OwlCyberSecurity - MANAGER
Edit File: handpicked-products.js
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["handpicked-products"]=function(e){function t(t){for(var c,l,i=t[0],s=t[1],a=t[2],d=0,b=[];d<i.length;d++)l=i[d],Object.prototype.hasOwnProperty.call(n,l)&&n[l]&&b.push(n[l][0]),n[l]=0;for(c in s)Object.prototype.hasOwnProperty.call(s,c)&&(e[c]=s[c]);for(u&&u(t);b.length;)b.shift()();return o.push.apply(o,a||[]),r()}function r(){for(var e,t=0;t<o.length;t++){for(var r=o[t],c=!0,i=1;i<r.length;i++){var s=r[i];0!==n[s]&&(c=!1)}c&&(o.splice(t--,1),e=l(l.s=r[0]))}return e}var c={},n={23:0},o=[];function l(t){if(c[t])return c[t].exports;var r=c[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,l),r.l=!0,r.exports}l.m=e,l.c=c,l.d=function(e,t,r){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(l.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)l.d(r,c,function(t){return e[t]}.bind(null,c));return r},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="";var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var a=0;a<i.length;a++)t(i[a]);var u=s;return o.push([568,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t){e.exports=window.wp.data},11:function(e,t){e.exports=window.wp.apiFetch},115:function(e,t){},116:function(e,t){e.exports=window.wp.coreData},119:function(e,t,r){"use strict";var c=r(0),n=r(1),o=r(4);r(2),t.a=e=>{let{value:t,setAttributes:r}=e;return Object(c.createElement)(o.SelectControl,{label:Object(n.__)("Order products by",'woocommerce'),value:t,options:[{label:Object(n.__)("Newness - newest first",'woocommerce'),value:"date"},{label:Object(n.__)("Price - low to high",'woocommerce'),value:"price_asc"},{label:Object(n.__)("Price - high to low",'woocommerce'),value:"price_desc"},{label:Object(n.__)("Rating - highest first",'woocommerce'),value:"rating"},{label:Object(n.__)("Sales - most first",'woocommerce'),value:"popularity"},{label:Object(n.__)("Title - alphabetical",'woocommerce'),value:"title"},{label:Object(n.__)("Menu Order",'woocommerce'),value:"menu_order"}],onChange:e=>r({orderby:e})})}},12:function(e,t){e.exports=window.wp.compose},13:function(e,t){e.exports=window.wp.url},14:function(e,t){e.exports=window.wp.blocks},172:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var c=r(0);const n=Object(c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},Object(c.createElement)("title",null,"Grid Block Preview"),Object(c.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(c.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(c.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(c.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(c.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(c.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(c.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(c.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(c.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(c.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(c.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(c.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(c.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}))},18:function(e,t){e.exports=window.wp.primitives},20:function(e,t){e.exports=window.wp.htmlEntities},21:function(e,t){e.exports=window.moment},273:function(e,t,r){"use strict";var c=r(7),n=r.n(c),o=r(0),l=r(32),i=r(34),s=r(165),a=r(35);t.a=e=>t=>{let{selected:r,...c}=t;const[u,d]=Object(o.useState)(!0),[b,p]=Object(o.useState)(null),[g,h]=Object(o.useState)([]),E=l.o.productCount>100,w=async e=>{const t=await Object(a.a)(e);p(t),d(!1)},O=Object(o.useRef)(r);Object(o.useEffect)(()=>{Object(i.h)({selected:O.current}).then(e=>{h(e),d(!1)}).catch(w)},[O]);const m=Object(s.a)(e=>{Object(i.h)({selected:r,search:e}).then(e=>{h(e),d(!1)}).catch(w)},400),f=Object(o.useCallback)(e=>{d(!0),m(e)},[d,m]);return Object(o.createElement)(e,n()({},c,{selected:r,error:b,products:g,isLoading:u,onSearch:E?f:null}))}},3:function(e,t){e.exports=window.wc.wcSettings},30:function(e,t){e.exports=window.wp.dataControls},32:function(e,t,r){"use strict";r.d(t,"o",(function(){return o})),r.d(t,"m",(function(){return l})),r.d(t,"l",(function(){return i})),r.d(t,"n",(function(){return s})),r.d(t,"j",(function(){return a})),r.d(t,"e",(function(){return u})),r.d(t,"f",(function(){return d})),r.d(t,"g",(function(){return b})),r.d(t,"k",(function(){return p})),r.d(t,"c",(function(){return g})),r.d(t,"d",(function(){return h})),r.d(t,"h",(function(){return E})),r.d(t,"a",(function(){return w})),r.d(t,"i",(function(){return O})),r.d(t,"b",(function(){return m}));var c,n=r(3);const o=Object(n.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),l=o.pluginUrl+"images/",i=o.pluginUrl+"build/",s=o.buildPhase,a=null===(c=n.STORE_PAGES.shop)||void 0===c?void 0:c.permalink,u=n.STORE_PAGES.checkout.id,d=n.STORE_PAGES.checkout.permalink,b=n.STORE_PAGES.privacy.permalink,p=(n.STORE_PAGES.privacy.title,n.STORE_PAGES.terms.permalink),g=(n.STORE_PAGES.terms.title,n.STORE_PAGES.cart.id),h=n.STORE_PAGES.cart.permalink,E=(n.STORE_PAGES.myaccount.permalink?n.STORE_PAGES.myaccount.permalink:Object(n.getSetting)("wpLoginUrl","/wp-login.php"),Object(n.getSetting)("shippingCountries",{})),w=Object(n.getSetting)("allowedCountries",{}),O=Object(n.getSetting)("shippingStates",{}),m=Object(n.getSetting)("allowedStates",{})},34:function(e,t,r){"use strict";r.d(t,"h",(function(){return a})),r.d(t,"e",(function(){return u})),r.d(t,"b",(function(){return d})),r.d(t,"i",(function(){return b})),r.d(t,"f",(function(){return p})),r.d(t,"c",(function(){return g})),r.d(t,"d",(function(){return h})),r.d(t,"g",(function(){return E})),r.d(t,"a",(function(){return w}));var c=r(13),n=r(11),o=r.n(n),l=r(6),i=r(3),s=r(32);const a=e=>{let{selected:t=[],search:r="",queryArgs:n={}}=e;const i=(e=>{let{selected:t=[],search:r="",queryArgs:n={}}=e;const o=s.o.productCount>100,l={per_page:o?100:0,catalog_visibility:"any",search:r,orderby:"title",order:"asc"},i=[Object(c.addQueryArgs)("/wc/store/products",{...l,...n})];return o&&t.length&&i.push(Object(c.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:t,per_page:0})),i})({selected:t,search:r,queryArgs:n});return Promise.all(i.map(e=>o()({path:e}))).then(e=>Object(l.uniqBy)(Object(l.flatten)(e),"id").map(e=>({...e,parent:0}))).catch(e=>{throw e})},u=e=>o()({path:"/wc/store/products/"+e}),d=()=>o()({path:"wc/store/products/attributes"}),b=e=>o()({path:`wc/store/products/attributes/${e}/terms`}),p=e=>{let{selected:t=[],search:r}=e;const n=(e=>{let{selected:t=[],search:r}=e;const n=Object(i.getSetting)("limitTags",!1),o=[Object(c.addQueryArgs)("wc/store/products/tags",{per_page:n?100:0,orderby:n?"count":"name",order:n?"desc":"asc",search:r})];return n&&t.length&&o.push(Object(c.addQueryArgs)("wc/store/products/tags",{include:t})),o})({selected:t,search:r});return Promise.all(n.map(e=>o()({path:e}))).then(e=>Object(l.uniqBy)(Object(l.flatten)(e),"id"))},g=e=>o()({path:Object(c.addQueryArgs)("wc/store/products/categories",{per_page:0,...e})}),h=e=>o()({path:"wc/store/products/categories/"+e}),E=e=>o()({path:Object(c.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})}),w=(e,t)=>{if(!e.title.raw)return e.slug;const r=1===t.filter(t=>t.title.raw===e.title.raw).length;return e.title.raw+(r?"":" - "+e.slug)}},35:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return o}));var c=r(1);const n=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},o=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(c.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},38:function(e,t){e.exports=window.wp.keycodes},39:function(e,t){e.exports=window.wp.escapeHtml},4:function(e,t){e.exports=window.wp.components},41:function(e,t,r){"use strict";var c=r(0),n=r(1),o=r(39);t.a=e=>{let{error:t}=e;return Object(c.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:r}=e;return t?"general"===r?Object(c.createElement)("span",null,Object(n.__)("The following error was returned",'woocommerce'),Object(c.createElement)("br",null),Object(c.createElement)("code",null,Object(o.escapeHTML)(t))):"api"===r?Object(c.createElement)("span",null,Object(n.__)("The following error was returned from the API",'woocommerce'),Object(c.createElement)("br",null),Object(c.createElement)("code",null,Object(o.escapeHTML)(t))):t:Object(n.__)("An unknown error occurred which prevented the block from being updated.",'woocommerce')})(t))}},45:function(e,t){e.exports=window.wp.hooks},51:function(e,t){e.exports=window.wp.deprecated},55:function(e,t,r){"use strict";var c=r(0);t.a=function(e){let{srcElement:t,size:r=24,...n}=e;return Object(c.isValidElement)(t)?Object(c.cloneElement)(t,{width:r,height:r,...n}):null}},568:function(e,t,r){e.exports=r(859)},569:function(e,t){},6:function(e,t){e.exports=window.lodash},61:function(e,t){e.exports=window.wp.dom},64:function(e,t){e.exports=window.regeneratorRuntime},76:function(e,t){e.exports=window.wp.serverSideRender},79:function(e,t){e.exports=window.ReactDOM},8:function(e,t){e.exports=window.React},82:function(e,t){e.exports=window.wp.viewport},84:function(e,t,r){"use strict";var c=r(0),n=r(1),o=(r(2),r(4));t.a=e=>{let{onChange:t,settings:r}=e;const{button:l,price:i,rating:s,title:a}=r;return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(o.ToggleControl,{label:Object(n.__)("Product title",'woocommerce'),help:a?Object(n.__)("Product title is visible.",'woocommerce'):Object(n.__)("Product title is hidden.",'woocommerce'),checked:a,onChange:()=>t({...r,title:!a})}),Object(c.createElement)(o.ToggleControl,{label:Object(n.__)("Product price",'woocommerce'),help:i?Object(n.__)("Product price is visible.",'woocommerce'):Object(n.__)("Product price is hidden.",'woocommerce'),checked:i,onChange:()=>t({...r,price:!i})}),Object(c.createElement)(o.ToggleControl,{label:Object(n.__)("Product rating",'woocommerce'),help:s?Object(n.__)("Product rating is visible.",'woocommerce'):Object(n.__)("Product rating is hidden.",'woocommerce'),checked:s,onChange:()=>t({...r,rating:!s})}),Object(c.createElement)(o.ToggleControl,{label:Object(n.__)("Add to Cart button",'woocommerce'),help:l?Object(n.__)("Add to Cart button is visible.",'woocommerce'):Object(n.__)("Add to Cart button is hidden.",'woocommerce'),checked:l,onChange:()=>t({...r,button:!l})}))}},859:function(e,t,r){"use strict";r.r(t);var c=r(0),n=r(1),o=r(14),l=r(3),i=r(55),s=r(18),a=Object(c.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(c.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(c.createElement)("path",{d:"M16.66 4.52l2.83 2.83-2.83 2.83-2.83-2.83 2.83-2.83M9 5v4H5V5h4m10 10v4h-4v-4h4M9 15v4H5v-4h4m7.66-13.31L11 7.34 16.66 13l5.66-5.66-5.66-5.65zM11 3H3v8h8V3zm10 10h-8v8h8v-8zm-10 0H3v8h8v-8z"})),u=(r(569),r(9)),d=r(76),b=r.n(d),p=r(4),g=(r(2),r(84)),h=r(40),E=r(273),w=r(41);const O=e=>{let{error:t,onChange:r,onSearch:o,selected:l,products:i,isLoading:s,isCompact:a}=e;const u={clear:Object(n.__)("Clear all products",'woocommerce'),list:Object(n.__)("Products",'woocommerce'),noItems:Object(n.__)("Your store doesn't have any products.",'woocommerce'),search:Object(n.__)("Search for products to display",'woocommerce'),selected:e=>Object(n.sprintf)( /* translators: %d is the number of selected products. */ Object(n._n)("%d product selected","%d products selected",e,'woocommerce'),e),updated:Object(n.__)("Product search results updated.",'woocommerce')};return t?Object(c.createElement)(w.a,{error:t}):Object(c.createElement)(h.b,{className:"woocommerce-products",list:i.map(e=>{const t=e.sku?" ("+e.sku+")":"";return{...e,name:`${e.name}${t}`}}),isCompact:a,isLoading:s,selected:i.filter(e=>{let{id:t}=e;return l.includes(t)}),onSearch:o,onChange:r,messages:u})};O.defaultProps={selected:[],products:[],isCompact:!1,isLoading:!0};var m=Object(E.a)(O),f=r(119),j=r(172);class x extends c.Component{getInspectorControls(){const{attributes:e,setAttributes:t}=this.props,{columns:r,contentVisibility:o,orderby:i,alignButtons:s}=e;return Object(c.createElement)(u.InspectorControls,{key:"inspector"},Object(c.createElement)(p.PanelBody,{title:Object(n.__)("Layout",'woocommerce'),initialOpen:!0},Object(c.createElement)(p.RangeControl,{label:Object(n.__)("Columns",'woocommerce'),value:r,onChange:e=>t({columns:e}),min:Object(l.getSetting)("min_columns",1),max:Object(l.getSetting)("max_columns",6)}),Object(c.createElement)(p.ToggleControl,{label:Object(n.__)("Align Buttons",'woocommerce'),help:s?Object(n.__)("Buttons are aligned vertically.",'woocommerce'):Object(n.__)("Buttons follow content.",'woocommerce'),checked:s,onChange:()=>t({alignButtons:!s})})),Object(c.createElement)(p.PanelBody,{title:Object(n.__)("Content",'woocommerce'),initialOpen:!0},Object(c.createElement)(g.a,{settings:o,onChange:e=>t({contentVisibility:e})})),Object(c.createElement)(p.PanelBody,{title:Object(n.__)("Order By",'woocommerce'),initialOpen:!1},Object(c.createElement)(f.a,{setAttributes:t,value:i})),Object(c.createElement)(p.PanelBody,{title:Object(n.__)("Products",'woocommerce'),initialOpen:!1},Object(c.createElement)(m,{selected:e.products,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const r=e.map(e=>{let{id:t}=e;return t});t({products:r})},isCompact:!0})))}renderEditMode(){const{attributes:e,debouncedSpeak:t,setAttributes:r}=this.props;return Object(c.createElement)(p.Placeholder,{icon:Object(c.createElement)(i.a,{srcElement:a}),label:Object(n.__)("Hand-picked Products",'woocommerce'),className:"wc-block-products-grid wc-block-handpicked-products"},Object(n.__)("Display a selection of hand-picked products in a grid.",'woocommerce'),Object(c.createElement)("div",{className:"wc-block-handpicked-products__selection"},Object(c.createElement)(m,{selected:e.products,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=e.map(e=>{let{id:t}=e;return t});r({products:t})}}),Object(c.createElement)(p.Button,{isPrimary:!0,onClick:()=>{r({editMode:!1}),t(Object(n.__)("Showing Hand-picked Products block preview.",'woocommerce'))}},Object(n.__)("Done",'woocommerce'))))}render(){const{attributes:e,name:t,setAttributes:r}=this.props,{editMode:o}=e;return e.isPreview?j.a:Object(c.createElement)(c.Fragment,null,Object(c.createElement)(u.BlockControls,null,Object(c.createElement)(p.ToolbarGroup,{controls:[{icon:"edit",title:Object(n.__)("Edit selected products",'woocommerce'),onClick:()=>r({editMode:!o}),isActive:o}]})),this.getInspectorControls(),o?this.renderEditMode():Object(c.createElement)(p.Disabled,null,Object(c.createElement)(b.a,{block:t,attributes:e})))}}var y=Object(p.withSpokenMessages)(x);Object(o.registerBlockType)("woocommerce/handpicked-products",{title:Object(n.__)("Hand-picked Products",'woocommerce'),icon:{src:Object(c.createElement)(i.a,{srcElement:a}),foreground:"#7f54b3"},category:"woocommerce",keywords:[Object(n.__)("Handpicked Products",'woocommerce'),Object(n.__)("WooCommerce",'woocommerce')],description:Object(n.__)("Display a selection of hand-picked products in a grid.",'woocommerce'),supports:{align:["wide","full"],html:!1},example:{attributes:{isPreview:!0}},attributes:{align:{type:"string"},columns:{type:"number",default:Object(l.getSetting)("default_columns",3)},editMode:{type:"boolean",default:!0},contentVisibility:{type:"object",default:{title:!0,price:!0,rating:!0,button:!0}},orderby:{type:"string",default:"date"},products:{type:"array",default:[]},alignButtons:{type:"boolean",default:!1},isPreview:{type:"boolean",default:!1}},edit:e=>Object(c.createElement)(y,e),save:()=>null})},89:function(e,t){e.exports=window.wp.date},9:function(e,t){e.exports=window.wp.blockEditor}});