(()=>{var e={9498:()=>{}},o={};function t(r){var c=o[r];if(void 0!==c)return c.exports;var l=o[r]={exports:{}};return e[r](l,l.exports,t),l.exports}t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";t.r(r);const e=window.wp.blocks,o=window.wc.wcSettings,c=window.React,l=window.wp.primitives,n=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","name":"woocommerce/product-filter-active","version":"1.0.0","title":"Active (Experimental)","description":"Display the currently active filters.","category":"woocommerce","keywords":["WooCommerce"],"textdomain":"woocommerce","apiVersion":3,"ancestor":["woocommerce/product-filters"],"supports":{"interactivity":true,"__experimentalBorder":{"color":true,"radius":true,"style":true,"width":true,"__experimentalDefaultControls":{"color":false,"radius":false,"style":false,"width":false}},"spacing":{"margin":true,"padding":true,"blockGap":false,"__experimentalDefaultControls":{"margin":false,"padding":false,"blockGap":false}}},"usesContext":["filterParams"],"attributes":{"clearButton":{"type":"boolean","default":false}}}'),i=window.wp.blockEditor,a=window.wp.i18n,s=window.wp.components,m=window.wp.data,u=window.wp.element,d=(e,o)=>{if(!e)return null;if(0===e.innerBlocks.length)return null;for(const t of e.innerBlocks){if(o(t))return t;const e=d(t,o);if(e)return e}return null},p=({attributes:o,setAttributes:t,clientId:r})=>{const{clearButton:l}=o;return(0,u.useEffect)((()=>{const o=(0,m.select)("core/block-editor").getBlock(r),t=("woocommerce/product-filter-clear-button",d(o,(function(e){return"woocommerce/product-filter-clear-button"===e.name})));t&&!l?((0,m.dispatch)("core/block-editor").updateBlockAttributes(t.clientId,{lock:{}}),(0,m.dispatch)("core/block-editor").removeBlock(t.clientId),(0,m.dispatch)("core/block-editor").selectBlock(r)):!t&&l&&(0,m.dispatch)("core/block-editor").insertBlock((0,e.createBlock)("woocommerce/product-filter-clear-button",{lock:{move:!1,remove:!0},clearType:"all"}),1,r,!1)}),[l,r]),(0,c.createElement)(i.InspectorControls,{group:"styles"},(0,c.createElement)(s.PanelBody,{title:(0,a.__)("Display","woocommerce")},(0,c.createElement)(s.ToggleControl,{label:(0,a.__)("Clear button","woocommerce"),checked:l,onChange:e=>{t({clearButton:e})}})))};t(9498);const w=({children:e})=>(0,c.createElement)("div",{className:"wc-block-product-filter-components-initial-disabled"},(0,c.createElement)("div",{className:"wc-block-product-filter-components-initial-disabled-overlay"}),e),f=["woocommerce/product-filters","woocommerce/product-filter-attribute","woocommerce/product-filter-active","woocommerce/product-filter-price","woocommerce/product-filter-status","woocommerce/product-collection","core/query"],b=(o=[])=>(0,e.getBlockTypes)().map((e=>e.name)).filter((e=>!o.includes(e))),k=[{type:(0,a.__)("Color","woocommerce"),label:(0,a.__)("Blue","woocommerce")},{type:(0,a.__)("Color","woocommerce"),label:(0,a.__)("Red","woocommerce")},{type:(0,a.__)("Size","woocommerce"),label:(0,a.__)("Large","woocommerce")},{type:(0,a.__)("Status","woocommerce"),label:(0,a.__)("In stock","woocommerce")},{type:(0,a.__)("Status","woocommerce"),label:(0,a.__)("On sale","woocommerce")}];(()=>{const{experimentalBlocksEnabled:e}=(0,o.getSetting)("wcBlocksConfig",{experimentalBlocksEnabled:!1});return e})()&&(0,e.registerBlockType)(n,{icon:()=>(0,c.createElement)(l.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,c.createElement)(l.Path,{d:"M9 17.5H11.5V16H9V17.5ZM5 6V7.5L17 7.5V6L5 6ZM7 12.5H15V11H7V12.5Z",fill:"currentColor"}),(0,c.createElement)(l.Path,{d:"M19.9982 13.1948L18.7945 12.2998L15.7111 16.1017L14.0969 14.8993L13.2002 16.1017L16.0185 18.2022L19.9982 13.1948Z",fill:"currentColor"})),edit:e=>{const{attributes:o}=e,{clearButton:t}=o,{children:r,...l}=(0,i.useInnerBlocksProps)((0,i.useBlockProps)(),{allowedBlocks:b(f),template:[["woocommerce/product-filter-removable-chips",{lock:{remove:!0}}],...t?[["woocommerce/product-filter-clear-button",{clearType:"all",lock:{remove:!0,move:!1}}]]:[]]});return(0,c.createElement)("div",{...l},(0,c.createElement)(p,{...e}),(0,c.createElement)(w,null,(0,c.createElement)(i.BlockContextProvider,{value:{filterData:{items:k}}},r)))},save:()=>{const e=i.useBlockProps.save(),o=i.useInnerBlocksProps.save(e);return(0,c.createElement)("div",{...o})}})})(),((this.wc=this.wc||{}).blocks=this.wc.blocks||{})["product-filter-active"]=r})();