!function(e){function t(r){if(n[r])return n[r].exports;var l=n[r]={i:r,l:!1,exports:{}};return e[r].call(l.exports,l,l.exports,t),l.l=!0,l.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(1)},function(e,t,n){"use strict";var r=(n(2),n(3)),l=(n.n(r),n(4)),o=(n.n(l),wp.i18n.__),a=(wp.element.createElement,wp.blocks.registerBlockType),i=wp.editor.InspectorControls,s=wp.components,u=s.SelectControl,c=s.TextControl,p=(s.ToggleControl,s.RangeControl),g=s.PanelBody,b=s.ServerSideRender,m=(s.Placeholder,s.ButtonGroup,s.Button,s.Disabled);a("ninja-shop/store",{title:o("Ninja Shop Store"),icon:"cart",keywords:[o("ninja"),o("shop"),o("store")],category:"widgets",attributes:{style:{type:"string",default:"none"},category:{type:"string",default:""},columns:{type:"number",default:1},orderby:{type:"string",default:"order_number"},order:{type:"string",default:"DESC"},posts_per_page:{type:"number",default:10},tag:{type:"string",default:""}},edit:function(e){var t=e.attributes,n=t.posts_per_page,r=t.category,l=t.order,a=t.orderby,s=t.columns,d=t.style,f=t.tag,y=Array.isArray(ninjaShopBlocks.categories)||ninjaShopBlocks.categories.length?ninjaShopBlocks.categories.map(function(e){return{value:e.term_id,label:e.name}}):[];y.unshift({value:"",label:"Select a Category"});var h=Array.isArray(ninjaShopBlocks.tags)||ninjaShopBlocks.tags.length?ninjaShopBlocks.tags.map(function(e){return{value:e.term_id,label:e.name}}):[];return h.unshift({value:"",label:"Select a Tag"}),console.log("block: ",e.attributes),wp.element.createElement("div",null,wp.element.createElement(i,{key:"ninja-forms-selector-inspector-controls"},wp.element.createElement(g,{title:o("Store Page Settings")},wp.element.createElement(u,{label:o("Style Option"),value:d,options:[{value:"none",label:"None"},{value:"option-1",label:"Option 1"},{value:"option-2",label:"Option 2"}],onChange:function(t){return e.setAttributes({style:t})}}),Array.isArray(ninjaShopBlocks.categories)&&ninjaShopBlocks.categories.length>0&&wp.element.createElement(u,{multiple:!0,label:o("Product Category"),value:""!==r?JSON.parse(r):"",options:y,onChange:function(t){return e.setAttributes({category:""!==t?JSON.stringify(t):""})}}),Array.isArray(ninjaShopBlocks.tags)&&ninjaShopBlocks.tags.length>0&&wp.element.createElement(u,{multiple:!0,label:o("Product Tags"),value:""!==f?JSON.parse(f):"",options:h,onChange:function(t){return e.setAttributes({tag:""!==t?JSON.stringify(t):""})}}),wp.element.createElement(u,{label:o("Order by"),value:a,options:[{value:"menu_order",label:"Order Number"},{value:"title",label:"Alphabetical"},{value:"price",label:"Price"}],onChange:function(t){return e.setAttributes({orderby:t})}}),wp.element.createElement(u,{label:o("Order"),value:l,onChange:function(t){return e.setAttributes({order:t})},options:[{value:"ASC",label:"Ascending"},{value:"DESC",label:"Descending"}]}),wp.element.createElement(p,{label:o("Columns"),value:s,onChange:function(t){return e.setAttributes({columns:t})},min:1,max:6}),wp.element.createElement(c,{label:o("Number of Products To Show"),value:n,onChange:function(t){return e.setAttributes({posts_per_page:Number(t)})},type:"number"}))),wp.element.createElement(m,null,wp.element.createElement(b,{block:"ninja-shop/store",attributes:e.attributes})))},save:function(){return null}})},function(e,t,n){"use strict"},function(e,t){},function(e,t){}]);