(self.webpackChunkshopwp=self.webpackChunkshopwp||[]).push([["StorefrontOptions-public"],{"KM+y":function(e,t,n){"use strict";n.d(t,{Lh:function(){return f},Sf:function(){return S},fo:function(){return m}});var r=n("6lrK"),i=n.n(r),o=n("Zmzl"),s=n.n(o),a=(n("wHO6"),n("3mso")),l=n.n(a),c=(n("kn62"),n("+s+W")),p=n.n(c),u=n("dGr1");function d(e){return e.isSelected?i()([e.selectedValue],e.currentList):s()((t=e.currentList)?t.map((function(e){return p()(e)?e.includes("gid://")?e:String(e).toLowerCase():e})):[],e.selectedValue);var t}function f(e){var t=Object.keys(e);return l()(t)||(0,u.z)(e)?[]:t}function S(e,t){var n={};return n[e]=t,n}function m(e,t,n,r){for(var i in r)i!==t&&l()(r[i])&&delete r[i];if("collections"===t)for(var o in r)"collections"!==o&&delete r[o];else for(var s in r)"collections"===s&&delete r[s];if(!e)return d({currentList:r[t]});if(p()(e))if(e.includes("gid://"))var a=e;else a=String(e).toLowerCase();else a=e;return d({isSelected:n,currentList:r[t],selectedValue:a})}},"rem/":function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return x}});var r=n("3mso"),i=n.n(r),o=n("fYWZ"),s=n("5Ulf"),a=n("2MD/"),l=n("dGr1"),c=function(e,t){switch(t.type){case"SET_IS_BOOTSTRAPPING":return(0,l.kK)("isBootstrapping",t,e);case"SET_FILTER_OPTIONS":return(0,l.kK)("filterOptions",t,e);default:throw new Error("Unhandled action type: ".concat(t.type," in StorefrontOptionsReducer"))}},p=wp.element.createContext(),u=function(e){var t=wp.element.useReducer(c,(e.options,{isBootstrapping:!1,filterOptions:[]})),n=(0,a.Z)(t,2),r=n[0],i=n[1],o=wp.element.useMemo((function(){return[r,i]}),[r]);return React.createElement(p.Provider,(0,s.Z)({value:o},e))},d=n("LpH3"),f=n("U039"),S={name:"15smrxm-headingCSS",styles:"&&{font-size:18px;background-color:#eaeaea;margin:0;padding:10px 15px;border-radius:5px;};label:headingCSS;"},m=function(e){var t=e.dropzone,n=e.settings,r=S;return(0,f.vI)((0,d.tZ)("h2",{className:"wps-storefront-heading",css:r},n.filterByLabelText),document.querySelector(t))},g=wp.element.lazy((function(){return n.e("OptionCollections-public").then(n.bind(n,"8N3t"))})),w=wp.element.lazy((function(){return n.e("OptionTags-public").then(n.bind(n,"4/sW"))})),y=wp.element.lazy((function(){return n.e("OptionTypes-public").then(n.bind(n,"CHrE"))})),h=wp.element.lazy((function(){return n.e("OptionVendors-public").then(n.bind(n,"+fjq"))})),b=wp.element.lazy((function(){return n.e("OptionPrice-public").then(n.bind(n,"JwZi"))})),v={name:"1wy0xc7-StorefrontSidebarCSS",styles:"margin-bottom:200px;.wps-checkbox-wrapper{align-items:center;margin:0;padding:0 0 0 18px;&:hover{cursor:pointer;background-color:#f0f0f0;label,input{cursor:pointer;}}}.wps-input-value{opacity:1;margin:0;display:block;position:static;width:16px;height:16px;top:0;[disabled],[disabled]+label{opacity:0.5;&:hover{cursor:not-allowed;}}}.wps-input-label{display:flex;flex:1;padding:9px 0;span{flex:1;text-transform:capitalize;margin-bottom:0;margin-left:0;padding:0 0 0 10px;line-height:1;}};label:StorefrontSidebarCSS;"},E=wp.element.memo((function(e){var t=e.settings,n=e.dropzoneHeading,r=v;return(0,f.vI)((0,d.tZ)(React.Fragment,null,t.showOptionsHeading&&(0,d.tZ)(m,{settings:t,dropzone:n}),(0,d.tZ)("aside",{className:"wps-storefront-sidebar",css:r},t.showCollections&&(0,d.tZ)(g,{settings:t}),t.showPrice&&(0,d.tZ)(b,{settings:t}),t.showTags&&(0,d.tZ)(w,{settings:t}),t.showVendors&&(0,d.tZ)(h,{settings:t}),t.showTypes&&(0,d.tZ)(y,{settings:t}))),document.querySelector(t.dropzoneOptions))})),T=n("KM+y"),x=function(e){var t=e.settings,n=wp.element.useEffect,r=(0,o.f)(),s=(0,o.D)();return n((function(){if(!i()(r.lastSelected)){var e=(0,T.fo)(r.lastSelected.itemValue,r.lastSelected.itemType,r.lastSelected.isSelected,r.selections);s({type:"SET_SELECTIONS",payload:(0,T.Sf)(r.lastSelected.itemType,e)}),s({type:"SET_SELECTED_"+String(r.lastSelected.itemType).toUpperCase(),payload:e}),e.length?s({type:"SET_HAS_SELECTIONS",payload:!0}):s({type:"SET_HAS_SELECTIONS",payload:!1})}}),[r.lastSelected]),React.createElement(u,null,React.createElement(E,{settings:t,dropzoneHeading:t.dropzoneHeading}))}},wHO6:function(e,t,n){var r=n("njL+"),i=n("4Dcw"),o=n("aDkP"),s=n("aY3D"),a=o((function(e,t){return s(e)?r(e,i(t,1,s,!0)):[]}));e.exports=a},"6lrK":function(e,t,n){var r=n("4Dcw"),i=n("aDkP"),o=n("syN9"),s=n("aY3D"),a=i((function(e){return o(r(e,1,s,!0))}));e.exports=a}}]);