var wc;(()=>{"use strict";var e={};(e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})})(e);const t=window.wc.__experimentalInteractivity,r=window.wc.priceFormat;function n(e,t,r){return e>=t&&e<=r}const{state:i,actions:a}=(0,t.store)("woocommerce/product-filter-price",{state:{get minPrice(){var e;const r=(0,t.getContext)(),n=(0,t.store)("woocommerce/product-filters");return null!==(e=n.state.params)&&void 0!==e&&e.min_price?parseInt(n.state.params.min_price,10):r.minRange},get maxPrice(){var e;const r=(0,t.getContext)(),n=(0,t.store)("woocommerce/product-filters");return null!==(e=n.state.params)&&void 0!==e&&e.max_price?parseInt(n.state.params.max_price,10):r.maxRange},get formattedMinPrice(){return(0,r.formatPrice)(i.minPrice,(0,r.getCurrency)({minorUnit:0}))},get formattedMaxPrice(){return(0,r.formatPrice)(i.maxPrice,(0,r.getCurrency)({minorUnit:0}))},get hasSelectedFilters(){const e=(0,t.getContext)();return i.minPrice>e.minRange||i.maxPrice<e.maxRange}},actions:{getActiveLabel(e,n){const i=(0,t.getContext)();return e&&e>i.minRange&&n&&n<i.maxRange?i.activeLabelTemplates.minAndMax.replace("{{min}}",(0,r.formatPrice)(e,(0,r.getCurrency)({minorUnit:0}))).replace("{{max}}",(0,r.formatPrice)(n,(0,r.getCurrency)({minorUnit:0}))):e&&e>i.minRange?i.activeLabelTemplates.minOnly.replace("{{min}}",(0,r.formatPrice)(e,(0,r.getCurrency)({minorUnit:0}))):n&&n<i.maxRange?i.activeLabelTemplates.maxOnly.replace("{{max}}",(0,r.formatPrice)(n,(0,r.getCurrency)({minorUnit:0}))):""},setPrice:(e,r)=>{const c=(0,t.getContext)(),m=(0,t.store)("woocommerce/product-filters"),o={min:i.minPrice,max:i.maxPrice};var l,s;"min"===e&&r&&n(r,c.minRange,c.maxRange)&&r<i.maxPrice&&(o.min=r),"max"===e&&r&&n(r,c.minRange,c.maxRange)&&r>i.minPrice&&(o.max=r),o.min===c.minRange&&(o.min=null),o.max===c.maxRange&&(o.max=null),m.actions.removeActiveFiltersByType("price"),m.actions.setActiveFilter({type:"price",value:(l=o.min,s=o.max,null===l&&null===s?null:null===s?`${l}-`:null===l?`-${s}`:`${l}-${s}`),label:a.getActiveLabel(o.min,o.max),price:o})},setMinPrice:e=>{const t=parseInt(e.target.value,10);a.setPrice("min",t)},setMaxPrice:e=>{const t=parseInt(e.target.value,10);a.setPrice("max",t)},clearFilters:()=>{const e=(0,t.store)("woocommerce/product-filters");e.actions.removeActiveFiltersByType("price"),e.actions.navigate()}}});(wc=void 0===wc?{}:wc)["product-filter-price"]=e})();