← Back
Editing: price-filter-frontend.js
var wc;(()=>{var e,r,t,o={8424:(e,r,t)=>{"use strict";var o=t(6087),n=t(7723);const i=window.wc.wcSettings,c=window.wc.wcTypes,s=(0,i.getSetting)("wcBlocksConfig",{pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=s.pluginUrl+"assets/images/",l=(s.pluginUrl,i.STORE_PAGES.shop,i.STORE_PAGES.checkout,i.STORE_PAGES.checkout,i.STORE_PAGES.privacy,i.STORE_PAGES.privacy,i.STORE_PAGES.terms,i.STORE_PAGES.terms,i.STORE_PAGES.cart,i.STORE_PAGES.cart,i.STORE_PAGES.myaccount?.permalink?i.STORE_PAGES.myaccount.permalink:(0,i.getSetting)("wpLoginUrl","/wp-login.php"),(0,i.getSetting)("localPickupEnabled",!1),(0,i.getSetting)("shippingMethodsExist",!1),(0,i.getSetting)("shippingEnabled",!0),(0,i.getSettingWithCoercion)("countries",{},c.isObject)),u=(0,i.getSetting)("countryData",{}),p={...Object.fromEntries(Object.keys(u).filter(e=>!0===u[e].allowBilling).map(e=>{const r=l[e];return[e,(0,c.isString)(r)?r:""]})),...Object.fromEntries(Object.keys(u).filter(e=>!0===u[e].allowShipping).map(e=>{const r=l[e];return[e,(0,c.isString)(r)?r:""]}))},d=(Object.fromEntries(Object.keys(p).map(e=>[e,u[e].states||{}])),Object.fromEntries(Object.keys(p).map(e=>[e,u[e].locale||{}])),{address:["first_name","last_name","company","address_1","address_2","city","postcode","country","state","phone"],contact:["email"],order:[]});(0,i.getSetting)("addressFieldsLocations",d).address,(0,i.getSetting)("addressFieldsLocations",d).contact,(0,i.getSetting)("addressFieldsLocations",d).order,(0,i.getSetting)("additionalOrderFields",{}),(0,i.getSetting)("additionalContactFields",{}),(0,i.getSetting)("additionalAddressFields",{});var m=t(790);const b=({imageUrl:e=`${a}/block-error.svg`,header:r=(0,n.__)("Oops!","woocommerce"),text:t=(0,n.__)("There was an error loading the content.","woocommerce"),errorMessage:o,errorMessagePrefix:i=(0,n.__)("Error:","woocommerce"),button:c,showErrorBlock:s=!0})=>s?(0,m.jsxs)("div",{className:"wc-block-error wc-block-components-error",children:[e&&(0,m.jsx)("img",{className:"wc-block-error__image wc-block-components-error__image",src:e,alt:""}),(0,m.jsxs)("div",{className:"wc-block-error__content wc-block-components-error__content",children:[r&&(0,m.jsx)("p",{className:"wc-block-error__header wc-block-components-error__header",children:r}),t&&(0,m.jsx)("p",{className:"wc-block-error__text wc-block-components-error__text",children:t}),o&&(0,m.jsxs)("p",{className:"wc-block-error__message wc-block-components-error__message",children:[i?i+" ":"",o]}),c&&(0,m.jsx)("p",{className:"wc-block-error__button wc-block-components-error__button",children:c})]})]}):null;t(5893);class _ extends o.Component{state={errorMessage:"",hasError:!1};static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("strong",{children:e.status}),": ",e.statusText]}),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:r,showErrorMessage:t=!0,showErrorBlock:o=!0,text:n,errorMessagePrefix:i,renderError:c,button:s}=this.props,{errorMessage:a,hasError:l}=this.state;return l?"function"==typeof c?c({errorMessage:a}):(0,m.jsx)(b,{showErrorBlock:o,errorMessage:t?a:null,header:e,imageUrl:r,text:n,errorMessagePrefix:i,button:s}):this.props.children}}const g=_,w=[".wp-block-woocommerce-cart"],h=({Block:e,container:r,attributes:t={},props:n={},errorBoundaryProps:i={}})=>{const c=()=>{(0,o.useEffect)(()=>{r.classList&&r.classList.remove("is-loading")},[]);const c=r.classList.contains("wp-block-woocommerce-checkout"),s=r.classList.contains("wp-block-woocommerce-cart");return c||s?(0,m.jsx)(g,{...i,children:(0,m.jsx)(e,{...n,attributes:t})}):(0,m.jsx)(g,{...i,children:(0,m.jsx)(o.Suspense,{fallback:(0,m.jsx)("div",{className:"wc-block-placeholder",children:"Loading..."}),children:e&&(0,m.jsx)(e,{...n,attributes:t})})})},s=(0,o.createRoot)(r);return s.render((0,m.jsx)(c,{})),s},f=({Block:e,containers:r,getProps:t=()=>({}),getErrorBoundaryProps:o=()=>({})})=>{if(0===r.length)return[];const n=[];return r.forEach((r,i)=>{const c=t(r,i),s=o(r,i),a={...r.dataset,...c.attributes||{}};n.push({container:r,root:h({Block:e,container:r,props:c,attributes:a,errorBoundaryProps:s})})}),n};function x(e,r){const t=(0,o.useRef)();return(0,o.useEffect)(()=>{t.current===e||r&&!r(e,t.current)||(t.current=e)},[e,r]),t.current}const k=window.wc.wcBlocksData,y=window.wp.data;var E=t(923),S=t.n(E);const v=(0,o.createContext)("page"),j=()=>(0,o.useContext)(v),P=(v.Provider,e=>{const r=j();e=e||r;const t=(0,y.useSelect)(r=>r(k.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:n}=(0,y.useDispatch)(k.QUERY_STATE_STORE_KEY);return[t,(0,o.useCallback)(r=>{n(e,r)},[e,n])]}),F=(e,r,t)=>{const n=j();t=t||n;const i=(0,y.useSelect)(o=>o(k.QUERY_STATE_STORE_KEY).getValueForQueryKey(t,e,r),[t,e]),{setQueryValue:c}=(0,y.useDispatch)(k.QUERY_STATE_STORE_KEY);return[i,(0,o.useCallback)(r=>{c(t,e,r)},[t,e,c])]};var O=t(4347),C=t(1303);function N(e){const r=(0,o.useRef)(e);return S()(e,r.current)||(r.current=e),r.current}const R=({queryAttribute:e,queryTaxonomy:r,queryPrices:t,queryStock:i,queryRating:s,queryState:a,isEditor:l=!1})=>{let u=j();u=`${u}-collection-data`;const[p]=P(u),[d,m]=F("calculate_attribute_counts",[],u),[b,_]=F("calculate_taxonomy_counts",[],u),[g,w]=F("calculate_price_range",null,u),[h,f]=F("calculate_stock_status_counts",null,u),[x,E]=F("calculate_rating_counts",null,u),S=N(e||{}),v=N(r),R=N(t),A=N(i),T=N(s);(0,o.useEffect)(()=>{"object"==typeof S&&Object.keys(S).length&&(d.find(e=>(0,c.objectHasProp)(S,"taxonomy")&&e.taxonomy===S.taxonomy)||m([...d,S]))},[S,d,m]),(0,o.useEffect)(()=>{v&&!b.includes(v)&&_([...b,v])},[v,b,_]),(0,o.useEffect)(()=>{g!==R&&void 0!==R&&w(R)},[R,w,g]),(0,o.useEffect)(()=>{h!==A&&void 0!==A&&f(A)},[A,f,h]),(0,o.useEffect)(()=>{x!==T&&void 0!==T&&E(T)},[T,E,x]);const[B,U]=(0,o.useState)(l),[L]=(0,O.d7)(B,200);B||U(!0);const M=(0,o.useMemo)(()=>(e=>{const r=e;return Array.isArray(e.calculate_attribute_counts)&&(r.calculate_attribute_counts=(0,C.di)(e.calculate_attribute_counts.map(({taxonomy:e,queryType:r})=>({taxonomy:e,query_type:r}))).asc(["taxonomy","query_type"])),Array.isArray(e.calculate_taxonomy_counts)&&(r.calculate_taxonomy_counts=e.calculate_taxonomy_counts),r})(p),[p]),{results:I,isLoading:q}=(e=>{const{namespace:r,resourceName:t,resourceValues:i=[],query:s={},shouldSelect:a=!0}=e;if(!r||!t)throw new Error("The options object must have valid values for the namespace and the resource properties.");const l=(0,o.useRef)({results:[],isLoading:!0}),u=N(s),p=N(i),d=(()=>{const[,e]=(0,o.useState)();return(0,o.useCallback)(r=>{e(()=>{throw r})},[])})(),m=(0,y.useSelect)(e=>{if(!a)return null;const o=e(k.COLLECTIONS_STORE_KEY),i=[r,t,u,p],s=o.getCollectionError(...i);if(s)if((0,c.isError)(s))d(s);else{const e="object"==typeof s&&null!==s&&"string"==typeof s.message?s.message:(0,n.__)("Something went wrong while loading data.","woocommerce");d(new Error(e))}return{results:o.getCollection(...i),isLoading:!o.hasFinishedResolution("getCollection",i)}},[r,t,p,u,a,d]);return null!==m&&(l.current=m),l.current})({namespace:"/wc/store/v1",resourceName:"products/collection-data",query:{...a,page:void 0,per_page:void 0,orderby:void 0,order:void 0,...M},shouldSelect:L});return{data:I,isLoading:q}};var A=t(4921);const T=window.wc.blocksComponents;t(6599);const B=(e,r,t,o=1,n=!1)=>{let[i,c]=e;const s=e=>Number.isFinite(e);return s(i)||(i=r||0),s(c)||(c=t||o),s(r)&&r>i&&(i=r),s(t)&&t<=i&&(i=t-o),s(r)&&r>=c&&(c=r+o),s(t)&&t<c&&(c=t),!n&&i>=c&&(i=c-o),n&&c<=i&&(c=i+o),[i,c]};t(874);const U=({className:e,isLoading:r,disabled:t, /* translators: Submit button text for filters. */ label:o=(0,n.__)("Apply","woocommerce"),onClick:i,screenReaderLabel:c=(0,n.__)("Apply filter","woocommerce")})=>(0,m.jsx)("button",{type:"submit",className:(0,A.A)("wp-block-button__link","wc-block-filter-submit-button","wc-block-components-filter-submit-button",{"is-loading":r},e),disabled:t,onClick:i,children:(0,m.jsx)(T.Label,{label:o,screenReaderLabel:c})}),L=({maxConstraint:e,minorUnit:r})=>({floatValue:t})=>void 0!==t&&t<=e/10**r&&t>0,M=({minConstraint:e,currentMaxValue:r,minorUnit:t})=>({floatValue:o})=>void 0!==o&&o>=e/10**t&&o<r/10**t;t(7165);const I=({className:e, /* translators: Reset button text for filters. */ label:r=(0,n.__)("Reset","woocommerce"),onClick:t,screenReaderLabel:o=(0,n.__)("Reset filter","woocommerce")})=>(0,m.jsx)("button",{className:(0,A.A)("wc-block-components-filter-reset-button",e),onClick:t,children:(0,m.jsx)(T.Label,{label:r,screenReaderLabel:o})}),q=({minPrice:e,maxPrice:r,minConstraint:t,maxConstraint:i,onChange:s,step:a,currency:l,showInputFields:u=!0,showFilterButton:p=!1,inlineInput:d=!0,isLoading:b=!1,isUpdating:_=!1,isEditor:g=!1,onSubmit:w=()=>{}})=>{const h=(0,o.useRef)(null),f=(0,o.useRef)(null),x=a||10**l.minorUnit,[k,y]=(0,o.useState)(e),[E,S]=(0,o.useState)(r),v=(0,o.useRef)(null),[j,P]=(0,o.useState)(0);(0,o.useEffect)(()=>{y(e)},[e]),(0,o.useEffect)(()=>{S(r)},[r]),(0,o.useLayoutEffect)(()=>{d&&v.current&&P(v.current?.offsetWidth)},[d,P]);const F=(0,o.useMemo)(()=>isFinite(t)&&isFinite(i),[t,i]),C=(0,o.useMemo)(()=>isFinite(e)&&isFinite(r)&&F?{"--low":(e-t)/(i-t)*100+"%","--high":(r-t)/(i-t)*100+"%"}:{"--low":"0%","--high":"100%"},[e,r,t,i,F]),N=(0,o.useCallback)(e=>{if(b||!F||!h.current||!f.current)return;const r=e.target.getBoundingClientRect(),t=e.clientX-r.left,o=h.current.offsetWidth,n=+h.current.value,c=f.current.offsetWidth,s=+f.current.value,a=o*(n/i),l=c*(s/i);Math.abs(t-a)>Math.abs(t-l)?(h.current.style.zIndex="20",f.current.style.zIndex="21"):(h.current.style.zIndex="21",f.current.style.zIndex="20")},[b,i,F]),R=(0,o.useCallback)(o=>{const n=o.target.classList.contains("wc-block-price-filter__range-input--min"),c=+o.target.value,a=n?[Math.round(c/x)*x,r]:[e,Math.round(c/x)*x],l=B(a,t,i,x,n);s(l)},[s,e,r,t,i,x]),q=(0,O.YQ)((e,r,t)=>{if(e>=r){const e=B([0,r],null,null,x,t);return s([parseInt(e[0],10),parseInt(e[1],10)])}const o=B([e,r],null,null,x,t);s(o)},1e3),Q=(0,O.YQ)(w,600),Y=(0,A.A)("wc-block-price-filter","wc-block-components-price-slider",u&&"wc-block-price-filter--has-input-fields",u&&"wc-block-components-price-slider--has-input-fields",p&&"wc-block-price-filter--has-filter-button",p&&"wc-block-components-price-slider--has-filter-button",!F&&"is-disabled",(d||j<=300)&&"wc-block-components-price-slider--is-input-inline"),G=(0,c.isObject)(h.current)?h.current.ownerDocument.activeElement:void 0,V=G&&G===h.current?x:1,W=G&&G===f.current?x:1,D=String(k/10**l.minorUnit),K=String(E/10**l.minorUnit),H=d&&j>300,$=(0,m.jsx)("div",{className:(0,A.A)("wc-block-price-filter__range-input-wrapper","wc-block-components-price-slider__range-input-wrapper",{"is-loading":b&&_}),onMouseMove:N,onFocus:N,children:F&&(0,m.jsxs)("div",{"aria-hidden":u,children:[(0,m.jsx)("div",{className:"wc-block-price-filter__range-input-progress wc-block-components-price-slider__range-input-progress",style:C}),(0,m.jsx)("input",{type:"range",className:"wc-block-price-filter__range-input wc-block-price-filter__range-input--min wc-block-components-price-slider__range-input wc-block-components-price-slider__range-input--min","aria-label":(0,n.__)("Filter products by minimum price","woocommerce"),"aria-valuetext":D,value:Number.isFinite(e)?e:t,onChange:R,step:V,min:t,max:i,ref:h,disabled:b&&!F,tabIndex:u?-1:0}),(0,m.jsx)("input",{type:"range",className:"wc-block-price-filter__range-input wc-block-price-filter__range-input--max wc-block-components-price-slider__range-input wc-block-components-price-slider__range-input--max","aria-label":(0,n.__)("Filter products by maximum price","woocommerce"),"aria-valuetext":K,value:Number.isFinite(r)?r:i,onChange:R,step:W,min:t,max:i,ref:f,disabled:b,tabIndex:u?-1:0})]})}),z=e=>`wc-block-price-filter__amount wc-block-price-filter__amount--${e} wc-block-form-text-input wc-block-components-price-slider__amount wc-block-components-price-slider__amount--${e}`,J={currency:l,decimalScale:0},X={...J,displayType:"input",allowNegative:!1,disabled:b||!F,onClick:e=>{const r=e.currentTarget;r&&r.select()}};return(0,m.jsxs)("div",{className:Y,ref:v,children:[(!H||!u)&&$,u&&(0,m.jsxs)("div",{className:"wc-block-price-filter__controls wc-block-components-price-slider__controls",children:[_?(0,m.jsx)("div",{className:"input-loading"}):(0,m.jsxs)("div",{className:"wc-block-price-filter__control wc-block-components-price-slider__control",children:[(0,m.jsx)("label",{className:"wc-block-components-price-slider__label",htmlFor:"minPriceInput",children:(0,n.__)("Min. Price","woocommerce")}),(0,m.jsx)(T.FormattedMonetaryAmount,{...X,id:"minPriceInput",className:z("min"),"aria-label":(0,n.__)("Filter products by minimum price","woocommerce"),isAllowed:M({minConstraint:t,minorUnit:l.minorUnit,currentMaxValue:E}),onValueChange:e=>{e!==k&&(y(e),q(e,E,!0))},value:k})]}),H&&$,_?(0,m.jsx)("div",{className:"input-loading"}):(0,m.jsxs)("div",{className:"wc-block-price-filter__control wc-block-components-price-slider__control",children:[(0,m.jsx)("label",{className:"wc-block-components-price-slider__label",htmlFor:"maxPriceInput",children:(0,n.__)("Max. Price","woocommerce")}),(0,m.jsx)(T.FormattedMonetaryAmount,{...X,id:"maxPriceInput",className:z("max"),"aria-label":(0,n.__)("Filter products by maximum price","woocommerce"),isAllowed:L({maxConstraint:i,minorUnit:l.minorUnit}),onValueChange:e=>{e!==E&&(S(e),q(k,e,!1))},value:E})]})]}),!u&&!_&&Number.isFinite(e)&&Number.isFinite(r)&&(0,m.jsxs)("div",{className:"wc-block-price-filter__range-text wc-block-components-price-slider__range-text",children:[(0,m.jsx)(T.FormattedMonetaryAmount,{...J,value:e}),(0,m.jsx)(T.FormattedMonetaryAmount,{...J,value:r})]}),(0,m.jsxs)("div",{className:"wc-block-components-price-slider__actions",children:[(g||!_&&(e!==t||r!==i))&&(0,m.jsx)(I,{onClick:()=>{s([t,i]),Q()},screenReaderLabel:(0,n.__)("Reset price filter","woocommerce")}),p&&(0,m.jsx)(U,{className:"wc-block-price-filter__button wc-block-components-price-slider__button",isLoading:_,disabled:b||!F,onClick:w,screenReaderLabel:(0,n.__)("Apply price filter","woocommerce")})]})]})};t(9300);const Q=({children:e})=>(0,m.jsx)("div",{className:"wc-block-filter-title-placeholder",children:e}),Y=window.wc.priceFormat,G=window.wp.url,V=(0,i.getSettingWithCoercion)("isRenderingPhpTemplate",!1,c.isBoolean);function W(e){return window?(0,G.getQueryArg)(window.location.href,e):null}function D(e){if(V){const r=new URL(e);r.pathname=r.pathname.replace(/\/page\/[0-9]+/i,""),r.searchParams.delete("paged"),r.searchParams.forEach((e,t)=>{t.match(/^query(?:-[0-9]+)?-page$/)&&r.searchParams.delete(t)}),window.location.href=r.href}else window.history.replaceState({},"",e)}const K="ROUND_UP",H="ROUND_DOWN",$=(e,r,t)=>{const o=1*10**r;let n=null;const i=parseFloat(e);isNaN(i)||(t===K?n=Math.ceil(i/o)*o:t===H&&(n=Math.floor(i/o)*o));const c=x(n,Number.isFinite);return Number.isFinite(n)?n:c};t(3846);const z=(0,o.createContext)({});function J(e,r){return Number(e)*10**r}const X=JSON.parse('{"uK":{"F8":{"A":3}}}');(e=>{const r=Array.from(document.body.querySelectorAll(w.join(","))),{Block:t,getProps:o,getErrorBoundaryProps:n,selector:i,options:c={multiple:!0}}=e,s=(({Block:e,getProps:r,getErrorBoundaryProps:t,selector:o,wrappers:n,options:i})=>{let c=Array.from(document.body.querySelectorAll(o));return n&&n.length>0&&(c=c.filter(e=>!((e,r)=>r.some(r=>r.contains(e)&&!r.isSameNode(e)))(e,n))),!1===i?.multiple&&(c=c.slice(0,1)),f({Block:e,containers:c,getProps:r,getErrorBoundaryProps:t})})({Block:t,getProps:o,getErrorBoundaryProps:n,selector:i,options:c,wrappers:r});r.forEach(r=>{r.addEventListener("wc-blocks_render_blocks_frontend",()=>{(({Block:e,getProps:r,getErrorBoundaryProps:t,selector:o,wrapper:n,options:i})=>{let c=Array.from(n.querySelectorAll(o));!1===i?.multiple&&(c=c.slice(0,1)),f({Block:e,containers:c,getProps:r,getErrorBoundaryProps:t})})({...e,wrapper:r})})})})({selector:".wp-block-woocommerce-price-filter:not(.wp-block-woocommerce-filter-wrapper .wp-block-woocommerce-price-filter)",Block:({attributes:e,isEditor:r=!1})=>{const t=(()=>{const{wrapper:e}=(0,o.useContext)(z);return r=>{e&&e.current&&(e.current.hidden=!r)}})(),n=(0,i.getSettingWithCoercion)("hasFilterableProducts",!1,c.isBoolean),s=(0,i.getSettingWithCoercion)("isRenderingPhpTemplate",!1,c.isBoolean),[a,l]=(0,o.useState)(!1),u=W("min_price"),p=W("max_price"),[d]=P(),b=(0,i.getSettingWithCoercion)("queryState",{},c.isObject),{data:_,isLoading:g}=R({queryPrices:!0,queryState:{...b,...d},isEditor:r}),w=(0,Y.getCurrencyFromPriceResponse)((0,c.objectHasProp)(_,"price_range")?_.price_range:void 0),[h,f]=F("min_price"),[k,y]=F("max_price"),[E,S]=(0,o.useState)(J(u,w.minorUnit)||null),[v,j]=(0,o.useState)(J(p,w.minorUnit)||null),{minConstraint:C,maxConstraint:N}=(({minPrice:e,maxPrice:r,minorUnit:t})=>({minConstraint:$(e||"",t,H),maxConstraint:$(r||"",t,K)}))({minPrice:(0,c.objectHasProp)(_,"price_range")&&(0,c.objectHasProp)(_.price_range,"min_price")&&(0,c.isString)(_.price_range.min_price)?_.price_range.min_price:void 0,maxPrice:(0,c.objectHasProp)(_,"price_range")&&(0,c.objectHasProp)(_.price_range,"max_price")&&(0,c.isString)(_.price_range.max_price)?_.price_range.max_price:void 0,minorUnit:w.minorUnit});(0,o.useEffect)(()=>{a||(f(J(u,w.minorUnit)),y(J(p,w.minorUnit)),l(!0))},[w.minorUnit,a,p,u,y,f]);const[A,T]=(0,o.useState)(g),B=(0,o.useCallback)((e,r)=>{const t=r>=Number(N)?void 0:r,o=e<=Number(C)?void 0:e;if(window){const e=function(e,r){const t={};for(const[e,o]of Object.entries(r))o?t[e]=o.toString():delete t[e];const o=(0,G.removeQueryArgs)(e,...Object.keys(r));return(0,G.addQueryArgs)(o,t)}(window.location.href,{min_price:o/10**w.minorUnit,max_price:t/10**w.minorUnit});window.location.href!==e&&D(e)}f(o),y(t)},[C,N,f,y,w.minorUnit]),U=(0,O.YQ)(B,500),L=(0,o.useCallback)(r=>{T(!0),r[0]!==E&&S(r[0]),r[1]!==v&&j(r[1]),s&&a&&!e.showFilterButton&&U(r[0],r[1])},[E,v,S,j,s,a,U,e.showFilterButton]);(0,o.useEffect)(()=>{e.showFilterButton||s||U(E,v)},[E,v,e.showFilterButton,U,s]);const M=x(h),I=x(k),V=x(C),X=x(N);if((0,o.useEffect)(()=>{(!Number.isFinite(E)||h!==M&&h!==E||C!==V&&C!==E)&&S(Number.isFinite(h)?h:C),(!Number.isFinite(v)||k!==I&&k!==v||N!==X&&N!==v)&&j(Number.isFinite(k)?k:N)},[E,v,h,k,C,N,V,X,M,I]),!n)return t(!1),null;if(!g&&(null===C||null===N||C===N))return t(!1),null;const Z=`h${e.headingLevel}`;t(!0),!g&&A&&T(!1);const ee=(0,m.jsx)(Z,{className:"wc-block-price-filter__title",children:e.heading}),re=g&&A?(0,m.jsx)(Q,{children:ee}):ee;return(0,m.jsxs)(m.Fragment,{children:[!r&&e.heading&&re,(0,m.jsx)("div",{className:"wc-block-price-slider",children:(0,m.jsx)(q,{minConstraint:C,maxConstraint:N,minPrice:E,maxPrice:v,currency:w,showInputFields:e.showInputFields,inlineInput:e.inlineInput,showFilterButton:e.showFilterButton,onChange:L,onSubmit:()=>B(E,v),isLoading:g,isUpdating:A,isEditor:r})})]})},getProps:e=>{return{attributes:(r=e.dataset,{heading:(0,c.isString)(r?.heading)?r.heading:"",headingLevel:(0,c.isString)(r?.headingLevel)&&parseInt(r.headingLevel,10)||X.uK.F8.A,showFilterButton:"true"===r?.showFilterButton,showInputFields:"false"!==r?.showInputFields,inlineInput:"true"===r?.inlineInput}),isEditor:!1};var r}})},5893:()=>{},9300:()=>{},7165:()=>{},874:()=>{},6599:()=>{},3846:()=>{},1609:e=>{"use strict";e.exports=window.React},790:e=>{"use strict";e.exports=window.ReactJSXRuntime},6087:e=>{"use strict";e.exports=window.wp.element},7723:e=>{"use strict";e.exports=window.wp.i18n},923:e=>{"use strict";e.exports=window.wp.isShallowEqual}},n={};function i(e){var r=n[e];if(void 0!==r)return r.exports;var t=n[e]={exports:{}};return o[e].call(t.exports,t,t.exports,i),t.exports}i.m=o,e=[],i.O=(r,t,o,n)=>{if(!t){var c=1/0;for(u=0;u<e.length;u++){for(var[t,o,n]=e[u],s=!0,a=0;a<t.length;a++)(!1&n||c>=n)&&Object.keys(i.O).every(e=>i.O[e](t[a]))?t.splice(a--,1):(s=!1,n<c&&(c=n));if(s){e.splice(u--,1);var l=o();void 0!==l&&(r=l)}}return r}n=n||0;for(var u=e.length;u>0&&e[u-1][2]>n;u--)e[u]=e[u-1];e[u]=[t,o,n]},i.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return i.d(r,{a:r}),r},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(e,o){if(1&o&&(e=this(e)),8&o)return e;if("object"==typeof e&&e){if(4&o&&e.__esModule)return e;if(16&o&&"function"==typeof e.then)return e}var n=Object.create(null);i.r(n);var c={};r=r||[null,t({}),t([]),t(t)];for(var s=2&o&&e;"object"==typeof s&&!~r.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(r=>c[r]=()=>e[r]);return c.default=()=>e,i.d(n,c),n},i.d=(e,r)=>{for(var t in r)i.o(r,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},i.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.j=493,(()=>{var e={493:0};i.O.j=r=>0===e[r];var r=(r,t)=>{var o,n,[c,s,a]=t,l=0;if(c.some(r=>0!==e[r])){for(o in s)i.o(s,o)&&(i.m[o]=s[o]);if(a)var u=a(i)}for(r&&r(t);l<c.length;l++)n=c[l],i.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return i.O(u)},t=globalThis.webpackChunkwebpackWcBlocksFrontendJsonp=globalThis.webpackChunkwebpackWcBlocksFrontendJsonp||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})();var c=i.O(void 0,[763],()=>i(8424));c=i.O(c),(wc=void 0===wc?{}:wc)["price-filter"]=c})();
Save File
Cancel