(()=>{var t={5351:()=>{Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(t,r){if(null==this)throw new TypeError('"this" est nul ou non défini');var e=Object(this),n=e.length>>>0;if(0===n)return!1;var o,i,u=0|r,c=Math.max(u>=0?u:n-Math.abs(u),0);for(;c<n;){if((o=e[c])===(i=t)||"number"==typeof o&&"number"==typeof i&&isNaN(o)&&isNaN(i))return!0;c++}return!1}})},6545:()=>{Array.prototype.fill||Object.defineProperty(Array.prototype,"fill",{value:function(t){if(null==this)throw new TypeError("this is null or not defined");for(var r=Object(this),e=r.length>>>0,n=arguments[1]|0,o=n<0?Math.max(e+n,0):Math.min(n,e),i=arguments[2],u=void 0===i?e:i|0,c=u<0?Math.max(e+u,0):Math.min(u,e);o<c;)r[o]=t,o++;return r}})},3656:()=>{Array.from||(Array.from=function(t){"use strict";return[].slice.call(t)})},7383:()=>{"function"!=typeof Element.prototype.closest&&(Element.prototype.closest=function(t){for(var r=this;r&&1===r.nodeType;){if(r.matches(t))return r;r=r.parentNode}return null})},1105:()=>{Array.prototype.find=Array.prototype.find||function(t){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof t)throw new TypeError("callback must be a function");for(var r=Object(this),e=r.length>>>0,n=arguments[1],o=0;o<e;o++){var i=r[o];if(t.call(n,i,o,r))return i}}},7661:()=>{Array.prototype.findIndex||(Array.prototype.findIndex=function(t){if(null===this)throw new TypeError("Array.prototype.findIndex called on null or undefined");if("function"!=typeof t)throw new TypeError("callback must be a function");for(var r=Object(this),e=r.length>>>0,n=arguments[1],o=0;o<e;o++)if(t.call(n,r[o],o,r))return o;return-1})},4141:()=>{Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector)},2961:()=>{Math.sign||(Math.sign=function(t){return 0===(t=+t)||isNaN(t)?Number(t):t>0?1:-1})},8166:()=>{window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=function(t,r){r=r||window;for(var e=0;e<this.length;e++)t.call(r,this[e],e,this)})},8784:function(t,r,e){!function(t){"use strict";var r=t.URLSearchParams?t.URLSearchParams:null,e=r&&"a=1"===new r({a:1}).toString(),n=r&&"+"===new r("s=%2B").get("s"),o="__URLSearchParams__",i=f.prototype,u=!(!t.Symbol||!t.Symbol.iterator);if(!(r&&e&&n)){i.append=function(t,r){y(this[o],t,r)},i.delete=function(t){delete this[o][t]},i.get=function(t){var r=this[o];return t in r?r[t][0]:null},i.getAll=function(t){var r=this[o];return t in r?r[t].slice(0):[]},i.has=function(t){return t in this[o]},i.set=function(t,r){this[o][t]=[""+r]},i.toString=function(){var t,r,e,n,i=this[o],u=[];for(r in i)for(e=s(r),t=0,n=i[r];t<n.length;t++)u.push(e+"="+s(n[t]));return u.join("&")};var c=!!n&&r&&!e&&t.Proxy;t.URLSearchParams=c?new Proxy(r,{construct:function(t,r){return new t(new f(r[0]).toString())}}):f;var a=t.URLSearchParams.prototype;a.polyfill=!0,a.forEach=a.forEach||function(t,r){var e=h(this.toString());Object.getOwnPropertyNames(e).forEach((function(n){e[n].forEach((function(e){t.call(r,e,n,this)}),this)}),this)},a.sort=a.sort||function(){var t,r,e,n=h(this.toString()),o=[];for(t in n)o.push(t);for(o.sort(),r=0;r<o.length;r++)this.delete(o[r]);for(r=0;r<o.length;r++){var i=o[r],u=n[i];for(e=0;e<u.length;e++)this.append(i,u[e])}},a.keys=a.keys||function(){var t=[];return this.forEach((function(r,e){t.push(e)})),p(t)},a.values=a.values||function(){var t=[];return this.forEach((function(r){t.push(r)})),p(t)},a.entries=a.entries||function(){var t=[];return this.forEach((function(r,e){t.push([e,r])})),p(t)},u&&(a[t.Symbol.iterator]=a[t.Symbol.iterator]||a.entries)}function f(t){((t=t||"")instanceof URLSearchParams||t instanceof f)&&(t=t.toString()),this[o]=h(t)}function s(t){var r={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'\(\)~]|%20|%00/g,(function(t){return r[t]}))}function l(t){return decodeURIComponent(t.replace(/\+/g," "))}function p(r){var e={next:function(){var t=r.shift();return{done:void 0===t,value:t}}};return u&&(e[t.Symbol.iterator]=function(){return e}),e}function h(t){var r={};if("object"==typeof t)for(var e in t)t.hasOwnProperty(e)&&y(r,e,t[e]);else{0===t.indexOf("?")&&(t=t.slice(1));for(var n=t.split("&"),o=0;o<n.length;o++){var i=n[o],u=i.indexOf("=");-1<u?y(r,l(i.slice(0,u)),l(i.slice(u+1))):i&&y(r,l(i),"")}}return r}function y(t,r,e){var n="string"==typeof e?e:null!=e&&"function"==typeof e.toString?e.toString():JSON.stringify(e);r in t?t[r].push(n):t[r]=[n]}}(void 0!==e.g?e.g:"undefined"!=typeof window?window:this)},8883:(t,r,e)=>{e(9650),e(7482),e(6094).Symbol},7652:(t,r,e)=>{e(2975),e(5890),t.exports=e(7960).f("iterator")},3387:t=>{t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},8184:(t,r,e)=>{var n=e(7574)("unscopables"),o=Array.prototype;null==o[n]&&e(3341)(o,n,{}),t.exports=function(t){o[n][t]=!0}},4228:(t,r,e)=>{var n=e(3305);t.exports=function(t){if(!n(t))throw TypeError(t+" is not an object!");return t}},1464:(t,r,e)=>{var n=e(7221),o=e(1485),i=e(157);t.exports=function(t){return function(r,e,u){var c,a=n(r),f=o(a.length),s=i(u,f);if(t&&e!=e){for(;f>s;)if((c=a[s++])!=c)return!0}else for(;f>s;s++)if((t||s in a)&&a[s]===e)return t||s||0;return!t&&-1}}},4848:(t,r,e)=>{var n=e(5089),o=e(7574)("toStringTag"),i="Arguments"==n(function(){return arguments}());t.exports=function(t){var r,e,u;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=function(t,r){try{return t[r]}catch(t){}}(r=Object(t),o))?e:i?n(r):"Object"==(u=n(r))&&"function"==typeof r.callee?"Arguments":u}},5089:t=>{var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},6094:t=>{var r=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=r)},5052:(t,r,e)=>{var n=e(3387);t.exports=function(t,r,e){if(n(t),void 0===r)return t;switch(e){case 1:return function(e){return t.call(r,e)};case 2:return function(e,n){return t.call(r,e,n)};case 3:return function(e,n,o){return t.call(r,e,n,o)}}return function(){return t.apply(r,arguments)}}},3344:t=>{t.exports=function(t){if(null==t)throw TypeError("Can't call method on  "+t);return t}},1763:(t,r,e)=>{t.exports=!e(9448)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},6034:(t,r,e)=>{var n=e(3305),o=e(7526).document,i=n(o)&&n(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},6140:t=>{t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},5969:(t,r,e)=>{var n=e(1311),o=e(1060),i=e(8449);t.exports=function(t){var r=n(t),e=o.f;if(e)for(var u,c=e(t),a=i.f,f=0;c.length>f;)a.call(t,u=c[f++])&&r.push(u);return r}},2127:(t,r,e)=>{var n=e(7526),o=e(6094),i=e(3341),u=e(8859),c=e(5052),a="prototype",f=function(t,r,e){var s,l,p,h,y=t&f.F,v=t&f.G,d=t&f.S,g=t&f.P,b=t&f.B,m=v?n:d?n[r]||(n[r]={}):(n[r]||{})[a],S=v?o:o[r]||(o[r]={}),x=S[a]||(S[a]={});for(s in v&&(e=r),e)p=((l=!y&&m&&void 0!==m[s])?m:e)[s],h=b&&l?c(p,n):g&&"function"==typeof p?c(Function.call,p):p,m&&u(m,s,p,t&f.U),S[s]!=p&&i(S,s,h),g&&x[s]!=p&&(x[s]=p)};n.core=o,f.F=1,f.G=2,f.S=4,f.P=8,f.B=16,f.W=32,f.U=64,f.R=128,t.exports=f},9448:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},9461:(t,r,e)=>{t.exports=e(4556)("native-function-to-string",Function.toString)},7526:t=>{var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},7917:t=>{var r={}.hasOwnProperty;t.exports=function(t,e){return r.call(t,e)}},3341:(t,r,e)=>{var n=e(7967),o=e(1996);t.exports=e(1763)?function(t,r,e){return n.f(t,r,o(1,e))}:function(t,r,e){return t[r]=e,t}},1308:(t,r,e)=>{var n=e(7526).document;t.exports=n&&n.documentElement},2956:(t,r,e)=>{t.exports=!e(1763)&&!e(9448)((function(){return 7!=Object.defineProperty(e(6034)("div"),"a",{get:function(){return 7}}).a}))},1249:(t,r,e)=>{var n=e(5089);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==n(t)?t.split(""):Object(t)}},7981:(t,r,e)=>{var n=e(5089);t.exports=Array.isArray||function(t){return"Array"==n(t)}},3305:t=>{t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},6032:(t,r,e)=>{"use strict";var n=e(4719),o=e(1996),i=e(3844),u={};e(3341)(u,e(7574)("iterator"),(function(){return this})),t.exports=function(t,r,e){t.prototype=n(u,{next:o(1,e)}),i(t,r+" Iterator")}},8175:(t,r,e)=>{"use strict";var n=e(2750),o=e(2127),i=e(8859),u=e(3341),c=e(906),a=e(6032),f=e(3844),s=e(627),l=e(7574)("iterator"),p=!([].keys&&"next"in[].keys()),h="keys",y="values",v=function(){return this};t.exports=function(t,r,e,d,g,b,m){a(e,r,d);var S,x,w,O=function(t){if(!p&&t in _)return _[t];switch(t){case h:case y:return function(){return new e(this,t)}}return function(){return new e(this,t)}},j=r+" Iterator",E=g==y,P=!1,_=t.prototype,L=_[l]||_["@@iterator"]||g&&_[g],T=L||O(g),A=g?E?O("entries"):T:void 0,M="Array"==r&&_.entries||L;if(M&&(w=s(M.call(new t)))!==Object.prototype&&w.next&&(f(w,j,!0),n||"function"==typeof w[l]||u(w,l,v)),E&&L&&L.name!==y&&(P=!0,T=function(){return L.call(this)}),n&&!m||!p&&!P&&_[l]||u(_,l,T),c[r]=T,c[j]=v,g)if(S={values:E?T:O(y),keys:b?T:O(h),entries:A},m)for(x in S)x in _||i(_,x,S[x]);else o(o.P+o.F*(p||P),r,S);return S}},4970:t=>{t.exports=function(t,r){return{value:r,done:!!t}}},906:t=>{t.exports={}},2750:t=>{t.exports=!1},2988:(t,r,e)=>{var n=e(4415)("meta"),o=e(3305),i=e(7917),u=e(7967).f,c=0,a=Object.isExtensible||function(){return!0},f=!e(9448)((function(){return a(Object.preventExtensions({}))})),s=function(t){u(t,n,{value:{i:"O"+ ++c,w:{}}})},l=t.exports={KEY:n,NEED:!1,fastKey:function(t,r){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!i(t,n)){if(!a(t))return"F";if(!r)return"E";s(t)}return t[n].i},getWeak:function(t,r){if(!i(t,n)){if(!a(t))return!0;if(!r)return!1;s(t)}return t[n].w},onFreeze:function(t){return f&&l.NEED&&a(t)&&!i(t,n)&&s(t),t}}},4719:(t,r,e)=>{var n=e(4228),o=e(1626),i=e(6140),u=e(766)("IE_PROTO"),c=function(){},a="prototype",f=function(){var t,r=e(6034)("iframe"),n=i.length;for(r.style.display="none",e(1308).appendChild(r),r.src="javascript:",(t=r.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),f=t.F;n--;)delete f[a][i[n]];return f()};t.exports=Object.create||function(t,r){var e;return null!==t?(c[a]=n(t),e=new c,c[a]=null,e[u]=t):e=f(),void 0===r?e:o(e,r)}},7967:(t,r,e)=>{var n=e(4228),o=e(2956),i=e(3048),u=Object.defineProperty;r.f=e(1763)?Object.defineProperty:function(t,r,e){if(n(t),r=i(r,!0),n(e),o)try{return u(t,r,e)}catch(t){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[r]=e.value),t}},1626:(t,r,e)=>{var n=e(7967),o=e(4228),i=e(1311);t.exports=e(1763)?Object.defineProperties:function(t,r){o(t);for(var e,u=i(r),c=u.length,a=0;c>a;)n.f(t,e=u[a++],r[e]);return t}},8641:(t,r,e)=>{var n=e(8449),o=e(1996),i=e(7221),u=e(3048),c=e(7917),a=e(2956),f=Object.getOwnPropertyDescriptor;r.f=e(1763)?f:function(t,r){if(t=i(t),r=u(r,!0),a)try{return f(t,r)}catch(t){}if(c(t,r))return o(!n.f.call(t,r),t[r])}},4765:(t,r,e)=>{var n=e(7221),o=e(9415).f,i={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return u&&"[object Window]"==i.call(t)?function(t){try{return o(t)}catch(t){return u.slice()}}(t):o(n(t))}},9415:(t,r,e)=>{var n=e(4561),o=e(6140).concat("length","prototype");r.f=Object.getOwnPropertyNames||function(t){return n(t,o)}},1060:(t,r)=>{r.f=Object.getOwnPropertySymbols},627:(t,r,e)=>{var n=e(7917),o=e(8270),i=e(766)("IE_PROTO"),u=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),n(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},4561:(t,r,e)=>{var n=e(7917),o=e(7221),i=e(1464)(!1),u=e(766)("IE_PROTO");t.exports=function(t,r){var e,c=o(t),a=0,f=[];for(e in c)e!=u&&n(c,e)&&f.push(e);for(;r.length>a;)n(c,e=r[a++])&&(~i(f,e)||f.push(e));return f}},1311:(t,r,e)=>{var n=e(4561),o=e(6140);t.exports=Object.keys||function(t){return n(t,o)}},8449:(t,r)=>{r.f={}.propertyIsEnumerable},1996:t=>{t.exports=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}}},8859:(t,r,e)=>{var n=e(7526),o=e(3341),i=e(7917),u=e(4415)("src"),c=e(9461),a="toString",f=(""+c).split(a);e(6094).inspectSource=function(t){return c.call(t)},(t.exports=function(t,r,e,c){var a="function"==typeof e;a&&(i(e,"name")||o(e,"name",r)),t[r]!==e&&(a&&(i(e,u)||o(e,u,t[r]?""+t[r]:f.join(String(r)))),t===n?t[r]=e:c?t[r]?t[r]=e:o(t,r,e):(delete t[r],o(t,r,e)))})(Function.prototype,a,(function(){return"function"==typeof this&&this[u]||c.call(this)}))},3844:(t,r,e)=>{var n=e(7967).f,o=e(7917),i=e(7574)("toStringTag");t.exports=function(t,r,e){t&&!o(t=e?t:t.prototype,i)&&n(t,i,{configurable:!0,value:r})}},766:(t,r,e)=>{var n=e(4556)("keys"),o=e(4415);t.exports=function(t){return n[t]||(n[t]=o(t))}},4556:(t,r,e)=>{var n=e(6094),o=e(7526),i="__core-js_shared__",u=o[i]||(o[i]={});(t.exports=function(t,r){return u[t]||(u[t]=void 0!==r?r:{})})("versions",[]).push({version:n.version,mode:e(2750)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},1212:(t,r,e)=>{var n=e(7087),o=e(3344);t.exports=function(t){return function(r,e){var i,u,c=String(o(r)),a=n(e),f=c.length;return a<0||a>=f?t?"":void 0:(i=c.charCodeAt(a))<55296||i>56319||a+1===f||(u=c.charCodeAt(a+1))<56320||u>57343?t?c.charAt(a):i:t?c.slice(a,a+2):u-56320+(i-55296<<10)+65536}}},157:(t,r,e)=>{var n=e(7087),o=Math.max,i=Math.min;t.exports=function(t,r){return(t=n(t))<0?o(t+r,0):i(t,r)}},7087:t=>{var r=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?e:r)(t)}},7221:(t,r,e)=>{var n=e(1249),o=e(3344);t.exports=function(t){return n(o(t))}},1485:(t,r,e)=>{var n=e(7087),o=Math.min;t.exports=function(t){return t>0?o(n(t),9007199254740991):0}},8270:(t,r,e)=>{var n=e(3344);t.exports=function(t){return Object(n(t))}},3048:(t,r,e)=>{var n=e(3305);t.exports=function(t,r){if(!n(t))return t;var e,o;if(r&&"function"==typeof(e=t.toString)&&!n(o=e.call(t)))return o;if("function"==typeof(e=t.valueOf)&&!n(o=e.call(t)))return o;if(!r&&"function"==typeof(e=t.toString)&&!n(o=e.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},4415:t=>{var r=0,e=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+e).toString(36))}},5392:(t,r,e)=>{var n=e(7526),o=e(6094),i=e(2750),u=e(7960),c=e(7967).f;t.exports=function(t){var r=o.Symbol||(o.Symbol=i?{}:n.Symbol||{});"_"==t.charAt(0)||t in r||c(r,t,{value:u.f(t)})}},7960:(t,r,e)=>{r.f=e(7574)},7574:(t,r,e)=>{var n=e(4556)("wks"),o=e(4415),i=e(7526).Symbol,u="function"==typeof i;(t.exports=function(t){return n[t]||(n[t]=u&&i[t]||(u?i:o)("Symbol."+t))}).store=n},5165:(t,r,e)=>{"use strict";var n=e(8184),o=e(4970),i=e(906),u=e(7221);t.exports=e(8175)(Array,"Array",(function(t,r){this._t=u(t),this._i=0,this._k=r}),(function(){var t=this._t,r=this._k,e=this._i++;return!t||e>=t.length?(this._t=void 0,o(1)):o(0,"keys"==r?e:"values"==r?t[e]:[e,t[e]])}),"values"),i.Arguments=i.Array,n("keys"),n("values"),n("entries")},7482:(t,r,e)=>{"use strict";var n=e(4848),o={};o[e(7574)("toStringTag")]="z",o+""!="[object z]"&&e(8859)(Object.prototype,"toString",(function(){return"[object "+n(this)+"]"}),!0)},2975:(t,r,e)=>{"use strict";var n=e(1212)(!0);e(8175)(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,r=this._t,e=this._i;return e>=r.length?{value:void 0,done:!0}:(t=n(r,e),this._i+=t.length,{value:t,done:!1})}))},9650:(t,r,e)=>{"use strict";var n=e(7526),o=e(7917),i=e(1763),u=e(2127),c=e(8859),a=e(2988).KEY,f=e(9448),s=e(4556),l=e(3844),p=e(4415),h=e(7574),y=e(7960),v=e(5392),d=e(5969),g=e(7981),b=e(4228),m=e(3305),S=e(8270),x=e(7221),w=e(3048),O=e(1996),j=e(4719),E=e(4765),P=e(8641),_=e(1060),L=e(7967),T=e(1311),A=P.f,M=L.f,N=E.f,k=n.Symbol,F=n.JSON,I=F&&F.stringify,C="prototype",R=h("_hidden"),U=h("toPrimitive"),D={}.propertyIsEnumerable,G=s("symbol-registry"),V=s("symbols"),z=s("op-symbols"),J=Object[C],W="function"==typeof k&&!!_.f,B=n.QObject,H=!B||!B[C]||!B[C].findChild,K=i&&f((function(){return 7!=j(M({},"a",{get:function(){return M(this,"a",{value:7}).a}})).a}))?function(t,r,e){var n=A(J,r);n&&delete J[r],M(t,r,e),n&&t!==J&&M(J,r,n)}:M,Y=function(t){var r=V[t]=j(k[C]);return r._k=t,r},q=W&&"symbol"==typeof k.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof k},Q=function(t,r,e){return t===J&&Q(z,r,e),b(t),r=w(r,!0),b(e),o(V,r)?(e.enumerable?(o(t,R)&&t[R][r]&&(t[R][r]=!1),e=j(e,{enumerable:O(0,!1)})):(o(t,R)||M(t,R,O(1,{})),t[R][r]=!0),K(t,r,e)):M(t,r,e)},X=function(t,r){b(t);for(var e,n=d(r=x(r)),o=0,i=n.length;i>o;)Q(t,e=n[o++],r[e]);return t},Z=function(t){var r=D.call(this,t=w(t,!0));return!(this===J&&o(V,t)&&!o(z,t))&&(!(r||!o(this,t)||!o(V,t)||o(this,R)&&this[R][t])||r)},$=function(t,r){if(t=x(t),r=w(r,!0),t!==J||!o(V,r)||o(z,r)){var e=A(t,r);return!e||!o(V,r)||o(t,R)&&t[R][r]||(e.enumerable=!0),e}},tt=function(t){for(var r,e=N(x(t)),n=[],i=0;e.length>i;)o(V,r=e[i++])||r==R||r==a||n.push(r);return n},rt=function(t){for(var r,e=t===J,n=N(e?z:x(t)),i=[],u=0;n.length>u;)!o(V,r=n[u++])||e&&!o(J,r)||i.push(V[r]);return i};W||(c((k=function(){if(this instanceof k)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0),r=function(e){this===J&&r.call(z,e),o(this,R)&&o(this[R],t)&&(this[R][t]=!1),K(this,t,O(1,e))};return i&&H&&K(J,t,{configurable:!0,set:r}),Y(t)})[C],"toString",(function(){return this._k})),P.f=$,L.f=Q,e(9415).f=E.f=tt,e(8449).f=Z,_.f=rt,i&&!e(2750)&&c(J,"propertyIsEnumerable",Z,!0),y.f=function(t){return Y(h(t))}),u(u.G+u.W+u.F*!W,{Symbol:k});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),nt=0;et.length>nt;)h(et[nt++]);for(var ot=T(h.store),it=0;ot.length>it;)v(ot[it++]);u(u.S+u.F*!W,"Symbol",{for:function(t){return o(G,t+="")?G[t]:G[t]=k(t)},keyFor:function(t){if(!q(t))throw TypeError(t+" is not a symbol!");for(var r in G)if(G[r]===t)return r},useSetter:function(){H=!0},useSimple:function(){H=!1}}),u(u.S+u.F*!W,"Object",{create:function(t,r){return void 0===r?j(t):X(j(t),r)},defineProperty:Q,defineProperties:X,getOwnPropertyDescriptor:$,getOwnPropertyNames:tt,getOwnPropertySymbols:rt});var ut=f((function(){_.f(1)}));u(u.S+u.F*ut,"Object",{getOwnPropertySymbols:function(t){return _.f(S(t))}}),F&&u(u.S+u.F*(!W||f((function(){var t=k();return"[null]"!=I([t])||"{}"!=I({a:t})||"{}"!=I(Object(t))}))),"JSON",{stringify:function(t){for(var r,e,n=[t],o=1;arguments.length>o;)n.push(arguments[o++]);if(e=r=n[1],(m(r)||void 0!==t)&&!q(t))return g(r)||(r=function(t,r){if("function"==typeof e&&(r=e.call(this,t,r)),!q(r))return r}),n[1]=r,I.apply(F,n)}}),k[C][U]||e(3341)(k[C],U,k[C].valueOf),l(k,"Symbol"),l(Math,"Math",!0),l(n.JSON,"JSON",!0)},5890:(t,r,e)=>{for(var n=e(5165),o=e(1311),i=e(8859),u=e(7526),c=e(3341),a=e(906),f=e(7574),s=f("iterator"),l=f("toStringTag"),p=a.Array,h={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},y=o(h),v=0;v<y.length;v++){var d,g=y[v],b=h[g],m=u[g],S=m&&m.prototype;if(S&&(S[s]||c(S,s,p),S[l]||c(S,l,g),a[g]=p,b))for(d in n)S[d]||i(S,d,n[d],!0)}}},r={};function e(n){var o=r[n];if(void 0!==o)return o.exports;var i=r[n]={exports:{}};return t[n].call(i.exports,i,i.exports,e),i.exports}e.n=t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},e.d=(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),e.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r),(()=>{"use strict";e(8883),e(7652),e(4141),e(7383),e(8166),e(6545),e(3656),e(5351),e(7661),e(1105),e(2961),e(8784)})()})();
(()=>{var e={957:()=>{function e(e){if("apply"!==this.facet.type)return;const{isShadow:t}=this.options,{settings:s,slug:i}=this.facet,{apply_redirect:n,apply_history:r}=s,a=this.facet.html&&e.querySelector("button.wpgb-apply");this.facet.rendered||a&&a.addEventListener("click",(()=>c.apply(this,[i]))),n&&t||(this.appliedParams=this.getParams()),this.autoRefresh=n&&t&&this.autoRefresh,this.history=this.history&&(!t||r),this.facet.rendered=!0,a&&(a.disabled=this.facet.disabled??!1),this.facet.html?(u.call(this,a),p.call(this,a)):this.facet.rendered=!1}function t(){"appliedParams"in this&&(this.appliedParams=this.getParams())}function s(e,t){if(!("appliedParams"in this))return;const s=this.getFacet(e)[0],i=s&&s.id,n=this.facet&&this.facet.type||s&&s.type;this.autoRefresh=!1,["sort","reset","selection","pagination","load_more","per_page"].includes(n)||a.call(this).includes(i)?(this.autoRefresh=!0,this.appliedParams[e]=t,l.call(this,e)):o.call(this)}function i(){"appliedParams"in this&&(this.appliedParams=this.getParams())}function n(e){"appliedParams"in this&&(e.forEach((e=>delete this.appliedParams[e])),l.call(this,""))}function r(){const e=[];for(const t in this.facets)this.facets[t].forEach((t=>"apply"===t.type&&e.push(t)));return e}function a(){let e=[];return r.call(this).forEach((t=>{e=[...e,...t.settings.apply_excluded||[]]})),e.map(Number)}function o(){r.call(this).forEach((e=>p.call(this,e.holder.querySelector("button.wpgb-apply"))))}function l(e){for(const e in this.getParams())!this.appliedParams[e]&&this.setParams(e,[]);for(const t in this.appliedParams)t!==e&&this.setParams(t,this.appliedParams[t])}function c(e){const t=this.getFacet(e)[0];t&&t.settings.apply_redirect?d.apply(this,[e]):h.apply(this,[e])}function d(e){const t=this.getFacet(e)[0];if(this.options.isGutenberg||!t||!t.settings.apply_url)return;let s="";try{s=new URL(t.settings.apply_url)}catch{s=new URL(window.location.href)}if(!s?.searchParams){const e=this.getQueryString(),s=t.settings.apply_url.includes("?")?"&":"?";return void(window.location.href=t.settings.apply_url+(e?s+e:""))}const i=this.getParams();for(const e in i){const t=`_${e}`,n=s.searchParams.get(t||{})?.split(",")||[];s.searchParams.set(t,[...new Set([...n,...i[e]])].join(","))}window.location.href=s.href}function h(e){this.emit("apply",[e]),this.appliedParams=this.getParams(),this.autoRefresh=!0,this.refresh()}function u(e){const t=this.facet.html&&document.createRange().createContextualFragment(this.facet.html),s=t&&t.querySelector("button.wpgb-apply");s&&e&&(e.textContent=s.textContent)}function p(e){"appliedParams"in this&&e&&(e.disabled=function(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e){if(!t[s])return!1;if(JSON.stringify([...e[s]].sort())!==JSON.stringify([...t[s]].sort()))return!1}return!0}(this.appliedParams||{},this.getParams()))}window.WP_Grid_Builder.on("init",(function(r){r.facets.on("render",e),r.facets.on("prefilter",t),r.facets.on("change",s),r.facets.on("refresh",i),r.facets.on("reset",n)}))},4540:()=>{function e(e){let{target:s}=e;const n=s.closest(".wpgb-checkbox"),r=n&&n.closest('li[role="treeitem"][aria-expanded="false"]');t.call(this,s),i.call(this,n),n&&n.closest("li").querySelector('[aria-pressed="true"]')&&"false"===n.getAttribute("aria-pressed")&&n.setAttribute("aria-pressed","mixed"),r&&"true"===n.getAttribute("aria-pressed")&&r.click()}function t(e){let t=!1;for(;e=n(e);){let i=r(e),n=e.getAttribute("aria-pressed");t=t||[...i].filter((e=>"true"===e.getAttribute("aria-pressed"))).length,t&&"false"===n&&e.setAttribute("aria-pressed","mixed"),!t&&"mixed"===n&&e.setAttribute("aria-pressed","false"),t&&s.call(this,e)}}function s(e){let{name:t,value:s}=e.querySelector("input");e.setAttribute("aria-pressed","mixed"),this.deleteParams(t.replace("[]",""),[s])}function i(e){r(e).forEach((e=>{let{name:t,value:s}=e.querySelector("input");e.setAttribute("aria-pressed","false"),this.deleteParams(t.replace("[]",""),[s])}))}function n(e){return(e=(e=e.closest("ul.wpgb-hierarchical-list"))&&e.closest("ul.wpgb-hierarchical-list li"))&&e.querySelector(".wpgb-checkbox")}function r(e){return(e=(e=e.closest("ul.wpgb-hierarchical-list li"))&&e.querySelector("ul.wpgb-hierarchical-list"))&&e.querySelectorAll(".wpgb-checkbox")||[]}window.WP_Grid_Builder.on("init",(function(t){t.facets.on("render",(function(t){if("checkbox"!==this.facet.type||!this.facet.settings.hierarchical)return;!function(e){e.forEach((e=>{for(;e=n(e);)"false"===e.getAttribute("aria-pressed")&&e.setAttribute("aria-pressed","mixed")}))}(t.querySelectorAll('.wpgb-checkbox[aria-pressed="true"]')),!t._onChange&&t.addEventListener("change",e.bind(this)),t._onChange=!0}))}))},4705:()=>{const e="undefined"!=typeof Map&&new Map;window.WP_Grid_Builder.on("init",(function(t){t.facets.on("render",(function(t){const{type:s,focused:i}=this.facet;if(function(t,s,i){const n=t.querySelector("button.wpgb-toggle-hidden");if(!n)return;const r=n.previousElementSibling,a=`wpgb-${Math.random().toString(36).substr(2,9)}`;n.setAttribute("aria-controls",a),r.id=a,function(t,s,i){if(e.has(t))e.get(t)&&(s.setAttribute("aria-expanded",!1),i.toggleHidden(!1,i.facet));else{t.querySelector('li[hidden] [role="button"][aria-pressed="true"] input[type="hidden"]')&&i.toggleHidden(!1,i.facet)}}(t,n,i),s&&s.classList.contains("wpgb-toggle-hidden")&&n.focus({preventScroll:!0})}(t,i,this),i&&t)switch(s){case"load_more":!function(e){const t=e.querySelector(".wpgb-load-more");requestAnimationFrame((()=>t&&t.focus({preventScroll:!0})))}(t);break;case"pagination":!function(e,t){let s=parseInt(t.getAttribute("data-page")||0,10);if(s){const i=t.textContent;e.querySelectorAll(`a[data-page="${s-1}"], a[data-page="${s}"], a[data-page="${s+1}"]`).forEach((e=>i===e.textContent&&e.focus({preventScroll:!0})))}}(t,i);break;case"selection":case"number":case"range":case"date":case"search":case"autocomplete":case"geolocation":case"map":case"result_count":case"reset":case"apply":break;default:!function(e,t){const s=t.facet.focused.querySelector("input");if(s){const i=s.value,n=e.querySelector(`[role="button"] input[type="hidden"][value="${CSS.escape(i)}"]`),r=n&&n.closest('[role="button"]');t.facet.settings.treeview||r&&r.focus({preventScroll:!0})}}(t,this)}})),t.facets.on("toggle",((t,s)=>e.set(t.holder,s)))}))},1542:()=>{function e(e){if("reset"!==this.facet.type)return;const s=this.facet.html&&e.querySelector("button.wpgb-reset");s&&t.call(this,s)}function t(e){const t=this.facet.settings.reset_facet||[],s=this.facet.disabled;requestAnimationFrame((()=>{setTimeout((()=>{const i=Object.keys(this.getParams());let n=i.length;Array.isArray(t)&&t.length&&(n=t.filter((e=>this.facets[e]&&this.facets[e][0]&&i.includes(this.facets[e][0].slug))).length),e.disabled=s||!n}))}))}window.WP_Grid_Builder.on("init",(function(t){t.facets.on("render",e)}))},4828:()=>{const e="undefined"!=typeof Map&&new Map;function t(e){const{target:t}=e;"LI"===t.tagName&&t.hasAttribute("tabindex")&&(this.querySelectorAll('li[tabindex="0"]').forEach((e=>e.tabIndex=-1)),t.tabIndex=0)}function s(t){let{target:s}=t;if("treeitem"!==s.getAttribute("role"))return;const i=e.get(this),r=s.getAttribute("aria-expanded");n(i,s,"false"===r),l(s)}function i(t){const s=t.target.closest("li");if(!s)return;const i=e.get(this);switch(t.key){case" ":case"Enter":!function(e){const t=e.querySelector('.wpgb-checkbox[role=button]:not([tabindex="-1"])');t&&t.click()}(s);break;case"*":case"Multiply":!function(e,t){const s=t.closest("ul").children;[...s].forEach((t=>n(e,t,!0)))}(i,s);break;case"Home":!function(e){const t=e.items[0];!l(t)&&r(e,t)}(i);break;case"End":!function(e){const t=e.items[e.items.length-1];!l(t)&&a(e,t)}(i);break;case"Left":case"ArrowLeft":"true"===s.getAttribute("aria-expanded")?n(i,s,!1):a(i,s,!0);break;case"Right":case"ArrowRight":"true"===s.getAttribute("aria-expanded")?r(i,s,!0):n(i,s,!0);break;case"Down":case"ArrowDown":r(i,s);break;case"Up":case"ArrowUp":a(i,s);break;default:return void function(e,t,s){const{items:i}=e,{length:n}=i,r=[...i].indexOf(t);for(let e=r+1;e<n;e++)if(o(i[e],s)&&l(i[e]))return;for(let e=0;e<r;e++)if(o(i[e],s)&&l(i[e]))return}(i,s,t.key)}t.preventDefault()}function n(t,s,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!s.hasAttribute("aria-expanded")||!n&&null===s.offsetParent)return;const r=s.closest(".wpgb-facet"),a=s.querySelector("input");s.setAttribute("aria-expanded",i),i?t.states[a.value]=!0:delete t.states[a.value],e.set(r,t)}function r(e,t){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const{items:i}=e,{length:n}=i,r=[...i].indexOf(t),a=s&&t.querySelector("ul");if(!(r>=n-1))for(let e=r+1;e<n&&(s&&a!==i[e].parentElement||!l(i[e]));e++);}function a(e,t){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const{items:i}=e,n=[...i].indexOf(t);if(!(n<1))for(let e=n-1;e>=0&&(s&&!i[e].contains(t)||!l(i[e]));e--);}function o(e,t){return e.textContent.charAt(0).toLowerCase()===t}function l(e){return!!c(e)&&(e.focus(),!0)}function c(e){return null!==e.offsetParent&&!e.querySelector("input").disabled}window.WP_Grid_Builder.on("init",(function(r){r.facets.on("render",(function(n){if("checkbox"!==this.facet.type||!this.facet.settings.treeview)return;const r=e.has(n),a=e.get(n)||{states:{}},o=n.querySelectorAll(".wpgb-checkbox-facet li");if(function(e,t){for(const s in t){const t=e.querySelector(`li[role=treeitem] input[value="${s}"]`);t&&t.closest("li").setAttribute("aria-expanded",!0)}}(n,a.states),e.set(n,{...a,items:o}),r||(n.addEventListener("click",s),n.addEventListener("keydown",i),n.addEventListener("focus",t,!0),function(t,s){const{selected:i}=t,{holder:n}=t;i.forEach((e=>{let t=n.querySelector(`input[value="${e}"]`),i=t&&t.closest("li[role=treeitem][aria-expanded=false]");for(i&&(i.setAttribute("aria-expanded",!0),s.states[i.querySelector("input").value]=!0),t=t&&t.closest("ul");t;)t=t.closest("li[role=treeitem][aria-expanded=false]"),t&&(t.setAttribute("aria-expanded",!0),s.states[t.querySelector("input").value]=!0)})),e.set(n,{...s,states:s.states})}(this.facet,e.get(n))),this.facet.focused){const e=this.facet.focused.querySelector("input");if(e){const t=n.querySelector(`[role="button"] input[type="hidden"][value="${e.value}"]`),s=t&&t.closest('[role="button"]');if(s)return void s.closest("li").focus({preventScroll:!0})}}for(let e=0;e<o.length;e++)if(c(o[e])){o[e].tabIndex=0;break}})),r.facets.on("toggle",(function(t,s){"checkbox"===t.type&&t.settings.treeview&&!s&&function(t){const{holder:s}=t,i=s.querySelector('li[tabindex="0"][hidden], li[hidden] li[tabindex="0"]'),r=e.get(s);if(r.items&&r.items.forEach((e=>null===e.offsetParent&&n(r,e,!1,!0))),r&&i){const{items:e}=r;for(let t=[...e].indexOf(i)-1;t>=0;t--)if(c(e[t])){e[t].tabIndex=0,i.tabIndex=-1;break}}}(t)}))}))},694:()=>{const e=document.createElement("div"),t="wpgb-content",s=new RegExp(`^${t}`,"i");function i(e){return e=(e=e.replace(/%[a-fA-F0-9]{2}/g,"")).replace(/[^A-Za-z0-9_-]/g,""),CSS.escape(e)}window.addEventListener("wpgb.loaded",(()=>{wpgb_settings&&wpgb_settings.shadowGrids&&wpgb_settings.shadowGrids.forEach((n=>{let r={id:n,isShadow:!0},a=e.cloneNode();/^\d+$/.test(n)||(r.isTemplate=!0),s.test(n)&&(a=function(e,s){let n=`.${i(s.id)}:not([hidden])`,r=document.querySelector(`${n}:not([data-instance])`);if(n+=` > *:not([class*="${t}"])`,r){const e=r.querySelector(`[class*="${t}"][hidden]`);e&&e.parentElement.removeChild(e)}else{if(n=`.${i(s.id)}`,r=document.querySelector(`${n}:not([data-instance])`),r&&r.parentElement){const e=r;r=r.parentElement,e.parentElement.removeChild(e)}n+=` ~ *:not([class*="${t}"])`}r&&(delete s.isShadow,r.querySelector(".wpgb-facet")&&console.error(`Facets should not be placed in '${s.id}' element.`));return s.customContent=!0,s.itemSelector=n,s.ajaxUrl=wpgb_settings.permalink+"?"+wpgb_settings.ajaxUrl.split(/[?#]/)[1],r||e}(a,r),r.id=n.trim()),WP_Grid_Builder.instantiate(a,r).init()}))}))},4156:function(e,t,s){(function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var t=function(e){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var t,s=String(e),i=s.length,n=-1,r="",a=s.charCodeAt(0);++n<i;)0!=(t=s.charCodeAt(n))?r+=t>=1&&t<=31||127==t||0==n&&t>=48&&t<=57||1==n&&t>=48&&t<=57&&45==a?"\\"+t.toString(16)+" ":0==n&&1==i&&45==t||!(t>=128||45==t||95==t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122)?"\\"+s.charAt(n):s.charAt(n):r+="�";return r};e.CSS||(e.CSS={}),e.CSS.escape=t})(void 0!==s.g?s.g:this)}},t={};function s(i){var n=t[i];if(void 0!==n)return n.exports;var r=t[i]={exports:{}};return e[i].call(r.exports,r,r.exports,s),r.exports}s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),(()=>{"use strict";const e=function(e){let t;"function"==typeof Event?t=new CustomEvent(e):(t=document.createEvent("CustomEvent"),t.initEvent(e,!0,!0)),window.dispatchEvent(t)};s(4156);const t=[],i=(()=>{const e=document.createElement("link").relList;return!!(e&&e.supports&&e.supports("preload"))})();class n{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e&&(this.library=e,this.callback=s,this.getScript(),this.script))return this.isLoaded()?this.callback&&this.callback():void(this.isLoading()?this.bindEvents(t[this.script.handle].element):this.loadScript())}getScript(){this.script=wpgb_settings.vendors.filter((e=>{let{handle:t}=e;return t===this.library})),this.script=this.script.shift()}isLoaded(){return t[this.library]&&t[this.library].loaded}isLoading(){return t[this.library]&&t[this.library].loading}loadScript(){const e=document.createElement("css"===this.script.type?"link":"script"),s=this.script.version?`?v=${this.script.version}`:"",n=this.script.source+s;this.bindEvents(e),"css"===this.script.type?(e.rel=i?"preload":"stylesheet",i&&(e.as="style"),e.href=n):e.src=n,document.head.appendChild(e),t[this.script.handle]={loading:!0,element:e}}onLoad(){const e=t[this.script.handle];"preload"===e.element.rel&&(e.element.rel="stylesheet",e.element.removeAttribute("as")),e.loaded=!0,this.callback&&this.callback()}onError(){t[this.script.handle].error=!0}bindEvents(e){e.addEventListener("load",(()=>this.onLoad())),e.addEventListener("error",(()=>this.onerror()))}}class r{constructor(){this.listeners=new Map}canListen(e,t){return!("function"!=typeof t||!e)||(!("object"!=typeof t||!t[e])||(console.error(`Invalid listener for event name: "${e}"`),!1))}exists(e,t){if(this.listeners.has(e))return this.listeners.get(e).find((e=>e.listener===t))}on(e,t){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.canListen(e,t)?(this.listeners.has(e)||this.listeners.set(e,[]),this.exists(e,t)||this.listeners.get(e).push({listener:t,once:s}),this):this}once(e,t){return this.on(e,t,!0)}off(e,t){const s=this.listeners.get(e)||[],i=s.findIndex((e=>e.listener===t));return i>-1&&s.splice(i,1),s.length<1&&this.listeners.delete(e),this}offAll(){return this.listeners.clear(),this}emit(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),i=1;i<t;i++)s[i-1]=arguments[i];return[...this.listeners.get(e)||[]].forEach((t=>{t.once&&this.off(e,t.listener),"object"==typeof t.listener?t.listener[e].apply(t.listener,...s):t.listener.apply(this,...s)})),this}}class a extends r{constructor(){super(),this.vendors={},this.instances={}}get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const{instances:t}=this,s=[];if(!Object.keys(t).length)return[];for(const i in t)(t[i].id||"").toString()===e.toString()&&s.push(t[i]);return s}instance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return Object.keys(this.instances).length&&this.instances[e]?this.instances[e]:{}}}const o={get:()=>[],instance:()=>[],instances:()=>[],instantiate:()=>[],on:()=>null,off:()=>null,once:()=>null,offAll:()=>null,emit:()=>null,vendors:{},unsupported:!0};if(!window?.WP_Grid_Builder?.instance){const e=!!(Math.sign&&Array.from&&Array.prototype.fill&&Array.prototype.find&&Array.prototype.findIndex&&Array.prototype.includes&&Element.prototype.matches&&Element.prototype.closest&&NodeList.prototype.forEach&&window.Map&&window.URLSearchParams);window.WP_Grid_Builder=e?Object.assign(new a,window?.WP_Grid_Builder||{}):Object.assign(o,window?.WP_Grid_Builder||{})}class l{constructor(e){this.instance=e,this.element=e.element,this.selector=CSS.escape(this.instance.id.replace("/","")),e.facets.on("fetched",this)}fetched(e,t){if(!e.posts)return;const s=document.createRange().createContextualFragment(e.posts);e.posts="",this.append(s,t)}append(e,t){"replace"===t?this.replaceContent(e):this.appendContent(e)}replaceContent(e){const t=e.querySelectorAll(`.${this.selector} > *`);this.element.innerHTML="",t?.forEach?.((e=>{this.element.append(e)}))}appendContent(e){let t=null,s=null;const i=e.querySelectorAll(`.${this.selector} > *`),n=this.element.querySelectorAll(`.${this.selector} > *`);n?.forEach?.((e=>{e.className.includes("gb-looper-")?t=e:e.remove()})),i?.forEach?.((e=>{e.className.includes("gb-looper-")&&(s=e),this.element.append(e)})),null===s&&null!==t?t?.remove?.():null!==s&&null!==t&&(s?.replaceWith?.(t),[...s?.children||[]]?.forEach?.((e=>{t?.append?.(e)})))}}WP_Grid_Builder.on("init",(e=>{"generateblocks/query"===e?.options?.block&&new l(e)}));const c={},d={},h={};let u=0;class p extends r{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(),e){if(e.instance)return h[e.instance];this.element=e,this.options={...d,...t},this.htmlInit(),this.id=this.options.id,this.setInstance(),this.intiFacets()}}setInstance(){this.instance=++u,this.element.instance=this.instance,h[this.instance]=this}htmlInit(){let e=this.element.getAttribute("data-options");e&&(e=JSON.parse(e),this.options={...this.options,...e},this.element.removeAttribute("data-options"))}intiFacets(){this.facets=WP_Grid_Builder.Facets(this.element,this.options)}init(){this.element&&(this.element.classList.add("wpgb-enabled"),this.element.setAttribute("data-instance",this.instance),window.WP_Grid_Builder.emit("init",[this]),this.facets&&this.facets.init())}destroy(){const e=Object.getOwnPropertyNames(this);if(this.element){this.facets.destroy(),this.element.classList.remove("wpgb-enabled"),this.element.setAttribute("data-options",JSON.stringify(this.options)),delete WP_Grid_Builder.instances[this.instance],delete this.element.instance,delete c[this.instance],delete h[this.instance];for(let t=0;t<e.length;t++)delete this[e[t]]}}}class g extends r{canObserve(){return"IntersectionObserver"in window&&"isIntersecting"in window.IntersectionObserverEntry.prototype}observe(){this.canObserve()?this.loader&&this.observer().observe(this.loader):(window.addEventListener("scroll",this),this.check())}unObserve(){if(this.intersection)return this.intersection.disconnect(),void delete this.intersection;window.removeEventListener("scroll",this)}observer(){return this.intersection=new IntersectionObserver(((e,t)=>{e.forEach((e=>{e.isIntersecting&&this.loader&&this.loader.click()}))}),{rootMargin:"600px"}),this.intersection}check(){this.loader&&this.inView()&&this.loader&&this.loader.click()}inView(e){const{top:t,bottom:s}=this.loader.getBoundingClientRect(),i=window.innerHeight;return t>=600&&t<=i||s>=0&&s<=i}onscroll=function(e,t){let s=0;return function(){const i=(new Date).getTime();if(!(i-s<t))return s=i,e(...arguments)}}((()=>this.check()),100)}class f extends g{bindEvents(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e=e?"addEventListener":"removeEventListener",this.history&&window[e]("popstate",this),document[e]("click",this,!0),document[e]("change",this,!1),document[e]("keydown",this,!1),document[e]("mousedown",this,!1)}handleEvent(e){const t="on"+e.type;this[t]&&this[t](e)}isFacet(e){const t=`.wpgb-facet[data-grid="${CSS.escape(this.options.id)}"]`,s=e&&e.closest(t),i=s&&s.closest(".wp-grid-builder");if(!s)return!1;if(i&&i!==this.element)return!1;const n=this.getFacet(s.getAttribute("data-facet"));return n&&n.forEach((e=>{e.holder!==s||(this.facet=e)})),!!this.facet}onpopstate(e){const{state:t}=e;t&&t.WP_Grid_Builder===this.options.id&&(delete this.loadMoreSlug,delete this.loadPageSlug,this.getURLParams(),this.fetch())}onclick(e){if(this.isFacet(e.target)){switch(this.facet.type){case"pagination":this.handlePagination(e);break;case"load_more":this.handleLoadMore(e);break;case"reset":this.handleReset(e)}e.target.closest(".wpgb-toggle-hidden")&&this.toggleHidden(e,this.facet),this.toggleButton(e),delete this.facet}}onmousedown(e){if(!this.isFacet(e.target))return;e.target.closest('[class^="wpgb"][role="button"][tabindex="-1"]')&&e.preventDefault(),delete this.facet}onchange(e){if(!this.isFacet(e.target)||!("type"in this.facet))return;const{value:t,name:s}=e.target,i=s.replace("[]",""),n=this.getInputType(e.target,this.facet);let r;r="select-multiple"===n?this.getSelectValues(e):this.getValues(e,t),"checkbox"===n?this.diffParams(i,r):this.setParams(i,r),this.emit("change",[i,this.getParams(i)]),this.refresh(),delete this.facet}onkeydown(e){const{keyCode:t}=e;[13,32].includes(t)&&this.isFacet(e.target)&&(this.toggleButton(e),delete this.facet)}handlePagination(e){const t=e.target.getAttribute("data-page");if(!t)return;const s=e.target.closest("ul"),i=s&&s.querySelector("[aria-current]");i&&i.removeAttribute("aria-current"),e.target.setAttribute("aria-current",!0),e.preventDefault(),this.loadPage(t),this.scrollToTop()}scrollToTop(){const e=this.facet.settings;if(!e.scroll_to_top)return;let t=this.element.querySelector(".wpgb-layout")||this.element,s=t.getBoundingClientRect().top+window.pageYOffset+e.scroll_to_top_offset;t.tabIndex=-1,t.focus({preventScroll:!0}),"scrollBehavior"in document.documentElement.style?window.scrollTo({top:s,behavior:"smooth"}):document.documentElement.scrollTop=s}handleLoadMore(e){const{settings:t}=this.facet;!t||t.offset+t.number<1||e.target.closest(".wpgb-load-more")&&this.loadMore()}handleReset(e){const{settings:t}=this.facet;let s=t&&t.reset_facet;e.target.closest(".wpgb-reset")&&(s=s.length&&"object"!=typeof s?[s||0]:s,s=s.length&&s.map((e=>(e=this.getFacet(parseInt(e,10)))&&e[0]&&e[0].slug)).filter((e=>e)),this.reset(s))}toggleButton(e){const{target:t}=e,s=t.closest('[role="button"]');if(!s)return;const i="true"===s.getAttribute("aria-pressed"),n=s.querySelector("input");if(!n||"-1"===s.getAttribute("tabindex"))return;e.preventDefault(),e.stopImmediatePropagation();const{value:r}=n,a=this.getInputType(n,this.facet);if(i&&"radio"===a&&""===r)return;const o=t.closest(".wpgb-facet");if("radio"===a){const e=o.querySelectorAll('[role="button"][aria-pressed="true"]');if(e.forEach((e=>e.setAttribute("aria-pressed",!1))),i&&e){const e=o.querySelector('[role="button"] input[type="hidden"][value=""]');e&&e.parentElement.setAttribute("aria-pressed",!0)}}else{if(o.querySelectorAll('[role="button"][aria-pressed="true"] input[type="hidden"][value=""]').forEach((e=>e.parentElement.setAttribute("aria-pressed",!1))),i&&1===o.querySelectorAll('[role="button"][aria-pressed="true"]').length){const e=o.querySelector('[role="button"] input[type="hidden"][value=""]');e&&e.parentElement.setAttribute("aria-pressed",!0)}}s.setAttribute("aria-pressed",(!i).toString()),n.checked=!i,"checkbox"===a&&this.facet?.settings?.treeview&&s.closest('[role="treeitem"]')?.setAttribute("aria-selected",(!i).toString()),i&&"radio"===a&&(n.value=""),"function"==typeof Event?e=new Event("change",{bubbles:!0}):(e=document.createEvent("Event")).initEvent("change",!0,!0),n.dispatchEvent(e),n.value=r}toggleHidden(e,t){const{holder:s,settings:i}=t,n=s.querySelector("ul"),r=n&&s.querySelector(".wpgb-toggle-hidden"),a=r&&"true"===r.getAttribute("aria-expanded"),o=n&&a&&n.querySelectorAll("[hidden]");n&&(e&&e.stopImmediatePropagation(),r.textContent=a?i.show_more_label.replace("[number]",o.length):i.show_less_label,r.setAttribute("aria-expanded",!a),n.classList.toggle("wpgb-expanded"),this.emit("toggle",[t,!a]))}getValues(e,t){let s=[];return""===t?s:(s="range"===this.facet.type?this.getRange(e):this.getInput(t),s.map(String).filter(((e,t,s)=>s.indexOf(e)===t)))}getSelectValues(e){return[...e.target.closest("select").options].filter((e=>e.selected)).map((e=>e.value))}getInput(e){let t=[];try{e=JSON.parse(e)}catch(e){}return Array.isArray(e)?t=e:t.push(e),t}getInputType(e,t){let s=e.type;return"select-multiple"===s||("checkbox"===t.type||"selection"===t.type||t.settings&&t.settings.multiple&&e.value?s="checkbox":"hidden"===s&&(s="radio")),s}getRange(e){const t=[...e.target.closest(".wpgb-facet").querySelectorAll('input[type="range"]')],s=t[0]?[t[0].min,t[0].max]:[],i=t.map((e=>e.value));return i.filter((e=>!s.includes(e))).length||i[0]===i[1]?i:[]}}const m={},b=(Math.max,Math.min);function y(e,t,s){let i,n,r,a,o,l,c=0,d=!1,h=!1,u=!0;if("function"!=typeof e)throw new TypeError(FUNC_ERROR_TEXT);function p(t){let s=i,r=n;return i=n=void 0,c=t,a=e.apply(r,s),a}function g(e){let s=e-l;return void 0===l||s>=t||s<0||h&&e-c>=r}function f(){const e=Date.now();if(g(e))return m(e);o=setTimeout(f,function(e){let s=t-(e-l);return h?b(s,r-(e-c)):s}(e))}function m(e){return o=void 0,u&&i?p(e):(i=n=void 0,a)}function y(){let e=Date.now(),s=g(e);if(i=arguments,n=this,l=e,s){if(void 0===o)return function(e){return c=e,o=setTimeout(f,t),d?p(e):a}(l);if(h)return o=setTimeout(f,t),p(l)}return void 0===o&&(o=setTimeout(f,t)),a}return t=Number(t)||0,"object"==typeof s&&(d=!!s.leading,u="trailing"in s?!!s.trailing:u),y.cancel=function(){void 0!==o&&clearTimeout(o),c=0,i=l=n=o=void 0},y}class w extends f{isLoadingMore(){return this.hasParams(this.loadMoreSlug)}isLoadingPage(){return this.hasParams(this.loadPageSlug)}pushState(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"push";if(this.history){"scrollRestoration"in history&&(window.history.scrollRestoration="manual"),e=this.getQueryString(),e=""!==e?"?"+e:"",e+=window.location.hash;try{window.history[`${t}State`]({WP_Grid_Builder:this.options.id},null,window.location.pathname+e)}catch(e){}}}formData(e){const t=new FormData,s=this.getSettings();return this.emit("fetch",[s,e]),this.isRestAPI?JSON.stringify(s):(t.append("wpgb",JSON.stringify(s)),t)}getEndPoint(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"render",s=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return s=s&&this.getQueryString(),e=this.isRestAPI?wpgb_settings.restUrl.replace("action=action","action="+t):(this.options.ajaxUrl||wpgb_settings.ajaxUrl).replace("wpgb-ajax=action","wpgb-ajax="+t),e+(s?"&"+s:"")}getSettings(){const e=window.wpgb_preview_settings||{},t=window.wpgb_settings||{},s=Object.keys(this.facets);return e.is_main_query=this.options.isMainQuery,e.main_query=t.mainQuery,e.permalink=t.permalink,e.facets=s.map(Number),e.lang=t.lang,e.id=this.options.id,this.options.isShadow&&(e.is_shadow=this.options.isShadow),this.options.isGutenberg&&(e.is_gutenberg=!0),this.options.isPreview&&(e.is_preview=!0),this.options.isTemplate&&(e.is_template=this.options.isTemplate,e.source_type=this.options.sourceType,e.query_args=this.options.queryArgs,e.render_callback=this.options.renderCallback,e.noresults_callback=this.options.noresultsCallback),this.options.postId&&(e.post_id=this.options.postId),e}fetch(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"refresh";this.abort(),this.loadContent(e)}loadContent=y((e=>{this.emit("refresh"),this.loading(!0,e),this.xhr=new XMLHttpRequest,this.xhr.onload=t=>this.onLoad(t,e),this.xhr.open("POST",this.getEndPoint(e)),this.isRestAPI&&(this.xhr.setRequestHeader("Content-Type","application/json;charset=UTF-8"),wpgb_settings?.restNonce&&this.xhr.setRequestHeader("X-WP-Nonce",wpgb_settings.restNonce)),this.xhr.send(this.formData(e))}),150,{leading:!0});abort(){this.xhr&&this.xhr.abort(),delete this.xhr}loading(e,t){const{facets:s}=this;if(("add"!==(e=e?"add":"remove")||"render"!==t&&!this.isLoadingMore())&&(!this.options.isShadow&&this.element.classList[e]("wpgb-loading"),"add"!==e||!this.isLoadingPage()))for(let t in s){let i=s[t];["pagination","load_more","search"].includes(i.type)||i.forEach((t=>{let{holder:s}=t;return s.classList[e]("wpgb-loading")}))}}onLoad(e,t){const s=this.isLoadingMore()?"append":"replace",{facets:i,posts:n,total:r}=this.getResponse(e.target.responseText,s);this.loading(),this.render(i),this.emit("loaded",[this.facets]),"refresh"===t?(this.appendItems(n,s),this.annonceResults(r)):(this.preFilter(),this.emit("prefilter")),m[this.element.facetGUID]=this.getQueryString()}getResponse(e,t){let s={};try{s=JSON.parse(e)}catch(t){const i=e.match(/\{"(facets|posts)".*\}/i);if(i&&i[0])try{s=JSON.parse(i[0])}catch(e){console.error(e),s={}}else console.error("No valid content was detected in the response.")}return this.emit("fetched",[s,t]),s}annonceResults(e){if(this.isLoadingPage()||this.isLoadingMore())return;let t;const s=document.createElement("div"),{resultMsg:i}=wpgb_settings;void 0!==e&&i&&(t=i?.plural,1===parseInt(e)?t=i.singular:parseInt(e)||(t=i.none),s.classList.add("wpgb-sr-only"),s.setAttribute("role","status"),s.setAttribute("aria-live","polite"),s.setAttribute("aria-atomic",!0),document.body.appendChild(s),setTimeout((()=>s.textContent=t.replace("%d",e)),100),setTimeout((()=>document.body.removeChild(s)),1e3))}appendItems(e,t){if(!e)return;const s=document.createRange();s.selectNodeContents(s.createContextualFragment("<template>").lastChild);const i=s.createContextualFragment(e);if(this.options.isTemplate)return void this.appendTemplate(i,e,t);if(!(e=i.querySelectorAll(".wpgb-card")).length)return;const n=this.element.querySelector(".wpgb-viewport > div");n&&(n.appendChild(i),this.emit("appended",[e,t]))}appendTemplate(e,t,s){const{itemSelector:i}=this.options;let{element:n}=this;if(t=i?e.querySelectorAll(i):[...e.children],i&&"append"===s||this.options.customContent){const s=n.querySelector(i);e=document.createDocumentFragment(),t.forEach((t=>e.appendChild(t))),s&&(n=s.parentElement)}if("replace"===s)for(;n.firstChild;){let e=n.firstChild;n.removeChild(e),e=null}n.appendChild(e),this.emit("appended",[t,s])}}const v="_";class S extends w{getURLParams(){const e=window.location.search.slice(1);if(this.params=new URLSearchParams(e),this.history)return;const t=this.params.get("s");this.params=new URLSearchParams(""),t&&this.params.set("s",t)}getParams(e){const t={},s=this.params.entries();for(let i of s){let s=i[0].substring(1),n=i[1].split(",");if(i[0].charAt(0)===v){if(e===s)return n;t[s]=n}}return e?[]:t}getParam(e){return(this.params.get(v+e)||"").split(",")}hasParams(e){return e&&this.params.has(v+e)}setParams(e,t){t=(t=this.validateParams(t)).filter(((e,t,s)=>s.indexOf(e)===t)),this.updateParams(e,t)}deleteParams(e,t){(t=this.validateParams(t)).length&&(t=this.getParam(e).filter((e=>t.indexOf(e)<0))),this.updateParams(e,t)}diffParams(e,t){let s=this.getParam(e);(t=this.validateParams(t)).forEach((e=>{let t=s.indexOf(e);-1===t?s.push(e):s.splice(t,1)})),this.updateParams(e,s)}updateParams(e,t){e=v+e,(t=t.filter((e=>e.trim().length)))&&t.length?this.params.set(e,t.join(",")):this.params.delete(e)}validateParams(e){return Array.isArray(e)?(e=e.filter((e=>"string"==typeof e||"number"==typeof e&&!isNaN(e)))).map(String):[]}getQueryString(){return this.params.toString()}}class _ extends S{query(){const e=`.wpgb-facet[data-grid="${CSS.escape(this.options.id)}"]`,t=document.querySelectorAll(e);this.facets={},t.forEach((e=>{let t=parseInt(e.dataset.facet,10),s=e.closest(".wp-grid-builder");t<1||s&&s!==this.element||(this.facets.hasOwnProperty(t)||(this.facets[t]=[]),this.facet={id:t,init:!0,holder:e},this.facets[t].push(this.facet),WP_Grid_Builder.emit("prerender",[e,this.facet,this]))})),delete this.facet}preFilter(){const{facets:e}=this;if(!this.getQueryString()){for(let t in e){let s=e[t][0],i=s.selected;i&&i.length&&this.setParams(s.slug,i)}this.pushState("replace")}}getFacet(e){const{facets:t}=this;let s=[];if(!Object.keys(t).length)return{};if(!e)return t;if(!isNaN(parseFloat(e))&&isFinite(e))return t.hasOwnProperty(e)&&(s=t[e]),s;for(let s in t)if(t.hasOwnProperty(s)&&t[s][0].slug===e)return t[s];return s}hasFacet(e){return!!e&&!!this.getFacet(e).length}render(e){this.setFocused();for(let t in e)e.hasOwnProperty(t)&&this.facets.hasOwnProperty(t)&&this.facets[t].forEach(((s,i)=>{this.facet=Object.assign(s,e[t]),this.facet.html&&this.facet.rendered||(this.facet.holder.classList.add("wpgb-notransitions"),this.remove(this.facet.holder),this.append(this.facet.holder),requestAnimationFrame((()=>this.getFacet(t)[i].holder.classList.remove("wpgb-notransitions")))),"reset"===this.facet.type&&(this.facet.rendered=!!this.facet.html),this.emit("render",[this.facet.holder,this.facet]),delete this.facet.focused,this.facets[t][i]=this.facet,this.initLoader()}));delete this.facet}setFocused(){const e=document.activeElement;this.isFacet(e)&&(this.facet.focused=e)}remove(e){for(;e.firstChild;)e.removeChild(e.firstChild)}append(e){const t=document.createRange().createContextualFragment(this.facet.html);e.hidden=""===this.facet.html,e.appendChild(t)}initLoader(){const{type:e,settings:t,disabled:s,holder:i}=this.facet,{layout:n}=this.options;"load_more"===e&&(this.loader=i.querySelector(".wpgb-load-more"),this.loader&&(this.loader.disabled=s||!1),this.loader&&!wpgb_settings.renderBlocks&&"onscroll"===t.load_more_event&&(this.loader.onScroll=!0,"horizontal"!==n&&(this.unObserve(),this.observe())))}}const P=class extends _{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.options=t,this.element=e,this.autoRefresh=!0,this.isRestAPI=!t?.ajaxUrl&&"rest_api"===wpgb_settings?.endpoint,this.query(),Object.keys(this.facets).length&&(this.setInstance(),this.canPush())}setInstance(){this.element.facetGUID||(this.facetGUID=Object.keys(m).length+1,this.element.facetGUID=this.facetGUID)}init(){const{facetGUID:e}=this.element;if(m[e]){const t=m[e].toString();this.params=new URLSearchParams(t)}else this.getURLParams(),this.getQueryString()&&this.pushState("replace");Object.keys(this.facets).length&&(this.bindEvents(),this.emit("init",[this.facets]),this.fetch("render"))}destroy(){this.abort(),this.unObserve(),this.bindEvents(!1),this.loading(!1),delete this.loader,delete this.loadMoreSlug,delete this.loadPageSlug}canPush(){this.history=window.wpgb_settings&&wpgb_settings.history}refresh(){this.autoRefresh&&(this.unsetLoaders(),this.pushState(),this.fetch())}reset(e){const t=this.getQueryString();t&&(e&&e?.length||(e=(e=Object.keys(this.facets)).map((e=>this.facets[e][0]&&this.facets[e][0].slug))),"string"==typeof e&&(e=[e]),e.forEach((e=>this.deleteParams(e))),t!==this.getQueryString()&&(this.emit("reset",[e]),this.unsetLoaders(),this.pushState(),this.fetch()))}unsetLoaders(){const e=["pagination","load_more"];let{facets:t}=this;t=Object.keys(t).map((s=>{let i=t[s][0];return i&&e.includes(i.type)&&i.slug})),t.forEach((e=>e&&this.deleteParams(e)))}loadMore(){if(this.xhr&&4!==this.xhr.readyState)return;const{slug:e,settings:t,holder:s}=this.facet,i=s.querySelector(".wpgb-load-more"),{width:n}=i&&i.getBoundingClientRect();if(!i)return;i.classList.add("wpgb-loading"),t.loading_text&&(i.style.minWidth=`${n}px`,i.textContent=t.loading_text);let r=(t.number+t.offset).toString();this.loadMoreSlug=e,this.deleteParams(this.loadPageSlug),this.setParams(e,[r]),this.emit("change",[e,[r]]),this.fetch()}loadPage(e){const{slug:t}=this.facet;this.getParam(t)[0]!==(e=e<2?"":e)&&(this.loadPageSlug=t,this.deleteParams(this.loadMoreSlug),this.setParams(t,[e]),this.emit("change",[t,[e]]),this.pushState(),this.fetch())}},x="undefined"!=typeof Map&&new Map;let E={};function A(e){return x.has(e.instance)}function q(e,t){e.instance=function(e){return E[e.type]||(E[e.type]=0),`${e.type}-${++E[e.type]}`}(e),x.set(e.instance,t)}function L(e){return x.get(e.instance)}function k(e){x.delete(e.instance)}function C(e){"date"===this.facet.type&&(this.facet.html?R.apply(this,[e,this.facet]):G.apply(this,[e,this.facet]))}function R(e,t){e.querySelector(".wpgb-date-facet")&&(t.rendered?B(e,t):D.apply(this,[e,t]),t.rendered=!0,O(t))}function O(e){if(!A(e))return;const t=L(e),s=e.holder.querySelector(".wpgb-clear-button");t?._input&&(t._input.disabled=e.disabled??!1),s&&(s.disabled=e.disabled??!1)}function D(e,t){WP_Grid_Builder.Date((s=>{const i=this.getFacet(t.id),n=e.querySelector("input.wpgb-input"),r=document.activeElement===n;if(!i.length||!n)return void G.apply(this,[e,t]);t.selected=i[0].selected||t.selected,t.settings.locale=t.settings.locale.substring(0,2),t.settings.locale="ca"===t.settings.locale?"cat":t.settings.locale,t.settings.locale="el"===t.settings.locale?"gr":t.settings.locale,this.emit("date.options",[t.settings,t]),s=s(n,t.settings);const a=e.className.split(" ").find((e=>e.includes("wpgb-style-")));a&&s?.calendarContainer?.classList?.add?.(a),r&&s._input&&s._input.focus(),q(t,s),function(e,t){const s=e.querySelector(".wpgb-clear-button"),i=e.querySelector("input"),n=L(t),{mode:r}=n.config;let a="";n.config.onOpen.push((()=>a=n.selectedDates)),n.config.onClose.push((()=>{if("range"===r&&1===n.selectedDates.length){let e=a.map((e=>n.formatDate(e,"Y-m-d")));requestAnimationFrame((()=>n.setDate(e)))}})),i.addEventListener("change",(e=>{if("range"===r&&1===n.selectedDates.length)return e.preventDefault(),void e.stopPropagation();let t=n.selectedDates.map((e=>n.formatDate(e,"Y-m-d")));t=t.filter(((e,t,s)=>s.indexOf(e)===t)),i.value="range"===r?t.length?t:"":t.length?t[0]:"",s.hidden=!t.length})),s&&s.addEventListener("click",(e=>{e.preventDefault(),n.clear(),n.altInput.focus(),n.close()}))}(e,t),B(e,t),O(t),this.emit("date.init",[s,t])}))}function G(e,t){A(t)&&(L(t).destroy(),k(t),this.emit("date.destroy",[t])),t.rendered=!1}function B(e,t){if(!A(t))return;const{selected:s}=t,i=e.querySelector(".wpgb-clear-button"),n=L(t);t.settings.minDate&&(n.set("minDate",[t.settings.minDate,...s].reduce(((e,t)=>e<t?e:t))),n.set("maxDate",[t.settings.maxDate,...s].reduce(((e,t)=>e>t?e:t))));const r=new Date,a=n.config.minDate||r,o=n.config.maxDate||r;n.setDate(s),s&&s[0]?n.jumpToDate(s[0]):r>=new Date(a)&&r<=new Date(o)?n.jumpToDate(r):r<new Date(a)?n.jumpToDate(a):r>new Date(o)&&n.jumpToDate(o),i&&(i.hidden=!(s&&s.length))}function F(e){"range"===this.facet.type&&(this.facet.html?I.apply(this,[e,this.facet]):N.apply(this,[e,this.facet]))}function I(e,t){e.querySelector(".wpgb-range-facet")&&(t.rendered?function(e,t){const s=L(t),i=document.createRange().createContextualFragment(t.html),n=i.querySelectorAll(".wpgb-range-facet input"),r=e.querySelectorAll(".wpgb-range-facet input"),a=["step","min","max","value"];if(r.length&&n.forEach(((e,t)=>a.forEach((e=>r[t][e]=n[t][e])))),!s)return;s.previous=[s.inputs[0].value,s.inputs[1].value],s.setValues(),s.getSliderSize(),s.updateSlider()}(e,t):W.apply(this,[e,t]),t.rendered=!0,function(e){if(!A(e))return;const t=L(e);e.disabled?t.disable():t.enable()}(t))}function W(e,t){WP_Grid_Builder.Range((s=>{const i=this.getFacet(t.id),n=e.querySelectorAll('[type="range"]'),r=e.querySelector(".wpgb-range-facet"),a=e.querySelector(".wpgb-range-facet-loader"),o=wpgb_settings.range;i.length&&r?(n?.[0]&&(n[0].disabled=t.disabled??!1),n?.[1]&&(n[1].disabled=t.disabled??!1),t.selected=i[0].selected||t.selected,t.settings.minLabel=o?o.minLabel:"",t.settings.maxLabel=o?o.maxLabel:"",this.emit("range.options",[t.settings,t]),s=s(r,t.settings),q(t,s),a&&a.parentElement.removeChild(a),this.emit("range.init",[s,t])):N.apply(this,[e,this.facet])}))}function N(e,t){A(t)&&(L(t).destroy(),k(t),this.emit("range.destroy",[t])),t.rendered=!1}function T(e){"number"===this.facet.type&&(this.facet.html?(j.apply(this,[e,this.facet]),this.facet.rendered=!0):this.facet.rendered=!1)}function j(e,t){const s=e.querySelectorAll('input[type="number"]');if(!s.length)return;const i=e.querySelector("button.wpgb-number-submit");if(U.apply(this,[s,t]),i&&M.apply(this,[t,s,i]),!t.rendered){if(i)return M.apply(this,[t,s,i]),i.addEventListener("click",(e=>J.apply(this,[e,t,s]))),s.forEach((e=>e.addEventListener("change",(e=>e.stopPropagation())))),s.forEach((e=>e.addEventListener("input",y((()=>M.apply(this,[t,s,i])),50)))),void s.forEach((e=>e.addEventListener("keydown",(e=>"Enter"===e.key&&J.apply(this,[e,t,s])))));s.forEach((e=>e.addEventListener("change",(e=>J.apply(this,[e,t,s]))))),s.forEach(((e,i)=>{e.addEventListener("input",(e=>$.apply(this,[e,t,i]))),e.addEventListener("input",y((e=>J.apply(this,[e,t,s])),350))}))}}function M(e,t,s){const i=this.getParams(e.slug),n=H(t);s.disabled=Q(n,i)}function $(e,t,s){this.getParams(t.slug)[s]!==e.target.value.trim()&&this.abort()}function U(e,t){const s=document.createRange().createContextualFragment(t.html).querySelectorAll('input[type="number"]');e.forEach(((e,i)=>{e.min=t.settings.min,e.max=t.settings.max,e.step=t.settings.step,e.value=s[i].value,e.placeholder=s[i].placeholder,e.disabled=t.disabled??!1}))}function J(e,t,s){const i=H(s),n=this.getParams(t.slug);e.stopPropagation(),Q(i,n)||(this.updateParams(t.slug,i.map((e=>e.toString()))),this.emit("change",[t.slug,i]),this.refresh())}function H(e){let t=[...e].map((e=>e.value||"_"));return t.filter((e=>"_"!==e)).length||(t=[]),t}function Q(e,t){return!e.length&&!t.length||e.length===t.length&&(1===e.length&&e[0]===t[0]||2===e.length&&e[0]===t[0]&&e[1]===t[1])}window.WP_Grid_Builder.on("prerender",(function(e,t,s){e.querySelector(".wpgb-date-facet")&&WP_Grid_Builder.Date()})),window.WP_Grid_Builder.on("init",(function(e){e.facets.on("render",C)})),window.WP_Grid_Builder.on("prerender",(function(e,t,s){e.querySelector(".wpgb-range-facet")&&WP_Grid_Builder.Range()})),window.WP_Grid_Builder.on("init",(function(e){e.facets.on("render",F)})),window.WP_Grid_Builder.on("init",(function(e){e.facets.on("render",T)}));s(4705),s(4828),s(4540);function V(e){"search"===this.facet.type&&(this.facet.html?(X.apply(this,[e,this.facet]),this.facet.rendered=!0):this.facet.rendered=!1)}function X(e,t){const s=e.querySelector('input[type="search"]');if(!s)return;if(t.rendered||Z.call(this,s,t),function(e,t){const s=e.value.trim(),i=t.selected.join(),n=K(t);s!==i&&(e.value=i);n&&(n.hidden=!i.length,n.disabled=t?.disabled??!1);e.disabled=t?.disabled??!1}(s,t),!t.settings.instant_search||t.rendered)return;const i=isNaN(t?.settings?.search_debounce)||""===t?.settings?.search_debounce?350:t?.settings?.search_debounce;s.addEventListener("input",(e=>z.apply(this,[e,t]))),s.addEventListener("input",y((e=>Y.apply(this,[e,t])),i)),s.addEventListener("change",(e=>e.stopPropagation()))}function z(e,t){this.getParams(t.slug).join().trim()!==e.target.value.trim()&&this.abort()}function Y(e,t){const s=this.getParams(t.slug).join().trim(),i=e.target.value.trim();if(s===i)return void e.stopPropagation();const n=Math.max(1,t?.settings?.search_min_length||1);i&&i?.replace?.(/^\s+/,"").length<n||(this.setParams(t.slug,[i]),this.emit("change",[t.slug,i?[i]:[]]),this.refresh())}function Z(e,t){const s=K(t);s&&(e.addEventListener("input",(()=>s.hidden=!e.value.length)),s.addEventListener("mousedown",(e=>e.preventDefault())),s.addEventListener("click",(i=>{e.value="",s.hidden=!0,e.focus(),Y.call(this,i,t)})))}function K(e){return e.holder.querySelector(".wpgb-clear-button")}function ee(e){"sort"!==this.facet.type&&"select"!==this.facet.type&&"per_page"!==this.facet.type||(this.facet.html?te.apply(this,[e,this.facet]):ie.apply(this,[e,this.facet]))}function te(e,t){const s=e.querySelector("select.wpgb-combobox");t.rendered||!s?function(e,t){const{settings:s,html:i}=t,n=L(t),r=n?n.element:e.querySelector("select.wpgb-select"),a=document.createRange().createContextualFragment(i).querySelectorAll("select option"),o=[];Array.from(r.options).forEach((e=>r.remove(e))),a.forEach(((e,t)=>{e.selected&&o.push(e.value),r.add(e,t)})),r.multiple||(r.value=o[0]||"");r.disabled=t.disabled??!1,n&&(!s.async&&n.Data.parse(),s.async&&n.close(),n.DOM.clearDropDown(),t.disabled?n.disable():n.enable(),requestAnimationFrame((()=>n.update())))}(e,t):se.apply(this,[e,t]),t.rendered=!0}function se(e,t){WP_Grid_Builder.Select((s=>{const i=this.getFacet(t.id),n=e.querySelector("select.wpgb-combobox");if(!i.length||!n)return void ie.apply(this,[e,this.facet]);t.selected=i[0].selected||t.selected,n.disabled=t.disabled??!1,this.emit("select.options",[t.settings,t]),(s=s(n,ne.apply(this,[e,t]))).init();const r=e.className.split(" ").find((e=>e.includes("wpgb-style-")));r&&s?.DOM?.dropDown?.classList?.add?.(r),q(t,s),this.emit("select.init",[s,t])}))}function ie(e,t){A(t)&&(L(t).destroy(),k(t),this.emit("select.destroy",[t])),t.rendered=!1}function ne(e,t){let s={messages:{...wpgb_settings.combobox}};if(!t||!t.settings)return s;if(s.messages.noResults=t.settings.no_results,s.messages.loading=t.settings.loading,s.messages.search=t.settings.search,s.searchable=t.settings.searchable,s.clearable=t.settings.clearable,s.clearLabel=s.messages.clearLabel,s.toggleLabel=s.messages.toggleLabel,t.settings.async){const t=this.getEndPoint("search",!1).split(/[?#]/);s.async={url:t[0],contentType:this.isRestAPI?"application/json;charset=UTF-8":"",header:{"X-WP-Nonce":this.isRestAPI?wpgb_settings.restNonce:""},data:()=>{const e=this.getParams(),s=t[1]&&new URLSearchParams(t[1]),i={};for(let e of s.entries())i[e[0]]=e[1].split(",");for(var n in e)i["_"+n]=e[n];return i},post:t=>{const s=new FormData,i=this.getSettings();return i.search={facet:Number(e.getAttribute("data-facet")),string:t},this.isRestAPI?JSON.stringify(i):(s.append("wpgb",JSON.stringify(i)),s)},response:e=>{const t=[];return e.length&&e.forEach((e=>{const s=!1!==e.count?" ("+e.count+")":"";t.push({value:e.facet_value,textContent:e.facet_name+s,disabled:e.disabled})})),t}}}return s}window.WP_Grid_Builder.on("init",(function(e){e.facets.on("render",V)})),window.WP_Grid_Builder.on("prerender",(function(e,t,s){e.querySelector("select.wpgb-combobox")&&WP_Grid_Builder.Select()})),window.WP_Grid_Builder.on("init",(function(e){e.facets.on("render",ee)}));s(1542),s(957);const re="undefined"!=typeof Map&&new Map;function ae(e){"autocomplete"===this.facet.type&&(this.facet.html?oe.apply(this,[e,this.facet]):he.apply(this,[e,this.facet]))}function oe(e,t){t.rendered?function(e,t){const s=e.querySelector('input[type="search"]');if(!s)return;s.value=t.selected.join(),de(t)}(e,t):le.apply(this,[e,t]),t.rendered=!0,function(e){if(!A(e))return;const t=L(e);e.disabled?t.disable():t?.element.disabled&&t.enable()}(t)}function le(e,t){WP_Grid_Builder.AutoComplete((s=>{const i=this.getFacet(t.id),n=e.querySelector('input[type="search"]');if(!i.length||!n)return void he.apply(this,[e,this.facet]);const r=ue.apply(this,[e,t]);t.selected=i[0].selected||t.selected,n.disabled=t.disabled??!1,this.emit("autocomplete.options",[r,t]),s=s(n,r),q(t,s),this.emit("autocomplete.init",[s,t]);const a=e.className.split(" ").find((e=>e.includes("wpgb-style-")));a&&s?.components?.Menu?.element?.classList?.add?.(a),n.addEventListener("change",(e=>e.stopPropagation())),n.addEventListener("keydown",(e=>{let{key:s}=e;const i=this.getParams(t.slug).join();"Enter"===s&&i!==n.value&&(ce.call(this,t.slug,n.value),de(t))}))}))}function ce(e,t){this.getParams(e).join()!==t&&(this.setParams(e,[t]),this.emit("change",[e,[t]]),this.refresh())}function de(e){if(!A(e))return;const t=L(e);t.abort(),t.update(),t.close()}function he(e,t){A(t)&&(L(t).destroy(),k(t),this.emit("autocomplete.destroy",[t])),t.rendered=!1}function ue(e,t){const{isRestAPI:s}=this,{settings:i}=t,n=y((function(e,t,i,n,r){n.onload=e=>{let{responseText:t}=e.target;try{t=JSON.parse(t)}catch(e){t=[]}t=t.map((e=>({...e,value:e.facet_name,label:e.facet_name}))),re.set(i,t),r(t)},n.open("POST",e),s&&(n.setRequestHeader("Content-Type","application/json;charset=UTF-8"),wpgb_settings?.restNonce&&n.setRequestHeader("X-WP-Nonce",wpgb_settings.restNonce)),n.send(t)}),isNaN(t?.settings?.acplt_debounce)||""===t?.settings?.acplt_debounce?350:t?.settings?.acplt_debounce);let r;return{loader:!0,messages:wpgb_settings.autocomplete,minLength:i.acplt_min_length,matchAll:i.acplt_match_all,autoFocus:i.acplt_auto_focus,clearLabel:wpgb_settings.autocomplete.clearLabel,highlighter:!!i.acplt_highlight&&document.createElement("mark"),filterResults:()=>!0,sortResults:!!i.acplt_relevance&&((e,t)=>e.disabled-t.disabled||e.index-t.index||e.label.localeCompare(t.label)||e.label.length-t.label.length),source:(e,i)=>{e=e.trim();const a=this.getEndPoint("search"),o=this.getSettings(),l=function(e,t,s,i){const n=new FormData;if(s.search={facet:t.id,string:e},i)return JSON.stringify(s);return n.append("wpgb",JSON.stringify(s)),n}(e,t,o,s),c=function(e,t,s,i){e.params=t;for(const t in e.params)t===s.slug?delete e.params[t]:e.params[t].sort();return e.search={facet:s.id,string:i},JSON.stringify(e)}(o,this.getParams(),t,e);r&&r.abort(),re.has(c)?i(re.get(c)):(r=new XMLHttpRequest,n(a,l,c,r,i))},renderItem:(e,t)=>{if(e.disabled&&t.setAttribute("aria-disabled",!0),!1!==e.count){const t=" ("+e.count+")";"string"==typeof e.content?e.content+=t:e.content.append(document.createTextNode(t))}return e.content},onSelect:e=>ce.call(this,t.slug,e.label),onClear:()=>ce.call(this,t.slug,""),onAbort:()=>{r&&r.abort(),n?.cancel?.()}}}window.WP_Grid_Builder.on("prerender",(function(e,t,s){e.querySelector(".wpgb-autocomplete-facet")&&WP_Grid_Builder.AutoComplete()})),window.WP_Grid_Builder.on("init",(function(e){e.facets.on("render",ae)}));s(694);let pe=0;WP_Grid_Builder.unsupported?function(){const e=document.querySelectorAll(".wpgb-facet"),t=document.querySelectorAll(".wpgb-sidebar");e&&e.forEach((e=>{let t=e.firstElementChild;t&&"wpgb-pagination-facet"!==t.className?e.style.display="none":e.classList.remove("wpgb-loading")})),t&&t.forEach((e=>e.parentElement.removeChild(e)))}():function(){const t=wpgb_settings.hasGrids;WP_Grid_Builder.Facets=(e,t)=>new P(e,t),WP_Grid_Builder.Range=(e,t)=>{new n("wpgb-range",(()=>e&&e(WP_Grid_Builder.vendors.range,t)))},WP_Grid_Builder.Date=(e,t)=>{new n("wpgb-date-css"),new n("wpgb-date",(()=>e&&e(WP_Grid_Builder.vendors.date,t)))},WP_Grid_Builder.Select=(e,t)=>{new n("wpgb-select",(()=>e&&e(WP_Grid_Builder.vendors.select,t)))},WP_Grid_Builder.AutoComplete=(e,t)=>{new n("wpgb-autocomplete",(()=>e&&e(WP_Grid_Builder.vendors.autocomplete,t)))},t?e("wpgb.facets.loaded"):(WP_Grid_Builder.instantiate=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.instances[++pe]=new p(e,t)},function(e){if("complete"===document.readyState||"interactive"===document.readyState)return e();document.addEventListener("DOMContentLoaded",e)}((()=>e("wpgb.loaded"))))}()})()})();
(()=>{"use strict";var t={43:t=>{t.exports=function t(e,s){if(e===s)return!0;if(e&&s&&"object"==typeof e&&"object"==typeof s){if(e.constructor!==s.constructor)return!1;var r,i,o;if(Array.isArray(e)){if((r=e.length)!=s.length)return!1;for(i=r;0!=i--;)if(!t(e[i],s[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===s.source&&e.flags===s.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===s.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===s.toString();if((r=(o=Object.keys(e)).length)!==Object.keys(s).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(s,o[i]))return!1;for(i=r;0!=i--;){var n=o[i];if(!t(e[n],s[n]))return!1}return!0}return e!=e&&s!=s}}},e={};function s(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,s),o.exports}s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var r in e)s.o(e,r)&&!s.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{let t,e,r,i;function o(s){s?.closest?.(".wp-grid-builder.wpgb-enabled[data-instance]")&&s?.querySelector(".wpgb-marker-content")?.classList?.add?.("wpgb-has-grid"),function(){const t=window?.wpgb_settings?.lightbox?.plugin||"";e=["modulobox","modulobox_lite"].includes(t),r="easy_fancybox"===t,i="foobox"===t,e&&"ModuloBox"in window&&(window.ModuloBox.prototype.openFromQuery=()=>{})}(),function(){const s=function(){if(!e||!("ModuloBox"in window))return;if(t)return t;t=new window.ModuloBox,t.init(),t&&(t.options.history=!1);return t}();if(!s)return;s.getGalleries()}(),r&&window.easy_fancybox_handler&&window.easy_fancybox_auto&&(jQuery(window.easy_fancybox_handler),jQuery(window.easy_fancybox_auto)),i&&window?.FOOBOX?.init&&window.FOOBOX.init()}!function(){if(!window?.WP_Grid_Builder?.Lightbox)return;const{lightbox:t}=window.wpgb_settings?wpgb_settings:{};WP_Grid_Builder.Lightbox({...t,selector:".wp-grid-builder.wpgb-marker-content:not(.wpgb-has-grid) .wpgb-lightbox"}).init()}();const n=document.head.appendChild(document.createElement("style")).sheet;n.facets=[];class a{loadMarkerStyles(){if(n.facets.includes(this.facet.id)||!this?.facet?.settings?.map_markers_style)return;this.facet?.settings?.map_fonts&&n.insertRule(`@import url(${this.facet.settings.map_fonts})`,0),n.facets.push(this.facet.id);const t=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");let e=t.exec(this.facet.settings.map_markers_style);for(;e&&null!==e;){-1===(void 0===e[2]?e[5]:e[2]).indexOf("@media")&&(n.insertRule(e[0].replace(/\.wpgb-marker-style-/g,`.wpgb-marker-content.wpgb-marker-style-${this.facet.id}-`),n.cssRules.length),e=t.exec(this.facet.settings.map_markers_style))}}generateMarker(t,e=!1){let s;if(s=""!==t?.icon?.content&&void 0!==t?.icon?.content?this.generateMarkerContent(t):this.generateMarkerIcon(t),e){this.generateMarkerWrapper();const t=this.markerWrapper.cloneNode();return t.appendChild(s),t}return s}generateMarkerWrapper(){this.markerWrapper||(this.markerWrapper=document.createElement("div"),this.markerWrapper.className="wpgb-marker",this.facet.settings.map_marker_content&&(this.markerWrapper.role="button",this.markerWrapper.tabIndex=0))}generateClusterWrapper(){this.clusterWrapper||(this.clusterWrapper=document.createElement("div"),this.clusterWrapper.className="wpgb-marker",this.clusterWrapper.role="button",this.clusterWrapper.tabIndex=0)}generateMarkerIcon(t){this.markerIcon||(this.markerIcon=document.createElement("img"),this.markerIcon.className="wpgb-marker-icon");const e=this.markerIcon.cloneNode();return e.src=t?.icon?.url,e.height=t?.icon?.size?.height||40,e.style.height=`${t?.icon?.size?.height||40}px`,e}generateMarkerContent(t){this.markerContent||(this.markerContent=document.createElement("div"),this.markerContent.className="wpgb-marker-content");const e=this.markerContent.cloneNode();return e.className+=t?.icon?.style_id?` wpgb-marker-style-${this.facet.id}-${t.icon.style_id}`:" wpgb-marker-style-default",e.innerHTML=t.icon.content,e}generateCluster(t,e=!1){const{map_clusters:s}=this.facet.settings;let r=s.filter((e=>t<=(e?.cluster_count||1/0))).sort(((t,e)=>(t?.cluster_count||1/0)-(e?.cluster_count||1/0)))?.[0];r?.cluster_icon||(r=s.reduce(((e,s)=>Math.abs((s?.cluster_count||1/0)-t)<Math.abs((e?.cluster_count||1/0)-t)?s:e))),this.clusterIcon||(this.clusterElement=document.createElement("div"),this.clusterIcon=document.createElement("img"),this.clusterElement.className="wpgb-cluster-icon",this.clusterElement.append(this.clusterIcon),this.clusterElement.append(document.createElement("span")));const i=this.clusterElement.cloneNode(!0);if(i.firstChild.src=r?.cluster_icon,i.firstChild.height=r?.cluster_size||50,i.firstChild.style.height=`${r?.cluster_size||50}px`,i.lastChild.textContent=t,i.lastChild.style.color=r?.cluster_color||"",e){this.generateClusterWrapper(!0);const t=this.clusterWrapper.cloneNode();return t.appendChild(i),t}return i}setPopupClass(t){if(!Object.prototype.hasOwnProperty.call(t?.attributes||{},"width"))return;const e=this.facet?.holder?.querySelector?.(".wpgb-map-facet");e?.classList?.add?.("wpgb-marker-popup")}setPopupWidth(t){if(!Object.prototype.hasOwnProperty.call(t?.attributes||{},"width"))return;const e=document.createRange();e.selectNodeContents(e.createContextualFragment("<template>").lastChild);const s=e.createContextualFragment(`<div class="wp-grid-builder wpgb-marker-content wpgb-enabled">${t.content}</div>`),r=s?.querySelector?.(".wpgb-marker-content"),i=document.createElement("div"),o=this.facet?.holder?.offsetWidth;r&&(r.style.width=`${Math.min(o-24,t.attributes.width)}px`),i.appendChild(s.cloneNode(!0)),t.content=i.innerHTML}updateMarkerContent(t,e){this.setPopupClass(t),this.setPopupWidth(t),this.setMarkerContent(t.content||t.message,e),this.setPopupClass(t),o(this.facet?.holder)}getMarkerContent(t,e,s){const{mapFacet:{restUrl:r,restNonce:i}}=wpgb_settings,{source:o}=this.facet.settings,{lang:n}=this.facet,a=`${r}?id=${t}&facet=${this.facet.id}&lat=${e}&lng=${s}&source=${o}${n?`&lang=${n}`:""}`;if(this.cache||(this.cache=new Map),this.cache.has(a)){const e=this.cache.get(a);this.updateMarkerContent({...e},t)}else this.xhr&&this.xhr.abort(),delete this.xhr,this.xhr=new XMLHttpRequest,this.xhr.onload=e=>this.onLoad(e,t,a),this.xhr.onerror=e=>this.onLoad(e,t,a),this.xhr.open("GET",a),this.xhr.setRequestHeader("Content-Type","application/json;charset=UTF-8"),i&&this.xhr.setRequestHeader("X-WP-Nonce",i),this.xhr.send()}onLoad(t,e,s){const r=JSON.parse(t.target.responseText);r?.success&&this.cache.set(s,r),this.updateMarkerContent({...r},e),delete this.xhr}setMapPosition(){this.hasBounds()||(this.hasLocation()?this.updateLocation():this.shouldCenter()?this.centerMarkers():this.canCenter()||this.autoCenterMap())}refreshPosition(){const t=this.facet.queryString,e=this.hasMarkers(),s=this.hasBounds(),r=this.canCenter(),i=this.hasLocation();this.hasRefreshed||(!i||s?t&&e||!r?s?this.updateBounds():e?this.centerMarkers():e||this.autoCenterMap():this.centerMap():this.updateLocation())}setLocation(t,e,s,r="km",i,o){if(this.circleColor=o||"rgb(54, 138, 252)",this.removeLocation(),!t&&!e)return void(this.location=!1);t=parseFloat(t),e=parseFloat(e),s=parseFloat(s),s="mi"===r?1.60934*s:s;const n=.009*(s=Math.min(20037.5,s)+.005),a=Math.max(-90,t-n),h=Math.min(90,t+n),c=Math.max(-180,e-n/Math.cos(t*Math.PI/180)),p=Math.min(180,e+n/Math.cos(t*Math.PI/180));this.location={lat:t,lng:e,rad:s,min:{lat:a,lng:c},max:{lat:h,lng:p}},i&&this.drawLocation()}hasLocation(){return this.location&&Object.keys(this.location).length>4}updateLocation(){!this.hasBounds()&&this.centerLocation()}hasBounds(){const{selected:t}=this.facet;return t&&t.length>=4}hasMarkers(){return this.facet.geoJSON.features.length>0}canCenter(){const{map_lat:t,map_lng:e}=this.facet.settings;return 0!==t&&""!==t&&void 0!==t||0!==e&&""!==e&&void 0!==e}shouldCenter(){return!this.hasBounds()&&this.hasMarkers()&&(!this.canCenter()||this.facet.queryString)}getBounds(){const{bounds:t}=this.facet;return!(!t||!t.min_lat)&&[{lat:parseFloat(t.min_lat),lng:parseFloat(t.min_lng)},{lat:parseFloat(t.max_lat),lng:parseFloat(t.max_lng)}]}getLat(){const{map_lat:t}=this.facet.settings;return this.hasBounds()?this.getBoundsLat():parseFloat(t||0)}getLng(){const{map_lng:t}=this.facet.settings;return this.hasBounds()?this.getBoundsLng():parseFloat(t||0)}getSWLat(){const{selected:t}=this.facet;return t&&t[0]?parseFloat(t[0]):-90}getSWLng(){const{selected:t}=this.facet;return t&&t[1]?parseFloat(t[1]):-180}getNELat(){const{selected:t}=this.facet;return t&&t[2]?parseFloat(t[2]):90}getNELng(){const{selected:t}=this.facet;return t&&t[3]?parseFloat(t[3]):180}getBoundsLat(){const t=this.getSWLat();return t+(this.getNELat()-t)/2}getBoundsLng(){const t=this.getSWLng();return t+(this.getNELng()-t)/2}getZoom(){const{map_zoom:t}=this.facet.settings;return this.hasBounds()?parseInt(this.facet.selected[4]):t||2}}const h=()=>{function t(t){t=t||{},this.ready_=!1,void 0===t.visible&&(t.visible=!0),void 0===t.anchor&&(t.anchor=e.BOTTOM),this.setValues(t)}t.prototype=new google.maps.OverlayView,t.prototype.getVisible=function(){return this.get("visible")},t.prototype.setVisible=function(t){this.set("visible",t)},t.prototype.visible_changed=function(){this.ready_&&(this.markerWrapper_.style.display=this.getVisible()?"":"none",this.draw())},t.prototype.getWidth=function(){return this.get("width")},t.prototype.getHeight=function(){return this.get("height")},t.prototype.setZIndex=function(t){this.set("zIndex",t)},t.prototype.getZIndex=function(){return this.get("zIndex")},t.prototype.zIndex_changed=function(){this.getZIndex()&&this.ready_&&(this.markerWrapper_.style.zIndex=this.getZIndex())},t.prototype.getPosition=function(){return this.get("position")},t.prototype.setPosition=function(t){this.set("position",t)},t.prototype.getAnchor=function(){return this.get("anchor")},t.prototype.setAnchor=function(t){this.set("anchor",t)},t.prototype.anchor_changed=function(){this.draw()},t.prototype.removeChildren_=function(t){if(t)for(;t.firstChild;)t.firstChild.remove()},t.prototype.setContent=function(t){this.set("content",t)},t.prototype.getContent=function(){return this.get("content")},t.prototype.addEventListener=function(t,e,s,r){return r=r||!1,t.addEventListener(e,s,r),{target:t,type:e,handler:s,useCapture:r}},t.prototype.removeEventListener=function(t){t.target.removeEventListener(t.type,t.handler,t.useCapture)},t.prototype.content_changed=function(){if(!this.markerContent_)return;this.removeChildren_(this.markerWrapper_);const t=this.getContent();t&&(this.markerWrapper_.appendChild(t),google.maps.event.trigger(this,"domready")),this.ready_&&this.draw()},t.prototype.getOffset_=function(){const t=this.getAnchor();if("object"==typeof t)return t;const s=new google.maps.Size(0,0);if(!this.markerWrapper_)return s;const r=this.markerWrapper_.offsetWidth,i=this.markerWrapper_.offsetHeight;switch(t){case e.TOP_LEFT:break;case e.TOP:s.width=-r/2;break;case e.TOP_RIGHT:s.width=-r;break;case e.LEFT:s.height=-i/2;break;case e.MIDDLE:s.width=-r/2,s.height=-i/2;break;case e.RIGHT:s.width=-r,s.height=-i/2;break;case e.BOTTOM_LEFT:s.height=-i;break;case e.BOTTOM:s.width=-r/2,s.height=-i;break;case e.BOTTOM_RIGHT:s.width=-r,s.height=-i}return s},t.prototype.onAdd=function(){if(this.markerWrapper_||(this.markerWrapper_=document.createElement("DIV"),this.markerWrapper_.className="wpgb-marker",this.markerWrapper_.style.position="absolute",(this.get("hasPopup")||this.get("isCluster"))&&(this.markerWrapper_.tabIndex=0,this.markerWrapper_.role="button")),this.getZIndex()&&(this.markerWrapper_.style.zIndex=this.getZIndex()),this.markerWrapper_.style.display=this.getVisible()?"":"none",!this.markerContent_){const t=this;this.markerContent_=!0,this.addEventListener(this.markerWrapper_,"click",(function(e){google.maps.event.trigger(t,"click",e)})),this.addEventListener(this.markerWrapper_,"mouseover",(function(e){google.maps.event.trigger(t,"mouseover",e)})),this.addEventListener(this.markerWrapper_,"mouseout",(function(e){google.maps.event.trigger(t,"mouseout",e)}))}this.ready_=!0,this.content_changed();const t=this.getPanes();t&&t.overlayMouseTarget.appendChild(this.markerWrapper_),google.maps.event.trigger(this,"ready")},t.prototype.draw=function(){if(!this.ready_)return;const t=this.getProjection();if(!t)return;const e=this.get("position"),s=t.fromLatLngToDivPixel(e),r=this.getOffset_();this.markerWrapper_.style.top=s.y+r.height+"px",this.markerWrapper_.style.left=s.x+r.width+"px";const i=this.markerWrapper_.offsetHeight,o=this.markerWrapper_.offsetWidth;o!==this.get("width")&&this.set("width",o),i!==this.get("height")&&(this.set("height",i),this.set("anchorPoint",new google.maps.Point(0,-1*i)))},t.prototype.onRemove=function(){this.markerWrapper_&&this.markerWrapper_.parentNode&&this.markerWrapper_.parentNode.removeChild(this.markerWrapper_)};const e={TOP_LEFT:1,TOP:2,TOP_RIGHT:3,LEFT:4,MIDDLE:5,RIGHT:6,BOTTOM_LEFT:7,BOTTOM:8,BOTTOM_RIGHT:9};return t};var c=s(43),p=s.n(c);const l=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class d{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[e,s]=new Uint8Array(t,0,2);if(219!==e)throw new Error("Data does not appear to be in a KDBush format.");const r=s>>4;if(1!==r)throw new Error(`Got v${r} data when expected v1.`);const i=l[15&s];if(!i)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(t,2,1),[n]=new Uint32Array(t,4,1);return new d(n,o,i,t)}constructor(t,e=64,s=Float64Array,r){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=s,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const i=l.indexOf(this.ArrayType),o=2*t*this.ArrayType.BYTES_PER_ELEMENT,n=t*this.IndexArrayType.BYTES_PER_ELEMENT,a=(8-n%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${s}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+n+a,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+o+n+a),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+n+a,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+i]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){const s=this._pos>>1;return this.ids[s]=s,this.coords[this._pos++]=t,this.coords[this._pos++]=e,s}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return m(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,s,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:o,nodeSize:n}=this,a=[0,i.length-1,0],h=[];for(;a.length;){const c=a.pop()||0,p=a.pop()||0,l=a.pop()||0;if(p-l<=n){for(let n=l;n<=p;n++){const a=o[2*n],c=o[2*n+1];a>=t&&a<=s&&c>=e&&c<=r&&h.push(i[n])}continue}const d=l+p>>1,m=o[2*d],u=o[2*d+1];m>=t&&m<=s&&u>=e&&u<=r&&h.push(i[d]),(0===c?t<=m:e<=u)&&(a.push(l),a.push(d-1),a.push(1-c)),(0===c?s>=m:r>=u)&&(a.push(d+1),a.push(p),a.push(1-c))}return h}within(t,e,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:i,nodeSize:o}=this,n=[0,r.length-1,0],a=[],h=s*s;for(;n.length;){const c=n.pop()||0,p=n.pop()||0,l=n.pop()||0;if(p-l<=o){for(let s=l;s<=p;s++)k(i[2*s],i[2*s+1],t,e)<=h&&a.push(r[s]);continue}const d=l+p>>1,m=i[2*d],u=i[2*d+1];k(m,u,t,e)<=h&&a.push(r[d]),(0===c?t-s<=m:e-s<=u)&&(n.push(l),n.push(d-1),n.push(1-c)),(0===c?t+s>=m:e+s>=u)&&(n.push(d+1),n.push(p),n.push(1-c))}return a}}function m(t,e,s,r,i,o){if(i-r<=s)return;const n=r+i>>1;u(t,e,n,r,i,o),m(t,e,s,r,n-1,1-o),m(t,e,s,n+1,i,1-o)}function u(t,e,s,r,i,o){for(;i>r;){if(i-r>600){const n=i-r+1,a=s-r+1,h=Math.log(n),c=.5*Math.exp(2*h/3),p=.5*Math.sqrt(h*c*(n-c)/n)*(a-n/2<0?-1:1);u(t,e,s,Math.max(r,Math.floor(s-a*c/n+p)),Math.min(i,Math.floor(s+(n-a)*c/n+p)),o)}const n=e[2*s+o];let a=r,h=i;for(g(t,e,r,s),e[2*i+o]>n&&g(t,e,r,i);a<h;){for(g(t,e,a,h),a++,h--;e[2*a+o]<n;)a++;for(;e[2*h+o]>n;)h--}e[2*r+o]===n?g(t,e,r,h):(h++,g(t,e,h,i)),h<=s&&(r=h+1),s<=h&&(i=h-1)}}function g(t,e,s,r){f(t,s,r),f(e,2*s,2*r),f(e,2*s+1,2*r+1)}function f(t,e,s){const r=t[e];t[e]=t[s],t[s]=r}function k(t,e,s,r){const i=t-s,o=e-r;return i*i+o*o}const y={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},_=Math.fround||(w=new Float32Array(1),t=>(w[0]=+t,w[0]));var w;const b=3,v=5,M=6;class x{constructor(t){this.options=Object.assign(Object.create(y),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:e,minZoom:s,maxZoom:r}=this.options;e&&console.time("total time");const i=`prepare ${t.length} points`;e&&console.time(i),this.points=t;const o=[];for(let e=0;e<t.length;e++){const s=t[e];if(!s.geometry)continue;const[r,i]=s.geometry.coordinates,n=_(P(r)),a=_(O(i));o.push(n,a,1/0,e,-1,1),this.options.reduce&&o.push(0)}let n=this.trees[r+1]=this._createTree(o);e&&console.timeEnd(i);for(let t=r;t>=s;t--){const s=+Date.now();n=this.trees[t]=this._createTree(this._cluster(n,t)),e&&console.log("z%d: %d clusters in %dms",t,n.numItems,+Date.now()-s)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let s=((t[0]+180)%360+360)%360-180;const r=Math.max(-90,Math.min(90,t[1]));let i=180===t[2]?180:((t[2]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)s=-180,i=180;else if(s>i){const t=this.getClusters([s,r,180,o],e),n=this.getClusters([-180,r,i,o],e);return t.concat(n)}const n=this.trees[this._limitZoom(e)],a=n.range(P(s),O(o),P(i),O(r)),h=n.data,c=[];for(const t of a){const e=this.stride*t;c.push(h[e+v]>1?C(h,e,this.clusterProps):this.points[h[e+b]])}return c}getChildren(t){const e=this._getOriginId(t),s=this._getOriginZoom(t),r="No cluster with the specified id.",i=this.trees[s];if(!i)throw new Error(r);const o=i.data;if(e*this.stride>=o.length)throw new Error(r);const n=this.options.radius/(this.options.extent*Math.pow(2,s-1)),a=o[e*this.stride],h=o[e*this.stride+1],c=i.within(a,h,n),p=[];for(const e of c){const s=e*this.stride;o[s+4]===t&&p.push(o[s+v]>1?C(o,s,this.clusterProps):this.points[o[s+b]])}if(0===p.length)throw new Error(r);return p}getLeaves(t,e,s){e=e||10,s=s||0;const r=[];return this._appendLeaves(r,t,e,s,0),r}getTile(t,e,s){const r=this.trees[this._limitZoom(t)],i=Math.pow(2,t),{extent:o,radius:n}=this.options,a=n/o,h=(s-a)/i,c=(s+1+a)/i,p={features:[]};return this._addTileFeatures(r.range((e-a)/i,h,(e+1+a)/i,c),r.data,e,s,i,p),0===e&&this._addTileFeatures(r.range(1-a/i,h,1,c),r.data,i,s,i,p),e===i-1&&this._addTileFeatures(r.range(0,h,a/i,c),r.data,-1,s,i,p),p.features.length?p:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const s=this.getChildren(t);if(e++,1!==s.length)break;t=s[0].properties.cluster_id}return e}_appendLeaves(t,e,s,r,i){const o=this.getChildren(e);for(const e of o){const o=e.properties;if(o&&o.cluster?i+o.point_count<=r?i+=o.point_count:i=this._appendLeaves(t,o.cluster_id,s,r,i):i<r?i++:t.push(e),t.length===s)break}return i}_createTree(t){const e=new d(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let s=0;s<t.length;s+=this.stride)e.add(t[s],t[s+1]);return e.finish(),e.data=t,e}_addTileFeatures(t,e,s,r,i,o){for(const n of t){const t=n*this.stride,a=e[t+v]>1;let h,c,p;if(a)h=E(e,t,this.clusterProps),c=e[t],p=e[t+1];else{const s=this.points[e[t+b]];h=s.properties;const[r,i]=s.geometry.coordinates;c=P(r),p=O(i)}const l={type:1,geometry:[[Math.round(this.options.extent*(c*i-s)),Math.round(this.options.extent*(p*i-r))]],tags:h};let d;d=a||this.options.generateId?e[t+b]:this.points[e[t+b]].id,void 0!==d&&(l.id=d),o.features.push(l)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,e){const{radius:s,extent:r,reduce:i,minPoints:o}=this.options,n=s/(r*Math.pow(2,e)),a=t.data,h=[],c=this.stride;for(let s=0;s<a.length;s+=c){if(a[s+2]<=e)continue;a[s+2]=e;const r=a[s],p=a[s+1],l=t.within(a[s],a[s+1],n),d=a[s+v];let m=d;for(const t of l){const s=t*c;a[s+2]>e&&(m+=a[s+v])}if(m>d&&m>=o){let t,o=r*d,n=p*d,u=-1;const g=((s/c|0)<<5)+(e+1)+this.points.length;for(const r of l){const h=r*c;if(a[h+2]<=e)continue;a[h+2]=e;const p=a[h+v];o+=a[h]*p,n+=a[h+1]*p,a[h+4]=g,i&&(t||(t=this._map(a,s,!0),u=this.clusterProps.length,this.clusterProps.push(t)),i(t,this._map(a,h)))}a[s+4]=g,h.push(o/m,n/m,1/0,g,-1,m),i&&h.push(u)}else{for(let t=0;t<c;t++)h.push(a[s+t]);if(m>1)for(const t of l){const s=t*c;if(!(a[s+2]<=e)){a[s+2]=e;for(let t=0;t<c;t++)h.push(a[s+t])}}}}return h}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,s){if(t[e+v]>1){const r=this.clusterProps[t[e+M]];return s?Object.assign({},r):r}const r=this.points[t[e+b]].properties,i=this.options.map(r);return s&&i===r?Object.assign({},i):i}}function C(t,e,s){return{type:"Feature",id:t[e+b],properties:E(t,e,s),geometry:{type:"Point",coordinates:[(r=t[e],360*(r-.5)),T(t[e+1])]}};var r}function E(t,e,s){const r=t[e+v],i=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?Math.round(r/100)/10+"k":r,o=t[e+M],n=-1===o?{}:Object.assign({},s[o]);return Object.assign(n,{cluster:!0,cluster_id:t[e+b],point_count:r,point_count_abbreviated:i})}function P(t){return t/360+.5}function O(t){const e=Math.sin(t*Math.PI/180),s=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return s<0?0:s>1?1:s}function T(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function I(t,e){var s={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(s[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(s[r[i]]=t[r[i]])}return s}class S{static isAdvancedMarkerAvailable(t){return google.maps.marker&&!0===t.getMapCapabilities().isAdvancedMarkersAvailable}static isAdvancedMarker(t){return google.maps.marker&&t instanceof google.maps.marker.AdvancedMarkerElement}static setMap(t,e){this.isAdvancedMarker(t)?t.map=e:t.setMap(e)}static getPosition(t){if(this.isAdvancedMarker(t)){if(t.position){if(t.position instanceof google.maps.LatLng)return t.position;if(t.position.lat&&t.position.lng)return new google.maps.LatLng(t.position.lat,t.position.lng)}return new google.maps.LatLng(null)}return t.getPosition()}static getVisible(t){return!!this.isAdvancedMarker(t)||t.getVisible()}}class B{constructor({markers:t,position:e}){this.markers=t,e&&(e instanceof google.maps.LatLng?this._position=e:this._position=new google.maps.LatLng(e))}get bounds(){if(0===this.markers.length&&!this._position)return;const t=new google.maps.LatLngBounds(this._position,this._position);for(const e of this.markers)t.extend(S.getPosition(e));return t}get position(){return this._position||this.bounds.getCenter()}get count(){return this.markers.filter((t=>S.getVisible(t))).length}push(t){this.markers.push(t)}delete(){this.marker&&(S.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}class W{constructor({maxZoom:t=16}){this.maxZoom=t}noop({markers:t}){return Z(t)}}const Z=t=>{const e=t.map((t=>new B({position:S.getPosition(t),markers:[t]})));return e};class z extends W{constructor(t){var{maxZoom:e,radius:s=60}=t,r=I(t,["maxZoom","radius"]);super({maxZoom:e}),this.state={zoom:-1},this.superCluster=new x(Object.assign({maxZoom:this.maxZoom,radius:s},r))}calculate(t){let e=!1;const s={zoom:t.map.getZoom()};if(!p()(t.markers,this.markers)){e=!0,this.markers=[...t.markers];const s=this.markers.map((t=>{const e=S.getPosition(t);return{type:"Feature",geometry:{type:"Point",coordinates:[e.lng(),e.lat()]},properties:{marker:t}}}));this.superCluster.load(s)}return e||(this.state.zoom<=this.maxZoom||s.zoom<=this.maxZoom)&&(e=!p()(this.state,s)),this.state=s,e&&(this.clusters=this.cluster(t)),{clusters:this.clusters,changed:e}}cluster({map:t}){return this.superCluster.getClusters([-180,-90,180,90],Math.round(t.getZoom())).map((t=>this.transformCluster(t)))}transformCluster({geometry:{coordinates:[t,e]},properties:s}){if(s.cluster)return new B({markers:this.superCluster.getLeaves(s.cluster_id,1/0).map((t=>t.properties.marker)),position:{lat:e,lng:t}});const r=s.marker;return new B({markers:[r],position:S.getPosition(r)})}}class A{constructor(t,e){this.markers={sum:t.length};const s=e.map((t=>t.count)),r=s.reduce(((t,e)=>t+e),0);this.clusters={count:e.length,markers:{mean:r/e.length,sum:r,min:Math.min(...s),max:Math.max(...s)}}}}class N{render({count:t,position:e},s,r){const i=`<svg fill="${t>Math.max(10,s.clusters.markers.mean)?"#ff0000":"#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">\n<circle cx="120" cy="120" opacity=".6" r="70" />\n<circle cx="120" cy="120" opacity=".3" r="90" />\n<circle cx="120" cy="120" opacity=".2" r="110" />\n<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${t}</text>\n</svg>`,o=`Cluster of ${t} markers`,n=Number(google.maps.Marker.MAX_ZINDEX)+t;if(S.isAdvancedMarkerAvailable(r)){const t=(new DOMParser).parseFromString(i,"image/svg+xml").documentElement;t.setAttribute("transform","translate(0 25)");const s={map:r,position:e,zIndex:n,title:o,content:t};return new google.maps.marker.AdvancedMarkerElement(s)}const a={position:e,zIndex:n,title:o,icon:{url:`data:image/svg+xml;base64,${btoa(i)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(a)}}class F{constructor(){!function(t,e){for(let s in e.prototype)t.prototype[s]=e.prototype[s]}(F,google.maps.OverlayView)}}var j;!function(t){t.CLUSTERING_BEGIN="clusteringbegin",t.CLUSTERING_END="clusteringend",t.CLUSTER_CLICK="click"}(j||(j={}));const R=(t,e,s)=>{s.fitBounds(e.bounds)};class $ extends F{constructor({map:t,markers:e=[],algorithmOptions:s={},algorithm:r=new z(s),renderer:i=new N,onClusterClick:o=R}){super(),this.markers=[...e],this.clusters=[],this.algorithm=r,this.renderer=i,this.onClusterClick=o,t&&this.setMap(t)}addMarker(t,e){this.markers.includes(t)||(this.markers.push(t),e||this.render())}addMarkers(t,e){t.forEach((t=>{this.addMarker(t,!0)})),e||this.render()}removeMarker(t,e){const s=this.markers.indexOf(t);return-1!==s&&(S.setMap(t,null),this.markers.splice(s,1),e||this.render(),!0)}removeMarkers(t,e){let s=!1;return t.forEach((t=>{s=this.removeMarker(t,!0)||s})),s&&!e&&this.render(),s}clearMarkers(t){this.markers.length=0,t||this.render()}render(){const t=this.getMap();if(t instanceof google.maps.Map&&t.getProjection()){google.maps.event.trigger(this,j.CLUSTERING_BEGIN,this);const{clusters:e,changed:s}=this.algorithm.calculate({markers:this.markers,map:t,mapCanvasProjection:this.getProjection()});if(s||null==s){const t=new Set;for(const s of e)1==s.markers.length&&t.add(s.markers[0]);const s=[];for(const e of this.clusters)null!=e.marker&&(1==e.markers.length?t.has(e.marker)||S.setMap(e.marker,null):s.push(e.marker));this.clusters=e,this.renderClusters(),requestAnimationFrame((()=>s.forEach((t=>S.setMap(t,null)))))}google.maps.event.trigger(this,j.CLUSTERING_END,this)}}onAdd(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this)),this.render()}onRemove(){google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach((t=>S.setMap(t,null))),this.clusters.forEach((t=>t.delete())),this.clusters=[]}renderClusters(){const t=new A(this.markers,this.clusters),e=this.getMap();this.clusters.forEach((s=>{1===s.markers.length?s.marker=s.markers[0]:(s.marker=this.renderer.render(s,t,e),s.markers.forEach((t=>S.setMap(t,null))),this.onClusterClick&&s.marker.addListener("click",(t=>{google.maps.event.trigger(this,j.CLUSTER_CLICK,s),this.onClusterClick(t,s,e)}))),S.setMap(s.marker,e)}))}}let G;const q=function(){const t={},e=()=>null;let s=null;return t.enableLogger=function(){window.console&&null!==s&&(window.console.warn=s)},t.disableLogger=function(){window.console&&window.console.warn!==e&&(s=window.console.warn,window.console.warn=e)},t}();class U extends a{constructor(t){super(),this.facet=t}emit(){}load(){if(G=document.getElementById("wpgb-gmap-script"),G&&G.loaded)this.init();else{if(!G){const{map_api_key:t}=this.facet.settings;G=document.createElement("script"),G.id="wpgb-gmap-script",G.src=`https://maps.googleapis.com/maps/api/js?key=${t}&libraries=places&loading=async&callback=wpgbGmapsLoaded`,document.querySelector("head").appendChild(G)}window.addEventListener("wpgbGmapsLoaded",(()=>this.init())),this.loadMarkerStyles()}}init(){q.disableLogger();const t=this.facet.holder.querySelector(".wpgb-map-facet");this.getOptions(),this.emit("beforeInit"),G.loaded=!0,t.classList.add("wpgb-map-loaded"),this.map=new google.maps.Map(t,this.options),this.popup=new google.maps.InfoWindow({maxWidth:300}),this.marker=h(),this.setLayers(),this.setClusters(),this.addMarkers(),this.setMapPosition(),this.bindEvents(),this.emit("afterInit"),setTimeout(q.enableLogger,500)}getOptions(){const{settings:t}=this.facet,e=["roadmap","satellite","hybrid","terrain"].includes(t?.map_google_style||"roadmap");this.options={center:{lat:this.getLat(),lng:this.getLng()},zoom:this.getZoom(),draggable:t.map_dragging,minZoom:t.map_min_zoom||0,maxZoom:t.map_max_zoom||20,zoomControl:t.map_zoom_ctrl,mapTypeControl:t.map_type_ctrl,scaleControl:t.map_scale_ctrl,streetViewControl:t.map_streetview_ctrl,rotateControl:t.map_rotate_ctrl,fullscreenControl:t.map_fullscreen_ctrl,animatedZoom:!1,clickableIcons:!1},e?this.options.mapTypeId=t.map_google_style||"roadmap":this.options.mapId=t.map_google_style,t.map_scrolling||(this.options.scrollwheel=!1),e&&!t.map_poi&&(this.options.styles=[{featureType:"poi",stylers:[{visibility:"off"}]},{featureType:"transit",stylers:[{visibility:"off"}]}])}setLayers(){const{map_transit:t,map_traffic:e,map_bicycling:s}=this.facet.settings;t&&(new google.maps.TransitLayer).setMap(this.map),e&&(new google.maps.TrafficLayer).setMap(this.map),s&&(new google.maps.BicyclingLayer).setMap(this.map)}setClusters(){const{map_cluster_max_zoom:t,map_marker_cluster:e,map_cluster_radius:s,map_cluster_size:r}=this.facet.settings;this.cluster=new $({map:this.map,markers:[],algorithm:new z({minPoints:e?r||2:999999,maxZoom:t||14,radius:s||50}),renderer:{render:t=>new this.marker({map:this.map,position:t.position,content:this.generateCluster(t.count),isCluster:!0})}})}bindEvents(){window.addEventListener("click",this.onFullScreen.bind(this)),this.popup.addListener("closeclick",(()=>delete this.popup.marker)),this?.facet?.holder?.addEventListener?.("click",(t=>{this.hasMoved||t?.target?.closest?.(".wpgb-marker, .gm-style-iw")||(delete this.popup.marker,this.popup.close())}),!0),this.map.addListener("dragend",(()=>this.hasMoved=!0)),this.map.addListener("zoom_changed",(()=>this.hasMoved=!0)),window.addEventListener("resize",(()=>{this.popup.close(),this.setMapPosition()})),this.map.addListener("idle",(()=>{!this.fitMarkers&&this.hasMoved&&this.emit("refresh"),delete this.hasMoved,delete this.fitMarkers}))}getCoordinates(){const t=this.map.getBounds();return[t.getSouthWest().lat(),t.getSouthWest().lng(),t.getNorthEast().lat(),t.getNorthEast().lng(),this.map.getZoom()]}centerMap(){this.map.panTo({lat:this.getLat(),lng:this.getLng()}),this.map.setZoom(this.getZoom()),delete this.hasMoved}autoCenterMap(){const t=this.getBounds(),e=new google.maps.LatLngBounds;t&&(this.fitMarkers=!0,e.extend(t[0]),e.extend(t[1]),this.map.setCenter(e.getCenter()),this.map.fitBounds(e))}centerMarkers(){this.fitMarkers=!0,this.map.fitBounds(this.bounds)}updateBounds(){this.fitMarkers=!0,this.map.fitBounds({north:this.getNELat(),south:this.getSWLat(),east:this.getNELng(),west:this.getSWLng()}),this.map.setZoom(this.getZoom()),delete this.hasMoved}addMarkers(){this.markers={},this.bounds=new google.maps.LatLngBounds,this.cluster.clearMarkers(),this.cluster.addMarkers(this.facet.geoJSON.features.map(this.addMarker.bind(this)))}addMarker(t){const{settings:e}=this.facet,s=t.properties.id,r=t.geometry.coordinates,i=new google.maps.LatLng(r[1],r[0]),o=new this.marker({position:i,map:this.map,content:this.generateMarker(t?.properties||{}),hasPopup:e.map_marker_content,feature:t});return this.bounds.extend(i),this.markers[s]=o,o.addListener("mouseover",(()=>this.emit("marker.mouseenter",[t]))),o.addListener("mouseout",(()=>this.emit("marker.mouseleave",[t]))),o.addListener("click",(()=>this.emit("marker.click",[t]))),e.map_marker_content&&o.addListener("click",(()=>this.onMarkerClick(o,s))),o}getMarker(t){const e=this.markers?.[t];return e?{element:e?.content?.parentElement,feature:e?.feature||{}}:{}}updateMarkers(){this.popup.close(),this.addMarkers()}onMarkerClick(t,e){this.hasMoved||(this.popup.close(),this.popup.marker!==e?(document.activeElement&&document.activeElement.blur&&document.activeElement.blur(),this.popup.close(),this.popup.setContent('<div class="wpgb-map-marker-loader"></div>'),this.popup.open({map:this.map,anchor:t}),this.popup.marker=e,this.getMarkerContent(e,t.getPosition().lat(),t.getPosition().lng())):delete this.popup.marker)}onFullScreen({target:t}){const e=t&&t.classList.contains("gm-fullscreen-control"),s=e&&t.closest(".wpgb-facet"),r=s&&s===this.facet.holder;e&&s&&r&&(this.hasMoved=!0)}setMarkerContent(t,e){this.popup.marker===e&&this.popup.setContent(t)}drawLocation(){if(!this.map)return;const{lat:t,lng:e,rad:s}=this.location;q.disableLogger(),this.center=new google.maps.Marker({map:this.map,position:{lat:t,lng:e},clickable:!1,icon:{strokeColor:"rgb(255, 255, 255)",fillColor:this.circleColor,strokeWeight:2,fillOpacity:1,path:google.maps.SymbolPath.CIRCLE,scale:7.5,anchor:new google.maps.Point(0,0)}}),this.circle=new google.maps.Circle({map:this.map,center:{lat:t,lng:e},radius:1e3*s,clickable:!1,strokeColor:this.circleColor,fillColor:this.circleColor,strokeOpacity:.8,strokeWeight:2,fillOpacity:.1}),setTimeout(q.enableLogger,64)}removeLocation(){this.circle&&this.circle.setMap(null),this.center&&this.center.setMap(null)}centerLocation(){const t=new google.maps.LatLngBounds;t.extend(this.location.min),t.extend(this.location.max),this.fitMarkers=!0,this.map.fitBounds(t,0)}}const D=document.createElement("script"),H=document.createElement("link");class V extends a{constructor(t){super(),this.facet=t}emit(){}load(){D.loaded?this.init():(D.addEventListener("load",(()=>this.init())),D.src||(H.href="https://api.tiles.mapbox.com/mapbox-gl-js/v2.10.0/mapbox-gl.css",H.rel="stylesheet",D.src="https://api.tiles.mapbox.com/mapbox-gl-js/v3.6.0/mapbox-gl.js",document.querySelector("head").appendChild(H),document.querySelector("head").appendChild(D)),this.loadMarkerStyles())}init(){const t=this.facet.holder.querySelector(".wpgb-map-facet");this.getOptions(t),this.emit("beforeInit"),D.loaded=!0,t.classList.add("wpgb-map-loaded"),mapboxgl.accessToken=this.options.accessToken,this.map=new mapboxgl.Map(this.options),this.popup=new mapboxgl.Popup,this.setControls(),this.addMarkers(),this.bindEvents(),this.setMapPosition(),this.hasBounds()&&this.updateBounds(),this.emit("afterInit")}getOptions(t){const{settings:e}=this.facet;this.options={accessToken:e.map_access_token,container:t,center:{lat:this.getLat(),lng:this.getLng()},scrollZoom:e.map_scrolling,dragPan:e.map_dragging,dragRotate:!1,zoom:this.getZoom(),minZoom:e.map_min_zoom||0,maxZoom:e.map_max_zoom||20,style:e.map_mapbox_style_url||e.map_mapbox_style||"mapbox://styles/mapbox/streets-v11",projection:"mercator"}}setControls(){const{settings:t}=this.facet;t.map_fullscreen_ctrl&&this.map.addControl(new mapboxgl.FullscreenControl),t.map_scale_ctrl&&this.map.addControl(new mapboxgl.ScaleControl),t.map_zoom_ctrl&&this.map.addControl(new mapboxgl.NavigationControl),t.map_geo_ctrl&&this.map.addControl(new mapboxgl.GeolocateControl)}bindEvents(){this.event=()=>{!this.resized&&this.emit("refresh"),delete this.resized,delete this.feature},this.map.on("moveend",this.event),this.resize||(this.map.on("resize",(()=>{this.setMapPosition(),this.resized=!0})),this.resize=!0)}getCoordinates(){const t=this.map.getBounds();return[t.getSouthWest().lat,t.getSouthWest().lng,t.getNorthEast().lat,t.getNorthEast().lng,this.map.getZoom()]}centerMap(){this.map.off("moveend",this.event),this.map.panTo([this.getLng(),this.getLat()],{duration:0}),this.map.setZoom(this.getZoom()),this.bindEvents()}autoCenterMap(){const t=this.getBounds(),e=new mapboxgl.LngLatBounds;t&&(e.extend([t[0].lng,t[0].lat]),e.extend([t[1].lng,t[1].lat]),this.map.off("moveend",this.event),this.map.fitBounds(e,{duration:0,padding:50}),this.bindEvents())}centerMarkers(){const t=new mapboxgl.LngLatBounds;this.facet.geoJSON.features.map((({geometry:e})=>t.extend(e.coordinates))),this.map.off("moveend",this.event),this.map.fitBounds(t,{duration:0,padding:67}),this.bindEvents()}updateBounds(){const t=new mapboxgl.LngLatBounds;t.extend([this.getNELng(),this.getNELat()]),t.extend([this.getSWLng(),this.getSWLat()]),this.map.off("moveend",this.event),this.map.fitBounds(t,{duration:0}),this.bindEvents()}addMarkers(){this.map.on("load",(()=>this.onMapLoad())),this.popup.on("close",(()=>delete this.popup.marker))}getMarker(t){const e=this.markers?.[`marker${t}`];return e?{element:e?.element,feature:e?.feature||{}}:{}}updateMarkers(){const t=this.map.getSource("markers");for(const t in this.markers)this.markers[t]?.marker?.remove?.(),delete this.markers[t];this.popup.isOpen()&&this.popup.remove(),t&&t.setData(this.facet.geoJSON)}onMapLoad(){this.emit("loaded"),this.setMarkers(),this.setCluster()}onMarkerClick(t,e){const{properties:s}=t;if(this.popup.marker===s.id)return delete this.popup.marker,void this.popup.remove();this.popup.isOpen()&&this.popup.remove(),this.popup.setLngLat(t.geometry.coordinates),this.popup.setOffset([0,-1*e.getBoundingClientRect()?.height]),this.popup.setHTML('<div class="wpgb-map-marker-loader"></div>'),this.popup.addTo(this.map),this.popup.marker=s.id,this.getMarkerContent(s.id,t.geometry.coordinates[1],t.geometry.coordinates[0])}onClusterClick(t){this.map.getSource("markers").getClusterExpansionZoom(t.properties.cluster_id,((e,s)=>{e||this.map.easeTo({center:t.geometry.coordinates,zoom:s})}))}setMarkers(){const{settings:t}=this.facet;this.markers={},this.map.addSource("markers",{type:"geojson",data:this.facet.geoJSON,cluster:!!t.map_marker_cluster,clusterMinPoints:t.map_marker_size||2,clusterMaxZoom:t.map_cluster_max_zoom||14,clusterRadius:t.map_cluster_radius||50}),this.map.on("data",(()=>requestAnimationFrame(this.renderMarkers.bind(this)))),this.map.on("moveend",(()=>requestAnimationFrame(this.renderMarkers.bind(this))))}renderMarkers(){if(!this.map.isSourceLoaded("markers"))return;const t=[],e=this.map.querySourceFeatures("markers");for(const s of e){const{properties:e,geometry:r}=s,i=e?.cluster,o=""+(i?`cluster${e.cluster_id}`:`marker${e.id}`);if(i&&!this.markers[o]){const t=this.generateCluster(e.point_count,!0),i=new mapboxgl.Marker(t,{anchor:"bottom"}).setLngLat(r.coordinates).addTo(this.map);i.getElement().addEventListener("click",(()=>this.onClusterClick(s))),this.markers[o]={element:t,marker:i}}if(!i&&!this.markers[o]){const t=JSON.parse(e.icon),i=this.generateMarker({properties:e,icon:t},!0),n=new mapboxgl.Marker(i,{anchor:"bottom"}).setLngLat(r.coordinates).addTo(this.map);n.getElement().addEventListener("mouseenter",(()=>this.emit("marker.mouseenter",[this.feature=s]))),n.getElement().addEventListener("mouseleave",(()=>this.feature&&this.emit("marker.mouseleave",[this.feature]))),n.getElement().addEventListener("click",(t=>{t.stopPropagation(),this.facet.settings.map_marker_content&&this.onMarkerClick(s,i),this.emit("marker.click",[s])})),this.markers[o]={feature:{geometry:s.geometry,properties:{icon:t},type:"Feature"},element:i,marker:n}}t.push(o)}for(const e in this.markers)t.includes(e)||(this.markers[e].marker.remove?.(),delete this.markers[e])}setCluster(){this.map.addLayer({id:"clusters",type:"circle",source:"markers",filter:["has","point_count"],paint:{"circle-radius":0}})}setMarkerContent(t,e){this.popup.marker===e&&this.popup.setHTML(t)}drawLocation(){if(!this.map)return;const{lat:t,lng:e}=this.location,s=this.map.getSource("geolocation"),r={type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[e,t]},properties:{id:"geolocation"}}]}};return s?(s.setData(r.data),this.locationCenter(),void this.locationCircle()):this.map.isStyleLoaded()?(this.map.addSource("geolocation",r),this.locationCenter(),void this.locationCircle()):void this.map.on("load",(()=>{const t=this.map.getSource("geolocation");t?t.setData(r.data):(this.map.addSource("geolocation",r),this.locationCenter(),this.locationCircle())}))}removeLocation(){this.map&&(this.map.getLayer("circle")&&this.map.removeLayer("circle"),this.map.getLayer("center")&&this.map.removeLayer("center"))}centerLocation(){const t=new mapboxgl.LngLatBounds;t.extend([this.location.min.lng,this.location.min.lat]),t.extend([this.location.max.lng,this.location.max.lat]),this.map.off("moveend",this.event),this.map.fitBounds(t,{duration:0,padding:50}),this.bindEvents()}locationCenter(){this.map.addLayer({id:"center",source:"geolocation",type:"circle",paint:{"circle-radius":7.5,"circle-opacity":1,"circle-color":this.circleColor,"circle-stroke-color":"rgb(255, 255, 255)","circle-stroke-width":2,"circle-stroke-opacity":1}},this.map.getLayer("marker")?"marker":"")}locationCircle(){const t=1e3*this.location.rad/.075/Math.cos(this.location.lat*Math.PI/180);this.map.addLayer({id:"circle",source:"geolocation",type:"circle",paint:{"circle-radius":{stops:[[0,0],[20,t]],base:2},"circle-opacity":.1,"circle-color":this.circleColor,"circle-stroke-color":this.circleColor,"circle-stroke-width":2,"circle-stroke-opacity":.8}},this.map.getLayer("center")?"center":"")}}const J=document.createElement("script"),X=document.createElement("link"),K={};wpgb_settings.mapFacet&&wpgb_settings.mapFacet.vendors.map((({type:t,source:e,version:s})=>K[t]=`${e}?v=${s}`));class Q extends a{constructor(t){super(),this.facet=t}emit(){}load(){J.loaded?this.init():(J.addEventListener("load",(()=>this.init())),J.src||(X.href=K.css,X.rel="stylesheet",J.src=K.js,document.querySelector("head").appendChild(X),document.querySelector("head").appendChild(J)),this.loadMarkerStyles())}init(){const t=this.facet.holder.querySelector(".wpgb-map-facet");this.getOptions(),this.emit("beforeInit"),J.loaded=!0,t&&(t.classList.add("wpgb-map-loaded"),this.map=new L.Map(t,this.options),this.popup=new L.popup({offset:[0,-20],autoPan:!0}),this.extendedMarker=(t,e)=>new(L.Marker.extend({_setPos(t){L.Marker.prototype?._setPos?.call?.(this,t),this._icon.style.transform+=" translate(-50%,-100%)"}}))(t,e),this.setProvider(),this.setClusters(),this.addMarkers(),this.setMapPosition(),this.bindEvents(),this.emit("afterInit"))}getOptions(){const{settings:t}=this.facet;this.options={center:{lat:this.getLat(),lng:this.getLng()},zoom:this.getZoom(),minZoom:t.map_min_zoom||0,maxZoom:t.map_max_zoom||20,zoomControl:t.map_zoom_ctrl,dragging:t.map_dragging,scrollWheelZoom:t.map_scrolling,gestureHandling:t.map_dragging&&t.map_scrolling,debounceMoveend:!0}}setProvider(){const{settings:t}=this.facet,e=t.map_leaflet_style;new L.tileLayer(e.url,e.options).addTo(this.map),e.options.bounds&&this.map.fitBounds(e.options.bounds,{animate:!1});for(const t in e.options)this.map.options[t]=e.options[t];this.map.options.minZoom=Math.max(this.options.minZoom,e.options.minZoom||0),this.map.options.maxZoom=Math.min(this.options.maxZoom,e.options.maxZoom||20)}setClusters(){const{map_cluster_max_zoom:t,map_cluster_radius:e,map_marker_cluster:s}=this.facet.settings;s&&(this.cluster=new L.MarkerClusterGroup({animate:!1,spiderfyOnMaxZoom:!0,showCoverageOnHover:!1,zoomToBoundsOnClick:!0,disableClusteringAtZoom:t||14,maxClusterRadius:e||50,iconCreateFunction:t=>{const e=t.getChildCount();return L.divIcon({html:this.generateCluster(e),className:"wpgb-marker",iconSize:null})}}))}bindEvents(){const{settings:t}=this.facet;this.event||(this.event=()=>{!this.autoPan&&!this.resized&&this.emit("refresh"),delete this.resized},this.layer.on("mouseover",(({layer:t})=>this.emit("marker.mouseenter",[t.feature]))),this.layer.on("mouseout",(({layer:t})=>this.emit("marker.mouseleave",[t.feature]))),this.layer.on("click",(({layer:t})=>this.emit("marker.click",[t.feature]))),t.map_marker_content&&this.layer.on("click",(({layer:t})=>{const{properties:e,geometry:s}=t.feature,{coordinates:r}=s;if(this.popup.marker===e.id)return delete this.autoPan,void delete this.popup.marker;this.autoPan=!0,this.popup.marker=e.id,this.popup.setLatLng([r[1],r[0]]),this.popup.options.offset=[0,-1*t.getElement().getBoundingClientRect()?.height],this.popup.setContent('<div class="wpgb-map-marker-loader"></div>'),this.popup.openOn(this.map),this.getMarkerContent(e.id,r[1],r[0])})),this.map.on("popupclose",(()=>{document.activeElement&&document.activeElement.classList.contains("leaflet-marker-icon")||delete this.popup.marker,delete this.autoPan})),this.map.on("movestart",(()=>delete this.resized)),this.map.on("resize",(()=>{this.setMapPosition(),this.resized=!0}))),delete this.popup.marker,delete this.resized,this.map.closePopup(),this.map.on("moveend",this.event)}getCoordinates(){const t=this.map.getBounds();return[t._southWest.lat,t._southWest.lng,t._northEast.lat,t._northEast.lng,this.map.getZoom()]}centerMap(){this.event&&this.map.off("moveend",this.event),this.map.setView(L.latLng(this.getLat(),this.getLng()),this.getZoom(),{animate:!1,duration:0}),this.bindEvents()}autoCenterMap(){const t=this.getBounds(),e=new L.LatLngBounds;t&&(e.extend([t[0].lat,t[0].lng]),e.extend([t[1].lat,t[1].lng]),this.event&&this.map.off("moveend",this.event),this.map.fitBounds(e,{animate:!1,duration:0}),this.bindEvents())}centerMarkers(){this.event&&this.map.off("moveend",this.event),this.map.fitBounds(this.layer.getBounds(),{animate:!1,duration:0}),this.bindEvents()}updateBounds(){const t=L.latLngBounds(L.latLng(this.getSWLat(),this.getSWLng()),L.latLng(this.getNELat(),this.getNELng()));this.event&&this.map.off("moveend",this.event),this.map.fitBounds(t,{animate:!1,duration:0}),this.bindEvents()}updateMarkers(){this.markers={},this.map.closePopup(),this.layer.clearLayers(),this.layer.addData(this.facet.geoJSON),this.cluster?(this.cluster.clearLayers(),this.cluster.addLayer(this.layer),this.map.addLayer(this.cluster)):this.layer.addTo(this.map)}addMarkers(){this.markers={},this.layer=new L.geoJSON(this.facet.geoJSON,{pointToLayer:this.setIcon.bind(this)}),this.cluster?(this.cluster.addLayer(this.layer),this.cluster.addTo(this.map)):this.layer.addTo(this.map)}getMarker(t){const e=this.markers?.[t];return e?{element:e?.getElement?.(),feature:e?.feature||{}}:{}}setIcon(t,e){return t?.properties?.id?this.markers[t.properties.id]=this.extendedMarker(e,{icon:new L.DivIcon({html:this.generateMarker(t?.properties||{}),className:"wpgb-marker",iconSize:null})}):null}setMarkerContent(t,e){if(this.popupAutoPanTimout&&clearTimeout(this.popupAutoPanTimout),!this.popup.marker)return this.map.closePopup(),void delete this.autoPan;this.popup.marker===e&&this.popup.setContent(t),this.popupAutoPanTimout=setTimeout((()=>delete this.autoPan),300),this.popup.update()}drawLocation(){if(!this.map)return;const{lat:t,lng:e,rad:s}=this.location;this.circle=L.circle([t,e],{interactive:!1,color:this.circleColor,fillColor:this.circleColor,opacity:.8,weight:2,fillOpacity:.1,radius:1e3*s}).addTo(this.map),this.center=L.circleMarker([t,e],{interactive:!1,color:"rgb(255, 255, 255)",fillColor:this.circleColor,weight:2,fillOpacity:1,radius:7.5}).addTo(this.map)}removeLocation(){this.map&&(this.circle&&this.map.removeLayer(this.circle),this.center&&this.map.removeLayer(this.center))}centerLocation(){const t=new L.LatLngBounds;t.extend(this.location.min),t.extend(this.location.max),this.event&&this.map.off("moveend",this.event),this.map.fitBounds(t,{animate:!1,duration:0,padding:[0,0]}),this.bindEvents()}}const Y="undefined"!=typeof Map&&new Map;function tt(t,e,s){const{target:r}=t,{instance:i}=e,o=function(t){if(!t||!t.classList.contains("wpgb-card"))return!1;const e=t.className.match(/wpgb-(post|user|term)-\d+/g);return e&&parseInt(e[0].replace(/wpgb-post-|wpgb-user-|wpgb-term-/g,""),10)}(r);if(!o)return;const n=i.getMarker(o);if(!n?.element||!n?.feature)return;const{element:a,feature:h}=n,c=a?.querySelector?.(".wpgb-marker-icon");Object.prototype.hasOwnProperty.call(a,"wpgbIndex")||(a.wpgbIndex=a.style.zIndex||""),a.classList?.[s?"add":"remove"]?.("wpgb-marker-highlighted"),a.style.zIndex=s?9999:a.wpgbIndex,c&&h?.properties?.icon?.url&&h?.properties?.icon?.urlHover&&(c.src=s?h.properties.icon.urlHover:h.properties.icon.url)}const et=t=>{t.facets.on("render",(function(){if("map"!==this.facet.type)return;if(this.facet.queryString=!!Object.keys(t.facets.getParams()).length,this.facet.lang=t.options.lang,!this.facet.html)return this.facet.instance=!1,void(this.facet.rendered=!1);const e=this.facet.holder.querySelector(".wpgb-map-facet");if(e&&(this.facet.disabled?e.setAttribute("aria-disabled",!0):e.removeAttribute("aria-disabled")),this.facet.instance){const t=this.facet,e=setInterval((()=>st(t,e)),50);st(t,e)}else{!function(t,e){Y.has(e.holder)&&(t.element.removeEventListener("mouseenter",Y.get(e.holder).mouseenter,!0),t.element.removeEventListener("mouseleave",Y.get(e.holder).mouseleave,!0),Y.delete(e.holder)),Y.set(e.holder,{mouseenter:t=>tt(t,e,!0),mouseleave:t=>tt(t,e,!1)}),t.element.addEventListener("mouseenter",Y.get(e.holder).mouseenter,!0),t.element.addEventListener("mouseleave",Y.get(e.holder).mouseleave,!0)}(t,this.facet),function(t){const e=t.holder.querySelector('.wpgb-map-pan-to-search input[type="checkbox"]');e&&e.addEventListener("change",(t=>t.stopPropagation()))}(this.facet),this.facet.instance=function(t){const{map_type:e}=t.settings;if("google"===e)return new U(t);if("leaflet"===e)return new Q(t);return new V(t)}(this.facet),this.facet.instance.type=this.facet.settings.map_type,this.facet.instance.emit=function(e,s){"refresh"===e?rt.bind(this)(t):t.facets.emit(`map.${e}`,[this.facet.instance,...s||[]])},this.facet.instance.load();const e=this.facet;t.facets.on("geolocate",((...t)=>e.instance&&e.instance.setLocation(...t)))}this.facet.rendered=!0}))};function st(t,e){t.instance.map&&(delete t.instance.popup.marker,t.instance.facet=t,t.instance.updateMarkers(),t.instance.refreshPosition(),delete t.instance.hasRefreshed,clearInterval(e))}function rt(t){const e=this.getCoordinates();(function(t){const e=t.holder.querySelector('.wpgb-map-pan-to-search input[type="checkbox"]');return e&&e.checked||!e&&t.settings&&t.settings.map_filtering})(this.facet)&&t&&t.facets&&(t.facets.emit("change",[this.facet.slug,e]),t.facets.setParams(this.facet.slug,e),t.facets.refresh(),this.hasRefreshed=!0)}function it(t){et(t)}function ot(){if(WP_Grid_Builder.on("init",it),WP_Grid_Builder.instances)for(const t in WP_Grid_Builder.instances){const e=WP_Grid_Builder.instances[t];e.element.classList.contains("wpgb-enabled")&&it(e)}}window.WP_Grid_Builder?ot():window.addEventListener("wpgb.loaded",(()=>ot())),window.wpgbGmapsLoaded=()=>{let t;"function"==typeof Event?t=new Event("wpgbGmapsLoaded"):document.createEvent&&(t=document.createEvent("Event"),t.initEvent("wpgbGmapsLoaded")),window.dispatchEvent(t)}})()})();
function getCookie(name){
let cookieKey=name + "=";
let ca=document.cookie.split(';');
for(let i=0; i < ca.length; i++){
let c=ca[i];
while (c.charAt(0)===' '){
c=c.substring(1);
}
if(c.indexOf(cookieKey)===0){
return c.substring(cookieKey.length, c.length);
}}
return null;
}
window.WP_Grid_Builder&&WP_Grid_Builder.on('init',  function(wpgb){
wpgb.facets.on('init', function(facets){
if(getCookie('cdf_dates_js')!==null&&getCookie('cdf_dates_js')!='+au+'){
console.log("Le cookie 'cdf_dates_js' existe.");
wpgb.facets.setParams('dates_de_disponibilite', [getCookie('cdf_dates_js').substring(0, 10)+','+getCookie('cdf_dates_js').substring(14, 24)]);
wpgb.facets.refresh();
}else{
}});
/*
var estValide=estCookieValide('cdf_dates_js');
if(estValide){
if(getCookie('cdf_dates_js')!=''){
setTimeout(function(){
console.log(getCookie('cdf_dates_js').substring(0, 10)+','+getCookie('cdf_dates_js').substring(14, 24));
wpgb.facets.setParams('dates_de_disponibilite', [getCookie('cdf_dates_js').substring(0, 10)+','+getCookie('cdf_dates_js').substring(14, 24)]);
wpgb.facets.refresh();
},1000)
}
*/
wpgb.facets.on('reset', function(facets){
document.cookie='cdf_dates_js=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=cabanes-de-france.com; ';
});
jQuery(document).on('click', 'button.wpgb-clear-button', function(){
console.log('Avant suppression du cookie');
document.cookie='cdf_dates_js=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
document.cookie='cdf_dates_js=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=cabanes-de-france.com';
console.log('Après suppression du cookie');
});
});
window.WP_Grid_Builder&&WP_Grid_Builder.on('init',  function(wpgb){
wpgb.facets.on('map.beforeInit', function(instance){
instance.options.styles =
[
{
"featureType": "landscape.man_made",
"elementType": "geometry",
"stylers": [
{
"color": "#f7f1df"
}
]
},
{
"featureType": "landscape.natural",
"elementType": "geometry",
"stylers": [
{
"color": "#d0e3b4"
}
]
},
{
"featureType": "landscape.natural.terrain",
"elementType": "geometry",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "poi",
"elementType": "labels",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "poi.business",
"elementType": "all",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "poi.medical",
"elementType": "geometry",
"stylers": [
{
"color": "#fbd3da"
}
]
},
{
"featureType": "poi.park",
"elementType": "geometry",
"stylers": [
{
"color": "#bde6ab"
}
]
},
{
"featureType": "road",
"elementType": "geometry.stroke",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "road",
"elementType": "labels",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "road.highway",
"elementType": "geometry.fill",
"stylers": [
{
"color": "#ffe15f"
}
]
},
{
"featureType": "road.highway",
"elementType": "geometry.stroke",
"stylers": [
{
"color": "#efd151"
}
]
},
{
"featureType": "road.arterial",
"elementType": "geometry.fill",
"stylers": [
{
"color": "#ffffff"
}
]
},
{
"featureType": "road.local",
"elementType": "geometry.fill",
"stylers": [
{
"color": "black"
}
]
},
{
"featureType": "transit.station.airport",
"elementType": "geometry.fill",
"stylers": [
{
"color": "#cfb2db"
}
]
},
{
"featureType": "water",
"elementType": "geometry",
"stylers": [
{
"color": "#a2daf2"
}
]
}
];
instance.options.center={ lat: 35.6894, lng: 139.692 };});
/*
wpgb.facets.on('map.afterInit', function(instance){
instance.cluster.setOptions({
renderer: {
render: function(args){
const count=args.count;
const position=args.position;
return new google.maps.Marker({
label: {
text: String(count),
color: 'white',
fontSize: '12px',
fontWeight: '600',
},
position,
icon: {
url: 'https://www.cabanes-de-france.com/wp-content/themes/wprentals/img/m2.png',
size: {
height: 30,
width: 30,
},
scaledSize: {
height: 30,
width: 30,
},
},
zIndex: Number(google.maps.Marker.MAX_ZINDEX) + count,
}
);
},
},
}
);
});
*/
wpgb.facets.on('map.afterInit', function(instance){
if(!document.getElementById('custom-cluster-styles')){
const style=document.createElement('style');
style.id='custom-cluster-styles';
style.textContent=`
.custom-cluster-wrapper {
background: transparent !important;
border: none !important;
}
.custom-marker-cluster {
position: relative;
width: 30px;
height: 30px;
}
.custom-marker-cluster img {
width: 30px;
height: 30px;
display: block;
}
.custom-marker-cluster span {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: white;
font-size: 12px;
font-weight: 600;
text-shadow: 0 1px 2px rgba(0,0,0,0.3);
line-height: 1;
}
`;
document.head.appendChild(style);
}
const mapType=instance.type; // 'leaflet' ou 'google'
console.log('Type de carte détecté:', mapType);
if(mapType==='leaflet'){
if(instance.cluster&&instance.cluster.options){
instance.cluster.options.iconCreateFunction=function(cluster){
const count=cluster.getChildCount();
return L.divIcon({
html: '<div class="custom-marker-cluster">' +
'<img src="https://www.cabanes-de-france.com/wp-content/themes/wprentals/img/m2.png" />' +
'<span>' + count + '</span>' +
'</div>',
className: 'custom-cluster-wrapper',
iconSize: L.point(30, 30)
});
};
instance.cluster.refreshClusters();
console.log('Configuration Leaflet appliquée avec succès');
}}else if(mapType==='google'){
if(instance.cluster){
try {
if(typeof instance.cluster.setOptions==='function'){
instance.cluster.setOptions({
renderer: {
render: function(args){
const count=args.count;
const position=args.position;
return new google.maps.Marker({
label: {
text: String(count),
color: 'white',
fontSize: '12px',
fontWeight: '600',
},
position,
icon: {
url: 'https://www.cabanes-de-france.com/wp-content/themes/wprentals/img/m2.png',
size: new google.maps.Size(30, 30),
scaledSize: new google.maps.Size(30, 30),
},
zIndex: Number(google.maps.Marker.MAX_ZINDEX) + count,
});
},
},
});
console.log('Configuration Google Maps appliquée avec setOptions');
}else if(typeof instance.cluster.setRenderer==='function'){
instance.cluster.setRenderer({
render: function(cluster, stats){
return new google.maps.Marker({
label: {
text: String(cluster.getMarkers().length),
color: 'white',
fontSize: '12px',
fontWeight: '600',
},
position: cluster.getCenter(),
icon: {
url: 'https://www.cabanes-de-france.com/wp-content/themes/wprentals/img/m2.png',
size: new google.maps.Size(30, 30),
scaledSize: new google.maps.Size(30, 30),
},
zIndex: Number(google.maps.Marker.MAX_ZINDEX) + cluster.getMarkers().length,
});
},
});
console.log('Configuration Google Maps appliquée avec setRenderer');
}} catch (error){
console.error('Erreur lors de la configuration Google Maps:', error);
}}
}else{
console.warn('Type de carte non reconnu:', mapType);
}});
});
(()=>{var e={710:()=>{window.jQuery&&jQuery(document).on("elementor/popup/show",((e,t)=>{document.querySelector(`#elementor-popup-modal-${t}`).querySelectorAll(".wp-grid-builder").forEach((e=>{const t=WP_Grid_Builder.instances[e.dataset.instance];t?t.element&&!document.body.contains(t.element)&&(e.replaceWith(t.element),t.grid.layout(),t.carousel&&t.carousel.resize()):WP_Grid_Builder.instantiate(e).init()}))}))},627:()=>{function e(e){var t=this.parentNode,o=arguments.length,r=+(t&&"object"==typeof e);if(t){for(;o-- >r;)t&&"object"!=typeof arguments[o]&&(arguments[o]=document.createTextNode(arguments[o])),t||!arguments[o].parentNode?t.insertBefore(this.previousSibling,arguments[o]):arguments[o].parentNode.removeChild(arguments[o]);r&&t.replaceChild(e,this)}}Element.prototype.replaceWith||(Element.prototype.replaceWith=e),CharacterData.prototype.replaceWith||(CharacterData.prototype.replaceWith=e),DocumentType.prototype.replaceWith||(DocumentType.prototype.replaceWith=e)},97:()=>{function e(e){(e?e.querySelectorAll(".wp-grid-builder"):[]).forEach((e=>{const t=WP_Grid_Builder.instances[e.instance];setTimeout((()=>t&&t.grid.layout()),500),t&&t.grid.layout(),t&&t.carousel&&t.carousel.resize()}))}window.jQuery&&jQuery(window).on("elementor/frontend/init",(()=>{elementorFrontend.hooks.addAction("frontend/element_ready/widget",(t=>{const o=t[0].classList.contains(".elementor-widget-tabs"),r=t[0].classList.contains(".elementor-widget-toggle"),n=t[0].classList.contains(".elementor-widget-accordion");(o||r||n)&&e(t[0])})),window.addEventListener("click",(({target:t})=>{t.closest(".elementor-tab-title")&&e(t.closest(".elementor-tabs, .elementor-toggle, .elementor-accordion"))}))}))}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,o),i.exports}(()=>{"use strict";o(627);window.jQuery&&jQuery(document).on("elementor/popup/show",((e,t)=>{let o=!1;document.querySelectorAll(`#elementor-popup-modal-${t} .wpgb-facet`).forEach((e=>{const{facet:t,grid:r}=e.dataset;o=!0,WP_Grid_Builder.get(r).forEach((o=>{const{facets:r}=o.facets;for(const o in r)o===t&&r[o].forEach((({holder:t})=>{!e.closest(".wp-grid-builder")&&!document.body.contains(t)&&e.replaceWith(t)}))}))})),o&&function(){if("function"==typeof Event)window.dispatchEvent(new Event("resize"));else{const e=window.document.createEvent("UIEvents");e.initUIEvent("resize",!0,!1,window,0),window.dispatchEvent(e)}}()}));o(710),o(97)})()})();