// source --> https://www.seminararkaden.de/wp-content/plugins/search-filter-pro/assets/frontend/app.js?ver=53ea2d62de334b9d150f 
/*! For license information please see app.js.LICENSE.txt */
window.searchAndFilter||(window.searchAndFilter={}),window.searchAndFilter.frontend||(window.searchAndFilter.frontend={packages:{core:{hooks:{}},utils:{},components:{},fields:{},registry:{},hooks:{},extensions:{},storybook:{}}}),function(){var e={395:function(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=s(e,i(n)))}return e}function i(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return o.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)r.call(e,n)&&e[n]&&(t=s(t,n));return t}function s(e,t){return t?e?e+" "+t:e+t:e}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},509:function(){const e=Element.prototype.insertBefore,t=new WeakSet;Element.prototype.insertBefore=function(n,r){return n instanceof Text&&r instanceof HTMLElement&&"font"===r.localName&&!t.has(n)?(t.add(n),n):e.call(this,n,r)},window.addEventListener("beforeunload",(()=>{Element.prototype.insertBefore=e}))}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){"use strict";var e={};n.r(e),n.d(e,{get:function(){return h},register:function(){return p}});var t={};n.r(t),n.d(t,{useCallback:function(){return ke},useContext:function(){return Pe},useDebugValue:function(){return Ie},useEffect:function(){return xe},useErrorBoundary:function(){return Te},useId:function(){return De},useImperativeHandle:function(){return Le},useLayoutEffect:function(){return Ee},useMemo:function(){return Ae},useReducer:function(){return Se},useRef:function(){return Ne},useState:function(){return Ce}});var r={};n.r(r),n.d(r,{assignObject:function(){return st},classNames:function(){return tt()},cloneArray:function(){return it},cloneObject:function(){return at},debounce:function(){return dt},forEach:function(){return lt},getNumericString:function(){return ft},getRealInputType:function(){return vt},getUid:function(){return _t},log:function(){return yt},mergeObjects:function(){return ut},mergeRefs:function(){return ct},onDocumentInteractive:function(){return gt},onInitDocument:function(){return pt}});var o={};n.r(o),n.d(o,{Button:function(){return ot},ButtonGroup:function(){return At},CheckableButton:function(){return Et},CheckableOptions:function(){return Tt},CheckableSkeleton:function(){return It},Description:function(){return Ze},FocusProvider:function(){return Ge},Icon:function(){return nt},InputGroup:function(){return Dt},Label:function(){return Je},Popover:function(){return bn},RadioControl:function(){return Sn},TextControl:function(){return An},TextControlContainer:function(){return En},TextInput:function(){return kn},checkableGetNextState:function(){return Pt},useFocusContext:function(){return ze},useFocusDispatch:function(){return Qe},useFocusEvent:function(){return Ye},usePopover:function(){return yn}});var i={};n.r(i),n.d(i,{AutocompleteControl:function(){return Dn},Label:function(){return Rn}});var s={};n.r(s),n.d(s,{Component:function(){return R},Fragment:function(){return $},cloneElement:function(){return se},createContext:function(){return le},createElement:function(){return O},createPortal:function(){return tn},createRef:function(){return q},h:function(){return O},hooks:function(){return t},hydrate:function(){return ie},isValidElement:function(){return v},options:function(){return m},render:function(){return oe},toChildArray:function(){return K}});var l={};n.r(l),n.d(l,{Button:function(){return _r},Checkbox:function(){return er},DatePicker:function(){return mr},PerPage:function(){return Sr},Radio:function(){return Qn},Reset:function(){return yr},Select:function(){return zn},Sort:function(){return Cr},Submit:function(){return vr},Text:function(){return hr},__getInputClassName:function(){return Hn}});var a={};n.r(a),n.d(a,{Autocomplete:function(){return Nr},DatePicker:function(){return Rr},LoadMore:function(){return $r},RangeNumber:function(){return Dr},RangeRadio:function(){return Tr},RangeSelect:function(){return Ir},RangeSlider:function(){return Pr},Selection:function(){return Fr}});var u={};n.r(u),n.d(u,{generateInputId:function(){return xt},getInstanceId:function(){return St},useDebounce:function(){return gn},useInstanceId:function(){return Ct}});var c={};n.r(c),n.d(c,{getScreenDimensions:function(){return Mr},useScreenDimensions:function(){return Hr},useSyncExternalStore:function(){return Vr}});var d={};n.r(d),n.d(d,{add:function(){return Br},applyFilters:function(){return zr},doActions:function(){return Gr},fields:function(){return jr},get:function(){return Kr},queries:function(){return Wr}});const f="searchAndFilter",p=(e,t,n,r=!1)=>{let o=window;e.unshift("frontend"),e.unshift(f);for(const t of e)o[t]||(o[t]={}),o=o[t];if(r&&"object"==typeof o[t])for(const e in n)o[t][e]=n[e];else o[t]=n},h=(e,t)=>{let n=window;e.unshift("frontend"),e.unshift(f);for(const t of e){if(!n[t])return;n=n[t]}return n[t]};var _,m,g,v,b,y,w,C,S,x,E,N,L,A={},k=[],P=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,I=Array.isArray;function T(e,t){for(var n in t)e[n]=t[n];return e}function D(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function O(e,t,n){var r,o,i,s={};for(i in t)"key"==i?r=t[i]:"ref"==i?o=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?_.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)null==s[i]&&(s[i]=e.defaultProps[i]);return F(e,s,r,o,null)}function F(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++g:o,__i:-1,__u:0};return null==o&&null!=m.vnode&&m.vnode(i),i}function q(){return{current:null}}function $(e){return e.children}function R(e,t){this.props=e,this.context=t}function U(e,t){if(null==t)return e.__?U(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?U(e):null}function V(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return V(e)}}function M(e){(!e.__d&&(e.__d=!0)&&b.push(e)&&!H.__r++||y!=m.debounceRendering)&&((y=m.debounceRendering)||w)(H)}function H(){for(var e,t,n,r,o,i,s,l=1;b.length;)b.length>l&&b.sort(C),e=b.shift(),l=b.length,e.__d&&(n=void 0,o=(r=(t=e).__v).__e,i=[],s=[],t.__P&&((n=T({},r)).__v=r.__v+1,m.vnode&&m.vnode(n),X(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[o]:null,i,null==o?U(r):o,!!(32&r.__u),s),n.__v=r.__v,n.__.__k[n.__i]=n,J(i,n,s),n.__e!=o&&V(n)));H.__r=0}function B(e,t,n,r,o,i,s,l,a,u,c){var d,f,p,h,_,m,g=r&&r.__k||k,v=t.length;for(a=j(n,t,g,a,v),d=0;d<v;d++)null!=(p=n.__k[d])&&(f=-1==p.__i?A:g[p.__i]||A,p.__i=d,m=X(e,p,f,o,i,s,l,a,u,c),h=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&te(f.ref,null,p),c.push(p.ref,p.__c||h,p)),null==_&&null!=h&&(_=h),4&p.__u||f.__k===p.__k?a=W(p,a,e):"function"==typeof p.type&&void 0!==m?a=m:h&&(a=h.nextSibling),p.__u&=-7);return n.__e=_,a}function j(e,t,n,r,o){var i,s,l,a,u,c=n.length,d=c,f=0;for(e.__k=new Array(o),i=0;i<o;i++)null!=(s=t[i])&&"boolean"!=typeof s&&"function"!=typeof s?(a=i+f,(s=e.__k[i]="string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?F(null,s,null,null,null):I(s)?F($,{children:s},null,null,null):null==s.constructor&&s.__b>0?F(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,l=null,-1!=(u=s.__i=G(s,n,a,d))&&(d--,(l=n[u])&&(l.__u|=2)),null==l||null==l.__v?(-1==u&&(o>c?f--:o<c&&f++),"function"!=typeof s.type&&(s.__u|=4)):u!=a&&(u==a-1?f--:u==a+1?f++:(u>a?f--:f++,s.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<c;i++)null!=(l=n[i])&&!(2&l.__u)&&(l.__e==r&&(r=U(l)),ne(l,l));return r}function W(e,t,n){var r,o;if("function"==typeof e.type){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=W(r[o],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=U(e)),n.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function K(e,t){return t=t||[],null==e||"boolean"==typeof e||(I(e)?e.some((function(e){K(e,t)})):t.push(e)),t}function G(e,t,n,r){var o,i,s=e.key,l=e.type,a=t[n];if(null===a&&null==e.key||a&&s==a.key&&l==a.type&&!(2&a.__u))return n;if(r>(null==a||2&a.__u?0:1))for(o=n-1,i=n+1;o>=0||i<t.length;){if(o>=0){if((a=t[o])&&!(2&a.__u)&&s==a.key&&l==a.type)return o;o--}if(i<t.length){if((a=t[i])&&!(2&a.__u)&&s==a.key&&l==a.type)return i;i++}}return-1}function z(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||P.test(t)?n:n+"px"}function Q(e,t,n,r,o){var i;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||z(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||z(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])i=t!=(t=t.replace(S,"$1")),t=t.toLowerCase()in e||"onFocusOut"==t||"onFocusIn"==t?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=x,e.addEventListener(t,i?N:E,i)):e.removeEventListener(t,i?N:E,i);else{if("http://www.w3.org/2000/svg"==o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function Y(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=x++;else if(t.t<n.u)return;return n(m.event?m.event(t):t)}}}function X(e,t,n,r,o,i,s,l,a,u){var c,d,f,p,h,_,g,v,b,y,w,C,S,x,E,N,L,A=t.type;if(null!=t.constructor)return null;128&n.__u&&(a=!!(32&n.__u),i=[l=t.__e=n.__e]),(c=m.__b)&&c(t);e:if("function"==typeof A)try{if(v=t.props,b="prototype"in A&&A.prototype.render,y=(c=A.contextType)&&r[c.__c],w=c?y?y.props.value:c.__:r,n.__c?g=(d=t.__c=n.__c).__=d.__E:(b?t.__c=d=new A(v,w):(t.__c=d=new R(v,w),d.constructor=A,d.render=re),y&&y.sub(d),d.props=v,d.state||(d.state={}),d.context=w,d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),b&&null==d.__s&&(d.__s=d.state),b&&null!=A.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=T({},d.__s)),T(d.__s,A.getDerivedStateFromProps(v,d.__s))),p=d.props,h=d.state,d.__v=t,f)b&&null==A.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),b&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(b&&null==A.getDerivedStateFromProps&&v!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(v,w),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(v,d.__s,w)||t.__v==n.__v){for(t.__v!=n.__v&&(d.props=v,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some((function(e){e&&(e.__=t)})),C=0;C<d._sb.length;C++)d.__h.push(d._sb[C]);d._sb=[],d.__h.length&&s.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(v,d.__s,w),b&&null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,h,_)}))}if(d.context=w,d.props=v,d.__P=e,d.__e=!1,S=m.__r,x=0,b){for(d.state=d.__s,d.__d=!1,S&&S(t),c=d.render(d.props,d.state,d.context),E=0;E<d._sb.length;E++)d.__h.push(d._sb[E]);d._sb=[]}else do{d.__d=!1,S&&S(t),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++x<25);d.state=d.__s,null!=d.getChildContext&&(r=T(T({},r),d.getChildContext())),b&&!f&&null!=d.getSnapshotBeforeUpdate&&(_=d.getSnapshotBeforeUpdate(p,h)),N=c,null!=c&&c.type===$&&null==c.key&&(N=Z(c.props.children)),l=B(e,I(N)?N:[N],t,n,r,o,i,s,l,a,u),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),g&&(d.__E=d.__=null)}catch(e){if(t.__v=null,a||null!=i)if(e.then){for(t.__u|=a?160:128;l&&8==l.nodeType&&l.nextSibling;)l=l.nextSibling;i[i.indexOf(l)]=null,t.__e=l}else for(L=i.length;L--;)D(i[L]);else t.__e=n.__e,t.__k=n.__k;m.__e(e,t,n)}else null==i&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):l=t.__e=ee(n.__e,t,n,r,o,i,s,a,u);return(c=m.diffed)&&c(t),128&t.__u?void 0:l}function J(e,t,n){for(var r=0;r<n.length;r++)te(n[r],n[++r],n[++r]);m.__c&&m.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){m.__e(e,t.__v)}}))}function Z(e){return"object"!=typeof e||null==e||e.__b&&e.__b>0?e:I(e)?e.map(Z):T({},e)}function ee(e,t,n,r,o,i,s,l,a){var u,c,d,f,p,h,g,v=n.props,b=t.props,y=t.type;if("svg"==y?o="http://www.w3.org/2000/svg":"math"==y?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=i)for(u=0;u<i.length;u++)if((p=i[u])&&"setAttribute"in p==!!y&&(y?p.localName==y:3==p.nodeType)){e=p,i[u]=null;break}if(null==e){if(null==y)return document.createTextNode(b);e=document.createElementNS(o,y,b.is&&b),l&&(m.__m&&m.__m(t,i),l=!1),i=null}if(null==y)v===b||l&&e.data==b||(e.data=b);else{if(i=i&&_.call(e.childNodes),v=n.props||A,!l&&null!=i)for(v={},u=0;u<e.attributes.length;u++)v[(p=e.attributes[u]).name]=p.value;for(u in v)if(p=v[u],"children"==u);else if("dangerouslySetInnerHTML"==u)d=p;else if(!(u in b)){if("value"==u&&"defaultValue"in b||"checked"==u&&"defaultChecked"in b)continue;Q(e,u,null,p,o)}for(u in b)p=b[u],"children"==u?f=p:"dangerouslySetInnerHTML"==u?c=p:"value"==u?h=p:"checked"==u?g=p:l&&"function"!=typeof p||v[u]===p||Q(e,u,p,v[u],o);if(c)l||d&&(c.__html==d.__html||c.__html==e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(d&&(e.innerHTML=""),B("template"==t.type?e.content:e,I(f)?f:[f],t,n,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":o,i,s,i?i[0]:n.__k&&U(n,0),l,a),null!=i)for(u=i.length;u--;)D(i[u]);l||(u="value","progress"==y&&null==h?e.removeAttribute("value"):null!=h&&(h!==e[u]||"progress"==y&&!h||"option"==y&&h!=v[u])&&Q(e,u,h,v[u],o),u="checked",null!=g&&g!=e[u]&&Q(e,u,g,v[u],o))}return e}function te(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){m.__e(e,n)}}function ne(e,t,n){var r,o;if(m.unmount&&m.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||te(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){m.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&ne(r[o],t,n||"function"!=typeof e.type);n||D(e.__e),e.__c=e.__=e.__e=void 0}function re(e,t,n){return this.constructor(e,n)}function oe(e,t,n){var r,o,i,s;t==document&&(t=document.documentElement),m.__&&m.__(e,t),o=(r="function"==typeof n)?null:n&&n.__k||t.__k,i=[],s=[],X(t,e=(!r&&n||t).__k=O($,null,[e]),o||A,A,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?_.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,s),J(i,e,s)}function ie(e,t){oe(e,t,ie)}function se(e,t,n){var r,o,i,s,l=T({},e.props);for(i in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==i?r=t[i]:"ref"==i?o=t[i]:l[i]=null==t[i]&&null!=s?s[i]:t[i];return arguments.length>2&&(l.children=arguments.length>3?_.call(arguments,2):n),F(e.type,l,r||e.key,o||e.ref,null)}function le(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach((function(e){e.__e=!0,M(e)}))},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+L++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}_=k.slice,m={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(t){e=t}throw e}},g=0,v=function(e){return null!=e&&null==e.constructor},R.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=T({},this.state),"function"==typeof e&&(e=e(T({},n),this.props)),e&&T(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),M(this))},R.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),M(this))},R.prototype.render=$,b=[],w="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,C=function(e,t){return e.__v.__b-t.__v.__b},H.__r=0,S=/(PointerCapture)$|Capture$/i,x=0,E=Y(!1),N=Y(!0),L=0;var ae,ue,ce,de,fe=0,pe=[],he=m,_e=he.__b,me=he.__r,ge=he.diffed,ve=he.__c,be=he.unmount,ye=he.__;function we(e,t){he.__h&&he.__h(ue,e,fe||t),fe=0;var n=ue.__H||(ue.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Ce(e){return fe=1,Se(Ve,e)}function Se(e,t,n){var r=we(ae++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Ve(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=ue,!ue.__f)){var o=function(e,t,n){if(!r.__c.__H)return!0;var o=r.__c.__H.__.filter((function(e){return!!e.__c}));if(o.every((function(e){return!e.__N})))return!i||i.call(this,e,t,n);var s=r.__c.props!==e;return o.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),i&&i.call(this,e,t,n)||s};ue.__f=!0;var i=ue.shouldComponentUpdate,s=ue.componentWillUpdate;ue.componentWillUpdate=function(e,t,n){if(this.__e){var r=i;i=void 0,o(e,t,n),i=r}s&&s.call(this,e,t,n)},ue.shouldComponentUpdate=o}return r.__N||r.__}function xe(e,t){var n=we(ae++,3);!he.__s&&Ue(n.__H,t)&&(n.__=e,n.u=t,ue.__H.__h.push(n))}function Ee(e,t){var n=we(ae++,4);!he.__s&&Ue(n.__H,t)&&(n.__=e,n.u=t,ue.__h.push(n))}function Ne(e){return fe=5,Ae((function(){return{current:e}}),[])}function Le(e,t,n){fe=6,Ee((function(){if("function"==typeof e){var n=e(t());return function(){e(null),n&&"function"==typeof n&&n()}}if(e)return e.current=t(),function(){return e.current=null}}),null==n?n:n.concat(e))}function Ae(e,t){var n=we(ae++,7);return Ue(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ke(e,t){return fe=8,Ae((function(){return e}),t)}function Pe(e){var t=ue.context[e.__c],n=we(ae++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(ue)),t.props.value):e.__}function Ie(e,t){he.useDebugValue&&he.useDebugValue(t?t(e):e)}function Te(e){var t=we(ae++,10),n=Ce();return t.__=e,ue.componentDidCatch||(ue.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]}function De(){var e=we(ae++,11);if(!e.__){for(var t=ue.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function Oe(){for(var e;e=pe.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach($e),e.__H.__h.forEach(Re),e.__H.__h=[]}catch(t){e.__H.__h=[],he.__e(t,e.__v)}}he.__b=function(e){ue=null,_e&&_e(e)},he.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ye&&ye(e,t)},he.__r=function(e){me&&me(e),ae=0;var t=(ue=e.__c).__H;t&&(ce===ue?(t.__h=[],ue.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.forEach($e),t.__h.forEach(Re),t.__h=[],ae=0)),ce=ue},he.diffed=function(e){ge&&ge(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==pe.push(t)&&de===he.requestAnimationFrame||((de=he.requestAnimationFrame)||qe)(Oe)),t.__H.__.forEach((function(e){e.u&&(e.__H=e.u),e.u=void 0}))),ce=ue=null},he.__c=function(e,t){t.some((function(e){try{e.__h.forEach($e),e.__h=e.__h.filter((function(e){return!e.__||Re(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],he.__e(n,e.__v)}})),ve&&ve(e,t)},he.unmount=function(e){be&&be(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{$e(e)}catch(e){t=e}})),n.__H=void 0,t&&he.__e(t,n.__v))};var Fe="function"==typeof requestAnimationFrame;function qe(e){var t,n=function(){clearTimeout(r),Fe&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Fe&&(t=requestAnimationFrame(n))}function $e(e){var t=ue,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),ue=t}function Re(e){var t=ue;e.__c=e.__(),ue=t}function Ue(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Ve(e,t){return"function"==typeof t?t(e):t}var Me=0;function He(e,t,n,r,o,i){t||(t={});var s,l,a=t;if("ref"in a)for(l in a={},t)"ref"==l?s=t[l]:a[l]=t[l];var u={type:e,props:a,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Me,__i:-1,__u:0,__source:o,__self:i};if("function"==typeof e&&(s=e.defaultProps))for(l in s)void 0===a[l]&&(a[l]=s[l]);return m.vnode&&m.vnode(u),u}Array.isArray;const Be=le(),je=le(),We={id:null},Ke=(e,t)=>{switch(t.type){case"SET":return{id:t.id};case"RESET":return{id:null};default:return e}},Ge=({children:e})=>{const[t,n]=Se(Ke,We);return He(Be.Provider,{value:t,children:He(je.Provider,{value:n,children:e})})},ze=()=>Pe(Be);ze.displayName="useFocusContext";const Qe=()=>Pe(je);Qe.displayName="useFocusDispatch";const Ye=(e,t)=>{const{id:n}=ze(),r=Qe();n===t&&(e.current.focus(),r({type:"RESET"}))};Ye.displayName="useFocusEvent";const Xe=()=>{},Je=({showLabel:e,label:t,id:n,forId:r,onClick:o=Xe,isInteractive:i=!0,as:s="div",...l})=>{const a=Qe();return"yes"!==e?null:He(s,{className:"search-filter-label",onClick:()=>{i&&(o&&o(),a({type:"SET",id:r}))},id:n,...l,children:t})};Je.templateVars=["label",["showLabel",{type:"control"}]];const Ze=({showDescription:e,description:t,id:n})=>He($,{children:"yes"===e&&He("div",{id:n,className:"search-filter-description",children:t})});Ze.templateVars=["description",["showDescription",{type:"control"}]];var et=n(395),tt=n.n(et);const nt=({icon:e,className:t,isInteractive:n,isDestructive:r,label:o,onClick:i,...s})=>{const l=["search-filter-icon"];n&&l.push("search-filter-icon--interactive"),r&&l.push("search-filter-icon--destructive"),t&&l.push(t);let a=null;return n&&(a=e=>{"Enter"!==e.code&&"Space"!==e.code||(e.preventDefault(),i(e))}),He("div",{className:tt()(l),onClick:i,role:n?"button":null,tabIndex:n?"0":null,"aria-label":n?o:null,onKeyDown:a,...s,children:He("svg",{className:"search-filter-icon__svg",children:He("use",{xlinkHref:"#sf-svg-"+e})})})},rt=()=>{},ot=({icon:e,className:t,iconPosition:n="left",iconProps:r,disabled:o,label:i,isPressed:s,children:l,isInteractive:a=!0,onClick:u=rt,isSelected:c,value:d,...f})=>He("button",{className:tt()(["search-filter-input-button",t,c?"search-filter-input-button--is-selected":""]),onClick:a?u:null,"aria-pressed":s,disabled:o,"data-option-value":d,...f,children:["left"===n&&e&&He(nt,{icon:e,...r}),l??i,"right"===n&&e&&He(nt,{icon:e,...r})]});ot.templateVars=["label",["isPressed",{type:"control"}]];const it=e=>{const t=[];for(let n=0;n<e.length;n++)t[n]=e[n];return t},st=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");const t=Object(e);for(let e=1;e<arguments.length;e++){const n=arguments[e];if(null!=n)for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])}return t},lt=(e,t)=>{for(let n=0;n<e.length;n++)t(e[n],n)},at=e=>st({},e),ut=function(e){const t=[{}].concat(it(arguments));return st.apply(null,t)},ct=e=>t=>{e.forEach((e=>{"function"==typeof e?e(t):null!==e&&(e.current=t)}))},dt=(e,t)=>{let n=null;return function(){clearTimeout(n);const r=arguments,o=this;n=setTimeout((function(){e.apply(o,r)}),t)}};function ft(e,t,n){return(1===n?e:t).replace(/%d/g,n)}const pt=(e,t="interactive")=>{document.readyState===t?e():document.addEventListener("readystatechange",(()=>{document.readyState===t&&e()}))};let ht=0;const _t=()=>(ht++,ht),mt=new WeakMap,gt=e=>{if(!mt.has(e))if("loading"!==document.readyState)e(),mt.set(e,!0);else{const t=n=>{"loading"!==document.readyState&&(mt.has(e)||(e(),mt.set(e,!0)),document.removeEventListener("readystatechange",t))};document.addEventListener("readystatechange",t)}};function vt(e){return"control"===e.type?e.controlType:e.inputType}const bt=[];window.searchAndFilter.logs=bt;const yt=(e,t="info")=>{bt.push({message:e,type:t}),"error"===t?console.error("Search & Filter: "+e):"warning"===t?console.warn("Search & Filter: "+e):"notice"===t?console.log("Search & Filter: "+e):console.warn("Search & Filter: unknown log type: "+t+" - "+e),window.dispatchEvent(new CustomEvent("search-filter/log",{detail:{message:e,type:t}}))},wt=new WeakMap;function Ct(e,t,n=""){return Ae((()=>St(e,t,n)),[e])}function St(e,t,n=""){if(n)return n;const r=function(e){const t=wt.get(e)||0;return wt.set(e,t+1),t}(e);return t?`${t}-${r}`:r}function xt(e,t,n){return`search-filter-input-${vt(e)}-${t}-${n}`}Ct.displayName="useInstanceId";const Et=({type:e,value:t,groupId:n,checked:r,onChange:o,isInteractive:i=!0,icon:s,iconPosition:l="left",iconProps:a,countLabel:u,children:c,className:d})=>{const f=`search-filter-checkable-button-${n}-${Ct(Et)}`;return He("div",{className:"search-filter-checkable-button","data-option-value":t,children:[He("input",{type:e,id:f,name:`search-filter-input-group-${n}`,value:t,checked:r,onChange:e=>{i&&o(e)},readOnly:!i,tabIndex:i?void 0:-1,className:"search-filter-checkable-button__input"}),He("label",{htmlFor:f,className:tt()("search-filter-input-button","search-filter-checkable-button__label",d,r&&"search-filter-input-button--is-selected"),children:["left"===l&&s&&He(nt,{icon:s,...a}),c,u&&He("span",{className:"search-filter-input-button__count",children:u}),"right"===l&&s&&He(nt,{icon:s,...a})]})]})};var Nt=window.searchAndFilter.frontend.packages.components;const Lt=()=>{},At=({value:e=[],options:t,onChange:n=Lt,multiple:r=!1,showLabel:o,isInteractive:i=!0,label:s,description:l,showDescription:a,inputClassName:u,labelProps:c,icon:d,iconPosition:f,iconProps:p,checkable:h=!1})=>{const _="search-filter-label-"+Ct(Nt.Label),m=h?Et:ot,g=Ct(At),v="search-filter-input-button-group-"+g,b=(t,o)=>{if(!i)return;let s=it(e);if(r)if(o)s.includes(t)||s.push(t);else{const e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s=[t];n(s)},y={id:v,className:tt()("search-filter-input-button-group",u),role:r?"group":"radiogroup","aria-labelledby":_},w=`${v}-description`;return l&&"yes"===a&&(y["aria-describedby"]=w),He($,{children:[He(Nt.Label,{showLabel:o,label:s,id:_,forId:v,isInteractive:i,as:"legend",...c}),He(Ze,{id:w,description:l,showDescription:a}),He("fieldset",{...y,children:t.map(((t,o)=>{const{label:s,value:l,countLabel:a,className:u}=t;let c=!1;c=0===e.length&&""===l||e.includes(l);let _={};return h?(_.type=r?"checkbox":"radio",_.onChange=e=>{b(l,e.target.checked)}):_.onClick=()=>{n([l])},He(m,{value:l,groupId:g,checked:c,onChange:e=>b(l,e.target.checked),isInteractive:i,icon:d,iconPosition:f,iconProps:p,countLabel:a,className:u,..._,children:s},o)}))})]})};At.templateVars=["labelUid",["options",{type:"list"}]];const kt=le({});function Pt(e,t){const n=function(e,t){const n=e.indexOf(t);return n===e.length-1?0:n+1}(e,t);return e[n]}const It=({options:e,showLabel:t,label:n,isInteractive:r=!0,type:o,checkableState:i,onUpdateOption:s,CheckableOptionComponent:l,description:a,showDescription:u,inputClassName:c,labelProps:d,showCount:f})=>{const p=Ct(Nt.Label),h="search-filter-label-"+p,_="search-filter-input-"+o+"-"+Ct(It),m=`${_}-description`,g={id:_,className:c,role:"checkbox"===o?"group":"radiogroup","aria-labelledby":h};return a&&"yes"===u&&(g["aria-describedby"]=m),He(kt.Provider,{value:{checkableState:i,onUpdateOption:s,groupId:p,CheckableOptionComponent:l},children:[He(Nt.Label,{showLabel:t,label:n,id:h,forId:_,isInteractive:r,as:"legend",...d}),He(Nt.Description,{description:a,showDescription:u,id:m}),He(Tt,{id:_,label:n,type:o,options:e,isInteractive:r,className:c,showCount:f,...g})]})};It.templateVars=["labelUid"];const Tt=({id:e,type:t,options:n,isInteractive:r,className:o,showCount:i,nested:s=!1,...l})=>{const{checkableState:a,onUpdateOption:u,groupId:c,CheckableOptionComponent:d}=Pe(kt);return He(s?"div":"fieldset",{id:e,className:tt()("search-filter-input-group",o),...l,children:n.map(((e,n)=>{let o="false";""===e.value&&0===Object.keys(a).length?o="true":a[e.value]&&(o=a[e.value]);const s={groupId:c,key:e.value,option:e,type:t,onUpdate:u,checkedState:o,isInteractive:r,countLabel:i?e.countLabel:null};return He(d,{...s,showCount:i},e.value)}))})};Tt.templateVars=["labelUid",["options",{type:"list",depth:10,child:{type:"object",props:["value","label",{name:"options",type:"list"}]}}]];const Dt=({children:e})=>He("div",{className:"search-filter-input-group",children:e}),Ot={},Ft={isVisible:!1,position:""},qt=(e,t)=>{switch(t.type){case"TOGGLE":{const n=t.name??"popover";let r={...Ft};e[n]&&(r=e[n]);const o=t?.show??!r.isVisible,i=ut(r,{isVisible:o});return ut(e,{[n]:i})}case"SET_POSITION":{const n=t.name??"popover";let r={...Ft};e[n]&&(r=e[n]);const o=ut(r,{position:t.position});return ut(e,{[n]:o})}default:return e}},$t=le(),Rt=le(),Ut=({children:e})=>{const[t,n]=Se(qt,Ot),r=ke((e=>t[e]?t[e]:{...Ft}),[t]);return He($t.Provider,{value:{get:r},children:He(Rt.Provider,{value:n,children:e})})},Vt=()=>Pe($t),Mt=()=>Pe(Rt);function Ht(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function Bt(e,t){this.props=e,this.context=t}(Bt.prototype=new R).isPureReactComponent=!0,Bt.prototype.shouldComponentUpdate=function(e,t){return Ht(this.props,e)||Ht(this.state,t)};var jt=m.__b;m.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),jt&&jt(e)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var Wt=m.__e;m.__e=function(e,t,n,r){if(e.then)for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);Wt(e,t,n,r)};var Kt=m.unmount;function Gt(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=function(e,t){for(var n in t)e[n]=t[n];return e}({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return Gt(e,t,n)}))),e}function zt(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return zt(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Qt(){this.__u=0,this.o=null,this.__b=null}function Yt(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Xt(){this.i=null,this.l=null}m.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Kt&&Kt(e)},(Qt.prototype=new R).__c=function(e,t){var n=t.__c,r=this;null==r.o&&(r.o=[]),r.o.push(n);var o=Yt(r.__v),i=!1,s=function(){i||(i=!0,n.__R=null,o?o(l):l())};n.__R=s;var l=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=zt(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(s,s)},Qt.prototype.componentWillUnmount=function(){this.o=[]},Qt.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Gt(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&O($,null,e.fallback);return o&&(o.__u&=-33),[O($,null,t.__a?null:e.children),o]};var Jt=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function Zt(e){return this.getChildContext=function(){return e.context},e.children}function en(e){var t=this,n=e.h;t.componentWillUnmount=function(){oe(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),t.v||(t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],contains:function(){return!0},appendChild:function(e){this.childNodes.push(e),t.h.appendChild(e)},insertBefore:function(e,n){this.childNodes.push(e),t.h.insertBefore(e,n)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}),oe(O(Zt,{context:t.context},e.__v),t.v)}function tn(e,t){var n=O(en,{__v:e,h:t});return n.containerInfo=t,n}(Xt.prototype=new R).__a=function(e){var t=this,n=Yt(t.__v),r=t.l.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),Jt(t,e,r)):o()};n?n(i):i()}},Xt.prototype.render=function(e){this.i=null,this.l=new Map;var t=K(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Xt.prototype.componentDidUpdate=Xt.prototype.componentDidMount=function(){var e=this;this.l.forEach((function(t,n){Jt(e,n,t)}))};var nn="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,rn=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,on=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,sn=/[A-Z0-9]/g,ln="undefined"!=typeof document,an=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};R.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(R.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var un=m.event;function cn(){}function dn(){return this.cancelBubble}function fn(){return this.defaultPrevented}m.event=function(e){return un&&(e=un(e)),e.persist=cn,e.isPropagationStopped=dn,e.isDefaultPrevented=fn,e.nativeEvent=e};var pn={enumerable:!1,configurable:!0,get:function(){return this.class}},hn=m.vnode;m.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,r={},o=-1===n.indexOf("-");for(var i in t){var s=t[i];if(!("value"===i&&"defaultValue"in t&&null==s||ln&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var l=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===s?s="":"translate"===l&&"no"===s?s=!1:"o"===l[0]&&"n"===l[1]?"ondoubleclick"===l?i="ondblclick":"onchange"!==l||"input"!==n&&"textarea"!==n||an(t.type)?"onfocus"===l?i="onfocusin":"onblur"===l?i="onfocusout":on.test(i)&&(i=l):l=i="oninput":o&&rn.test(i)?i=i.replace(sn,"-$&").toLowerCase():null===s&&(s=void 0),"oninput"===l&&r[i=l]&&(i="oninputCapture"),r[i]=s}}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=K(t.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==n&&null!=r.defaultValue&&(r.value=K(t.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",pn)):(t.className&&!t.class||t.class&&t.className)&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=nn,hn&&hn(e)};var _n=m.__r;m.__r=function(e){_n&&_n(e),e.__c};var mn=m.diffed;m.diffed=function(e){mn&&mn(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value)};const gn=(e,t=1e3)=>{const n=Ne();return xe((()=>{n.current=e}),[e]),Ae((()=>dt((()=>{n.current?.()}),t)),[])},vn=()=>{},bn=({name:e="popup",htmlElement:t="div",closeOnScroll:n=!1,closeOnClickOutside:r=!0,updateOnScroll:o=!0,matchWidth:i=!1,onClickOutside:s=vn,onShow:l=vn,onHide:a=vn,node:u="inline",className:c,elementProps:d,children:f,containerRef:p,sourceRef:h,id:_,isAriaModal:m,ariaLabel:g,role:v,dialogMessage:b,showDialogMessage:y,overridePopoverPositions:w,overrideAttachmentNode:C})=>{const{isVisible:S,position:x}=Vt().get(e),E=Mt();let N=u;window.searchAndFilter?.admin?.popoverNode&&(N=window.searchAndFilter.admin.popoverNode),window.searchAndFilter?.admin?.blockEditor?.popoverNode&&(N=window.searchAndFilter.admin.popoverNode),window.searchAndFilterData?.popoverNode&&(N=window.searchAndFilterData.popoverNode),"function"==typeof C&&(N=C(N));const L=h.current?.ownerDocument||document,A=ke((t=>{E({type:"SET_POSITION",name:e,position:t})}),[e,E]),k="search-filter-component-popover",[P,I]=Ce({}),[T,D]=Ce(!1);let O=Ne(null);p&&(O=p);const F=ke((()=>{E({type:"TOGGLE",name:e,show:!1}),a()}),[e,E,a]),q=Ne(null),$=Ne(null),R=ke(((e="auto")=>{if(!O.current||!h.current)return;let t=e,n=null;if("function"==typeof w){const{position:e,style:r}=w(h.current,i,N,L);t=e,n=r}null===n&&("auto"===e&&(t=((e,t,n="auto",r=document)=>{const o=t.getBoundingClientRect(),i=e.getBoundingClientRect();let s="bottom";if("auto"===n){const t=window.getComputedStyle(e).marginTop,n=parseFloat(t);let l=0;l="px"===t.replace(n,"")?n:0;const a=o.top+o.height+i.height+l,u=o.top-i.height+l;a>(window.innerHeight||r.documentElement.clientHeight)&&(s="top",u<0&&(s="bottom"))}else s=n;return s})(O.current,h.current,e,L)),n=((e,t,n,r=!1,o=document,i="inline")=>{const s=t.getBoundingClientRect(),l=e.getBoundingClientRect(),a={};if("inline"===i){const i=((e,t)=>{let n=0,r=0,o=e;for(;o&&o!==t;)n+=o.offsetTop||0,r+=o.offsetLeft||0,o=o.offsetParent;return{top:n,left:r}})(t,e.offsetParent||o.body);a.position="absolute",a.left=i.left+"px",a.top="top"===n?i.top-l.height+"px":i.top+s.height+"px",r&&(a.width=s.width+"px");const u=wn(t);return a.zIndex=u,a}let u=t,c=[];const d=o.documentElement,f=o.body,p=window.getComputedStyle(d),h=window.getComputedStyle(f),_="static"!==p.position&&parseFloat(p.marginTop)||0,m="static"!==p.position&&parseFloat(p.marginLeft)||0,g=_+("static"!==h.position&&parseFloat(h.marginTop)||0),v=m+("static"!==h.position&&parseFloat(h.marginLeft)||0);for(;u&&u!==o.body;)"visible"!==getComputedStyle(u).overflow&&c.push(u),u=u.parentElement;let b=s;c.forEach((e=>{const t=e.getBoundingClientRect();b={top:Math.max(s.top,t.top),left:Math.max(s.left,t.left),bottom:Math.min(s.bottom,t.bottom),right:Math.min(s.right,t.right)}}));const y=window.scrollX||window.pageXOffset,w=window.scrollY||window.pageYOffset,C=b.left+y-v,S=b.top+w-g;b.right,b.bottom,"body"===i&&("top"===n?(a.left=C+"px",a.top=S-l.height+"px",a.position="absolute"):(a.left=s.left+y-v+"px",a.top=s.top+s.height+w-g+"px",a.position="absolute")),r&&(a.width=s.width+"px");const x=wn(t);return a.zIndex=x,a})(O.current,h.current,t,i,L,N)),q.current=t,A(t),D(!0),I(n)}),[i,A,D,I,w,O,h,L]),U=ke((e=>{if(S&&h.current&&e.target.contains(h.current))if(n)F();else if(!n&&O.current&&h.current){let e="auto";!1===o&&(e=q.current),R(e)}}),[S,n,o,R,h,F]);gn((()=>{R("auto")}),1),Ee((()=>{if(!O.current||!h.current)return;const e=new ResizeObserver((e=>{window.requestAnimationFrame((()=>{R("auto")}))}));if(O.current,h.current){e.observe(h.current);let t=h.current?.parentNode;const n=[window.Node.DOCUMENT_NODE,window.Node.DOCUMENT_TYPE_NODE,window.Node.DOCUMENT_FRAGMENT_NODE];for(;t&&!n.includes(t.nodeType);){if(t&&t.nodeType===window.Node.ELEMENT_NODE)try{e.observe(t)}catch(e){}t=t.parentNode}}return()=>{if(O.current,h.current){e.unobserve(h.current);let t=h.current?.parentNode;for(;t&&t!==L.body;)t.nodeType===window.Node.ELEMENT_NODE&&e.unobserve(t),t=t.parentNode}}}),[O,h.current]);const V=Ne(null);Ee((()=>{V.current=window.innerWidth}),[]),xe((()=>($.current=S,S?window.addEventListener("scroll",U,!0):window.removeEventListener("scroll",U,!0),()=>{window.removeEventListener("scroll",U,!0)})),[S,U]),xe((()=>{const e=e=>{$.current&&V.current!==window.innerWidth&&(V.current=window.innerWidth,F())};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[F]),xe((()=>{const e=e=>{h.current&&e.detail===h.current&&R("auto")};return window.addEventListener("searchFilterComponentDomUpdate",e),()=>{window.removeEventListener("searchFilterComponentDomUpdate",e)}}),[R]),Ee((()=>{R("auto"),S&&l(h)}),[S,R,l]),Ee((()=>{if(!r)return;const e=e=>{const t=e.target.closest(`.${k}`);!h.current||h.current.contains(e.target)||t||(s(),F())};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[h,F,r,s]);const M=["search-filter-base",k,`${k}--position-${x}`,(!S||!T)&&`${k}--hidden`,c],H=He(t,{style:P,id:_,className:tt()(M),ref:O,"aria-modal":m?"true":void 0,role:v,"aria-label":g||void 0,...d,children:[f,b&&He("div",{"aria-live":"polite",className:"search-filter-component-popup__dialog-message"+(y?"":" search-filter-component-popup__dialog-message-hidden"),children:b})]});return"inline"===N?H:tn(H,L.body)},yn=(e="popover")=>{const t=Vt().get(e),n=Mt();return{isVisible:t.isVisible,toggle:t=>{const r={type:"TOGGLE",name:e};void 0!==t&&(r.show=t),n(r)},position:t.position}},wn=e=>{let t=1e3;for(;e;){const n=window.getComputedStyle(e),r=parseInt(n.zIndex,10);if(r&&0!==r&&r>=t){t=r+1;break}e=e.parentElement}return t},Cn=["false","true"],Sn=({type:e,options:t,value:n,onChange:r,showLabel:o,label:i,isInteractive:s,...l})=>{const[a,u]=function(e,t){const[n,r]=Ce({});return Ee((()=>{e&&e.length>0?r({[e[0]]:"true"}):r({})}),[e]),[n,e=>{const r=n[e]??"false",o=Pt(Cn,r);t("true"===o?[e]:[])}]}(n,r);return He(It,{type:"radio",options:t,value:n,onChange:r,checkableState:a,onUpdateOption:u,CheckableOptionComponent:xn,showLabel:o,label:i,isInteractive:s,...l})},xn=({option:e,type:t,onUpdate:n,isInteractive:r=!0,checkedState:o="false",groupId:i,countLabel:s,showCount:l})=>{const{label:a,value:u,options:c,id:d}=e,f=Ct(xn),p=xt(t,i,d??f),h="true"===o,_="search-filter-input-"+t,m=h?" "+_+"--is-active":"",g=c?.length>0;let v="";"true"===o&&(v="-checked");const b=`#sf-svg-${t}${v}`;return He("div",{className:_+m,"data-option-value":u,children:[He("input",{id:p,type:t,readOnly:!r,tabIndex:r?null:-1,className:"search-filter-input-"+t+"__input",onChange:e=>{e.preventDefault(),n(u)},checked:h,name:`search-filter-input-group-${i}`,"aria-checked":o,value:u}),He("label",{htmlFor:p,className:"search-filter-input-"+t+"__container",onClick:e=>{r||e.preventDefault()},children:[He("span",{className:"search-filter-input-"+t+"__control","aria-hidden":"true",children:He("svg",{children:He("use",{xlinkHref:b})})}),He("span",{className:"search-filter-input-"+t+"__label",children:[a,s?He("span",{className:"search-filter-input-"+t+"__count",translate:"no",children:s}):null]})]}),g&&He(Tt,{type:t,options:c,isInteractive:r,showCount:l,nested:!0})]})};xn.templateVars=["value","label","uid",["hasChildren",{type:"control"}],"checkedState","activeClass","svgLink",["options",{type:"list",depth:10,child:{type:"object",props:["value","label",{name:"options",type:"list"}]}}]];const En=({className:e,isFocused:t,onClick:n,cRef:r,children:o})=>He($,{children:He("div",{className:tt()({"search-filter-input-text":!0,"search-filter-input-text--focused":t,[e]:!!e}),onClick:n,ref:r,children:o})}),Nn=()=>{},Ln={},An=({className:e,value:t="",icon:n,iconPosition:r="left",hasClear:o=!1,placeholder:i,labelProps:s,showLabel:l,label:a,id:u,isInteractive:c=!0,focusStyles:d=!0,children:f,onChange:p=Nn,onFocus:h=Nn,onBlur:_=Nn,onClick:m=Nn,onClear:g=Nn,onEnter:v=Nn,inputRef:b,controlRef:y,describedBy:w,onClickIcon:C,inputProps:S=Ln,inputClassName:x,iconProps:E=Ln,description:N,showDescription:L})=>{const A=Ne(null),k=b||A,[P,I]=Ce(!1),T=Ct(An),D=u??"search-filter-input-text-"+T,O="search-filter-label-"+Ct(Nt.Label),F=""!==t;Ye(k,D);const q=Qe(),R=()=>{q({type:"SET",id:D}),d&&I(!0)},U=n?He(nt,{className:"search-filter-input-text__icon",icon:n,onClick:e=>{c&&(C?C(e):(R(),m(e)))},isInteractive:c&&C,"aria-controls":S.name?S.name:void 0,"aria-hidden":!S.name||void 0,...E}):null;return He($,{children:[He(Nt.Label,{showLabel:l,label:a,id:O,forId:D,isInteractive:c,...s}),He(Ze,{description:N,showDescription:L}),He(En,{isFocused:P,className:tt()("search-filter-input-text",e),cRef:y,onClick:()=>{c&&R()},children:[U&&"left"===r?U:null,He(kn,{id:D,"aria-labelledby":"yes"===l?O:null,"aria-label":"yes"===l?null:a,className:tt()("search-filter-input-text__input",x),autoComplete:"off",value:t,onInput:e=>{p(c?e.target.value:"")},onKeyDown:e=>{c&&"Enter"===e.key&&v(e)},readOnly:!c,tabIndex:c?null:-1,onFocus:()=>{c&&(d&&I(!0),h())},onBlur:()=>{c&&(d&&I(!1),_())},inputRef:k,onClick:e=>{c&&m(e)},placeholder:i,"aria-describedby":w?w.id:void 0,...S}),w&&He("span",{className:"search-filter-input-text__description",id:w.id,children:w.content}),f,o&&F&&He(nt,{className:"search-filter-input-text__clear-button",icon:"clear",onClick:function(){c&&(R(),g!==Nn?g():p(""))},isInteractive:!0,isDestructive:!0,label:"Clear input"}),U&&"right"===r?U:null]})]})};An.templateVars=["placeholder","uid","labelUid"];const kn=e=>{const t=at(e),n=e.value,r=e.inputRef;return delete t.value,delete t.inputRef,He("input",{type:"text",value:n,ref:r,...t})};kn.templateVars=["value"];var Pn=window.searchAndFilter.frontend.packages.hooks,In=window.searchAndFilter.frontend.packages.utils;const Tn=e=>{const{id:t,icon:n,inputRef:r,controlRef:o,label:i,showLabel:s,hasClear:l,onChange:a,value:u,placeholder:c,readOnly:d,onEnter:f,onClick:p,isInteractive:h,inputProps:_,controlProps:m,isLoading:g,popupVisible:v,inputClassName:b,...y}=e,{className:w,...C}=m,S=Ae((()=>({..._,...C})),[_,C]);return He(Nt.TextControl,{id:t,icon:n,inputRef:r,controlRef:o,label:i,showLabel:s,hasClear:(!v||!g)&&l,onChange:a,className:tt()("search-filter-component-autocomplete-control",w,b),value:u,placeholder:c,readOnly:d,onEnter:f,onClick:p,focusStyles:!1,isInteractive:h,inputProps:S,...y,children:g&&v?He(Nt.Icon,{icon:"spinner-circle",className:"search-filter-component-autocomplete-control__loading-icon"}):null})},Dn=e=>e.apiUrl?He(Fn,{...e}):He(On,{...e}),On=e=>{const{isLoading:t}=e,n="search-filter-component-combobox-base",r=He("div",{"aria-live":"polite",role:"status",className:tt()(`${n}__listbox-option`,`${n}__listbox-option--disabled`),children:e.loadingText??"Looking for suggestions…"});return He(Nt.ComboboxBase,{InputComponent:Tn,hideSuggestionsOnEmpty:!0,listboxContent:t?r:null,...e})};Dn.templateVars=["placeholder","uid","labelUid"];const Fn=e=>{const{apiUrl:t,apiArgs:n,useCache:r}=e,{suggestions:o,isLoading:i}=qn(t,e.value??"",n,r);return He(On,{...e,options:o,isLoading:i})},qn=(e,t,n,r=!0)=>{const[o,i]=Ce([]),[s,l]=Ce(!1),a=(0,Pn.useDebounce)((()=>{(()=>{const{fieldId:r,attributes:o}=n,s={method:"GET",headers:{"Content-Type":"application/json"}};let a=e,u={};window.searchAndFilterData?.suggestionsNonce&&(u={nonce:window.searchAndFilterData.suggestionsNonce}),(e=>e&&0!==e&&""!==e)(r)?a=((e,t)=>{const n=new URL(e),r=new URLSearchParams(n.search);return Object.keys(t).forEach((e=>{r.append(e,t[e])})),n.search=r,n.toString()})(e,{search:t,fieldId:r,...u}):(s.method="POST",s.body=JSON.stringify({search:t,attributes:o,...u}),window.searchAndFilter?.admin?.restNonce&&(s.headers["X-WP-Nonce"]=window.searchAndFilter.admin.restNonce)),fetch(a,s).then((e=>e.json())).then((e=>(((e,t)=>{i((n=>({...n,[e]:t})))})(t,e),l(!1),e))).catch((e=>{l(!1),"AbortError"!==e.name&&(0,In.log)("Unable to fetch suggestions, message: "+e.message,"error")}))})()}),400);return Ee((()=>{if(""===t)return;if(o[t]&&r)return;const e=new AbortController;return l(!0),a(),()=>{e.abort()}}),[t]),""===t?{suggestions:[],isLoading:!1}:{suggestions:o[t],isLoading:s}},$n=()=>{},Rn=({showLabel:e,label:t,id:n,forId:r,isInteractive:o=!0,isToggle:i=!1,fieldIsOpen:s=!0,onClick:l=$n,as:a="div"})=>{const u=(0,Nt.useFocusDispatch)();if("yes"!==e)return null;const c=i&&o;return He(a,{className:"search-filter-label",onClick:()=>{o&&(l(),i||u({type:"SET",id:r}))},id:n,tabIndex:c?"0":null,role:i?"button":null,"aria-expanded":i?s:null,"aria-controls":i?r:null,onKeyDown:c?e=>{"Enter"===e.key?l():" "===e.key&&(e.preventDefault(),l())}:null,children:[t,i?He(Nt.Icon,{icon:"arrow-down",className:tt()(["search-filter-label__toggle-icon",s?"search-filter-label__toggle-icon--up":"search-filter-label__toggle-icon--down"])}):null]})};Rn.templateVars=["label",["showLabel",{type:"control"}]];var Un=le({});const Vn=(e,t)=>e[t]??null,Mn=e=>({storeKey:t,...n})=>{const r=Pe(Un),[o,i]=Ce(Vn(r.getState(),t)),s=()=>{const e=Vn(r.getState(),t);e!==o&&i(e)};xe((()=>(r.subscribe(s),s(),()=>{r.unsubscribe(s)})),[]);const l=Vn(r.getState(),t);return He(e,{...l,...n})};Mn.displayName="withStoreKey";const Hn=e=>tt()("search-filter-field__input",e),Bn=()=>window.innerWidth<768||window.innerHeight<768,jn=()=>window.searchAndFilterData?.urlPrefix??"_",Wn=[],Kn=(e,t,n)=>Ae((()=>{if("yes"!==t)return e??Wn;let r=Array.isArray(e)?[...e]:Wn;return r.unshift({label:n,value:""}),r}),[e,t,n]),Gn={},zn=Mn((e=>{const{values:t,attributes:n,options:r,onChange:o,onClear:i,listboxClassName:s,listboxProps:l,isInteractive:a,id:u,closeListboxOnScroll:c=!1,moveListboxOnScroll:d=!1,extensions:f=Gn}=e,p=Kn(r,n?.inputOptionsAddDefault,n?.inputOptionsDefaultLabel),{multiple:h,inputScale:_,placeholder:m,label:g,showLabel:v,showCount:b,inputNoResultsText:y,inputEnableSearch:w,description:C,showDescription:S,stylesId:x,type:E,inputType:N,dropdownAttachment:L,inputBorderDivider:A="yes"}=n;return He(Nt.ComboboxControl,{value:t,multiple:"yes"===h,scale:_,options:p,pageAmount:5,onChange:o,onClear:i,closeListboxOnScroll:c,moveListboxOnScroll:d,placeholder:m,label:g,showLabel:v,showCount:b,noResultsText:y,listboxClassName:tt()([s,"search-filter-field__popup",`search-filter-field__popup--id-${u}`,`search-filter-style--id-${x}`,`search-filter-style--${E}-${N}`]),listboxAttachment:L,isInteractive:a,description:C,showDescription:S,showDivider:"yes"===A,listboxProps:l,...f,inputClassName:Hn(f.inputClassName),enableSearch:"no"!==w&&!Bn()})})),Qn=Mn((e=>{const{values:t,attributes:n,options:r,onChange:o,isInteractive:i,extensions:s={}}=e,l=Kn(r,n?.inputOptionsAddDefault,n?.inputOptionsDefaultLabel);return He(Sn,{value:t,options:l,onChange:o,type:n.inputType,label:n.label,showLabel:n.showLabel,isInteractive:i,description:n.description,showDescription:n.showDescription,showCount:n.showCount,...s,inputClassName:Hn(s.inputClassName)})})),Yn=["false","true"],Xn=({type:e,options:t,value:n,onChange:r,showLabel:o,label:i,isInteractive:s,...l})=>{const[a,u]=function(e,t){const[n,r]=Ce({});return Ee((()=>{if(e&&e.length>0){const t={};e.forEach((e=>{t[e]="true"})),console.log("NEW STATE",t),r(t)}else r({})}),[e]),[n,r=>{const o=n[r]??"false",i=Pt(Yn,o),s=[...e||[]];if("true"===i)-1===s.indexOf(r)&&s.push(r);else{const e=s.indexOf(r);-1!==e&&s.splice(e,1)}t(s)}]}(n,r);return He(It,{type:"checkbox",options:t,value:n,onChange:r,checkableState:a,onUpdateOption:u,CheckableOptionComponent:Jn,showLabel:o,label:i,isInteractive:s,...l})},Jn=({option:e,type:t,onUpdate:n,isInteractive:r=!0,checkedState:o="false",groupId:i,countLabel:s,showCount:l})=>{const{label:a,value:u,options:c,id:d}=e,f=Ct(Jn),p=xt(t,i,d??f),h="true"===o,_="search-filter-input-"+t,m=h?" "+_+"--is-active":"",g=c?.length>0;let v="";"true"===o&&(v="-checked");const b=`#sf-svg-${t}${v}`;return He("div",{className:_+m,"data-option-value":u,children:[He("input",{id:p,type:t,readOnly:!r,tabIndex:r?null:-1,className:"search-filter-input-"+t+"__input",onChange:e=>{e.preventDefault(),n(u)},checked:h,name:`search-filter-input-group-${i}`,"aria-checked":o,value:u}),He("label",{htmlFor:p,className:"search-filter-input-"+t+"__container",onClick:e=>{r||e.preventDefault()},children:[He("span",{className:"search-filter-input-"+t+"__control","aria-hidden":"true",children:He("svg",{children:He("use",{xlinkHref:b})})}),He("span",{className:"search-filter-input-"+t+"__label",children:[a,s?He("span",{className:"search-filter-input-"+t+"__count",translate:"no",children:s}):null]})]}),g&&He(Tt,{type:t,options:c,isInteractive:r,showCount:l,nested:!0})]})};Jn.templateVars=["value","label","uid",["hasChildren",{type:"control"}],"checkedState","activeClass","svgLink",["options",{type:"list",depth:10,child:{type:"object",props:["value","label",{name:"options",type:"list"}]}}]];const Zn={},er=Mn((e=>{const{values:t,attributes:n,options:r,onChange:o,isInteractive:i,extensions:s=Zn}=e,{inputCheckboxTristate:l}=n;let a=Nt.CheckboxControl;return"no"===l&&(a=Xn),He(a,{value:t,options:r,onChange:o,type:n.inputType,label:n.label,showLabel:n.showLabel,isInteractive:i,hierarchical:n.taxonomyHierarchical,description:n.description,showDescription:n.showDescription,showCount:n.showCount,...s,inputClassName:Hn(s.inputClassName)})}));function tr(e,t){for(var n in t)e[n]=t[n];return e}function nr(e){var t=[];function n(e){for(var n=[],r=0;r<t.length;r++)t[r]===e?e=null:n.push(t[r]);t=n}function r(n,r,o){e=r?n:tr(tr({},e),n);for(var i=t,s=0;s<i.length;s++)i[s](e,o)}return e=e||{},{action:function(t){function n(e){r(e,!1,t)}return function(){for(var r=arguments,o=[e],i=0;i<arguments.length;i++)o.push(r[i]);var s=t.apply(this,o);if(null!=s)return s.then?s.then(n):n(s)}},setState:r,subscribe:function(e){return t.push(e),function(){n(e)}},unsubscribe:n,getState:function(){return e}}}var rr=le({});const or={setAttributes(e,t,n){if(void 0===e[t])return e;const r=at(e),o=at(e[t]);return o.attributes=ut(o.attributes,n),r[t]=o,r},setProps(e,t,n){if(void 0===e[t])return e;const r=at(e),o=ut(e[t],n);return r[t]=o,r},setProp(e,t,n,r){if(void 0===e[t])return e;const o=at(e),i=ut(e[t],{[n]:r});return o[t]=i,o},setQuery(e,t,n){const r=at(e);return r[t]=at(n),r},removeQuery(e,t){const n=at(e);return n[t]&&delete n[t],n}},ir=nr({}),sr=(((e,t)=>{"function"==typeof e&&(e=e(t));const n={};for(const r in e)n[r]=t.action(e[r])})(or,ir),new WeakMap);sr.set(ir,or);const lr=function(e,t,n){const r=it(arguments);r.splice(0,2),r.unshift(t.getState());const o=sr.get(t)[e].apply(null,r);t.setState(o,!0)},ar=function(e){const t=it(arguments);t.splice(1,0,ir),lr.apply(null,t)},ur={},cr=(e,t)=>e[t]??ur,dr=(e,t)=>{const n=Pe(rr),r=cr(n.getState(),e),[o,i]=Ce(r[t]),s=()=>{const r=cr(n.getState(),e);r[t]!==o&&i(r[t])};return Ee((()=>(n.subscribe(s),()=>{n.unsubscribe(s)})),[]),cr(n.getState(),e)[t]??ur},fr=e=>dr(e,"actions"),pr=()=>{},hr=Mn((e=>{const{values:t,attributes:n,onChange:r,onClear:o,isInteractive:i,queryStoreKey:s,extensions:l={},icon:a="search"}=e,{submit:u=pr}=fr(s),c=t?t[0]:"";return He(An,{value:c,onChange:e=>{r([e])},onClear:o,icon:"yes"===n.inputShowIcon?a:null,iconPosition:n.inputIconPosition,hasClear:!0,placeholder:n.placeholder,label:n.label,showLabel:n.showLabel,isInteractive:i,onEnter:()=>{u()},description:n.description,showDescription:n.showDescription,...l,className:Hn(l.inputClassName)})})),_r=Mn((e=>{const{values:t,options:n,onChange:r,isInteractive:o,type:i,attributes:s={},extensions:l={}}=e,{inputOptionsAddDefault:a,inputOptionsDefaultLabel:u,label:c,showLabel:d,multiple:f,description:p,showDescription:h}=s,_=Kn(n,a,u);return He(At,{value:t,options:_,onChange:r,type:i,label:c,showLabel:d,multiple:"yes"===f,isInteractive:o,description:p,showDescription:h,...l,inputClassName:Hn(l.inputClassName),checkable:!0})})),mr=Mn((e=>{const{values:t,attributes:n,onChange:r,onClear:o,calendarClassName:i,isInteractive:s,id:l,extensions:a={},icon:u="event",hasClear:c=!0,flatpickrOptions:d}=e,f=t[0]?t[0]:"";return He(Nt.DatePickerControl,{value:f,onChange:e=>{r([e])},onClear:o,icon:"yes"===n.inputShowIcon?u:null,hasClear:c,placeholder:n.placeholder,label:n.label,showLabel:n.showLabel,dateFormat:"custom"===n.dateDisplayFormat?n.dateDisplayFormatCustom:n.dateDisplayFormat,calendarClassName:tt()(["search-filter-base",i,"search-filter-field__popup",`search-filter-field__popup--id-${l}`,`search-filter-style--id-${n.stylesId}`,`search-filter-style--${n.type}-${n.inputType}`]),isInteractive:s,description:n.description,showDescription:n.showDescription,flatpickrOptions:d,...a,inputClassName:Hn(a.inputClassName)})})),gr=()=>{},vr=Mn((e=>{const{attributes:t,queryStoreKey:n,icon:r,isInteractive:o}=e,{submit:i=gr}=fr(n);return He(ot,{onClick:i,icon:r,label:t.label,showLabel:t.showLabel,isInteractive:o,className:"search-filter-field__input"})})),br=()=>{},yr=Mn((e=>{const{attributes:t,queryStoreKey:n,icon:r,isInteractive:o}=e,{reset:i=br}=fr(n);return He(ot,{onClick:i,icon:r,label:t.label,showLabel:t.showLabel,isInteractive:o,className:"search-filter-field__input"})})),wr={},Cr=Mn((e=>{const{values:t,attributes:n,onChange:r,listboxClassName:o,isInteractive:i,id:s,closeListboxOnScroll:l=!1,moveListboxOnScroll:a=!1,listboxProps:u=wr,extensions:c={},options:d=[]}=e;return He(Nt.ComboboxControl,{value:t,multiple:"yes"===n.multiple,scale:n.inputScale,options:d,pageAmount:5,onChange:r,closeListboxOnScroll:l,moveListboxOnScroll:a,placeholder:n.placeholder,label:n.label,showLabel:n.showLabel,showCount:n.showCount,listboxClassName:tt()([o,"search-filter-field__popup",`search-filter-field__popup--id-${s}`,`search-filter-style--id-${n.stylesId}`,`search-filter-style--${n.type}-${n.controlType}`]),listboxProps:u,isInteractive:i,description:n.description,showDescription:n.showDescription,...c,inputClassName:Hn(c.inputClassName),enableSearch:!Bn()})})),Sr=Mn((e=>{const{values:t,attributes:n,onChange:r,setValuesAndLabels:o,listboxClassName:i,isInteractive:s,id:l,closeListboxOnScroll:a=!1,moveListboxOnScroll:u=!1,extensions:c={},options:d}=e;return He(Nt.ComboboxControl,{value:t,multiple:"yes"===n.multiple,scale:n.inputScale,options:d,pageAmount:5,onChange:r,closeListboxOnScroll:a,moveListboxOnScroll:u,placeholder:n.placeholder,label:n.label,showLabel:n.showLabel,showCount:n.showCount,listboxClassName:tt()([i,"search-filter-field__popup",`search-filter-field__popup--id-${l}`,`search-filter-style--id-${n.stylesId}`,`search-filter-style--${n.type}-${n.controlType}`]),isInteractive:s,description:n.description,showDescription:n.showDescription,...c,inputClassName:Hn(c.inputClassName),enableSearch:!Bn()})}));var xr=window.searchAndFilter.frontend.packages.fields;const Er=()=>{},Nr=Mn((e=>{const{values:t,attributes:n,options:r,onChange:o,onClear:i,closeListboxOnScroll:s=!1,moveListboxOnScroll:l=!1,listboxClassName:a,isInteractive:u=!0,connectedData:c,autocompleteUseCache:d,queryStoreKey:f,id:p,icon:h="search",extensions:_={}}=e,m=t?t[0]:"",{submit:g=Er}=fr(f);let v="";c&&(v=c.autocompletApiUrl);const b=Ne(null),{autoSubmit:y,autoSubmitDelay:w,autoSubmitOnType:C,description:S,showDescription:x,inputLoadingText:E,inputNoResultsText:N,inputSingularResultsCountText:L,inputPluralResultsCountText:A}=n,k=()=>{b.current&&clearTimeout(b.current),g()},P=p&&0!==p&&""!==p;return He(Nt.AutocompleteControl,{value:m,multiple:"yes"===n.multiple,scale:n.scale,options:r,pageAmount:5,onChange:e=>{o([e]),"yes"===y&&"yes"===C&&(b.current&&clearTimeout(b.current),b.current=setTimeout((()=>{g()}),w))},onClear:()=>{i&&i(),"yes"===y&&k()},onSelectOption:e=>{o([e.value]),"yes"===y&&k()},closeListboxOnScroll:s,moveListboxOnScroll:l,placeholder:n.placeholder,label:n.label,showLabel:n.showLabel,listboxClassName:tt()([a,"search-filter-field__popup",`search-filter-field__popup--id-${p}`,`search-filter-style--id-${n.stylesId}`,`search-filter-style--${n.type}-${n.inputType}`]),isInteractive:u,apiUrl:v,apiArgs:P?{fieldId:p}:{attributes:n},icon:"yes"===n.inputShowIcon?h:null,onEnter:()=>{g()},useCache:d,description:S,showDescription:x,loadingText:E,noResultsText:N,singularResultsCountText:L,pluralResultsCountText:A,..._,inputClassName:(0,xr.__getInputClassName)(_.inputClassName)})})),Lr=[],Ar=(e,t)=>e[jn()+t]??Lr,kr=e=>{const{rangeValuePrefix:t,rangeValueSuffix:n,rangeDecimalPlaces:r,rangeThousandCharacter:o,rangeDecimalCharacter:i,rangeMin:s,rangeMax:l,rangeStep:a}=e;return{rangeValuePrefix:t,rangeValueSuffix:n,rangeDecimalPlaces:r,rangeThousandCharacter:o,rangeDecimalCharacter:i,rangeMin:s,rangeMax:l,rangeStep:a}},Pr=Mn((e=>{const{values:t,attributes:n,onChange:r,urlName:o,isInteractive:i,extensions:s={},queryStoreKey:l}=e,a=dr(l,"currentValues"),u=Ar(a,o);return He(Nt.RangeSliderControl,{values:t,appliedValues:u,onChange:r,label:n.label,showLabel:n.showLabel,isInteractive:i,description:n.description,showDescription:n.showDescription,...s,...kr(n),inputClassName:(0,xr.__getInputClassName)(s.inputClassName),separator:n.rangeSeparator,textPosition:n.rangeSliderTextPosition,showReset:n.rangeSliderShowReset,resetPosition:n.rangeSliderResetPosition})})),Ir=Mn((e=>{const{values:t,attributes:n,onChange:r,isInteractive:o,listboxClassName:i,listboxProps:s,id:l,extensions:a={},queryStoreKey:u,urlName:c}=e,d=dr(u,"currentValues"),f=Ar(d,c);return He(Nt.RangeSelectControl,{values:t,appliedValues:f,onChange:r,label:n.label,showLabel:n.showLabel,isInteractive:o,description:n.description,showDescription:n.showDescription,separator:n.rangeSeparator,listboxClassName:tt()([i,"search-filter-field__popup",`search-filter-field__popup--id-${l}`,`search-filter-style--id-${n.stylesId}`,`search-filter-style--${n.type}-${n.inputType}`]),listboxProps:s,...a,...kr(n),inputClassName:(0,xr.__getInputClassName)(a.inputClassName)})})),Tr=Mn((e=>{const{values:t,attributes:n,onChange:r,isInteractive:o,extensions:i={},queryStoreKey:s,urlName:l}=e,a=dr(s,"currentValues"),u=Ar(a,l);return He(Nt.RangeRadioControl,{values:t,appliedValues:u,onChange:r,label:n.label,showLabel:n.showLabel,isInteractive:o,description:n.description,showDescription:n.showDescription,separator:n.rangeSeparator,...i,...kr(n),inputClassName:(0,xr.__getInputClassName)(i.inputClassName)})})),Dr=Mn((e=>{const{values:t,attributes:n,onChange:r,isInteractive:o,extensions:i={},queryStoreKey:s,urlName:l}=e,a=dr(s,"currentValues"),u=Ar(a,l);return He(Nt.RangeNumberControl,{values:t,appliedValues:u,onChange:r,label:n.label,showLabel:n.showLabel,isInteractive:o,description:n.description,showDescription:n.showDescription,...i,...kr(n),inputClassName:(0,xr.__getInputClassName)(i.inputClassName)})})),Or=()=>{},Fr=Mn((e=>{const{values:t,attributes:n,isInteractive:r,queryStoreKey:o,type:i,extensions:s={},options:l,availableOptions:a=null,_setProp:u}=e,c=Ae((()=>{if(null===a)return l;const e=[];for(const t of l)a.includes(t.value)&&e.push(t);return e}),[a,l]),{submit:d=Or}=fr(o),f=dr(o,"activeFields");return He(Nt.ButtonGroup,{value:t,options:c,onChange:e=>{const t=e[0],[n,r]=t.split("/"),o=`field-${n}`;if(!f[o])return;const i=f[o].getValues(),s=r.split(",").map((e=>e.replace(/\x1F/g,","))),l=i.filter((e=>!s.includes(e)));f[o].setValues(l);const c=a.filter((e=>e!==t));u("availableOptions",c),d()},type:i,label:n.label,showLabel:n.showLabel,multiple:"yes"===n.multiple,isInteractive:r,description:n.description,showDescription:n.showDescription,...s,inputClassName:(0,xr.__getInputClassName)(s.inputClassName),icon:"clear",iconPosition:"right",iconProps:{isDestructive:!0}})})),qr=()=>{},$r=Mn((e=>{const{attributes:t,queryStoreKey:n,isInteractive:r,icon:o="spinner-circle"}=e,[i,s]=Ce(!1),{loadMore:l=qr}=fr(n),{currentPage:a=1,maxPages:u=2}=dr(n,"settings"),c=parseInt(a)>=parseInt(u),d=()=>{s(!1)};return He(Nt.Button,{disabled:i,onClick:()=>{i||c||(l(d),s(!0))},icon:i?o:null,label:t.label,showLabel:t.showLabel,isInteractive:r,className:tt()("search-filter-field__input",c?"search-filter-input-button--hidden":""),"aria-hidden":c})})),Rr=Mn((e=>{const{values:t,attributes:n={},onChange:r,isInteractive:o,id:i,extensions:s={},queryStoreKey:l,calendarClassName:a,urlName:u}=e,c=(dr(l,"currentValues"),2!==t.length?["",""]:t),{stylesId:d,type:f,inputType:p,placeholder:h,label:_,showLabel:m,icon:g}=n;return He(Nt.RangeDatePickerControl,{values:c,onChange:r,isInteractive:o,calendarClassName:tt()(["search-filter-base",a,"search-filter-field__popup",`search-filter-field__popup--id-${i}`,`search-filter-style--id-${d}`,`search-filter-style--${f}-${p}`]),...s,inputClassName:(0,xr.__getInputClassName)(s.inputClassName),inline:!1,locale:"en-GB",icon:"yes"===n.inputShowIcon?g:null,placeholder:h,label:_,escClears:!1,showLabel:m,dateFormat:"custom"===n.dateDisplayFormat?n.dateDisplayFormatCustom:n.dateDisplayFormat,description:n.description,showDescription:n.showDescription})}));function Ur(e){const t=e._getSnapshot,n=e._value;try{return!function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t}(n,t())}catch(e){return!0}}function Vr(e,t){const n=t(),[{_instance:r},o]=Ce({_instance:{_value:n,_getSnapshot:t}});return Ee((()=>{r._value=n,r._getSnapshot=t,Ur(r)&&o({_instance:r})}),[e,n,t]),xe((()=>(Ur(r)&&o({_instance:r}),e((()=>{Ur(r)&&o({_instance:r})})))),[e]),n}const Mr=()=>{const{innerWidth:e,innerHeight:t}=window;return{screenWidth:e,screenHeight:t}},Hr=()=>{const[e,t]=Ce(Mr());return xe((()=>{function e(){t(Mr())}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),e},Br=(e,t)=>{Kr(e).push(t)},jr=[],Wr=[],Kr=e=>"fields"===e?jr:"queries"===e?Wr:void 0,Gr=(e,t,n)=>{Array.isArray(e)&&e.forEach((e=>{e[t]&&e[t](...n)}))},zr=(e,t,n,r)=>{if(!Array.isArray(t))return r[0];let o=e;return t.forEach((e=>{e[n]&&(o=e[n](o,...r))})),o};p(["packages"],"registry",e);const Qr={...o,...i};p(["packages"],"components",Qr,!0);const{hooks:Yr,...Xr}=s;p(["packages"],"core",Xr,!0),p(["packages","core"],"hooks",Yr,!0);const Jr={...l,...a};p(["packages"],"fields",Jr,!0),p(["packages"],"utils",r,!0);const Zr={...u,...c};p(["packages"],"hooks",Zr,!0),p(["packages"],"extensions",d,!0),n(509);const eo={search:{text:hr},choice:{select:zn,radio:Qn,checkbox:er,button:_r},range:{},advanced:{date_picker:mr},control:{submit:vr,reset:yr,sort:Cr,per_page:Sr}};function to(e,t,n){eo[e]||(eo[e]={}),eo[e][t]=n}const no=()=>{const e={};return{triggerEvent:function(t,n=[]){e[t]&&e[t].forEach((e=>{e(...n)}))},addEventListener:function(t,n){e[t]||(e[t]=[]),e[t].push(n)},removeEventListener:function(t,n){if(!e[t])return;const r=e[t].indexOf(n);-1!==r&&e[t].splice(r,1)}}};var ro=le({});const oo={setValues(e,t,n){if(void 0===e[t])return e;const r=at(e),o=at(e[t]);return o.values=n,r[t]=o,r},setValueLabels(e,t,n){if(void 0===e[t])return e;const r=at(e),o=at(e[t]);return o.valueLabels=n,r[t]=o,r},setAttributes(e,t,n){if(void 0===e[t])return e;const r=at(e),o=at(e[t]);return o.attributes=ut(o.attributes,n),r[t]=o,r},setProps(e,t,n){if(void 0===e[t])return e;const r=at(e),o=ut(e[t],n);return r[t]=o,r},setProp(e,t,n,r){if(void 0===e[t])return e;const o=at(e),i=ut(e[t],{[n]:r});return o[t]=i,o},setField(e,t,n){const r=at(e);return r[t]=at(n),r},removeField(e,t){const n=at(e);return n[t]&&delete n[t],n}},io={setValues(e,t,n){const r=at(e),o=it(n);return r[t]=o,r}},so=nr({}),lo=nr({}),ao=new WeakMap;ao.set(so,oo),ao.set(lo,io);const uo=function(e,t,n){const r=it(arguments);r.splice(0,2),r.unshift(t.getState());const o=ao.get(t)[e].apply(null,r);t.setState(o,!0)},co=function(e){const t=it(arguments);t.splice(1,0,so),uo.apply(null,t)},fo=function(e){const t=it(arguments);t.splice(1,0,lo),uo.apply(null,t)},po=({children:e,queryStore:t})=>He(Un.Provider,{value:so,children:He(ro.Provider,{value:lo,children:He(rr.Provider,{value:t,children:e})})});let ho=0;const _o=(e,t)=>{const n=(ho++,ho),r=`field_${n}`;let o={},i=[],s="",l={},a=!1;const u=Kr("fields"),c=h([],"queries"),d={},f={},p=no();let _=null;const m=e=>{o.values!==e&&(C(e),Gr(u,"onUpdateValues",[T,e,o]),p.triggerEvent("onUpdateValues",[T,e]))},g=()=>{C([]),Gr(u,"onClearValues",[T,o])};function v(){return void 0!==o.el?o.el:e}function b(){return r}function y(e){const t=e[r];if(t&&o!==t){if(void 0!==o.classList&&o.classList!==t.classList){const e=v();e&&(e.className="",t.classList.forEach((function(t){e.classList.add(t)})))}o=t,Gr(u,"onUpdate",[T,o])}}function w(e){const t=e[s];t&&(i=t)}function C(e){o.isInteractive&&(co("setValues",b(),e),fo("setValues",s,e))}function S(){return o.values}function x(){return o.inputType}function E(e,t,n){var r=e.lastIndexOf(t);return r>=0?e.substring(0,r)+n+e.substring(r+t.length):e}function N(e){const t=e?.attributes??{},r=t.type,i=vt(t);s=e.urlName;let p=at(e);p.isInteractive=e?.isInteractive??!0,p.classList=e?.classList??[],l=e.connectedData;const h=e.urlTemplate;_=c.get(parseInt(t.queryId));let y=null;_&&(y=_.getStoreKey()),h&&l&&l.termIdentifiers&&l.termIdentifiers.forEach((e=>{d[e.slug]=e.id,f[e.id]=e.slug}));const w=[];let C=p.classList?[...p.classList]:[];const x=v();x&&(x.classList.forEach((function(e){w.push(e),C=C.filter((t=>t!==e))})),C.forEach((function(e){x.classList.add(e),w.push(e)}))),p={...p,inputType:i,type:r,queryStoreKey:y,classList:w,uid:n,el:v(),onChange:m,onClear:g,_setProp:I},o._instance&&(p._instance=o._instance),p=zr(p,u,"config",[T]),co("setField",b(),p),fo("setValues",s,S()),Gr(u,"init",[T,p]),a=!0}function L(e){if(!e)return;const t=(n=o.type,i=x(),eo[n]&&eo[n][i]?eo[n][i]:null);var n,i;null!==t&&oe(He(Ge,{children:He(Ut,{children:He(po,{queryStore:ir,children:He(t,{storeKey:r})})})}),e)}function A(){v()&&(oe(null,v()),I("el",null))}function k(e){return o.attributes&&o.attributes[e]?o.attributes[e]:null}function P(e,t=!1){!1===t&&(e=zr(e,u,"setProps",[T])),co("setProps",b(),e),Gr(u,"onUpdateProps",[T,e,o])}function I(e,t,n=!1){P({[e]:t},n)}const T={initField:function(e){const t=function(e){return vt(e.attributes)!==vt(o.attributes)||e.type!==o.type}(e);N(e),t&&L(v())},setOptions:function(e){I("options",e),Gr(u,"onUpdateOptions",[T,e])},setAttributes:function(e){co("setAttributes",b(),e)},getAttributes:function(){return o.attributes},getAttribute:k,setValues:C,setProps:P,setProp:I,getProp:function(e){return o[e]},getUid:function(){return n},getId:function(){return o.id},getState:function(){return o},getName:function(){return o.name},getElement:v,getQueryData:function(){return{queryId:o.attributes.queryId}},getStoreKey:b,getValues:S,getUrlName:function(){return s},getUrlValues:function(e){return i},getConnectedData:function(){return l},setConnectedData:function(e){l=e},getUrl:function(){if(!o?.urlTemplate)return null;if(!function(){const e=x();return"checkbox"!==e&&("select"!==e&&"button"!==e||"yes"!==k("multiple"))}())return null;if(!l.taxonomyParents)return null;const e=S(),t=e.length>0?e[0]:"",n=d[t],r=f[n];let i=o.urlTemplate;if(!Array.isArray(i))return null;if(0===i.length)return null;let s=0;l.taxonomyParents[n]&&l.taxonomyParents[n].forEach((e=>{s++}));let a=i[s];return a?(a=E(a,"[id]",n),a=E(a,"[slug]",r),l.taxonomyParents[n]&&l.taxonomyParents[n].forEach((e=>{a=E(a,"[slug]",e.slug)})),a):null},remove:function(){A(),so.unsubscribe(y),lo.unsubscribe(w),co("removeField",b()),_&&_.removeField(T)},unmount:A,mount:function(e){e?(I("el",e),L(e)):L(v())},enable:function(){},disable:function(){},focus:function(){},blur:function(){},queryActions:function(){return _?_.getActions():{}},getQuery:function(){return _},on:p.addEventListener,off:p.removeEventListener};return so.subscribe(y),lo.subscribe(w),N(t),e&&L(e),I("_instance",T),_&&_.addField(T),T};var mo=window.searchAndFilter.frontend.packages.registry,go=window.searchAndFilter.frontend.packages.extensions;const vo=(e,t)=>{window.location.href=((e,t)=>{const n=new URLSearchParams(t).toString();let r=e;if(""===e&&(r="?"),""!==n){const e=r.indexOf("?")>-1;r+=(e?"&":"?")+n}return r})(e,t)},bo=()=>window.searchAndFilter.admin;let yo=null;const wo=e=>{if(e.getAttribute("href")){const t=Fo(e.getAttribute("href")).trim();t!==e.getAttribute("href")&&e.setAttribute("href",t)}else if(e.innerHTML){const t=Fo(e.innerHTML).trim();t!==e.innerHTML.trim()&&(e.innerHTML=t)}else if(e.textContent){const t=Fo(e.textContent).trim();t!==e.textContent.trim()&&(e.textContent=t)}},Co=e=>{const t=[];let n=null,r=null;if(e.head){let r=!1;for(const o of e.head.childNodes)if(o.nodeType===Node.ELEMENT_NODE&&"META"===o.tagName&&"search-filter-head-assets-start"===o.getAttribute("name")&&(r=!0,n=o),r&&o!==n&&o.nodeType===Node.ELEMENT_NODE){if("META"===o.tagName&&"search-filter-head-assets-end"===o.getAttribute("name"))break;(Eo(o)||xo(o))&&(wo(o),t.push({element:o,location:"head"}))}}if(e.body){const n='body > style, body > link[rel="stylesheet"], body > #search-filter-svg-template',o=e.body.querySelectorAll(n);for(const e of o)wo(e),t.push({element:e,location:"body"});r=e.body.firstChild}return{elementsList:t,headMarker:n,bodyMarker:r}},So=(e,t,n)=>new Promise(((r,o)=>{const i=e.cloneNode(!0),s=i.getAttribute("media")||"all";let l,a;const{element:u,action:c}=t;i.setAttribute("media","print");const d=()=>{i.onload=null,i.onerror=null,n&&n.removeEventListener("abort",p),i.setAttribute("media",s)},f=()=>{clearTimeout(l),cancelAnimationFrame(a),"replace"===c&&u.remove()},p=()=>{d(),f()};i.onload=()=>{d();const e=()=>{l=setTimeout((()=>{a=requestAnimationFrame((()=>{(e=>{for(const t of document.styleSheets)if(t.href===e)return t;return null})(i.href)||n&&n.aborted?(f(),r(i)):e()}))}),20)};e()},i.onerror=()=>{p()},u.after(i),n.addEventListener("abort",p,{once:!0}),n.aborted&&p()})),xo=e=>!!e&&"LINK"===e.tagName&&"stylesheet"===e.getAttribute("rel")&&e.getAttribute("href"),Eo=e=>!!e&&"STYLE"===e.tagName;let No=null,Lo=null;const Ao=(e,t,n=null,r=null)=>{if(bo())return Promise.resolve();if(!t)return Promise.resolve();const o=t.head&&t.head.querySelector('meta[name="search-filter-head-assets-start"]')&&t.head.querySelector('meta[name="search-filter-head-assets-end"]'),i=t.querySelector("#search-filter-data-js");if(!o&&!i)throw new Error("Failed to update assets: Page does not contain expected Search & Filter markers. The response may be an error page.");return Lo&&Lo.url===e?(No=null,Promise.resolve()):(Lo&&Lo.abortController&&Lo.abortController.abort(),No={url:e,doc:t,updateTreeSelectors:r,abortController:n||new AbortController},Lo?Promise.resolve():Po())},ko=e=>{const t=new Map;for(const n of e){const e=n.element;if(e.nodeType===Node.ELEMENT_NODE)if(e.id)t.set(e.id,e);else if(e.getAttribute("href")){const n=e.getAttribute("href");t.set(n,e)}else t.set(e.textContent,e)}return{getEquivelant:function(e){if(e.id)return t.get(e.id);if(e.getAttribute("href")){const n=e.getAttribute("href");return t.get(n)}return t.get(e.textContent)},elements:t}},Po=()=>{Lo=No,No=null;const e=Lo.abortController;return new Promise(((t,n)=>{if(e.signal.aborted)return void n(new DOMException("Request superseded by new request","AbortError"));const r=Lo.doc,{added:o,removed:i,changed:s}=(()=>{if(yo)return yo;if(!window.searchAndFilterPage||!window.searchAndFilterPage.head||!window.searchAndFilterPage.body)return yo={added:[],removed:[],changed:[]},yo;const e=new DOMParser,t="<html>"+window.searchAndFilterPage.head+window.searchAndFilterPage.body+"</html>",n=e.parseFromString(t,"text/html"),{elementsList:r}=Co(n),{elementsList:o}=Co(document),{added:i,removed:s,changed:l}=((e,t)=>{const n=ko(e),r=ko(t),o=[],i=[],s=[];for(const e of t){const t=e.element,r=n.getEquivelant(t);r?Eo(t)?t.textContent!==r.textContent&&s.push(e):xo(t)&&t.getAttribute("href")!==r.getAttribute("href")&&s.push(e):o.push(e)}for(const t of e){const e=t.element;r.getEquivelant(e)||i.push(t)}return{added:o,removed:i,changed:s}})(r,o);return yo={added:i,removed:s,changed:l},yo})(),l=ko(o),a=ko(i),{elementsList:u,headMarker:c,bodyMarker:d}=Co(document),{elementsList:f}=Co(r);if(!c)return void t();const p=ko(u),h=ko(f),_=[];let m=c,g=d;const v=new WeakMap,b=new Set;for(const t of f){const n=t.element;if(a.getEquivelant(n))continue;const r=p.getEquivelant(n),o="head"===t.location;if(r?(o?m=r:g=r,v.set(n,{action:"replace",element:o?m:g})):v.set(n,{action:"after",element:o?m:g}),Eo(n)){if(r&&r.textContent===n.textContent)continue;b.add(n)}else if(xo(n)){if(r&&n.getAttribute("href")===r.getAttribute("href"))continue;_.push(So(n,v.get(n),e.signal))}else{if(r&&r.textContent===n.textContent)continue;b.add(n)}}const y=new Set;for(const e of u){const t=e.element;l.getEquivelant(t)||(h.getEquivelant(t)||y.add(t))}const w=()=>{for(const n of b){const o=v.get(n),{action:i,element:s}=o;"replace"===i?s.replaceWith(n.cloneNode(!0)):s.after(n.cloneNode(!0))}for(const l of y)l.remove();document.title!==r.title&&(document.title=r.title),document.body.className!==r.body.className&&(document.body.className=r.body.className);const e=Lo.updateTreeSelectors;if(e)for(const a of e){const u=document.querySelector(a),c=r.querySelector(a);function d(e,t){return!(!e||!t)&&"BODY"!==e.tagName&&"BODY"!==t.tagName&&e&&t&&e.nodeType===Node.ELEMENT_NODE&&t.nodeType===Node.ELEMENT_NODE}if(d(u,c)){let f=u.parentElement,p=c.parentElement;for(;d(f,p);)f.className=p.className,f.style.cssText=p.style.cssText,f=f.parentElement,p=p.parentElement}}t()};Promise.all(_).then(w).catch((e=>{if("AbortError"!==e.name)throw e;w(),w()})).finally((()=>{Lo=null,No&&Po()}))}))},Io=(e,t,n=!1)=>{let r=e;const o=[];for(const e in t)!t[e]&&n?o.push(`${e}`):o.push(`${e}=${t[e]}`);const i=r.split("#");r=i[0];const s=i[1];return 0===o.length?e:(-1!==r.indexOf("?")?r+="&":r+="?",r+=o.join("&"),s&&(r+=`#${s}`),r)},To=(e,t)=>{let n=e;const r={};for(const e in t)if(Array.isArray(t[e])){const n=[];t[e].forEach((e=>{if(e){const t=e.replace(/,/g,"");n.push(encodeURIComponent(t))}else n.push(e)})),r[e]=n.join(",")}else r[e]=encodeURIComponent(t[e]);return n=Io(n,r),n},Do=e=>(new DOMParser).parseFromString(e,"text/html");let Oo=null;function Fo(e){let t=e;const n=window.searchAndFilterData.homeUrl,r=qo();return n&&r&&(t=e.replaceAll(r.url,n)),t}const qo=()=>{if(!window.searchAndFilterApiUrl)return null;if(null!==Oo)return Oo;Oo={auth:null,url:null};const e=new URL(window.searchAndFilterApiUrl);return e.username&&e.password&&(Oo.auth="Basic "+btoa(`${e.username}:${e.password}`)),Oo.url=`${e.origin}${e.pathname}${e.search}`,Oo.url.endsWith("/")&&(Oo.url=Oo.url.slice(0,-1)),Oo},$o=(()=>{const e={},t={},n=[];function r(e){if(t[e]){const n=t[e];t[e]=null;try{n.abort(new DOMException("Request superseded by new request","AbortError"))}catch(e){if("AbortError"===e.name)return}}}bo()||window.addEventListener("popstate",(t=>{(async(t,r)=>{const i=r&&Object.keys(r).length>0;if(!e[t]&&i&&(e[t]={dom:Do(r),raw:r}),e[t])try{await Ao(t,e[t].dom,null,o())}catch(e){if("AbortError"!==e.name)throw e}for(const r of n)r.popState&&r.popState(t,e[t])})(window.location.href,t.state)}));const o=()=>{let e=[];for(const t of n)t.treeSelector&&e.push(t.treeSelector);return e};return(0,In.onInitDocument)((()=>{if(!window.searchAndFilterPage||!window.searchAndFilterPage.head||!window.searchAndFilterPage.body)return;const t="<html>"+window.searchAndFilterPage.head+window.searchAndFilterPage.body+"</html>",n=Do(t);e[window.location.href]={dom:n,raw:t}}),"complete"),{newRequest:async function(n,i,s,l=!0,a=!1){const u=a?o():[];if(e[n]){r(s);const o=new AbortController;return t[s]=o,new Promise(((t,r)=>{setTimeout((async()=>{try{l&&await Ao(n,e[n].dom,o,u),t(i(e[n]))}catch(e){r(e)}}),100)}))}return new Promise(((o,a)=>{r(s);const c=new AbortController;t[s]=c;const d=function(e){let t=e;const n=window.searchAndFilterData.homeUrl,r=qo();return n&&r&&(t=e.replaceAll(n,r.url)),t}(n),f=qo(),p={"search-filter-api":"frontend"};f&&(p["search-filter-api"]="frontend/external");const h=To(d,p),_={"Content-Type":"text/html"};f&&f.auth&&(_.Authorization=f.auth),fetch(h,{method:"GET",headers:_,signal:c.signal}).then((e=>{if(t[s]!==c)throw new DOMException("Aborted","AbortError");if(!e.ok)throw new Error(`Failed to load page: HTTP ${e.status} ${e.statusText} for URL: ${h}`);return e.text()})).then((async r=>{if(t[s]!==c)throw new DOMException("Aborted","AbortError");return e[n]={dom:Do(r),raw:r},l&&await Ao(n,e[n].dom,c,u),Promise.resolve(i(e[n]))})).then((()=>{o()})).catch((e=>{"AbortError"!==e.name?a(e):o()})).finally((()=>{t[s]===c&&(t[s]=null)}))}))},registerHandler:e=>{n.push(e)},abortRequest:e=>{r(e)}}})(),Ro=$o.registerHandler,Uo=$o.newRequest,Vo=$o.abortRequest,Mo=window.getComputedStyle;function Ho(e,...t){if(!e)return"";let n=0;return e.replace(/%(\d+\$)?([ds])/g,((e,r,o)=>{const i=r?parseInt(r)-1:n++,s=t[i];return"d"===o?parseInt(s,10):String(s)}))}function Bo(e,t){e&&(e.textContent="",requestAnimationFrame((()=>{e.textContent=t})))}function jo(e,t,n,r){const o=r||{},i=o.noResultsText||"No results found",s=o.singleResultText||"%d result found",l=o.multipleResultsText||"%d results found",a=o.pageText||"Page %1$d of %2$d";let u="";return u=0===e?i:Ho(1===e?s:l,e),n>1&&(u+=". "+Ho(a,t,n)),u}let Wo=0;function Ko(e){if(Array.isArray(e)){if(0===e.length)return!0;if(1===e.length&&""===e[0])return!0}return!1}const Go={},zo=e=>{let t=0;const n=(Wo++,Wo),r=`query_${n}`;let o={},i="",s={},l=null,a=null,u=null,c=!1;const d=jn();let f=window.location.href;const p={},h=(0,go.get)("queries"),_=no();function m(){return t}function g(){return n}function v(){return r}function b(e){const t=e[r];t&&o!==t&&(o=e[r])}function y(e){return o.settings?o.settings[e]:null}function w(e){ar("setProp",v(),"activeFields",e)}function C(){return o.fields?o.fields:[]}function S(e){ar("setProp",v(),"fields",e)}function x(e,t=!1){if(function(){const e=C();for(const t in e){const n=e[t];if(n.getAttribute("defaultValueType")&&"none"!==n.getAttribute("defaultValueType"))return!0}return!1}()){const t=E();e=Io(e,{[t]:null},!0)}return e}function E(){return"~"+m()}function N(){const e={fieldValues:{},urlValues:{},url:i},t=y("currentTaxonomyArchive"),n=y("currentTaxonomyTermArchive");let r=!1,s=!1;for(const n in o.fields){const l=o.fields[n],a=o.fields[n].getUrlValues(),u=l.getProp("connectedData")?.navigatesTaxonomyArchive;u&&u===t&&Ko(a)&&(s=!0,r=!0,e.url=i)}for(const i in o.fields){const l=o.fields[i],a=d+o.fields[i].getUrlName(),u=o.fields[i].getUrlValues();Ko(u)||(e.urlValues[a]=u,e.fieldValues[i]=u);const c=l.getProp("connectedData")?.navigatesTaxonomyArchive;c&&(c===t?Ko(u)||(n!==u[0]&&(r=!0,e.url=l.getUrl()),e.urlValues[a]&&delete e.urlValues[a]):t&&!s||!c||Ko(u)||(r=!0,e.url=l.getUrl(),e.urlValues[a]&&delete e.urlValues[a]))}if(r)return e;const l=y("taxonomyArchiveUrl");return l?(e.url=l,e):e}function L(e){s=(0,In.cloneObject)(e),i=s.url,t=s.id,ar("setQuery",v(),s),c||(function(){if(u)return;const e=A("queryContainer");if(!e)return;const t=document.querySelectorAll(e);if(0===t.length)return void(function(){const e=new URL(N().url),t=new URL(window.location.href);return e.pathname===t.pathname}()&&(0,In.log)(`Query container not found for query ${m()}. Selector: ${e}`,"error"));if(t.length>1)return void(0,In.log)(`Multiple query containers found for query ${m()}. Selector: ${e}`,"error");u=t[0],u.classList.add("search-filter-query");const n=A("a11yQueryContainerLabel")||"Search Results";if(k("containerId",function(e,t,n){let r=e.id;var o;return r||(r=`search-filter-query-instance-${t}`,e.id=r),(o=e).tabIndex>=0||o.hasAttribute("tabindex")||e.setAttribute("tabindex","-1"),e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby")||e.setAttribute("aria-label",n),function(e){if(["MAIN","NAV","ASIDE","HEADER","FOOTER","SECTION","FORM"].includes(e.tagName))return!0;const t=e.getAttribute("role");return!(!t||!["main","navigation","complementary","banner","contentinfo","region","form","search"].includes(t))}(e)||e.setAttribute("role","region"),r}(u,g(),n)),I()){const e=function(e){const t=`search-filter-query-announcer-${e}`;let n=document.getElementById(t);return n||(n=document.createElement("div"),n.id=t,n.className="search-filter-screen-reader-text",n.setAttribute("role","status"),n.setAttribute("aria-live","polite"),n.setAttribute("aria-atomic","true"),n)}(m());u.parentNode.insertBefore(e,u),k("announcer",e)}}(),function(){if(!l&&I()&&u&&"yes"===A("resultsShowSpinner")){const e="search-filter-query--loading";l=function(e,t,n=null){let r=!1,o=!1;const i="search-filter-query__spinner--show",s=document.createElement("div");s.classList.add("search-filter-base"),s.classList.add("search-filter-query__spinner"),s.classList.add("search-filter-query--id-"+t);const l=document.createElement("div");l.classList.add("search-filter-query__spinner-icon");const a=document.createElementNS("http://www.w3.org/2000/svg","svg"),u=document.createElementNS("http://www.w3.org/2000/svg","use");function c(){const t=e.offsetParent,n=function(e,t=!0){let n=Mo(e);const r="absolute"===n.position,o=t?/(auto|scroll|hidden)/:/(auto|scroll)/;if("fixed"===n.position)return document.body;for(let t=e;t=t.parentElement;)if(n=Mo(t),(!r||"static"!==n.position)&&o.test(n.overflow+n.overflowY+n.overflowX))return t;return document.body}(e);if(!n||!n.tagName)return;t&&"body"!==n.tagName.toLowerCase()&&!n.contains(t)&&"static"===Mo(n).position&&(n.style.position="relative");let r="0px",o="0px";if(t&&"body"===t.tagName.toLowerCase()&&"static"===Mo(t).position){const e=Mo(document.documentElement);"relative"!==e.position&&(r=e.marginTop,o=e.marginLeft)}const i=e.getBoundingClientRect();s.style.width=i.width+"px",s.style.height=i.height+"px",s.style.top=`calc( ${e.offsetTop}px + ${r} )`,s.style.left=`calc( ${e.offsetLeft}px + ${o} )`}let d;function f(){d&&window.cancelAnimationFrame(d),d=window.requestAnimationFrame((function(){c()}))}u.setAttributeNS("http://www.w3.org/1999/xlink","href","#sf-svg-spinner-circle"),a.appendChild(u),l.appendChild(a),s.appendChild(l),window.addEventListener("scroll",f,!0),window.addEventListener("resize",f,!0);const p=()=>{s.style.visibility="hidden",r=!1,o=!1,n&&n()};return s.addEventListener("transitionstart",(function(e){o=!0})),s.addEventListener("transitionend",(function(e){r&&p()})),s.addEventListener("transitioncancel",(function(e){r&&p()})),e.after(s),c(),{container:s,setLoaderPosition:c,remove:function(){s.remove()},show:function(){s.style.visibility="visible",c(),s.classList.add(i)},hide:function(){c(),r=!0,o||p(),s.classList.remove(i)}}}(u,m(),(()=>{u.classList.remove(e)}))}}(),D(),O(),c=!0)}function A(e){return o.attributes&&o.attributes[e]?o.attributes[e]:null}function k(e,t){ar("setProp",v(),e,t)}function P(e){return ir.getState()[v()][e]}function I(){return"yes"===A("resultsDynamicUpdate")}function T(e){e.preventDefault(),P("preventPaginationPropagation")&&e.stopPropagation();const t=function(e){const t=new URL(document.baseURI).origin;return 0!==e.indexOf(t)}(n=e.currentTarget.getAttribute("href"))?new URL(n,document.baseURI).href:n;var n;t&&Q(t,!0)}function D(){const e=A("queryPaginationSelector");if(!e)return;const t=document.querySelectorAll(e);t&&t.forEach((e=>{e.removeEventListener("click",T),e.addEventListener("click",T)}))}function O(){if("infinite_scroll"!==A("resultsPaginationType"))return;const e=A("queryPostsContainer");if(!e)return void(0,In.log)(`Posts container selector not configured for infinite scroll on query ${m()}.`,"error");const t=document.querySelector(e);if(!t)return void(0,In.log)(`Posts container not found for infinite scroll on query ${m()}. Selector: ${e}`,"error");a&&a.remove();const n=A("infiniteScrollOffset")||"-100px";a=function(e,t,n={}){const{rootMargin:r="-100px",onTrigger:o=()=>{},onEnd:i=()=>{}}=n;let s=null,l=!1,a=!1,u=!1,c=!0;const d="search-filter-query__infinite-scroll-loader--show",f=document.createElement("div");f.classList.add("search-filter-base"),f.classList.add("search-filter-query__infinite-scroll-trigger"),f.classList.add("search-filter-query--id-"+t);const p=document.createElement("div");p.classList.add("search-filter-query__infinite-scroll-loader");const h=document.createElement("div");h.classList.add("search-filter-query__infinite-scroll-loader-icon");const _=document.createElementNS("http://www.w3.org/2000/svg","svg"),m=document.createElementNS("http://www.w3.org/2000/svg","use");function g(){s&&s.disconnect();const e=r.includes(" ")?r:`0px 0px ${r} 0px`;s=new IntersectionObserver((e=>{e.forEach((e=>{!e.isIntersecting||l||a||u||v()}))}),{root:null,rootMargin:e,threshold:0}),s.observe(f)}function v(){l=!0,y(),o(b)}function b(){l=!1,w(),g()}function y(){p.classList.add(d)}function w(){p.classList.remove(d)}return m.setAttributeNS("http://www.w3.org/1999/xlink","href","#sf-svg-spinner-circle"),_.appendChild(m),h.appendChild(_),p.appendChild(h),f.appendChild(p),e.after(f),g(),{container:f,show:y,hide:w,remove:function(){s&&(s.disconnect(),s=null),f.remove()},pause:function(){a=!0},resume:function(){a=!1},updateEndState:function(e,t){parseInt(e)>=parseInt(t)?(u=!0,w(),i()):(u=!1,c&&(c=!1,requestAnimationFrame((()=>{!function(){if(l||a||u)return;const e=f.getBoundingClientRect(),t=parseInt(r)||0;e.top<window.innerHeight+t&&v()}()}))))}}}(t,m(),{rootMargin:n,onTrigger:e=>{z(e)},onEnd:()=>{(0,In.log)(`Infinite scroll reached end for query ${m()}.`)}}),a.updateEndState(y("currentPage"),y("maxPages"))}function F(){a&&(a.remove(),a=null)}function q(){const e={};let t=!1;for(const n in o.fields)Ko(o.fields[n].getUrlValues())||(e[`field-${o.fields[n].getId()}`]=o.fields[n],t=!0);return t?e:Go}function $(e=null){const t=N();w(q());const n=e??t.url,r=Object.keys(t.urlValues).length>0;let o=null;return n&&(o=x(To(n,t.urlValues),r)),{values:t.urlValues,url:o}}function R(){const{values:e,url:t}=$();t?Q(t,!0):(0,In.log)(`No URL set for query ID: ${m()}.`,"error"),(0,go.doActions)(h,"onSubmit",[e])}ir.subscribe(b),L(e);const U=(e=!0)=>{const t=C();for(const n in t)t[n].setProp("isBusy",e)},V=()=>{const e="yes"===A("resultsFadeResults"),t="yes"===A("resultsShowSpinner");e&&u&&u.classList.add("search-filter-query--fade-out"),t&&l&&l.show(),u&&u.classList.add("search-filter-query--loading"),U(!0);const n=P("announcer");n&&Bo(n,A("a11yLoadingText")||"Loading results...")},M=()=>{const e="yes"===A("resultsFadeResults"),t="yes"===A("resultsShowSpinner");e&&u&&u.classList.remove("search-filter-query--fade-out"),t&&l&&l.hide(),u&&u.classList.remove("search-filter-query--loading"),U(!1)},H=(e="search")=>{const t=P("announcer");if(!t)return;const n=y("foundPosts"),r=y("currentPage"),o=y("maxPages");let i="";i="load-more"===e?((e,...t)=>{let n=0;return e.replace(/%(\d+\$)?([ds])/g,((e,r,o)=>{const i=r?parseInt(r)-1:n++,s=t[i];return"d"===o?parseInt(s,10):String(s)}))})(A("a11yLoadedMoreText")||"Loaded more results. Page %1$d of %2$d",r,o):jo(n,r,o,{noResultsText:A("a11yNoResultsText"),singleResultText:A("a11ySingleResultText"),multipleResultsText:A("a11yMultipleResultsText"),pageText:A("a11yPageText")}),Bo(t,i)},B=()=>{for(const e in o.fields)o.fields[e].setValues([]);w(q());const e=N().url;e&&Q(x(e),!0),(0,go.doActions)(h,"onReset",[])},j=e=>{k("currentValues",e)},W=e=>{if(!e)return;const t=(0,mo.get)([],"queries");Object.keys(e).forEach((n=>{const r={...e[n]},o=t.get(r.id);o?o.setSettings(r.settings):zo(r)}))},K=e=>{if(!e)return;const t=(0,mo.get)([],"fields");Object.keys(e).forEach((n=>{const r={...e[n]},o=t.get(r.id);if(o)r.values=o.getValues(),o.initField(r);else{const e=document.querySelector(`.search-filter-field[data-field-id="${r.id}"]`);e&&_o(e,r)}}))},G=e=>{if(!e)return;const t=(0,mo.get)([],"fields");for(const n in e){const r={...e[n]},o=t.get(r.id);o&&o.setValues(r.values)}w(q())};function z(e){if(!I())return void(0,In.log)(`Live search is not enabled for query ${m()}.`,"error");const t=A("queryPostsContainer"),n=document.querySelectorAll(t);if(0===n.length)return void(0,In.log)(`Posts container not found for query ${m()}. Selector: ${t}`,"error");if(n.length>1)return void(0,In.log)(`Multiple posts containers found for query ${m()}. Selector: ${t}`,"error");const r=n[0],o=parseInt(y("currentPage"))+1,i=N(),s=y("paginationKey");s?i.urlValues[s]=o:i.urlValues.paged=o;const l=Object.keys(i.urlValues).length>0,c=x(To(i.url,i.urlValues),l);_.triggerEvent("get-results/start",[oe,{action:"load-more"}]),U(!0);const d=P("announcer");d&&Bo(d,A("a11yLoadingMoreText")||"Loading more results..."),Uo(c,(t=>{const n=t.dom,o=Y(n),i=A("queryContainer"),s=n.querySelector(i);if(!s)return void(0,In.log)(`Destination query container not found for query ${m()}. Selector: ${i}`,"error");X(o,s);const l=A("queryPostsContainer"),c=n.querySelector(l);c?(Array.from(c.childNodes).forEach((e=>{r.appendChild(e.cloneNode(!0)),ee(u,o.fields)})),a&&a.updateEndState(y("currentPage"),y("maxPages")),H("load-more"),e&&e()):(0,In.log)(`Destination posts container not found for query ${m()}. Selector: ${l}`,"error")})).catch((e=>{if("AbortError"===e.name)return;(0,In.log)(`Failed to load more for query ${m()}: ${e.message}`,"error");const t=P("announcer");t&&Bo(t,A("a11yErrorText")||"Error loading results")})).finally((()=>{U(!1),_.triggerEvent("get-results/finish",[oe,{action:"load-more"}])}))}async function Q(e,t=!0){if(!u)return void(t&&vo(e));if(!I()||!u)return void(t&&vo(e));_.triggerEvent("get-results/start",[oe]),V();const n=A("queryContainer");await Uo(e,(async n=>{await async function(e,t,n=!0){j({...te(e)}),J(t),H("search"),"yes"===A("resultsUpdateUrl")&&n&&(((e,t)=>{e!==window.location.href&&window.history.pushState(t,"",e)})(e,t.raw),f=e);const r=A("resultsScrollToSelector");if(r&&""!==r){const e=document.querySelector(r);e?e.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}):(0,In.log)(`Scroll to selector element not found for query ${m()}. Selector: ${r}`,"error")}}(e,n,t)}),`results-${m()}`,!0,n).catch((e=>{if("AbortError"===e.name)return;(0,In.log)(`Failed to fetch results for query ${m()}: ${e.message}`,"error");const t=P("announcer");t&&Bo(t,A("a11yErrorText")||"Error loading results")})).finally((()=>{M(),_.triggerEvent("get-results/finish",[oe])}))}function Y(e){const t=e.querySelector("#search-filter-data-js");if(!t)throw new Error("Failed to parse page data: #search-filter-data-js script tag not found. The page may have returned an error or invalid response.");const n=t.getAttribute("data-search-filter-data");if(!n)throw new Error("Failed to parse page data: data-search-filter-data attribute is missing.");const r=JSON.parse(n);if(!r.fields||!r.queries)throw new Error("Failed to parse page data: fields or queries data is missing from response.");return r}function X(e,t,n=!1){if(W(e.queries),K(e.fields),n&&G(e.fields),u&&"yes"===A("resultsUpdatePage"))for(const e of t.attributes)u.setAttribute(e.name,e.value)}function J(e,t=!1){const n=e.dom,r=Y(n),o=A("queryContainer"),i=n.querySelector(o);if(!i)return void(0,In.log)(`Destination query container not found for query ${m()}. Selector: ${o}`,"error");F(),Z(u,i,r.fields),X(r,i,t);const s=A("dynamicSections");if(s===o)return void(0,In.log)(`Dynamic section value is the same as the query container for query ${m()}.`,"error");const l=[],a=A("additionalDynamicSections");s&&l.push(s),a&&l.push(a);const c=l.join(", ");""!==c&&c.split(",").forEach((e=>{const t=e.trim(),o=document.querySelectorAll(t),i=n.querySelectorAll(t);o.length!==i.length&&(0,In.log)(`Dynamic area count mismatch for query ${m()}. Selector: ${t}`,"error"),o.forEach(((e,t)=>{e.innerHTML=i[t].innerHTML,Z(e,i[t],r.fields)}))})),D(),O()}function Z(e,t,n){e&&t&&(function(e){if(!e)return;const t=(0,mo.get)([],"fields");e.querySelectorAll(".search-filter-field[data-search-filter-id]").forEach((e=>{const n=e.getAttribute("data-search-filter-id"),r=t.get(parseInt(n));r&&r.unmount()}))}(e),e.innerHTML=t.innerHTML,ee(e,n))}function ee(e,t){if(!e)return;const n=(0,mo.get)([],"fields");e.querySelectorAll(".search-filter-field[data-search-filter-id]").forEach((e=>{const r=e.getAttribute("data-search-filter-id");let o=n.get(parseInt(r));const i={...t["field_"+r]};o?(i&&o.setOptions(i.options),o.mount(e)):o=_o(e,i)}))}function te(e){const t=new URL(e),n=new URLSearchParams(t.search),r={};return n.forEach(((e,t)=>{r[t]=e.split(",").map((e=>e.replace(/\x1F/g,",")))})),r}if(!bo()&&I()){let e=null;"yes"===A("resultsUpdatePage")&&(e=A("queryContainer")),Ro({popState:async function(e,t){if(I()){if(t)return _.triggerEvent("get-results/start",[oe]),j({...te(e)}),J(t,!0),_.triggerEvent("get-results/finish",[oe]),void(f=e);f.split("#")[0]!==e.split("#")[0]&&await Q(e,!1),f=e}},treeSelector:e})}function ne(){Vo(`results-${m()}`),Vo(`fields-${m()}`)}var re;re={submit:R,reset:B,loadMore:z,getFields:C,refreshFields:async function(){const{url:e}=$(window.location.href);e&&(_.triggerEvent("get-results/start",[oe]),U(!0),await Uo(e,(e=>{!function(e){(e=>{if(!e)return;const t=(0,mo.get)([],"fields");Object.keys(e).forEach((n=>{const r=e[n],o=t.get(r.id);o&&o.setOptions(r.options)}))})(Y(e.dom).fields)}(e)}),`fields-${m()}`,!1).catch((e=>{"AbortError"!==e.name&&(0,In.log)(`Failed to refresh fields for query ${m()}: ${e.message}`,"error")})).finally((()=>{U(!1),_.triggerEvent("get-results/finish",[oe])})))},signalUpdate:ne},ar("setProp",v(),"actions",re);const oe={setQuery:function(e,t){L(e)},setAttributes:function(e){ar("setAttributes",v(),e)},setProps:function(e){ar("setProps",v(),e)},setProp:k,getProp:P,setSettings:function(e){ar("setProp",v(),"settings",e)},getSetting:y,initConfig:L,getUid:g,getId:m,getValues:function(){return N().fieldValues},getStoreKey:v,getUrl:function(){return N().url},getName:function(){return s.name},getAttribute:A,getAttributes:function(){return o.attributes},getActions:function(){return o.actions??{}},submit:R,reset:B,remove:function(){l&&l.remove(),F(),ir.unsubscribe(b),ar("removeQuery",v())},loadMore:z,addField:e=>{S({...o.fields,[e.getStoreKey()]:e}),w(q()),p[e.getUrlName()]||(p[e.getUrlName()]=[]),p[e.getUrlName()].push(e);const t=o.activeValues??{};e.getValues().length>0&&(t[d+e.getUrlName()]=e.getValues()),j({...t}),e.on("onUpdateValues",ne)},removeField:e=>{const t={...o.fields};t[e.getStoreKey()]&&delete t[e.getStoreKey()],S(t),w(q()),e.off("onUpdateValues",ne)},getFields:C,isActive:function(){return o.isActive},getActiveUrlArg:E,getQueryContainer:function(){return u},on:_.addEventListener,off:_.removeEventListener};return ar("setProp",r,"_instance",oe),oe};function Qo(e){const t=e.getFields();for(const e in t){const n=t[e].getUrlValues();if(n&&n.length>0&&""!==n[0])return!0}return!1}function Yo(){if("loading"===document.readyState)return!1;if(window?.searchAndFilterData?.shouldMount){const e=h([],"mount");if(e){e();const t=h([],"queries");return t&&function(e){e&&Array.isArray(e)&&e.forEach((e=>{(function(e){if(!function(e){return Qo(e)}(e))return null;const t=e.getProp("containerId");if(!t)return null;const n=e.getAttribute("a11ySkipLinkLabel")||"Skip to search results",r=e.getAttribute("a11ySkipLinkClass")||"search-filter-screen-reader-text",o=document.createElement("a");o.href=`#${t}`,o.className=`skip-link ${r}`,o.textContent=n,o.setAttribute("data-search-filter-skip-link",e.getId()),o.addEventListener("click",(()=>{const e=document.getElementById(t);e&&e.focus()})),document.body.insertBefore(o,document.body.firstChild)})(e),function(e){if(!Qo(e))return;const t=e.getSetting("foundPosts"),n=e.getSetting("currentPage"),r=e.getSetting("maxPages");if(void 0===t)return;const o=jo(t,n,r,{noResultsText:e.getAttribute("a11yNoResultsText"),singleResultText:e.getAttribute("a11ySingleResultText"),multipleResultsText:e.getAttribute("a11yMultipleResultsText"),pageText:e.getAttribute("a11yPageText")}),i=function(e){const t=`search-filter-query-alert-${e}`;let n=document.getElementById(t);return n||(n=document.createElement("div"),n.id=t,n.className="search-filter-screen-reader-text",n.setAttribute("role","alert"),n.setAttribute("aria-atomic","true"),n)}(e.getId());document.body.appendChild(i),Bo(i,o)}(e)}))}(t.getAll()),!0}}return!1}let Xo,Jo=!1;const Zo={},ei=(e,t)=>(!t.supports||!t.supports.includes("autoSubmit"))&&"yes"===t.attributes.autoSubmit,ti=(e,t)=>{const n=e.getQuery();if(!n)return;if("yes"!==n.getAttribute("useIndexer"))return;const r=e.queryActions(),{refreshFields:o}=r;if(!o)return;if(ei(0,t))return;let i=100;const s=t.attributes.autoSubmitDelay;s&&""!==s&&(i=parseInt(s)),clearTimeout(Xo),Xo=setTimeout((()=>{o()}),i)},ni=(e,t)=>{const n=e.getElement();e.setProp("isFieldVisible",!1),e.setProp("isInteractive",!1),t.includes("search-filter-field--hidden")||(t.push("search-filter-field--hidden"),e.blur(),e.setProp("classList",t),n.setAttribute("aria-hidden","true"))},ri=e=>{if("yes"!==e.getAttribute("hideFieldWhenEmpty"))return;if(!e.getElement())return;if(0!==e.getValues().length)return;const t=[...e.getProp("classList")],n=e.getAttribute("type");if("choice"===n){if(0===e.getProp("options").length)return void ni(e,t)}else if("range"===n){if(null===e.getAttribute("rangeMin")&&null===e.getAttribute("rangeMax"))return void ni(e,t)}else{if("control"!==n)return;{if("selection"!==e.getAttribute("controlType"))return;const n=e.getProp("availableOptions");if(n&&0===n.length)return void ni(e,t)}}e.getProp("isFieldVisible")||((e,t)=>{const n=e.getElement();e.setProp("isFieldVisible",!0),e.setProp("isInteractive",!0),n.setAttribute("aria-hidden","false"),t.includes("search-filter-field--hidden")&&(t.splice(t.indexOf("search-filter-field--hidden"),1),e.setProp("classList",t))})(e,t)};var oi={fields:{init:(e,t)=>{(e=>{Zo[e.getStoreKey()]||(Zo[e.getStoreKey()]=e)})(e),ri(e)},onUpdateOptions:(e,t)=>{ri(e)},onUpdateProps:(e,t)=>{t.availableOptions&&ri(e)},onUpdateValues:(e,t,n)=>{((e,t)=>{const n=e.queryActions(),{submit:r}=n;if(!r)return;if(!ei(0,t))return;let o=100;const i=t.attributes.autoSubmitDelay;i&&""!==i&&(o=parseInt(i)),clearTimeout(Xo),Xo=setTimeout((()=>{r()}),o)})(e,n),ti(e,n)},onClearValues:(e,t)=>{((e,t)=>{const n=e.queryActions(),{submit:r}=n;r&&ei(0,t)&&r()})(e,t),ti(e,t)},config:(e,t)=>{let n={...e};return n=((e,t)=>{const{attributes:n}=e,{showLabel:r,labelToggleVisibility:o=!1,labelInitialVisibility:i="visible"}=n;if("yes"!==r)return e;if("yes"!==o)return e;const s={...e},l=t.getProp("isFieldOpen");let a=void 0!==l?l:"visible"===i;return bo()&&(a=!0),s.extensions={labelProps:{fieldIsOpen:a,onClick:()=>{const e=!t.getProp("isFieldOpen");t.setProp("isFieldOpen",e);const n={...t.getProp("extensions")};n.inputClassName=e?null:"search-filter-field__input--hidden",n.labelProps={...n.labelProps,fieldIsOpen:e},t.setProp("extensions",n)},isToggle:!0},inputClassName:a?null:"search-filter-field__input--hidden"},s.isFieldOpen=a,s})(n,t),n=(e=>{if(!e.defaultValues)return e;if(!e.attributes.defaultValueType)return e;const t=e.attributes.defaultValueType;if(!t||"none"===t)return e;const n=e.defaultValues,r={...e},o=Number(e.attributes.queryId),i=searchAndFilter.frontend.queries.get(o);return i?window.location.href.includes(i.getActiveUrlArg())?e:(i.isActive()||(r.values=n),0===r.values.length&&(r.values=n),r):e})(n),n},setProps:(e,t)=>{if(e.isBusy){const n=[...t.getProp("classList")];n.includes("search-filter-field--is-busy")||(n.push("search-filter-field--is-busy"),e.classList=n)}else if(!1===e.isBusy){const n=[...t.getProp("classList")];n.includes("search-filter-field--is-busy")&&(n.splice(n.indexOf("search-filter-field--is-busy"),1),e.classList=n)}return e}},queries:{onSubmit:e=>{clearTimeout(Xo)},onReset:e=>{clearTimeout(Xo)}}};Br("fields",oi.fields),Br("queries",oi.queries),to("search","autocomplete",Nr),to("range","number",Dr),to("range","select",Ir),to("range","slider",Pr),to("range","radio",Tr),to("control","load_more",$r),to("control","selection",Fr);const ii=(e=>{const t=no();return{create:function(...n){const r=e(...n);return t.triggerEvent("create",[r]),r},getByUid:function(e){const t=[],n=so.getState();for(const r in n)n[r].uid===e&&t.push(n[r]._instance);return t.length>0?t[0]:null},get:function(e){const t=[],n=so.getState();for(const r in n)n[r].id===e&&t.push(n[r]._instance);return t.length>0?t[0]:null},getAll:function(e){const t=[],n=so.getState();for(const r in n)e?n[r].id===e&&t.push(n[r]._instance):t.push(n[r]._instance);return t},enable:function(){const e=so.getState();for(const t in e)e[t]._instance.enable()},disable:function(){const e=so.getState();for(const t in e)e[t]._instance.disable()},unload:function(){const e=so.getState(),t=[];for(const n in e)t.push(e[n].id),e[n]._instance.remove();return t},store:so,on:t.addEventListener,off:t.removeEventListener}})(_o);p([],"fields",ii);const si=(e=>{const t=no();return{create:function(n){const r=e(n);return t.triggerEvent("create",[r]),r},getByStoreKey:function(e){const t=ir.getState();return t[e]?t[e]._instance:null},get:function(e){if("number"!=typeof e)return yt("Query ID is not a number","error"),null;const t=[],n=ir.getState();for(const r in n)n[r].id===e&&t.push(n[r]._instance);return t.length>0?t[0]:null},getAll:function(){const e=[],t=ir.getState();for(const n in t)e.push(t[n]._instance);return e},enable:function(){const e=ir.getState();for(const t in e)e[t]._instance.enable()},disable:function(){const e=ir.getState();for(const t in e)e[t]._instance.disable()},unload:function(){const e=ir.getState(),t=[];for(const n in e)t.push(e[n].id),e[n]._instance.remove();return t},store:ir,on:t.addEventListener,off:t.removeEventListener}})(zo);p([],"queries",si),p([],"mount",(function(){const e=window?.searchAndFilterData?.queries,t=(e=>{const t=[];for(const[n,r]of Object.entries(e)){const e=r;if(void 0===e)return void(0,In.log)("Query config not set.","error");let n=si.get(e.id);n||(n=si.create(e)),t.push(n)}return t})(e??{}),n=window?.searchAndFilterData?.fields,r=(e=>{const t=[];for(const[n,r]of Object.entries(e)){const e=r;if(void 0===e)return void(0,In.log)("Field config not set.","error");let n=ii.get(e.id);if(!n){const r=document.querySelectorAll(`[data-search-filter-id="${e.id}"]`);if(0===r.length)n=ii.create(null,e),t.push(n);else for(const o of r)n=ii.create(o,e),t.push(n)}}return t})(n);document.dispatchEvent(new CustomEvent("search-filter/mount",{detail:{queries:t,fields:r}}))})),p([],"unmount",(function(){const e=ii.unload(),t=si.unload();document.dispatchEvent(new CustomEvent("search-filter/unmount",{detail:{fieldIds:e,queryIds:t}}))})),document.dispatchEvent(new CustomEvent("search-filter/interactive")),Yo()||document.addEventListener("readystatechange",(e=>{Jo||(Jo=Yo())}))}()}();