this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["attribute-filter"]=function(e){function t(t){for(var c,l,a=t[0],s=t[1],i=t[2],b=0,d=[];b<a.length;b++)l=a[b],Object.prototype.hasOwnProperty.call(r,l)&&r[l]&&d.push(r[l][0]),r[l]=0;for(c in s)Object.prototype.hasOwnProperty.call(s,c)&&(e[c]=s[c]);for(u&&u(t);d.length;)d.shift()();return o.push.apply(o,i||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],c=!0,a=1;a<n.length;a++){var s=n[a];0!==r[s]&&(c=!1)}c&&(o.splice(t--,1),e=l(l.s=n[0]))}return e}var c={},r={8:0,1:0},o=[];function l(t){if(c[t])return c[t].exports;var n=c[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,l),n.l=!0,n.exports}l.m=e,l.c=c,l.d=function(e,t,n){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},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 n=Object.create(null);if(l.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)l.d(n,c,function(t){return e[t]}.bind(null,c));return n},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 a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=a.push.bind(a);a.push=t,a=a.slice();for(var i=0;i<a.length;i++)t(a[i]);var u=s;return o.push([381,0]),n()}({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.wc.wcBlocksData},100:function(e,t,n){"use strict";n.d(t,"a",(function(){return E}));var c=n(6),r=n.n(c),o=n(0),l=n(1),a=n(3),s=n(80),i=n(535),u=n(4),b=n.n(u),d=n(12),m=n(19),p=n(38),g=n(534),O=n(18);const j=e=>{let{id:t,label:n,popoverContents:c,remove:r,screenReaderLabel:i,className:u=""}=e;const[m,p]=Object(o.useState)(!1),f=Object(d.useInstanceId)(j);if(i=i||n,!n)return null;n=Object(O.decodeEntities)(n);const h=b()("woocommerce-tag",u,{"has-remove":!!r}),w="woocommerce-tag__label-"+f,_=Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},i),Object(o.createElement)("span",{"aria-hidden":"true"},n));return Object(o.createElement)("span",{className:h},c?Object(o.createElement)(a.Button,{className:"woocommerce-tag__text",id:w,onClick:()=>p(!0)},_):Object(o.createElement)("span",{className:"woocommerce-tag__text",id:w},_),c&&m&&Object(o.createElement)(a.Popover,{onClose:()=>p(!1)},c),r&&Object(o.createElement)(a.Button,{className:"woocommerce-tag__remove",onClick:r(t),label:Object(l.sprintf)(// Translators: %s label.
Object(l.__)("Remove %s","woocommerce"),n),"aria-describedby":w},Object(o.createElement)(s.a,{icon:g.a,size:20,className:"clear-icon"})))};var f=j;const h=e=>Object(o.createElement)(p.b,e),w=e=>{const{list:t,selected:n,renderItem:c,depth:l=0,onSelect:a,instanceId:s,isSingle:i,search:u}=e;return t?Object(o.createElement)(o.Fragment,null,t.map(t=>{const b=-1!==n.findIndex(e=>{let{id:n}=e;return n===t.id});return Object(o.createElement)(o.Fragment,{key:t.id},Object(o.createElement)("li",null,c({item:t,isSelected:b,onSelect:a,isSingle:i,search:u,depth:l,controlId:s})),Object(o.createElement)(w,r()({},e,{list:t.children,depth:l+1})))})):null},_=e=>{let{isLoading:t,isSingle:n,selected:c,messages:r,onChange:s,onRemove:i}=e;if(t||n||!c)return null;const u=c.length;return Object(o.createElement)("div",{className:"woocommerce-search-list__selected"},Object(o.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(o.createElement)("strong",null,r.selected(u)),u>0?Object(o.createElement)(a.Button,{isLink:!0,isDestructive:!0,onClick:()=>s([]),"aria-label":r.clear},Object(l.__)("Clear all","woocommerce")):null),u>0?Object(o.createElement)("ul",null,c.map((e,t)=>Object(o.createElement)("li",{key:t},Object(o.createElement)(f,{label:e.name,id:e.id,remove:i})))):null)},y=e=>{let{filteredList:t,search:n,onSelect:c,instanceId:r,...a}=e;const{messages:u,renderItem:b,selected:d,isSingle:m}=a,p=b||h;return 0===t.length?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(o.createElement)(s.a,{icon:i.a})),Object(o.createElement)("span",{className:"woocommerce-search-list__not-found-text"},n?Object(l.sprintf)(u.noResults,n):u.noItems)):Object(o.createElement)("ul",{className:"woocommerce-search-list__list"},Object(o.createElement)(w,{list:t,selected:d,renderItem:p,onSelect:c,instanceId:r,isSingle:m,search:n}))},E=e=>{const{className:t="",isCompact:n,isHierarchical:c,isLoading:l,isSingle:s,list:i,messages:u=m.a,onChange:p,onSearch:g,selected:O,debouncedSpeak:j}=e,[f,h]=Object(o.useState)(""),w=Object(d.useInstanceId)(E),k=Object(o.useMemo)(()=>({...m.a,...u}),[u]),v=Object(o.useMemo)(()=>Object(m.c)(i,f,c),[i,f,c]);Object(o.useEffect)(()=>{j&&j(k.updated)},[j,k]),Object(o.useEffect)(()=>{"function"==typeof g&&g(f)},[f,g]);const S=Object(o.useCallback)(e=>()=>{s&&p([]);const t=O.findIndex(t=>{let{id:n}=t;return n===e});p([...O.slice(0,t),...O.slice(t+1)])},[s,O,p]),C=Object(o.useCallback)(e=>()=>{-1===O.findIndex(t=>{let{id:n}=t;return n===e.id})?p(s?[e]:[...O,e]):S(e.id)()},[s,S,p,O]);return Object(o.createElement)("div",{className:b()("woocommerce-search-list",t,{"is-compact":n})},Object(o.createElement)(_,r()({},e,{onRemove:S,messages:k})),Object(o.createElement)("div",{className:"woocommerce-search-list__search"},Object(o.createElement)(a.TextControl,{label:k.search,type:"search",value:f,onChange:e=>h(e)})),l?Object(o.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(o.createElement)(a.Spinner,null)):Object(o.createElement)(y,r()({},e,{search:f,filteredList:v,messages:k,onSelect:C,instanceId:w})))};Object(a.withSpokenMessages)(E)},101:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var c=n(0);const r=Object(c.createContext)({}),o=()=>{const{wrapper:e}=Object(c.useContext)(r);return t=>{e&&e.current&&(e.current.hidden=!t)}}},103:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var c=n(13);function r(e,t){const n=Object(c.useRef)();return Object(c.useEffect)(()=>{n.current===e||t&&!t(e,n.current)||(n.current=e)},[e,t]),n.current}},106:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var c=n(10),r=n(7),o=n(0),l=n(42);const a=e=>{const{namespace:t,resourceName:n,resourceValues:a=[],query:s={},shouldSelect:i=!0}=e;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");const u=Object(o.useRef)({results:[],isLoading:!0}),b=Object(l.a)(s),d=Object(l.a)(a),m=(()=>{const[,e]=Object(o.useState)();return Object(o.useCallback)(t=>{e(()=>{throw t})},[])})(),p=Object(r.useSelect)(e=>{if(!i)return null;const r=e(c.COLLECTIONS_STORE_KEY),o=[t,n,b,d],l=r.getCollectionError(...o);if(l){if(!(l instanceof Error))throw new Error("TypeError: `error` object is not an instance of Error constructor");m(l)}return{results:r.getCollection(...o),isLoading:!r.hasFinishedResolution("getCollection",o)}},[t,n,d,b,i]);return null!==p&&(u.current=p),u.current}},11:function(e,t){e.exports=window.wp.primitives},111:function(e,t,n){"use strict";var c=n(0),r=n(1),o=n(30);n(263),t.a=e=>{let{name:t,count:n}=e;return Object(c.createElement)(c.Fragment,null,t,null!==n&&Number.isFinite(n)&&Object(c.createElement)(o.a,{label:n.toString(),screenReaderLabel:Object(r.sprintf)(
/* translators: %s number of products. */
Object(r._n)("%s product","%s products",n,"woocommerce"),n),wrapperElement:"span",wrapperProps:{className:"wc-filter-element-label-list-count"}}))}},12:function(e,t){e.exports=window.wp.compose},121:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var c=n(0),r=n(1),o=n(9),l=n(7),a=n(3),s=n(5);const i=e=>{let{clientId:t,setAttributes:n,filterType:i,attributes:u}=e;const{replaceBlock:b}=Object(l.useDispatch)("core/block-editor"),{heading:d,headingLevel:m}=u;if(Object(l.useSelect)(e=>{const{getBlockParentsByBlockName:n}=e("core/block-editor");return n(t,"woocommerce/filter-wrapper").length>0},[t])||!i)return null;const p=[Object(c.createElement)(a.Button,{key:"convert",onClick:()=>{const e=[Object(o.createBlock)("woocommerce/"+i,{...u,heading:""})];d&&""!==d&&e.unshift(Object(o.createBlock)("core/heading",{content:d,level:null!=m?m:2})),b(t,Object(o.createBlock)("woocommerce/filter-wrapper",{heading:d,filterType:i},[...e])),n({heading:"",lock:{remove:!0}})},variant:"primary"},Object(r.__)("Upgrade block","woocommerce"))];return Object(c.createElement)(s.Warning,{actions:p},Object(r.__)("Filter block: We have improved this block to make styling easier. Upgrade it using the button below.","woocommerce"))}},122:function(e,t,n){"use strict";var c=n(0),r=n(5),o=n(12),l=n(1);n(161),t.a=Object(o.withInstanceId)(e=>{let{className:t,headingLevel:n,onChange:o,heading:a,instanceId:s}=e;const i="h"+n;return Object(c.createElement)(i,{className:t},Object(c.createElement)("label",{className:"screen-reader-text",htmlFor:"block-title-"+s},Object(l.__)("Block title","woocommerce")),Object(c.createElement)(r.PlainText,{id:"block-title-"+s,className:"wc-block-editor-components-title",value:a,onChange:o,style:{backgroundColor:"transparent"}}))})},123:function(e,t,n){"use strict";var c=n(0);n(162),t.a=e=>{let{children:t}=e;return Object(c.createElement)("div",{className:"wc-block-filter-title-placeholder"},t)}},125:function(e,t,n){"use strict";var c=n(0),r=n(1),o=n(4),l=n.n(o),a=n(30);n(165),t.a=e=>{let{className:t,label:
/* translators: Reset button text for filters. */
n=Object(r.__)("Reset","woocommerce"),onClick:o,screenReaderLabel:s=Object(r.__)("Reset filter","woocommerce")}=e;return Object(c.createElement)("button",{className:l()("wc-block-components-filter-reset-button",t),onClick:o},Object(c.createElement)(a.a,{label:n,screenReaderLabel:s}))}},126:function(e,t,n){"use strict";var c=n(0),r=n(1),o=n(4),l=n.n(o),a=n(30);n(166),t.a=e=>{let{className:t,isLoading:n,disabled:o,label:
/* translators: Submit button text for filters. */
s=Object(r.__)("Apply","woocommerce"),onClick:i,screenReaderLabel:u=Object(r.__)("Apply filter","woocommerce")}=e;return Object(c.createElement)("button",{type:"submit",className:l()("wp-block-button__link","wc-block-filter-submit-button","wc-block-components-filter-submit-button",{"is-loading":n},t),disabled:o,onClick:i},Object(c.createElement)(a.a,{label:s,screenReaderLabel:u}))}},127:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));const c=e=>"boolean"==typeof e},13:function(e,t){e.exports=window.React},132:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var c=n(5),r=n(55),o=n(32),l=n(98);const a=e=>{if(!Object(r.b)())return{className:"",style:{}};const t=Object(o.b)(e)?e:{},n=Object(l.a)(t.style);return Object(c.__experimentalUseBorderProps)({...t,style:n})}},14:function(e,t){e.exports=window.wc.blocksCheckout},147:function(e){e.exports=JSON.parse('{"name":"woocommerce/attribute-filter","version":"1.0.0","title":"Filter by Attribute Controls","description":"Enable customers to filter the product grid by selecting one or more attributes, such as color.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"html":false,"color":{"text":true,"background":false},"inserter":false,"lock":false},"attributes":{"className":{"type":"string","default":""},"attributeId":{"type":"number","default":0},"showCounts":{"type":"boolean","default":true},"queryType":{"type":"string","default":"or"},"headingLevel":{"type":"number","default":3},"displayStyle":{"type":"string","default":"list"},"showFilterButton":{"type":"boolean","default":false},"selectType":{"type":"string","default":"multiple"},"isPreview":{"type":"boolean","default":false}},"textdomain":"woocommerce","apiVersion":2,"$schema":"https://schemas.wp.org/trunk/block.json"}')},153:function(e,t,n){"use strict";var c=n(6),r=n.n(c),o=n(0),l=n(305),a=n(4),s=n.n(a);n(193),t.a=e=>{let{className:t,style:n,suggestions:c,multiple:a=!0,saveTransform:i=(e=>e.trim().replace(/\s/g,"-")),messages:u={},validateInput:b=(e=>c.includes(e)),label:d="",...m}=e;return Object(o.createElement)("div",{className:s()("wc-blocks-components-form-token-field-wrapper",t,{"single-selection":!a}),style:n},Object(o.createElement)(l.a,r()({label:d,__experimentalExpandOnFocus:!0,__experimentalShowHowTo:!1,__experimentalValidateInput:b,saveTransform:i,maxLength:a?void 0:1,suggestions:c,messages:u},m)))}},154:function(e,t,n){"use strict";var c=n(0),r=n(1),o=n(4),l=n.n(o),a=n(14);n(194),t.a=e=>{let{className:t,onChange:n,options:o=[],checked:s=[],isLoading:i=!1,isDisabled:u=!1,limit:b=10}=e;const[d,m]=Object(c.useState)(!1),p=Object(c.useMemo)(()=>[...Array(5)].map((e,t)=>Object(c.createElement)("li",{key:t,style:{width:Math.floor(75*Math.random())+25+"%"}})),[]),g=Object(c.useMemo)(()=>{const e=o.length-b;return!d&&Object(c.createElement)("li",{key:"show-more",className:"show-more"},Object(c.createElement)("button",{onClick:()=>{m(!0)},"aria-expanded":!1,"aria-label":Object(r.sprintf)(
/* translators: %s is referring the remaining count of options */
Object(r._n)("Show %s more option","Show %s more options",e,"woocommerce"),e)},Object(r.sprintf)(
/* translators: %s number of options to reveal. */
Object(r._n)("Show %s more","Show %s more",e,"woocommerce"),e)))},[o,b,d]),O=Object(c.useMemo)(()=>d&&Object(c.createElement)("li",{key:"show-less",className:"show-less"},Object(c.createElement)("button",{onClick:()=>{m(!1)},"aria-expanded":!0,"aria-label":Object(r.__)("Show less options","woocommerce")},Object(r.__)("Show less","woocommerce"))),[d]),j=Object(c.useMemo)(()=>{const e=o.length>b+5;return Object(c.createElement)(c.Fragment,null,o.map((t,r)=>Object(c.createElement)(c.Fragment,{key:t.value},Object(c.createElement)("li",e&&!d&&r>=b&&{hidden:!0},Object(c.createElement)(a.CheckboxControl,{id:t.value,className:"wc-block-checkbox-list__checkbox",label:t.label,checked:s.includes(t.value),onChange:()=>{n(t.value)},disabled:u})),e&&r===b-1&&g)),e&&O)},[o,n,s,d,b,O,g,u]),f=l()("wc-block-checkbox-list","wc-block-components-checkbox-list",{"is-loading":i},t);return Object(c.createElement)("ul",{className:f},i?p:j)}},161:function(e,t){},162:function(e,t){},165:function(e,t){},166:function(e,t){},17:function(e,t){e.exports=window.wp.url},175:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o}));var c=n(8);const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const o=e.filter(e=>e.attribute===n.taxonomy),l=o.length?o[0]:null;if(!(l&&l.slug&&Array.isArray(l.slug)&&l.slug.includes(r)))return;const a=l.slug.filter(e=>e!==r),s=e.filter(e=>e.attribute!==n.taxonomy);a.length>0&&(l.slug=a.sort(),s.push(l)),t(Object(c.sortBy)(s,"attribute"))},o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in";if(!n||!n.taxonomy)return[];const l=e.filter(e=>e.attribute!==n.taxonomy);return 0===r.length?t(l):(l.push({attribute:n.taxonomy,operator:o,slug:r.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(c.sortBy)(l,"attribute"))),l}},18:function(e,t){e.exports=window.wp.htmlEntities},19:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return i})),n.d(t,"b",(function(){return u}));var c=n(0),r=n(8),o=n(1);const l={clear:Object(o.__)("Clear all selected items","woocommerce"),noItems:Object(o.__)("No items found.","woocommerce"),
/* Translators: %s search term */
noResults:Object(o.__)("No results for %s","woocommerce"),search:Object(o.__)("Search for items","woocommerce"),selected:e=>Object(o.sprintf)(
/* translators: Number of items selected from list. */
Object(o._n)("%d item selected","%d items selected",e,"woocommerce"),e),updated:Object(o.__)("Search results updated.","woocommerce")},a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const n=Object(r.groupBy)(e,"parent"),c=Object(r.keyBy)(t,"id"),o=["0"],l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.parent)return e.name?[e.name]:[];const t=l(c[e.parent]);return[...t,e.name]},a=e=>e.map(e=>{const t=n[e.id];return o.push(""+e.id),{...e,breadcrumbs:l(c[e.parent]),children:t&&t.length?a(t):[]}}),s=a(n[0]||[]);return Object.entries(n).forEach(e=>{let[t,n]=e;o.includes(t)||s.push(...a(n||[]))}),s},s=(e,t,n)=>{if(!t)return n?a(e):e;const c=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),r=e.map(e=>!!c.test(e.name)&&e).filter(Boolean);return n?a(r,e):r},i=(e,t)=>{if(!t)return e;const n=new RegExp(`(${t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")})`,"ig");return e.split(n).map((e,t)=>n.test(e)?Object(c.createElement)("strong",{key:t},e):Object(c.createElement)(c.Fragment,{key:t},e))},u=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},193:function(e,t){},194:function(e,t){},2:function(e,t){e.exports=window.wc.wcSettings},20:function(e,t,n){"use strict";n.d(t,"o",(function(){return o})),n.d(t,"m",(function(){return l})),n.d(t,"l",(function(){return a})),n.d(t,"n",(function(){return s})),n.d(t,"j",(function(){return i})),n.d(t,"e",(function(){return u})),n.d(t,"g",(function(){return b})),n.d(t,"k",(function(){return d})),n.d(t,"c",(function(){return m})),n.d(t,"d",(function(){return p})),n.d(t,"h",(function(){return g})),n.d(t,"a",(function(){return O})),n.d(t,"i",(function(){return j})),n.d(t,"b",(function(){return f})),n.d(t,"f",(function(){return h}));var c,r=n(2);const o=Object(r.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),l=o.pluginUrl+"images/",a=o.pluginUrl+"build/",s=o.buildPhase,i=null===(c=r.STORE_PAGES.shop)||void 0===c?void 0:c.permalink,u=r.STORE_PAGES.checkout.id,b=(r.STORE_PAGES.checkout.permalink,r.STORE_PAGES.privacy.permalink),d=(r.STORE_PAGES.privacy.title,r.STORE_PAGES.terms.permalink),m=(r.STORE_PAGES.terms.title,r.STORE_PAGES.cart.id),p=r.STORE_PAGES.cart.permalink,g=(r.STORE_PAGES.myaccount.permalink?r.STORE_PAGES.myaccount.permalink:Object(r.getSetting)("wpLoginUrl","/wp-login.php"),Object(r.getSetting)("shippingCountries",{})),O=Object(r.getSetting)("allowedCountries",{}),j=Object(r.getSetting)("shippingStates",{}),f=Object(r.getSetting)("allowedStates",{}),h=Object(r.getSetting)("localPickupEnabled",!1)},207:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return l}));var c=n(2);const r=Object(c.getSetting)("attributes",[]).reduce((e,t)=>{const n=(c=t)&&c.attribute_name?{id:parseInt(c.attribute_id,10),name:c.attribute_name,taxonomy:"pa_"+c.attribute_name,label:c.attribute_label}:null;var c;return n&&n.id&&e.push(n),e},[]),o=e=>{if(e)return r.find(t=>t.id===e)},l=e=>{if(e)return r.find(t=>t.taxonomy===e)}},232:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s})),n.d(t,"d",(function(){return i})),n.d(t,"c",(function(){return u}));var c=n(17),r=n(2),o=n(127);const l=Object(r.getSettingWithCoercion)("is_rendering_php_template",!1,o.a),a="query_type_",s="filter_";function i(e){return window?Object(c.getQueryArg)(window.location.href,e):null}function u(e){l?window.location.href=e:window.history.replaceState({},"",e)}},25:function(e,t){e.exports=window.wp.isShallowEqual},263:function(e,t){},264:function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var c=n(0),r=n(249),o=n(8),l=n(42),a=n(32),s=n(54),i=n(106),u=n(47);const b=e=>{let{queryAttribute:t,queryPrices:n,queryStock:b,queryRating:d,queryState:m,productIds:p,isEditor:g=!1}=e,O=Object(u.a)();O+="-collection-data";const[j]=Object(s.a)(O),[f,h]=Object(s.b)("calculate_attribute_counts",[],O),[w,_]=Object(s.b)("calculate_price_range",null,O),[y,E]=Object(s.b)("calculate_stock_status_counts",null,O),[k,v]=Object(s.b)("calculate_rating_counts",null,O),S=Object(l.a)(t||{}),C=Object(l.a)(n),x=Object(l.a)(b),N=Object(l.a)(d);Object(c.useEffect)(()=>{"object"==typeof S&&Object.keys(S).length&&(f.find(e=>Object(a.c)(S,"taxonomy")&&e.taxonomy===S.taxonomy)||h([...f,S]))},[S,f,h]),Object(c.useEffect)(()=>{w!==C&&void 0!==C&&_(C)},[C,_,w]),Object(c.useEffect)(()=>{y!==x&&void 0!==x&&E(x)},[x,E,y]),Object(c.useEffect)(()=>{k!==N&&void 0!==N&&v(N)},[N,v,k]);const[T,A]=Object(c.useState)(g),[R]=Object(r.a)(T,200);T||A(!0);const L=Object(c.useMemo)(()=>(e=>{const t=e;return Array.isArray(e.calculate_attribute_counts)&&(t.calculate_attribute_counts=Object(o.sortBy)(e.calculate_attribute_counts.map(e=>{let{taxonomy:t,queryType:n}=e;return{taxonomy:t,query_type:n}}),["taxonomy","query_type"])),t})(j),[j]);return Object(i.a)({namespace:"/wc/store/v1",resourceName:"products/collection-data",query:{...m,page:void 0,per_page:void 0,orderby:void 0,order:void 0,...!Object(o.isEmpty)(p)&&{include:p},...L},shouldSelect:R})}},3:function(e,t){e.exports=window.wp.components},30:function(e,t,n){"use strict";var c=n(0),r=n(4),o=n.n(r);t.a=e=>{let t,{label:n,screenReaderLabel:r,wrapperElement:l,wrapperProps:a={}}=e;const s=null!=n,i=null!=r;return!s&&i?(t=l||"span",a={...a,className:o()(a.className,"screen-reader-text")},Object(c.createElement)(t,a,r)):(t=l||c.Fragment,s&&i&&n!==r?Object(c.createElement)(t,a,Object(c.createElement)("span",{"aria-hidden":"true"},n),Object(c.createElement)("span",{className:"screen-reader-text"},r)):Object(c.createElement)(t,a,n))}},32:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){return o}));const c=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function r(e,t){return c(e)&&t in e}const o=e=>0===Object.keys(e).length},365:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return a}));var c=n(32);const r=e=>Object(c.c)(e,"count")&&Object(c.c)(e,"description")&&Object(c.c)(e,"id")&&Object(c.c)(e,"name")&&Object(c.c)(e,"parent")&&Object(c.c)(e,"slug")&&"number"==typeof e.count&&"string"==typeof e.description&&"number"==typeof e.id&&"string"==typeof e.name&&"number"==typeof e.parent&&"string"==typeof e.slug,o=e=>Array.isArray(e)&&e.every(r),l=e=>Object(c.c)(e,"attribute")&&Object(c.c)(e,"operator")&&Object(c.c)(e,"slug")&&"string"==typeof e.attribute&&"string"==typeof e.operator&&Array.isArray(e.slug)&&e.slug.every(e=>"string"==typeof e),a=e=>Array.isArray(e)&&e.every(l)},38:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var c=n(6),r=n.n(c),o=n(0),l=n(19);const a=e=>{let{countLabel:t,className:n,depth:c=0,controlId:a="",item:s,isSelected:i,isSingle:u,onSelect:b,search:d="",...m}=e;const p=null!=t&&void 0!==s.count&&null!==s.count,g=[n,"woocommerce-search-list__item"];g.push("depth-"+c),u&&g.push("is-radio-button"),p&&g.push("has-count");const O=s.breadcrumbs&&s.breadcrumbs.length,j=m.name||"search-list-item-"+a,f=`${j}-${s.id}`;return Object(o.createElement)("label",{htmlFor:f,className:g.join(" ")},u?Object(o.createElement)("input",r()({type:"radio",id:f,name:j,value:s.value,onChange:b(s),checked:i,className:"woocommerce-search-list__item-input"},m)):Object(o.createElement)("input",r()({type:"checkbox",id:f,name:j,value:s.value,onChange:b(s),checked:i,className:"woocommerce-search-list__item-input"},m)),Object(o.createElement)("span",{className:"woocommerce-search-list__item-label"},O?Object(o.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(l.b)(s.breadcrumbs)):null,Object(o.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(l.d)(s.name,d))),!!p&&Object(o.createElement)("span",{className:"woocommerce-search-list__item-count"},t||s.count))};t.b=a},381:function(e,t,n){e.exports=n(494)},382:function(e,t){},383:function(e,t){},41:function(e,t){e.exports=window.wp.deprecated},42:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var c=n(0),r=n(25),o=n.n(r);function l(e){const t=Object(c.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},46:function(e,t){e.exports=window.wp.a11y},47:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var c=n(0);const r=Object(c.createContext)("page"),o=()=>Object(c.useContext)(r);r.Provider},494:function(e,t,n){"use strict";n.r(t);var c=n(6),r=n.n(c),o=n(0),l=n(9),a=n(5),s=n(55),i=n(80),u=n(550),b=n(4),d=n.n(b),m=n(1),p=n(228),g=n(100),O=n(8),j=n(2),f=n(122),h=n(3),w=n(132),_=n(42),y=n(103),E=n(54),k=n(106),v=n(264),S=n(111),C=n(125),x=n(126),N=n(25),T=n.n(N),A=n(18),R=n(551),L=n(17),P=n(127),B=n(74),I=n(32),F=n(365),q=n(553),G=n(232),D=n(153),M=n(123),Q=n(207),U=n(175);const V=[{value:"preview-1",formattedValue:"preview-1",name:"Blue",label:Object(o.createElement)(S.a,{name:"Blue",count:3}),textLabel:"Blue (3)"},{value:"preview-2",formattedValue:"preview-2",name:"Green",label:Object(o.createElement)(S.a,{name:"Green",count:3}),textLabel:"Green (3)"},{value:"preview-3",formattedValue:"preview-3",name:"Red",label:Object(o.createElement)(S.a,{name:"Red",count:2}),textLabel:"Red (2)"}],$={id:0,name:"preview",taxonomy:"preview",label:"Preview"};n(383);var Y=n(147);function W(){return Math.floor(Math.random()*Date.now())}const K=e=>e.replace("pa_",""),J=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n={};t.forEach(e=>{const{attribute:t,slug:c,operator:r}=e,o=K(t),l=c.join(","),a=`${G.b}${o}`,s="in"===r?"or":"and";n[`${G.a}${o}`]=l,n[a]=s});const c=Object(L.removeQueryArgs)(e,...Object.keys(n));return Object(L.addQueryArgs)(c,n)},z=e=>{if(e){const t=Object(G.d)("filter_"+e.name);return("string"==typeof t?t.split(","):[]).map(e=>encodeURIComponent(e).toLowerCase())}return[]},H=(e,t)=>{const n=Object.entries(t).reduce((e,t)=>{let[n,c]=t;return n.includes("query_type")?e:{...e,[n]:c}},{});return Object.entries(n).reduce((t,n)=>{let[c,r]=n;return e[c]===r&&t},!0)},Z=e=>e.trim().replace(/\s/g,"-").replace(/_/g,"-").replace(/-+/g,"-").replace(/[^a-zA-Z0-9-]/g,"");var X=n(154),ee=e=>{let{isLoading:t=!1,options:n,checked:c,onChange:r}=e;return t?Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"is-loading"}),Object(o.createElement)("span",{className:"is-loading"})):Object(o.createElement)(X.a,{className:"wc-block-attribute-filter-list",options:n,checked:c,onChange:r,isLoading:t,isDisabled:t})},te=n(101),ne=e=>{let{attributes:t,isEditor:n=!1}=e;const c=Object(j.getSettingWithCoercion)("has_filterable_products",!1,P.a),r=Object(j.getSettingWithCoercion)("is_rendering_php_template",!1,P.a),l=Object(j.getSettingWithCoercion)("page_url",window.location.href,B.a),a=n?[]:Object(j.getSettingWithCoercion)("product_ids",[],Array.isArray),[s,u]=Object(o.useState)(!1),b=t.isPreview&&!t.attributeId?$:Object(Q.a)(t.attributeId),p=Object(o.useMemo)(()=>z(b),[b]),[g,f]=Object(o.useState)(p),[h,N]=Object(o.useState)(W()),[Y,X]=Object(o.useState)(t.isPreview&&!t.attributeId?V:[]),ne=Object(w.a)(t),[ce]=Object(E.a)(),[re,oe]=Object(E.b)("attributes",[]),{results:le,isLoading:ae}=Object(k.a)({namespace:"/wc/store/v1",resourceName:"products/attributes/terms",resourceValues:[(null==b?void 0:b.id)||0],shouldSelect:t.attributeId>0}),se="dropdown"!==t.displayStyle&&"and"===t.queryType,{results:ie,isLoading:ue}=Object(v.a)({queryAttribute:{taxonomy:(null==b?void 0:b.taxonomy)||"",queryType:t.queryType},queryState:{...ce,attributes:se?ce.attributes:null},productIds:a,isEditor:n}),be=Object(o.useCallback)(e=>Object(I.c)(ie,"attribute_counts")&&Array.isArray(ie.attribute_counts)?ie.attribute_counts.find(t=>{let{term:n}=t;return n===e}):null,[ie]);Object(o.useEffect)(()=>{if(ae||ue)return;if(!Array.isArray(le))return;const e=le.map(e=>{const n=be(e.id);if(!(n||g.includes(e.slug)||(c=e.slug,null!=ce&&ce.attributes&&ce.attributes.some(e=>{let{attribute:t,slug:n=[]}=e;return t===(null==b?void 0:b.taxonomy)&&n.includes(c)}))))return null;var c;const r=n?n.count:0;return{formattedValue:Z(e.slug),value:e.slug,name:Object(A.decodeEntities)(e.name),label:Object(o.createElement)(S.a,{name:Object(A.decodeEntities)(e.name),count:t.showCounts?r:null}),textLabel:t.showCounts?`${Object(A.decodeEntities)(e.name)} (${r})`:Object(A.decodeEntities)(e.name)}}).filter(e=>!!e);X(e),N(W())},[null==b?void 0:b.taxonomy,le,ae,t.showCounts,ue,be,g,ce.attributes]);const de=Object(o.useCallback)(e=>Array.isArray(le)?le.reduce((t,n)=>(e.includes(n.slug)&&t.push(n),t),[]):[],[le]),me=Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e=e.map(e=>({...e,slug:e.slug.map(e=>decodeURIComponent(e))})),t){if(null==b||!b.taxonomy)return;const t=Object.keys(Object(L.getQueryArgs)(window.location.href)),n=K(b.taxonomy),c=t.reduce((e,t)=>t.includes(G.b+n)||t.includes(G.a+n)?Object(L.removeQueryArgs)(e,t):e,window.location.href),r=J(c,e);Object(G.c)(r)}else{const t=J(l,e),n=Object(L.getQueryArgs)(window.location.href),c=Object(L.getQueryArgs)(t);H(n,c)||Object(G.c)(t)}}),[l,null==b?void 0:b.taxonomy]),pe=e=>{const n=Object(U.b)(re,oe,b,de(e),"or"===t.queryType?"in":"and");me(n,0===e.length)},ge=Object(o.useCallback)((function(e){let c=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n||(f(e),!c&&t.showFilterButton||Object(U.b)(re,oe,b,de(e),"or"===t.queryType?"in":"and"))}),[n,f,re,oe,b,de,t.queryType,t.showFilterButton]),Oe=Object(o.useMemo)(()=>Object(F.a)(re)?re.filter(e=>{let{attribute:t}=e;return t===(null==b?void 0:b.taxonomy)}).flatMap(e=>{let{slug:t}=e;return t}):[],[re,null==b?void 0:b.taxonomy]),je=Object(_.a)(Oe),fe=Object(y.a)(je);Object(o.useEffect)(()=>{!fe||T()(fe,je)||T()(g,je)||ge(je)},[g,je,fe,ge]);const he="single"!==t.selectType,we=Object(o.useCallback)(e=>{const t=g.includes(e);let n;he?(n=g.filter(t=>t!==e),t||(n.push(e),n.sort())):n=t?[]:[e],ge(n)},[g,he,ge]);Object(o.useEffect)(()=>{b&&!t.showFilterButton&&((e=>{let{currentCheckedFilters:t,hasSetFilterDefaultsFromUrl:n}=e;return n&&0===t.length})({currentCheckedFilters:g,hasSetFilterDefaultsFromUrl:s})?me(re,!0):me(re,!1))},[s,me,re,b,g,t.showFilterButton]),Object(o.useEffect)(()=>{if(!s&&!ae)return p.length>0?(u(!0),void ge(p,!0)):void(r||u(!0))},[b,s,ae,ge,p,r]);const _e=Object(te.a)();if(!c)return _e(!1),null;if(!b)return n?Object(o.createElement)(R.a,{status:"warning",isDismissible:!1},Object(o.createElement)("p",null,Object(m.__)("Please select an attribute to use this filter!","woocommerce"))):(_e(!1),null);if(0===Y.length&&!ae&&n)return Object(o.createElement)(R.a,{status:"warning",isDismissible:!1},Object(o.createElement)("p",null,Object(m.__)("There are no products with the selected attributes.","woocommerce")));const ye="h"+t.headingLevel,Ee=!t.isPreview&&ae,ke=!t.isPreview&&ue,ve=(Ee||ke)&&0===Y.length;if(!ve&&0===Y.length)return _e(!1),null;const Se=he?!ve&&g.length<Y.length:!ve&&0===g.length,Ce=Object(o.createElement)(ye,{className:"wc-block-attribute-filter__title"},t.heading),xe=ve?Object(o.createElement)(M.a,null,Ce):Ce;return _e(!0),Object(o.createElement)(o.Fragment,null,!n&&t.heading&&xe,Object(o.createElement)("div",{className:d()("wc-block-attribute-filter","style-"+t.displayStyle)},"dropdown"===t.displayStyle?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(D.a,{key:h,className:d()(ne.className,{"single-selection":!he,"is-loading":ve}),style:{...ne.style,borderStyle:"none"},suggestions:Y.filter(e=>!g.includes(e.value)).map(e=>e.formattedValue),disabled:ve,placeholder:Object(m.sprintf)(
/* translators: %s attribute name. */
Object(m.__)("Select %s","woocommerce"),b.label),onChange:e=>{!he&&e.length>1&&(e=[e[e.length-1]]),e=e.map(e=>{const t=Y.find(t=>t.formattedValue===e);return t?t.value:e});const t=Object(O.difference)(e,g);if(1===t.length)return we(t[0]);const n=Object(O.difference)(g,e);1===n.length&&we(n[0])},value:g,displayTransform:e=>{const t=Y.find(t=>[t.value,t.formattedValue].includes(e));return t?t.textLabel:e},saveTransform:Z,messages:{added:Object(m.sprintf)(
/* translators: %s is the attribute label. */
Object(m.__)("%s filter added.","woocommerce"),b.label),removed:Object(m.sprintf)(
/* translators: %s is the attribute label. */
Object(m.__)("%s filter removed.","woocommerce"),b.label),remove:Object(m.sprintf)(
/* translators: %s is the attribute label. */
Object(m.__)("Remove %s filter.","woocommerce"),b.label.toLocaleLowerCase()),__experimentalInvalid:Object(m.sprintf)(
/* translators: %s is the attribute label. */
Object(m.__)("Invalid %s filter.","woocommerce"),b.label.toLocaleLowerCase())}}),Se&&Object(o.createElement)(i.a,{icon:q.a,size:30})):Object(o.createElement)(ee,{options:Y,checked:g,onChange:we,isLoading:ve,isDisabled:ve})),Object(o.createElement)("div",{className:"wc-block-attribute-filter__actions"},(g.length>0||n)&&!ve&&Object(o.createElement)(C.a,{onClick:()=>{f([]),N(W()),s&&pe([])},screenReaderLabel:Object(m.__)("Reset attribute filter","woocommerce")}),t.showFilterButton&&Object(o.createElement)(x.a,{className:"wc-block-attribute-filter__button",isLoading:ve,disabled:(()=>{if(Ee||ke)return!0;const e=z(b);return e.length===g.length&&g.every(t=>e.includes(t))})(),onClick:()=>pe(g)})))},ce=(n(382),n(121));const re=Object(j.getSetting)("attributes",[]);var oe=Object(h.withSpokenMessages)(e=>{let{attributes:t,setAttributes:n,debouncedSpeak:c,clientId:r}=e;const{attributeId:l,className:s,displayStyle:b,heading:w,headingLevel:_,isPreview:y,queryType:E,showCounts:k,showFilterButton:v,selectType:S}=t,[C,x]=Object(o.useState)(!l&&!y),N=Object(a.useBlockProps)(),T=e=>{if(!e||!e.length)return;const t=e[0].id;re.find(e=>e.attribute_id===t.toString())&&l!==t&&n({attributeId:t})},A=e=>{let{isCompact:t}=e;const n={clear:Object(m.__)("Clear selected attribute","woocommerce"),list:Object(m.__)("Product Attributes","woocommerce"),noItems:Object(m.__)("Your store doesn't have any product attributes.","woocommerce"),search:Object(m.__)("Search for a product attribute:","woocommerce"),selected:e=>Object(m.sprintf)(
/* translators: %d is the number of attributes selected. */
Object(m._n)("%d attribute selected","%d attributes selected",e,"woocommerce"),e),updated:Object(m.__)("Product attribute search results updated.","woocommerce")},c=Object(O.sortBy)(re.map(e=>({id:parseInt(e.attribute_id,10),name:e.attribute_label})),"name");return Object(o.createElement)(g.a,{className:"woocommerce-product-attributes",list:c,selected:c.filter(e=>{let{id:t}=e;return t===l}),onChange:T,messages:n,isSingle:!0,isCompact:t})};return 0===Object.keys(re).length?Object(o.createElement)(h.Placeholder,{className:"wc-block-attribute-filter",icon:Object(o.createElement)(i.a,{icon:u.a}),label:Object(m.__)("Filter by Attribute","woocommerce"),instructions:Object(m.__)("Display a list of filters based on the selected attributes.","woocommerce")},Object(o.createElement)("p",null,Object(m.__)("Attributes are needed for filtering your products. You haven't created any attributes yet.","woocommerce")),Object(o.createElement)(h.Button,{className:"wc-block-attribute-filter__add-attribute-button",isSecondary:!0,href:Object(j.getAdminLink)("edit.php?post_type=product&page=product_attributes")},Object(m.__)("Add new attribute","woocommerce")+" ",Object(o.createElement)(i.a,{icon:p.a})),Object(o.createElement)(h.Button,{className:"wc-block-attribute-filter__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-product-taxonomies/"},Object(m.__)("Learn more","woocommerce"))):Object(o.createElement)("div",N,Object(o.createElement)(a.BlockControls,null,Object(o.createElement)(h.ToolbarGroup,{controls:[{icon:"edit",title:Object(m.__)("Edit","woocommerce"),onClick:()=>x(!C),isActive:C}]})),Object(o.createElement)(a.InspectorControls,{key:"inspector"},Object(o.createElement)(h.PanelBody,{title:Object(m.__)("Display Settings","woocommerce")},Object(o.createElement)(h.ToggleControl,{label:Object(m.__)("Display product count","woocommerce"),checked:k,onChange:()=>n({showCounts:!k})}),Object(o.createElement)(h.__experimentalToggleGroupControl,{label:Object(m.__)("Allow selecting multiple options?","woocommerce"),value:S||"multiple",onChange:e=>n({selectType:e}),className:"wc-block-attribute-filter__multiple-toggle"},Object(o.createElement)(h.__experimentalToggleGroupControlOption,{value:"multiple",label:Object(m.__)("Multiple","woocommerce")}),Object(o.createElement)(h.__experimentalToggleGroupControlOption,{value:"single",label:Object(m.__)("Single","woocommerce")})),"multiple"===S&&Object(o.createElement)(h.__experimentalToggleGroupControl,{label:Object(m.__)("Filter Conditions","woocommerce"),help:"and"===E?Object(m.__)("Choose to return filter results for all of the attributes selected.","woocommerce"):Object(m.__)("Choose to return filter results for any of the attributes selected.","woocommerce"),value:E,onChange:e=>n({queryType:e}),className:"wc-block-attribute-filter__conditions-toggle"},Object(o.createElement)(h.__experimentalToggleGroupControlOption,{value:"and",label:Object(m.__)("All","woocommerce")}),Object(o.createElement)(h.__experimentalToggleGroupControlOption,{value:"or",label:Object(m.__)("Any","woocommerce")})),Object(o.createElement)(h.__experimentalToggleGroupControl,{label:Object(m.__)("Display Style","woocommerce"),value:b,onChange:e=>n({displayStyle:e}),className:"wc-block-attribute-filter__display-toggle"},Object(o.createElement)(h.__experimentalToggleGroupControlOption,{value:"list",label:Object(m.__)("List","woocommerce")}),Object(o.createElement)(h.__experimentalToggleGroupControlOption,{value:"dropdown",label:Object(m.__)("Dropdown","woocommerce")})),Object(o.createElement)(h.ToggleControl,{label:Object(m.__)("Show 'Apply filters' button","woocommerce"),help:Object(m.__)("Products will update when the button is clicked.","woocommerce"),checked:v,onChange:e=>n({showFilterButton:e})})),Object(o.createElement)(h.PanelBody,{title:Object(m.__)("Content Settings","woocommerce"),initialOpen:!1},A({isCompact:!0}))),Object(o.createElement)(ce.a,{clientId:r,attributes:t,setAttributes:n,filterType:"attribute-filter"}),C?Object(o.createElement)(h.Placeholder,{className:"wc-block-attribute-filter",icon:Object(o.createElement)(i.a,{icon:u.a}),label:Object(m.__)("Filter by Attribute","woocommerce")},Object(o.createElement)("div",{className:"wc-block-attribute-filter__instructions"},Object(m.__)("Display a list of filters based on the selected attributes.","woocommerce")),Object(o.createElement)("div",{className:"wc-block-attribute-filter__selection"},A({isCompact:!1}),Object(o.createElement)(h.Button,{isPrimary:!0,onClick:()=>{x(!1),c(Object(m.__)("Now displaying a preview of the Filter Products by Attribute block.","woocommerce"))}},Object(m.__)("Done","woocommerce")))):Object(o.createElement)("div",{className:d()(s,"wc-block-attribute-filter")},w&&Object(o.createElement)(f.a,{className:"wc-block-attribute-filter__title",headingLevel:_,heading:w,onChange:e=>n({heading:e})}),Object(o.createElement)(h.Disabled,null,Object(o.createElement)(ne,{attributes:t,isEditor:!0}))))});const le={heading:{type:"string",default:Object(m.__)("Filter by attribute","woocommerce")}};Object(l.registerBlockType)(Y,{icon:{src:Object(o.createElement)(i.a,{icon:u.a,className:"wc-block-editor-components-block-icon"})},supports:{...Y.supports,...Object(s.b)()&&{__experimentalBorder:{radius:!1,color:!0,width:!1}}},attributes:{...Y.attributes,...le},edit:oe,save(e){let{attributes:t}=e;const{className:n,showCounts:c,queryType:l,attributeId:s,heading:i,headingLevel:u,displayStyle:b,showFilterButton:m,selectType:p}=t,g={"data-attribute-id":s,"data-show-counts":c,"data-query-type":l,"data-heading":i,"data-heading-level":u};return"list"!==b&&(g["data-display-style"]=b),m&&(g["data-show-filter-button"]=m),"single"===p&&(g["data-select-type"]=p),Object(o.createElement)("div",r()({},a.useBlockProps.save({className:d()("is-loading",n)}),g),Object(o.createElement)("span",{"aria-hidden":!0,className:"wc-block-product-attribute-filter__placeholder"}))}})},5:function(e,t){e.exports=window.wp.blockEditor},53:function(e,t){e.exports=window.wp.keycodes},54:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return m}));var c=n(10),r=n(7),o=n(0),l=n(25),a=n.n(l),s=n(42),i=n(103),u=n(47);const b=e=>{const t=Object(u.a)();e=e||t;const n=Object(r.useSelect)(t=>t(c.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:l}=Object(r.useDispatch)(c.QUERY_STATE_STORE_KEY);return[n,Object(o.useCallback)(t=>{l(e,t)},[e,l])]},d=(e,t,n)=>{const l=Object(u.a)();n=n||l;const a=Object(r.useSelect)(r=>r(c.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t),[n,e]),{setQueryValue:s}=Object(r.useDispatch)(c.QUERY_STATE_STORE_KEY);return[a,Object(o.useCallback)(t=>{s(n,e,t)},[n,e,s])]},m=(e,t)=>{const n=Object(u.a)();t=t||n;const[c,r]=b(t),l=Object(s.a)(c),d=Object(s.a)(e),m=Object(i.a)(d),p=Object(o.useRef)(!1);return Object(o.useEffect)(()=>{a()(m,d)||(r(Object.assign({},l,d)),p.current=!0)},[l,d,m,r]),p.current?[c,r]:[e,r]}},55:function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return a}));var c=n(9),r=n(20);const o=(e,t)=>{if(r.n>2)return Object(c.registerBlockType)(e,t)},l=()=>r.n>2,a=()=>r.n>1},67:function(e,t){e.exports=window.wp.dom},7:function(e,t){e.exports=window.wp.data},74:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));const c=e=>"string"==typeof e},8:function(e,t){e.exports=window.lodash},9:function(e,t){e.exports=window.wp.blocks},94:function(e,t){e.exports=window.wp.warning},98:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var c=n(74),r=n(32);const o=e=>Object(c.a)(e)?JSON.parse(e)||{}:Object(r.b)(e)?e:{}}});