@maptiler/geocoding-control 2.0.0-rc.2 → 2.0.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/leaflet.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(A,z){typeof exports=="object"&&typeof module<"u"?z(exports,require("leaflet")):typeof define=="function"&&define.amd?define(["exports","leaflet"],z):(A=typeof globalThis<"u"?globalThis:A||self,z(A.leafletMaptilerGeocoder={},A.L))})(this,function(A,z){"use strict";var ao=Object.defineProperty;var Yi=A=>{throw TypeError(A)};var co=(A,z,K)=>z in A?ao(A,z,{enumerable:!0,configurable:!0,writable:!0,value:K}):A[z]=K;var qt=(A,z,K)=>co(A,typeof z!="symbol"?z+"":z,K),Xi=(A,z,K)=>z.has(A)||Yi("Cannot "+K);var he=(A,z,K)=>(Xi(A,z,"read from private field"),K?K.call(A):z.get(A)),Zt=(A,z,K)=>z.has(A)?Yi("Cannot add the same private member more than once"):z instanceof WeakSet?z.add(A):z.set(A,K),gt=(A,z,K,ie)=>(Xi(A,z,"write to private field"),ie?ie.call(A,K):z.set(A,K),K);var ue,Ie;function K(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const ie=K(z);function B(){}function Ki(i,e){for(const t in e)i[t]=e[t];return i}function Qt(i){return i()}function Ht(){return Object.create(null)}function ye(i){i.forEach(Qt)}function Vt(i){return typeof i=="function"}function we(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let tt;function J(i,e){return i===e?!0:(tt||(tt=document.createElement("a")),tt.href=e,i===tt.href)}function Ji(i){return Object.keys(i).length===0}function $i(i,e,t,n){if(i){const r=Yt(i,e,t,n);return i[0](r)}}function Yt(i,e,t,n){return i[1]&&n?Ki(t.ctx.slice(),i[1](n(e))):t.ctx}function en(i,e,t,n){if(i[2]&&n){const r=i[2](n(t));if(e.dirty===void 0)return r;if(typeof r=="object"){const o=[],u=Math.max(e.dirty.length,r.length);for(let s=0;s<u;s+=1)o[s]=e.dirty[s]|r[s];return o}return e.dirty|r}return e.dirty}function tn(i,e,t,n,r,o){if(r){const u=Yt(e,t,n,o);i.p(u,r)}}function nn(i){if(i.ctx.length>32){const e=[],t=i.ctx.length/32;for(let n=0;n<t;n++)e[n]=-1;return e}return-1}function Xt(i){return i??""}function T(i,e){i.appendChild(e)}function U(i,e,t){i.insertBefore(e,t||null)}function D(i){i.parentNode&&i.parentNode.removeChild(i)}function W(i){return document.createElement(i)}function fe(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function _e(i){return document.createTextNode(i)}function ne(){return _e(" ")}function rn(){return _e("")}function ee(i,e,t,n){return i.addEventListener(e,t,n),()=>i.removeEventListener(e,t,n)}function on(i){return function(e){return e.preventDefault(),i.call(this,e)}}function p(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}function sn(i){return Array.from(i.childNodes)}function Ge(i,e){e=""+e,i.data!==e&&(i.data=e)}function Kt(i,e){i.value=e??""}function se(i,e,t){i.classList.toggle(e,!!t)}function ln(i,e,{bubbles:t=!1,cancelable:n=!1}={}){return new CustomEvent(i,{detail:e,bubbles:t,cancelable:n})}let je;function qe(i){je=i}function Jt(){if(!je)throw new Error("Function called outside component initialization");return je}function un(i){Jt().$$.on_destroy.push(i)}function an(){const i=Jt();return(e,t,{cancelable:n=!1}={})=>{const r=i.$$.callbacks[e];if(r){const o=ln(e,t,{cancelable:n});return r.slice().forEach(u=>{u.call(i,o)}),!o.defaultPrevented}return!0}}function $t(i,e){const t=i.$$.callbacks[e.type];t&&t.slice().forEach(n=>n.call(this,e))}const We=[],yt=[];let ze=[];const ei=[],cn=Promise.resolve();let pt=!1;function fn(){pt||(pt=!0,cn.then(ti))}function bt(i){ze.push(i)}const vt=new Set;let Be=0;function ti(){if(Be!==0)return;const i=je;do{try{for(;Be<We.length;){const e=We[Be];Be++,qe(e),dn(e.$$)}}catch(e){throw We.length=0,Be=0,e}for(qe(null),We.length=0,Be=0;yt.length;)yt.pop()();for(let e=0;e<ze.length;e+=1){const t=ze[e];vt.has(t)||(vt.add(t),t())}ze.length=0}while(We.length);for(;ei.length;)ei.pop()();pt=!1,vt.clear(),qe(i)}function dn(i){if(i.fragment!==null){i.update(),ye(i.before_update);const e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(bt)}}function hn(i){const e=[],t=[];ze.forEach(n=>i.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),ze=e}const it=new Set;let Re;function nt(){Re={r:0,c:[],p:Re}}function rt(){Re.r||ye(Re.c),Re=Re.p}function Q(i,e){i&&i.i&&(it.delete(i),i.i(e))}function Y(i,e,t,n){if(i&&i.o){if(it.has(i))return;it.add(i),Re.c.push(()=>{it.delete(i),n&&(t&&i.d(1),n())}),i.o(e)}else n&&n()}function ii(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function mn(i,e){Y(i,1,1,()=>{e.delete(i.key)})}function gn(i,e,t,n,r,o,u,s,c,l,d,a){let f=i.length,h=o.length,g=f;const y={};for(;g--;)y[i[g].key]=g;const v=[],b=new Map,E=new Map,L=[];for(g=h;g--;){const S=a(r,o,g),w=t(S);let k=u.get(w);k?L.push(()=>k.p(S,e)):(k=l(w,S),k.c()),b.set(w,v[g]=k),w in y&&E.set(w,Math.abs(g-y[w]))}const _=new Set,C=new Set;function x(S){Q(S,1),S.m(s,d),u.set(S.key,S),d=S.first,h--}for(;f&&h;){const S=v[h-1],w=i[f-1],k=S.key,I=w.key;S===w?(d=S.first,f--,h--):b.has(I)?!u.has(k)||_.has(k)?x(S):C.has(I)?f--:E.get(k)>E.get(I)?(C.add(k),x(S)):(_.add(I),f--):(c(w,u),f--)}for(;f--;){const S=i[f];b.has(S.key)||c(S,u)}for(;h;)x(v[h-1]);return ye(L),v}function Ee(i){i&&i.c()}function pe(i,e,t){const{fragment:n,after_update:r}=i.$$;n&&n.m(e,t),bt(()=>{const o=i.$$.on_mount.map(Qt).filter(Vt);i.$$.on_destroy?i.$$.on_destroy.push(...o):ye(o),i.$$.on_mount=[]}),r.forEach(bt)}function be(i,e){const t=i.$$;t.fragment!==null&&(hn(t.after_update),ye(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function yn(i,e){i.$$.dirty[0]===-1&&(We.push(i),fn(),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function Le(i,e,t,n,r,o,u=null,s=[-1]){const c=je;qe(i);const l=i.$$={fragment:null,ctx:[],props:o,update:B,not_equal:r,bound:Ht(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:Ht(),dirty:s,skip_bound:!1,root:e.target||c.$$.root};u&&u(l.root);let d=!1;if(l.ctx=t?t(i,e.props||{},(a,f,...h)=>{const g=h.length?h[0]:f;return l.ctx&&r(l.ctx[a],l.ctx[a]=g)&&(!l.skip_bound&&l.bound[a]&&l.bound[a](g),d&&yn(i,a)),f}):[],l.update(),d=!0,ye(l.before_update),l.fragment=n?n(l.ctx):!1,e.target){if(e.hydrate){const a=sn(e.target);l.fragment&&l.fragment.l(a),a.forEach(D)}else l.fragment&&l.fragment.c();e.intro&&Q(i.$$.fragment),pe(i,e.target,e.anchor),ti()}qe(c)}class Se{constructor(){qt(this,"$$");qt(this,"$$set")}$destroy(){be(this,1),this.$destroy=B}$on(e,t){if(!Vt(t))return B;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const r=n.indexOf(t);r!==-1&&n.splice(r,1)}}$set(e){this.$$set&&!Ji(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const pn="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(pn);function bn(i){let e,t;return{c(){e=fe("svg"),t=fe("path"),p(t,"d","M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"),p(e,"viewBox","0 0 14 14"),p(e,"width","13"),p(e,"height","13"),p(e,"class","svelte-en2qvf")},m(n,r){U(n,e,r),T(e,t)},p:B,i:B,o:B,d(n){n&&D(e)}}}class ni extends Se{constructor(e){super(),Le(this,e,null,bn,we,{})}}function vn(i){let e,t;return{c(){e=fe("svg"),t=fe("path"),p(t,"d","M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"),p(e,"viewBox","0 0 30 30"),p(e,"fill","none"),p(e,"xmlns","http://www.w3.org/2000/svg"),p(e,"class","svelte-d2loi5")},m(n,r){U(n,e,r),T(e,t)},p:B,i:B,o:B,d(n){n&&D(e)}}}class ri extends Se{constructor(e){super(),Le(this,e,null,vn,we,{})}}function wn(i){let e,t;return{c(){e=W("img"),J(e.src,t=i[3]+"area.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"class","svelte-ltkwvy")},m(n,r){U(n,e,r)},p(n,r){r&8&&!J(e.src,t=n[3]+"area.svg")&&p(e,"src",t),r&64&&p(e,"alt",n[6])},d(n){n&&D(e)}}}function _n(i){let e,t;return{c(){e=W("img"),J(e.src,t=i[3]+"reverse.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"class","svelte-ltkwvy")},m(n,r){U(n,e,r)},p(n,r){r&8&&!J(e.src,t=n[3]+"reverse.svg")&&p(e,"src",t),r&64&&p(e,"alt",n[6])},d(n){n&&D(e)}}}function En(i){let e,t;return{c(){e=W("img"),J(e.src,t=i[3]+"poi.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"class","svelte-ltkwvy")},m(n,r){U(n,e,r)},p(n,r){r&8&&!J(e.src,t=n[3]+"poi.svg")&&p(e,"src",t),r&64&&p(e,"alt",n[6])},d(n){n&&D(e)}}}function Ln(i){let e,t;return{c(){e=W("img"),J(e.src,t=i[3]+"postal_code.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"class","svelte-ltkwvy")},m(n,r){U(n,e,r)},p(n,r){r&8&&!J(e.src,t=n[3]+"postal_code.svg")&&p(e,"src",t),r&64&&p(e,"alt",n[6])},d(n){n&&D(e)}}}function Sn(i){let e,t;return{c(){e=W("img"),J(e.src,t=i[3]+"street.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"class","svelte-ltkwvy")},m(n,r){U(n,e,r)},p(n,r){r&8&&!J(e.src,t=n[3]+"street.svg")&&p(e,"src",t),r&64&&p(e,"alt",n[6])},d(n){n&&D(e)}}}function xn(i){let e,t;return{c(){e=W("img"),J(e.src,t=i[3]+"road.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"class","svelte-ltkwvy")},m(n,r){U(n,e,r)},p(n,r){r&8&&!J(e.src,t=n[3]+"road.svg")&&p(e,"src",t),r&64&&p(e,"alt",n[6])},d(n){n&&D(e)}}}function Mn(i){let e,t;return{c(){e=W("img"),J(e.src,t=i[3]+"housenumber.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"class","svelte-ltkwvy")},m(n,r){U(n,e,r)},p(n,r){r&8&&!J(e.src,t=n[3]+"housenumber.svg")&&p(e,"src",t),r&64&&p(e,"alt",n[6])},d(n){n&&D(e)}}}function Cn(i){let e,t,n,r;return{c(){e=W("img"),J(e.src,t=i[5])||p(e,"src",t),p(e,"alt",i[4]),p(e,"class","svelte-ltkwvy")},m(o,u){U(o,e,u),n||(r=ee(e,"error",i[14]),n=!0)},p(o,u){u&32&&!J(e.src,t=o[5])&&p(e,"src",t),u&16&&p(e,"alt",o[4])},d(o){o&&D(e),n=!1,r()}}}function oi(i){let e,t;return{c(){e=W("span"),t=_e(i[6]),p(e,"class","secondary svelte-ltkwvy")},m(n,r){U(n,e,r),T(e,t)},p(n,r){r&64&&Ge(t,n[6])},d(n){n&&D(e)}}}function kn(i){let e,t,n,r,o,u,s,c,l,d=(i[7]?i[0].place_name:i[0].place_name.replace(/,.*/,""))+"",a,f,h=i[2]==="always"||i[2]!=="never"&&!i[0].address&&!i[0].id.startsWith("road.")&&!i[0].id.startsWith("address.")&&!i[0].id.startsWith("postal_code.")&&(!i[0].id.startsWith("poi.")||!i[5])&&!i[7],g,y,v=(i[7]?"":i[0].place_name.replace(/[^,]*,?\s*/,""))+"",b,E,L;function _(w,k){return k&1&&(t=null),k&1&&(n=null),k&1&&(r=null),k&1&&(o=null),w[5]?Cn:w[0].address?Mn:(t==null&&(t=!!w[0].id.startsWith("road.")),t?xn:(n==null&&(n=!!w[0].id.startsWith("address.")),n?Sn:(r==null&&(r=!!w[0].id.startsWith("postal_code.")),r?Ln:(o==null&&(o=!!w[0].id.startsWith("poi.")),o?En:w[7]?_n:wn))))}let C=_(i,-1),x=C(i),S=h&&oi(i);return{c(){e=W("li"),x.c(),u=ne(),s=W("span"),c=W("span"),l=W("span"),a=_e(d),f=ne(),S&&S.c(),g=ne(),y=W("span"),b=_e(v),p(l,"class","primary svelte-ltkwvy"),p(c,"class","svelte-ltkwvy"),p(y,"class","line2 svelte-ltkwvy"),p(s,"class","texts svelte-ltkwvy"),p(e,"tabindex","0"),p(e,"data-selected",i[1]),p(e,"class","svelte-ltkwvy"),se(e,"selected",i[1])},m(w,k){U(w,e,k),x.m(e,null),T(e,u),T(e,s),T(s,c),T(c,l),T(l,a),T(c,f),S&&S.m(c,null),T(s,g),T(s,y),T(y,b),E||(L=[ee(e,"mouseenter",i[12]),ee(e,"focus",i[13])],E=!0)},p(w,[k]){C===(C=_(w,k))&&x?x.p(w,k):(x.d(1),x=C(w),x&&(x.c(),x.m(e,u))),k&1&&d!==(d=(w[7]?w[0].place_name:w[0].place_name.replace(/,.*/,""))+"")&&Ge(a,d),k&37&&(h=w[2]==="always"||w[2]!=="never"&&!w[0].address&&!w[0].id.startsWith("road.")&&!w[0].id.startsWith("address.")&&!w[0].id.startsWith("postal_code.")&&(!w[0].id.startsWith("poi.")||!w[5])&&!w[7]),h?S?S.p(w,k):(S=oi(w),S.c(),S.m(c,null)):S&&(S.d(1),S=null),k&1&&v!==(v=(w[7]?"":w[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&Ge(b,v),k&2&&p(e,"data-selected",w[1]),k&2&&se(e,"selected",w[1])},i:B,o:B,d(w){w&&D(e),x.d(),S&&S.d(),E=!1,ye(L)}}}function Nn(i,e,t){var L;let n,r,{feature:o}=e,{selected:u=!1}=e,{showPlaceType:s}=e,{missingIconsCache:c}=e,{iconsBaseUrl:l}=e;const d=(L=o.properties)==null?void 0:L.categories;let a,f,h=0,g=o.place_type[0]==="reverse";function y(){f&&c.add(f),t(10,h++,h)}function v(_){$t.call(this,i,_)}function b(_){$t.call(this,i,_)}const E=()=>y();return i.$$set=_=>{"feature"in _&&t(0,o=_.feature),"selected"in _&&t(1,u=_.selected),"showPlaceType"in _&&t(2,s=_.showPlaceType),"missingIconsCache"in _&&t(9,c=_.missingIconsCache),"iconsBaseUrl"in _&&t(3,l=_.iconsBaseUrl)},i.$$.update=()=>{var _,C,x,S;if(i.$$.dirty&3640)do t(11,n--,n),t(4,a=d==null?void 0:d[n]),t(5,f=a?l+a.replace(/ /g,"_")+".svg":void 0);while(n>-1&&(!f||c.has(f)));i.$$.dirty&1&&t(6,r=((C=(_=o.properties)==null?void 0:_.categories)==null?void 0:C.join(", "))??((S=(x=o.properties)==null?void 0:x.place_type_name)==null?void 0:S[0])??o.place_type[0])},t(11,n=(d==null?void 0:d.length)??0),[o,u,s,l,a,f,r,g,y,c,h,n,v,b,E]}class Tn extends Se{constructor(e){super(),Le(this,e,Nn,kn,we,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function Pn(i){let e;return{c(){e=W("div"),e.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',p(e,"class","svelte-7cmwmc")},m(t,n){U(t,e,n)},p:B,i:B,o:B,d(t){t&&D(e)}}}class Rn extends Se{constructor(e){super(),Le(this,e,null,Pn,we,{})}}function In(i){let e,t,n;return{c(){e=fe("svg"),t=fe("path"),p(t,"stroke-width","4"),p(t,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),p(t,"class","svelte-gzo3ar"),p(e,"width",n=i[0]==="list"?20:void 0),p(e,"viewBox","0 0 70 85"),p(e,"fill","none"),p(e,"class","svelte-gzo3ar"),se(e,"in-map",i[0]!=="list"),se(e,"list-icon",i[0]==="list")},m(r,o){U(r,e,o),T(e,t)},p(r,[o]){o&1&&n!==(n=r[0]==="list"?20:void 0)&&p(e,"width",n),o&1&&se(e,"in-map",r[0]!=="list"),o&1&&se(e,"list-icon",r[0]==="list")},i:B,o:B,d(r){r&&D(e)}}}function On(i,e,t){let{displayIn:n}=e;return i.$$set=r=>{"displayIn"in r&&t(0,n=r.displayIn)},[n]}class An extends Se{constructor(e){super(),Le(this,e,On,In,we,{displayIn:0})}}function Wn(i){let e,t;return{c(){e=fe("svg"),t=fe("path"),p(t,"d","M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"),p(e,"viewBox","0 0 60.006 21.412"),p(e,"width","14"),p(e,"height","20"),p(e,"class","svelte-en2qvf")},m(n,r){U(n,e,r),T(e,t)},p:B,i:B,o:B,d(n){n&&D(e)}}}class zn extends Se{constructor(e){super(),Le(this,e,null,Wn,we,{})}}function Bn(i){let e,t,n;return{c(){e=fe("svg"),t=fe("circle"),n=fe("path"),p(t,"cx","4.789"),p(t,"cy","4.787"),p(t,"r","3.85"),p(t,"class","svelte-1aq105l"),p(n,"d","M12.063 12.063 7.635 7.635"),p(n,"class","svelte-1aq105l"),p(e,"xmlns","http://www.w3.org/2000/svg"),p(e,"width","13"),p(e,"height","13"),p(e,"viewBox","0 0 13 13"),p(e,"class","svelte-1aq105l")},m(r,o){U(r,e,o),T(e,t),T(e,n)},p:B,i:B,o:B,d(r){r&&D(e)}}}class Dn extends Se{constructor(e){super(),Le(this,e,null,Bn,we,{})}}function Un(i,e,t){const n=e[1],r=e[0],o=n-r;return i===n&&t?i:((i-r)%o+o)%o+r}function Ze(i){const e=[...i];return e[2]<e[0]&&(Math.abs((e[0]+e[2]+360)/2)>Math.abs((e[0]-360+e[2])/2)?e[0]-=360:e[2]+=360),e}let Qe;async function Fn(i,e,t){const n=i==null?void 0:i.getCenterAndZoom();for(const r of e??[])if(!(n&&(r.minZoom!=null&&r.minZoom>n[0]||r.maxZoom!=null&&r.maxZoom<n[0]))){if(r.type==="fixed")return r.coordinates.join(",");e:if(r.type==="client-geolocation"){if(Qe&&r.cachedLocationExpiry&&Qe.time+r.cachedLocationExpiry>Date.now()){if(!Qe.coords)break e;return Qe.coords}let o;try{return o=await new Promise((u,s)=>{t.signal.addEventListener("abort",()=>{s(Error("aborted"))}),navigator.geolocation.getCurrentPosition(c=>{u([c.coords.longitude,c.coords.latitude].map(l=>l.toFixed(6)).join(","))},c=>{s(c)},r)}),o}catch{}finally{r.cachedLocationExpiry&&(Qe={time:Date.now(),coords:o})}if(t.signal.aborted)return}if(r.type==="server-geolocation")return"ip";if(n&&r.type==="map-center")return n[1].toFixed(6)+","+n[2].toFixed(6)}}const Gn=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(EAST|WEST|[EW])?$/i,si=/^([+-]?[0-8]?[0-9])\s+([0-5]?[0-9]\.\d{3,})[\s,]{1,}([+-]?[0-1]?[0-9]?[0-9])\s+([0-5]?[0-9]\.\d{3,})$/,li=/^(NORTH|SOUTH|[NS])?[\s]*([+-]?[0-8]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(NORTH|SOUTH|[NS])?[\s]*[,/;]?[\s]*(EAST|WEST|[EW])?[\s]*([+-]?[0-1]?[0-9]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(EAST|WEST|[EW])?$/i,ui=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(EAST|WEST|[EW])?$/i,ai=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)\s*(EAST|WEST|[EW])?$/i,ci=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|’’|´´|["″”\.])?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|´´|’’|["″”\.])?\s*(EAST|WEST|[EW])?$/i;function jn(i){if(!["DMS","DM","DD"].includes(i))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){const e=this.decimalCoordinates.split(",").map(h=>Number(h.trim())),t=Number(e[0]),n=Number(e[1]),r=Math.abs(t),o=Math.abs(n),u=t>0?"N":"S",s=n>0?"E":"W";let c;i=="DD"&&(c=`${r}° ${u}, ${o}° ${s}`);const l=Math.floor(r),d=Math.floor(o),a=(r-l)*60,f=(o-d)*60;if(i=="DM"){let h=fi(a,3).toFixed(3).padStart(6,"0"),g=fi(f,3).toFixed(3).padStart(6,"0");h.endsWith(".000")&&g.endsWith(".000")&&(h=h.replace(/\.000$/,""),g=g.replace(/\.000$/,"")),c=`${l}° ${h}' ${u}, ${d}° ${g}' ${s}`}if(i=="DMS"){const h=Math.floor(a),g=Math.floor(f);let y=((a-h)*60).toFixed(1).padStart(4,"0"),v=((f-g)*60).toFixed(1).padStart(4,"0");const b=h.toString().padStart(2,"0"),E=g.toString().padStart(2,"0");y.endsWith(".0")&&v.endsWith(".0")&&(y=y.replace(/\.0$/,""),v=v.replace(/\.0$/,"")),c=`${l}° ${b}' ${y}" ${u}, ${d}° ${E}' ${v}" ${s}`}return c}else throw new Error("no decimal coordinates to convert")}function fi(i,e){const t=Math.pow(10,e);return Math.round((i+Number.EPSILON)*t)/t}function wt(i,e){e||(e=5),i=i.replace(/\s+/g," ").trim();let t=null,n=null,r="",o="",u=null,s=[],c=!1;if(Gn.test(i))throw new Error("invalid coordinate value");if(si.test(i))if(s=si.exec(i),c=He(s),c)t=Math.abs(s[1])+s[2]/60,Number(s[1])<0&&(t*=-1),n=Math.abs(s[3])+s[4]/60,Number(s[3])<0&&(n*=-1),u="DM";else throw new Error("invalid coordinate format");else if(li.test(i))if(s=li.exec(i),c=He(s),c){if(t=s[2],n=s[6],t.includes(",")&&(t=t.replace(",",".")),n.includes(",")&&(n=n.replace(",",".")),u="DD",Number(Math.round(t))==Number(t))throw new Error("integer only coordinate provided");if(Number(Math.round(n))==Number(n))throw new Error("integer only coordinate provided");s[1]?(r=s[1],o=s[5]):s[4]&&(r=s[4],o=s[8])}else throw new Error("invalid decimal coordinate format");else if(ui.test(i))if(s=ui.exec(i),c=He(s),c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,u="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,u="DMS"),parseInt(s[2])<0&&(t=-1*t),n=Math.abs(parseInt(s[9])),s[11]&&(n+=s[11]/60),s[13]&&(n+=s[13].replace(",",".")/3600),parseInt(s[9])<0&&(n=-1*n),s[1]?(r=s[1],o=s[8]):s[7]&&(r=s[7],o=s[14]);else throw new Error("invalid DMS coordinates format");else if(ai.test(i))if(s=ai.exec(i),c=He(s),c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,u="DM"),s[6]&&(t+=s[6]/3600,u="DMS"),parseInt(s[2])<0&&(t=-1*t),n=Math.abs(parseInt(s[10])),s[12]&&(n+=s[12]/60),s[14]&&(n+=s[14]/3600),parseInt(s[10])<0&&(n=-1*n),s[1]?(r=s[1],o=s[9]):s[8]&&(r=s[8],o=s[16]);else throw new Error("invalid DMS coordinates format");else if(ci.test(i)){if(s=ci.exec(i),c=He(s),s.filter(l=>l).length<=5)throw new Error("invalid coordinates format");if(c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4].replace(",",".")/60,u="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,u="DMS"),parseInt(s[2])<0&&(t=-1*t),n=Math.abs(parseInt(s[10])),s[12]&&(n+=s[12].replace(",",".")/60),s[14]&&(n+=s[14].replace(",",".")/3600),parseInt(s[10])<0&&(n=-1*n),s[1]?(r=s[1],o=s[9]):s[8]&&(r=s[8],o=s[16]);else throw new Error("invalid coordinates format")}if(c){if(Math.abs(n)>=180)throw new Error("invalid longitude value");if(Math.abs(t)>=90)throw new Error("invalid latitude value");if(r&&!o||!r&&o)throw new Error("invalid coordinates value");if(r&&r==o)throw new Error("invalid coordinates format");t.toString().includes(",")&&(t=t.replace(",",".")),n.toString().includes(",")&&(n=n.replace(",","."));let l=/S|SOUTH/i;l.test(r)&&t>0&&(t=-1*t),l=/W|WEST/i,l.test(o)&&n>0&&(n=-1*n);const d=s[0].trim();let a,f;const h=/[,/;\u0020]/g,g=d.match(h);if(g==null){const b=Math.floor(i.length/2);a=d.substring(0,b).trim(),f=d.substring(b).trim()}else{let b;g.length%2==1?b=Math.floor(g.length/2):b=g.length/2-1;let E=0;if(b==0)E=d.indexOf(g[0]),a=d.substring(0,E).trim(),f=d.substring(E+1).trim();else{let L=0,_=0;for(;L<=b;)E=d.indexOf(g[L],_),_=E+1,L++;a=d.substring(0,E).trim(),f=d.substring(E+1).trim()}}const y=a.split(".");if(y.length==2&&y[1]==0&&y[1].length!=2)throw new Error("invalid coordinates format");const v=f.split(".");if(v.length==2&&v[1]==0&&v[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(a)||/^\d+$/.test(f))throw new Error("degree only coordinate/s provided");return t=Number(Number(t).toFixed(e)),n=Number(Number(n).toFixed(e)),Object.freeze({verbatimCoordinates:d,verbatimLatitude:a,verbatimLongitude:f,decimalLatitude:t,decimalLongitude:n,decimalCoordinates:`${t},${n}`,originalFormat:u,closeEnough:qn,toCoordinateFormat:jn})}else throw new Error("coordinates pattern match failed")}function He(i){if(!isNaN(i[0]))return!1;const e=[...i];if(e.shift(),e.length%2>0)return!1;const t=/^[-+]?\d+([\.,]\d+)?$/,n=/[eastsouthnorthwest]+/i,r=e.length/2;for(let o=0;o<r;o++){const u=e[o],s=e[o+r],c=t.test(u)&&t.test(s),l=n.test(u)&&n.test(s),d=u==s;if(!(u==null&&s==null)){if(u==null||s==null)return!1;if(c||l||d)continue;return!1}}return!0}function di(i,e){const t=Math.abs(i-e);return Number(t.toFixed(6))<=1e-5}function qn(i){if(!i)throw new Error("coords must be provided");if(i.includes(",")){const e=i.split(",");if(Number(e[0])==NaN||Number(e[1])==NaN)throw new Error("coords are not valid decimals");return di(this.decimalLatitude,Number(e[0]))&&di(this.decimalLongitude,e[1])}else throw new Error("coords being tested must be separated by a comma")}const Zn=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});wt.to=Zn;const Qn=[{verbatimCoordinates:"40.123, -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:'40° 7´ 22.8" N 74° 7´ 22.8" W',verbatimLatitude:'40° 7´ 22.8" N',verbatimLongitude:'74° 7´ 22.8" W'},{verbatimCoordinates:"40° 7.38’ , -74° 7.38’",verbatimLatitude:"40° 7.38’",verbatimLongitude:"-74° 7.38’"},{verbatimCoordinates:"N40°7’22.8’’, W74°7’22.8’’",verbatimLatitude:"N40°7’22.8’’",verbatimLongitude:"W74°7’22.8’’"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:`40°7'22.8"N, 74°7'22.8"W`,verbatimLatitude:`40°7'22.8"N`,verbatimLongitude:`74°7'22.8"W`},{verbatimCoordinates:"40 7 22.8, -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"},{verbatimCoordinates:"40.123 -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123°,-74.123°",verbatimLatitude:"40.123°",verbatimLongitude:"-74.123°"},{verbatimCoordinates:"40.123N74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"4007.38N7407.38W",verbatimLatitude:"4007.38N",verbatimLongitude:"7407.38W"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:"400722.8N740722.8W",verbatimLatitude:"400722.8N",verbatimLongitude:"740722.8W"},{verbatimCoordinates:"N 40 7.38 W 74 7.38",verbatimLatitude:"N 40 7.38",verbatimLongitude:"W 74 7.38"},{verbatimCoordinates:"40:7:22.8N 74:7:22.8W",verbatimLatitude:"40:7:22.8N",verbatimLongitude:"74:7:22.8W"},{verbatimCoordinates:"40:7:23N,74:7:23W",verbatimLatitude:"40:7:23N",verbatimLongitude:"74:7:23W",decimalLatitude:40.1230555555,decimalLongitude:-74.1230555555},{verbatimCoordinates:'40°7’23"N 74°7’23"W',verbatimLatitude:'40°7’23"N',verbatimLongitude:'74°7’23"W',decimalLatitude:40.1230555555,decimalLongitude:-74.12305555555555},{verbatimCoordinates:'40°7’23"S 74°7’23"E',verbatimLatitude:'40°7’23"S',verbatimLongitude:'74°7’23"E',decimalLatitude:-40.1230555555,decimalLongitude:74.12305555555555},{verbatimCoordinates:'40°7’23" -74°7’23"',verbatimLatitude:'40°7’23"',verbatimLongitude:'-74°7’23"',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:'40d 7’ 23" N 74d 7’ 23" W',verbatimLatitude:'40d 7’ 23" N',verbatimLongitude:'74d 7’ 23" W',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:"40.123N 74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40 7 22.8; -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"}],Hn={decimalLatitude:40.123,decimalLongitude:-74.123},Vn=[{verbatimCoordinates:`50°4'17.698"south, 14°24'2.826"east`,verbatimLatitude:`50°4'17.698"south`,verbatimLongitude:`14°24'2.826"east`,decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"50d4m17.698S 14d24m2.826E",verbatimLatitude:"50d4m17.698S",verbatimLongitude:"14d24m2.826E",decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"40:26:46N,79:56:55W",verbatimLatitude:"40:26:46N",verbatimLongitude:"79:56:55W",decimalLatitude:40.44611111111111,decimalLongitude:-79.9486111111111},{verbatimCoordinates:"40:26:46.302N 79:56:55.903W",verbatimLatitude:"40:26:46.302N",verbatimLongitude:"79:56:55.903W",decimalLatitude:40.446195,decimalLongitude:-79.94886194444445},{verbatimCoordinates:"40°26′47″N 79°58′36″W",verbatimLatitude:"40°26′47″N",verbatimLongitude:"79°58′36″W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40d 26′ 47″ N 79d 58′ 36″ W",verbatimLatitude:"40d 26′ 47″ N",verbatimLongitude:"79d 58′ 36″ W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40.446195N 79.948862W",verbatimLatitude:"40.446195N",verbatimLongitude:"79.948862W",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40,446195° 79,948862°",verbatimLatitude:"40,446195°",verbatimLongitude:"79,948862°",decimalLatitude:40.446195,decimalLongitude:79.948862},{verbatimCoordinates:"40° 26.7717, -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.446195, -79.948862",verbatimLatitude:"40.446195",verbatimLongitude:"-79.948862",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.123256; -74.123256",verbatimLatitude:"40.123256",verbatimLongitude:"-74.123256",decimalLatitude:40.123256,decimalLongitude:-74.123256},{verbatimCoordinates:"18°24S 22°45E",verbatimLatitude:"18°24S",verbatimLongitude:"22°45E",decimalLatitude:-18.4,decimalLongitude:22.75}],Yn=[{verbatimCoordinates:"10.432342S 10.6345345E",verbatimLatitude:"10.432342S",verbatimLongitude:"10.6345345E",decimalLatitude:-10.432342,decimalLongitude:10.6345345},{verbatimCoordinates:"10.00S 10.00E",verbatimLatitude:"10.00S",verbatimLongitude:"10.00E",decimalLatitude:-10,decimalLongitude:10},{verbatimCoordinates:"00.00S 01.00E",verbatimLatitude:"00.00S",verbatimLongitude:"01.00E",decimalLatitude:0,decimalLongitude:1},{verbatimCoordinates:"18.24S 22.45E",verbatimLatitude:"18.24S",verbatimLongitude:"22.45E",decimalLatitude:-18.4,decimalLongitude:22.75},{verbatimCoordinates:"27deg 15min 45.2sec S 18deg 32min 53.7sec E",verbatimLatitude:"27deg 15min 45.2sec S",verbatimLongitude:"18deg 32min 53.7sec E",decimalLatitude:-27.262555555555554,decimalLongitude:18.54825},{verbatimCoordinates:"-23.3245° S / 28.2344° E",verbatimLatitude:"-23.3245° S",verbatimLongitude:"28.2344° E",decimalLatitude:-23.3245,decimalLongitude:28.2344},{verbatimCoordinates:"40° 26.7717 -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"27.15.45S 18.32.53E",verbatimLatitude:"27.15.45S",verbatimLongitude:"18.32.53E",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"-27.15.45 18.32.53",verbatimLatitude:"-27.15.45",verbatimLongitude:"18.32.53",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"27.15.45.2S 18.32.53.4E",verbatimLatitude:"27.15.45.2S",verbatimLongitude:"18.32.53.4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"27.15.45,2S 18.32.53,4E",verbatimLatitude:"27.15.45,2S",verbatimLongitude:"18.32.53,4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"S23.43563 ° E22.45634 °",verbatimLatitude:"S23.43563 °",verbatimLongitude:"E22.45634 °",decimalLatitude:-23.43563,decimalLongitude:22.45634},{verbatimCoordinates:"27,71372° S 23,07771° E",verbatimLatitude:"27,71372° S",verbatimLongitude:"23,07771° E",decimalLatitude:-27.71372,decimalLongitude:23.07771},{verbatimCoordinates:"27.45.34 S 23.23.23 E",verbatimLatitude:"27.45.34 S",verbatimLongitude:"23.23.23 E",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"S 27.45.34 E 23.23.23",verbatimLatitude:"S 27.45.34",verbatimLongitude:"E 23.23.23",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"53 16.3863,4 52.8171",verbatimLatitude:"53 16.3863",verbatimLongitude:"4 52.8171",decimalLatitude:53.273105,decimalLongitude:4.88029},{verbatimCoordinates:"50 8.2914,-5 2.4447",verbatimLatitude:"50 8.2914",verbatimLongitude:"-5 2.4447",decimalLatitude:50.13819,decimalLongitude:-5.040745},{verbatimCoordinates:"N 48° 30,6410', E 18° 57,4583'",verbatimLatitude:"N 48° 30,6410'",verbatimLongitude:"E 18° 57,4583'",decimalLatitude:48.51068,decimalLongitude:18.95764},{verbatimCoordinates:"1.23456, 18.33453",verbatimLatitude:"1.23456",verbatimLongitude:"18.33453",decimalLatitude:1.23456,decimalLongitude:18.33453}];function Xn(){const i=[];return Qn.forEach(e=>{e.decimalLatitude?i.push(e):i.push({...e,...Hn})}),[...i,...Vn,...Yn]}const Kn=Xn();wt.formats=Kn.map(i=>i.verbatimCoordinates);const Jn=wt;function hi(i,e,t){const n=i.slice();return n[86]=e[t],n[88]=t,n}function mi(i){let e,t;return e=new Rn({}),{c(){Ee(e.$$.fragment)},m(n,r){pe(e,n,r),t=!0},i(n){t||(Q(e.$$.fragment,n),t=!0)},o(n){Y(e.$$.fragment,n),t=!1},d(n){be(e,n)}}}function gi(i){let e,t,n,r,o;return t=new zn({}),{c(){e=W("button"),Ee(t.$$.fragment),p(e,"type","button"),p(e,"title",i[9]),p(e,"class","svelte-bz0zu3"),se(e,"active",i[0])},m(u,s){U(u,e,s),pe(t,e,null),n=!0,r||(o=ee(e,"click",i[70]),r=!0)},p(u,s){(!n||s[0]&512)&&p(e,"title",u[9]),(!n||s[0]&1)&&se(e,"active",u[0])},i(u){n||(Q(t.$$.fragment,u),n=!0)},o(u){Y(t.$$.fragment,u),n=!1},d(u){u&&D(e),be(t),r=!1,o()}}}function $n(i){let e,t=[],n=new Map,r,o,u,s=ii(i[14]);const c=l=>l[86].id+(l[86].address?","+l[86].address:"");for(let l=0;l<s.length;l+=1){let d=hi(i,s,l),a=c(d);n.set(a,t[l]=yi(a,d))}return{c(){e=W("ul");for(let l=0;l<t.length;l+=1)t[l].c();p(e,"class","options svelte-bz0zu3")},m(l,d){U(l,e,d);for(let a=0;a<t.length;a+=1)t[a]&&t[a].m(e,null);r=!0,o||(u=[ee(e,"mouseleave",i[74]),ee(e,"blur",i[75])],o=!0)},p(l,d){d[0]&17880064&&(s=ii(l[14]),nt(),t=gn(t,d,c,1,l,s,n,e,mn,yi,null,hi),rt())},i(l){if(!r){for(let d=0;d<s.length;d+=1)Q(t[d]);r=!0}},o(l){for(let d=0;d<t.length;d+=1)Y(t[d]);r=!1},d(l){l&&D(e);for(let d=0;d<t.length;d+=1)t[d].d();o=!1,ye(u)}}}function er(i){let e,t,n,r,o,u;return t=new ri({}),{c(){e=W("div"),Ee(t.$$.fragment),n=ne(),r=W("div"),o=_e(i[7]),p(r,"class","svelte-bz0zu3"),p(e,"class","no-results svelte-bz0zu3")},m(s,c){U(s,e,c),pe(t,e,null),T(e,n),T(e,r),T(r,o),u=!0},p(s,c){(!u||c[0]&128)&&Ge(o,s[7])},i(s){u||(Q(t.$$.fragment,s),u=!0)},o(s){Y(t.$$.fragment,s),u=!1},d(s){s&&D(e),be(t)}}}function tr(i){let e="",t;return{c(){t=_e(e)},m(n,r){U(n,t,r)},p:B,i:B,o:B,d(n){n&&D(t)}}}function ir(i){let e,t,n,r,o,u,s,c,l,d,a;return t=new ri({}),c=new ni({}),{c(){e=W("div"),Ee(t.$$.fragment),n=ne(),r=W("div"),o=_e(i[6]),u=ne(),s=W("button"),Ee(c.$$.fragment),p(r,"class","svelte-bz0zu3"),p(s,"class","svelte-bz0zu3"),p(e,"class","error svelte-bz0zu3")},m(f,h){U(f,e,h),pe(t,e,null),T(e,n),T(e,r),T(r,o),T(e,u),T(e,s),pe(c,s,null),l=!0,d||(a=ee(s,"click",i[71]),d=!0)},p(f,h){(!l||h[0]&64)&&Ge(o,f[6])},i(f){l||(Q(t.$$.fragment,f),Q(c.$$.fragment,f),l=!0)},o(f){Y(t.$$.fragment,f),Y(c.$$.fragment,f),l=!1},d(f){f&&D(e),be(t),be(c),d=!1,a()}}}function yi(i,e){let t,n,r;function o(){return e[72](e[88])}function u(){return e[73](e[86])}return n=new Tn({props:{feature:e[86],showPlaceType:e[10],selected:e[15]===e[88],missingIconsCache:e[20],iconsBaseUrl:e[12]}}),n.$on("mouseenter",o),n.$on("focus",u),{key:i,first:null,c(){t=rn(),Ee(n.$$.fragment),this.first=t},m(s,c){U(s,t,c),pe(n,s,c),r=!0},p(s,c){e=s;const l={};c[0]&16384&&(l.feature=e[86]),c[0]&1024&&(l.showPlaceType=e[10]),c[0]&49152&&(l.selected=e[15]===e[88]),c[0]&4096&&(l.iconsBaseUrl=e[12]),n.$set(l)},i(s){r||(Q(n.$$.fragment,s),r=!0)},o(s){Y(n.$$.fragment,s),r=!1},d(s){s&&D(t),be(n,s)}}}function nr(i){let e,t,n,r,o,u,s,c,l,d,a,f,h,g,y,v,b,E,L,_,C,x=!1;o=new Dn({}),a=new ni({});let S=i[19]&&mi(),w=i[5]===!0&&gi(i);const k=i[62].default,I=$i(k,i,i[61],null),F=[ir,tr,er,$n],j=[];function O(M,q){var re,Ne;return M[18]?0:M[16]?((re=M[14])==null?void 0:re.length)===0?2:M[16]&&((Ne=M[14])!=null&&Ne.length)?3:-1:1}return~(v=O(i))&&(b=j[v]=F[v](i)),{c(){e=ne(),t=W("form"),n=W("div"),r=W("button"),Ee(o.$$.fragment),u=ne(),s=W("input"),c=ne(),l=W("div"),d=W("button"),Ee(a.$$.fragment),f=ne(),S&&S.c(),h=ne(),w&&w.c(),g=ne(),I&&I.c(),y=ne(),b&&b.c(),p(r,"class","search-button svelte-bz0zu3"),p(r,"type","button"),p(s,"placeholder",i[8]),p(s,"aria-label",i[8]),p(s,"class","svelte-bz0zu3"),p(d,"type","button"),p(d,"title",i[3]),p(d,"class","svelte-bz0zu3"),p(l,"class","clear-button-container svelte-bz0zu3"),se(l,"displayable",i[1]!==""),p(n,"class","input-group svelte-bz0zu3"),p(t,"tabindex","0"),p(t,"class",E=Xt(i[2])+" svelte-bz0zu3"),se(t,"can-collapse",i[4]&&i[1]==="")},m(M,q){U(M,e,q),U(M,t,q),T(t,n),T(n,r),pe(o,r,null),T(n,u),T(n,s),i[64](s),Kt(s,i[1]),T(n,c),T(n,l),T(l,d),pe(a,d,null),T(l,f),S&&S.m(l,null),T(n,h),w&&w.m(n,null),T(n,g),I&&I.m(n,null),T(t,y),~v&&j[v].m(t,null),L=!0,_||(C=[ee(r,"click",i[63]),ee(s,"input",i[65]),ee(s,"focus",i[66]),ee(s,"blur",i[67]),ee(s,"keydown",i[22]),ee(s,"input",i[68]),ee(d,"click",i[69]),ee(t,"submit",on(i[21]))],_=!0)},p(M,q){(!L||q[0]&256)&&p(s,"placeholder",M[8]),(!L||q[0]&256)&&p(s,"aria-label",M[8]),q[0]&2&&s.value!==M[1]&&Kt(s,M[1]),(!L||q[0]&8)&&p(d,"title",M[3]),M[19]?S?q[0]&524288&&Q(S,1):(S=mi(),S.c(),Q(S,1),S.m(l,null)):S&&(nt(),Y(S,1,1,()=>{S=null}),rt()),(!L||q[0]&2)&&se(l,"displayable",M[1]!==""),M[5]===!0?w?(w.p(M,q),q[0]&32&&Q(w,1)):(w=gi(M),w.c(),Q(w,1),w.m(n,g)):w&&(nt(),Y(w,1,1,()=>{w=null}),rt()),I&&I.p&&(!L||q[1]&1073741824)&&tn(I,k,M,M[61],L?en(k,M[61],q,null):nn(M[61]),null);let re=v;v=O(M),v===re?~v&&j[v].p(M,q):(b&&(nt(),Y(j[re],1,1,()=>{j[re]=null}),rt()),~v?(b=j[v],b?b.p(M,q):(b=j[v]=F[v](M),b.c()),Q(b,1),b.m(t,null)):b=null),(!L||q[0]&4&&E!==(E=Xt(M[2])+" svelte-bz0zu3"))&&p(t,"class",E),(!L||q[0]&22)&&se(t,"can-collapse",M[4]&&M[1]==="")},i(M){L||(Q(x),Q(o.$$.fragment,M),Q(a.$$.fragment,M),Q(S),Q(w),Q(I,M),Q(b),L=!0)},o(M){Y(x),Y(o.$$.fragment,M),Y(a.$$.fragment,M),Y(S),Y(w),Y(I,M),Y(b),L=!1},d(M){M&&(D(e),D(t)),be(o),i[64](null),be(a),S&&S.d(),w&&w.d(),I&&I.d(M),~v&&j[v].d(),_=!1,ye(C)}}}function rr(i,e,t){let n,{$$slots:r={},$$scope:o}=e;const u={continental_marine:4,country:4,major_landform:8,region:5,subregion:6,county:7,joint_municipality:8,joint_submunicipality:9,municipality:10,municipal_district:11,locality:12,neighbourhood:13,place:14,postal_code:14,road:16,poi:17,address:18,"poi.peak":15,"poi.shop":18,"poi.cafe":18,"poi.restaurant":18,"poi.aerodrome":13};let{class:s=void 0}=e,{apiKey:c}=e,{bbox:l=void 0}=e,{clearButtonTitle:d="clear"}=e,{clearOnBlur:a=!1}=e,{collapsed:f=!1}=e,{country:h=void 0}=e,{debounceSearch:g=200}=e,{enableReverse:y=!1}=e,{errorMessage:v="Something went wrong…"}=e,{filter:b=()=>!0}=e,{flyTo:E=!0}=e,{fuzzyMatch:L=!0}=e,{language:_=void 0}=e,{limit:C=void 0}=e,{mapController:x=void 0}=e,{minLength:S=2}=e,{noResultsMessage:w="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=e,{placeholder:k="Search"}=e,{proximity:I=[{type:"server-geolocation"}]}=e,{reverseActive:F=y==="always"}=e,{reverseButtonTitle:j="toggle reverse geocoding"}=e,{searchValue:O=""}=e,{pickedResultStyle:M="full-geometry"}=e,{showPlaceType:q="if-needed"}=e,{showResultsWhileTyping:re=!0}=e,{autocompleteTimeout:Ne=void 0}=e,{selectFirst:Ue=!0}=e,{flyToSelected:It=!1}=e,{markerOnSelected:ut=!0}=e,{types:Oe=void 0}=e,{exhaustiveReverseGeocoding:Ot=!1}=e,{excludeTypes:at=!1}=e,{zoom:ct=u}=e,{apiUrl:At="https://api.maptiler.com/geocoding"}=e,{fetchParameters:Wt={}}=e,{iconsBaseUrl:Zi="https://cdn.maptiler.com/maptiler-geocoding-control/v2.0.0-rc.2/icons/"}=e,{adjustUrlQuery:zt=()=>{}}=e;function Fr(){me.focus()}function Gr(){me.blur()}function Qi(m,Z=!0,V=!1){t(1,O=m),Z?(t(15,G=-1),Vi()):(Ut(!V,V),setTimeout(()=>{me.focus(),me.select()}))}function jr(){t(14,R=void 0),t(57,N=void 0),t(15,G=-1)}function qr(){t(56,H=[]),t(57,N=void 0)}let Fe=!1,R,H,N,Hi="",me,G=-1,ge,ft=[],Ae,Te,ae,dt,Bt;const Zr=new Set,Pe=an();function Qr(){return!!ae}un(()=>{x&&(x.setEventHandler(void 0),x.indicateReverse(!1),x.setSelectedMarker(-1),x.setMarkers(void 0,void 0))});function Vi(m){if(Te&&(window.clearTimeout(Te),Te=void 0),ae){window.clearTimeout(ae),t(58,ae=void 0),$e(O,{exact:!0});return}if(G>-1&&R)t(57,N=R[G]),t(1,O=N.place_type[0]==="reverse"?N.place_name:N.place_name.replace(/,.*/,"")),t(18,ge=void 0),t(56,H=void 0),t(15,G=-1);else if(O){const Z=m||!Dt(O);$e(O,{exact:!0}).then(()=>{t(56,H=R),t(57,N=void 0),Z&&Hr()}).catch(V=>t(18,ge=V))}}function Dt(m){try{return Jn(m,6)}catch{return!1}}async function $e(m,{byId:Z=!1,exact:V=!1,appendSpace:ce=!1}={}){t(18,ge=void 0),Ae==null||Ae.abort();const oe=new AbortController;t(19,Ae=oe);try{const P=Dt(m),X=new URLSearchParams;if(_!==void 0&&X.set("language",Array.isArray(_)?_.join(","):_??""),Oe&&X.set("types",Oe.join(",")),at&&X.set("excludeTypes",String(at)),l&&X.set("bbox",l.map(mt=>mt.toFixed(6)).join(",")),h&&X.set("country",Array.isArray(h)?h.join(","):h),!Z&&!P){const mt=await Fn(x,I,oe);mt&&X.set("proximity",mt),(V||!re)&&X.set("autocomplete","false"),X.set("fuzzyMatch",String(L))}C!==void 0&&(Ot||!P||(Oe==null?void 0:Oe.length)===1)&&X.set("limit",String(C)),X.set("key",c),zt(X);const ht=At+"/"+encodeURIComponent(P?P.decimalLongitude+","+P.decimalLatitude:m+(ce?" ":""))+".json?"+X.toString();if(ht===Hi){Z?(t(14,R=void 0),t(57,N=ft[0])):t(14,R=ft);return}Hi=ht;const Gt=await fetch(ht,{signal:oe.signal,...Wt});if(!Gt.ok)throw new Error(await Gt.text());const jt=await Gt.json();Pe("response",{url:ht,featureCollection:jt}),Z?(t(14,R=void 0),t(57,N=jt.features[0]),ft=[N]):(t(14,R=jt.features.filter(b)),P&&R.unshift({type:"Feature",properties:{},id:"reverse_"+P.decimalLongitude+"_"+P.decimalLatitude,text:P.decimalLatitude+", "+P.decimalLongitude,place_name:P.decimalLatitude+", "+P.decimalLongitude,place_type:["reverse"],center:[P.decimalLongitude,P.decimalLatitude],bbox:[P.decimalLongitude,P.decimalLatitude,P.decimalLongitude,P.decimalLatitude],geometry:{type:"Point",coordinates:[P.decimalLongitude,P.decimalLatitude]}}),ft=R,P&&me.focus())}catch(P){if(P&&typeof P=="object"&&"name"in P&&P.name==="AbortError")return;throw P}finally{oe===Ae&&t(19,Ae=void 0)}}function Hr(){var ce;if(!(H!=null&&H.length)||!E)return;const m=[180,90,-180,-90],Z=!H.some(oe=>!oe.matching_text);let V;for(const oe of H){const P=et(oe);if(V=V===void 0?P:P===void 0?V:Math.max(V,P),Z||!oe.matching_text)for(const X of[0,1,2,3])m[X]=Math[X<2?"min":"max"](m[X],((ce=oe.bbox)==null?void 0:ce[X])??oe.center[X%2])}x&&H.length>0&&(N&&m[0]===m[2]&&m[1]===m[3]?x.flyTo(N.center,et(N)):x.fitBounds(Ze(m),50,V))}function et(m){var V;if(!m.bbox||m.bbox[0]!==m.bbox[2]&&m.bbox[1]!==m.bbox[3])return;const Z=m.id.replace(/\..*/,"");return(Array.isArray((V=m.properties)==null?void 0:V.categories)?m.properties.categories.reduce((ce,oe)=>{const P=ct[Z+"."+oe];return ce===void 0?P:P===void 0?ce:Math.max(ce,P)},void 0):void 0)??ct[Z]}function Vr(m){t(0,F=y==="always"),t(14,R=void 0),t(57,N=void 0),t(15,G=-1),Qi(m[1].toFixed(6)+", "+Un(m[0],[-180,180],!0).toFixed(6),!1,!0)}function Yr(m){if(!R)return;let Z=m.key==="ArrowDown"?1:m.key==="ArrowUp"?-1:0;Z&&(G===(Ue?0:-1)&&Z===-1&&t(15,G=R.length),t(15,G+=Z),G>=R.length&&t(15,G=-1),G<0&&Ue&&t(15,G=0),m.preventDefault())}function Ut(m=!0,Z=!1){if(t(18,ge=void 0),Te&&(window.clearTimeout(Te),Te=void 0),ae&&(window.clearTimeout(ae),t(58,ae=void 0)),!re&&!Z||O.length<S){t(14,R=void 0);return}const V=O;Te=window.setTimeout(()=>{Te=void 0,$e(V).catch(ce=>t(18,ge=ce))},m?g:0),O.endsWith(" ")||t(58,ae=window.setTimeout(()=>{t(58,ae=void 0),$e(V,{appendSpace:!0}).catch(ce=>t(18,ge=ce))},Ne))}function Ft(m){t(57,N=m),t(1,O=m.place_name),t(15,G=-1)}const Xr=()=>me.focus();function Kr(m){yt[m?"unshift":"push"](()=>{me=m,t(17,me)})}function Jr(){O=this.value,t(1,O),t(13,Fe),t(28,a)}const $r=()=>t(13,Fe=!0),eo=()=>t(13,Fe=!1),to=()=>Ut(),io=()=>{t(1,O=""),me.focus()},no=()=>t(0,F=!F),ro=()=>t(18,ge=void 0),oo=m=>t(15,G=m),so=m=>Ft(m),lo=()=>{Ue||t(15,G=-1)},uo=()=>{};return i.$$set=m=>{"class"in m&&t(2,s=m.class),"apiKey"in m&&t(26,c=m.apiKey),"bbox"in m&&t(27,l=m.bbox),"clearButtonTitle"in m&&t(3,d=m.clearButtonTitle),"clearOnBlur"in m&&t(28,a=m.clearOnBlur),"collapsed"in m&&t(4,f=m.collapsed),"country"in m&&t(29,h=m.country),"debounceSearch"in m&&t(30,g=m.debounceSearch),"enableReverse"in m&&t(5,y=m.enableReverse),"errorMessage"in m&&t(6,v=m.errorMessage),"filter"in m&&t(31,b=m.filter),"flyTo"in m&&t(32,E=m.flyTo),"fuzzyMatch"in m&&t(33,L=m.fuzzyMatch),"language"in m&&t(34,_=m.language),"limit"in m&&t(35,C=m.limit),"mapController"in m&&t(36,x=m.mapController),"minLength"in m&&t(37,S=m.minLength),"noResultsMessage"in m&&t(7,w=m.noResultsMessage),"placeholder"in m&&t(8,k=m.placeholder),"proximity"in m&&t(38,I=m.proximity),"reverseActive"in m&&t(0,F=m.reverseActive),"reverseButtonTitle"in m&&t(9,j=m.reverseButtonTitle),"searchValue"in m&&t(1,O=m.searchValue),"pickedResultStyle"in m&&t(39,M=m.pickedResultStyle),"showPlaceType"in m&&t(10,q=m.showPlaceType),"showResultsWhileTyping"in m&&t(40,re=m.showResultsWhileTyping),"autocompleteTimeout"in m&&t(41,Ne=m.autocompleteTimeout),"selectFirst"in m&&t(11,Ue=m.selectFirst),"flyToSelected"in m&&t(42,It=m.flyToSelected),"markerOnSelected"in m&&t(43,ut=m.markerOnSelected),"types"in m&&t(44,Oe=m.types),"exhaustiveReverseGeocoding"in m&&t(45,Ot=m.exhaustiveReverseGeocoding),"excludeTypes"in m&&t(46,at=m.excludeTypes),"zoom"in m&&t(47,ct=m.zoom),"apiUrl"in m&&t(48,At=m.apiUrl),"fetchParameters"in m&&t(49,Wt=m.fetchParameters),"iconsBaseUrl"in m&&t(12,Zi=m.iconsBaseUrl),"adjustUrlQuery"in m&&t(50,zt=m.adjustUrlQuery),"$$scope"in m&&t(61,o=m.$$scope)},i.$$.update=()=>{if(i.$$.dirty[0]&32&&t(0,F=y==="always"),i.$$.dirty[0]&268443648&&setTimeout(()=>{t(16,dt=Fe),a&&!Fe&&t(1,O="")}),i.$$.dirty[0]&16386|i.$$.dirty[1]&64&&O.length<S&&(t(57,N=void 0),t(14,R=void 0),t(18,ge=void 0),t(56,H=R)),i.$$.dirty[1]&67109120&&M!=="marker-only"&&N&&!N.address&&N.geometry.type==="Point"&&N.place_type[0]!=="reverse"&&$e(N.id,{byId:!0}).catch(m=>t(18,ge=m)),i.$$.dirty[1]&335544354&&(x&&N&&N.id!==Bt&&E&&(!N.bbox||N.bbox[0]===N.bbox[2]&&N.bbox[1]===N.bbox[3]?x.flyTo(N.center,et(N)):x.fitBounds(Ze(N.bbox),50,et(N)),t(14,R=void 0),t(56,H=void 0),t(15,G=-1)),t(59,Bt=N==null?void 0:N.id)),i.$$.dirty[0]&18432&&Ue&&R!=null&&R.length&&(Qr()||t(15,G=0)),i.$$.dirty[0]&2&&t(15,G=-1),i.$$.dirty[0]&16384|i.$$.dirty[1]&33554432&&H!==R&&t(56,H=void 0),i.$$.dirty[0]&81921|i.$$.dirty[1]&33554464&&x&&x.setEventHandler(m=>{switch(m.type){case"mapClick":F&&Vr(m.coordinates);break;case"markerClick":{const Z=R==null?void 0:R.find(V=>V.id===m.id);Z&&Ft(Z)}break;case"markerMouseEnter":H&&t(15,G=dt?(R==null?void 0:R.findIndex(Z=>Z.id===m.id))??-1:-1);break;case"markerMouseLeave":H&&t(15,G=-1);break}}),i.$$.dirty[0]&49152&&t(60,n=R==null?void 0:R[G]),i.$$.dirty[1]&536872994&&x&&n&&E&&It&&x.flyTo(n.center,et(n)),i.$$.dirty[1]&4128&&(ut||x==null||x.setMarkers(void 0,void 0)),i.$$.dirty[1]&570429472&&x&&ut&&!H&&(x.setMarkers(n?[n]:void 0,void 0),x.setSelectedMarker(n?0:-1)),i.$$.dirty[1]&100663328&&x&&x.setMarkers(H,N),i.$$.dirty[0]&32768|i.$$.dirty[1]&33554464&&H&&x&&x.setSelectedMarker(G),i.$$.dirty[1]&671088640&&n&&(window.clearTimeout(ae),t(58,ae=void 0)),i.$$.dirty[0]&2|i.$$.dirty[1]&32&&x){const m=Dt(O);x.setReverseMarker(m?[m.decimalLongitude,m.decimalLatitude]:void 0)}i.$$.dirty[1]&536870912&&Pe("select",{feature:n}),i.$$.dirty[1]&67108864&&Pe("pick",{feature:N}),i.$$.dirty[0]&81920&&Pe("optionsvisibilitychange",{optionsVisible:dt&&!!R}),i.$$.dirty[0]&16384&&Pe("featureslisted",{features:R}),i.$$.dirty[1]&33554432&&Pe("featuresmarked",{features:H}),i.$$.dirty[0]&1&&Pe("reversetoggle",{reverse:F}),i.$$.dirty[0]&2&&Pe("querychange",{query:O}),i.$$.dirty[0]&1|i.$$.dirty[1]&32&&x&&x.indicateReverse(F)},[F,O,s,d,f,y,v,w,k,j,q,Ue,Zi,Fe,R,G,dt,me,ge,Ae,Zr,Vi,Yr,Ut,Ft,u,c,l,a,h,g,b,E,L,_,C,x,S,I,M,re,Ne,It,ut,Oe,Ot,at,ct,At,Wt,zt,Fr,Gr,Qi,jr,qr,H,N,ae,Bt,n,o,r,Xr,Kr,Jr,$r,eo,to,io,no,ro,oo,so,lo,uo]}let or=class extends Se{constructor(e){super(),Le(this,e,rr,nr,we,{ZOOM_DEFAULTS:25,class:2,apiKey:26,bbox:27,clearButtonTitle:3,clearOnBlur:28,collapsed:4,country:29,debounceSearch:30,enableReverse:5,errorMessage:6,filter:31,flyTo:32,fuzzyMatch:33,language:34,limit:35,mapController:36,minLength:37,noResultsMessage:7,placeholder:8,proximity:38,reverseActive:0,reverseButtonTitle:9,searchValue:1,pickedResultStyle:39,showPlaceType:10,showResultsWhileTyping:40,autocompleteTimeout:41,selectFirst:11,flyToSelected:42,markerOnSelected:43,types:44,exhaustiveReverseGeocoding:45,excludeTypes:46,zoom:47,apiUrl:48,fetchParameters:49,iconsBaseUrl:12,adjustUrlQuery:50,focus:51,blur:52,setQuery:53,clearList:54,clearMap:55},null,[-1,-1,-1])}get ZOOM_DEFAULTS(){return this.$$.ctx[25]}get focus(){return this.$$.ctx[51]}get blur(){return this.$$.ctx[52]}get setQuery(){return this.$$.ctx[53]}get clearList(){return this.$$.ctx[54]}get clearMap(){return this.$$.ctx[55]}};function Ve(i,e,t={}){const n={type:"Feature"};return(t.id===0||t.id)&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.properties=e||{},n.geometry=i,n}function _t(i,e,t={}){for(const r of i){if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(r[r.length-1].length!==r[0].length)throw new Error("First and last Position are not equivalent.");for(let o=0;o<r[r.length-1].length;o++)if(r[r.length-1][o]!==r[0][o])throw new Error("First and last Position are not equivalent.")}return Ve({type:"Polygon",coordinates:i},e,t)}function Ye(i,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=i,t}function pi(i,e,t={}){return Ve({type:"MultiPolygon",coordinates:i},e,t)}function bi(i,e,t){if(i!==null)for(var n,r,o,u,s,c,l,d=0,a=0,f,h=i.type,g=h==="FeatureCollection",y=h==="Feature",v=g?i.features.length:1,b=0;b<v;b++){l=g?i.features[b].geometry:y?i.geometry:i,f=l?l.type==="GeometryCollection":!1,s=f?l.geometries.length:1;for(var E=0;E<s;E++){var L=0,_=0;if(u=f?l.geometries[E]:l,u!==null){c=u.coordinates;var C=u.type;switch(d=0,C){case null:break;case"Point":if(e(c,a,b,L,_)===!1)return!1;a++,L++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(e(c[n],a,b,L,_)===!1)return!1;a++,C==="MultiPoint"&&L++}C==="LineString"&&L++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(r=0;r<c[n].length-d;r++){if(e(c[n][r],a,b,L,_)===!1)return!1;a++}C==="MultiLineString"&&L++,C==="Polygon"&&_++}C==="Polygon"&&L++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(_=0,r=0;r<c[n].length;r++){for(o=0;o<c[n][r].length-d;o++){if(e(c[n][r][o],a,b,L,_)===!1)return!1;a++}_++}L++}break;case"GeometryCollection":for(n=0;n<u.geometries.length;n++)if(bi(u.geometries[n],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Et(i,e){var t,n,r,o,u,s,c,l,d,a,f=0,h=i.type==="FeatureCollection",g=i.type==="Feature",y=h?i.features.length:1;for(t=0;t<y;t++){for(s=h?i.features[t].geometry:g?i.geometry:i,l=h?i.features[t].properties:g?i.properties:{},d=h?i.features[t].bbox:g?i.bbox:void 0,a=h?i.features[t].id:g?i.id:void 0,c=s?s.type==="GeometryCollection":!1,u=c?s.geometries.length:1,r=0;r<u;r++){if(o=c?s.geometries[r]:s,o===null){if(e(null,f,l,d,a)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,f,l,d,a)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(e(o.geometries[n],f,l,d,a)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function sr(i,e){Et(i,function(t,n,r,o,u){var s=t===null?null:t.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return e(Ve(t,r,{bbox:o,id:u}),n,0)===!1?!1:void 0}var c;switch(s){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var l=0;l<t.coordinates.length;l++){var d=t.coordinates[l],a={type:c,coordinates:d};if(e(Ve(a,r),n,l)===!1)return!1}})}function lr(i,e={}){if(i.bbox!=null&&e.recompute!==!0)return i.bbox;const t=[1/0,1/0,-1/0,-1/0];return bi(i,n=>{t[0]>n[0]&&(t[0]=n[0]),t[1]>n[1]&&(t[1]=n[1]),t[2]<n[0]&&(t[2]=n[0]),t[3]<n[1]&&(t[3]=n[1])}),t}var Lt=lr;function ur(i){if(!i)throw new Error("geojson is required");switch(i.type){case"Feature":return vi(i);case"FeatureCollection":return ar(i);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return St(i);default:throw new Error("unknown GeoJSON type")}}function vi(i){const e={type:"Feature"};return Object.keys(i).forEach(t=>{switch(t){case"type":case"properties":case"geometry":return;default:e[t]=i[t]}}),e.properties=wi(i.properties),i.geometry==null?e.geometry=null:e.geometry=St(i.geometry),e}function wi(i){const e={};return i&&Object.keys(i).forEach(t=>{const n=i[t];typeof n=="object"?n===null?e[t]=null:Array.isArray(n)?e[t]=n.map(r=>r):e[t]=wi(n):e[t]=n}),e}function ar(i){const e={type:"FeatureCollection"};return Object.keys(i).forEach(t=>{switch(t){case"type":case"features":return;default:e[t]=i[t]}}),e.features=i.features.map(t=>vi(t)),e}function St(i){const e={type:i.type};return i.bbox&&(e.bbox=i.bbox),i.type==="GeometryCollection"?(e.geometries=i.geometries.map(t=>St(t)),e):(e.coordinates=_i(i.coordinates),e)}function _i(i){const e=i;return typeof e[0]!="object"?e.slice():e.map(t=>_i(t))}var cr=ur;/**
1
+ (function(A,z){typeof exports=="object"&&typeof module<"u"?z(exports,require("leaflet")):typeof define=="function"&&define.amd?define(["exports","leaflet"],z):(A=typeof globalThis<"u"?globalThis:A||self,z(A.leafletMaptilerGeocoder={},A.L))})(this,function(A,z){"use strict";var ao=Object.defineProperty;var Yi=A=>{throw TypeError(A)};var co=(A,z,K)=>z in A?ao(A,z,{enumerable:!0,configurable:!0,writable:!0,value:K}):A[z]=K;var qt=(A,z,K)=>co(A,typeof z!="symbol"?z+"":z,K),Xi=(A,z,K)=>z.has(A)||Yi("Cannot "+K);var he=(A,z,K)=>(Xi(A,z,"read from private field"),K?K.call(A):z.get(A)),Zt=(A,z,K)=>z.has(A)?Yi("Cannot add the same private member more than once"):z instanceof WeakSet?z.add(A):z.set(A,K),gt=(A,z,K,ie)=>(Xi(A,z,"write to private field"),ie?ie.call(A,K):z.set(A,K),K);var ue,Ie;function K(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const ie=K(z);function B(){}function Ki(i,e){for(const t in e)i[t]=e[t];return i}function Qt(i){return i()}function Ht(){return Object.create(null)}function ye(i){i.forEach(Qt)}function Vt(i){return typeof i=="function"}function we(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let tt;function J(i,e){return i===e?!0:(tt||(tt=document.createElement("a")),tt.href=e,i===tt.href)}function Ji(i){return Object.keys(i).length===0}function $i(i,e,t,n){if(i){const r=Yt(i,e,t,n);return i[0](r)}}function Yt(i,e,t,n){return i[1]&&n?Ki(t.ctx.slice(),i[1](n(e))):t.ctx}function en(i,e,t,n){if(i[2]&&n){const r=i[2](n(t));if(e.dirty===void 0)return r;if(typeof r=="object"){const o=[],u=Math.max(e.dirty.length,r.length);for(let s=0;s<u;s+=1)o[s]=e.dirty[s]|r[s];return o}return e.dirty|r}return e.dirty}function tn(i,e,t,n,r,o){if(r){const u=Yt(e,t,n,o);i.p(u,r)}}function nn(i){if(i.ctx.length>32){const e=[],t=i.ctx.length/32;for(let n=0;n<t;n++)e[n]=-1;return e}return-1}function Xt(i){return i??""}function T(i,e){i.appendChild(e)}function U(i,e,t){i.insertBefore(e,t||null)}function D(i){i.parentNode&&i.parentNode.removeChild(i)}function W(i){return document.createElement(i)}function fe(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function _e(i){return document.createTextNode(i)}function ne(){return _e(" ")}function rn(){return _e("")}function ee(i,e,t,n){return i.addEventListener(e,t,n),()=>i.removeEventListener(e,t,n)}function on(i){return function(e){return e.preventDefault(),i.call(this,e)}}function p(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}function sn(i){return Array.from(i.childNodes)}function Ge(i,e){e=""+e,i.data!==e&&(i.data=e)}function Kt(i,e){i.value=e??""}function se(i,e,t){i.classList.toggle(e,!!t)}function ln(i,e,{bubbles:t=!1,cancelable:n=!1}={}){return new CustomEvent(i,{detail:e,bubbles:t,cancelable:n})}let je;function qe(i){je=i}function Jt(){if(!je)throw new Error("Function called outside component initialization");return je}function un(i){Jt().$$.on_destroy.push(i)}function an(){const i=Jt();return(e,t,{cancelable:n=!1}={})=>{const r=i.$$.callbacks[e];if(r){const o=ln(e,t,{cancelable:n});return r.slice().forEach(u=>{u.call(i,o)}),!o.defaultPrevented}return!0}}function $t(i,e){const t=i.$$.callbacks[e.type];t&&t.slice().forEach(n=>n.call(this,e))}const We=[],yt=[];let ze=[];const ei=[],cn=Promise.resolve();let pt=!1;function fn(){pt||(pt=!0,cn.then(ti))}function vt(i){ze.push(i)}const bt=new Set;let Be=0;function ti(){if(Be!==0)return;const i=je;do{try{for(;Be<We.length;){const e=We[Be];Be++,qe(e),dn(e.$$)}}catch(e){throw We.length=0,Be=0,e}for(qe(null),We.length=0,Be=0;yt.length;)yt.pop()();for(let e=0;e<ze.length;e+=1){const t=ze[e];bt.has(t)||(bt.add(t),t())}ze.length=0}while(We.length);for(;ei.length;)ei.pop()();pt=!1,bt.clear(),qe(i)}function dn(i){if(i.fragment!==null){i.update(),ye(i.before_update);const e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(vt)}}function hn(i){const e=[],t=[];ze.forEach(n=>i.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),ze=e}const it=new Set;let Re;function nt(){Re={r:0,c:[],p:Re}}function rt(){Re.r||ye(Re.c),Re=Re.p}function Q(i,e){i&&i.i&&(it.delete(i),i.i(e))}function Y(i,e,t,n){if(i&&i.o){if(it.has(i))return;it.add(i),Re.c.push(()=>{it.delete(i),n&&(t&&i.d(1),n())}),i.o(e)}else n&&n()}function ii(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function mn(i,e){Y(i,1,1,()=>{e.delete(i.key)})}function gn(i,e,t,n,r,o,u,s,c,l,d,a){let f=i.length,h=o.length,g=f;const y={};for(;g--;)y[i[g].key]=g;const b=[],v=new Map,E=new Map,L=[];for(g=h;g--;){const S=a(r,o,g),w=t(S);let k=u.get(w);k?L.push(()=>k.p(S,e)):(k=l(w,S),k.c()),v.set(w,b[g]=k),w in y&&E.set(w,Math.abs(g-y[w]))}const _=new Set,C=new Set;function x(S){Q(S,1),S.m(s,d),u.set(S.key,S),d=S.first,h--}for(;f&&h;){const S=b[h-1],w=i[f-1],k=S.key,I=w.key;S===w?(d=S.first,f--,h--):v.has(I)?!u.has(k)||_.has(k)?x(S):C.has(I)?f--:E.get(k)>E.get(I)?(C.add(k),x(S)):(_.add(I),f--):(c(w,u),f--)}for(;f--;){const S=i[f];v.has(S.key)||c(S,u)}for(;h;)x(b[h-1]);return ye(L),b}function Ee(i){i&&i.c()}function pe(i,e,t){const{fragment:n,after_update:r}=i.$$;n&&n.m(e,t),vt(()=>{const o=i.$$.on_mount.map(Qt).filter(Vt);i.$$.on_destroy?i.$$.on_destroy.push(...o):ye(o),i.$$.on_mount=[]}),r.forEach(vt)}function ve(i,e){const t=i.$$;t.fragment!==null&&(hn(t.after_update),ye(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function yn(i,e){i.$$.dirty[0]===-1&&(We.push(i),fn(),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function Le(i,e,t,n,r,o,u=null,s=[-1]){const c=je;qe(i);const l=i.$$={fragment:null,ctx:[],props:o,update:B,not_equal:r,bound:Ht(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:Ht(),dirty:s,skip_bound:!1,root:e.target||c.$$.root};u&&u(l.root);let d=!1;if(l.ctx=t?t(i,e.props||{},(a,f,...h)=>{const g=h.length?h[0]:f;return l.ctx&&r(l.ctx[a],l.ctx[a]=g)&&(!l.skip_bound&&l.bound[a]&&l.bound[a](g),d&&yn(i,a)),f}):[],l.update(),d=!0,ye(l.before_update),l.fragment=n?n(l.ctx):!1,e.target){if(e.hydrate){const a=sn(e.target);l.fragment&&l.fragment.l(a),a.forEach(D)}else l.fragment&&l.fragment.c();e.intro&&Q(i.$$.fragment),pe(i,e.target,e.anchor),ti()}qe(c)}class Se{constructor(){qt(this,"$$");qt(this,"$$set")}$destroy(){ve(this,1),this.$destroy=B}$on(e,t){if(!Vt(t))return B;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const r=n.indexOf(t);r!==-1&&n.splice(r,1)}}$set(e){this.$$set&&!Ji(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const pn="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(pn);function vn(i){let e,t;return{c(){e=fe("svg"),t=fe("path"),p(t,"d","M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"),p(e,"viewBox","0 0 14 14"),p(e,"width","13"),p(e,"height","13"),p(e,"class","svelte-en2qvf")},m(n,r){U(n,e,r),T(e,t)},p:B,i:B,o:B,d(n){n&&D(e)}}}class ni extends Se{constructor(e){super(),Le(this,e,null,vn,we,{})}}function bn(i){let e,t;return{c(){e=fe("svg"),t=fe("path"),p(t,"d","M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"),p(e,"viewBox","0 0 30 30"),p(e,"fill","none"),p(e,"xmlns","http://www.w3.org/2000/svg"),p(e,"class","svelte-d2loi5")},m(n,r){U(n,e,r),T(e,t)},p:B,i:B,o:B,d(n){n&&D(e)}}}class ri extends Se{constructor(e){super(),Le(this,e,null,bn,we,{})}}function wn(i){let e,t;return{c(){e=W("img"),J(e.src,t=i[3]+"area.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"class","svelte-ltkwvy")},m(n,r){U(n,e,r)},p(n,r){r&8&&!J(e.src,t=n[3]+"area.svg")&&p(e,"src",t),r&64&&p(e,"alt",n[6])},d(n){n&&D(e)}}}function _n(i){let e,t;return{c(){e=W("img"),J(e.src,t=i[3]+"reverse.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"class","svelte-ltkwvy")},m(n,r){U(n,e,r)},p(n,r){r&8&&!J(e.src,t=n[3]+"reverse.svg")&&p(e,"src",t),r&64&&p(e,"alt",n[6])},d(n){n&&D(e)}}}function En(i){let e,t;return{c(){e=W("img"),J(e.src,t=i[3]+"poi.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"class","svelte-ltkwvy")},m(n,r){U(n,e,r)},p(n,r){r&8&&!J(e.src,t=n[3]+"poi.svg")&&p(e,"src",t),r&64&&p(e,"alt",n[6])},d(n){n&&D(e)}}}function Ln(i){let e,t;return{c(){e=W("img"),J(e.src,t=i[3]+"postal_code.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"class","svelte-ltkwvy")},m(n,r){U(n,e,r)},p(n,r){r&8&&!J(e.src,t=n[3]+"postal_code.svg")&&p(e,"src",t),r&64&&p(e,"alt",n[6])},d(n){n&&D(e)}}}function Sn(i){let e,t;return{c(){e=W("img"),J(e.src,t=i[3]+"street.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"class","svelte-ltkwvy")},m(n,r){U(n,e,r)},p(n,r){r&8&&!J(e.src,t=n[3]+"street.svg")&&p(e,"src",t),r&64&&p(e,"alt",n[6])},d(n){n&&D(e)}}}function xn(i){let e,t;return{c(){e=W("img"),J(e.src,t=i[3]+"road.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"class","svelte-ltkwvy")},m(n,r){U(n,e,r)},p(n,r){r&8&&!J(e.src,t=n[3]+"road.svg")&&p(e,"src",t),r&64&&p(e,"alt",n[6])},d(n){n&&D(e)}}}function Mn(i){let e,t;return{c(){e=W("img"),J(e.src,t=i[3]+"housenumber.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"class","svelte-ltkwvy")},m(n,r){U(n,e,r)},p(n,r){r&8&&!J(e.src,t=n[3]+"housenumber.svg")&&p(e,"src",t),r&64&&p(e,"alt",n[6])},d(n){n&&D(e)}}}function Cn(i){let e,t,n,r;return{c(){e=W("img"),J(e.src,t=i[5])||p(e,"src",t),p(e,"alt",i[4]),p(e,"class","svelte-ltkwvy")},m(o,u){U(o,e,u),n||(r=ee(e,"error",i[14]),n=!0)},p(o,u){u&32&&!J(e.src,t=o[5])&&p(e,"src",t),u&16&&p(e,"alt",o[4])},d(o){o&&D(e),n=!1,r()}}}function oi(i){let e,t;return{c(){e=W("span"),t=_e(i[6]),p(e,"class","secondary svelte-ltkwvy")},m(n,r){U(n,e,r),T(e,t)},p(n,r){r&64&&Ge(t,n[6])},d(n){n&&D(e)}}}function kn(i){let e,t,n,r,o,u,s,c,l,d=(i[7]?i[0].place_name:i[0].place_name.replace(/,.*/,""))+"",a,f,h=i[2]==="always"||i[2]!=="never"&&!i[0].address&&!i[0].id.startsWith("road.")&&!i[0].id.startsWith("address.")&&!i[0].id.startsWith("postal_code.")&&(!i[0].id.startsWith("poi.")||!i[5])&&!i[7],g,y,b=(i[7]?"":i[0].place_name.replace(/[^,]*,?\s*/,""))+"",v,E,L;function _(w,k){return k&1&&(t=null),k&1&&(n=null),k&1&&(r=null),k&1&&(o=null),w[5]?Cn:w[0].address?Mn:(t==null&&(t=!!w[0].id.startsWith("road.")),t?xn:(n==null&&(n=!!w[0].id.startsWith("address.")),n?Sn:(r==null&&(r=!!w[0].id.startsWith("postal_code.")),r?Ln:(o==null&&(o=!!w[0].id.startsWith("poi.")),o?En:w[7]?_n:wn))))}let C=_(i,-1),x=C(i),S=h&&oi(i);return{c(){e=W("li"),x.c(),u=ne(),s=W("span"),c=W("span"),l=W("span"),a=_e(d),f=ne(),S&&S.c(),g=ne(),y=W("span"),v=_e(b),p(l,"class","primary svelte-ltkwvy"),p(c,"class","svelte-ltkwvy"),p(y,"class","line2 svelte-ltkwvy"),p(s,"class","texts svelte-ltkwvy"),p(e,"tabindex","0"),p(e,"data-selected",i[1]),p(e,"class","svelte-ltkwvy"),se(e,"selected",i[1])},m(w,k){U(w,e,k),x.m(e,null),T(e,u),T(e,s),T(s,c),T(c,l),T(l,a),T(c,f),S&&S.m(c,null),T(s,g),T(s,y),T(y,v),E||(L=[ee(e,"mouseenter",i[12]),ee(e,"focus",i[13])],E=!0)},p(w,[k]){C===(C=_(w,k))&&x?x.p(w,k):(x.d(1),x=C(w),x&&(x.c(),x.m(e,u))),k&1&&d!==(d=(w[7]?w[0].place_name:w[0].place_name.replace(/,.*/,""))+"")&&Ge(a,d),k&37&&(h=w[2]==="always"||w[2]!=="never"&&!w[0].address&&!w[0].id.startsWith("road.")&&!w[0].id.startsWith("address.")&&!w[0].id.startsWith("postal_code.")&&(!w[0].id.startsWith("poi.")||!w[5])&&!w[7]),h?S?S.p(w,k):(S=oi(w),S.c(),S.m(c,null)):S&&(S.d(1),S=null),k&1&&b!==(b=(w[7]?"":w[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&Ge(v,b),k&2&&p(e,"data-selected",w[1]),k&2&&se(e,"selected",w[1])},i:B,o:B,d(w){w&&D(e),x.d(),S&&S.d(),E=!1,ye(L)}}}function Nn(i,e,t){var L;let n,r,{feature:o}=e,{selected:u=!1}=e,{showPlaceType:s}=e,{missingIconsCache:c}=e,{iconsBaseUrl:l}=e;const d=(L=o.properties)==null?void 0:L.categories;let a,f,h=0,g=o.place_type[0]==="reverse";function y(){f&&c.add(f),t(10,h++,h)}function b(_){$t.call(this,i,_)}function v(_){$t.call(this,i,_)}const E=()=>y();return i.$$set=_=>{"feature"in _&&t(0,o=_.feature),"selected"in _&&t(1,u=_.selected),"showPlaceType"in _&&t(2,s=_.showPlaceType),"missingIconsCache"in _&&t(9,c=_.missingIconsCache),"iconsBaseUrl"in _&&t(3,l=_.iconsBaseUrl)},i.$$.update=()=>{var _,C,x,S;if(i.$$.dirty&3640)do t(11,n--,n),t(4,a=d==null?void 0:d[n]),t(5,f=a?l+a.replace(/ /g,"_")+".svg":void 0);while(n>-1&&(!f||c.has(f)));i.$$.dirty&1&&t(6,r=((C=(_=o.properties)==null?void 0:_.categories)==null?void 0:C.join(", "))??((S=(x=o.properties)==null?void 0:x.place_type_name)==null?void 0:S[0])??o.place_type[0])},t(11,n=(d==null?void 0:d.length)??0),[o,u,s,l,a,f,r,g,y,c,h,n,b,v,E]}class Tn extends Se{constructor(e){super(),Le(this,e,Nn,kn,we,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function Pn(i){let e;return{c(){e=W("div"),e.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',p(e,"class","svelte-7cmwmc")},m(t,n){U(t,e,n)},p:B,i:B,o:B,d(t){t&&D(e)}}}class Rn extends Se{constructor(e){super(),Le(this,e,null,Pn,we,{})}}function In(i){let e,t,n;return{c(){e=fe("svg"),t=fe("path"),p(t,"stroke-width","4"),p(t,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),p(t,"class","svelte-gzo3ar"),p(e,"width",n=i[0]==="list"?20:void 0),p(e,"viewBox","0 0 70 85"),p(e,"fill","none"),p(e,"class","svelte-gzo3ar"),se(e,"in-map",i[0]!=="list"),se(e,"list-icon",i[0]==="list")},m(r,o){U(r,e,o),T(e,t)},p(r,[o]){o&1&&n!==(n=r[0]==="list"?20:void 0)&&p(e,"width",n),o&1&&se(e,"in-map",r[0]!=="list"),o&1&&se(e,"list-icon",r[0]==="list")},i:B,o:B,d(r){r&&D(e)}}}function On(i,e,t){let{displayIn:n}=e;return i.$$set=r=>{"displayIn"in r&&t(0,n=r.displayIn)},[n]}class An extends Se{constructor(e){super(),Le(this,e,On,In,we,{displayIn:0})}}function Wn(i){let e,t;return{c(){e=fe("svg"),t=fe("path"),p(t,"d","M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"),p(e,"viewBox","0 0 60.006 21.412"),p(e,"width","14"),p(e,"height","20"),p(e,"class","svelte-en2qvf")},m(n,r){U(n,e,r),T(e,t)},p:B,i:B,o:B,d(n){n&&D(e)}}}class zn extends Se{constructor(e){super(),Le(this,e,null,Wn,we,{})}}function Bn(i){let e,t,n;return{c(){e=fe("svg"),t=fe("circle"),n=fe("path"),p(t,"cx","4.789"),p(t,"cy","4.787"),p(t,"r","3.85"),p(t,"class","svelte-1aq105l"),p(n,"d","M12.063 12.063 7.635 7.635"),p(n,"class","svelte-1aq105l"),p(e,"xmlns","http://www.w3.org/2000/svg"),p(e,"width","13"),p(e,"height","13"),p(e,"viewBox","0 0 13 13"),p(e,"class","svelte-1aq105l")},m(r,o){U(r,e,o),T(e,t),T(e,n)},p:B,i:B,o:B,d(r){r&&D(e)}}}class Dn extends Se{constructor(e){super(),Le(this,e,null,Bn,we,{})}}function Un(i,e,t){const n=e[1],r=e[0],o=n-r;return i===n&&t?i:((i-r)%o+o)%o+r}function Ze(i){const e=[...i];return e[2]<e[0]&&(Math.abs((e[0]+e[2]+360)/2)>Math.abs((e[0]-360+e[2])/2)?e[0]-=360:e[2]+=360),e}let Qe;async function Fn(i,e,t){const n=i==null?void 0:i.getCenterAndZoom();for(const r of e??[])if(!(n&&(r.minZoom!=null&&r.minZoom>n[0]||r.maxZoom!=null&&r.maxZoom<n[0]))){if(r.type==="fixed")return r.coordinates.join(",");e:if(r.type==="client-geolocation"){if(Qe&&r.cachedLocationExpiry&&Qe.time+r.cachedLocationExpiry>Date.now()){if(!Qe.coords)break e;return Qe.coords}let o;try{return o=await new Promise((u,s)=>{t.signal.addEventListener("abort",()=>{s(Error("aborted"))}),navigator.geolocation.getCurrentPosition(c=>{u([c.coords.longitude,c.coords.latitude].map(l=>l.toFixed(6)).join(","))},c=>{s(c)},r)}),o}catch{}finally{r.cachedLocationExpiry&&(Qe={time:Date.now(),coords:o})}if(t.signal.aborted)return}if(r.type==="server-geolocation")return"ip";if(n&&r.type==="map-center")return n[1].toFixed(6)+","+n[2].toFixed(6)}}const Gn=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(EAST|WEST|[EW])?$/i,si=/^([+-]?[0-8]?[0-9])\s+([0-5]?[0-9]\.\d{3,})[\s,]{1,}([+-]?[0-1]?[0-9]?[0-9])\s+([0-5]?[0-9]\.\d{3,})$/,li=/^(NORTH|SOUTH|[NS])?[\s]*([+-]?[0-8]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(NORTH|SOUTH|[NS])?[\s]*[,/;]?[\s]*(EAST|WEST|[EW])?[\s]*([+-]?[0-1]?[0-9]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(EAST|WEST|[EW])?$/i,ui=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(EAST|WEST|[EW])?$/i,ai=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)\s*(EAST|WEST|[EW])?$/i,ci=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|’’|´´|["″”\.])?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|´´|’’|["″”\.])?\s*(EAST|WEST|[EW])?$/i;function jn(i){if(!["DMS","DM","DD"].includes(i))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){const e=this.decimalCoordinates.split(",").map(h=>Number(h.trim())),t=Number(e[0]),n=Number(e[1]),r=Math.abs(t),o=Math.abs(n),u=t>0?"N":"S",s=n>0?"E":"W";let c;i=="DD"&&(c=`${r}° ${u}, ${o}° ${s}`);const l=Math.floor(r),d=Math.floor(o),a=(r-l)*60,f=(o-d)*60;if(i=="DM"){let h=fi(a,3).toFixed(3).padStart(6,"0"),g=fi(f,3).toFixed(3).padStart(6,"0");h.endsWith(".000")&&g.endsWith(".000")&&(h=h.replace(/\.000$/,""),g=g.replace(/\.000$/,"")),c=`${l}° ${h}' ${u}, ${d}° ${g}' ${s}`}if(i=="DMS"){const h=Math.floor(a),g=Math.floor(f);let y=((a-h)*60).toFixed(1).padStart(4,"0"),b=((f-g)*60).toFixed(1).padStart(4,"0");const v=h.toString().padStart(2,"0"),E=g.toString().padStart(2,"0");y.endsWith(".0")&&b.endsWith(".0")&&(y=y.replace(/\.0$/,""),b=b.replace(/\.0$/,"")),c=`${l}° ${v}' ${y}" ${u}, ${d}° ${E}' ${b}" ${s}`}return c}else throw new Error("no decimal coordinates to convert")}function fi(i,e){const t=Math.pow(10,e);return Math.round((i+Number.EPSILON)*t)/t}function wt(i,e){e||(e=5),i=i.replace(/\s+/g," ").trim();let t=null,n=null,r="",o="",u=null,s=[],c=!1;if(Gn.test(i))throw new Error("invalid coordinate value");if(si.test(i))if(s=si.exec(i),c=He(s),c)t=Math.abs(s[1])+s[2]/60,Number(s[1])<0&&(t*=-1),n=Math.abs(s[3])+s[4]/60,Number(s[3])<0&&(n*=-1),u="DM";else throw new Error("invalid coordinate format");else if(li.test(i))if(s=li.exec(i),c=He(s),c){if(t=s[2],n=s[6],t.includes(",")&&(t=t.replace(",",".")),n.includes(",")&&(n=n.replace(",",".")),u="DD",Number(Math.round(t))==Number(t))throw new Error("integer only coordinate provided");if(Number(Math.round(n))==Number(n))throw new Error("integer only coordinate provided");s[1]?(r=s[1],o=s[5]):s[4]&&(r=s[4],o=s[8])}else throw new Error("invalid decimal coordinate format");else if(ui.test(i))if(s=ui.exec(i),c=He(s),c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,u="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,u="DMS"),parseInt(s[2])<0&&(t=-1*t),n=Math.abs(parseInt(s[9])),s[11]&&(n+=s[11]/60),s[13]&&(n+=s[13].replace(",",".")/3600),parseInt(s[9])<0&&(n=-1*n),s[1]?(r=s[1],o=s[8]):s[7]&&(r=s[7],o=s[14]);else throw new Error("invalid DMS coordinates format");else if(ai.test(i))if(s=ai.exec(i),c=He(s),c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,u="DM"),s[6]&&(t+=s[6]/3600,u="DMS"),parseInt(s[2])<0&&(t=-1*t),n=Math.abs(parseInt(s[10])),s[12]&&(n+=s[12]/60),s[14]&&(n+=s[14]/3600),parseInt(s[10])<0&&(n=-1*n),s[1]?(r=s[1],o=s[9]):s[8]&&(r=s[8],o=s[16]);else throw new Error("invalid DMS coordinates format");else if(ci.test(i)){if(s=ci.exec(i),c=He(s),s.filter(l=>l).length<=5)throw new Error("invalid coordinates format");if(c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4].replace(",",".")/60,u="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,u="DMS"),parseInt(s[2])<0&&(t=-1*t),n=Math.abs(parseInt(s[10])),s[12]&&(n+=s[12].replace(",",".")/60),s[14]&&(n+=s[14].replace(",",".")/3600),parseInt(s[10])<0&&(n=-1*n),s[1]?(r=s[1],o=s[9]):s[8]&&(r=s[8],o=s[16]);else throw new Error("invalid coordinates format")}if(c){if(Math.abs(n)>=180)throw new Error("invalid longitude value");if(Math.abs(t)>=90)throw new Error("invalid latitude value");if(r&&!o||!r&&o)throw new Error("invalid coordinates value");if(r&&r==o)throw new Error("invalid coordinates format");t.toString().includes(",")&&(t=t.replace(",",".")),n.toString().includes(",")&&(n=n.replace(",","."));let l=/S|SOUTH/i;l.test(r)&&t>0&&(t=-1*t),l=/W|WEST/i,l.test(o)&&n>0&&(n=-1*n);const d=s[0].trim();let a,f;const h=/[,/;\u0020]/g,g=d.match(h);if(g==null){const v=Math.floor(i.length/2);a=d.substring(0,v).trim(),f=d.substring(v).trim()}else{let v;g.length%2==1?v=Math.floor(g.length/2):v=g.length/2-1;let E=0;if(v==0)E=d.indexOf(g[0]),a=d.substring(0,E).trim(),f=d.substring(E+1).trim();else{let L=0,_=0;for(;L<=v;)E=d.indexOf(g[L],_),_=E+1,L++;a=d.substring(0,E).trim(),f=d.substring(E+1).trim()}}const y=a.split(".");if(y.length==2&&y[1]==0&&y[1].length!=2)throw new Error("invalid coordinates format");const b=f.split(".");if(b.length==2&&b[1]==0&&b[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(a)||/^\d+$/.test(f))throw new Error("degree only coordinate/s provided");return t=Number(Number(t).toFixed(e)),n=Number(Number(n).toFixed(e)),Object.freeze({verbatimCoordinates:d,verbatimLatitude:a,verbatimLongitude:f,decimalLatitude:t,decimalLongitude:n,decimalCoordinates:`${t},${n}`,originalFormat:u,closeEnough:qn,toCoordinateFormat:jn})}else throw new Error("coordinates pattern match failed")}function He(i){if(!isNaN(i[0]))return!1;const e=[...i];if(e.shift(),e.length%2>0)return!1;const t=/^[-+]?\d+([\.,]\d+)?$/,n=/[eastsouthnorthwest]+/i,r=e.length/2;for(let o=0;o<r;o++){const u=e[o],s=e[o+r],c=t.test(u)&&t.test(s),l=n.test(u)&&n.test(s),d=u==s;if(!(u==null&&s==null)){if(u==null||s==null)return!1;if(c||l||d)continue;return!1}}return!0}function di(i,e){const t=Math.abs(i-e);return Number(t.toFixed(6))<=1e-5}function qn(i){if(!i)throw new Error("coords must be provided");if(i.includes(",")){const e=i.split(",");if(Number(e[0])==NaN||Number(e[1])==NaN)throw new Error("coords are not valid decimals");return di(this.decimalLatitude,Number(e[0]))&&di(this.decimalLongitude,e[1])}else throw new Error("coords being tested must be separated by a comma")}const Zn=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});wt.to=Zn;const Qn=[{verbatimCoordinates:"40.123, -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:'40° 7´ 22.8" N 74° 7´ 22.8" W',verbatimLatitude:'40° 7´ 22.8" N',verbatimLongitude:'74° 7´ 22.8" W'},{verbatimCoordinates:"40° 7.38’ , -74° 7.38’",verbatimLatitude:"40° 7.38’",verbatimLongitude:"-74° 7.38’"},{verbatimCoordinates:"N40°7’22.8’’, W74°7’22.8’’",verbatimLatitude:"N40°7’22.8’’",verbatimLongitude:"W74°7’22.8’’"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:`40°7'22.8"N, 74°7'22.8"W`,verbatimLatitude:`40°7'22.8"N`,verbatimLongitude:`74°7'22.8"W`},{verbatimCoordinates:"40 7 22.8, -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"},{verbatimCoordinates:"40.123 -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123°,-74.123°",verbatimLatitude:"40.123°",verbatimLongitude:"-74.123°"},{verbatimCoordinates:"40.123N74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"4007.38N7407.38W",verbatimLatitude:"4007.38N",verbatimLongitude:"7407.38W"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:"400722.8N740722.8W",verbatimLatitude:"400722.8N",verbatimLongitude:"740722.8W"},{verbatimCoordinates:"N 40 7.38 W 74 7.38",verbatimLatitude:"N 40 7.38",verbatimLongitude:"W 74 7.38"},{verbatimCoordinates:"40:7:22.8N 74:7:22.8W",verbatimLatitude:"40:7:22.8N",verbatimLongitude:"74:7:22.8W"},{verbatimCoordinates:"40:7:23N,74:7:23W",verbatimLatitude:"40:7:23N",verbatimLongitude:"74:7:23W",decimalLatitude:40.1230555555,decimalLongitude:-74.1230555555},{verbatimCoordinates:'40°7’23"N 74°7’23"W',verbatimLatitude:'40°7’23"N',verbatimLongitude:'74°7’23"W',decimalLatitude:40.1230555555,decimalLongitude:-74.12305555555555},{verbatimCoordinates:'40°7’23"S 74°7’23"E',verbatimLatitude:'40°7’23"S',verbatimLongitude:'74°7’23"E',decimalLatitude:-40.1230555555,decimalLongitude:74.12305555555555},{verbatimCoordinates:'40°7’23" -74°7’23"',verbatimLatitude:'40°7’23"',verbatimLongitude:'-74°7’23"',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:'40d 7’ 23" N 74d 7’ 23" W',verbatimLatitude:'40d 7’ 23" N',verbatimLongitude:'74d 7’ 23" W',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:"40.123N 74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40 7 22.8; -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"}],Hn={decimalLatitude:40.123,decimalLongitude:-74.123},Vn=[{verbatimCoordinates:`50°4'17.698"south, 14°24'2.826"east`,verbatimLatitude:`50°4'17.698"south`,verbatimLongitude:`14°24'2.826"east`,decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"50d4m17.698S 14d24m2.826E",verbatimLatitude:"50d4m17.698S",verbatimLongitude:"14d24m2.826E",decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"40:26:46N,79:56:55W",verbatimLatitude:"40:26:46N",verbatimLongitude:"79:56:55W",decimalLatitude:40.44611111111111,decimalLongitude:-79.9486111111111},{verbatimCoordinates:"40:26:46.302N 79:56:55.903W",verbatimLatitude:"40:26:46.302N",verbatimLongitude:"79:56:55.903W",decimalLatitude:40.446195,decimalLongitude:-79.94886194444445},{verbatimCoordinates:"40°26′47″N 79°58′36″W",verbatimLatitude:"40°26′47″N",verbatimLongitude:"79°58′36″W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40d 26′ 47″ N 79d 58′ 36″ W",verbatimLatitude:"40d 26′ 47″ N",verbatimLongitude:"79d 58′ 36″ W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40.446195N 79.948862W",verbatimLatitude:"40.446195N",verbatimLongitude:"79.948862W",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40,446195° 79,948862°",verbatimLatitude:"40,446195°",verbatimLongitude:"79,948862°",decimalLatitude:40.446195,decimalLongitude:79.948862},{verbatimCoordinates:"40° 26.7717, -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.446195, -79.948862",verbatimLatitude:"40.446195",verbatimLongitude:"-79.948862",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.123256; -74.123256",verbatimLatitude:"40.123256",verbatimLongitude:"-74.123256",decimalLatitude:40.123256,decimalLongitude:-74.123256},{verbatimCoordinates:"18°24S 22°45E",verbatimLatitude:"18°24S",verbatimLongitude:"22°45E",decimalLatitude:-18.4,decimalLongitude:22.75}],Yn=[{verbatimCoordinates:"10.432342S 10.6345345E",verbatimLatitude:"10.432342S",verbatimLongitude:"10.6345345E",decimalLatitude:-10.432342,decimalLongitude:10.6345345},{verbatimCoordinates:"10.00S 10.00E",verbatimLatitude:"10.00S",verbatimLongitude:"10.00E",decimalLatitude:-10,decimalLongitude:10},{verbatimCoordinates:"00.00S 01.00E",verbatimLatitude:"00.00S",verbatimLongitude:"01.00E",decimalLatitude:0,decimalLongitude:1},{verbatimCoordinates:"18.24S 22.45E",verbatimLatitude:"18.24S",verbatimLongitude:"22.45E",decimalLatitude:-18.4,decimalLongitude:22.75},{verbatimCoordinates:"27deg 15min 45.2sec S 18deg 32min 53.7sec E",verbatimLatitude:"27deg 15min 45.2sec S",verbatimLongitude:"18deg 32min 53.7sec E",decimalLatitude:-27.262555555555554,decimalLongitude:18.54825},{verbatimCoordinates:"-23.3245° S / 28.2344° E",verbatimLatitude:"-23.3245° S",verbatimLongitude:"28.2344° E",decimalLatitude:-23.3245,decimalLongitude:28.2344},{verbatimCoordinates:"40° 26.7717 -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"27.15.45S 18.32.53E",verbatimLatitude:"27.15.45S",verbatimLongitude:"18.32.53E",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"-27.15.45 18.32.53",verbatimLatitude:"-27.15.45",verbatimLongitude:"18.32.53",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"27.15.45.2S 18.32.53.4E",verbatimLatitude:"27.15.45.2S",verbatimLongitude:"18.32.53.4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"27.15.45,2S 18.32.53,4E",verbatimLatitude:"27.15.45,2S",verbatimLongitude:"18.32.53,4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"S23.43563 ° E22.45634 °",verbatimLatitude:"S23.43563 °",verbatimLongitude:"E22.45634 °",decimalLatitude:-23.43563,decimalLongitude:22.45634},{verbatimCoordinates:"27,71372° S 23,07771° E",verbatimLatitude:"27,71372° S",verbatimLongitude:"23,07771° E",decimalLatitude:-27.71372,decimalLongitude:23.07771},{verbatimCoordinates:"27.45.34 S 23.23.23 E",verbatimLatitude:"27.45.34 S",verbatimLongitude:"23.23.23 E",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"S 27.45.34 E 23.23.23",verbatimLatitude:"S 27.45.34",verbatimLongitude:"E 23.23.23",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"53 16.3863,4 52.8171",verbatimLatitude:"53 16.3863",verbatimLongitude:"4 52.8171",decimalLatitude:53.273105,decimalLongitude:4.88029},{verbatimCoordinates:"50 8.2914,-5 2.4447",verbatimLatitude:"50 8.2914",verbatimLongitude:"-5 2.4447",decimalLatitude:50.13819,decimalLongitude:-5.040745},{verbatimCoordinates:"N 48° 30,6410', E 18° 57,4583'",verbatimLatitude:"N 48° 30,6410'",verbatimLongitude:"E 18° 57,4583'",decimalLatitude:48.51068,decimalLongitude:18.95764},{verbatimCoordinates:"1.23456, 18.33453",verbatimLatitude:"1.23456",verbatimLongitude:"18.33453",decimalLatitude:1.23456,decimalLongitude:18.33453}];function Xn(){const i=[];return Qn.forEach(e=>{e.decimalLatitude?i.push(e):i.push({...e,...Hn})}),[...i,...Vn,...Yn]}const Kn=Xn();wt.formats=Kn.map(i=>i.verbatimCoordinates);const Jn=wt;function hi(i,e,t){const n=i.slice();return n[86]=e[t],n[88]=t,n}function mi(i){let e,t;return e=new Rn({}),{c(){Ee(e.$$.fragment)},m(n,r){pe(e,n,r),t=!0},i(n){t||(Q(e.$$.fragment,n),t=!0)},o(n){Y(e.$$.fragment,n),t=!1},d(n){ve(e,n)}}}function gi(i){let e,t,n,r,o;return t=new zn({}),{c(){e=W("button"),Ee(t.$$.fragment),p(e,"type","button"),p(e,"title",i[9]),p(e,"class","svelte-bz0zu3"),se(e,"active",i[0])},m(u,s){U(u,e,s),pe(t,e,null),n=!0,r||(o=ee(e,"click",i[70]),r=!0)},p(u,s){(!n||s[0]&512)&&p(e,"title",u[9]),(!n||s[0]&1)&&se(e,"active",u[0])},i(u){n||(Q(t.$$.fragment,u),n=!0)},o(u){Y(t.$$.fragment,u),n=!1},d(u){u&&D(e),ve(t),r=!1,o()}}}function $n(i){let e,t=[],n=new Map,r,o,u,s=ii(i[14]);const c=l=>l[86].id+(l[86].address?","+l[86].address:"");for(let l=0;l<s.length;l+=1){let d=hi(i,s,l),a=c(d);n.set(a,t[l]=yi(a,d))}return{c(){e=W("ul");for(let l=0;l<t.length;l+=1)t[l].c();p(e,"class","options svelte-bz0zu3")},m(l,d){U(l,e,d);for(let a=0;a<t.length;a+=1)t[a]&&t[a].m(e,null);r=!0,o||(u=[ee(e,"mouseleave",i[74]),ee(e,"blur",i[75])],o=!0)},p(l,d){d[0]&17880064&&(s=ii(l[14]),nt(),t=gn(t,d,c,1,l,s,n,e,mn,yi,null,hi),rt())},i(l){if(!r){for(let d=0;d<s.length;d+=1)Q(t[d]);r=!0}},o(l){for(let d=0;d<t.length;d+=1)Y(t[d]);r=!1},d(l){l&&D(e);for(let d=0;d<t.length;d+=1)t[d].d();o=!1,ye(u)}}}function er(i){let e,t,n,r,o,u;return t=new ri({}),{c(){e=W("div"),Ee(t.$$.fragment),n=ne(),r=W("div"),o=_e(i[7]),p(r,"class","svelte-bz0zu3"),p(e,"class","no-results svelte-bz0zu3")},m(s,c){U(s,e,c),pe(t,e,null),T(e,n),T(e,r),T(r,o),u=!0},p(s,c){(!u||c[0]&128)&&Ge(o,s[7])},i(s){u||(Q(t.$$.fragment,s),u=!0)},o(s){Y(t.$$.fragment,s),u=!1},d(s){s&&D(e),ve(t)}}}function tr(i){let e="",t;return{c(){t=_e(e)},m(n,r){U(n,t,r)},p:B,i:B,o:B,d(n){n&&D(t)}}}function ir(i){let e,t,n,r,o,u,s,c,l,d,a;return t=new ri({}),c=new ni({}),{c(){e=W("div"),Ee(t.$$.fragment),n=ne(),r=W("div"),o=_e(i[6]),u=ne(),s=W("button"),Ee(c.$$.fragment),p(r,"class","svelte-bz0zu3"),p(s,"class","svelte-bz0zu3"),p(e,"class","error svelte-bz0zu3")},m(f,h){U(f,e,h),pe(t,e,null),T(e,n),T(e,r),T(r,o),T(e,u),T(e,s),pe(c,s,null),l=!0,d||(a=ee(s,"click",i[71]),d=!0)},p(f,h){(!l||h[0]&64)&&Ge(o,f[6])},i(f){l||(Q(t.$$.fragment,f),Q(c.$$.fragment,f),l=!0)},o(f){Y(t.$$.fragment,f),Y(c.$$.fragment,f),l=!1},d(f){f&&D(e),ve(t),ve(c),d=!1,a()}}}function yi(i,e){let t,n,r;function o(){return e[72](e[88])}function u(){return e[73](e[86])}return n=new Tn({props:{feature:e[86],showPlaceType:e[10],selected:e[15]===e[88],missingIconsCache:e[20],iconsBaseUrl:e[12]}}),n.$on("mouseenter",o),n.$on("focus",u),{key:i,first:null,c(){t=rn(),Ee(n.$$.fragment),this.first=t},m(s,c){U(s,t,c),pe(n,s,c),r=!0},p(s,c){e=s;const l={};c[0]&16384&&(l.feature=e[86]),c[0]&1024&&(l.showPlaceType=e[10]),c[0]&49152&&(l.selected=e[15]===e[88]),c[0]&4096&&(l.iconsBaseUrl=e[12]),n.$set(l)},i(s){r||(Q(n.$$.fragment,s),r=!0)},o(s){Y(n.$$.fragment,s),r=!1},d(s){s&&D(t),ve(n,s)}}}function nr(i){let e,t,n,r,o,u,s,c,l,d,a,f,h,g,y,b,v,E,L,_,C,x=!1;o=new Dn({}),a=new ni({});let S=i[19]&&mi(),w=i[5]!=="never"&&gi(i);const k=i[62].default,I=$i(k,i,i[61],null),F=[ir,tr,er,$n],j=[];function O(M,q){var re,Ne;return M[18]?0:M[16]?((re=M[14])==null?void 0:re.length)===0?2:M[16]&&((Ne=M[14])!=null&&Ne.length)?3:-1:1}return~(b=O(i))&&(v=j[b]=F[b](i)),{c(){e=ne(),t=W("form"),n=W("div"),r=W("button"),Ee(o.$$.fragment),u=ne(),s=W("input"),c=ne(),l=W("div"),d=W("button"),Ee(a.$$.fragment),f=ne(),S&&S.c(),h=ne(),w&&w.c(),g=ne(),I&&I.c(),y=ne(),v&&v.c(),p(r,"class","search-button svelte-bz0zu3"),p(r,"type","button"),p(s,"placeholder",i[8]),p(s,"aria-label",i[8]),p(s,"class","svelte-bz0zu3"),p(d,"type","button"),p(d,"title",i[3]),p(d,"class","svelte-bz0zu3"),p(l,"class","clear-button-container svelte-bz0zu3"),se(l,"displayable",i[1]!==""),p(n,"class","input-group svelte-bz0zu3"),p(t,"tabindex","0"),p(t,"class",E=Xt(i[2])+" svelte-bz0zu3"),se(t,"can-collapse",i[4]&&i[1]==="")},m(M,q){U(M,e,q),U(M,t,q),T(t,n),T(n,r),pe(o,r,null),T(n,u),T(n,s),i[64](s),Kt(s,i[1]),T(n,c),T(n,l),T(l,d),pe(a,d,null),T(l,f),S&&S.m(l,null),T(n,h),w&&w.m(n,null),T(n,g),I&&I.m(n,null),T(t,y),~b&&j[b].m(t,null),L=!0,_||(C=[ee(r,"click",i[63]),ee(s,"input",i[65]),ee(s,"focus",i[66]),ee(s,"blur",i[67]),ee(s,"keydown",i[22]),ee(s,"input",i[68]),ee(d,"click",i[69]),ee(t,"submit",on(i[21]))],_=!0)},p(M,q){(!L||q[0]&256)&&p(s,"placeholder",M[8]),(!L||q[0]&256)&&p(s,"aria-label",M[8]),q[0]&2&&s.value!==M[1]&&Kt(s,M[1]),(!L||q[0]&8)&&p(d,"title",M[3]),M[19]?S?q[0]&524288&&Q(S,1):(S=mi(),S.c(),Q(S,1),S.m(l,null)):S&&(nt(),Y(S,1,1,()=>{S=null}),rt()),(!L||q[0]&2)&&se(l,"displayable",M[1]!==""),M[5]!=="never"?w?(w.p(M,q),q[0]&32&&Q(w,1)):(w=gi(M),w.c(),Q(w,1),w.m(n,g)):w&&(nt(),Y(w,1,1,()=>{w=null}),rt()),I&&I.p&&(!L||q[1]&1073741824)&&tn(I,k,M,M[61],L?en(k,M[61],q,null):nn(M[61]),null);let re=b;b=O(M),b===re?~b&&j[b].p(M,q):(v&&(nt(),Y(j[re],1,1,()=>{j[re]=null}),rt()),~b?(v=j[b],v?v.p(M,q):(v=j[b]=F[b](M),v.c()),Q(v,1),v.m(t,null)):v=null),(!L||q[0]&4&&E!==(E=Xt(M[2])+" svelte-bz0zu3"))&&p(t,"class",E),(!L||q[0]&22)&&se(t,"can-collapse",M[4]&&M[1]==="")},i(M){L||(Q(x),Q(o.$$.fragment,M),Q(a.$$.fragment,M),Q(S),Q(w),Q(I,M),Q(v),L=!0)},o(M){Y(x),Y(o.$$.fragment,M),Y(a.$$.fragment,M),Y(S),Y(w),Y(I,M),Y(v),L=!1},d(M){M&&(D(e),D(t)),ve(o),i[64](null),ve(a),S&&S.d(),w&&w.d(),I&&I.d(M),~b&&j[b].d(),_=!1,ye(C)}}}function rr(i,e,t){let n,{$$slots:r={},$$scope:o}=e;const u={continental_marine:4,country:4,major_landform:8,region:5,subregion:6,county:7,joint_municipality:8,joint_submunicipality:9,municipality:10,municipal_district:11,locality:12,neighbourhood:13,place:14,postal_code:14,road:16,poi:17,address:18,"poi.peak":15,"poi.shop":18,"poi.cafe":18,"poi.restaurant":18,"poi.aerodrome":13};let{class:s=void 0}=e,{apiKey:c}=e,{bbox:l=void 0}=e,{clearButtonTitle:d="clear"}=e,{clearOnBlur:a=!1}=e,{collapsed:f=!1}=e,{country:h=void 0}=e,{debounceSearch:g=200}=e,{reverse:y="never"}=e,{errorMessage:b="Something went wrong…"}=e,{filter:v=()=>!0}=e,{flyTo:E=!0}=e,{fuzzyMatch:L=!0}=e,{language:_=void 0}=e,{limit:C=void 0}=e,{mapController:x=void 0}=e,{minLength:S=2}=e,{noResultsMessage:w="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=e,{placeholder:k="Search"}=e,{proximity:I=[{type:"server-geolocation"}]}=e,{reverseActive:F=y==="always"}=e,{reverseButtonTitle:j="toggle reverse geocoding"}=e,{searchValue:O=""}=e,{pickedResultStyle:M="full-geometry"}=e,{showPlaceType:q="if-needed"}=e,{showResultsWhileTyping:re=!0}=e,{autocompleteTimeout:Ne=void 0}=e,{selectFirst:Ue=!0}=e,{flyToSelected:It=!1}=e,{markerOnSelected:ut=!0}=e,{types:Oe=void 0}=e,{exhaustiveReverseGeocoding:Ot=!1}=e,{excludeTypes:at=!1}=e,{zoom:ct=u}=e,{apiUrl:At="https://api.maptiler.com/geocoding"}=e,{fetchParameters:Wt={}}=e,{iconsBaseUrl:Zi="https://cdn.maptiler.com/maptiler-geocoding-control/v2.0.0-rc.3/icons/"}=e,{adjustUrlQuery:zt=()=>{}}=e;function Fr(){me.focus()}function Gr(){me.blur()}function Qi(m,Z=!0,V=!1){t(1,O=m),Z?(t(15,G=-1),Vi()):(Ut(!V,V),setTimeout(()=>{me.focus(),me.select()}))}function jr(){t(14,R=void 0),t(57,N=void 0),t(15,G=-1)}function qr(){t(56,H=[]),t(57,N=void 0)}let Fe=!1,R,H,N,Hi="",me,G=-1,ge,ft=[],Ae,Te,ae,dt,Bt;const Zr=new Set,Pe=an();function Qr(){return!!ae}un(()=>{x&&(x.setEventHandler(void 0),x.indicateReverse(!1),x.setSelectedMarker(-1),x.setMarkers(void 0,void 0))});function Vi(m){if(Te&&(window.clearTimeout(Te),Te=void 0),ae){window.clearTimeout(ae),t(58,ae=void 0),$e(O,{exact:!0});return}if(G>-1&&R)t(57,N=R[G]),t(1,O=N.place_type[0]==="reverse"?N.place_name:N.place_name.replace(/,.*/,"")),t(18,ge=void 0),t(56,H=void 0),t(15,G=-1);else if(O){const Z=m||!Dt(O);$e(O,{exact:!0}).then(()=>{t(56,H=R),t(57,N=void 0),Z&&Hr()}).catch(V=>t(18,ge=V))}}function Dt(m){try{return Jn(m,6)}catch{return!1}}async function $e(m,{byId:Z=!1,exact:V=!1,appendSpace:ce=!1}={}){t(18,ge=void 0),Ae==null||Ae.abort();const oe=new AbortController;t(19,Ae=oe);try{const P=Dt(m),X=new URLSearchParams;if(_!==void 0&&X.set("language",Array.isArray(_)?_.join(","):_??""),Oe&&X.set("types",Oe.join(",")),at&&X.set("excludeTypes",String(at)),l&&X.set("bbox",l.map(mt=>mt.toFixed(6)).join(",")),h&&X.set("country",Array.isArray(h)?h.join(","):h),!Z&&!P){const mt=await Fn(x,I,oe);mt&&X.set("proximity",mt),(V||!re)&&X.set("autocomplete","false"),X.set("fuzzyMatch",String(L))}C!==void 0&&(Ot||!P||(Oe==null?void 0:Oe.length)===1)&&X.set("limit",String(C)),X.set("key",c),zt(X);const ht=At+"/"+encodeURIComponent(P?P.decimalLongitude+","+P.decimalLatitude:m+(ce?" ":""))+".json?"+X.toString();if(ht===Hi){Z?(t(14,R=void 0),t(57,N=ft[0])):t(14,R=ft);return}Hi=ht;const Gt=await fetch(ht,{signal:oe.signal,...Wt});if(!Gt.ok)throw new Error(await Gt.text());const jt=await Gt.json();Pe("response",{url:ht,featureCollection:jt}),Z?(t(14,R=void 0),t(57,N=jt.features[0]),ft=[N]):(t(14,R=jt.features.filter(v)),P&&R.unshift({type:"Feature",properties:{},id:"reverse_"+P.decimalLongitude+"_"+P.decimalLatitude,text:P.decimalLatitude+", "+P.decimalLongitude,place_name:P.decimalLatitude+", "+P.decimalLongitude,place_type:["reverse"],center:[P.decimalLongitude,P.decimalLatitude],bbox:[P.decimalLongitude,P.decimalLatitude,P.decimalLongitude,P.decimalLatitude],geometry:{type:"Point",coordinates:[P.decimalLongitude,P.decimalLatitude]}}),ft=R,P&&me.focus())}catch(P){if(P&&typeof P=="object"&&"name"in P&&P.name==="AbortError")return;throw P}finally{oe===Ae&&t(19,Ae=void 0)}}function Hr(){var ce;if(!(H!=null&&H.length)||!E)return;const m=[180,90,-180,-90],Z=!H.some(oe=>!oe.matching_text);let V;for(const oe of H){const P=et(oe);if(V=V===void 0?P:P===void 0?V:Math.max(V,P),Z||!oe.matching_text)for(const X of[0,1,2,3])m[X]=Math[X<2?"min":"max"](m[X],((ce=oe.bbox)==null?void 0:ce[X])??oe.center[X%2])}x&&H.length>0&&(N&&m[0]===m[2]&&m[1]===m[3]?x.flyTo(N.center,et(N)):x.fitBounds(Ze(m),50,V))}function et(m){var V;if(!m.bbox||m.bbox[0]!==m.bbox[2]&&m.bbox[1]!==m.bbox[3])return;const Z=m.id.replace(/\..*/,"");return(Array.isArray((V=m.properties)==null?void 0:V.categories)?m.properties.categories.reduce((ce,oe)=>{const P=ct[Z+"."+oe];return ce===void 0?P:P===void 0?ce:Math.max(ce,P)},void 0):void 0)??ct[Z]}function Vr(m){t(0,F=y==="always"),t(14,R=void 0),t(57,N=void 0),t(15,G=-1),Qi(m[1].toFixed(6)+", "+Un(m[0],[-180,180],!0).toFixed(6),!1,!0)}function Yr(m){if(!R)return;let Z=m.key==="ArrowDown"?1:m.key==="ArrowUp"?-1:0;Z&&(G===(Ue?0:-1)&&Z===-1&&t(15,G=R.length),t(15,G+=Z),G>=R.length&&t(15,G=-1),G<0&&Ue&&t(15,G=0),m.preventDefault())}function Ut(m=!0,Z=!1){if(t(18,ge=void 0),Te&&(window.clearTimeout(Te),Te=void 0),ae&&(window.clearTimeout(ae),t(58,ae=void 0)),!re&&!Z||O.length<S){t(14,R=void 0);return}const V=O;Te=window.setTimeout(()=>{Te=void 0,$e(V).catch(ce=>t(18,ge=ce))},m?g:0),O.endsWith(" ")||t(58,ae=window.setTimeout(()=>{t(58,ae=void 0),$e(V,{appendSpace:!0}).catch(ce=>t(18,ge=ce))},Ne))}function Ft(m){t(57,N=m),t(1,O=m.place_name),t(15,G=-1)}const Xr=()=>me.focus();function Kr(m){yt[m?"unshift":"push"](()=>{me=m,t(17,me)})}function Jr(){O=this.value,t(1,O),t(13,Fe),t(28,a)}const $r=()=>t(13,Fe=!0),eo=()=>t(13,Fe=!1),to=()=>Ut(),io=()=>{t(1,O=""),me.focus()},no=()=>t(0,F=!F),ro=()=>t(18,ge=void 0),oo=m=>t(15,G=m),so=m=>Ft(m),lo=()=>{Ue||t(15,G=-1)},uo=()=>{};return i.$$set=m=>{"class"in m&&t(2,s=m.class),"apiKey"in m&&t(26,c=m.apiKey),"bbox"in m&&t(27,l=m.bbox),"clearButtonTitle"in m&&t(3,d=m.clearButtonTitle),"clearOnBlur"in m&&t(28,a=m.clearOnBlur),"collapsed"in m&&t(4,f=m.collapsed),"country"in m&&t(29,h=m.country),"debounceSearch"in m&&t(30,g=m.debounceSearch),"reverse"in m&&t(5,y=m.reverse),"errorMessage"in m&&t(6,b=m.errorMessage),"filter"in m&&t(31,v=m.filter),"flyTo"in m&&t(32,E=m.flyTo),"fuzzyMatch"in m&&t(33,L=m.fuzzyMatch),"language"in m&&t(34,_=m.language),"limit"in m&&t(35,C=m.limit),"mapController"in m&&t(36,x=m.mapController),"minLength"in m&&t(37,S=m.minLength),"noResultsMessage"in m&&t(7,w=m.noResultsMessage),"placeholder"in m&&t(8,k=m.placeholder),"proximity"in m&&t(38,I=m.proximity),"reverseActive"in m&&t(0,F=m.reverseActive),"reverseButtonTitle"in m&&t(9,j=m.reverseButtonTitle),"searchValue"in m&&t(1,O=m.searchValue),"pickedResultStyle"in m&&t(39,M=m.pickedResultStyle),"showPlaceType"in m&&t(10,q=m.showPlaceType),"showResultsWhileTyping"in m&&t(40,re=m.showResultsWhileTyping),"autocompleteTimeout"in m&&t(41,Ne=m.autocompleteTimeout),"selectFirst"in m&&t(11,Ue=m.selectFirst),"flyToSelected"in m&&t(42,It=m.flyToSelected),"markerOnSelected"in m&&t(43,ut=m.markerOnSelected),"types"in m&&t(44,Oe=m.types),"exhaustiveReverseGeocoding"in m&&t(45,Ot=m.exhaustiveReverseGeocoding),"excludeTypes"in m&&t(46,at=m.excludeTypes),"zoom"in m&&t(47,ct=m.zoom),"apiUrl"in m&&t(48,At=m.apiUrl),"fetchParameters"in m&&t(49,Wt=m.fetchParameters),"iconsBaseUrl"in m&&t(12,Zi=m.iconsBaseUrl),"adjustUrlQuery"in m&&t(50,zt=m.adjustUrlQuery),"$$scope"in m&&t(61,o=m.$$scope)},i.$$.update=()=>{if(i.$$.dirty[0]&32&&t(0,F=y==="always"),i.$$.dirty[0]&268443648&&setTimeout(()=>{t(16,dt=Fe),a&&!Fe&&t(1,O="")}),i.$$.dirty[0]&16386|i.$$.dirty[1]&64&&O.length<S&&(t(57,N=void 0),t(14,R=void 0),t(18,ge=void 0),t(56,H=R)),i.$$.dirty[1]&67109120&&M!=="marker-only"&&N&&!N.address&&N.geometry.type==="Point"&&N.place_type[0]!=="reverse"&&$e(N.id,{byId:!0}).catch(m=>t(18,ge=m)),i.$$.dirty[1]&335544354&&(x&&N&&N.id!==Bt&&E&&(!N.bbox||N.bbox[0]===N.bbox[2]&&N.bbox[1]===N.bbox[3]?x.flyTo(N.center,et(N)):x.fitBounds(Ze(N.bbox),50,et(N)),t(14,R=void 0),t(56,H=void 0),t(15,G=-1)),t(59,Bt=N==null?void 0:N.id)),i.$$.dirty[0]&18432&&Ue&&R!=null&&R.length&&(Qr()||t(15,G=0)),i.$$.dirty[0]&2&&t(15,G=-1),i.$$.dirty[0]&16384|i.$$.dirty[1]&33554432&&H!==R&&t(56,H=void 0),i.$$.dirty[0]&81921|i.$$.dirty[1]&33554464&&x&&x.setEventHandler(m=>{switch(m.type){case"mapClick":F&&Vr(m.coordinates);break;case"markerClick":{const Z=R==null?void 0:R.find(V=>V.id===m.id);Z&&Ft(Z)}break;case"markerMouseEnter":H&&t(15,G=dt?(R==null?void 0:R.findIndex(Z=>Z.id===m.id))??-1:-1);break;case"markerMouseLeave":H&&t(15,G=-1);break}}),i.$$.dirty[0]&49152&&t(60,n=R==null?void 0:R[G]),i.$$.dirty[1]&536872994&&x&&n&&E&&It&&x.flyTo(n.center,et(n)),i.$$.dirty[1]&4128&&(ut||x==null||x.setMarkers(void 0,void 0)),i.$$.dirty[1]&570429472&&x&&ut&&!H&&(x.setMarkers(n?[n]:void 0,void 0),x.setSelectedMarker(n?0:-1)),i.$$.dirty[1]&100663328&&x&&x.setMarkers(H,N),i.$$.dirty[0]&32768|i.$$.dirty[1]&33554464&&H&&x&&x.setSelectedMarker(G),i.$$.dirty[1]&671088640&&n&&(window.clearTimeout(ae),t(58,ae=void 0)),i.$$.dirty[0]&2|i.$$.dirty[1]&32&&x){const m=Dt(O);x.setReverseMarker(m?[m.decimalLongitude,m.decimalLatitude]:void 0)}i.$$.dirty[1]&536870912&&Pe("select",{feature:n}),i.$$.dirty[1]&67108864&&Pe("pick",{feature:N}),i.$$.dirty[0]&81920&&Pe("optionsvisibilitychange",{optionsVisible:dt&&!!R}),i.$$.dirty[0]&16384&&Pe("featureslisted",{features:R}),i.$$.dirty[1]&33554432&&Pe("featuresmarked",{features:H}),i.$$.dirty[0]&1&&Pe("reversetoggle",{reverse:F}),i.$$.dirty[0]&2&&Pe("querychange",{query:O}),i.$$.dirty[0]&1|i.$$.dirty[1]&32&&x&&x.indicateReverse(F)},[F,O,s,d,f,y,b,w,k,j,q,Ue,Zi,Fe,R,G,dt,me,ge,Ae,Zr,Vi,Yr,Ut,Ft,u,c,l,a,h,g,v,E,L,_,C,x,S,I,M,re,Ne,It,ut,Oe,Ot,at,ct,At,Wt,zt,Fr,Gr,Qi,jr,qr,H,N,ae,Bt,n,o,r,Xr,Kr,Jr,$r,eo,to,io,no,ro,oo,so,lo,uo]}let or=class extends Se{constructor(e){super(),Le(this,e,rr,nr,we,{ZOOM_DEFAULTS:25,class:2,apiKey:26,bbox:27,clearButtonTitle:3,clearOnBlur:28,collapsed:4,country:29,debounceSearch:30,reverse:5,errorMessage:6,filter:31,flyTo:32,fuzzyMatch:33,language:34,limit:35,mapController:36,minLength:37,noResultsMessage:7,placeholder:8,proximity:38,reverseActive:0,reverseButtonTitle:9,searchValue:1,pickedResultStyle:39,showPlaceType:10,showResultsWhileTyping:40,autocompleteTimeout:41,selectFirst:11,flyToSelected:42,markerOnSelected:43,types:44,exhaustiveReverseGeocoding:45,excludeTypes:46,zoom:47,apiUrl:48,fetchParameters:49,iconsBaseUrl:12,adjustUrlQuery:50,focus:51,blur:52,setQuery:53,clearList:54,clearMap:55},null,[-1,-1,-1])}get ZOOM_DEFAULTS(){return this.$$.ctx[25]}get focus(){return this.$$.ctx[51]}get blur(){return this.$$.ctx[52]}get setQuery(){return this.$$.ctx[53]}get clearList(){return this.$$.ctx[54]}get clearMap(){return this.$$.ctx[55]}};function Ve(i,e,t={}){const n={type:"Feature"};return(t.id===0||t.id)&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.properties=e||{},n.geometry=i,n}function _t(i,e,t={}){for(const r of i){if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(r[r.length-1].length!==r[0].length)throw new Error("First and last Position are not equivalent.");for(let o=0;o<r[r.length-1].length;o++)if(r[r.length-1][o]!==r[0][o])throw new Error("First and last Position are not equivalent.")}return Ve({type:"Polygon",coordinates:i},e,t)}function Ye(i,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=i,t}function pi(i,e,t={}){return Ve({type:"MultiPolygon",coordinates:i},e,t)}function vi(i,e,t){if(i!==null)for(var n,r,o,u,s,c,l,d=0,a=0,f,h=i.type,g=h==="FeatureCollection",y=h==="Feature",b=g?i.features.length:1,v=0;v<b;v++){l=g?i.features[v].geometry:y?i.geometry:i,f=l?l.type==="GeometryCollection":!1,s=f?l.geometries.length:1;for(var E=0;E<s;E++){var L=0,_=0;if(u=f?l.geometries[E]:l,u!==null){c=u.coordinates;var C=u.type;switch(d=0,C){case null:break;case"Point":if(e(c,a,v,L,_)===!1)return!1;a++,L++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(e(c[n],a,v,L,_)===!1)return!1;a++,C==="MultiPoint"&&L++}C==="LineString"&&L++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(r=0;r<c[n].length-d;r++){if(e(c[n][r],a,v,L,_)===!1)return!1;a++}C==="MultiLineString"&&L++,C==="Polygon"&&_++}C==="Polygon"&&L++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(_=0,r=0;r<c[n].length;r++){for(o=0;o<c[n][r].length-d;o++){if(e(c[n][r][o],a,v,L,_)===!1)return!1;a++}_++}L++}break;case"GeometryCollection":for(n=0;n<u.geometries.length;n++)if(vi(u.geometries[n],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Et(i,e){var t,n,r,o,u,s,c,l,d,a,f=0,h=i.type==="FeatureCollection",g=i.type==="Feature",y=h?i.features.length:1;for(t=0;t<y;t++){for(s=h?i.features[t].geometry:g?i.geometry:i,l=h?i.features[t].properties:g?i.properties:{},d=h?i.features[t].bbox:g?i.bbox:void 0,a=h?i.features[t].id:g?i.id:void 0,c=s?s.type==="GeometryCollection":!1,u=c?s.geometries.length:1,r=0;r<u;r++){if(o=c?s.geometries[r]:s,o===null){if(e(null,f,l,d,a)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,f,l,d,a)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(e(o.geometries[n],f,l,d,a)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function sr(i,e){Et(i,function(t,n,r,o,u){var s=t===null?null:t.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return e(Ve(t,r,{bbox:o,id:u}),n,0)===!1?!1:void 0}var c;switch(s){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var l=0;l<t.coordinates.length;l++){var d=t.coordinates[l],a={type:c,coordinates:d};if(e(Ve(a,r),n,l)===!1)return!1}})}function lr(i,e={}){if(i.bbox!=null&&e.recompute!==!0)return i.bbox;const t=[1/0,1/0,-1/0,-1/0];return vi(i,n=>{t[0]>n[0]&&(t[0]=n[0]),t[1]>n[1]&&(t[1]=n[1]),t[2]<n[0]&&(t[2]=n[0]),t[3]<n[1]&&(t[3]=n[1])}),t}var Lt=lr;function ur(i){if(!i)throw new Error("geojson is required");switch(i.type){case"Feature":return bi(i);case"FeatureCollection":return ar(i);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return St(i);default:throw new Error("unknown GeoJSON type")}}function bi(i){const e={type:"Feature"};return Object.keys(i).forEach(t=>{switch(t){case"type":case"properties":case"geometry":return;default:e[t]=i[t]}}),e.properties=wi(i.properties),i.geometry==null?e.geometry=null:e.geometry=St(i.geometry),e}function wi(i){const e={};return i&&Object.keys(i).forEach(t=>{const n=i[t];typeof n=="object"?n===null?e[t]=null:Array.isArray(n)?e[t]=n.map(r=>r):e[t]=wi(n):e[t]=n}),e}function ar(i){const e={type:"FeatureCollection"};return Object.keys(i).forEach(t=>{switch(t){case"type":case"features":return;default:e[t]=i[t]}}),e.features=i.features.map(t=>bi(t)),e}function St(i){const e={type:i.type};return i.bbox&&(e.bbox=i.bbox),i.type==="GeometryCollection"?(e.geometries=i.geometries.map(t=>St(t)),e):(e.coordinates=_i(i.coordinates),e)}function _i(i){const e=i;return typeof e[0]!="object"?e.slice():e.map(t=>_i(t))}var cr=ur;/**
2
2
  * splaytree v3.1.2
3
3
  * Fast Splay tree for Node and browser
4
4
  *
@@ -19,5 +19,5 @@
19
19
  See the Apache Version 2.0 License for specific language governing permissions
20
20
  and limitations under the License.
21
21
  ***************************************************************************** */function fr(i,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,r,o,u;return u={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(l){return function(d){return c([l,d])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,r&&(o=l[0]&2?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,r=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){t.label=l[1];break}if(l[0]===6&&t.label<o[1]){t.label=o[1],o=l;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(l);break}o[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(i,t)}catch(d){l=[6,d],r=0}finally{n=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var xe=function(){function i(e,t){this.next=null,this.key=e,this.data=t,this.left=null,this.right=null}return i}();function dr(i,e){return i>e?1:i<e?-1:0}function Me(i,e,t){for(var n=new xe(null,null),r=n,o=n;;){var u=t(i,e.key);if(u<0){if(e.left===null)break;if(t(i,e.left.key)<0){var s=e.left;if(e.left=s.right,s.right=e,e=s,e.left===null)break}o.left=e,o=e,e=e.left}else if(u>0){if(e.right===null)break;if(t(i,e.right.key)>0){var s=e.right;if(e.right=s.left,s.left=e,e=s,e.right===null)break}r.right=e,r=e,e=e.right}else break}return r.right=e.left,o.left=e.right,e.left=n.right,e.right=n.left,e}function xt(i,e,t,n){var r=new xe(i,e);if(t===null)return r.left=r.right=null,r;t=Me(i,t,n);var o=n(i,t.key);return o<0?(r.left=t.left,r.right=t,t.left=null):o>=0&&(r.right=t.right,r.left=t,t.right=null),r}function Ei(i,e,t){var n=null,r=null;if(e){e=Me(i,e,t);var o=t(e.key,i);o===0?(n=e.left,r=e.right):o<0?(r=e.right,e.right=null,n=e):(n=e.left,e.left=null,r=e)}return{left:n,right:r}}function hr(i,e,t){return e===null?i:(i===null||(e=Me(i.key,e,t),e.left=i),e)}function Mt(i,e,t,n,r){if(i){n(""+e+(t?"└── ":"├── ")+r(i)+`
22
- `);var o=e+(t?" ":"│ ");i.left&&Mt(i.left,o,!1,n,r),i.right&&Mt(i.right,o,!0,n,r)}}var Ct=function(){function i(e){e===void 0&&(e=dr),this._root=null,this._size=0,this._comparator=e}return i.prototype.insert=function(e,t){return this._size++,this._root=xt(e,t,this._root,this._comparator)},i.prototype.add=function(e,t){var n=new xe(e,t);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var r=this._comparator,o=Me(e,this._root,r),u=r(e,o.key);return u===0?this._root=o:(u<0?(n.left=o.left,n.right=o,o.left=null):u>0&&(n.right=o.right,n.left=o,o.right=null),this._size++,this._root=n),this._root},i.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},i.prototype._remove=function(e,t,n){var r;if(t===null)return null;t=Me(e,t,n);var o=n(e,t.key);return o===0?(t.left===null?r=t.right:(r=Me(e,t.left,n),r.right=t.right),this._size--,r):t},i.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=Me(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},i.prototype.findStatic=function(e){for(var t=this._root,n=this._comparator;t;){var r=n(e,t.key);if(r===0)return t;r<0?t=t.left:t=t.right}return null},i.prototype.find=function(e){return this._root&&(this._root=Me(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root},i.prototype.contains=function(e){for(var t=this._root,n=this._comparator;t;){var r=n(e,t.key);if(r===0)return!0;r<0?t=t.left:t=t.right}return!1},i.prototype.forEach=function(e,t){for(var n=this._root,r=[],o=!1;!o;)n!==null?(r.push(n),n=n.left):r.length!==0?(n=r.pop(),e.call(t,n),n=n.right):o=!0;return this},i.prototype.range=function(e,t,n,r){for(var o=[],u=this._comparator,s=this._root,c;o.length!==0||s;)if(s)o.push(s),s=s.left;else{if(s=o.pop(),c=u(s.key,t),c>0)break;if(u(s.key,e)>=0&&n.call(r,s))return this;s=s.right}return this},i.prototype.keys=function(){var e=[];return this.forEach(function(t){var n=t.key;return e.push(n)}),e},i.prototype.values=function(){var e=[];return this.forEach(function(t){var n=t.data;return e.push(n)}),e},i.prototype.min=function(){return this._root?this.minNode(this._root).key:null},i.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},i.prototype.minNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.left;)e=e.left;return e},i.prototype.maxNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.right;)e=e.right;return e},i.prototype.at=function(e){for(var t=this._root,n=!1,r=0,o=[];!n;)if(t)o.push(t),t=t.left;else if(o.length>0){if(t=o.pop(),r===e)return t;r++,t=t.right}else n=!0;return null},i.prototype.next=function(e){var t=this._root,n=null;if(e.right){for(n=e.right;n.left;)n=n.left;return n}for(var r=this._comparator;t;){var o=r(e.key,t.key);if(o===0)break;o<0?(n=t,t=t.left):t=t.right}return n},i.prototype.prev=function(e){var t=this._root,n=null;if(e.left!==null){for(n=e.left;n.right;)n=n.right;return n}for(var r=this._comparator;t;){var o=r(e.key,t.key);if(o===0)break;o<0?t=t.left:(n=t,t=t.right)}return n},i.prototype.clear=function(){return this._root=null,this._size=0,this},i.prototype.toList=function(){return gr(this._root)},i.prototype.load=function(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!1);var r=e.length,o=this._comparator;if(n&&Tt(e,t,0,r-1,o),this._root===null)this._root=kt(e,t,0,r),this._size=r;else{var u=yr(this.toList(),mr(e,t),o);r=this._size+r,this._root=Nt({head:u},0,r)}return this},i.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(i.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),i.prototype.toString=function(e){e===void 0&&(e=function(n){return String(n.key)});var t=[];return Mt(this._root,"",!0,function(n){return t.push(n)},e),t.join("")},i.prototype.update=function(e,t,n){var r=this._comparator,o=Ei(e,this._root,r),u=o.left,s=o.right;r(e,t)<0?s=xt(t,n,s,r):u=xt(t,n,u,r),this._root=hr(u,s,r)},i.prototype.split=function(e){return Ei(e,this._root,this._comparator)},i.prototype[Symbol.iterator]=function(){var e,t,n;return fr(this,function(r){switch(r.label){case 0:e=this._root,t=[],n=!1,r.label=1;case 1:return n?[3,6]:e===null?[3,2]:(t.push(e),e=e.left,[3,5]);case 2:return t.length===0?[3,4]:(e=t.pop(),[4,e]);case 3:return r.sent(),e=e.right,[3,5];case 4:n=!0,r.label=5;case 5:return[3,1];case 6:return[2]}})},i}();function kt(i,e,t,n){var r=n-t;if(r>0){var o=t+Math.floor(r/2),u=i[o],s=e[o],c=new xe(u,s);return c.left=kt(i,e,t,o),c.right=kt(i,e,o+1,n),c}return null}function mr(i,e){for(var t=new xe(null,null),n=t,r=0;r<i.length;r++)n=n.next=new xe(i[r],e[r]);return n.next=null,t.next}function gr(i){for(var e=i,t=[],n=!1,r=new xe(null,null),o=r;!n;)e?(t.push(e),e=e.left):t.length>0?(e=o=o.next=t.pop(),e=e.right):n=!0;return o.next=null,r.next}function Nt(i,e,t){var n=t-e;if(n>0){var r=e+Math.floor(n/2),o=Nt(i,e,r),u=i.head;return u.left=o,i.head=i.head.next,u.right=Nt(i,r+1,t),u}return null}function yr(i,e,t){for(var n=new xe(null,null),r=n,o=i,u=e;o!==null&&u!==null;)t(o.key,u.key)<0?(r.next=o,o=o.next):(r.next=u,u=u.next),r=r.next;return o!==null?r.next=o:u!==null&&(r.next=u),n.next}function Tt(i,e,t,n,r){if(!(t>=n)){for(var o=i[t+n>>1],u=t-1,s=n+1;;){do u++;while(r(i[u],o)<0);do s--;while(r(i[s],o)>0);if(u>=s)break;var c=i[u];i[u]=i[s],i[s]=c,c=e[u],e[u]=e[s],e[s]=c}Tt(i,e,t,s,r),Tt(i,e,s+1,n,r)}}const ve=11102230246251565e-32,$=134217729,pr=(3+8*ve)*ve;function Pt(i,e,t,n,r){let o,u,s,c,l=e[0],d=n[0],a=0,f=0;d>l==d>-l?(o=l,l=e[++a]):(o=d,d=n[++f]);let h=0;if(a<i&&f<t)for(d>l==d>-l?(u=l+o,s=o-(u-l),l=e[++a]):(u=d+o,s=o-(u-d),d=n[++f]),o=u,s!==0&&(r[h++]=s);a<i&&f<t;)d>l==d>-l?(u=o+l,c=u-o,s=o-(u-c)+(l-c),l=e[++a]):(u=o+d,c=u-o,s=o-(u-c)+(d-c),d=n[++f]),o=u,s!==0&&(r[h++]=s);for(;a<i;)u=o+l,c=u-o,s=o-(u-c)+(l-c),l=e[++a],o=u,s!==0&&(r[h++]=s);for(;f<t;)u=o+d,c=u-o,s=o-(u-c)+(d-c),d=n[++f],o=u,s!==0&&(r[h++]=s);return(o!==0||h===0)&&(r[h++]=o),h}function br(i,e){let t=e[0];for(let n=1;n<i;n++)t+=e[n];return t}function Xe(i){return new Float64Array(i)}const vr=(3+16*ve)*ve,wr=(2+12*ve)*ve,_r=(9+64*ve)*ve*ve,De=Xe(4),Li=Xe(8),Si=Xe(12),xi=Xe(16),te=Xe(4);function Er(i,e,t,n,r,o,u){let s,c,l,d,a,f,h,g,y,v,b,E,L,_,C,x,S,w;const k=i-r,I=t-r,F=e-o,j=n-o;_=k*j,f=$*k,h=f-(f-k),g=k-h,f=$*j,y=f-(f-j),v=j-y,C=g*v-(_-h*y-g*y-h*v),x=F*I,f=$*F,h=f-(f-F),g=F-h,f=$*I,y=f-(f-I),v=I-y,S=g*v-(x-h*y-g*y-h*v),b=C-S,a=C-b,De[0]=C-(b+a)+(a-S),E=_+b,a=E-_,L=_-(E-a)+(b-a),b=L-x,a=L-b,De[1]=L-(b+a)+(a-x),w=E+b,a=w-E,De[2]=E-(w-a)+(b-a),De[3]=w;let O=br(4,De),M=wr*u;if(O>=M||-O>=M||(a=i-k,s=i-(k+a)+(a-r),a=t-I,l=t-(I+a)+(a-r),a=e-F,c=e-(F+a)+(a-o),a=n-j,d=n-(j+a)+(a-o),s===0&&c===0&&l===0&&d===0)||(M=_r*u+pr*Math.abs(O),O+=k*d+j*s-(F*l+I*c),O>=M||-O>=M))return O;_=s*j,f=$*s,h=f-(f-s),g=s-h,f=$*j,y=f-(f-j),v=j-y,C=g*v-(_-h*y-g*y-h*v),x=c*I,f=$*c,h=f-(f-c),g=c-h,f=$*I,y=f-(f-I),v=I-y,S=g*v-(x-h*y-g*y-h*v),b=C-S,a=C-b,te[0]=C-(b+a)+(a-S),E=_+b,a=E-_,L=_-(E-a)+(b-a),b=L-x,a=L-b,te[1]=L-(b+a)+(a-x),w=E+b,a=w-E,te[2]=E-(w-a)+(b-a),te[3]=w;const q=Pt(4,De,4,te,Li);_=k*d,f=$*k,h=f-(f-k),g=k-h,f=$*d,y=f-(f-d),v=d-y,C=g*v-(_-h*y-g*y-h*v),x=F*l,f=$*F,h=f-(f-F),g=F-h,f=$*l,y=f-(f-l),v=l-y,S=g*v-(x-h*y-g*y-h*v),b=C-S,a=C-b,te[0]=C-(b+a)+(a-S),E=_+b,a=E-_,L=_-(E-a)+(b-a),b=L-x,a=L-b,te[1]=L-(b+a)+(a-x),w=E+b,a=w-E,te[2]=E-(w-a)+(b-a),te[3]=w;const re=Pt(q,Li,4,te,Si);_=s*d,f=$*s,h=f-(f-s),g=s-h,f=$*d,y=f-(f-d),v=d-y,C=g*v-(_-h*y-g*y-h*v),x=c*l,f=$*c,h=f-(f-c),g=c-h,f=$*l,y=f-(f-l),v=l-y,S=g*v-(x-h*y-g*y-h*v),b=C-S,a=C-b,te[0]=C-(b+a)+(a-S),E=_+b,a=E-_,L=_-(E-a)+(b-a),b=L-x,a=L-b,te[1]=L-(b+a)+(a-x),w=E+b,a=w-E,te[2]=E-(w-a)+(b-a),te[3]=w;const Ne=Pt(re,Si,4,te,xi);return xi[Ne-1]}function Lr(i,e,t,n,r,o){const u=(e-o)*(t-r),s=(i-r)*(n-o),c=u-s,l=Math.abs(u+s);return Math.abs(c)>=vr*l?c:-Er(i,e,t,n,r,o,l)}const Ke=(i,e)=>i.ll.x<=e.x&&e.x<=i.ur.x&&i.ll.y<=e.y&&e.y<=i.ur.y,Rt=(i,e)=>{if(e.ur.x<i.ll.x||i.ur.x<e.ll.x||e.ur.y<i.ll.y||i.ur.y<e.ll.y)return null;const t=i.ll.x<e.ll.x?e.ll.x:i.ll.x,n=i.ur.x<e.ur.x?i.ur.x:e.ur.x,r=i.ll.y<e.ll.y?e.ll.y:i.ll.y,o=i.ur.y<e.ur.y?i.ur.y:e.ur.y;return{ll:{x:t,y:r},ur:{x:n,y:o}}};let Ce=Number.EPSILON;Ce===void 0&&(Ce=Math.pow(2,-52));const Sr=Ce*Ce,Mi=(i,e)=>{if(-Ce<i&&i<Ce&&-Ce<e&&e<Ce)return 0;const t=i-e;return t*t<Sr*i*e?0:i<e?-1:1};class xr{constructor(){this.reset()}reset(){this.xRounder=new Ci,this.yRounder=new Ci}round(e,t){return{x:this.xRounder.round(e),y:this.yRounder.round(t)}}}class Ci{constructor(){this.tree=new Ct,this.round(0)}round(e){const t=this.tree.add(e),n=this.tree.prev(t);if(n!==null&&Mi(t.key,n.key)===0)return this.tree.remove(e),n.key;const r=this.tree.next(t);return r!==null&&Mi(t.key,r.key)===0?(this.tree.remove(e),r.key):e}}const Je=new xr,ot=(i,e)=>i.x*e.y-i.y*e.x,ki=(i,e)=>i.x*e.x+i.y*e.y,Ni=(i,e,t)=>{const n=Lr(i.x,i.y,e.x,e.y,t.x,t.y);return n>0?-1:n<0?1:0},st=i=>Math.sqrt(ki(i,i)),Mr=(i,e,t)=>{const n={x:e.x-i.x,y:e.y-i.y},r={x:t.x-i.x,y:t.y-i.y};return ot(r,n)/st(r)/st(n)},Cr=(i,e,t)=>{const n={x:e.x-i.x,y:e.y-i.y},r={x:t.x-i.x,y:t.y-i.y};return ki(r,n)/st(r)/st(n)},Ti=(i,e,t)=>e.y===0?null:{x:i.x+e.x/e.y*(t-i.y),y:t},Pi=(i,e,t)=>e.x===0?null:{x:t,y:i.y+e.y/e.x*(t-i.x)},kr=(i,e,t,n)=>{if(e.x===0)return Pi(t,n,i.x);if(n.x===0)return Pi(i,e,t.x);if(e.y===0)return Ti(t,n,i.y);if(n.y===0)return Ti(i,e,t.y);const r=ot(e,n);if(r==0)return null;const o={x:t.x-i.x,y:t.y-i.y},u=ot(o,e)/r,s=ot(o,n)/r,c=i.x+s*e.x,l=t.x+u*n.x,d=i.y+s*e.y,a=t.y+u*n.y,f=(c+l)/2,h=(d+a)/2;return{x:f,y:h}};class le{static compare(e,t){const n=le.comparePoints(e.point,t.point);return n!==0?n:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:ke.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0}constructor(e,t){e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let n=0,r=t.length;n<r;n++){const o=t[n];this.point.events.push(o),o.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let t=0;t<e;t++){const n=this.point.events[t];if(n.segment.consumedBy===void 0)for(let r=t+1;r<e;r++){const o=this.point.events[r];o.consumedBy===void 0&&n.otherSE.point.events===o.otherSE.point.events&&n.segment.consume(o.segment)}}}getAvailableLinkedEvents(){const e=[];for(let t=0,n=this.point.events.length;t<n;t++){const r=this.point.events[t];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&e.push(r)}return e}getLeftmostComparator(e){const t=new Map,n=r=>{const o=r.otherSE;t.set(r,{sine:Mr(this.point,e.point,o.point),cosine:Cr(this.point,e.point,o.point)})};return(r,o)=>{t.has(r)||n(r),t.has(o)||n(o);const{sine:u,cosine:s}=t.get(r),{sine:c,cosine:l}=t.get(o);return u>=0&&c>=0?s<l?1:s>l?-1:0:u<0&&c<0?s<l?-1:s>l?1:0:c<u?-1:c>u?1:0}}}let Nr=0;class ke{static compare(e,t){const n=e.leftSE.point.x,r=t.leftSE.point.x,o=e.rightSE.point.x,u=t.rightSE.point.x;if(u<n)return 1;if(o<r)return-1;const s=e.leftSE.point.y,c=t.leftSE.point.y,l=e.rightSE.point.y,d=t.rightSE.point.y;if(n<r){if(c<s&&c<l)return 1;if(c>s&&c>l)return-1;const a=e.comparePoint(t.leftSE.point);if(a<0)return 1;if(a>0)return-1;const f=t.comparePoint(e.rightSE.point);return f!==0?f:-1}if(n>r){if(s<c&&s<d)return-1;if(s>c&&s>d)return 1;const a=t.comparePoint(e.leftSE.point);if(a!==0)return a;const f=e.comparePoint(t.rightSE.point);return f<0?1:f>0?-1:1}if(s<c)return-1;if(s>c)return 1;if(o<u){const a=t.comparePoint(e.rightSE.point);if(a!==0)return a}if(o>u){const a=e.comparePoint(t.rightSE.point);if(a<0)return 1;if(a>0)return-1}if(o!==u){const a=l-s,f=o-n,h=d-c,g=u-r;if(a>f&&h<g)return 1;if(a<f&&h>g)return-1}return o>u?1:o<u||l<d?-1:l>d?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,n,r){this.id=++Nr,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=n,this.windings=r}static fromRing(e,t,n){let r,o,u;const s=le.comparePoints(e,t);if(s<0)r=e,o=t,u=1;else if(s>0)r=t,o=e,u=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const c=new le(r,!0),l=new le(o,!1);return new ke(c,l,[n],[u])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<t?e:t},ur:{x:this.rightSE.point.x,y:e>t?e:t}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}comparePoint(e){if(this.isAnEndpoint(e))return 0;const t=this.leftSE.point,n=this.rightSE.point,r=this.vector();if(t.x===n.x)return e.x===t.x?0:e.x<t.x?1:-1;const o=(e.y-t.y)/r.y,u=t.x+o*r.x;if(e.x===u)return 0;const s=(e.x-t.x)/r.x,c=t.y+s*r.y;return e.y===c?0:e.y<c?-1:1}getIntersection(e){const t=this.bbox(),n=e.bbox(),r=Rt(t,n);if(r===null)return null;const o=this.leftSE.point,u=this.rightSE.point,s=e.leftSE.point,c=e.rightSE.point,l=Ke(t,s)&&this.comparePoint(s)===0,d=Ke(n,o)&&e.comparePoint(o)===0,a=Ke(t,c)&&this.comparePoint(c)===0,f=Ke(n,u)&&e.comparePoint(u)===0;if(d&&l)return f&&!a?u:!f&&a?c:null;if(d)return a&&o.x===c.x&&o.y===c.y?null:o;if(l)return f&&u.x===s.x&&u.y===s.y?null:s;if(f&&a)return null;if(f)return u;if(a)return c;const h=kr(o,this.vector(),s,e.vector());return h===null||!Ke(r,h)?null:Je.round(h.x,h.y)}split(e){const t=[],n=e.events!==void 0,r=new le(e,!0),o=new le(e,!1),u=this.rightSE;this.replaceRightSE(o),t.push(o),t.push(r);const s=new ke(r,u,this.rings.slice(),this.windings.slice());return le.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),le.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),o.checkForConsuming()),t}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,n=this.windings.length;t<n;t++)this.windings[t]*=-1}consume(e){let t=this,n=e;for(;t.consumedBy;)t=t.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const r=ke.compare(t,n);if(r!==0){if(r>0){const o=t;t=n,n=o}if(t.prev===n){const o=t;t=n,n=o}for(let o=0,u=n.rings.length;o<u;o++){const s=n.rings[o],c=n.windings[o],l=t.rings.indexOf(s);l===-1?(t.rings.push(s),t.windings.push(c)):t.windings[l]+=c}n.rings=null,n.windings=null,n.consumedBy=t,n.leftSE.consumedBy=t.leftSE,n.rightSE.consumedBy=t.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};const t=this._afterState.rings,n=this._afterState.windings,r=this._afterState.multiPolys;for(let s=0,c=this.rings.length;s<c;s++){const l=this.rings[s],d=this.windings[s],a=t.indexOf(l);a===-1?(t.push(l),n.push(d)):n[a]+=d}const o=[],u=[];for(let s=0,c=t.length;s<c;s++){if(n[s]===0)continue;const l=t[s],d=l.poly;if(u.indexOf(d)===-1)if(l.isExterior)o.push(d);else{u.indexOf(d)===-1&&u.push(d);const a=o.indexOf(l.poly);a!==-1&&o.splice(a,1)}}for(let s=0,c=o.length;s<c;s++){const l=o[s].multiPoly;r.indexOf(l)===-1&&r.push(l)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(de.type){case"union":{const n=e.length===0,r=t.length===0;this._isInResult=n!==r;break}case"intersection":{let n,r;e.length<t.length?(n=e.length,r=t.length):(n=t.length,r=e.length),this._isInResult=r===de.numMultiPolys&&n<r;break}case"xor":{const n=Math.abs(e.length-t.length);this._isInResult=n%2===1;break}case"difference":{const n=r=>r.length===1&&r[0].isSubject;this._isInResult=n(e)!==n(t);break}default:throw new Error(`Unrecognized operation type found ${de.type}`)}return this._isInResult}}class Ri{constructor(e,t,n){if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=n,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const r=Je.round(e[0][0],e[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};let o=r;for(let u=1,s=e.length;u<s;u++){if(typeof e[u][0]!="number"||typeof e[u][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=Je.round(e[u][0],e[u][1]);c.x===o.x&&c.y===o.y||(this.segments.push(ke.fromRing(o,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),o=c)}(r.x!==o.x||r.y!==o.y)&&this.segments.push(ke.fromRing(o,r,this))}getSweepEvents(){const e=[];for(let t=0,n=this.segments.length;t<n;t++){const r=this.segments[t];e.push(r.leftSE),e.push(r.rightSE)}return e}}class Tr{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Ri(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let n=1,r=e.length;n<r;n++){const o=new Ri(e[n],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=t}getSweepEvents(){const e=this.exteriorRing.getSweepEvents();for(let t=0,n=this.interiorRings.length;t<n;t++){const r=this.interiorRings[t].getSweepEvents();for(let o=0,u=r.length;o<u;o++)e.push(r[o])}return e}}class Ii{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof e[0][0][0]=="number"&&(e=[e])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let n=0,r=e.length;n<r;n++){const o=new Tr(e[n],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=t}getSweepEvents(){const e=[];for(let t=0,n=this.polys.length;t<n;t++){const r=this.polys[t].getSweepEvents();for(let o=0,u=r.length;o<u;o++)e.push(r[o])}return e}}class lt{static factory(e){const t=[];for(let n=0,r=e.length;n<r;n++){const o=e[n];if(!o.isInResult()||o.ringOut)continue;let u=null,s=o.leftSE,c=o.rightSE;const l=[s],d=s.point,a=[];for(;u=s,s=c,l.push(s),s.point!==d;)for(;;){const f=s.getAvailableLinkedEvents();if(f.length===0){const y=l[0].point,v=l[l.length-1].point;throw new Error(`Unable to complete output ring starting at [${y.x}, ${y.y}]. Last matching segment found ends at [${v.x}, ${v.y}].`)}if(f.length===1){c=f[0].otherSE;break}let h=null;for(let y=0,v=a.length;y<v;y++)if(a[y].point===s.point){h=y;break}if(h!==null){const y=a.splice(h)[0],v=l.splice(y.index);v.unshift(v[0].otherSE),t.push(new lt(v.reverse()));continue}a.push({index:l.length,point:s.point});const g=s.getLeftmostComparator(u);c=f.sort(g)[0].otherSE;break}t.push(new lt(l))}return t}constructor(e){this.events=e;for(let t=0,n=e.length;t<n;t++)e[t].segment.ringOut=this;this.poly=null}getGeom(){let e=this.events[0].point;const t=[e];for(let l=1,d=this.events.length-1;l<d;l++){const a=this.events[l].point,f=this.events[l+1].point;Ni(a,e,f)!==0&&(t.push(a),e=a)}if(t.length===1)return null;const n=t[0],r=t[1];Ni(n,e,r)===0&&t.shift(),t.push(t[0]);const o=this.isExteriorRing()?1:-1,u=this.isExteriorRing()?0:t.length-1,s=this.isExteriorRing()?t.length:-1,c=[];for(let l=u;l!=s;l+=o)c.push([t[l].x,t[l].y]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){const e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let e=this.events[0];for(let r=1,o=this.events.length;r<o;r++){const u=this.events[r];le.compare(e,u)>0&&(e=u)}let t=e.segment.prevInResult(),n=t?t.prevInResult():null;for(;;){if(!t)return null;if(!n)return t.ringOut;if(n.ringOut!==t.ringOut)return n.ringOut.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut.enclosingRing();t=n.prevInResult(),n=t?t.prevInResult():null}}}class Oi{constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){const e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(let t=0,n=this.interiorRings.length;t<n;t++){const r=this.interiorRings[t].getGeom();r!==null&&e.push(r)}return e}}class Pr{constructor(e){this.rings=e,this.polys=this._composePolys(e)}getGeom(){const e=[];for(let t=0,n=this.polys.length;t<n;t++){const r=this.polys[t].getGeom();r!==null&&e.push(r)}return e}_composePolys(e){const t=[];for(let n=0,r=e.length;n<r;n++){const o=e[n];if(!o.poly)if(o.isExteriorRing())t.push(new Oi(o));else{const u=o.enclosingRing();u.poly||t.push(new Oi(u)),u.poly.addInterior(o)}}return t}}class Rr{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ke.compare;this.queue=e,this.tree=new Ct(t),this.segments=[]}process(e){const t=e.segment,n=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),n;const r=e.isLeft?this.tree.add(t):this.tree.find(t);if(!r)throw new Error(`Unable to find segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] in SweepLine tree.`);let o=r,u=r,s,c;for(;s===void 0;)o=this.tree.prev(o),o===null?s=null:o.key.consumedBy===void 0&&(s=o.key);for(;c===void 0;)u=this.tree.next(u),u===null?c=null:u.key.consumedBy===void 0&&(c=u.key);if(e.isLeft){let l=null;if(s){const a=s.getIntersection(t);if(a!==null&&(t.isAnEndpoint(a)||(l=a),!s.isAnEndpoint(a))){const f=this._splitSafely(s,a);for(let h=0,g=f.length;h<g;h++)n.push(f[h])}}let d=null;if(c){const a=c.getIntersection(t);if(a!==null&&(t.isAnEndpoint(a)||(d=a),!c.isAnEndpoint(a))){const f=this._splitSafely(c,a);for(let h=0,g=f.length;h<g;h++)n.push(f[h])}}if(l!==null||d!==null){let a=null;l===null?a=d:d===null?a=l:a=le.comparePoints(l,d)<=0?l:d,this.queue.remove(t.rightSE),n.push(t.rightSE);const f=t.split(a);for(let h=0,g=f.length;h<g;h++)n.push(f[h])}n.length>0?(this.tree.remove(t),n.push(e)):(this.segments.push(t),t.prev=s)}else{if(s&&c){const l=s.getIntersection(c);if(l!==null){if(!s.isAnEndpoint(l)){const d=this._splitSafely(s,l);for(let a=0,f=d.length;a<f;a++)n.push(d[a])}if(!c.isAnEndpoint(l)){const d=this._splitSafely(c,l);for(let a=0,f=d.length;a<f;a++)n.push(d[a])}}}this.tree.remove(t)}return n}_splitSafely(e,t){this.tree.remove(e);const n=e.rightSE;this.queue.remove(n);const r=e.split(t);return r.push(n),e.consumedBy===void 0&&this.tree.add(e),r}}const Ai=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Ir=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Or{run(e,t,n){de.type=e,Je.reset();const r=[new Ii(t,!0)];for(let a=0,f=n.length;a<f;a++)r.push(new Ii(n[a],!1));if(de.numMultiPolys=r.length,de.type==="difference"){const a=r[0];let f=1;for(;f<r.length;)Rt(r[f].bbox,a.bbox)!==null?f++:r.splice(f,1)}if(de.type==="intersection")for(let a=0,f=r.length;a<f;a++){const h=r[a];for(let g=a+1,y=r.length;g<y;g++)if(Rt(h.bbox,r[g].bbox)===null)return[]}const o=new Ct(le.compare);for(let a=0,f=r.length;a<f;a++){const h=r[a].getSweepEvents();for(let g=0,y=h.length;g<y;g++)if(o.insert(h[g]),o.size>Ai)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const u=new Rr(o);let s=o.size,c=o.pop();for(;c;){const a=c.key;if(o.size===s){const h=a.segment;throw new Error(`Unable to pop() ${a.isLeft?"left":"right"} SweepEvent [${a.point.x}, ${a.point.y}] from segment #${h.id} [${h.leftSE.point.x}, ${h.leftSE.point.y}] -> [${h.rightSE.point.x}, ${h.rightSE.point.y}] from queue.`)}if(o.size>Ai)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(u.segments.length>Ir)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=u.process(a);for(let h=0,g=f.length;h<g;h++){const y=f[h];y.consumedBy===void 0&&o.insert(y)}s=o.size,c=o.pop()}Je.reset();const l=lt.factory(u.segments);return new Pr(l).getGeom()}}const de=new Or;var Wi={union:function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return de.run("union",i,t)},intersection:function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return de.run("intersection",i,t)},xor:function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return de.run("xor",i,t)},difference:function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return de.run("difference",i,t)}};function Ar(i,e={}){const t=[];if(Et(i,r=>{t.push(r.coordinates)}),t.length<2)throw new Error("Must have at least 2 geometries");const n=Wi.union(t[0],...t.slice(1));return n.length===0?null:n.length===1?_t(n[0],e.properties):pi(n,e.properties)}var zi=Ar;function Wr(i){const e=[];if(Et(i,r=>{e.push(r.coordinates)}),e.length<2)throw new Error("Must have at least two features");const t=i.features[0].properties||{},n=Wi.difference(e[0],...e.slice(1));return n.length===0?null:n.length===1?_t(n[0],t):pi(n,t)}var zr=Wr;function Br(i){if(!i)throw new Error("geojson is required");var e=[];return sr(i,function(t){e.push(t)}),Ye(e)}var Dr=Br;function Bi(i,e){const t=zr(Ye([_t([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),i]));if(!t)return;t.properties={isMask:!0};const n=Ze(Lt(i)),r=(n[2]-n[0])/360/1e3,o=n[0]<-180,u=n[2]>180,s=Dr(i);if(s.features.length>1&&(o||u))for(const c of s.features){const l=Ze(Lt(c));if(u&&l[0]<-180+r)for(const d of c.geometry.coordinates)for(const a of d)a[0]+=360-r;if(o&&l[2]>180-r)for(const d of c.geometry.coordinates)for(const a of d)a[0]-=360-r}e(Ye([s.features.length<2?i:zi(s)??i,t]))}const Di=i=>{var n,r,o;const e=(n=i==null?void 0:i.geometry)==null?void 0:n.type,t=(r=i==null?void 0:i.properties)!=null&&r.isMask?0:e==="LineString"||e==="MultiLineString"?3:2;return{color:"#3170fe",fillColor:"#000",fillOpacity:(o=i==null?void 0:i.properties)!=null&&o.isMask?.1:0,weight:t,dashArray:[t,t],lineCap:"butt"}};function Ui(i,e=!0,t=!0,n={},r={},o=Di,u=!1){let s;const c=[];let l,d;const a=ie.geoJSON(void 0,{style:o===!0?Di:o===!1?void 0:o??void 0,interactive:!1}).addTo(i),f=g=>{s==null||s({type:"mapClick",coordinates:[g.latlng.lng,g.latlng.lat]})};function h(g,y=!1){const v=document.createElement("div");return new An({props:{displayIn:"leaflet"},target:v}),new ie.Marker(g,{interactive:y,icon:new ie.DivIcon({html:v,className:"",iconAnchor:[12,26],iconSize:[25,30],tooltipAnchor:[1,-24]})})}return{setEventHandler(g){g?(s=g,i.on("click",f)):(s=void 0,i.off("click",f))},flyTo(g,y){i.flyTo([g[1],g[0]],y,{duration:2,...n})},fitBounds(g,y,v){i.flyToBounds([[g[1],g[0]],[g[3],g[2]]],{padding:[y,y],duration:2,...v?{maxZoom:v}:{},...r})},indicateReverse(g){i.getContainer().style.cursor=g?"crosshair":""},setReverseMarker(g){var v;if(!e)return;const y=g&&[g[1],g[0]];d?y?d.setLatLng(y):(d.remove(),d=void 0):y&&(e instanceof Function?d=e(i)??void 0:(d=(typeof e=="object"?new ie.Marker(y,e):h(y)).addTo(i),(v=d.getElement())==null||v.classList.add("marker-reverse")))},setMarkers(g,y){function v(b){a.clearLayers(),b&&a.addData(b)}for(const b of c)b.remove();if(c.length=0,v(),y){let b=!1;if(y.geometry.type==="GeometryCollection"){const E=y.geometry.geometries.filter(L=>L.type==="Polygon"||L.type==="MultiPolygon");e:if(E.length>0){const L=zi(Ye(E.map(_=>Ve(_))));if(!L)break e;Bi({...y,geometry:L.geometry},v),b=!0}else{const L=y.geometry.geometries.filter(_=>_.type==="LineString"||_.type==="MultiLineString");L.length>0&&(v({...y,geometry:{type:"GeometryCollection",geometries:L}}),b=!0)}}if(!b){if(y.geometry.type==="Polygon"||y.geometry.type==="MultiPolygon")Bi(y,E=>{if(!E)return;const L=[...E.features],_=Ze(Lt(y)),C=_[2]-_[0];_[0]-C/4<-180&&L.push(...Fi(E,-360).features),_[2]+C/4>180&&L.push(...Fi(E,360).features),v(Ye(L))});else if(y.geometry.type==="LineString"||y.geometry.type==="MultiLineString"){v(y);return}}if(!u&&y.geometry.type!=="Point")return;if(e instanceof Function){const E=e(i,y);E&&c.push(E.addTo(i))}else if(e){const E=[y.center[1],y.center[0]];c.push(typeof e=="object"?new ie.Marker(E,e):h(E).addTo(i))}}if(t)for(const b of g??[]){if(b===y)continue;const E=[b.center[1],b.center[0]];let L;if(t instanceof Function){if(L=t(i,b),!L)continue}else L=(typeof t=="object"?new ie.Marker(E,t):h(E,!0)).addTo(i).bindTooltip(b.place_type[0]==="reverse"?b.place_name:b.place_name.replace(/,.*/,""),{direction:"top"});const _=L.getElement();_&&(_.addEventListener("click",C=>{C.stopPropagation(),s==null||s({type:"markerClick",id:b.id})}),_.addEventListener("mouseenter",()=>{s==null||s({type:"markerMouseEnter",id:b.id})}),_.addEventListener("mouseleave",()=>{s==null||s({type:"markerMouseLeave",id:b.id})}),_.classList.toggle("marker-fuzzy",!!b.matching_text)),c.push(L)}},setSelectedMarker(g){var y,v;l&&((y=l.getElement())==null||y.classList.toggle("marker-selected",!1)),l=g>-1?c[g]:void 0,(v=l==null?void 0:l.getElement())==null||v.classList.toggle("marker-selected",!0)},getCenterAndZoom(){const g=i.getCenter();return[i.getZoom(),g.lng,g.lat]}}}function Fi(i,e){const t=cr(i);for(const n of t.features)if(n.geometry.type=="MultiPolygon")for(const r of n.geometry.coordinates)Gi(r,e);else Gi(n.geometry.coordinates,e);return t}function Gi(i,e){for(const t of i)for(const n of t)n[0]+=e}class ji extends ie.Control{}ie.Util.extend(ji.prototype,ie.Evented.prototype);class qi extends ji{constructor(t){super(t);Zt(this,ue);Zt(this,Ie);gt(this,Ie,t)}onAdd(t){const n=document.createElement("div");n.className="leaflet-ctrl-geocoder",ie.DomEvent.disableClickPropagation(n),ie.DomEvent.disableScrollPropagation(n);const{marker:r,showResultMarkers:o,flyTo:u,fullGeometryStyle:s,position:c,...l}=he(this,Ie),d=typeof u=="boolean"?{}:u,a=Ui(t,r,o,d,d,s,l.pickedResultStyle==="full-geometry-including-polygon-center-marker");gt(this,ue,new or({target:n,props:{mapController:a,flyTo:u===void 0?!0:!!u,...l}}));const f={select:void 0,pick:void 0,featureslisted:void 0,featuresmarked:void 0,response:void 0,optionsvisibilitychange:void 0,reversetoggle:void 0,querychange:void 0};for(const h in f)he(this,ue).$on(h,g=>this.fire(h,g.detail));return n}setOptions(t){var c;gt(this,Ie,t);const{marker:n,showResultMarkers:r,flyTo:o,fullGeometryStyle:u,...s}=he(this,Ie);(c=he(this,ue))==null||c.$set(s)}setQuery(t,n=!0){var r;(r=he(this,ue))==null||r.setQuery(t,n)}clearMap(){var t;(t=he(this,ue))==null||t.clearMap()}clearList(){var t;(t=he(this,ue))==null||t.clearList()}focus(){var t;(t=he(this,ue))==null||t.focus()}blur(){var t;(t=he(this,ue))==null||t.blur()}onRemove(){var t;(t=he(this,ue))==null||t.$destroy()}}ue=new WeakMap,Ie=new WeakMap;function Ur(...i){return new qi(...i)}window.L&&typeof window.L=="object"&&typeof window.L.control=="function"&&(window.L.control.maptilerGeocoding=Ur),A.GeocodingControl=qi,A.createLeafletMapController=Ui,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
22
+ `);var o=e+(t?" ":"│ ");i.left&&Mt(i.left,o,!1,n,r),i.right&&Mt(i.right,o,!0,n,r)}}var Ct=function(){function i(e){e===void 0&&(e=dr),this._root=null,this._size=0,this._comparator=e}return i.prototype.insert=function(e,t){return this._size++,this._root=xt(e,t,this._root,this._comparator)},i.prototype.add=function(e,t){var n=new xe(e,t);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var r=this._comparator,o=Me(e,this._root,r),u=r(e,o.key);return u===0?this._root=o:(u<0?(n.left=o.left,n.right=o,o.left=null):u>0&&(n.right=o.right,n.left=o,o.right=null),this._size++,this._root=n),this._root},i.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},i.prototype._remove=function(e,t,n){var r;if(t===null)return null;t=Me(e,t,n);var o=n(e,t.key);return o===0?(t.left===null?r=t.right:(r=Me(e,t.left,n),r.right=t.right),this._size--,r):t},i.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=Me(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},i.prototype.findStatic=function(e){for(var t=this._root,n=this._comparator;t;){var r=n(e,t.key);if(r===0)return t;r<0?t=t.left:t=t.right}return null},i.prototype.find=function(e){return this._root&&(this._root=Me(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root},i.prototype.contains=function(e){for(var t=this._root,n=this._comparator;t;){var r=n(e,t.key);if(r===0)return!0;r<0?t=t.left:t=t.right}return!1},i.prototype.forEach=function(e,t){for(var n=this._root,r=[],o=!1;!o;)n!==null?(r.push(n),n=n.left):r.length!==0?(n=r.pop(),e.call(t,n),n=n.right):o=!0;return this},i.prototype.range=function(e,t,n,r){for(var o=[],u=this._comparator,s=this._root,c;o.length!==0||s;)if(s)o.push(s),s=s.left;else{if(s=o.pop(),c=u(s.key,t),c>0)break;if(u(s.key,e)>=0&&n.call(r,s))return this;s=s.right}return this},i.prototype.keys=function(){var e=[];return this.forEach(function(t){var n=t.key;return e.push(n)}),e},i.prototype.values=function(){var e=[];return this.forEach(function(t){var n=t.data;return e.push(n)}),e},i.prototype.min=function(){return this._root?this.minNode(this._root).key:null},i.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},i.prototype.minNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.left;)e=e.left;return e},i.prototype.maxNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.right;)e=e.right;return e},i.prototype.at=function(e){for(var t=this._root,n=!1,r=0,o=[];!n;)if(t)o.push(t),t=t.left;else if(o.length>0){if(t=o.pop(),r===e)return t;r++,t=t.right}else n=!0;return null},i.prototype.next=function(e){var t=this._root,n=null;if(e.right){for(n=e.right;n.left;)n=n.left;return n}for(var r=this._comparator;t;){var o=r(e.key,t.key);if(o===0)break;o<0?(n=t,t=t.left):t=t.right}return n},i.prototype.prev=function(e){var t=this._root,n=null;if(e.left!==null){for(n=e.left;n.right;)n=n.right;return n}for(var r=this._comparator;t;){var o=r(e.key,t.key);if(o===0)break;o<0?t=t.left:(n=t,t=t.right)}return n},i.prototype.clear=function(){return this._root=null,this._size=0,this},i.prototype.toList=function(){return gr(this._root)},i.prototype.load=function(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!1);var r=e.length,o=this._comparator;if(n&&Tt(e,t,0,r-1,o),this._root===null)this._root=kt(e,t,0,r),this._size=r;else{var u=yr(this.toList(),mr(e,t),o);r=this._size+r,this._root=Nt({head:u},0,r)}return this},i.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(i.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),i.prototype.toString=function(e){e===void 0&&(e=function(n){return String(n.key)});var t=[];return Mt(this._root,"",!0,function(n){return t.push(n)},e),t.join("")},i.prototype.update=function(e,t,n){var r=this._comparator,o=Ei(e,this._root,r),u=o.left,s=o.right;r(e,t)<0?s=xt(t,n,s,r):u=xt(t,n,u,r),this._root=hr(u,s,r)},i.prototype.split=function(e){return Ei(e,this._root,this._comparator)},i.prototype[Symbol.iterator]=function(){var e,t,n;return fr(this,function(r){switch(r.label){case 0:e=this._root,t=[],n=!1,r.label=1;case 1:return n?[3,6]:e===null?[3,2]:(t.push(e),e=e.left,[3,5]);case 2:return t.length===0?[3,4]:(e=t.pop(),[4,e]);case 3:return r.sent(),e=e.right,[3,5];case 4:n=!0,r.label=5;case 5:return[3,1];case 6:return[2]}})},i}();function kt(i,e,t,n){var r=n-t;if(r>0){var o=t+Math.floor(r/2),u=i[o],s=e[o],c=new xe(u,s);return c.left=kt(i,e,t,o),c.right=kt(i,e,o+1,n),c}return null}function mr(i,e){for(var t=new xe(null,null),n=t,r=0;r<i.length;r++)n=n.next=new xe(i[r],e[r]);return n.next=null,t.next}function gr(i){for(var e=i,t=[],n=!1,r=new xe(null,null),o=r;!n;)e?(t.push(e),e=e.left):t.length>0?(e=o=o.next=t.pop(),e=e.right):n=!0;return o.next=null,r.next}function Nt(i,e,t){var n=t-e;if(n>0){var r=e+Math.floor(n/2),o=Nt(i,e,r),u=i.head;return u.left=o,i.head=i.head.next,u.right=Nt(i,r+1,t),u}return null}function yr(i,e,t){for(var n=new xe(null,null),r=n,o=i,u=e;o!==null&&u!==null;)t(o.key,u.key)<0?(r.next=o,o=o.next):(r.next=u,u=u.next),r=r.next;return o!==null?r.next=o:u!==null&&(r.next=u),n.next}function Tt(i,e,t,n,r){if(!(t>=n)){for(var o=i[t+n>>1],u=t-1,s=n+1;;){do u++;while(r(i[u],o)<0);do s--;while(r(i[s],o)>0);if(u>=s)break;var c=i[u];i[u]=i[s],i[s]=c,c=e[u],e[u]=e[s],e[s]=c}Tt(i,e,t,s,r),Tt(i,e,s+1,n,r)}}const be=11102230246251565e-32,$=134217729,pr=(3+8*be)*be;function Pt(i,e,t,n,r){let o,u,s,c,l=e[0],d=n[0],a=0,f=0;d>l==d>-l?(o=l,l=e[++a]):(o=d,d=n[++f]);let h=0;if(a<i&&f<t)for(d>l==d>-l?(u=l+o,s=o-(u-l),l=e[++a]):(u=d+o,s=o-(u-d),d=n[++f]),o=u,s!==0&&(r[h++]=s);a<i&&f<t;)d>l==d>-l?(u=o+l,c=u-o,s=o-(u-c)+(l-c),l=e[++a]):(u=o+d,c=u-o,s=o-(u-c)+(d-c),d=n[++f]),o=u,s!==0&&(r[h++]=s);for(;a<i;)u=o+l,c=u-o,s=o-(u-c)+(l-c),l=e[++a],o=u,s!==0&&(r[h++]=s);for(;f<t;)u=o+d,c=u-o,s=o-(u-c)+(d-c),d=n[++f],o=u,s!==0&&(r[h++]=s);return(o!==0||h===0)&&(r[h++]=o),h}function vr(i,e){let t=e[0];for(let n=1;n<i;n++)t+=e[n];return t}function Xe(i){return new Float64Array(i)}const br=(3+16*be)*be,wr=(2+12*be)*be,_r=(9+64*be)*be*be,De=Xe(4),Li=Xe(8),Si=Xe(12),xi=Xe(16),te=Xe(4);function Er(i,e,t,n,r,o,u){let s,c,l,d,a,f,h,g,y,b,v,E,L,_,C,x,S,w;const k=i-r,I=t-r,F=e-o,j=n-o;_=k*j,f=$*k,h=f-(f-k),g=k-h,f=$*j,y=f-(f-j),b=j-y,C=g*b-(_-h*y-g*y-h*b),x=F*I,f=$*F,h=f-(f-F),g=F-h,f=$*I,y=f-(f-I),b=I-y,S=g*b-(x-h*y-g*y-h*b),v=C-S,a=C-v,De[0]=C-(v+a)+(a-S),E=_+v,a=E-_,L=_-(E-a)+(v-a),v=L-x,a=L-v,De[1]=L-(v+a)+(a-x),w=E+v,a=w-E,De[2]=E-(w-a)+(v-a),De[3]=w;let O=vr(4,De),M=wr*u;if(O>=M||-O>=M||(a=i-k,s=i-(k+a)+(a-r),a=t-I,l=t-(I+a)+(a-r),a=e-F,c=e-(F+a)+(a-o),a=n-j,d=n-(j+a)+(a-o),s===0&&c===0&&l===0&&d===0)||(M=_r*u+pr*Math.abs(O),O+=k*d+j*s-(F*l+I*c),O>=M||-O>=M))return O;_=s*j,f=$*s,h=f-(f-s),g=s-h,f=$*j,y=f-(f-j),b=j-y,C=g*b-(_-h*y-g*y-h*b),x=c*I,f=$*c,h=f-(f-c),g=c-h,f=$*I,y=f-(f-I),b=I-y,S=g*b-(x-h*y-g*y-h*b),v=C-S,a=C-v,te[0]=C-(v+a)+(a-S),E=_+v,a=E-_,L=_-(E-a)+(v-a),v=L-x,a=L-v,te[1]=L-(v+a)+(a-x),w=E+v,a=w-E,te[2]=E-(w-a)+(v-a),te[3]=w;const q=Pt(4,De,4,te,Li);_=k*d,f=$*k,h=f-(f-k),g=k-h,f=$*d,y=f-(f-d),b=d-y,C=g*b-(_-h*y-g*y-h*b),x=F*l,f=$*F,h=f-(f-F),g=F-h,f=$*l,y=f-(f-l),b=l-y,S=g*b-(x-h*y-g*y-h*b),v=C-S,a=C-v,te[0]=C-(v+a)+(a-S),E=_+v,a=E-_,L=_-(E-a)+(v-a),v=L-x,a=L-v,te[1]=L-(v+a)+(a-x),w=E+v,a=w-E,te[2]=E-(w-a)+(v-a),te[3]=w;const re=Pt(q,Li,4,te,Si);_=s*d,f=$*s,h=f-(f-s),g=s-h,f=$*d,y=f-(f-d),b=d-y,C=g*b-(_-h*y-g*y-h*b),x=c*l,f=$*c,h=f-(f-c),g=c-h,f=$*l,y=f-(f-l),b=l-y,S=g*b-(x-h*y-g*y-h*b),v=C-S,a=C-v,te[0]=C-(v+a)+(a-S),E=_+v,a=E-_,L=_-(E-a)+(v-a),v=L-x,a=L-v,te[1]=L-(v+a)+(a-x),w=E+v,a=w-E,te[2]=E-(w-a)+(v-a),te[3]=w;const Ne=Pt(re,Si,4,te,xi);return xi[Ne-1]}function Lr(i,e,t,n,r,o){const u=(e-o)*(t-r),s=(i-r)*(n-o),c=u-s,l=Math.abs(u+s);return Math.abs(c)>=br*l?c:-Er(i,e,t,n,r,o,l)}const Ke=(i,e)=>i.ll.x<=e.x&&e.x<=i.ur.x&&i.ll.y<=e.y&&e.y<=i.ur.y,Rt=(i,e)=>{if(e.ur.x<i.ll.x||i.ur.x<e.ll.x||e.ur.y<i.ll.y||i.ur.y<e.ll.y)return null;const t=i.ll.x<e.ll.x?e.ll.x:i.ll.x,n=i.ur.x<e.ur.x?i.ur.x:e.ur.x,r=i.ll.y<e.ll.y?e.ll.y:i.ll.y,o=i.ur.y<e.ur.y?i.ur.y:e.ur.y;return{ll:{x:t,y:r},ur:{x:n,y:o}}};let Ce=Number.EPSILON;Ce===void 0&&(Ce=Math.pow(2,-52));const Sr=Ce*Ce,Mi=(i,e)=>{if(-Ce<i&&i<Ce&&-Ce<e&&e<Ce)return 0;const t=i-e;return t*t<Sr*i*e?0:i<e?-1:1};class xr{constructor(){this.reset()}reset(){this.xRounder=new Ci,this.yRounder=new Ci}round(e,t){return{x:this.xRounder.round(e),y:this.yRounder.round(t)}}}class Ci{constructor(){this.tree=new Ct,this.round(0)}round(e){const t=this.tree.add(e),n=this.tree.prev(t);if(n!==null&&Mi(t.key,n.key)===0)return this.tree.remove(e),n.key;const r=this.tree.next(t);return r!==null&&Mi(t.key,r.key)===0?(this.tree.remove(e),r.key):e}}const Je=new xr,ot=(i,e)=>i.x*e.y-i.y*e.x,ki=(i,e)=>i.x*e.x+i.y*e.y,Ni=(i,e,t)=>{const n=Lr(i.x,i.y,e.x,e.y,t.x,t.y);return n>0?-1:n<0?1:0},st=i=>Math.sqrt(ki(i,i)),Mr=(i,e,t)=>{const n={x:e.x-i.x,y:e.y-i.y},r={x:t.x-i.x,y:t.y-i.y};return ot(r,n)/st(r)/st(n)},Cr=(i,e,t)=>{const n={x:e.x-i.x,y:e.y-i.y},r={x:t.x-i.x,y:t.y-i.y};return ki(r,n)/st(r)/st(n)},Ti=(i,e,t)=>e.y===0?null:{x:i.x+e.x/e.y*(t-i.y),y:t},Pi=(i,e,t)=>e.x===0?null:{x:t,y:i.y+e.y/e.x*(t-i.x)},kr=(i,e,t,n)=>{if(e.x===0)return Pi(t,n,i.x);if(n.x===0)return Pi(i,e,t.x);if(e.y===0)return Ti(t,n,i.y);if(n.y===0)return Ti(i,e,t.y);const r=ot(e,n);if(r==0)return null;const o={x:t.x-i.x,y:t.y-i.y},u=ot(o,e)/r,s=ot(o,n)/r,c=i.x+s*e.x,l=t.x+u*n.x,d=i.y+s*e.y,a=t.y+u*n.y,f=(c+l)/2,h=(d+a)/2;return{x:f,y:h}};class le{static compare(e,t){const n=le.comparePoints(e.point,t.point);return n!==0?n:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:ke.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0}constructor(e,t){e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let n=0,r=t.length;n<r;n++){const o=t[n];this.point.events.push(o),o.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let t=0;t<e;t++){const n=this.point.events[t];if(n.segment.consumedBy===void 0)for(let r=t+1;r<e;r++){const o=this.point.events[r];o.consumedBy===void 0&&n.otherSE.point.events===o.otherSE.point.events&&n.segment.consume(o.segment)}}}getAvailableLinkedEvents(){const e=[];for(let t=0,n=this.point.events.length;t<n;t++){const r=this.point.events[t];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&e.push(r)}return e}getLeftmostComparator(e){const t=new Map,n=r=>{const o=r.otherSE;t.set(r,{sine:Mr(this.point,e.point,o.point),cosine:Cr(this.point,e.point,o.point)})};return(r,o)=>{t.has(r)||n(r),t.has(o)||n(o);const{sine:u,cosine:s}=t.get(r),{sine:c,cosine:l}=t.get(o);return u>=0&&c>=0?s<l?1:s>l?-1:0:u<0&&c<0?s<l?-1:s>l?1:0:c<u?-1:c>u?1:0}}}let Nr=0;class ke{static compare(e,t){const n=e.leftSE.point.x,r=t.leftSE.point.x,o=e.rightSE.point.x,u=t.rightSE.point.x;if(u<n)return 1;if(o<r)return-1;const s=e.leftSE.point.y,c=t.leftSE.point.y,l=e.rightSE.point.y,d=t.rightSE.point.y;if(n<r){if(c<s&&c<l)return 1;if(c>s&&c>l)return-1;const a=e.comparePoint(t.leftSE.point);if(a<0)return 1;if(a>0)return-1;const f=t.comparePoint(e.rightSE.point);return f!==0?f:-1}if(n>r){if(s<c&&s<d)return-1;if(s>c&&s>d)return 1;const a=t.comparePoint(e.leftSE.point);if(a!==0)return a;const f=e.comparePoint(t.rightSE.point);return f<0?1:f>0?-1:1}if(s<c)return-1;if(s>c)return 1;if(o<u){const a=t.comparePoint(e.rightSE.point);if(a!==0)return a}if(o>u){const a=e.comparePoint(t.rightSE.point);if(a<0)return 1;if(a>0)return-1}if(o!==u){const a=l-s,f=o-n,h=d-c,g=u-r;if(a>f&&h<g)return 1;if(a<f&&h>g)return-1}return o>u?1:o<u||l<d?-1:l>d?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,n,r){this.id=++Nr,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=n,this.windings=r}static fromRing(e,t,n){let r,o,u;const s=le.comparePoints(e,t);if(s<0)r=e,o=t,u=1;else if(s>0)r=t,o=e,u=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const c=new le(r,!0),l=new le(o,!1);return new ke(c,l,[n],[u])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<t?e:t},ur:{x:this.rightSE.point.x,y:e>t?e:t}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}comparePoint(e){if(this.isAnEndpoint(e))return 0;const t=this.leftSE.point,n=this.rightSE.point,r=this.vector();if(t.x===n.x)return e.x===t.x?0:e.x<t.x?1:-1;const o=(e.y-t.y)/r.y,u=t.x+o*r.x;if(e.x===u)return 0;const s=(e.x-t.x)/r.x,c=t.y+s*r.y;return e.y===c?0:e.y<c?-1:1}getIntersection(e){const t=this.bbox(),n=e.bbox(),r=Rt(t,n);if(r===null)return null;const o=this.leftSE.point,u=this.rightSE.point,s=e.leftSE.point,c=e.rightSE.point,l=Ke(t,s)&&this.comparePoint(s)===0,d=Ke(n,o)&&e.comparePoint(o)===0,a=Ke(t,c)&&this.comparePoint(c)===0,f=Ke(n,u)&&e.comparePoint(u)===0;if(d&&l)return f&&!a?u:!f&&a?c:null;if(d)return a&&o.x===c.x&&o.y===c.y?null:o;if(l)return f&&u.x===s.x&&u.y===s.y?null:s;if(f&&a)return null;if(f)return u;if(a)return c;const h=kr(o,this.vector(),s,e.vector());return h===null||!Ke(r,h)?null:Je.round(h.x,h.y)}split(e){const t=[],n=e.events!==void 0,r=new le(e,!0),o=new le(e,!1),u=this.rightSE;this.replaceRightSE(o),t.push(o),t.push(r);const s=new ke(r,u,this.rings.slice(),this.windings.slice());return le.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),le.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),o.checkForConsuming()),t}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,n=this.windings.length;t<n;t++)this.windings[t]*=-1}consume(e){let t=this,n=e;for(;t.consumedBy;)t=t.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const r=ke.compare(t,n);if(r!==0){if(r>0){const o=t;t=n,n=o}if(t.prev===n){const o=t;t=n,n=o}for(let o=0,u=n.rings.length;o<u;o++){const s=n.rings[o],c=n.windings[o],l=t.rings.indexOf(s);l===-1?(t.rings.push(s),t.windings.push(c)):t.windings[l]+=c}n.rings=null,n.windings=null,n.consumedBy=t,n.leftSE.consumedBy=t.leftSE,n.rightSE.consumedBy=t.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};const t=this._afterState.rings,n=this._afterState.windings,r=this._afterState.multiPolys;for(let s=0,c=this.rings.length;s<c;s++){const l=this.rings[s],d=this.windings[s],a=t.indexOf(l);a===-1?(t.push(l),n.push(d)):n[a]+=d}const o=[],u=[];for(let s=0,c=t.length;s<c;s++){if(n[s]===0)continue;const l=t[s],d=l.poly;if(u.indexOf(d)===-1)if(l.isExterior)o.push(d);else{u.indexOf(d)===-1&&u.push(d);const a=o.indexOf(l.poly);a!==-1&&o.splice(a,1)}}for(let s=0,c=o.length;s<c;s++){const l=o[s].multiPoly;r.indexOf(l)===-1&&r.push(l)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(de.type){case"union":{const n=e.length===0,r=t.length===0;this._isInResult=n!==r;break}case"intersection":{let n,r;e.length<t.length?(n=e.length,r=t.length):(n=t.length,r=e.length),this._isInResult=r===de.numMultiPolys&&n<r;break}case"xor":{const n=Math.abs(e.length-t.length);this._isInResult=n%2===1;break}case"difference":{const n=r=>r.length===1&&r[0].isSubject;this._isInResult=n(e)!==n(t);break}default:throw new Error(`Unrecognized operation type found ${de.type}`)}return this._isInResult}}class Ri{constructor(e,t,n){if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=n,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const r=Je.round(e[0][0],e[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};let o=r;for(let u=1,s=e.length;u<s;u++){if(typeof e[u][0]!="number"||typeof e[u][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=Je.round(e[u][0],e[u][1]);c.x===o.x&&c.y===o.y||(this.segments.push(ke.fromRing(o,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),o=c)}(r.x!==o.x||r.y!==o.y)&&this.segments.push(ke.fromRing(o,r,this))}getSweepEvents(){const e=[];for(let t=0,n=this.segments.length;t<n;t++){const r=this.segments[t];e.push(r.leftSE),e.push(r.rightSE)}return e}}class Tr{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Ri(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let n=1,r=e.length;n<r;n++){const o=new Ri(e[n],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=t}getSweepEvents(){const e=this.exteriorRing.getSweepEvents();for(let t=0,n=this.interiorRings.length;t<n;t++){const r=this.interiorRings[t].getSweepEvents();for(let o=0,u=r.length;o<u;o++)e.push(r[o])}return e}}class Ii{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof e[0][0][0]=="number"&&(e=[e])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let n=0,r=e.length;n<r;n++){const o=new Tr(e[n],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=t}getSweepEvents(){const e=[];for(let t=0,n=this.polys.length;t<n;t++){const r=this.polys[t].getSweepEvents();for(let o=0,u=r.length;o<u;o++)e.push(r[o])}return e}}class lt{static factory(e){const t=[];for(let n=0,r=e.length;n<r;n++){const o=e[n];if(!o.isInResult()||o.ringOut)continue;let u=null,s=o.leftSE,c=o.rightSE;const l=[s],d=s.point,a=[];for(;u=s,s=c,l.push(s),s.point!==d;)for(;;){const f=s.getAvailableLinkedEvents();if(f.length===0){const y=l[0].point,b=l[l.length-1].point;throw new Error(`Unable to complete output ring starting at [${y.x}, ${y.y}]. Last matching segment found ends at [${b.x}, ${b.y}].`)}if(f.length===1){c=f[0].otherSE;break}let h=null;for(let y=0,b=a.length;y<b;y++)if(a[y].point===s.point){h=y;break}if(h!==null){const y=a.splice(h)[0],b=l.splice(y.index);b.unshift(b[0].otherSE),t.push(new lt(b.reverse()));continue}a.push({index:l.length,point:s.point});const g=s.getLeftmostComparator(u);c=f.sort(g)[0].otherSE;break}t.push(new lt(l))}return t}constructor(e){this.events=e;for(let t=0,n=e.length;t<n;t++)e[t].segment.ringOut=this;this.poly=null}getGeom(){let e=this.events[0].point;const t=[e];for(let l=1,d=this.events.length-1;l<d;l++){const a=this.events[l].point,f=this.events[l+1].point;Ni(a,e,f)!==0&&(t.push(a),e=a)}if(t.length===1)return null;const n=t[0],r=t[1];Ni(n,e,r)===0&&t.shift(),t.push(t[0]);const o=this.isExteriorRing()?1:-1,u=this.isExteriorRing()?0:t.length-1,s=this.isExteriorRing()?t.length:-1,c=[];for(let l=u;l!=s;l+=o)c.push([t[l].x,t[l].y]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){const e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let e=this.events[0];for(let r=1,o=this.events.length;r<o;r++){const u=this.events[r];le.compare(e,u)>0&&(e=u)}let t=e.segment.prevInResult(),n=t?t.prevInResult():null;for(;;){if(!t)return null;if(!n)return t.ringOut;if(n.ringOut!==t.ringOut)return n.ringOut.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut.enclosingRing();t=n.prevInResult(),n=t?t.prevInResult():null}}}class Oi{constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){const e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(let t=0,n=this.interiorRings.length;t<n;t++){const r=this.interiorRings[t].getGeom();r!==null&&e.push(r)}return e}}class Pr{constructor(e){this.rings=e,this.polys=this._composePolys(e)}getGeom(){const e=[];for(let t=0,n=this.polys.length;t<n;t++){const r=this.polys[t].getGeom();r!==null&&e.push(r)}return e}_composePolys(e){const t=[];for(let n=0,r=e.length;n<r;n++){const o=e[n];if(!o.poly)if(o.isExteriorRing())t.push(new Oi(o));else{const u=o.enclosingRing();u.poly||t.push(new Oi(u)),u.poly.addInterior(o)}}return t}}class Rr{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ke.compare;this.queue=e,this.tree=new Ct(t),this.segments=[]}process(e){const t=e.segment,n=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),n;const r=e.isLeft?this.tree.add(t):this.tree.find(t);if(!r)throw new Error(`Unable to find segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] in SweepLine tree.`);let o=r,u=r,s,c;for(;s===void 0;)o=this.tree.prev(o),o===null?s=null:o.key.consumedBy===void 0&&(s=o.key);for(;c===void 0;)u=this.tree.next(u),u===null?c=null:u.key.consumedBy===void 0&&(c=u.key);if(e.isLeft){let l=null;if(s){const a=s.getIntersection(t);if(a!==null&&(t.isAnEndpoint(a)||(l=a),!s.isAnEndpoint(a))){const f=this._splitSafely(s,a);for(let h=0,g=f.length;h<g;h++)n.push(f[h])}}let d=null;if(c){const a=c.getIntersection(t);if(a!==null&&(t.isAnEndpoint(a)||(d=a),!c.isAnEndpoint(a))){const f=this._splitSafely(c,a);for(let h=0,g=f.length;h<g;h++)n.push(f[h])}}if(l!==null||d!==null){let a=null;l===null?a=d:d===null?a=l:a=le.comparePoints(l,d)<=0?l:d,this.queue.remove(t.rightSE),n.push(t.rightSE);const f=t.split(a);for(let h=0,g=f.length;h<g;h++)n.push(f[h])}n.length>0?(this.tree.remove(t),n.push(e)):(this.segments.push(t),t.prev=s)}else{if(s&&c){const l=s.getIntersection(c);if(l!==null){if(!s.isAnEndpoint(l)){const d=this._splitSafely(s,l);for(let a=0,f=d.length;a<f;a++)n.push(d[a])}if(!c.isAnEndpoint(l)){const d=this._splitSafely(c,l);for(let a=0,f=d.length;a<f;a++)n.push(d[a])}}}this.tree.remove(t)}return n}_splitSafely(e,t){this.tree.remove(e);const n=e.rightSE;this.queue.remove(n);const r=e.split(t);return r.push(n),e.consumedBy===void 0&&this.tree.add(e),r}}const Ai=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Ir=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Or{run(e,t,n){de.type=e,Je.reset();const r=[new Ii(t,!0)];for(let a=0,f=n.length;a<f;a++)r.push(new Ii(n[a],!1));if(de.numMultiPolys=r.length,de.type==="difference"){const a=r[0];let f=1;for(;f<r.length;)Rt(r[f].bbox,a.bbox)!==null?f++:r.splice(f,1)}if(de.type==="intersection")for(let a=0,f=r.length;a<f;a++){const h=r[a];for(let g=a+1,y=r.length;g<y;g++)if(Rt(h.bbox,r[g].bbox)===null)return[]}const o=new Ct(le.compare);for(let a=0,f=r.length;a<f;a++){const h=r[a].getSweepEvents();for(let g=0,y=h.length;g<y;g++)if(o.insert(h[g]),o.size>Ai)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const u=new Rr(o);let s=o.size,c=o.pop();for(;c;){const a=c.key;if(o.size===s){const h=a.segment;throw new Error(`Unable to pop() ${a.isLeft?"left":"right"} SweepEvent [${a.point.x}, ${a.point.y}] from segment #${h.id} [${h.leftSE.point.x}, ${h.leftSE.point.y}] -> [${h.rightSE.point.x}, ${h.rightSE.point.y}] from queue.`)}if(o.size>Ai)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(u.segments.length>Ir)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=u.process(a);for(let h=0,g=f.length;h<g;h++){const y=f[h];y.consumedBy===void 0&&o.insert(y)}s=o.size,c=o.pop()}Je.reset();const l=lt.factory(u.segments);return new Pr(l).getGeom()}}const de=new Or;var Wi={union:function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return de.run("union",i,t)},intersection:function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return de.run("intersection",i,t)},xor:function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return de.run("xor",i,t)},difference:function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return de.run("difference",i,t)}};function Ar(i,e={}){const t=[];if(Et(i,r=>{t.push(r.coordinates)}),t.length<2)throw new Error("Must have at least 2 geometries");const n=Wi.union(t[0],...t.slice(1));return n.length===0?null:n.length===1?_t(n[0],e.properties):pi(n,e.properties)}var zi=Ar;function Wr(i){const e=[];if(Et(i,r=>{e.push(r.coordinates)}),e.length<2)throw new Error("Must have at least two features");const t=i.features[0].properties||{},n=Wi.difference(e[0],...e.slice(1));return n.length===0?null:n.length===1?_t(n[0],t):pi(n,t)}var zr=Wr;function Br(i){if(!i)throw new Error("geojson is required");var e=[];return sr(i,function(t){e.push(t)}),Ye(e)}var Dr=Br;function Bi(i,e){const t=zr(Ye([_t([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),i]));if(!t)return;t.properties={isMask:!0};const n=Ze(Lt(i)),r=(n[2]-n[0])/360/1e3,o=n[0]<-180,u=n[2]>180,s=Dr(i);if(s.features.length>1&&(o||u))for(const c of s.features){const l=Ze(Lt(c));if(u&&l[0]<-180+r)for(const d of c.geometry.coordinates)for(const a of d)a[0]+=360-r;if(o&&l[2]>180-r)for(const d of c.geometry.coordinates)for(const a of d)a[0]-=360-r}e(Ye([s.features.length<2?i:zi(s)??i,t]))}const Di=i=>{var n,r,o;const e=(n=i==null?void 0:i.geometry)==null?void 0:n.type,t=(r=i==null?void 0:i.properties)!=null&&r.isMask?0:e==="LineString"||e==="MultiLineString"?3:2;return{color:"#3170fe",fillColor:"#000",fillOpacity:(o=i==null?void 0:i.properties)!=null&&o.isMask?.1:0,weight:t,dashArray:[t,t],lineCap:"butt"}};function Ui(i,e=!0,t=!0,n={},r={},o=Di,u=!1){let s;const c=[];let l,d;const a=ie.geoJSON(void 0,{style:o===!0?Di:o===!1?void 0:o??void 0,interactive:!1}).addTo(i),f=g=>{s==null||s({type:"mapClick",coordinates:[g.latlng.lng,g.latlng.lat]})};function h(g,y=!1){const b=document.createElement("div");return new An({props:{displayIn:"leaflet"},target:b}),new ie.Marker(g,{interactive:y,icon:new ie.DivIcon({html:b,className:"",iconAnchor:[12,26],iconSize:[25,30],tooltipAnchor:[1,-24]})})}return{setEventHandler(g){g?(s=g,i.on("click",f)):(s=void 0,i.off("click",f))},flyTo(g,y){i.flyTo([g[1],g[0]],y,{duration:2,...n})},fitBounds(g,y,b){i.flyToBounds([[g[1],g[0]],[g[3],g[2]]],{padding:[y,y],duration:2,...b?{maxZoom:b}:{},...r})},indicateReverse(g){i.getContainer().style.cursor=g?"crosshair":""},setReverseMarker(g){var b;if(!e)return;const y=g&&[g[1],g[0]];d?y?d.setLatLng(y):(d.remove(),d=void 0):y&&(e instanceof Function?d=e(i)??void 0:(d=(typeof e=="object"?new ie.Marker(y,e):h(y)).addTo(i),(b=d.getElement())==null||b.classList.add("marker-reverse")))},setMarkers(g,y){function b(v){a.clearLayers(),v&&a.addData(v)}for(const v of c)v.remove();if(c.length=0,b(),y){let v=!1;if(y.geometry.type==="GeometryCollection"){const E=y.geometry.geometries.filter(L=>L.type==="Polygon"||L.type==="MultiPolygon");e:if(E.length>0){const L=zi(Ye(E.map(_=>Ve(_))));if(!L)break e;Bi({...y,geometry:L.geometry},b),v=!0}else{const L=y.geometry.geometries.filter(_=>_.type==="LineString"||_.type==="MultiLineString");L.length>0&&(b({...y,geometry:{type:"GeometryCollection",geometries:L}}),v=!0)}}if(!v){if(y.geometry.type==="Polygon"||y.geometry.type==="MultiPolygon")Bi(y,E=>{if(!E)return;const L=[...E.features],_=Ze(Lt(y)),C=_[2]-_[0];_[0]-C/4<-180&&L.push(...Fi(E,-360).features),_[2]+C/4>180&&L.push(...Fi(E,360).features),b(Ye(L))});else if(y.geometry.type==="LineString"||y.geometry.type==="MultiLineString"){b(y);return}}if(!u&&y.geometry.type!=="Point")return;if(e instanceof Function){const E=e(i,y);E&&c.push(E.addTo(i))}else if(e){const E=[y.center[1],y.center[0]];c.push(typeof e=="object"?new ie.Marker(E,e):h(E).addTo(i))}}if(t)for(const v of g??[]){if(v===y)continue;const E=[v.center[1],v.center[0]];let L;if(t instanceof Function){if(L=t(i,v),!L)continue}else L=(typeof t=="object"?new ie.Marker(E,t):h(E,!0)).addTo(i).bindTooltip(v.place_type[0]==="reverse"?v.place_name:v.place_name.replace(/,.*/,""),{direction:"top"});const _=L.getElement();_&&(_.addEventListener("click",C=>{C.stopPropagation(),s==null||s({type:"markerClick",id:v.id})}),_.addEventListener("mouseenter",()=>{s==null||s({type:"markerMouseEnter",id:v.id})}),_.addEventListener("mouseleave",()=>{s==null||s({type:"markerMouseLeave",id:v.id})}),_.classList.toggle("marker-fuzzy",!!v.matching_text)),c.push(L)}},setSelectedMarker(g){var y,b;l&&((y=l.getElement())==null||y.classList.toggle("marker-selected",!1)),l=g>-1?c[g]:void 0,(b=l==null?void 0:l.getElement())==null||b.classList.toggle("marker-selected",!0)},getCenterAndZoom(){const g=i.getCenter();return[i.getZoom(),g.lng,g.lat]}}}function Fi(i,e){const t=cr(i);for(const n of t.features)if(n.geometry.type=="MultiPolygon")for(const r of n.geometry.coordinates)Gi(r,e);else Gi(n.geometry.coordinates,e);return t}function Gi(i,e){for(const t of i)for(const n of t)n[0]+=e}class ji extends ie.Control{}ie.Util.extend(ji.prototype,ie.Evented.prototype);class qi extends ji{constructor(t){super(t);Zt(this,ue);Zt(this,Ie);gt(this,Ie,t)}onAdd(t){const n=document.createElement("div");n.className="leaflet-ctrl-geocoder",ie.DomEvent.disableClickPropagation(n),ie.DomEvent.disableScrollPropagation(n);const{marker:r,showResultMarkers:o,flyTo:u,fullGeometryStyle:s,position:c,...l}=he(this,Ie),d=typeof u=="boolean"?{}:u,a=Ui(t,r,o,d,d,s,l.pickedResultStyle==="full-geometry-including-polygon-center-marker");gt(this,ue,new or({target:n,props:{mapController:a,flyTo:u===void 0?!0:!!u,...l}}));const f={select:void 0,pick:void 0,featureslisted:void 0,featuresmarked:void 0,response:void 0,optionsvisibilitychange:void 0,reversetoggle:void 0,querychange:void 0};for(const h in f)he(this,ue).$on(h,g=>this.fire(h,g.detail));return n}setOptions(t){var c;gt(this,Ie,t);const{marker:n,showResultMarkers:r,flyTo:o,fullGeometryStyle:u,...s}=he(this,Ie);(c=he(this,ue))==null||c.$set(s)}setQuery(t,n=!0){var r;(r=he(this,ue))==null||r.setQuery(t,n)}clearMap(){var t;(t=he(this,ue))==null||t.clearMap()}clearList(){var t;(t=he(this,ue))==null||t.clearList()}focus(){var t;(t=he(this,ue))==null||t.focus()}blur(){var t;(t=he(this,ue))==null||t.blur()}onRemove(){var t;(t=he(this,ue))==null||t.$destroy()}}ue=new WeakMap,Ie=new WeakMap;function Ur(...i){return new qi(...i)}window.L&&typeof window.L=="object"&&typeof window.L.control=="function"&&(window.L.control.maptilerGeocoding=Ur),A.GeocodingControl=qi,A.createLeafletMapController=Ui,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
23
23
  //# sourceMappingURL=leaflet.umd.js.map