1"use strict";(self.webpackChunkshopwp=self.webpackChunkshopwp||[]).push([["StorefrontFilterOptionsGroupOption-public"],{"./npm-packages/@shopwp/components/src/storefront/options/group-items/index.jsx"(e,t,n){n.d(t,{A:()=>d});var s=n("./node_modules/memoize-one/dist/memoize-one.esm.js"),o=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),r=n("./node_modules/lodash-es/isEmpty.js"),i=n("./node_modules/lodash-es/some.js"),a=n("./npm-packages/@shopwp/components/src/storefront/_state/hooks.jsx");const l=function(e){var t=e.itemValue,n=e.itemType,s=e.storefrontDispatch,l=e.isLoading,c=e.initialSelections,p=wp.element,u=p.useState,m=p.useEffect,d=u((function(){var e=c[n];return!(!e||0===e.length)&&("collections"===n?e.filter((function(e){return e.label===t.label})).length:!!(e&&e.length&&t)&&e.includes(String(t).toLowerCase()))})),f=(0,o.A)(d,2),h=f[0],g=f[1],b="collections"===n?t.label:t,w=(0,a.z)();return m((function(){if((0,r.A)(w.selections)&&g(!1),(0,r.A)(w.selections[n])&&g(!1),"collections"===n)var e=(0,i.A)(w.selections[n],t);else e=w.selections[n]&&t&&w.selections[n].length?w.selections[n].includes(String(t).toLowerCase()):h;e||g(!1)}),[w.selections]),React.createElement("li",{"data-wps-is-selected":h,"data-wps-filter-value":b,"data-wps-display-style":"checkbox",className:"wps-checkbox-wrapper"},React.createElement("label",{className:"wps-input-label"},React.createElement("input",{type:"checkbox",onChange:function(){if(!l){var e={itemValue:t,itemType:n,isSelected:!h};g(!h),s({type:"SET_LAST_SELECTED",payload:e})}},disabled:l,checked:h?"checked":"",className:"wps-input-value"}),b&&React.createElement("span",null,b)))};var c=n("./npm-packages/@shopwp/components/src/items/_state/requests/hooks.jsx"),p=n("./node_modules/@tanstack/react-virtual/dist/esm/index.js"),u=wp.element.memo((function(e){var t=e.data,n=e.index,s=e.size,o=e.start,r=t.filterOptions,i=t.itemType,a=t.storefrontDispatch,c=t.isLoading,p=t.initialSelections,u=r[n];return React.createElement("ul",{style:{position:"absolute",top:0,left:0,width:"100%",height:"".concat(s,"px"),transform:"translateY(".concat(o,"px)"),listStyle:"none",margin:0,padding:0}},React.createElement(l,{itemType:i,itemValue:u,storefrontDispatch:a,isLoading:c,initialSelections:p}))})),m=(0,s.A)((function(e,t,n,s,o){return{filterOptions:e,itemType:t,storefrontDispatch:n,isLoading:s,initialSelections:o}}));const d=function(e){var t=e.filterOptions,n=e.itemType,s=(0,a.U)(),o=(0,a.z)(),r=(0,c.V)(),i=m(t,n,s,r.isFetchingNew,o.selections),l=wp.element.useRef(),d=(0,p.Te)({count:t.length,getScrollElement:function(){return l.current},estimateSize:wp.element.useCallback((function(){return 30}),[])});return React.createElement("ul",{className:"wps-"+n,ref:l,style:{height:"auto",width:"300px",overflow:"auto"}},React.createElement("li",{className:"ListInner",style:{height:"".concat(d.getTotalSize(),"px"),width:"100%",position:"relative",listStyle:"none",margin:0,padding:0}},d.getVirtualItems().map((function(e){return React.createElement(u,{key:e.key,data:i,index:e.index,size:e.size,start:e.start})}))))}},"./npm-packages/@shopwp/components/src/storefront/options/option/index.jsx"(e,t,n){n.r(t),n.d(t,{default:()=>f});var s=n("./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js"),o=n("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),r=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),i=n("./node_modules/@babel/runtime/regenerator/index.js"),a=n.n(i),l=n("./npm-packages/@shopwp/common/src/utils/index.jsx"),c=n("./node_modules/lodash-es/isObject.js"),p=n("./node_modules/lodash-es/isEmpty.js"),u=n("./npm-packages/@shopwp/api/src/errors/index.js"),m=n("./npm-packages/@shopwp/components/src/storefront/options/group-items/index.jsx"),d=wp.element.lazy((function(){return n.e("StorefrontFilterOptionsGroup-public").then(n.bind(n,"./npm-packages/@shopwp/components/src/storefront/options/group/index.jsx"))}));const f=function(e){var t=e.queryFn,n=e.groupType,i=e.heading,f=e.openOnLoad,h=void 0!==f&&f,g=e.filterName,b=void 0!==g&&g,w=e.noFilterGroupFoundText,y=e.shopState,x=wp.element,k=x.useState,j=x.useEffect,S=k(!0),E=(0,r.A)(S,2),A=E[0],v=E[1],T=k(!1),O=(0,r.A)(T,2),_=O[0],L=O[1],R=k(!1),F=(0,r.A)(R,2),z=F[0],C=F[1],N=k([]),D=(0,r.A)(N,2),G=D[0],V=D[1];function I(e){return q.apply(this,arguments)}function q(){return(q=(0,o.A)(a().mark((function e(n){var o,i,p,m,d,f,h,g,w,x,k,j;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h=function(e){return e.map((function(e){return(0,c.A)(e.node)?e.node[Object.keys(e.node)[0]]:e.node}))},f=function(e){return(0,s.A)(new Set(e))},n){e.next=1;break}return e.abrupt("return");case 1:if(!z){e.next=2;break}return V(z),e.abrupt("return");case 2:return v(!0),e.next=3,(0,l.to)(t(y));
1case 3:if(o=e.sent,i=(0,r.A)(o,2),p=i[0],m=i[1],v(!1),!p){e.next=4;break}return L(JSON.stringify(p)),e.abrupt("return");case 4:if(d=m[Object.keys(m)[0]],g=h(d.edges),w=g.filter(Boolean),x=f(w),d=x.sort(),v(!1),!(k=(0,u.FL)(p,m))){e.next=5;break}return L(k),e.abrupt("return");case 5:j=b?wp.hooks.applyFilters(b,d):d,C(j),V(j);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return j((function(){h&&I(h)}),[]),React.createElement(d,{onOpen:I,openOnLoad:h,error:_,isLoadingItems:A,groupType:n,noFilterGroupFoundText:w,areFilterOptionsEmpty:(0,p.A)(G),heading:i,items:React.createElement(m.A,{filterOptions:G,itemType:n})})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.