@maptiler/geocoding-control 2.1.0-rc1 → 2.1.0-with-autocomplete-timeout
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.js +970 -951
- package/leaflet.js.map +1 -1
- package/leaflet.umd.js +3 -3
- package/leaflet.umd.js.map +1 -1
- package/maplibregl.js +1238 -1219
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +3 -3
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.js +1240 -1221
- package/maptilersdk.js.map +1 -1
- package/maptilersdk.umd.js +3 -3
- package/maptilersdk.umd.js.map +1 -1
- package/openlayers.js +1033 -1014
- package/openlayers.js.map +1 -1
- package/openlayers.umd.js +3 -3
- package/openlayers.umd.js.map +1 -1
- package/package.json +1 -1
- package/react.js +701 -682
- package/react.js.map +1 -1
- package/react.umd.js +1 -1
- package/react.umd.js.map +1 -1
- package/svelte/GeocodingControl.svelte +45 -17
- package/svelte/GeocodingControl.svelte.d.ts +1 -0
- package/svelte/types.d.ts +1 -0
- package/types.d.ts +1 -0
- package/vanilla.js +713 -694
- package/vanilla.js.map +1 -1
- package/vanilla.umd.js +1 -1
- package/vanilla.umd.js.map +1 -1
package/leaflet.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(A,U){typeof exports=="object"&&typeof module<"u"?U(exports,require("leaflet")):typeof define=="function"&&define.amd?define(["exports","leaflet"],U):(A=typeof globalThis<"u"?globalThis:A||self,U(A.leafletMaptilerGeocoder={},A.L))})(this,function(A,U){"use strict";var yo=Object.defineProperty;var nn=A=>{throw TypeError(A)};var bo=(A,U,K)=>U in A?yo(A,U,{enumerable:!0,configurable:!0,writable:!0,value:K}):A[U]=K;var Vt=(A,U,K)=>bo(A,typeof U!="symbol"?U+"":U,K),rn=(A,U,K)=>U.has(A)||nn("Cannot "+K);var le=(A,U,K)=>(rn(A,U,"read from private field"),K?K.call(A):U.get(A)),Yt=(A,U,K)=>U.has(A)?nn("Cannot add the same private member more than once"):U instanceof WeakSet?U.add(A):U.set(A,K),Xt=(A,U,K,ie)=>(rn(A,U,"write to private field"),ie?ie.call(A,K):U.set(A,K),K);var re,Oe;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(U);function F(){}function on(i,e){for(const t in e)i[t]=e[t];return i}function Kt(i){return i()}function Jt(){return Object.create(null)}function ye(i){i.forEach(Kt)}function $t(i){return typeof i=="function"}function Ee(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 sn(i){return Object.keys(i).length===0}function ln(i,e,t,n){if(i){const r=ei(i,e,t,n);return i[0](r)}}function ei(i,e,t,n){return i[1]&&n?on(t.ctx.slice(),i[1](n(e))):t.ctx}function un(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=[],l=Math.max(e.dirty.length,r.length);for(let s=0;s<l;s+=1)o[s]=e.dirty[s]|r[s];return o}return e.dirty|r}return e.dirty}function an(i,e,t,n,r,o){if(r){const l=ei(e,t,n,o);i.p(l,r)}}function cn(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 it(i){return i??""}function I(i,e){i.appendChild(e)}function j(i,e,t){i.insertBefore(e,t||null)}function G(i){i.parentNode&&i.parentNode.removeChild(i)}function D(i){return document.createElement(i)}function ae(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function Le(i){return document.createTextNode(i)}function ne(){return Le(" ")}function fn(){return Le("")}function Y(i,e,t,n){return i.addEventListener(e,t,n),()=>i.removeEventListener(e,t,n)}function dn(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 hn(i){return Array.from(i.childNodes)}function je(i,e){e=""+e,i.data!==e&&(i.data=e)}function ti(i,e){i.value=e??""}function ge(i,e,t){i.classList.toggle(e,!!t)}function gn(i,e,{bubbles:t=!1,cancelable:n=!1}={}){return new CustomEvent(i,{detail:e,bubbles:t,cancelable:n})}let qe;function Ze(i){qe=i}function ii(){if(!qe)throw new Error("Function called outside component initialization");return qe}function mn(i){ii().$$.on_destroy.push(i)}function ni(){const i=ii();return(e,t,{cancelable:n=!1}={})=>{const r=i.$$.callbacks[e];if(r){const o=gn(e,t,{cancelable:n});return r.slice().forEach(l=>{l.call(i,o)}),!o.defaultPrevented}return!0}}function pn(i,e){const t=i.$$.callbacks[e.type];t&&t.slice().forEach(n=>n.call(this,e))}const Ae=[],bt=[];let We=[];const ri=[],yn=Promise.resolve();let vt=!1;function bn(){vt||(vt=!0,yn.then(oi))}function _t(i){We.push(i)}const wt=new Set;let Be=0;function oi(){if(Be!==0)return;const i=qe;do{try{for(;Be<Ae.length;){const e=Ae[Be];Be++,Ze(e),vn(e.$$)}}catch(e){throw Ae.length=0,Be=0,e}for(Ze(null),Ae.length=0,Be=0;bt.length;)bt.pop()();for(let e=0;e<We.length;e+=1){const t=We[e];wt.has(t)||(wt.add(t),t())}We.length=0}while(Ae.length);for(;ri.length;)ri.pop()();vt=!1,wt.clear(),Ze(i)}function vn(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(_t)}}function _n(i){const e=[],t=[];We.forEach(n=>i.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),We=e}const nt=new Set;let Re;function rt(){Re={r:0,c:[],p:Re}}function ot(){Re.r||ye(Re.c),Re=Re.p}function Q(i,e){i&&i.i&&(nt.delete(i),i.i(e))}function X(i,e,t,n){if(i&&i.o){if(nt.has(i))return;nt.add(i),Re.c.push(()=>{nt.delete(i),n&&(t&&i.d(1),n())}),i.o(e)}else n&&n()}function si(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function wn(i,e){X(i,1,1,()=>{e.delete(i.key)})}function En(i,e,t,n,r,o,l,s,c,u,h,a){let f=i.length,d=o.length,m=f;const b={};for(;m--;)b[i[m].key]=m;const v=[],y=new Map,E=new Map,_=[];for(m=d;m--;){const x=a(r,o,m),S=t(x);let T=l.get(S);T?_.push(()=>T.p(x,e)):(T=u(S,x),T.c()),y.set(S,v[m]=T),S in b&&E.set(S,Math.abs(m-b[S]))}const L=new Set,P=new Set;function N(x){Q(x,1),x.m(s,h),l.set(x.key,x),h=x.first,d--}for(;f&&d;){const x=v[d-1],S=i[f-1],T=x.key,w=S.key;x===S?(h=x.first,f--,d--):y.has(w)?!l.has(T)||L.has(T)?N(x):P.has(w)?f--:E.get(T)>E.get(w)?(P.add(T),N(x)):(L.add(w),f--):(c(S,l),f--)}for(;f--;){const x=i[f];y.has(x.key)||c(x,l)}for(;d;)N(v[d-1]);return ye(_),v}function Se(i){i&&i.c()}function be(i,e,t){const{fragment:n,after_update:r}=i.$$;n&&n.m(e,t),_t(()=>{const o=i.$$.on_mount.map(Kt).filter($t);i.$$.on_destroy?i.$$.on_destroy.push(...o):ye(o),i.$$.on_mount=[]}),r.forEach(_t)}function ve(i,e){const t=i.$$;t.fragment!==null&&(_n(t.after_update),ye(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Ln(i,e){i.$$.dirty[0]===-1&&(Ae.push(i),bn(),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function xe(i,e,t,n,r,o,l=null,s=[-1]){const c=qe;Ze(i);const u=i.$$={fragment:null,ctx:[],props:o,update:F,not_equal:r,bound:Jt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:Jt(),dirty:s,skip_bound:!1,root:e.target||c.$$.root};l&&l(u.root);let h=!1;if(u.ctx=t?t(i,e.props||{},(a,f,...d)=>{const m=d.length?d[0]:f;return u.ctx&&r(u.ctx[a],u.ctx[a]=m)&&(!u.skip_bound&&u.bound[a]&&u.bound[a](m),h&&Ln(i,a)),f}):[],u.update(),h=!0,ye(u.before_update),u.fragment=n?n(u.ctx):!1,e.target){if(e.hydrate){const a=hn(e.target);u.fragment&&u.fragment.l(a),a.forEach(G)}else u.fragment&&u.fragment.c();e.intro&&Q(i.$$.fragment),be(i,e.target,e.anchor),oi()}Ze(c)}class Me{constructor(){Vt(this,"$$");Vt(this,"$$set")}$destroy(){ve(this,1),this.$destroy=F}$on(e,t){if(!$t(t))return F;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&&!sn(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Sn="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Sn);function xn(i){let e,t;return{c(){e=ae("svg"),t=ae("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){j(n,e,r),I(e,t)},p:F,i:F,o:F,d(n){n&&G(e)}}}class li extends Me{constructor(e){super(),xe(this,e,null,xn,Ee,{})}}function Mn(i){let e,t;return{c(){e=ae("svg"),t=ae("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){j(n,e,r),I(e,t)},p:F,i:F,o:F,d(n){n&&G(e)}}}class ui extends Me{constructor(e){super(),xe(this,e,null,Mn,Ee,{})}}function Cn(i){let e,t;return{c(){e=D("img"),J(e.src,t=i[3]+"area.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"title",i[6]),p(e,"class","svelte-z7p9pp")},m(n,r){j(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]),r&64&&p(e,"title",n[6])},d(n){n&&G(e)}}}function kn(i){let e,t;return{c(){e=D("img"),J(e.src,t=i[3]+"reverse.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"title",i[6]),p(e,"class","svelte-z7p9pp")},m(n,r){j(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]),r&64&&p(e,"title",n[6])},d(n){n&&G(e)}}}function Nn(i){let e,t;return{c(){e=D("img"),J(e.src,t=i[3]+"poi.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"title",i[6]),p(e,"class","svelte-z7p9pp")},m(n,r){j(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]),r&64&&p(e,"title",n[6])},d(n){n&&G(e)}}}function Pn(i){let e,t;return{c(){e=D("img"),J(e.src,t=i[3]+"postal_code.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"title",i[6]),p(e,"class","svelte-z7p9pp")},m(n,r){j(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]),r&64&&p(e,"title",n[6])},d(n){n&&G(e)}}}function Tn(i){let e,t;return{c(){e=D("img"),J(e.src,t=i[3]+"street.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"title",i[6]),p(e,"class","svelte-z7p9pp")},m(n,r){j(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]),r&64&&p(e,"title",n[6])},d(n){n&&G(e)}}}function Rn(i){let e,t;return{c(){e=D("img"),J(e.src,t=i[3]+"road.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"title",i[6]),p(e,"class","svelte-z7p9pp")},m(n,r){j(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]),r&64&&p(e,"title",n[6])},d(n){n&&G(e)}}}function On(i){let e,t;return{c(){e=D("img"),J(e.src,t=i[3]+"housenumber.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"title",i[6]),p(e,"class","svelte-z7p9pp")},m(n,r){j(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]),r&64&&p(e,"title",n[6])},d(n){n&&G(e)}}}function In(i){let e,t,n,r;return{c(){e=D("img"),J(e.src,t=i[5])||p(e,"src",t),p(e,"alt",i[4]),p(e,"title",i[6]),p(e,"class","svelte-z7p9pp")},m(o,l){j(o,e,l),n||(r=Y(e,"error",i[14]),n=!0)},p(o,l){l&32&&!J(e.src,t=o[5])&&p(e,"src",t),l&16&&p(e,"alt",o[4]),l&64&&p(e,"title",o[6])},d(o){o&&G(e),n=!1,r()}}}function ai(i){let e,t;return{c(){e=D("span"),t=Le(i[6]),p(e,"class","secondary svelte-z7p9pp")},m(n,r){j(n,e,r),I(e,t)},p(n,r){r&64&&je(t,n[6])},d(n){n&&G(e)}}}function zn(i){let e,t,n,r,o,l,s,c,u,h=(i[8]?i[0].place_name:i[0].place_name.replace(/,.*/,""))+"",a,f,d=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[8],m,b,v=(i[8]?"":i[0].place_name.replace(/[^,]*,?\s*/,""))+"",y,E,_,L,P,N;function x(M,R){return R&1&&(t=null),R&1&&(n=null),R&1&&(r=null),R&1&&(o=null),M[5]?In:M[0].address?On:(t==null&&(t=!!M[0].id.startsWith("road.")),t?Rn:(n==null&&(n=!!M[0].id.startsWith("address.")),n?Tn:(r==null&&(r=!!M[0].id.startsWith("postal_code.")),r?Pn:(o==null&&(o=!!M[0].id.startsWith("poi.")),o?Nn:M[8]?kn:Cn))))}let S=x(i,-1),T=S(i),w=d&&ai(i);return{c(){e=D("li"),T.c(),l=ne(),s=D("span"),c=D("span"),u=D("span"),a=Le(h),f=ne(),w&&w.c(),m=ne(),b=D("span"),y=Le(v),p(u,"class","primary svelte-z7p9pp"),p(c,"class","svelte-z7p9pp"),p(b,"class","line2 svelte-z7p9pp"),p(s,"class","texts svelte-z7p9pp"),p(e,"tabindex","-1"),p(e,"role","option"),p(e,"aria-selected",E=i[1]==="selected"),p(e,"aria-checked",_=i[1]==="picked"),p(e,"class",L=it(i[1])+" svelte-z7p9pp")},m(M,R){j(M,e,R),T.m(e,null),I(e,l),I(e,s),I(s,c),I(c,u),I(u,a),I(c,f),w&&w.m(c,null),I(s,m),I(s,b),I(b,y),P||(N=[Y(e,"mouseenter",i[13]),Y(e,"focus",i[15]),Y(e,"click",i[16])],P=!0)},p(M,[R]){S===(S=x(M,R))&&T?T.p(M,R):(T.d(1),T=S(M),T&&(T.c(),T.m(e,l))),R&1&&h!==(h=(M[8]?M[0].place_name:M[0].place_name.replace(/,.*/,""))+"")&&je(a,h),R&37&&(d=M[2]==="always"||M[2]!=="never"&&!M[0].address&&!M[0].id.startsWith("road.")&&!M[0].id.startsWith("address.")&&!M[0].id.startsWith("postal_code.")&&(!M[0].id.startsWith("poi.")||!M[5])&&!M[8]),d?w?w.p(M,R):(w=ai(M),w.c(),w.m(c,null)):w&&(w.d(1),w=null),R&1&&v!==(v=(M[8]?"":M[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&je(y,v),R&2&&E!==(E=M[1]==="selected")&&p(e,"aria-selected",E),R&2&&_!==(_=M[1]==="picked")&&p(e,"aria-checked",_),R&2&&L!==(L=it(M[1])+" svelte-z7p9pp")&&p(e,"class",L)},i:F,o:F,d(M){M&&G(e),T.d(),w&&w.d(),P=!1,ye(N)}}}function An(i,e,t){var P;let n,r,{feature:o}=e,{style:l="default"}=e,{showPlaceType:s}=e,{missingIconsCache:c}=e,{iconsBaseUrl:u}=e;const h=ni(),a=(P=o.properties)==null?void 0:P.categories;let f,d,m=0,b=o.place_type[0]==="reverse";function v(){d&&c.add(d),t(11,m++,m)}function y(N){pn.call(this,i,N)}const E=()=>v(),_=()=>h("select",void 0),L=N=>{document.activeElement!==N.target&&h("select",void 0)};return i.$$set=N=>{"feature"in N&&t(0,o=N.feature),"style"in N&&t(1,l=N.style),"showPlaceType"in N&&t(2,s=N.showPlaceType),"missingIconsCache"in N&&t(10,c=N.missingIconsCache),"iconsBaseUrl"in N&&t(3,u=N.iconsBaseUrl)},i.$$.update=()=>{var N,x,S,T;if(i.$$.dirty&7224)do t(12,n--,n),t(4,f=a==null?void 0:a[n]),t(5,d=f?u+f.replace(/ /g,"_")+".svg":void 0);while(n>-1&&(!d||c.has(d)));i.$$.dirty&1&&t(6,r=((x=(N=o.properties)==null?void 0:N.categories)==null?void 0:x.join(", "))??((T=(S=o.properties)==null?void 0:S.place_type_name)==null?void 0:T[0])??o.place_type[0])},t(12,n=(a==null?void 0:a.length)??0),[o,l,s,u,f,d,r,h,b,v,c,m,n,y,E,_,L]}class Wn extends Me{constructor(e){super(),xe(this,e,An,zn,Ee,{feature:0,style:1,showPlaceType:2,missingIconsCache:10,iconsBaseUrl:3})}}function Bn(i){let e;return{c(){e=D("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){j(t,e,n)},p:F,i:F,o:F,d(t){t&&G(e)}}}class Dn extends Me{constructor(e){super(),xe(this,e,null,Bn,Ee,{})}}function Un(i){let e,t,n;return{c(){e=ae("svg"),t=ae("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"),ge(e,"in-map",i[0]!=="list"),ge(e,"list-icon",i[0]==="list")},m(r,o){j(r,e,o),I(e,t)},p(r,[o]){o&1&&n!==(n=r[0]==="list"?20:void 0)&&p(e,"width",n),o&1&&ge(e,"in-map",r[0]!=="list"),o&1&&ge(e,"list-icon",r[0]==="list")},i:F,o:F,d(r){r&&G(e)}}}function Fn(i,e,t){let{displayIn:n}=e;return i.$$set=r=>{"displayIn"in r&&t(0,n=r.displayIn)},[n]}class Gn extends Me{constructor(e){super(),xe(this,e,Fn,Un,Ee,{displayIn:0})}}function jn(i){let e,t;return{c(){e=ae("svg"),t=ae("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){j(n,e,r),I(e,t)},p:F,i:F,o:F,d(n){n&&G(e)}}}class qn extends Me{constructor(e){super(),xe(this,e,null,jn,Ee,{})}}function Zn(i){let e,t,n;return{c(){e=ae("svg"),t=ae("circle"),n=ae("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){j(r,e,o),I(e,t),I(e,n)},p:F,i:F,o:F,d(r){r&&G(e)}}}class Qn extends Me{constructor(e){super(),xe(this,e,null,Zn,Ee,{})}}function Hn(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 Qe(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 He;async function Vn(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(He&&r.cachedLocationExpiry&&He.time+r.cachedLocationExpiry>Date.now()){if(!He.coords)break e;return He.coords}let o;try{return o=await new Promise((l,s)=>{t.signal.addEventListener("abort",()=>{s(Error("aborted"))}),navigator.geolocation.getCurrentPosition(c=>{l([c.coords.longitude,c.coords.latitude].map(u=>u.toFixed(6)).join(","))},c=>{s(c)},r)}),o}catch{}finally{r.cachedLocationExpiry&&(He={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 Yn=/^(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,ci=/^([+-]?[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,})$/,fi=/^(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,di=/^(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,hi=/^(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,gi=/^(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 Xn(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(d=>Number(d.trim())),t=Number(e[0]),n=Number(e[1]),r=Math.abs(t),o=Math.abs(n),l=t>0?"N":"S",s=n>0?"E":"W";let c;i=="DD"&&(c=`${r}° ${l}, ${o}° ${s}`);const u=Math.floor(r),h=Math.floor(o),a=(r-u)*60,f=(o-h)*60;if(i=="DM"){let d=mi(a,3).toFixed(3).padStart(6,"0"),m=mi(f,3).toFixed(3).padStart(6,"0");d.endsWith(".000")&&m.endsWith(".000")&&(d=d.replace(/\.000$/,""),m=m.replace(/\.000$/,"")),c=`${u}° ${d}' ${l}, ${h}° ${m}' ${s}`}if(i=="DMS"){const d=Math.floor(a),m=Math.floor(f);let b=((a-d)*60).toFixed(1).padStart(4,"0"),v=((f-m)*60).toFixed(1).padStart(4,"0");const y=d.toString().padStart(2,"0"),E=m.toString().padStart(2,"0");b.endsWith(".0")&&v.endsWith(".0")&&(b=b.replace(/\.0$/,""),v=v.replace(/\.0$/,"")),c=`${u}° ${y}' ${b}" ${l}, ${h}° ${E}' ${v}" ${s}`}return c}else throw new Error("no decimal coordinates to convert")}function mi(i,e){const t=Math.pow(10,e);return Math.round((i+Number.EPSILON)*t)/t}function Et(i,e){e||(e=5),i=i.replace(/\s+/g," ").trim();let t=null,n=null,r="",o="",l=null,s=[],c=!1;if(Yn.test(i))throw new Error("invalid coordinate value");if(ci.test(i))if(s=ci.exec(i),c=Ve(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),l="DM";else throw new Error("invalid coordinate format");else if(fi.test(i))if(s=fi.exec(i),c=Ve(s),c){if(t=s[2],n=s[6],t.includes(",")&&(t=t.replace(",",".")),n.includes(",")&&(n=n.replace(",",".")),l="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(di.test(i))if(s=di.exec(i),c=Ve(s),c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,l="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,l="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(hi.test(i))if(s=hi.exec(i),c=Ve(s),c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,l="DM"),s[6]&&(t+=s[6]/3600,l="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(gi.test(i)){if(s=gi.exec(i),c=Ve(s),s.filter(u=>u).length<=5)throw new Error("invalid coordinates format");if(c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4].replace(",",".")/60,l="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,l="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 u=/S|SOUTH/i;u.test(r)&&t>0&&(t=-1*t),u=/W|WEST/i,u.test(o)&&n>0&&(n=-1*n);const h=s[0].trim();let a,f;const d=/[,/;\u0020]/g,m=h.match(d);if(m==null){const y=Math.floor(i.length/2);a=h.substring(0,y).trim(),f=h.substring(y).trim()}else{let y;m.length%2==1?y=Math.floor(m.length/2):y=m.length/2-1;let E=0;if(y==0)E=h.indexOf(m[0]),a=h.substring(0,E).trim(),f=h.substring(E+1).trim();else{let _=0,L=0;for(;_<=y;)E=h.indexOf(m[_],L),L=E+1,_++;a=h.substring(0,E).trim(),f=h.substring(E+1).trim()}}const b=a.split(".");if(b.length==2&&b[1]==0&&b[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:h,verbatimLatitude:a,verbatimLongitude:f,decimalLatitude:t,decimalLongitude:n,decimalCoordinates:`${t},${n}`,originalFormat:l,closeEnough:Kn,toCoordinateFormat:Xn})}else throw new Error("coordinates pattern match failed")}function Ve(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 l=e[o],s=e[o+r],c=t.test(l)&&t.test(s),u=n.test(l)&&n.test(s),h=l==s;if(!(l==null&&s==null)){if(l==null||s==null)return!1;if(c||u||h)continue;return!1}}return!0}function pi(i,e){const t=Math.abs(i-e);return Number(t.toFixed(6))<=1e-5}function Kn(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 pi(this.decimalLatitude,Number(e[0]))&&pi(this.decimalLongitude,e[1])}else throw new Error("coords being tested must be separated by a comma")}const Jn=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});Et.to=Jn;const $n=[{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"}],er={decimalLatitude:40.123,decimalLongitude:-74.123},tr=[{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}],ir=[{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 nr(){const i=[];return $n.forEach(e=>{e.decimalLatitude?i.push(e):i.push({...e,...er})}),[...i,...tr,...ir]}const rr=nr();Et.formats=rr.map(i=>i.verbatimCoordinates);const or=Et;function yi(i,e,t){const n=i.slice();return n[91]=e[t],n[93]=t,n}function bi(i){let e,t;return e=new Dn({}),{c(){Se(e.$$.fragment)},m(n,r){be(e,n,r),t=!0},i(n){t||(Q(e.$$.fragment,n),t=!0)},o(n){X(e.$$.fragment,n),t=!1},d(n){ve(e,n)}}}function vi(i){let e,t,n,r,o;return t=new qn({}),{c(){e=D("button"),Se(t.$$.fragment),p(e,"type","button"),p(e,"title",i[10]),p(e,"class","svelte-bz0zu3"),ge(e,"active",i[0])},m(l,s){j(l,e,s),be(t,e,null),n=!0,r||(o=Y(e,"click",i[76]),r=!0)},p(l,s){(!n||s[0]&1024)&&p(e,"title",l[10]),(!n||s[0]&1)&&ge(e,"active",l[0])},i(l){n||(Q(t.$$.fragment,l),n=!0)},o(l){X(t.$$.fragment,l),n=!1},d(l){l&&G(e),ve(t),r=!1,o()}}}function sr(i){let e,t=[],n=new Map,r,o,l,s=si(i[13]);const c=u=>u[91].id+(u[91].address?","+u[91].address:"");for(let u=0;u<s.length;u+=1){let h=yi(i,s,u),a=c(h);n.set(a,t[u]=_i(a,h))}return{c(){e=D("ul");for(let u=0;u<t.length;u+=1)t[u].c();p(e,"class","options svelte-bz0zu3"),p(e,"role","listbox")},m(u,h){j(u,e,h);for(let a=0;a<t.length;a+=1)t[a]&&t[a].m(e,null);r=!0,o||(l=[Y(e,"mouseleave",i[27]),Y(e,"blur",i[80]),Y(e,"keydown",i[23])],o=!0)},p(u,h){h[0]&102823936&&(s=si(u[13]),rt(),t=En(t,h,c,1,u,s,n,e,wn,_i,null,yi),ot())},i(u){if(!r){for(let h=0;h<s.length;h+=1)Q(t[h]);r=!0}},o(u){for(let h=0;h<t.length;h+=1)X(t[h]);r=!1},d(u){u&&G(e);for(let h=0;h<t.length;h+=1)t[h].d();o=!1,ye(l)}}}function lr(i){let e,t,n,r,o,l;return t=new ui({}),{c(){e=D("div"),Se(t.$$.fragment),n=ne(),r=D("div"),o=Le(i[8]),p(r,"class","svelte-bz0zu3"),p(e,"class","no-results svelte-bz0zu3")},m(s,c){j(s,e,c),be(t,e,null),I(e,n),I(e,r),I(r,o),l=!0},p(s,c){(!l||c[0]&256)&&je(o,s[8])},i(s){l||(Q(t.$$.fragment,s),l=!0)},o(s){X(t.$$.fragment,s),l=!1},d(s){s&&G(e),ve(t)}}}function ur(i){let e="",t;return{c(){t=Le(e)},m(n,r){j(n,t,r)},p:F,i:F,o:F,d(n){n&&G(t)}}}function ar(i){let e,t,n,r,o,l,s,c,u,h,a;return t=new ui({}),c=new li({}),{c(){e=D("div"),Se(t.$$.fragment),n=ne(),r=D("div"),o=Le(i[7]),l=ne(),s=D("button"),Se(c.$$.fragment),p(r,"class","svelte-bz0zu3"),p(s,"class","svelte-bz0zu3"),p(e,"class","error svelte-bz0zu3")},m(f,d){j(f,e,d),be(t,e,null),I(e,n),I(e,r),I(r,o),I(e,l),I(e,s),be(c,s,null),u=!0,h||(a=Y(s,"click",i[77]),h=!0)},p(f,d){(!u||d[0]&128)&&je(o,f[7])},i(f){u||(Q(t.$$.fragment,f),Q(c.$$.fragment,f),u=!0)},o(f){X(t.$$.fragment,f),X(c.$$.fragment,f),u=!1},d(f){f&&G(e),ve(t),ve(c),h=!1,a()}}}function _i(i,e){var s;let t,n,r;function o(){return e[78](e[93])}function l(){return e[79](e[91])}return n=new Wn({props:{feature:e[91],showPlaceType:e[11],style:e[15]===e[93]?"selected":((s=e[14])==null?void 0:s.id)===e[91].id?"picked":"default",missingIconsCache:e[21],iconsBaseUrl:e[12]}}),n.$on("mouseenter",o),n.$on("select",l),{key:i,first:null,c(){t=fn(),Se(n.$$.fragment),this.first=t},m(c,u){j(c,t,u),be(n,c,u),r=!0},p(c,u){var a;e=c;const h={};u[0]&8192&&(h.feature=e[91]),u[0]&2048&&(h.showPlaceType=e[11]),u[0]&57344&&(h.style=e[15]===e[93]?"selected":((a=e[14])==null?void 0:a.id)===e[91].id?"picked":"default"),u[0]&4096&&(h.iconsBaseUrl=e[12]),n.$set(h)},i(c){r||(Q(n.$$.fragment,c),r=!0)},o(c){X(n.$$.fragment,c),r=!1},d(c){c&&G(t),ve(n,c)}}}function cr(i){let e,t,n,r,o,l,s,c,u,h,a,f,d,m,b,v,y,E,_,L,P,N=!1;o=new Qn({}),a=new li({});let x=i[20]&&bi(),S=i[6]==="button"&&vi(i);const T=i[67].default,w=ln(T,i,i[66],null),M=[ar,ur,lr,sr],R=[];function te(C,W){var fe,Z;return C[19]?0:!C[16]&&!C[4]?1:((fe=C[13])==null?void 0:fe.length)===0?2:(Z=C[13])!=null&&Z.length&&(C[16]||C[4])?3:-1}return~(v=te(i))&&(y=R[v]=M[v](i)),{c(){e=ne(),t=D("form"),n=D("div"),r=D("button"),Se(o.$$.fragment),l=ne(),s=D("input"),c=ne(),u=D("div"),h=D("button"),Se(a.$$.fragment),f=ne(),x&&x.c(),d=ne(),S&&S.c(),m=ne(),w&&w.c(),b=ne(),y&&y.c(),p(r,"class","search-button svelte-bz0zu3"),p(r,"type","button"),p(s,"placeholder",i[9]),p(s,"aria-label",i[9]),p(s,"class","svelte-bz0zu3"),p(h,"type","button"),p(h,"title",i[3]),p(h,"class","svelte-bz0zu3"),p(u,"class","clear-button-container svelte-bz0zu3"),ge(u,"displayable",i[1]!==""),p(n,"class","input-group svelte-bz0zu3"),p(t,"class",E=it(i[2])+" svelte-bz0zu3"),ge(t,"can-collapse",i[5]&&i[1]==="")},m(C,W){j(C,e,W),j(C,t,W),I(t,n),I(n,r),be(o,r,null),I(n,l),I(n,s),i[69](s),ti(s,i[1]),I(n,c),I(n,u),I(u,h),be(a,h,null),I(u,f),x&&x.m(u,null),I(n,d),S&&S.m(n,null),I(n,m),w&&w.m(n,null),I(t,b),~v&&R[v].m(t,null),_=!0,L||(P=[Y(r,"click",i[68]),Y(s,"input",i[70]),Y(s,"focus",i[71]),Y(s,"blur",i[72]),Y(s,"click",i[73]),Y(s,"keydown",i[23]),Y(s,"input",i[24]),Y(s,"change",i[74]),Y(h,"click",i[75]),Y(t,"submit",dn(i[22]))],L=!0)},p(C,W){(!_||W[0]&512)&&p(s,"placeholder",C[9]),(!_||W[0]&512)&&p(s,"aria-label",C[9]),W[0]&2&&s.value!==C[1]&&ti(s,C[1]),(!_||W[0]&8)&&p(h,"title",C[3]),C[20]?x?W[0]&1048576&&Q(x,1):(x=bi(),x.c(),Q(x,1),x.m(u,null)):x&&(rt(),X(x,1,1,()=>{x=null}),ot()),(!_||W[0]&2)&&ge(u,"displayable",C[1]!==""),C[6]==="button"?S?(S.p(C,W),W[0]&64&&Q(S,1)):(S=vi(C),S.c(),Q(S,1),S.m(n,m)):S&&(rt(),X(S,1,1,()=>{S=null}),ot()),w&&w.p&&(!_||W[2]&16)&&an(w,T,C,C[66],_?un(T,C[66],W,null):cn(C[66]),null);let fe=v;v=te(C),v===fe?~v&&R[v].p(C,W):(y&&(rt(),X(R[fe],1,1,()=>{R[fe]=null}),ot()),~v?(y=R[v],y?y.p(C,W):(y=R[v]=M[v](C),y.c()),Q(y,1),y.m(t,null)):y=null),(!_||W[0]&4&&E!==(E=it(C[2])+" svelte-bz0zu3"))&&p(t,"class",E),(!_||W[0]&38)&&ge(t,"can-collapse",C[5]&&C[1]==="")},i(C){_||(Q(N),Q(o.$$.fragment,C),Q(a.$$.fragment,C),Q(x),Q(S),Q(w,C),Q(y),_=!0)},o(C){X(N),X(o.$$.fragment,C),X(a.$$.fragment,C),X(x),X(S),X(w,C),X(y),_=!1},d(C){C&&(G(e),G(t)),ve(o),i[69](null),ve(a),x&&x.d(),S&&S.d(),w&&w.d(C),~v&&R[v].d(),L=!1,ye(P)}}}function fr(i,e,t){let n,r,o,{$$slots:l={},$$scope:s}=e;const c={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:u=void 0}=e,{apiKey:h}=e,{bbox:a=void 0}=e,{clearButtonTitle:f="clear"}=e,{clearOnBlur:d=!1}=e,{clearListOnPick:m=!1}=e,{keepListOpen:b=!1}=e,{collapsed:v=!1}=e,{country:y=void 0}=e,{debounceSearch:E=200}=e,{enableReverse:_="never"}=e,{errorMessage:L="Something went wrong…"}=e,{filter:P=()=>!0}=e,{flyTo:N=!0}=e,{fuzzyMatch:x=!0}=e,{language:S=void 0}=e,{limit:T=void 0}=e,{mapController:w=void 0}=e,{minLength:M=2}=e,{noResultsMessage:R="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:te="Search"}=e,{proximity:C=[{type:"server-geolocation"}]}=e,{reverseActive:W=_==="always"}=e,{reverseButtonTitle:fe="toggle reverse geocoding"}=e,{searchValue:Z=""}=e,{pickedResultStyle:at="full-geometry"}=e,{showPlaceType:Yi="if-needed"}=e,{showResultsWhileTyping:ct=!0}=e,{selectFirst:Ue=!0}=e,{flyToSelected:ft=!1}=e,{markerOnSelected:dt=!0}=e,{types:Ie=void 0}=e,{exhaustiveReverseGeocoding:zt=!1}=e,{excludeTypes:ht=!1}=e,{zoom:gt=c}=e,{apiUrl:At="https://api.maptiler.com/geocoding"}=e,{fetchParameters:Wt={}}=e,{iconsBaseUrl:Xi="https://cdn.maptiler.com/maptiler-geocoding-control/v2.1.0-rc1/icons/"}=e,{adjustUrlQuery:Bt=()=>{}}=e,{adjustUrl:Dt=()=>{}}=e;function Vr(g){de.focus(g)}function Yr(){de.blur()}function Ki(g,q=!0,H=!1){t(1,Z=g),q?(t(15,B=-1),$i()):(en(void 0,!H,H),setTimeout(()=>{de.focus(),de.select()}))}function Xr(){t(13,O=void 0),t(14,k=void 0),t(15,B=-1)}function Kr(){t(61,V=[]),t(14,k=void 0)}let O,V,k,Ji="",de,B=-1,me,mt=[],ze,Fe,Ge,Ut,we=!1;const Jr=new Set,Te=ni();mn(()=>{w&&(w.setEventHandler(void 0),w.indicateReverse(!1),w.setSelectedMarker(-1),w.setFeatures(void 0,void 0,!1))});function $i(g){if(t(17,we=!1),Fe&&(clearTimeout(Fe),Fe=void 0),B>-1&&O)t(14,k=O[B]),t(1,Z=k.place_type[0]==="reverse"?k.place_name:k.place_name.replace(/,.*/,"")),t(19,me=void 0),t(61,V=void 0),t(15,B=-1);else if(Z){const q=g||!Ft(Z);Gt(Z,{exact:!0}).then(()=>{t(61,V=O),t(14,k=void 0),q&&$r()}).catch(H=>t(19,me=H))}}function Ft(g){try{return or(g,6)}catch{return!1}}async function Gt(g,{byId:q=!1,exact:H=!1}={}){var se,pe;t(19,me=void 0),ze==null||ze.abort();const oe=new AbortController;t(20,ze=oe);try{const z=Ft(g),Zt=new URL(At+"/"+encodeURIComponent(z?z.decimalLongitude+","+z.decimalLatitude:g)+".json"),he=Zt.searchParams;if(S!==void 0&&he.set("language",Array.isArray(S)?S.join(","):S??""),Ie&&he.set("types",Ie.join(",")),ht&&he.set("excludeTypes",String(ht)),a&&he.set("bbox",a.map(yt=>yt.toFixed(6)).join(",")),y&&he.set("country",Array.isArray(y)?y.join(","):y),!q&&!z){const yt=await Vn(w,C,oe);yt&&he.set("proximity",yt),(H||!ct)&&he.set("autocomplete","false"),he.set("fuzzyMatch",String(x))}T!==void 0&&(zt||!z||(Ie==null?void 0:Ie.length)===1)&&he.set("limit",String(T)),he.set("key",h),Bt(he),Dt(Zt);const pt=Zt.toString();if(pt===Ji){q?(m&&t(13,O=void 0),t(14,k=mt[0])):(t(13,O=mt),((se=O[B])==null?void 0:se.id)!==(r==null?void 0:r.id)&&t(15,B=-1));return}Ji=pt;const Qt=await fetch(pt,{signal:oe.signal,...Wt});if(!Qt.ok)throw new Error(await Qt.text());const Ht=await Qt.json();Te("response",{url:pt,featureCollection:Ht}),q?(m&&t(13,O=void 0),t(14,k=Ht.features[0]),mt=[k]):(t(13,O=Ht.features.filter(P)),z&&O.unshift({type:"Feature",properties:{},id:"reverse_"+z.decimalLongitude+"_"+z.decimalLatitude,text:z.decimalLatitude+", "+z.decimalLongitude,place_name:z.decimalLatitude+", "+z.decimalLongitude,place_type:["reverse"],center:[z.decimalLongitude,z.decimalLatitude],bbox:[z.decimalLongitude,z.decimalLatitude,z.decimalLongitude,z.decimalLatitude],geometry:{type:"Point",coordinates:[z.decimalLongitude,z.decimalLatitude]}}),mt=O,((pe=O[B])==null?void 0:pe.id)!==(r==null?void 0:r.id)&&t(15,B=-1),z&&de.focus())}catch(z){if(z&&typeof z=="object"&&"name"in z&&z.name==="AbortError")return;throw z}finally{oe===ze&&t(20,ze=void 0)}}function $r(){var oe;if(!(V!=null&&V.length)||!N)return;const g=[180,90,-180,-90],q=!V.some(se=>!se.matching_text);let H;for(const se of V){const pe=et(se);if(H=H===void 0?pe:pe===void 0?H:Math.max(H,pe),q||!se.matching_text)for(const z of[0,1,2,3])g[z]=Math[z<2?"min":"max"](g[z],((oe=se.bbox)==null?void 0:oe[z])??se.center[z%2])}w&&V.length>0&&(k&&g[0]===g[2]&&g[1]===g[3]?w.flyTo(k.center,et(k)):w.fitBounds(Qe(g),50,H))}function jt(){!k||!w||(!k.bbox||k.bbox[0]===k.bbox[2]&&k.bbox[1]===k.bbox[3]?w.flyTo(k.center,et(k)):w.fitBounds(Qe(k.bbox),50,et(k)))}function et(g){var H;if(!g.bbox||g.bbox[0]!==g.bbox[2]&&g.bbox[1]!==g.bbox[3])return;const q=g.id.replace(/\..*/,"");return(Array.isArray((H=g.properties)==null?void 0:H.categories)?g.properties.categories.reduce((oe,se)=>{const pe=gt[q+"."+se];return oe===void 0?pe:pe===void 0?oe:Math.max(oe,pe)},void 0):void 0)??gt[q]}function eo(g){t(0,W=_==="always"),t(13,O=void 0),t(14,k=void 0),t(15,B=-1),Ki(g[1].toFixed(6)+", "+Hn(g[0],[-180,180],!0).toFixed(6),!1,!0)}function to(g){if(!O)return;let q=g.key==="ArrowDown"?1:g.key==="ArrowUp"?-1:0;q&&(de.focus(),t(17,we=!0),g.preventDefault(),k&&B===-1&&t(15,B=O.findIndex(H=>H.id===(k==null?void 0:k.id))),B===(k||Ue?0:-1)&&q===-1&&t(15,B=O.length),t(15,B+=q),B>=O.length&&t(15,B=-1),B<0&&(k||Ue)&&t(15,B=0))}function en(g,q=!0,H=!1){if(t(19,me=void 0),t(14,k=void 0),t(17,we=!0),ct||H){if(Fe&&clearTimeout(Fe),Z.length<M)return;const oe=Z;Fe=window.setTimeout(()=>{Gt(oe).catch(se=>t(19,me=se))},q?E:0)}else t(13,O=void 0),t(19,me=void 0)}function qt(g){k&&(k==null?void 0:k.id)===(g==null?void 0:g.id)?jt():(t(14,k=g),t(1,Z=g.place_name))}function tn(g){t(15,B=g)}function io(){(!Ue||k)&&t(15,B=-1),ft&&jt()}const no=()=>de.focus();function ro(g){bt[g?"unshift":"push"](()=>{de=g,t(18,de)})}function oo(){Z=this.value,t(1,Z),t(17,we),t(31,d),t(16,Ge)}const so=()=>t(17,we=!0),lo=()=>t(17,we=!1),uo=()=>t(17,we=!0),ao=()=>t(14,k=void 0),co=()=>{t(1,Z=""),de.focus()},fo=()=>t(0,W=!W),ho=()=>t(19,me=void 0),go=g=>tn(g),mo=g=>qt(g),po=()=>{};return i.$$set=g=>{"class"in g&&t(2,u=g.class),"apiKey"in g&&t(29,h=g.apiKey),"bbox"in g&&t(30,a=g.bbox),"clearButtonTitle"in g&&t(3,f=g.clearButtonTitle),"clearOnBlur"in g&&t(31,d=g.clearOnBlur),"clearListOnPick"in g&&t(32,m=g.clearListOnPick),"keepListOpen"in g&&t(4,b=g.keepListOpen),"collapsed"in g&&t(5,v=g.collapsed),"country"in g&&t(33,y=g.country),"debounceSearch"in g&&t(34,E=g.debounceSearch),"enableReverse"in g&&t(6,_=g.enableReverse),"errorMessage"in g&&t(7,L=g.errorMessage),"filter"in g&&t(35,P=g.filter),"flyTo"in g&&t(36,N=g.flyTo),"fuzzyMatch"in g&&t(37,x=g.fuzzyMatch),"language"in g&&t(38,S=g.language),"limit"in g&&t(39,T=g.limit),"mapController"in g&&t(40,w=g.mapController),"minLength"in g&&t(41,M=g.minLength),"noResultsMessage"in g&&t(8,R=g.noResultsMessage),"placeholder"in g&&t(9,te=g.placeholder),"proximity"in g&&t(42,C=g.proximity),"reverseActive"in g&&t(0,W=g.reverseActive),"reverseButtonTitle"in g&&t(10,fe=g.reverseButtonTitle),"searchValue"in g&&t(1,Z=g.searchValue),"pickedResultStyle"in g&&t(43,at=g.pickedResultStyle),"showPlaceType"in g&&t(11,Yi=g.showPlaceType),"showResultsWhileTyping"in g&&t(44,ct=g.showResultsWhileTyping),"selectFirst"in g&&t(45,Ue=g.selectFirst),"flyToSelected"in g&&t(46,ft=g.flyToSelected),"markerOnSelected"in g&&t(47,dt=g.markerOnSelected),"types"in g&&t(48,Ie=g.types),"exhaustiveReverseGeocoding"in g&&t(49,zt=g.exhaustiveReverseGeocoding),"excludeTypes"in g&&t(50,ht=g.excludeTypes),"zoom"in g&&t(51,gt=g.zoom),"apiUrl"in g&&t(52,At=g.apiUrl),"fetchParameters"in g&&t(53,Wt=g.fetchParameters),"iconsBaseUrl"in g&&t(12,Xi=g.iconsBaseUrl),"adjustUrlQuery"in g&&t(54,Bt=g.adjustUrlQuery),"adjustUrl"in g&&t(55,Dt=g.adjustUrl),"$$scope"in g&&t(66,s=g.$$scope)},i.$$.update=()=>{if(i.$$.dirty[0]&64&&t(0,W=_==="always"),i.$$.dirty[0]&16384|i.$$.dirty[1]&4096&&at!=="marker-only"&&k&&!k.address&&k.geometry.type==="Point"&&k.place_type[0]!=="reverse"&&Gt(k.id,{byId:!0}).catch(g=>t(19,me=g)),i.$$.dirty[0]&16384|i.$$.dirty[1]&546|i.$$.dirty[2]&1&&(w&&k&&k.id!==Ut&&N&&(jt(),m&&t(13,O=void 0),t(61,V=void 0),t(15,B=-1)),t(62,Ut=k==null?void 0:k.id)),i.$$.dirty[0]&196608|i.$$.dirty[1]&1&&setTimeout(()=>{t(16,Ge=we),d&&!Ge&&t(1,Z="")}),i.$$.dirty[0]&8194|i.$$.dirty[1]&1024&&Z.length<M&&(t(13,O=void 0),t(19,me=void 0),t(61,V=O)),i.$$.dirty[0]&57344|i.$$.dirty[1]&16384&&Ue&&O!=null&&O.length&&B==-1&&!k&&t(15,B=0),i.$$.dirty[0]&8192|i.$$.dirty[1]&1073741824&&V!==O&&t(61,V=void 0),i.$$.dirty[0]&73729|i.$$.dirty[1]&1073742336&&w&&w.setEventHandler(g=>{switch(g.type){case"mapClick":W&&eo(g.coordinates);break;case"markerClick":{const q=O==null?void 0:O.find(H=>H.id===g.id);q&&qt(q)}break;case"markerMouseEnter":V&&t(15,B=Ge?(O==null?void 0:O.findIndex(q=>q.id===g.id))??-1:-1);break;case"markerMouseLeave":V&&t(15,B=-1);break}}),i.$$.dirty[0]&40960&&t(63,r=O==null?void 0:O[B]),i.$$.dirty[1]&33312|i.$$.dirty[2]&2&&w&&r&&N&&ft&&w.flyTo(r.center,et(r)),i.$$.dirty[1]&4096&&t(65,n=at==="full-geometry-including-polygon-center-marker"),i.$$.dirty[1]&66048|i.$$.dirty[2]&8&&(dt||w==null||w.setFeatures(void 0,void 0,n)),i.$$.dirty[0]&16384|i.$$.dirty[1]&1073807872|i.$$.dirty[2]&10&&w&&dt&&!V&&(w.setFeatures(r?[r]:void 0,k,n),w.setSelectedMarker(r?0:-1)),i.$$.dirty[0]&16384|i.$$.dirty[1]&1073742336|i.$$.dirty[2]&8&&w&&w.setFeatures(V,k,n),i.$$.dirty[0]&32768|i.$$.dirty[1]&1073742336&&V&&w&&w.setSelectedMarker(B),i.$$.dirty[0]&2|i.$$.dirty[1]&512&&w){const g=Ft(Z);w.setReverseMarker(g?[g.decimalLongitude,g.decimalLatitude]:void 0)}i.$$.dirty[2]&2&&Te("select",{feature:r}),i.$$.dirty[0]&16384&&Te("pick",{feature:k}),i.$$.dirty[0]&73744&&t(64,o=!!(O!=null&&O.length)&&(Ge||b)),i.$$.dirty[2]&4&&Te("optionsvisibilitychange",{optionsVisible:o}),i.$$.dirty[0]&8192&&Te("featureslisted",{features:O}),i.$$.dirty[1]&1073741824&&Te("featuresmarked",{features:V}),i.$$.dirty[0]&1&&Te("reversetoggle",{reverse:W}),i.$$.dirty[0]&2&&Te("querychange",{query:Z}),i.$$.dirty[0]&1|i.$$.dirty[1]&512&&w&&w.indicateReverse(W)},[W,Z,u,f,b,v,_,L,R,te,fe,Yi,Xi,O,k,B,Ge,we,de,me,ze,Jr,$i,to,en,qt,tn,io,c,h,a,d,m,y,E,P,N,x,S,T,w,M,C,at,ct,Ue,ft,dt,Ie,zt,ht,gt,At,Wt,Bt,Dt,Vr,Yr,Ki,Xr,Kr,V,Ut,r,o,n,s,l,no,ro,oo,so,lo,uo,ao,co,fo,ho,go,mo,po]}let dr=class extends Me{constructor(e){super(),xe(this,e,fr,cr,Ee,{ZOOM_DEFAULTS:28,class:2,apiKey:29,bbox:30,clearButtonTitle:3,clearOnBlur:31,clearListOnPick:32,keepListOpen:4,collapsed:5,country:33,debounceSearch:34,enableReverse:6,errorMessage:7,filter:35,flyTo:36,fuzzyMatch:37,language:38,limit:39,mapController:40,minLength:41,noResultsMessage:8,placeholder:9,proximity:42,reverseActive:0,reverseButtonTitle:10,searchValue:1,pickedResultStyle:43,showPlaceType:11,showResultsWhileTyping:44,selectFirst:45,flyToSelected:46,markerOnSelected:47,types:48,exhaustiveReverseGeocoding:49,excludeTypes:50,zoom:51,apiUrl:52,fetchParameters:53,iconsBaseUrl:12,adjustUrlQuery:54,adjustUrl:55,focus:56,blur:57,setQuery:58,clearList:59,clearMap:60},null,[-1,-1,-1,-1])}get ZOOM_DEFAULTS(){return this.$$.ctx[28]}get focus(){return this.$$.ctx[56]}get blur(){return this.$$.ctx[57]}get setQuery(){return this.$$.ctx[58]}get clearList(){return this.$$.ctx[59]}get clearMap(){return this.$$.ctx[60]}};function Ye(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 Lt(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 Ye({type:"Polygon",coordinates:i},e,t)}function Xe(i,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=i,t}function wi(i,e,t={}){return Ye({type:"MultiPolygon",coordinates:i},e,t)}function Ei(i,e,t){if(i!==null)for(var n,r,o,l,s,c,u,h=0,a=0,f,d=i.type,m=d==="FeatureCollection",b=d==="Feature",v=m?i.features.length:1,y=0;y<v;y++){u=m?i.features[y].geometry:b?i.geometry:i,f=u?u.type==="GeometryCollection":!1,s=f?u.geometries.length:1;for(var E=0;E<s;E++){var _=0,L=0;if(l=f?u.geometries[E]:u,l!==null){c=l.coordinates;var P=l.type;switch(h=0,P){case null:break;case"Point":if(e(c,a,y,_,L)===!1)return!1;a++,_++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(e(c[n],a,y,_,L)===!1)return!1;a++,P==="MultiPoint"&&_++}P==="LineString"&&_++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(r=0;r<c[n].length-h;r++){if(e(c[n][r],a,y,_,L)===!1)return!1;a++}P==="MultiLineString"&&_++,P==="Polygon"&&L++}P==="Polygon"&&_++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(L=0,r=0;r<c[n].length;r++){for(o=0;o<c[n][r].length-h;o++){if(e(c[n][r][o],a,y,_,L)===!1)return!1;a++}L++}_++}break;case"GeometryCollection":for(n=0;n<l.geometries.length;n++)if(Ei(l.geometries[n],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function St(i,e){var t,n,r,o,l,s,c,u,h,a,f=0,d=i.type==="FeatureCollection",m=i.type==="Feature",b=d?i.features.length:1;for(t=0;t<b;t++){for(s=d?i.features[t].geometry:m?i.geometry:i,u=d?i.features[t].properties:m?i.properties:{},h=d?i.features[t].bbox:m?i.bbox:void 0,a=d?i.features[t].id:m?i.id:void 0,c=s?s.type==="GeometryCollection":!1,l=c?s.geometries.length:1,r=0;r<l;r++){if(o=c?s.geometries[r]:s,o===null){if(e(null,f,u,h,a)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,f,u,h,a)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(e(o.geometries[n],f,u,h,a)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function hr(i,e){St(i,function(t,n,r,o,l){var s=t===null?null:t.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return e(Ye(t,r,{bbox:o,id:l}),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 u=0;u<t.coordinates.length;u++){var h=t.coordinates[u],a={type:c,coordinates:h};if(e(Ye(a,r),n,u)===!1)return!1}})}function gr(i,e={}){if(i.bbox!=null&&e.recompute!==!0)return i.bbox;const t=[1/0,1/0,-1/0,-1/0];return Ei(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 xt=gr;function mr(i){if(!i)throw new Error("geojson is required");switch(i.type){case"Feature":return Li(i);case"FeatureCollection":return pr(i);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Mt(i);default:throw new Error("unknown GeoJSON type")}}function Li(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=Si(i.properties),i.geometry==null?e.geometry=null:e.geometry=Mt(i.geometry),e}function Si(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]=Si(n):e[t]=n}),e}function pr(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=>Li(t)),e}function Mt(i){const e={type:i.type};return i.bbox&&(e.bbox=i.bbox),i.type==="GeometryCollection"?(e.geometries=i.geometries.map(t=>Mt(t)),e):(e.coordinates=xi(i.coordinates),e)}function xi(i){const e=i;return typeof e[0]!="object"?e.slice():e.map(t=>xi(t))}var yr=mr;/**
|
|
1
|
+
(function(z,U){typeof exports=="object"&&typeof module<"u"?U(exports,require("leaflet")):typeof define=="function"&&define.amd?define(["exports","leaflet"],U):(z=typeof globalThis<"u"?globalThis:z||self,U(z.leafletMaptilerGeocoder={},z.L))})(this,function(z,U){"use strict";var wo=Object.defineProperty;var sn=z=>{throw TypeError(z)};var Eo=(z,U,K)=>U in z?wo(z,U,{enumerable:!0,configurable:!0,writable:!0,value:K}):z[U]=K;var Kt=(z,U,K)=>Eo(z,typeof U!="symbol"?U+"":U,K),ln=(z,U,K)=>U.has(z)||sn("Cannot "+K);var se=(z,U,K)=>(ln(z,U,"read from private field"),K?K.call(z):U.get(z)),Jt=(z,U,K)=>U.has(z)?sn("Cannot add the same private member more than once"):U instanceof WeakSet?U.add(z):U.set(z,K),$t=(z,U,K,ne)=>(ln(z,U,"write to private field"),ne?ne.call(z,K):U.set(z,K),K);var oe,Ae;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 ne=K(U);function F(){}function un(i,e){for(const t in e)i[t]=e[t];return i}function ei(i){return i()}function ti(){return Object.create(null)}function be(i){i.forEach(ei)}function ii(i){return typeof i=="function"}function Le(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let rt;function $(i,e){return i===e?!0:(rt||(rt=document.createElement("a")),rt.href=e,i===rt.href)}function an(i){return Object.keys(i).length===0}function cn(i,e,t,n){if(i){const r=ni(i,e,t,n);return i[0](r)}}function ni(i,e,t,n){return i[1]&&n?un(t.ctx.slice(),i[1](n(e))):t.ctx}function fn(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=[],l=Math.max(e.dirty.length,r.length);for(let s=0;s<l;s+=1)o[s]=e.dirty[s]|r[s];return o}return e.dirty|r}return e.dirty}function dn(i,e,t,n,r,o){if(r){const l=ni(e,t,n,o);i.p(l,r)}}function hn(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 ot(i){return i??""}function I(i,e){i.appendChild(e)}function j(i,e,t){i.insertBefore(e,t||null)}function G(i){i.parentNode&&i.parentNode.removeChild(i)}function B(i){return document.createElement(i)}function ae(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function Se(i){return document.createTextNode(i)}function re(){return Se(" ")}function mn(){return Se("")}function Y(i,e,t,n){return i.addEventListener(e,t,n),()=>i.removeEventListener(e,t,n)}function gn(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 pn(i){return Array.from(i.childNodes)}function Ze(i,e){e=""+e,i.data!==e&&(i.data=e)}function ri(i,e){i.value=e??""}function ge(i,e,t){i.classList.toggle(e,!!t)}function yn(i,e,{bubbles:t=!1,cancelable:n=!1}={}){return new CustomEvent(i,{detail:e,bubbles:t,cancelable:n})}let Qe;function He(i){Qe=i}function oi(){if(!Qe)throw new Error("Function called outside component initialization");return Qe}function bn(i){oi().$$.on_destroy.push(i)}function si(){const i=oi();return(e,t,{cancelable:n=!1}={})=>{const r=i.$$.callbacks[e];if(r){const o=yn(e,t,{cancelable:n});return r.slice().forEach(l=>{l.call(i,o)}),!o.defaultPrevented}return!0}}function vn(i,e){const t=i.$$.callbacks[e.type];t&&t.slice().forEach(n=>n.call(this,e))}const Ue=[],wt=[];let Fe=[];const li=[],_n=Promise.resolve();let Et=!1;function wn(){Et||(Et=!0,_n.then(ui))}function Lt(i){Fe.push(i)}const St=new Set;let Ge=0;function ui(){if(Ge!==0)return;const i=Qe;do{try{for(;Ge<Ue.length;){const e=Ue[Ge];Ge++,He(e),En(e.$$)}}catch(e){throw Ue.length=0,Ge=0,e}for(He(null),Ue.length=0,Ge=0;wt.length;)wt.pop()();for(let e=0;e<Fe.length;e+=1){const t=Fe[e];St.has(t)||(St.add(t),t())}Fe.length=0}while(Ue.length);for(;li.length;)li.pop()();Et=!1,St.clear(),He(i)}function En(i){if(i.fragment!==null){i.update(),be(i.before_update);const e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(Lt)}}function Ln(i){const e=[],t=[];Fe.forEach(n=>i.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),Fe=e}const st=new Set;let ze;function lt(){ze={r:0,c:[],p:ze}}function ut(){ze.r||be(ze.c),ze=ze.p}function Q(i,e){i&&i.i&&(st.delete(i),i.i(e))}function X(i,e,t,n){if(i&&i.o){if(st.has(i))return;st.add(i),ze.c.push(()=>{st.delete(i),n&&(t&&i.d(1),n())}),i.o(e)}else n&&n()}function ai(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function Sn(i,e){X(i,1,1,()=>{e.delete(i.key)})}function xn(i,e,t,n,r,o,l,s,c,u,h,a){let f=i.length,d=o.length,g=f;const b={};for(;g--;)b[i[g].key]=g;const v=[],y=new Map,E=new Map,_=[];for(g=d;g--;){const x=a(r,o,g),S=t(x);let P=l.get(S);P?_.push(()=>P.p(x,e)):(P=u(S,x),P.c()),y.set(S,v[g]=P),S in b&&E.set(S,Math.abs(g-b[S]))}const L=new Set,T=new Set;function N(x){Q(x,1),x.m(s,h),l.set(x.key,x),h=x.first,d--}for(;f&&d;){const x=v[d-1],S=i[f-1],P=x.key,w=S.key;x===S?(h=x.first,f--,d--):y.has(w)?!l.has(P)||L.has(P)?N(x):T.has(w)?f--:E.get(P)>E.get(w)?(T.add(P),N(x)):(L.add(w),f--):(c(S,l),f--)}for(;f--;){const x=i[f];y.has(x.key)||c(x,l)}for(;d;)N(v[d-1]);return be(_),v}function xe(i){i&&i.c()}function ve(i,e,t){const{fragment:n,after_update:r}=i.$$;n&&n.m(e,t),Lt(()=>{const o=i.$$.on_mount.map(ei).filter(ii);i.$$.on_destroy?i.$$.on_destroy.push(...o):be(o),i.$$.on_mount=[]}),r.forEach(Lt)}function _e(i,e){const t=i.$$;t.fragment!==null&&(Ln(t.after_update),be(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Mn(i,e){i.$$.dirty[0]===-1&&(Ue.push(i),wn(),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function Me(i,e,t,n,r,o,l=null,s=[-1]){const c=Qe;He(i);const u=i.$$={fragment:null,ctx:[],props:o,update:F,not_equal:r,bound:ti(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:ti(),dirty:s,skip_bound:!1,root:e.target||c.$$.root};l&&l(u.root);let h=!1;if(u.ctx=t?t(i,e.props||{},(a,f,...d)=>{const g=d.length?d[0]:f;return u.ctx&&r(u.ctx[a],u.ctx[a]=g)&&(!u.skip_bound&&u.bound[a]&&u.bound[a](g),h&&Mn(i,a)),f}):[],u.update(),h=!0,be(u.before_update),u.fragment=n?n(u.ctx):!1,e.target){if(e.hydrate){const a=pn(e.target);u.fragment&&u.fragment.l(a),a.forEach(G)}else u.fragment&&u.fragment.c();e.intro&&Q(i.$$.fragment),ve(i,e.target,e.anchor),ui()}He(c)}class Ce{constructor(){Kt(this,"$$");Kt(this,"$$set")}$destroy(){_e(this,1),this.$destroy=F}$on(e,t){if(!ii(t))return F;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&&!an(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Cn="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Cn);function kn(i){let e,t;return{c(){e=ae("svg"),t=ae("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){j(n,e,r),I(e,t)},p:F,i:F,o:F,d(n){n&&G(e)}}}class ci extends Ce{constructor(e){super(),Me(this,e,null,kn,Le,{})}}function Nn(i){let e,t;return{c(){e=ae("svg"),t=ae("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){j(n,e,r),I(e,t)},p:F,i:F,o:F,d(n){n&&G(e)}}}class fi extends Ce{constructor(e){super(),Me(this,e,null,Nn,Le,{})}}function Tn(i){let e,t;return{c(){e=B("img"),$(e.src,t=i[3]+"area.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"title",i[6]),p(e,"class","svelte-z7p9pp")},m(n,r){j(n,e,r)},p(n,r){r&8&&!$(e.src,t=n[3]+"area.svg")&&p(e,"src",t),r&64&&p(e,"alt",n[6]),r&64&&p(e,"title",n[6])},d(n){n&&G(e)}}}function Pn(i){let e,t;return{c(){e=B("img"),$(e.src,t=i[3]+"reverse.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"title",i[6]),p(e,"class","svelte-z7p9pp")},m(n,r){j(n,e,r)},p(n,r){r&8&&!$(e.src,t=n[3]+"reverse.svg")&&p(e,"src",t),r&64&&p(e,"alt",n[6]),r&64&&p(e,"title",n[6])},d(n){n&&G(e)}}}function Rn(i){let e,t;return{c(){e=B("img"),$(e.src,t=i[3]+"poi.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"title",i[6]),p(e,"class","svelte-z7p9pp")},m(n,r){j(n,e,r)},p(n,r){r&8&&!$(e.src,t=n[3]+"poi.svg")&&p(e,"src",t),r&64&&p(e,"alt",n[6]),r&64&&p(e,"title",n[6])},d(n){n&&G(e)}}}function On(i){let e,t;return{c(){e=B("img"),$(e.src,t=i[3]+"postal_code.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"title",i[6]),p(e,"class","svelte-z7p9pp")},m(n,r){j(n,e,r)},p(n,r){r&8&&!$(e.src,t=n[3]+"postal_code.svg")&&p(e,"src",t),r&64&&p(e,"alt",n[6]),r&64&&p(e,"title",n[6])},d(n){n&&G(e)}}}function In(i){let e,t;return{c(){e=B("img"),$(e.src,t=i[3]+"street.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"title",i[6]),p(e,"class","svelte-z7p9pp")},m(n,r){j(n,e,r)},p(n,r){r&8&&!$(e.src,t=n[3]+"street.svg")&&p(e,"src",t),r&64&&p(e,"alt",n[6]),r&64&&p(e,"title",n[6])},d(n){n&&G(e)}}}function zn(i){let e,t;return{c(){e=B("img"),$(e.src,t=i[3]+"road.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"title",i[6]),p(e,"class","svelte-z7p9pp")},m(n,r){j(n,e,r)},p(n,r){r&8&&!$(e.src,t=n[3]+"road.svg")&&p(e,"src",t),r&64&&p(e,"alt",n[6]),r&64&&p(e,"title",n[6])},d(n){n&&G(e)}}}function An(i){let e,t;return{c(){e=B("img"),$(e.src,t=i[3]+"housenumber.svg")||p(e,"src",t),p(e,"alt",i[6]),p(e,"title",i[6]),p(e,"class","svelte-z7p9pp")},m(n,r){j(n,e,r)},p(n,r){r&8&&!$(e.src,t=n[3]+"housenumber.svg")&&p(e,"src",t),r&64&&p(e,"alt",n[6]),r&64&&p(e,"title",n[6])},d(n){n&&G(e)}}}function Wn(i){let e,t,n,r;return{c(){e=B("img"),$(e.src,t=i[5])||p(e,"src",t),p(e,"alt",i[4]),p(e,"title",i[6]),p(e,"class","svelte-z7p9pp")},m(o,l){j(o,e,l),n||(r=Y(e,"error",i[14]),n=!0)},p(o,l){l&32&&!$(e.src,t=o[5])&&p(e,"src",t),l&16&&p(e,"alt",o[4]),l&64&&p(e,"title",o[6])},d(o){o&&G(e),n=!1,r()}}}function di(i){let e,t;return{c(){e=B("span"),t=Se(i[6]),p(e,"class","secondary svelte-z7p9pp")},m(n,r){j(n,e,r),I(e,t)},p(n,r){r&64&&Ze(t,n[6])},d(n){n&&G(e)}}}function Bn(i){let e,t,n,r,o,l,s,c,u,h=(i[8]?i[0].place_name:i[0].place_name.replace(/,.*/,""))+"",a,f,d=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[8],g,b,v=(i[8]?"":i[0].place_name.replace(/[^,]*,?\s*/,""))+"",y,E,_,L,T,N;function x(M,O){return O&1&&(t=null),O&1&&(n=null),O&1&&(r=null),O&1&&(o=null),M[5]?Wn:M[0].address?An:(t==null&&(t=!!M[0].id.startsWith("road.")),t?zn:(n==null&&(n=!!M[0].id.startsWith("address.")),n?In:(r==null&&(r=!!M[0].id.startsWith("postal_code.")),r?On:(o==null&&(o=!!M[0].id.startsWith("poi.")),o?Rn:M[8]?Pn:Tn))))}let S=x(i,-1),P=S(i),w=d&&di(i);return{c(){e=B("li"),P.c(),l=re(),s=B("span"),c=B("span"),u=B("span"),a=Se(h),f=re(),w&&w.c(),g=re(),b=B("span"),y=Se(v),p(u,"class","primary svelte-z7p9pp"),p(c,"class","svelte-z7p9pp"),p(b,"class","line2 svelte-z7p9pp"),p(s,"class","texts svelte-z7p9pp"),p(e,"tabindex","-1"),p(e,"role","option"),p(e,"aria-selected",E=i[1]==="selected"),p(e,"aria-checked",_=i[1]==="picked"),p(e,"class",L=ot(i[1])+" svelte-z7p9pp")},m(M,O){j(M,e,O),P.m(e,null),I(e,l),I(e,s),I(s,c),I(c,u),I(u,a),I(c,f),w&&w.m(c,null),I(s,g),I(s,b),I(b,y),T||(N=[Y(e,"mouseenter",i[13]),Y(e,"focus",i[15]),Y(e,"click",i[16])],T=!0)},p(M,[O]){S===(S=x(M,O))&&P?P.p(M,O):(P.d(1),P=S(M),P&&(P.c(),P.m(e,l))),O&1&&h!==(h=(M[8]?M[0].place_name:M[0].place_name.replace(/,.*/,""))+"")&&Ze(a,h),O&37&&(d=M[2]==="always"||M[2]!=="never"&&!M[0].address&&!M[0].id.startsWith("road.")&&!M[0].id.startsWith("address.")&&!M[0].id.startsWith("postal_code.")&&(!M[0].id.startsWith("poi.")||!M[5])&&!M[8]),d?w?w.p(M,O):(w=di(M),w.c(),w.m(c,null)):w&&(w.d(1),w=null),O&1&&v!==(v=(M[8]?"":M[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&Ze(y,v),O&2&&E!==(E=M[1]==="selected")&&p(e,"aria-selected",E),O&2&&_!==(_=M[1]==="picked")&&p(e,"aria-checked",_),O&2&&L!==(L=ot(M[1])+" svelte-z7p9pp")&&p(e,"class",L)},i:F,o:F,d(M){M&&G(e),P.d(),w&&w.d(),T=!1,be(N)}}}function Dn(i,e,t){var T;let n,r,{feature:o}=e,{style:l="default"}=e,{showPlaceType:s}=e,{missingIconsCache:c}=e,{iconsBaseUrl:u}=e;const h=si(),a=(T=o.properties)==null?void 0:T.categories;let f,d,g=0,b=o.place_type[0]==="reverse";function v(){d&&c.add(d),t(11,g++,g)}function y(N){vn.call(this,i,N)}const E=()=>v(),_=()=>h("select",void 0),L=N=>{document.activeElement!==N.target&&h("select",void 0)};return i.$$set=N=>{"feature"in N&&t(0,o=N.feature),"style"in N&&t(1,l=N.style),"showPlaceType"in N&&t(2,s=N.showPlaceType),"missingIconsCache"in N&&t(10,c=N.missingIconsCache),"iconsBaseUrl"in N&&t(3,u=N.iconsBaseUrl)},i.$$.update=()=>{var N,x,S,P;if(i.$$.dirty&7224)do t(12,n--,n),t(4,f=a==null?void 0:a[n]),t(5,d=f?u+f.replace(/ /g,"_")+".svg":void 0);while(n>-1&&(!d||c.has(d)));i.$$.dirty&1&&t(6,r=((x=(N=o.properties)==null?void 0:N.categories)==null?void 0:x.join(", "))??((P=(S=o.properties)==null?void 0:S.place_type_name)==null?void 0:P[0])??o.place_type[0])},t(12,n=(a==null?void 0:a.length)??0),[o,l,s,u,f,d,r,h,b,v,c,g,n,y,E,_,L]}class Un extends Ce{constructor(e){super(),Me(this,e,Dn,Bn,Le,{feature:0,style:1,showPlaceType:2,missingIconsCache:10,iconsBaseUrl:3})}}function Fn(i){let e;return{c(){e=B("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){j(t,e,n)},p:F,i:F,o:F,d(t){t&&G(e)}}}class Gn extends Ce{constructor(e){super(),Me(this,e,null,Fn,Le,{})}}function jn(i){let e,t,n;return{c(){e=ae("svg"),t=ae("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"),ge(e,"in-map",i[0]!=="list"),ge(e,"list-icon",i[0]==="list")},m(r,o){j(r,e,o),I(e,t)},p(r,[o]){o&1&&n!==(n=r[0]==="list"?20:void 0)&&p(e,"width",n),o&1&&ge(e,"in-map",r[0]!=="list"),o&1&&ge(e,"list-icon",r[0]==="list")},i:F,o:F,d(r){r&&G(e)}}}function qn(i,e,t){let{displayIn:n}=e;return i.$$set=r=>{"displayIn"in r&&t(0,n=r.displayIn)},[n]}class Zn extends Ce{constructor(e){super(),Me(this,e,qn,jn,Le,{displayIn:0})}}function Qn(i){let e,t;return{c(){e=ae("svg"),t=ae("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){j(n,e,r),I(e,t)},p:F,i:F,o:F,d(n){n&&G(e)}}}class Hn extends Ce{constructor(e){super(),Me(this,e,null,Qn,Le,{})}}function Vn(i){let e,t,n;return{c(){e=ae("svg"),t=ae("circle"),n=ae("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){j(r,e,o),I(e,t),I(e,n)},p:F,i:F,o:F,d(r){r&&G(e)}}}class Yn extends Ce{constructor(e){super(),Me(this,e,null,Vn,Le,{})}}function Xn(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 Ve(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 Ye;async function Kn(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(Ye&&r.cachedLocationExpiry&&Ye.time+r.cachedLocationExpiry>Date.now()){if(!Ye.coords)break e;return Ye.coords}let o;try{return o=await new Promise((l,s)=>{t.signal.addEventListener("abort",()=>{s(Error("aborted"))}),navigator.geolocation.getCurrentPosition(c=>{l([c.coords.longitude,c.coords.latitude].map(u=>u.toFixed(6)).join(","))},c=>{s(c)},r)}),o}catch{}finally{r.cachedLocationExpiry&&(Ye={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 Jn=/^(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,hi=/^([+-]?[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,})$/,mi=/^(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,gi=/^(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,pi=/^(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,yi=/^(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 $n(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(d=>Number(d.trim())),t=Number(e[0]),n=Number(e[1]),r=Math.abs(t),o=Math.abs(n),l=t>0?"N":"S",s=n>0?"E":"W";let c;i=="DD"&&(c=`${r}° ${l}, ${o}° ${s}`);const u=Math.floor(r),h=Math.floor(o),a=(r-u)*60,f=(o-h)*60;if(i=="DM"){let d=bi(a,3).toFixed(3).padStart(6,"0"),g=bi(f,3).toFixed(3).padStart(6,"0");d.endsWith(".000")&&g.endsWith(".000")&&(d=d.replace(/\.000$/,""),g=g.replace(/\.000$/,"")),c=`${u}° ${d}' ${l}, ${h}° ${g}' ${s}`}if(i=="DMS"){const d=Math.floor(a),g=Math.floor(f);let b=((a-d)*60).toFixed(1).padStart(4,"0"),v=((f-g)*60).toFixed(1).padStart(4,"0");const y=d.toString().padStart(2,"0"),E=g.toString().padStart(2,"0");b.endsWith(".0")&&v.endsWith(".0")&&(b=b.replace(/\.0$/,""),v=v.replace(/\.0$/,"")),c=`${u}° ${y}' ${b}" ${l}, ${h}° ${E}' ${v}" ${s}`}return c}else throw new Error("no decimal coordinates to convert")}function bi(i,e){const t=Math.pow(10,e);return Math.round((i+Number.EPSILON)*t)/t}function xt(i,e){e||(e=5),i=i.replace(/\s+/g," ").trim();let t=null,n=null,r="",o="",l=null,s=[],c=!1;if(Jn.test(i))throw new Error("invalid coordinate value");if(hi.test(i))if(s=hi.exec(i),c=Xe(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),l="DM";else throw new Error("invalid coordinate format");else if(mi.test(i))if(s=mi.exec(i),c=Xe(s),c){if(t=s[2],n=s[6],t.includes(",")&&(t=t.replace(",",".")),n.includes(",")&&(n=n.replace(",",".")),l="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(gi.test(i))if(s=gi.exec(i),c=Xe(s),c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,l="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,l="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(pi.test(i))if(s=pi.exec(i),c=Xe(s),c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,l="DM"),s[6]&&(t+=s[6]/3600,l="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(yi.test(i)){if(s=yi.exec(i),c=Xe(s),s.filter(u=>u).length<=5)throw new Error("invalid coordinates format");if(c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4].replace(",",".")/60,l="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,l="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 u=/S|SOUTH/i;u.test(r)&&t>0&&(t=-1*t),u=/W|WEST/i,u.test(o)&&n>0&&(n=-1*n);const h=s[0].trim();let a,f;const d=/[,/;\u0020]/g,g=h.match(d);if(g==null){const y=Math.floor(i.length/2);a=h.substring(0,y).trim(),f=h.substring(y).trim()}else{let y;g.length%2==1?y=Math.floor(g.length/2):y=g.length/2-1;let E=0;if(y==0)E=h.indexOf(g[0]),a=h.substring(0,E).trim(),f=h.substring(E+1).trim();else{let _=0,L=0;for(;_<=y;)E=h.indexOf(g[_],L),L=E+1,_++;a=h.substring(0,E).trim(),f=h.substring(E+1).trim()}}const b=a.split(".");if(b.length==2&&b[1]==0&&b[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:h,verbatimLatitude:a,verbatimLongitude:f,decimalLatitude:t,decimalLongitude:n,decimalCoordinates:`${t},${n}`,originalFormat:l,closeEnough:er,toCoordinateFormat:$n})}else throw new Error("coordinates pattern match failed")}function Xe(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 l=e[o],s=e[o+r],c=t.test(l)&&t.test(s),u=n.test(l)&&n.test(s),h=l==s;if(!(l==null&&s==null)){if(l==null||s==null)return!1;if(c||u||h)continue;return!1}}return!0}function vi(i,e){const t=Math.abs(i-e);return Number(t.toFixed(6))<=1e-5}function er(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 vi(this.decimalLatitude,Number(e[0]))&&vi(this.decimalLongitude,e[1])}else throw new Error("coords being tested must be separated by a comma")}const tr=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});xt.to=tr;const ir=[{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"}],nr={decimalLatitude:40.123,decimalLongitude:-74.123},rr=[{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}],or=[{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 sr(){const i=[];return ir.forEach(e=>{e.decimalLatitude?i.push(e):i.push({...e,...nr})}),[...i,...rr,...or]}const lr=sr();xt.formats=lr.map(i=>i.verbatimCoordinates);const ur=xt;function _i(i,e,t){const n=i.slice();return n[94]=e[t],n[96]=t,n}function wi(i){let e,t;return e=new Gn({}),{c(){xe(e.$$.fragment)},m(n,r){ve(e,n,r),t=!0},i(n){t||(Q(e.$$.fragment,n),t=!0)},o(n){X(e.$$.fragment,n),t=!1},d(n){_e(e,n)}}}function Ei(i){let e,t,n,r,o;return t=new Hn({}),{c(){e=B("button"),xe(t.$$.fragment),p(e,"type","button"),p(e,"title",i[10]),p(e,"class","svelte-bz0zu3"),ge(e,"active",i[0])},m(l,s){j(l,e,s),ve(t,e,null),n=!0,r||(o=Y(e,"click",i[78]),r=!0)},p(l,s){(!n||s[0]&1024)&&p(e,"title",l[10]),(!n||s[0]&1)&&ge(e,"active",l[0])},i(l){n||(Q(t.$$.fragment,l),n=!0)},o(l){X(t.$$.fragment,l),n=!1},d(l){l&&G(e),_e(t),r=!1,o()}}}function ar(i){let e,t=[],n=new Map,r,o,l,s=ai(i[13]);const c=u=>u[94].id+(u[94].address?","+u[94].address:"");for(let u=0;u<s.length;u+=1){let h=_i(i,s,u),a=c(h);n.set(a,t[u]=Li(a,h))}return{c(){e=B("ul");for(let u=0;u<t.length;u+=1)t[u].c();p(e,"class","options svelte-bz0zu3"),p(e,"role","listbox")},m(u,h){j(u,e,h);for(let a=0;a<t.length;a+=1)t[a]&&t[a].m(e,null);r=!0,o||(l=[Y(e,"mouseleave",i[27]),Y(e,"blur",i[82]),Y(e,"keydown",i[23])],o=!0)},p(u,h){h[0]&102823936&&(s=ai(u[13]),lt(),t=xn(t,h,c,1,u,s,n,e,Sn,Li,null,_i),ut())},i(u){if(!r){for(let h=0;h<s.length;h+=1)Q(t[h]);r=!0}},o(u){for(let h=0;h<t.length;h+=1)X(t[h]);r=!1},d(u){u&&G(e);for(let h=0;h<t.length;h+=1)t[h].d();o=!1,be(l)}}}function cr(i){let e,t,n,r,o,l;return t=new fi({}),{c(){e=B("div"),xe(t.$$.fragment),n=re(),r=B("div"),o=Se(i[8]),p(r,"class","svelte-bz0zu3"),p(e,"class","no-results svelte-bz0zu3")},m(s,c){j(s,e,c),ve(t,e,null),I(e,n),I(e,r),I(r,o),l=!0},p(s,c){(!l||c[0]&256)&&Ze(o,s[8])},i(s){l||(Q(t.$$.fragment,s),l=!0)},o(s){X(t.$$.fragment,s),l=!1},d(s){s&&G(e),_e(t)}}}function fr(i){let e="",t;return{c(){t=Se(e)},m(n,r){j(n,t,r)},p:F,i:F,o:F,d(n){n&&G(t)}}}function dr(i){let e,t,n,r,o,l,s,c,u,h,a;return t=new fi({}),c=new ci({}),{c(){e=B("div"),xe(t.$$.fragment),n=re(),r=B("div"),o=Se(i[7]),l=re(),s=B("button"),xe(c.$$.fragment),p(r,"class","svelte-bz0zu3"),p(s,"class","svelte-bz0zu3"),p(e,"class","error svelte-bz0zu3")},m(f,d){j(f,e,d),ve(t,e,null),I(e,n),I(e,r),I(r,o),I(e,l),I(e,s),ve(c,s,null),u=!0,h||(a=Y(s,"click",i[79]),h=!0)},p(f,d){(!u||d[0]&128)&&Ze(o,f[7])},i(f){u||(Q(t.$$.fragment,f),Q(c.$$.fragment,f),u=!0)},o(f){X(t.$$.fragment,f),X(c.$$.fragment,f),u=!1},d(f){f&&G(e),_e(t),_e(c),h=!1,a()}}}function Li(i,e){var s;let t,n,r;function o(){return e[80](e[96])}function l(){return e[81](e[94])}return n=new Un({props:{feature:e[94],showPlaceType:e[11],style:e[15]===e[96]?"selected":((s=e[14])==null?void 0:s.id)===e[94].id?"picked":"default",missingIconsCache:e[21],iconsBaseUrl:e[12]}}),n.$on("mouseenter",o),n.$on("select",l),{key:i,first:null,c(){t=mn(),xe(n.$$.fragment),this.first=t},m(c,u){j(c,t,u),ve(n,c,u),r=!0},p(c,u){var a;e=c;const h={};u[0]&8192&&(h.feature=e[94]),u[0]&2048&&(h.showPlaceType=e[11]),u[0]&57344&&(h.style=e[15]===e[96]?"selected":((a=e[14])==null?void 0:a.id)===e[94].id?"picked":"default"),u[0]&4096&&(h.iconsBaseUrl=e[12]),n.$set(h)},i(c){r||(Q(n.$$.fragment,c),r=!0)},o(c){X(n.$$.fragment,c),r=!1},d(c){c&&G(t),_e(n,c)}}}function hr(i){let e,t,n,r,o,l,s,c,u,h,a,f,d,g,b,v,y,E,_,L,T,N=!1;o=new Yn({}),a=new ci({});let x=i[20]&&wi(),S=i[6]==="button"&&Ei(i);const P=i[69].default,w=cn(P,i,i[68],null),M=[dr,fr,cr,ar],O=[];function ie(C,A){var fe,q;return C[19]?0:!C[16]&&!C[4]?1:((fe=C[13])==null?void 0:fe.length)===0?2:(q=C[13])!=null&&q.length&&(C[16]||C[4])?3:-1}return~(v=ie(i))&&(y=O[v]=M[v](i)),{c(){e=re(),t=B("form"),n=B("div"),r=B("button"),xe(o.$$.fragment),l=re(),s=B("input"),c=re(),u=B("div"),h=B("button"),xe(a.$$.fragment),f=re(),x&&x.c(),d=re(),S&&S.c(),g=re(),w&&w.c(),b=re(),y&&y.c(),p(r,"class","search-button svelte-bz0zu3"),p(r,"type","button"),p(s,"placeholder",i[9]),p(s,"aria-label",i[9]),p(s,"class","svelte-bz0zu3"),p(h,"type","button"),p(h,"title",i[3]),p(h,"class","svelte-bz0zu3"),p(u,"class","clear-button-container svelte-bz0zu3"),ge(u,"displayable",i[1]!==""),p(n,"class","input-group svelte-bz0zu3"),p(t,"class",E=ot(i[2])+" svelte-bz0zu3"),ge(t,"can-collapse",i[5]&&i[1]==="")},m(C,A){j(C,e,A),j(C,t,A),I(t,n),I(n,r),ve(o,r,null),I(n,l),I(n,s),i[71](s),ri(s,i[1]),I(n,c),I(n,u),I(u,h),ve(a,h,null),I(u,f),x&&x.m(u,null),I(n,d),S&&S.m(n,null),I(n,g),w&&w.m(n,null),I(t,b),~v&&O[v].m(t,null),_=!0,L||(T=[Y(r,"click",i[70]),Y(s,"input",i[72]),Y(s,"focus",i[73]),Y(s,"blur",i[74]),Y(s,"click",i[75]),Y(s,"keydown",i[23]),Y(s,"input",i[24]),Y(s,"change",i[76]),Y(h,"click",i[77]),Y(t,"submit",gn(i[22]))],L=!0)},p(C,A){(!_||A[0]&512)&&p(s,"placeholder",C[9]),(!_||A[0]&512)&&p(s,"aria-label",C[9]),A[0]&2&&s.value!==C[1]&&ri(s,C[1]),(!_||A[0]&8)&&p(h,"title",C[3]),C[20]?x?A[0]&1048576&&Q(x,1):(x=wi(),x.c(),Q(x,1),x.m(u,null)):x&&(lt(),X(x,1,1,()=>{x=null}),ut()),(!_||A[0]&2)&&ge(u,"displayable",C[1]!==""),C[6]==="button"?S?(S.p(C,A),A[0]&64&&Q(S,1)):(S=Ei(C),S.c(),Q(S,1),S.m(n,g)):S&&(lt(),X(S,1,1,()=>{S=null}),ut()),w&&w.p&&(!_||A[2]&64)&&dn(w,P,C,C[68],_?fn(P,C[68],A,null):hn(C[68]),null);let fe=v;v=ie(C),v===fe?~v&&O[v].p(C,A):(y&&(lt(),X(O[fe],1,1,()=>{O[fe]=null}),ut()),~v?(y=O[v],y?y.p(C,A):(y=O[v]=M[v](C),y.c()),Q(y,1),y.m(t,null)):y=null),(!_||A[0]&4&&E!==(E=ot(C[2])+" svelte-bz0zu3"))&&p(t,"class",E),(!_||A[0]&38)&&ge(t,"can-collapse",C[5]&&C[1]==="")},i(C){_||(Q(N),Q(o.$$.fragment,C),Q(a.$$.fragment,C),Q(x),Q(S),Q(w,C),Q(y),_=!0)},o(C){X(N),X(o.$$.fragment,C),X(a.$$.fragment,C),X(x),X(S),X(w,C),X(y),_=!1},d(C){C&&(G(e),G(t)),_e(o),i[71](null),_e(a),x&&x.d(),S&&S.d(),w&&w.d(C),~v&&O[v].d(),L=!1,be(T)}}}function mr(i,e,t){let n,r,o,{$$slots:l={},$$scope:s}=e;const c={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:u=void 0}=e,{apiKey:h}=e,{bbox:a=void 0}=e,{clearButtonTitle:f="clear"}=e,{clearOnBlur:d=!1}=e,{clearListOnPick:g=!1}=e,{keepListOpen:b=!1}=e,{collapsed:v=!1}=e,{country:y=void 0}=e,{debounceSearch:E=200}=e,{enableReverse:_="never"}=e,{errorMessage:L="Something went wrong…"}=e,{filter:T=()=>!0}=e,{flyTo:N=!0}=e,{fuzzyMatch:x=!0}=e,{language:S=void 0}=e,{limit:P=void 0}=e,{mapController:w=void 0}=e,{minLength:M=2}=e,{noResultsMessage:O="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:ie="Search"}=e,{proximity:C=[{type:"server-geolocation"}]}=e,{reverseActive:A=_==="always"}=e,{reverseButtonTitle:fe="toggle reverse geocoding"}=e,{searchValue:q=""}=e,{pickedResultStyle:dt="full-geometry"}=e,{showPlaceType:Ji="if-needed"}=e,{showResultsWhileTyping:ht=!0}=e,{autocompleteTimeout:Bt=void 0}=e,{selectFirst:We=!0}=e,{flyToSelected:mt=!1}=e,{markerOnSelected:gt=!0}=e,{types:Be=void 0}=e,{exhaustiveReverseGeocoding:Dt=!1}=e,{excludeTypes:pt=!1}=e,{zoom:yt=c}=e,{apiUrl:Ut="https://api.maptiler.com/geocoding"}=e,{fetchParameters:Ft={}}=e,{iconsBaseUrl:$i="https://cdn.maptiler.com/maptiler-geocoding-control/v2.1.0-with-autocomplete-timeout/icons/"}=e,{adjustUrlQuery:Gt=()=>{}}=e,{adjustUrl:jt=()=>{}}=e;function Kr(m){de.focus(m)}function Jr(){de.blur()}function en(m,Z=!0,H=!1){t(1,q=m),Z?(t(15,W=-1),nn()):(rn(void 0,!H,H),setTimeout(()=>{de.focus(),de.select()}))}function $r(){t(13,R=void 0),t(14,k=void 0),t(15,W=-1)}function eo(){t(62,V=[]),t(14,k=void 0)}let R,V,k,tn="",de,W=-1,pe,bt=[],De,Re,ue,qe,qt,Ee=!1;const to=new Set,Oe=si();function io(){return!!ue}bn(()=>{w&&(w.setEventHandler(void 0),w.indicateReverse(!1),w.setSelectedMarker(-1),w.setFeatures(void 0,void 0,!1))});function nn(m){if(t(17,Ee=!1),Re&&(window.clearTimeout(Re),Re=void 0),ue){window.clearTimeout(ue),t(63,ue=void 0),it(q,{appendSpace:!0});return}if(W>-1&&R)t(14,k=R[W]),t(1,q=k.place_type[0]==="reverse"?k.place_name:k.place_name.replace(/,.*/,"")),t(19,pe=void 0),t(62,V=void 0),t(15,W=-1);else if(q){const Z=m||!Zt(q);it(q,{exact:!0}).then(()=>{t(62,V=R),t(14,k=void 0),Z&&no()}).catch(H=>t(19,pe=H))}}function Zt(m){try{return ur(m,6)}catch{return!1}}async function it(m,{byId:Z=!1,exact:H=!1,appendSpace:he=!1}={}){var ye,Ie;t(19,pe=void 0),De==null||De.abort();const J=new AbortController;t(20,De=J);try{const D=Zt(m),Vt=new URL(Ut+"/"+encodeURIComponent(D?D.decimalLongitude+","+D.decimalLatitude:m+(he?" ":""))+".json"),me=Vt.searchParams;if(S!==void 0&&me.set("language",Array.isArray(S)?S.join(","):S??""),Be&&me.set("types",Be.join(",")),pt&&me.set("excludeTypes",String(pt)),a&&me.set("bbox",a.map(_t=>_t.toFixed(6)).join(",")),y&&me.set("country",Array.isArray(y)?y.join(","):y),!Z&&!D){const _t=await Kn(w,C,J);_t&&me.set("proximity",_t),(H||!ht)&&me.set("autocomplete","false"),me.set("fuzzyMatch",String(x))}P!==void 0&&(Dt||!D||(Be==null?void 0:Be.length)===1)&&me.set("limit",String(P)),me.set("key",h),Gt(me),jt(Vt);const vt=Vt.toString();if(vt===tn){Z?(g&&t(13,R=void 0),t(14,k=bt[0])):(t(13,R=bt),((ye=R[W])==null?void 0:ye.id)!==(r==null?void 0:r.id)&&t(15,W=-1));return}tn=vt;const Yt=await fetch(vt,{signal:J.signal,...Ft});if(!Yt.ok)throw new Error(await Yt.text());const Xt=await Yt.json();Oe("response",{url:vt,featureCollection:Xt}),Z?(g&&t(13,R=void 0),t(14,k=Xt.features[0]),bt=[k]):(t(13,R=Xt.features.filter(T)),D&&R.unshift({type:"Feature",properties:{},id:"reverse_"+D.decimalLongitude+"_"+D.decimalLatitude,text:D.decimalLatitude+", "+D.decimalLongitude,place_name:D.decimalLatitude+", "+D.decimalLongitude,place_type:["reverse"],center:[D.decimalLongitude,D.decimalLatitude],bbox:[D.decimalLongitude,D.decimalLatitude,D.decimalLongitude,D.decimalLatitude],geometry:{type:"Point",coordinates:[D.decimalLongitude,D.decimalLatitude]}}),bt=R,((Ie=R[W])==null?void 0:Ie.id)!==(r==null?void 0:r.id)&&t(15,W=-1),D&&de.focus())}catch(D){if(D&&typeof D=="object"&&"name"in D&&D.name==="AbortError")return;throw D}finally{J===De&&t(20,De=void 0)}}function no(){var he;if(!(V!=null&&V.length)||!N)return;const m=[180,90,-180,-90],Z=!V.some(J=>!J.matching_text);let H;for(const J of V){const ye=nt(J);if(H=H===void 0?ye:ye===void 0?H:Math.max(H,ye),Z||!J.matching_text)for(const Ie of[0,1,2,3])m[Ie]=Math[Ie<2?"min":"max"](m[Ie],((he=J.bbox)==null?void 0:he[Ie])??J.center[Ie%2])}w&&V.length>0&&(k&&m[0]===m[2]&&m[1]===m[3]?w.flyTo(k.center,nt(k)):w.fitBounds(Ve(m),50,H))}function Qt(){!k||!w||(!k.bbox||k.bbox[0]===k.bbox[2]&&k.bbox[1]===k.bbox[3]?w.flyTo(k.center,nt(k)):w.fitBounds(Ve(k.bbox),50,nt(k)))}function nt(m){var H;if(!m.bbox||m.bbox[0]!==m.bbox[2]&&m.bbox[1]!==m.bbox[3])return;const Z=m.id.replace(/\..*/,"");return(Array.isArray((H=m.properties)==null?void 0:H.categories)?m.properties.categories.reduce((he,J)=>{const ye=yt[Z+"."+J];return he===void 0?ye:ye===void 0?he:Math.max(he,ye)},void 0):void 0)??yt[Z]}function ro(m){t(0,A=_==="always"),t(13,R=void 0),t(14,k=void 0),t(15,W=-1),en(m[1].toFixed(6)+", "+Xn(m[0],[-180,180],!0).toFixed(6),!1,!0)}function oo(m){if(!R)return;let Z=m.key==="ArrowDown"?1:m.key==="ArrowUp"?-1:0;Z&&(de.focus(),t(17,Ee=!0),m.preventDefault(),k&&W===-1&&t(15,W=R.findIndex(H=>H.id===(k==null?void 0:k.id))),W===(k||We?0:-1)&&Z===-1&&t(15,W=R.length),t(15,W+=Z),W>=R.length&&t(15,W=-1),W<0&&(k||We)&&t(15,W=0))}function rn(m,Z=!0,H=!1){if(t(19,pe=void 0),t(14,k=void 0),t(17,Ee=!0),Re&&(window.clearTimeout(Re),Re=void 0),ue&&(window.clearTimeout(ue),t(63,ue=void 0)),!ht&&!H||q.length<M){t(13,R=void 0);return}const he=q;Re=window.setTimeout(()=>{Re=void 0,it(he).catch(J=>t(19,pe=J))},Z?E:0),q.endsWith(" ")||t(63,ue=window.setTimeout(()=>{t(63,ue=void 0),it(he,{appendSpace:!0}).catch(J=>t(19,pe=J))},Bt))}function Ht(m){k&&(k==null?void 0:k.id)===(m==null?void 0:m.id)?Qt():(t(14,k=m),t(1,q=m.place_name))}function on(m){t(15,W=m)}function so(){(!We||k)&&t(15,W=-1),mt&&Qt()}const lo=()=>de.focus();function uo(m){wt[m?"unshift":"push"](()=>{de=m,t(18,de)})}function ao(){q=this.value,t(1,q),t(17,Ee),t(31,d),t(16,qe)}const co=()=>t(17,Ee=!0),fo=()=>t(17,Ee=!1),ho=()=>t(17,Ee=!0),mo=()=>t(14,k=void 0),go=()=>{t(1,q=""),de.focus()},po=()=>t(0,A=!A),yo=()=>t(19,pe=void 0),bo=m=>on(m),vo=m=>Ht(m),_o=()=>{};return i.$$set=m=>{"class"in m&&t(2,u=m.class),"apiKey"in m&&t(29,h=m.apiKey),"bbox"in m&&t(30,a=m.bbox),"clearButtonTitle"in m&&t(3,f=m.clearButtonTitle),"clearOnBlur"in m&&t(31,d=m.clearOnBlur),"clearListOnPick"in m&&t(32,g=m.clearListOnPick),"keepListOpen"in m&&t(4,b=m.keepListOpen),"collapsed"in m&&t(5,v=m.collapsed),"country"in m&&t(33,y=m.country),"debounceSearch"in m&&t(34,E=m.debounceSearch),"enableReverse"in m&&t(6,_=m.enableReverse),"errorMessage"in m&&t(7,L=m.errorMessage),"filter"in m&&t(35,T=m.filter),"flyTo"in m&&t(36,N=m.flyTo),"fuzzyMatch"in m&&t(37,x=m.fuzzyMatch),"language"in m&&t(38,S=m.language),"limit"in m&&t(39,P=m.limit),"mapController"in m&&t(40,w=m.mapController),"minLength"in m&&t(41,M=m.minLength),"noResultsMessage"in m&&t(8,O=m.noResultsMessage),"placeholder"in m&&t(9,ie=m.placeholder),"proximity"in m&&t(42,C=m.proximity),"reverseActive"in m&&t(0,A=m.reverseActive),"reverseButtonTitle"in m&&t(10,fe=m.reverseButtonTitle),"searchValue"in m&&t(1,q=m.searchValue),"pickedResultStyle"in m&&t(43,dt=m.pickedResultStyle),"showPlaceType"in m&&t(11,Ji=m.showPlaceType),"showResultsWhileTyping"in m&&t(44,ht=m.showResultsWhileTyping),"autocompleteTimeout"in m&&t(45,Bt=m.autocompleteTimeout),"selectFirst"in m&&t(46,We=m.selectFirst),"flyToSelected"in m&&t(47,mt=m.flyToSelected),"markerOnSelected"in m&&t(48,gt=m.markerOnSelected),"types"in m&&t(49,Be=m.types),"exhaustiveReverseGeocoding"in m&&t(50,Dt=m.exhaustiveReverseGeocoding),"excludeTypes"in m&&t(51,pt=m.excludeTypes),"zoom"in m&&t(52,yt=m.zoom),"apiUrl"in m&&t(53,Ut=m.apiUrl),"fetchParameters"in m&&t(54,Ft=m.fetchParameters),"iconsBaseUrl"in m&&t(12,$i=m.iconsBaseUrl),"adjustUrlQuery"in m&&t(55,Gt=m.adjustUrlQuery),"adjustUrl"in m&&t(56,jt=m.adjustUrl),"$$scope"in m&&t(68,s=m.$$scope)},i.$$.update=()=>{if(i.$$.dirty[0]&64&&t(0,A=_==="always"),i.$$.dirty[0]&16384|i.$$.dirty[1]&4096&&dt!=="marker-only"&&k&&!k.address&&k.geometry.type==="Point"&&k.place_type[0]!=="reverse"&&it(k.id,{byId:!0}).catch(m=>t(19,pe=m)),i.$$.dirty[0]&16384|i.$$.dirty[1]&546|i.$$.dirty[2]&4&&(w&&k&&k.id!==qt&&N&&(Qt(),g&&t(13,R=void 0),t(62,V=void 0),t(15,W=-1)),t(64,qt=k==null?void 0:k.id)),i.$$.dirty[0]&196608|i.$$.dirty[1]&1&&setTimeout(()=>{t(16,qe=Ee),d&&!qe&&t(1,q="")}),i.$$.dirty[0]&8194|i.$$.dirty[1]&1024&&q.length<M&&(t(13,R=void 0),t(19,pe=void 0),t(62,V=R)),i.$$.dirty[0]&8192|i.$$.dirty[1]&32768&&We&&R!=null&&R.length&&(io()||t(15,W=0)),i.$$.dirty[0]&57344|i.$$.dirty[1]&32768&&We&&R!=null&&R.length&&W==-1&&!k&&t(15,W=0),i.$$.dirty[0]&8192|i.$$.dirty[2]&1&&V!==R&&t(62,V=void 0),i.$$.dirty[0]&73729|i.$$.dirty[1]&512|i.$$.dirty[2]&1&&w&&w.setEventHandler(m=>{switch(m.type){case"mapClick":A&&ro(m.coordinates);break;case"markerClick":{const Z=R==null?void 0:R.find(H=>H.id===m.id);Z&&Ht(Z)}break;case"markerMouseEnter":V&&t(15,W=qe?(R==null?void 0:R.findIndex(Z=>Z.id===m.id))??-1:-1);break;case"markerMouseLeave":V&&t(15,W=-1);break}}),i.$$.dirty[0]&40960&&t(65,r=R==null?void 0:R[W]),i.$$.dirty[1]&66080|i.$$.dirty[2]&8&&w&&r&&N&&mt&&w.flyTo(r.center,nt(r)),i.$$.dirty[1]&4096&&t(67,n=dt==="full-geometry-including-polygon-center-marker"),i.$$.dirty[1]&131584|i.$$.dirty[2]&32&&(gt||w==null||w.setFeatures(void 0,void 0,n)),i.$$.dirty[0]&16384|i.$$.dirty[1]&131584|i.$$.dirty[2]&41&&w&>&&!V&&(w.setFeatures(r?[r]:void 0,k,n),w.setSelectedMarker(r?0:-1)),i.$$.dirty[0]&16384|i.$$.dirty[1]&512|i.$$.dirty[2]&33&&w&&w.setFeatures(V,k,n),i.$$.dirty[0]&32768|i.$$.dirty[1]&512|i.$$.dirty[2]&1&&V&&w&&w.setSelectedMarker(W),i.$$.dirty[2]&10&&r&&(window.clearTimeout(ue),t(63,ue=void 0)),i.$$.dirty[0]&2|i.$$.dirty[1]&512&&w){const m=Zt(q);w.setReverseMarker(m?[m.decimalLongitude,m.decimalLatitude]:void 0)}i.$$.dirty[2]&8&&Oe("select",{feature:r}),i.$$.dirty[0]&16384&&Oe("pick",{feature:k}),i.$$.dirty[0]&73744&&t(66,o=!!(R!=null&&R.length)&&(qe||b)),i.$$.dirty[2]&16&&Oe("optionsvisibilitychange",{optionsVisible:o}),i.$$.dirty[0]&8192&&Oe("featureslisted",{features:R}),i.$$.dirty[2]&1&&Oe("featuresmarked",{features:V}),i.$$.dirty[0]&1&&Oe("reversetoggle",{reverse:A}),i.$$.dirty[0]&2&&Oe("querychange",{query:q}),i.$$.dirty[0]&1|i.$$.dirty[1]&512&&w&&w.indicateReverse(A)},[A,q,u,f,b,v,_,L,O,ie,fe,Ji,$i,R,k,W,qe,Ee,de,pe,De,to,nn,oo,rn,Ht,on,so,c,h,a,d,g,y,E,T,N,x,S,P,w,M,C,dt,ht,Bt,We,mt,gt,Be,Dt,pt,yt,Ut,Ft,Gt,jt,Kr,Jr,en,$r,eo,V,ue,qt,r,o,n,s,l,lo,uo,ao,co,fo,ho,mo,go,po,yo,bo,vo,_o]}let gr=class extends Ce{constructor(e){super(),Me(this,e,mr,hr,Le,{ZOOM_DEFAULTS:28,class:2,apiKey:29,bbox:30,clearButtonTitle:3,clearOnBlur:31,clearListOnPick:32,keepListOpen:4,collapsed:5,country:33,debounceSearch:34,enableReverse:6,errorMessage:7,filter:35,flyTo:36,fuzzyMatch:37,language:38,limit:39,mapController:40,minLength:41,noResultsMessage:8,placeholder:9,proximity:42,reverseActive:0,reverseButtonTitle:10,searchValue:1,pickedResultStyle:43,showPlaceType:11,showResultsWhileTyping:44,autocompleteTimeout:45,selectFirst:46,flyToSelected:47,markerOnSelected:48,types:49,exhaustiveReverseGeocoding:50,excludeTypes:51,zoom:52,apiUrl:53,fetchParameters:54,iconsBaseUrl:12,adjustUrlQuery:55,adjustUrl:56,focus:57,blur:58,setQuery:59,clearList:60,clearMap:61},null,[-1,-1,-1,-1])}get ZOOM_DEFAULTS(){return this.$$.ctx[28]}get focus(){return this.$$.ctx[57]}get blur(){return this.$$.ctx[58]}get setQuery(){return this.$$.ctx[59]}get clearList(){return this.$$.ctx[60]}get clearMap(){return this.$$.ctx[61]}};function Ke(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 Mt(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 Ke({type:"Polygon",coordinates:i},e,t)}function Je(i,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=i,t}function Si(i,e,t={}){return Ke({type:"MultiPolygon",coordinates:i},e,t)}function xi(i,e,t){if(i!==null)for(var n,r,o,l,s,c,u,h=0,a=0,f,d=i.type,g=d==="FeatureCollection",b=d==="Feature",v=g?i.features.length:1,y=0;y<v;y++){u=g?i.features[y].geometry:b?i.geometry:i,f=u?u.type==="GeometryCollection":!1,s=f?u.geometries.length:1;for(var E=0;E<s;E++){var _=0,L=0;if(l=f?u.geometries[E]:u,l!==null){c=l.coordinates;var T=l.type;switch(h=0,T){case null:break;case"Point":if(e(c,a,y,_,L)===!1)return!1;a++,_++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(e(c[n],a,y,_,L)===!1)return!1;a++,T==="MultiPoint"&&_++}T==="LineString"&&_++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(r=0;r<c[n].length-h;r++){if(e(c[n][r],a,y,_,L)===!1)return!1;a++}T==="MultiLineString"&&_++,T==="Polygon"&&L++}T==="Polygon"&&_++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(L=0,r=0;r<c[n].length;r++){for(o=0;o<c[n][r].length-h;o++){if(e(c[n][r][o],a,y,_,L)===!1)return!1;a++}L++}_++}break;case"GeometryCollection":for(n=0;n<l.geometries.length;n++)if(xi(l.geometries[n],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Ct(i,e){var t,n,r,o,l,s,c,u,h,a,f=0,d=i.type==="FeatureCollection",g=i.type==="Feature",b=d?i.features.length:1;for(t=0;t<b;t++){for(s=d?i.features[t].geometry:g?i.geometry:i,u=d?i.features[t].properties:g?i.properties:{},h=d?i.features[t].bbox:g?i.bbox:void 0,a=d?i.features[t].id:g?i.id:void 0,c=s?s.type==="GeometryCollection":!1,l=c?s.geometries.length:1,r=0;r<l;r++){if(o=c?s.geometries[r]:s,o===null){if(e(null,f,u,h,a)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,f,u,h,a)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(e(o.geometries[n],f,u,h,a)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function pr(i,e){Ct(i,function(t,n,r,o,l){var s=t===null?null:t.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return e(Ke(t,r,{bbox:o,id:l}),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 u=0;u<t.coordinates.length;u++){var h=t.coordinates[u],a={type:c,coordinates:h};if(e(Ke(a,r),n,u)===!1)return!1}})}function yr(i,e={}){if(i.bbox!=null&&e.recompute!==!0)return i.bbox;const t=[1/0,1/0,-1/0,-1/0];return xi(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 kt=yr;function br(i){if(!i)throw new Error("geojson is required");switch(i.type){case"Feature":return Mi(i);case"FeatureCollection":return vr(i);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Nt(i);default:throw new Error("unknown GeoJSON type")}}function Mi(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=Ci(i.properties),i.geometry==null?e.geometry=null:e.geometry=Nt(i.geometry),e}function Ci(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]=Ci(n):e[t]=n}),e}function vr(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=>Mi(t)),e}function Nt(i){const e={type:i.type};return i.bbox&&(e.bbox=i.bbox),i.type==="GeometryCollection"?(e.geometries=i.geometries.map(t=>Nt(t)),e):(e.coordinates=ki(i.coordinates),e)}function ki(i){const e=i;return typeof e[0]!="object"?e.slice():e.map(t=>ki(t))}var _r=br;/**
|
|
2
2
|
* splaytree v3.1.2
|
|
3
3
|
* Fast Splay tree for Node and browser
|
|
4
4
|
*
|
|
@@ -18,6 +18,6 @@
|
|
|
18
18
|
|
|
19
19
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
20
20
|
and limitations under the License.
|
|
21
|
-
***************************************************************************** */function
|
|
22
|
-
`);var o=e+(t?" ":"│ ");i.left&&kt(i.left,o,!1,n,r),i.right&&kt(i.right,o,!0,n,r)}}var Nt=function(){function i(e){e===void 0&&(e=vr),this._root=null,this._size=0,this._comparator=e}return i.prototype.insert=function(e,t){return this._size++,this._root=Ct(e,t,this._root,this._comparator)},i.prototype.add=function(e,t){var n=new Ce(e,t);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var r=this._comparator,o=ke(e,this._root,r),l=r(e,o.key);return l===0?this._root=o:(l<0?(n.left=o.left,n.right=o,o.left=null):l>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=ke(e,t,n);var o=n(e,t.key);return o===0?(t.left===null?r=t.right:(r=ke(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=ke(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=ke(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=[],l=this._comparator,s=this._root,c;o.length!==0||s;)if(s)o.push(s),s=s.left;else{if(s=o.pop(),c=l(s.key,t),c>0)break;if(l(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 Er(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&&Rt(e,t,0,r-1,o),this._root===null)this._root=Pt(e,t,0,r),this._size=r;else{var l=Lr(this.toList(),wr(e,t),o);r=this._size+r,this._root=Tt({head:l},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 kt(this._root,"",!0,function(n){return t.push(n)},e),t.join("")},i.prototype.update=function(e,t,n){var r=this._comparator,o=Mi(e,this._root,r),l=o.left,s=o.right;r(e,t)<0?s=Ct(t,n,s,r):l=Ct(t,n,l,r),this._root=_r(l,s,r)},i.prototype.split=function(e){return Mi(e,this._root,this._comparator)},i.prototype[Symbol.iterator]=function(){var e,t,n;return br(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 Pt(i,e,t,n){var r=n-t;if(r>0){var o=t+Math.floor(r/2),l=i[o],s=e[o],c=new Ce(l,s);return c.left=Pt(i,e,t,o),c.right=Pt(i,e,o+1,n),c}return null}function wr(i,e){for(var t=new Ce(null,null),n=t,r=0;r<i.length;r++)n=n.next=new Ce(i[r],e[r]);return n.next=null,t.next}function Er(i){for(var e=i,t=[],n=!1,r=new Ce(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 Tt(i,e,t){var n=t-e;if(n>0){var r=e+Math.floor(n/2),o=Tt(i,e,r),l=i.head;return l.left=o,i.head=i.head.next,l.right=Tt(i,r+1,t),l}return null}function Lr(i,e,t){for(var n=new Ce(null,null),r=n,o=i,l=e;o!==null&&l!==null;)t(o.key,l.key)<0?(r.next=o,o=o.next):(r.next=l,l=l.next),r=r.next;return o!==null?r.next=o:l!==null&&(r.next=l),n.next}function Rt(i,e,t,n,r){if(!(t>=n)){for(var o=i[t+n>>1],l=t-1,s=n+1;;){do l++;while(r(i[l],o)<0);do s--;while(r(i[s],o)>0);if(l>=s)break;var c=i[l];i[l]=i[s],i[s]=c,c=e[l],e[l]=e[s],e[s]=c}Rt(i,e,t,s,r),Rt(i,e,s+1,n,r)}}const _e=11102230246251565e-32,$=134217729,Sr=(3+8*_e)*_e;function Ot(i,e,t,n,r){let o,l,s,c,u=e[0],h=n[0],a=0,f=0;h>u==h>-u?(o=u,u=e[++a]):(o=h,h=n[++f]);let d=0;if(a<i&&f<t)for(h>u==h>-u?(l=u+o,s=o-(l-u),u=e[++a]):(l=h+o,s=o-(l-h),h=n[++f]),o=l,s!==0&&(r[d++]=s);a<i&&f<t;)h>u==h>-u?(l=o+u,c=l-o,s=o-(l-c)+(u-c),u=e[++a]):(l=o+h,c=l-o,s=o-(l-c)+(h-c),h=n[++f]),o=l,s!==0&&(r[d++]=s);for(;a<i;)l=o+u,c=l-o,s=o-(l-c)+(u-c),u=e[++a],o=l,s!==0&&(r[d++]=s);for(;f<t;)l=o+h,c=l-o,s=o-(l-c)+(h-c),h=n[++f],o=l,s!==0&&(r[d++]=s);return(o!==0||d===0)&&(r[d++]=o),d}function xr(i,e){let t=e[0];for(let n=1;n<i;n++)t+=e[n];return t}function Ke(i){return new Float64Array(i)}const Mr=(3+16*_e)*_e,Cr=(2+12*_e)*_e,kr=(9+64*_e)*_e*_e,De=Ke(4),Ci=Ke(8),ki=Ke(12),Ni=Ke(16),ee=Ke(4);function Nr(i,e,t,n,r,o,l){let s,c,u,h,a,f,d,m,b,v,y,E,_,L,P,N,x,S;const T=i-r,w=t-r,M=e-o,R=n-o;L=T*R,f=$*T,d=f-(f-T),m=T-d,f=$*R,b=f-(f-R),v=R-b,P=m*v-(L-d*b-m*b-d*v),N=M*w,f=$*M,d=f-(f-M),m=M-d,f=$*w,b=f-(f-w),v=w-b,x=m*v-(N-d*b-m*b-d*v),y=P-x,a=P-y,De[0]=P-(y+a)+(a-x),E=L+y,a=E-L,_=L-(E-a)+(y-a),y=_-N,a=_-y,De[1]=_-(y+a)+(a-N),S=E+y,a=S-E,De[2]=E-(S-a)+(y-a),De[3]=S;let te=xr(4,De),C=Cr*l;if(te>=C||-te>=C||(a=i-T,s=i-(T+a)+(a-r),a=t-w,u=t-(w+a)+(a-r),a=e-M,c=e-(M+a)+(a-o),a=n-R,h=n-(R+a)+(a-o),s===0&&c===0&&u===0&&h===0)||(C=kr*l+Sr*Math.abs(te),te+=T*h+R*s-(M*u+w*c),te>=C||-te>=C))return te;L=s*R,f=$*s,d=f-(f-s),m=s-d,f=$*R,b=f-(f-R),v=R-b,P=m*v-(L-d*b-m*b-d*v),N=c*w,f=$*c,d=f-(f-c),m=c-d,f=$*w,b=f-(f-w),v=w-b,x=m*v-(N-d*b-m*b-d*v),y=P-x,a=P-y,ee[0]=P-(y+a)+(a-x),E=L+y,a=E-L,_=L-(E-a)+(y-a),y=_-N,a=_-y,ee[1]=_-(y+a)+(a-N),S=E+y,a=S-E,ee[2]=E-(S-a)+(y-a),ee[3]=S;const W=Ot(4,De,4,ee,Ci);L=T*h,f=$*T,d=f-(f-T),m=T-d,f=$*h,b=f-(f-h),v=h-b,P=m*v-(L-d*b-m*b-d*v),N=M*u,f=$*M,d=f-(f-M),m=M-d,f=$*u,b=f-(f-u),v=u-b,x=m*v-(N-d*b-m*b-d*v),y=P-x,a=P-y,ee[0]=P-(y+a)+(a-x),E=L+y,a=E-L,_=L-(E-a)+(y-a),y=_-N,a=_-y,ee[1]=_-(y+a)+(a-N),S=E+y,a=S-E,ee[2]=E-(S-a)+(y-a),ee[3]=S;const fe=Ot(W,Ci,4,ee,ki);L=s*h,f=$*s,d=f-(f-s),m=s-d,f=$*h,b=f-(f-h),v=h-b,P=m*v-(L-d*b-m*b-d*v),N=c*u,f=$*c,d=f-(f-c),m=c-d,f=$*u,b=f-(f-u),v=u-b,x=m*v-(N-d*b-m*b-d*v),y=P-x,a=P-y,ee[0]=P-(y+a)+(a-x),E=L+y,a=E-L,_=L-(E-a)+(y-a),y=_-N,a=_-y,ee[1]=_-(y+a)+(a-N),S=E+y,a=S-E,ee[2]=E-(S-a)+(y-a),ee[3]=S;const Z=Ot(fe,ki,4,ee,Ni);return Ni[Z-1]}function Pr(i,e,t,n,r,o){const l=(e-o)*(t-r),s=(i-r)*(n-o),c=l-s,u=Math.abs(l+s);return Math.abs(c)>=Mr*u?c:-Nr(i,e,t,n,r,o,u)}const Je=(i,e)=>i.ll.x<=e.x&&e.x<=i.ur.x&&i.ll.y<=e.y&&e.y<=i.ur.y,It=(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 Ne=Number.EPSILON;Ne===void 0&&(Ne=Math.pow(2,-52));const Tr=Ne*Ne,Pi=(i,e)=>{if(-Ne<i&&i<Ne&&-Ne<e&&e<Ne)return 0;const t=i-e;return t*t<Tr*i*e?0:i<e?-1:1};class Rr{constructor(){this.reset()}reset(){this.xRounder=new Ti,this.yRounder=new Ti}round(e,t){return{x:this.xRounder.round(e),y:this.yRounder.round(t)}}}class Ti{constructor(){this.tree=new Nt,this.round(0)}round(e){const t=this.tree.add(e),n=this.tree.prev(t);if(n!==null&&Pi(t.key,n.key)===0)return this.tree.remove(e),n.key;const r=this.tree.next(t);return r!==null&&Pi(t.key,r.key)===0?(this.tree.remove(e),r.key):e}}const $e=new Rr,st=(i,e)=>i.x*e.y-i.y*e.x,Ri=(i,e)=>i.x*e.x+i.y*e.y,Oi=(i,e,t)=>{const n=Pr(i.x,i.y,e.x,e.y,t.x,t.y);return n>0?-1:n<0?1:0},lt=i=>Math.sqrt(Ri(i,i)),Or=(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 st(r,n)/lt(r)/lt(n)},Ir=(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 Ri(r,n)/lt(r)/lt(n)},Ii=(i,e,t)=>e.y===0?null:{x:i.x+e.x/e.y*(t-i.y),y:t},zi=(i,e,t)=>e.x===0?null:{x:t,y:i.y+e.y/e.x*(t-i.x)},zr=(i,e,t,n)=>{if(e.x===0)return zi(t,n,i.x);if(n.x===0)return zi(i,e,t.x);if(e.y===0)return Ii(t,n,i.y);if(n.y===0)return Ii(i,e,t.y);const r=st(e,n);if(r==0)return null;const o={x:t.x-i.x,y:t.y-i.y},l=st(o,e)/r,s=st(o,n)/r,c=i.x+s*e.x,u=t.x+l*n.x,h=i.y+s*e.y,a=t.y+l*n.y,f=(c+u)/2,d=(h+a)/2;return{x:f,y:d}};class ue{static compare(e,t){const n=ue.comparePoints(e.point,t.point);return n!==0?n:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:Pe.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:Or(this.point,e.point,o.point),cosine:Ir(this.point,e.point,o.point)})};return(r,o)=>{t.has(r)||n(r),t.has(o)||n(o);const{sine:l,cosine:s}=t.get(r),{sine:c,cosine:u}=t.get(o);return l>=0&&c>=0?s<u?1:s>u?-1:0:l<0&&c<0?s<u?-1:s>u?1:0:c<l?-1:c>l?1:0}}}let Ar=0;class Pe{static compare(e,t){const n=e.leftSE.point.x,r=t.leftSE.point.x,o=e.rightSE.point.x,l=t.rightSE.point.x;if(l<n)return 1;if(o<r)return-1;const s=e.leftSE.point.y,c=t.leftSE.point.y,u=e.rightSE.point.y,h=t.rightSE.point.y;if(n<r){if(c<s&&c<u)return 1;if(c>s&&c>u)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<h)return-1;if(s>c&&s>h)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<l){const a=t.comparePoint(e.rightSE.point);if(a!==0)return a}if(o>l){const a=e.comparePoint(t.rightSE.point);if(a<0)return 1;if(a>0)return-1}if(o!==l){const a=u-s,f=o-n,d=h-c,m=l-r;if(a>f&&d<m)return 1;if(a<f&&d>m)return-1}return o>l?1:o<l||u<h?-1:u>h?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,n,r){this.id=++Ar,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,l;const s=ue.comparePoints(e,t);if(s<0)r=e,o=t,l=1;else if(s>0)r=t,o=e,l=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const c=new ue(r,!0),u=new ue(o,!1);return new Pe(c,u,[n],[l])}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,l=t.x+o*r.x;if(e.x===l)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=It(t,n);if(r===null)return null;const o=this.leftSE.point,l=this.rightSE.point,s=e.leftSE.point,c=e.rightSE.point,u=Je(t,s)&&this.comparePoint(s)===0,h=Je(n,o)&&e.comparePoint(o)===0,a=Je(t,c)&&this.comparePoint(c)===0,f=Je(n,l)&&e.comparePoint(l)===0;if(h&&u)return f&&!a?l:!f&&a?c:null;if(h)return a&&o.x===c.x&&o.y===c.y?null:o;if(u)return f&&l.x===s.x&&l.y===s.y?null:s;if(f&&a)return null;if(f)return l;if(a)return c;const d=zr(o,this.vector(),s,e.vector());return d===null||!Je(r,d)?null:$e.round(d.x,d.y)}split(e){const t=[],n=e.events!==void 0,r=new ue(e,!0),o=new ue(e,!1),l=this.rightSE;this.replaceRightSE(o),t.push(o),t.push(r);const s=new Pe(r,l,this.rings.slice(),this.windings.slice());return ue.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),ue.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=Pe.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,l=n.rings.length;o<l;o++){const s=n.rings[o],c=n.windings[o],u=t.rings.indexOf(s);u===-1?(t.rings.push(s),t.windings.push(c)):t.windings[u]+=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 u=this.rings[s],h=this.windings[s],a=t.indexOf(u);a===-1?(t.push(u),n.push(h)):n[a]+=h}const o=[],l=[];for(let s=0,c=t.length;s<c;s++){if(n[s]===0)continue;const u=t[s],h=u.poly;if(l.indexOf(h)===-1)if(u.isExterior)o.push(h);else{l.indexOf(h)===-1&&l.push(h);const a=o.indexOf(u.poly);a!==-1&&o.splice(a,1)}}for(let s=0,c=o.length;s<c;s++){const u=o[s].multiPoly;r.indexOf(u)===-1&&r.push(u)}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(ce.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===ce.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 ${ce.type}`)}return this._isInResult}}class Ai{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=$e.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 l=1,s=e.length;l<s;l++){if(typeof e[l][0]!="number"||typeof e[l][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=$e.round(e[l][0],e[l][1]);c.x===o.x&&c.y===o.y||(this.segments.push(Pe.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(Pe.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 Wr{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Ai(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 Ai(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,l=r.length;o<l;o++)e.push(r[o])}return e}}class Wi{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 Wr(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,l=r.length;o<l;o++)e.push(r[o])}return e}}class ut{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 l=null,s=o.leftSE,c=o.rightSE;const u=[s],h=s.point,a=[];for(;l=s,s=c,u.push(s),s.point!==h;)for(;;){const f=s.getAvailableLinkedEvents();if(f.length===0){const b=u[0].point,v=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${b.x}, ${b.y}]. Last matching segment found ends at [${v.x}, ${v.y}].`)}if(f.length===1){c=f[0].otherSE;break}let d=null;for(let b=0,v=a.length;b<v;b++)if(a[b].point===s.point){d=b;break}if(d!==null){const b=a.splice(d)[0],v=u.splice(b.index);v.unshift(v[0].otherSE),t.push(new ut(v.reverse()));continue}a.push({index:u.length,point:s.point});const m=s.getLeftmostComparator(l);c=f.sort(m)[0].otherSE;break}t.push(new ut(u))}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 u=1,h=this.events.length-1;u<h;u++){const a=this.events[u].point,f=this.events[u+1].point;Oi(a,e,f)!==0&&(t.push(a),e=a)}if(t.length===1)return null;const n=t[0],r=t[1];Oi(n,e,r)===0&&t.shift(),t.push(t[0]);const o=this.isExteriorRing()?1:-1,l=this.isExteriorRing()?0:t.length-1,s=this.isExteriorRing()?t.length:-1,c=[];for(let u=l;u!=s;u+=o)c.push([t[u].x,t[u].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 l=this.events[r];ue.compare(e,l)>0&&(e=l)}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 Bi{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 Br{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 Bi(o));else{const l=o.enclosingRing();l.poly||t.push(new Bi(l)),l.poly.addInterior(o)}}return t}}class Dr{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Pe.compare;this.queue=e,this.tree=new Nt(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,l=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;)l=this.tree.next(l),l===null?c=null:l.key.consumedBy===void 0&&(c=l.key);if(e.isLeft){let u=null;if(s){const a=s.getIntersection(t);if(a!==null&&(t.isAnEndpoint(a)||(u=a),!s.isAnEndpoint(a))){const f=this._splitSafely(s,a);for(let d=0,m=f.length;d<m;d++)n.push(f[d])}}let h=null;if(c){const a=c.getIntersection(t);if(a!==null&&(t.isAnEndpoint(a)||(h=a),!c.isAnEndpoint(a))){const f=this._splitSafely(c,a);for(let d=0,m=f.length;d<m;d++)n.push(f[d])}}if(u!==null||h!==null){let a=null;u===null?a=h:h===null?a=u:a=ue.comparePoints(u,h)<=0?u:h,this.queue.remove(t.rightSE),n.push(t.rightSE);const f=t.split(a);for(let d=0,m=f.length;d<m;d++)n.push(f[d])}n.length>0?(this.tree.remove(t),n.push(e)):(this.segments.push(t),t.prev=s)}else{if(s&&c){const u=s.getIntersection(c);if(u!==null){if(!s.isAnEndpoint(u)){const h=this._splitSafely(s,u);for(let a=0,f=h.length;a<f;a++)n.push(h[a])}if(!c.isAnEndpoint(u)){const h=this._splitSafely(c,u);for(let a=0,f=h.length;a<f;a++)n.push(h[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 Di=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Ur=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Fr{run(e,t,n){ce.type=e,$e.reset();const r=[new Wi(t,!0)];for(let a=0,f=n.length;a<f;a++)r.push(new Wi(n[a],!1));if(ce.numMultiPolys=r.length,ce.type==="difference"){const a=r[0];let f=1;for(;f<r.length;)It(r[f].bbox,a.bbox)!==null?f++:r.splice(f,1)}if(ce.type==="intersection")for(let a=0,f=r.length;a<f;a++){const d=r[a];for(let m=a+1,b=r.length;m<b;m++)if(It(d.bbox,r[m].bbox)===null)return[]}const o=new Nt(ue.compare);for(let a=0,f=r.length;a<f;a++){const d=r[a].getSweepEvents();for(let m=0,b=d.length;m<b;m++)if(o.insert(d[m]),o.size>Di)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const l=new Dr(o);let s=o.size,c=o.pop();for(;c;){const a=c.key;if(o.size===s){const d=a.segment;throw new Error(`Unable to pop() ${a.isLeft?"left":"right"} SweepEvent [${a.point.x}, ${a.point.y}] from segment #${d.id} [${d.leftSE.point.x}, ${d.leftSE.point.y}] -> [${d.rightSE.point.x}, ${d.rightSE.point.y}] from queue.`)}if(o.size>Di)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(l.segments.length>Ur)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=l.process(a);for(let d=0,m=f.length;d<m;d++){const b=f[d];b.consumedBy===void 0&&o.insert(b)}s=o.size,c=o.pop()}$e.reset();const u=ut.factory(l.segments);return new Br(u).getGeom()}}const ce=new Fr;var Ui={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 ce.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 ce.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 ce.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 ce.run("difference",i,t)}};function Gr(i,e={}){const t=[];if(St(i,r=>{t.push(r.coordinates)}),t.length<2)throw new Error("Must have at least 2 geometries");const n=Ui.union(t[0],...t.slice(1));return n.length===0?null:n.length===1?Lt(n[0],e.properties):wi(n,e.properties)}var Fi=Gr;function jr(i){const e=[];if(St(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=Ui.difference(e[0],...e.slice(1));return n.length===0?null:n.length===1?Lt(n[0],t):wi(n,t)}var qr=jr;function Zr(i){if(!i)throw new Error("geojson is required");var e=[];return hr(i,function(t){e.push(t)}),Xe(e)}var Qr=Zr;function Gi(i,e){const t=qr(Xe([Lt([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),i]));if(!t)return;t.properties={isMask:!0};const n=Qe(xt(i)),r=(n[2]-n[0])/360/1e3,o=n[0]<-180,l=n[2]>180,s=Qr(i);if(s.features.length>1&&(o||l))for(const c of s.features){const u=Qe(xt(c));if(l&&u[0]<-180+r)for(const h of c.geometry.coordinates)for(const a of h)a[0]+=360-r;if(o&&u[2]>180-r)for(const h of c.geometry.coordinates)for(const a of h)a[0]-=360-r}e(Xe([s.features.length<2?i:Fi(s)??i,t]))}const ji=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 qi(i,e=!0,t=!0,n={},r={},o=ji){let l;const s=[];let c,u;const h=ie.geoJSON(void 0,{style:o===!0?ji:o===!1?void 0:o??void 0,interactive:!1}).addTo(i),a=d=>{l==null||l({type:"mapClick",coordinates:[d.latlng.lng,d.latlng.lat]})};function f(d,m=!1){const b=document.createElement("div");return new Gn({props:{displayIn:"leaflet"},target:b}),new ie.Marker(d,{interactive:m,icon:new ie.DivIcon({html:b,className:"",iconAnchor:[12,26],iconSize:[25,30],tooltipAnchor:[1,-24]})})}return{setEventHandler(d){d?(l=d,i.on("click",a)):(l=void 0,i.off("click",a))},flyTo(d,m){i.flyTo([d[1],d[0]],m,{duration:2,...n})},fitBounds(d,m,b){i.flyToBounds([[d[1],d[0]],[d[3],d[2]]],{padding:[m,m],duration:2,...b?{maxZoom:b}:{},...r})},indicateReverse(d){i.getContainer().style.cursor=d?"crosshair":""},setReverseMarker(d){var b;if(!e)return;const m=d&&[d[1],d[0]];u?m?u.setLatLng(m):(u.remove(),u=void 0):m&&(e instanceof Function?u=e(i)??void 0:(u=(typeof e=="object"?new ie.Marker(m,e):f(m)).addTo(i),(b=u.getElement())==null||b.classList.add("marker-reverse")))},setFeatures(d,m,b){function v(y){h.clearLayers(),y&&h.addData(y)}for(const y of s)y.remove();s.length=0,v();e:if(m){let y=!1;if(m.geometry.type==="GeometryCollection"){const E=m.geometry.geometries.filter(_=>_.type==="Polygon"||_.type==="MultiPolygon");t:if(E.length>0){const _=Fi(Xe(E.map(L=>Ye(L))));if(!_)break t;Gi({...m,geometry:_.geometry},v),y=!0}else{const _=m.geometry.geometries.filter(L=>L.type==="LineString"||L.type==="MultiLineString");_.length>0&&(v({...m,geometry:{type:"GeometryCollection",geometries:_}}),y=!0)}}if(!y){if(m.geometry.type==="Polygon"||m.geometry.type==="MultiPolygon")Gi(m,E=>{if(!E)return;const _=[...E.features],L=Qe(xt(m)),P=L[2]-L[0];L[0]-P/4<-180&&_.push(...Zi(E,-360).features),L[2]+P/4>180&&_.push(...Zi(E,360).features),v(Xe(_))});else if(m.geometry.type==="LineString"||m.geometry.type==="MultiLineString"){v(m);break e}}if(!b&&m.geometry.type!=="Point")break e;if(e instanceof Function){const E=e(i,m);E&&s.push(E.addTo(i))}else if(e){const E=[m.center[1],m.center[0]];s.push(typeof e=="object"?new ie.Marker(E,e):f(E).addTo(i))}}if(t)for(const y of d??[]){if(y===m)continue;const E=[y.center[1],y.center[0]];let _;if(t instanceof Function){if(_=t(i,y),!_)continue}else _=(typeof t=="object"?new ie.Marker(E,t):f(E,!0)).addTo(i).bindTooltip(y.place_type[0]==="reverse"?y.place_name:y.place_name.replace(/,.*/,""),{direction:"top"});const L=_.getElement();L&&(L.addEventListener("click",P=>{P.stopPropagation(),l==null||l({type:"markerClick",id:y.id})}),L.addEventListener("mouseenter",()=>{l==null||l({type:"markerMouseEnter",id:y.id})}),L.addEventListener("mouseleave",()=>{l==null||l({type:"markerMouseLeave",id:y.id})}),L.classList.toggle("marker-fuzzy",!!y.matching_text)),s.push(_)}},setSelectedMarker(d){var m,b;c&&((m=c.getElement())==null||m.classList.toggle("marker-selected",!1)),c=d>-1?s[d]:void 0,(b=c==null?void 0:c.getElement())==null||b.classList.toggle("marker-selected",!0)},getCenterAndZoom(){const d=i.getCenter();return[i.getZoom(),d.lng,d.lat]}}}function Zi(i,e){const t=yr(i);for(const n of t.features)if(n.geometry.type=="MultiPolygon")for(const r of n.geometry.coordinates)Qi(r,e);else Qi(n.geometry.coordinates,e);return t}function Qi(i,e){for(const t of i)for(const n of t)n[0]+=e}class Hi extends ie.Control{}ie.Util.extend(Hi.prototype,ie.Evented.prototype);class Vi extends Hi{constructor(t){super(t);Yt(this,re);Yt(this,Oe);Xt(this,Oe,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:l,fullGeometryStyle:s,position:c,...u}=le(this,Oe),h=typeof l=="boolean"?{}:l,a=qi(t,r,o,h,h,s);Xt(this,re,new dr({target:n,props:{mapController:a,flyTo:l===void 0?!0:!!l,...u}}));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 d in f)le(this,re).$on(d,m=>this.fire(d,m.detail));return n}setOptions(t){var c;Object.assign(le(this,Oe),t);const{marker:n,showResultMarkers:r,flyTo:o,fullGeometryStyle:l,...s}=le(this,Oe);(c=le(this,re))==null||c.$set(s)}setQuery(t,n=!0){var r;(r=le(this,re))==null||r.setQuery(t,n)}clearMap(){var t;(t=le(this,re))==null||t.clearMap()}clearList(){var t;(t=le(this,re))==null||t.clearList()}setReverseMode(t){var n;(n=le(this,re))==null||n.$set({reverseActive:t})}focus(t){var n;(n=le(this,re))==null||n.focus(t)}blur(){var t;(t=le(this,re))==null||t.blur()}onRemove(){var t;(t=le(this,re))==null||t.$destroy()}}re=new WeakMap,Oe=new WeakMap;function Hr(...i){return new Vi(...i)}window.L&&typeof window.L=="object"&&typeof window.L.control=="function"&&(window.L.control.maptilerGeocoding=Hr),A.GeocodingControl=Vi,A.createLeafletMapController=qi,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
|
|
21
|
+
***************************************************************************** */function wr(i,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,r,o,l;return l={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function s(u){return function(h){return c([u,h])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,r&&(o=u[0]&2?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,r=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1],o=u;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(u);break}o[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(i,t)}catch(h){u=[6,h],r=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var ke=function(){function i(e,t){this.next=null,this.key=e,this.data=t,this.left=null,this.right=null}return i}();function Er(i,e){return i>e?1:i<e?-1:0}function Ne(i,e,t){for(var n=new ke(null,null),r=n,o=n;;){var l=t(i,e.key);if(l<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(l>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 Tt(i,e,t,n){var r=new ke(i,e);if(t===null)return r.left=r.right=null,r;t=Ne(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 Ni(i,e,t){var n=null,r=null;if(e){e=Ne(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 Lr(i,e,t){return e===null?i:(i===null||(e=Ne(i.key,e,t),e.left=i),e)}function Pt(i,e,t,n,r){if(i){n(""+e+(t?"└── ":"├── ")+r(i)+`
|
|
22
|
+
`);var o=e+(t?" ":"│ ");i.left&&Pt(i.left,o,!1,n,r),i.right&&Pt(i.right,o,!0,n,r)}}var Rt=function(){function i(e){e===void 0&&(e=Er),this._root=null,this._size=0,this._comparator=e}return i.prototype.insert=function(e,t){return this._size++,this._root=Tt(e,t,this._root,this._comparator)},i.prototype.add=function(e,t){var n=new ke(e,t);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var r=this._comparator,o=Ne(e,this._root,r),l=r(e,o.key);return l===0?this._root=o:(l<0?(n.left=o.left,n.right=o,o.left=null):l>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=Ne(e,t,n);var o=n(e,t.key);return o===0?(t.left===null?r=t.right:(r=Ne(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=Ne(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=Ne(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=[],l=this._comparator,s=this._root,c;o.length!==0||s;)if(s)o.push(s),s=s.left;else{if(s=o.pop(),c=l(s.key,t),c>0)break;if(l(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 xr(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&&zt(e,t,0,r-1,o),this._root===null)this._root=Ot(e,t,0,r),this._size=r;else{var l=Mr(this.toList(),Sr(e,t),o);r=this._size+r,this._root=It({head:l},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 Pt(this._root,"",!0,function(n){return t.push(n)},e),t.join("")},i.prototype.update=function(e,t,n){var r=this._comparator,o=Ni(e,this._root,r),l=o.left,s=o.right;r(e,t)<0?s=Tt(t,n,s,r):l=Tt(t,n,l,r),this._root=Lr(l,s,r)},i.prototype.split=function(e){return Ni(e,this._root,this._comparator)},i.prototype[Symbol.iterator]=function(){var e,t,n;return wr(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 Ot(i,e,t,n){var r=n-t;if(r>0){var o=t+Math.floor(r/2),l=i[o],s=e[o],c=new ke(l,s);return c.left=Ot(i,e,t,o),c.right=Ot(i,e,o+1,n),c}return null}function Sr(i,e){for(var t=new ke(null,null),n=t,r=0;r<i.length;r++)n=n.next=new ke(i[r],e[r]);return n.next=null,t.next}function xr(i){for(var e=i,t=[],n=!1,r=new ke(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 It(i,e,t){var n=t-e;if(n>0){var r=e+Math.floor(n/2),o=It(i,e,r),l=i.head;return l.left=o,i.head=i.head.next,l.right=It(i,r+1,t),l}return null}function Mr(i,e,t){for(var n=new ke(null,null),r=n,o=i,l=e;o!==null&&l!==null;)t(o.key,l.key)<0?(r.next=o,o=o.next):(r.next=l,l=l.next),r=r.next;return o!==null?r.next=o:l!==null&&(r.next=l),n.next}function zt(i,e,t,n,r){if(!(t>=n)){for(var o=i[t+n>>1],l=t-1,s=n+1;;){do l++;while(r(i[l],o)<0);do s--;while(r(i[s],o)>0);if(l>=s)break;var c=i[l];i[l]=i[s],i[s]=c,c=e[l],e[l]=e[s],e[s]=c}zt(i,e,t,s,r),zt(i,e,s+1,n,r)}}const we=11102230246251565e-32,ee=134217729,Cr=(3+8*we)*we;function At(i,e,t,n,r){let o,l,s,c,u=e[0],h=n[0],a=0,f=0;h>u==h>-u?(o=u,u=e[++a]):(o=h,h=n[++f]);let d=0;if(a<i&&f<t)for(h>u==h>-u?(l=u+o,s=o-(l-u),u=e[++a]):(l=h+o,s=o-(l-h),h=n[++f]),o=l,s!==0&&(r[d++]=s);a<i&&f<t;)h>u==h>-u?(l=o+u,c=l-o,s=o-(l-c)+(u-c),u=e[++a]):(l=o+h,c=l-o,s=o-(l-c)+(h-c),h=n[++f]),o=l,s!==0&&(r[d++]=s);for(;a<i;)l=o+u,c=l-o,s=o-(l-c)+(u-c),u=e[++a],o=l,s!==0&&(r[d++]=s);for(;f<t;)l=o+h,c=l-o,s=o-(l-c)+(h-c),h=n[++f],o=l,s!==0&&(r[d++]=s);return(o!==0||d===0)&&(r[d++]=o),d}function kr(i,e){let t=e[0];for(let n=1;n<i;n++)t+=e[n];return t}function $e(i){return new Float64Array(i)}const Nr=(3+16*we)*we,Tr=(2+12*we)*we,Pr=(9+64*we)*we*we,je=$e(4),Ti=$e(8),Pi=$e(12),Ri=$e(16),te=$e(4);function Rr(i,e,t,n,r,o,l){let s,c,u,h,a,f,d,g,b,v,y,E,_,L,T,N,x,S;const P=i-r,w=t-r,M=e-o,O=n-o;L=P*O,f=ee*P,d=f-(f-P),g=P-d,f=ee*O,b=f-(f-O),v=O-b,T=g*v-(L-d*b-g*b-d*v),N=M*w,f=ee*M,d=f-(f-M),g=M-d,f=ee*w,b=f-(f-w),v=w-b,x=g*v-(N-d*b-g*b-d*v),y=T-x,a=T-y,je[0]=T-(y+a)+(a-x),E=L+y,a=E-L,_=L-(E-a)+(y-a),y=_-N,a=_-y,je[1]=_-(y+a)+(a-N),S=E+y,a=S-E,je[2]=E-(S-a)+(y-a),je[3]=S;let ie=kr(4,je),C=Tr*l;if(ie>=C||-ie>=C||(a=i-P,s=i-(P+a)+(a-r),a=t-w,u=t-(w+a)+(a-r),a=e-M,c=e-(M+a)+(a-o),a=n-O,h=n-(O+a)+(a-o),s===0&&c===0&&u===0&&h===0)||(C=Pr*l+Cr*Math.abs(ie),ie+=P*h+O*s-(M*u+w*c),ie>=C||-ie>=C))return ie;L=s*O,f=ee*s,d=f-(f-s),g=s-d,f=ee*O,b=f-(f-O),v=O-b,T=g*v-(L-d*b-g*b-d*v),N=c*w,f=ee*c,d=f-(f-c),g=c-d,f=ee*w,b=f-(f-w),v=w-b,x=g*v-(N-d*b-g*b-d*v),y=T-x,a=T-y,te[0]=T-(y+a)+(a-x),E=L+y,a=E-L,_=L-(E-a)+(y-a),y=_-N,a=_-y,te[1]=_-(y+a)+(a-N),S=E+y,a=S-E,te[2]=E-(S-a)+(y-a),te[3]=S;const A=At(4,je,4,te,Ti);L=P*h,f=ee*P,d=f-(f-P),g=P-d,f=ee*h,b=f-(f-h),v=h-b,T=g*v-(L-d*b-g*b-d*v),N=M*u,f=ee*M,d=f-(f-M),g=M-d,f=ee*u,b=f-(f-u),v=u-b,x=g*v-(N-d*b-g*b-d*v),y=T-x,a=T-y,te[0]=T-(y+a)+(a-x),E=L+y,a=E-L,_=L-(E-a)+(y-a),y=_-N,a=_-y,te[1]=_-(y+a)+(a-N),S=E+y,a=S-E,te[2]=E-(S-a)+(y-a),te[3]=S;const fe=At(A,Ti,4,te,Pi);L=s*h,f=ee*s,d=f-(f-s),g=s-d,f=ee*h,b=f-(f-h),v=h-b,T=g*v-(L-d*b-g*b-d*v),N=c*u,f=ee*c,d=f-(f-c),g=c-d,f=ee*u,b=f-(f-u),v=u-b,x=g*v-(N-d*b-g*b-d*v),y=T-x,a=T-y,te[0]=T-(y+a)+(a-x),E=L+y,a=E-L,_=L-(E-a)+(y-a),y=_-N,a=_-y,te[1]=_-(y+a)+(a-N),S=E+y,a=S-E,te[2]=E-(S-a)+(y-a),te[3]=S;const q=At(fe,Pi,4,te,Ri);return Ri[q-1]}function Or(i,e,t,n,r,o){const l=(e-o)*(t-r),s=(i-r)*(n-o),c=l-s,u=Math.abs(l+s);return Math.abs(c)>=Nr*u?c:-Rr(i,e,t,n,r,o,u)}const et=(i,e)=>i.ll.x<=e.x&&e.x<=i.ur.x&&i.ll.y<=e.y&&e.y<=i.ur.y,Wt=(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 Te=Number.EPSILON;Te===void 0&&(Te=Math.pow(2,-52));const Ir=Te*Te,Oi=(i,e)=>{if(-Te<i&&i<Te&&-Te<e&&e<Te)return 0;const t=i-e;return t*t<Ir*i*e?0:i<e?-1:1};class zr{constructor(){this.reset()}reset(){this.xRounder=new Ii,this.yRounder=new Ii}round(e,t){return{x:this.xRounder.round(e),y:this.yRounder.round(t)}}}class Ii{constructor(){this.tree=new Rt,this.round(0)}round(e){const t=this.tree.add(e),n=this.tree.prev(t);if(n!==null&&Oi(t.key,n.key)===0)return this.tree.remove(e),n.key;const r=this.tree.next(t);return r!==null&&Oi(t.key,r.key)===0?(this.tree.remove(e),r.key):e}}const tt=new zr,at=(i,e)=>i.x*e.y-i.y*e.x,zi=(i,e)=>i.x*e.x+i.y*e.y,Ai=(i,e,t)=>{const n=Or(i.x,i.y,e.x,e.y,t.x,t.y);return n>0?-1:n<0?1:0},ct=i=>Math.sqrt(zi(i,i)),Ar=(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 at(r,n)/ct(r)/ct(n)},Wr=(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 zi(r,n)/ct(r)/ct(n)},Wi=(i,e,t)=>e.y===0?null:{x:i.x+e.x/e.y*(t-i.y),y:t},Bi=(i,e,t)=>e.x===0?null:{x:t,y:i.y+e.y/e.x*(t-i.x)},Br=(i,e,t,n)=>{if(e.x===0)return Bi(t,n,i.x);if(n.x===0)return Bi(i,e,t.x);if(e.y===0)return Wi(t,n,i.y);if(n.y===0)return Wi(i,e,t.y);const r=at(e,n);if(r==0)return null;const o={x:t.x-i.x,y:t.y-i.y},l=at(o,e)/r,s=at(o,n)/r,c=i.x+s*e.x,u=t.x+l*n.x,h=i.y+s*e.y,a=t.y+l*n.y,f=(c+u)/2,d=(h+a)/2;return{x:f,y:d}};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:Pe.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:Ar(this.point,e.point,o.point),cosine:Wr(this.point,e.point,o.point)})};return(r,o)=>{t.has(r)||n(r),t.has(o)||n(o);const{sine:l,cosine:s}=t.get(r),{sine:c,cosine:u}=t.get(o);return l>=0&&c>=0?s<u?1:s>u?-1:0:l<0&&c<0?s<u?-1:s>u?1:0:c<l?-1:c>l?1:0}}}let Dr=0;class Pe{static compare(e,t){const n=e.leftSE.point.x,r=t.leftSE.point.x,o=e.rightSE.point.x,l=t.rightSE.point.x;if(l<n)return 1;if(o<r)return-1;const s=e.leftSE.point.y,c=t.leftSE.point.y,u=e.rightSE.point.y,h=t.rightSE.point.y;if(n<r){if(c<s&&c<u)return 1;if(c>s&&c>u)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<h)return-1;if(s>c&&s>h)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<l){const a=t.comparePoint(e.rightSE.point);if(a!==0)return a}if(o>l){const a=e.comparePoint(t.rightSE.point);if(a<0)return 1;if(a>0)return-1}if(o!==l){const a=u-s,f=o-n,d=h-c,g=l-r;if(a>f&&d<g)return 1;if(a<f&&d>g)return-1}return o>l?1:o<l||u<h?-1:u>h?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,n,r){this.id=++Dr,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,l;const s=le.comparePoints(e,t);if(s<0)r=e,o=t,l=1;else if(s>0)r=t,o=e,l=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const c=new le(r,!0),u=new le(o,!1);return new Pe(c,u,[n],[l])}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,l=t.x+o*r.x;if(e.x===l)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=Wt(t,n);if(r===null)return null;const o=this.leftSE.point,l=this.rightSE.point,s=e.leftSE.point,c=e.rightSE.point,u=et(t,s)&&this.comparePoint(s)===0,h=et(n,o)&&e.comparePoint(o)===0,a=et(t,c)&&this.comparePoint(c)===0,f=et(n,l)&&e.comparePoint(l)===0;if(h&&u)return f&&!a?l:!f&&a?c:null;if(h)return a&&o.x===c.x&&o.y===c.y?null:o;if(u)return f&&l.x===s.x&&l.y===s.y?null:s;if(f&&a)return null;if(f)return l;if(a)return c;const d=Br(o,this.vector(),s,e.vector());return d===null||!et(r,d)?null:tt.round(d.x,d.y)}split(e){const t=[],n=e.events!==void 0,r=new le(e,!0),o=new le(e,!1),l=this.rightSE;this.replaceRightSE(o),t.push(o),t.push(r);const s=new Pe(r,l,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=Pe.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,l=n.rings.length;o<l;o++){const s=n.rings[o],c=n.windings[o],u=t.rings.indexOf(s);u===-1?(t.rings.push(s),t.windings.push(c)):t.windings[u]+=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 u=this.rings[s],h=this.windings[s],a=t.indexOf(u);a===-1?(t.push(u),n.push(h)):n[a]+=h}const o=[],l=[];for(let s=0,c=t.length;s<c;s++){if(n[s]===0)continue;const u=t[s],h=u.poly;if(l.indexOf(h)===-1)if(u.isExterior)o.push(h);else{l.indexOf(h)===-1&&l.push(h);const a=o.indexOf(u.poly);a!==-1&&o.splice(a,1)}}for(let s=0,c=o.length;s<c;s++){const u=o[s].multiPoly;r.indexOf(u)===-1&&r.push(u)}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(ce.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===ce.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 ${ce.type}`)}return this._isInResult}}class Di{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=tt.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 l=1,s=e.length;l<s;l++){if(typeof e[l][0]!="number"||typeof e[l][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=tt.round(e[l][0],e[l][1]);c.x===o.x&&c.y===o.y||(this.segments.push(Pe.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(Pe.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 Ur{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Di(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 Di(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,l=r.length;o<l;o++)e.push(r[o])}return e}}class Ui{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 Ur(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,l=r.length;o<l;o++)e.push(r[o])}return e}}class ft{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 l=null,s=o.leftSE,c=o.rightSE;const u=[s],h=s.point,a=[];for(;l=s,s=c,u.push(s),s.point!==h;)for(;;){const f=s.getAvailableLinkedEvents();if(f.length===0){const b=u[0].point,v=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${b.x}, ${b.y}]. Last matching segment found ends at [${v.x}, ${v.y}].`)}if(f.length===1){c=f[0].otherSE;break}let d=null;for(let b=0,v=a.length;b<v;b++)if(a[b].point===s.point){d=b;break}if(d!==null){const b=a.splice(d)[0],v=u.splice(b.index);v.unshift(v[0].otherSE),t.push(new ft(v.reverse()));continue}a.push({index:u.length,point:s.point});const g=s.getLeftmostComparator(l);c=f.sort(g)[0].otherSE;break}t.push(new ft(u))}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 u=1,h=this.events.length-1;u<h;u++){const a=this.events[u].point,f=this.events[u+1].point;Ai(a,e,f)!==0&&(t.push(a),e=a)}if(t.length===1)return null;const n=t[0],r=t[1];Ai(n,e,r)===0&&t.shift(),t.push(t[0]);const o=this.isExteriorRing()?1:-1,l=this.isExteriorRing()?0:t.length-1,s=this.isExteriorRing()?t.length:-1,c=[];for(let u=l;u!=s;u+=o)c.push([t[u].x,t[u].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 l=this.events[r];le.compare(e,l)>0&&(e=l)}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 Fi{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 Fr{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 Fi(o));else{const l=o.enclosingRing();l.poly||t.push(new Fi(l)),l.poly.addInterior(o)}}return t}}class Gr{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Pe.compare;this.queue=e,this.tree=new Rt(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,l=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;)l=this.tree.next(l),l===null?c=null:l.key.consumedBy===void 0&&(c=l.key);if(e.isLeft){let u=null;if(s){const a=s.getIntersection(t);if(a!==null&&(t.isAnEndpoint(a)||(u=a),!s.isAnEndpoint(a))){const f=this._splitSafely(s,a);for(let d=0,g=f.length;d<g;d++)n.push(f[d])}}let h=null;if(c){const a=c.getIntersection(t);if(a!==null&&(t.isAnEndpoint(a)||(h=a),!c.isAnEndpoint(a))){const f=this._splitSafely(c,a);for(let d=0,g=f.length;d<g;d++)n.push(f[d])}}if(u!==null||h!==null){let a=null;u===null?a=h:h===null?a=u:a=le.comparePoints(u,h)<=0?u:h,this.queue.remove(t.rightSE),n.push(t.rightSE);const f=t.split(a);for(let d=0,g=f.length;d<g;d++)n.push(f[d])}n.length>0?(this.tree.remove(t),n.push(e)):(this.segments.push(t),t.prev=s)}else{if(s&&c){const u=s.getIntersection(c);if(u!==null){if(!s.isAnEndpoint(u)){const h=this._splitSafely(s,u);for(let a=0,f=h.length;a<f;a++)n.push(h[a])}if(!c.isAnEndpoint(u)){const h=this._splitSafely(c,u);for(let a=0,f=h.length;a<f;a++)n.push(h[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 Gi=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,jr=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class qr{run(e,t,n){ce.type=e,tt.reset();const r=[new Ui(t,!0)];for(let a=0,f=n.length;a<f;a++)r.push(new Ui(n[a],!1));if(ce.numMultiPolys=r.length,ce.type==="difference"){const a=r[0];let f=1;for(;f<r.length;)Wt(r[f].bbox,a.bbox)!==null?f++:r.splice(f,1)}if(ce.type==="intersection")for(let a=0,f=r.length;a<f;a++){const d=r[a];for(let g=a+1,b=r.length;g<b;g++)if(Wt(d.bbox,r[g].bbox)===null)return[]}const o=new Rt(le.compare);for(let a=0,f=r.length;a<f;a++){const d=r[a].getSweepEvents();for(let g=0,b=d.length;g<b;g++)if(o.insert(d[g]),o.size>Gi)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const l=new Gr(o);let s=o.size,c=o.pop();for(;c;){const a=c.key;if(o.size===s){const d=a.segment;throw new Error(`Unable to pop() ${a.isLeft?"left":"right"} SweepEvent [${a.point.x}, ${a.point.y}] from segment #${d.id} [${d.leftSE.point.x}, ${d.leftSE.point.y}] -> [${d.rightSE.point.x}, ${d.rightSE.point.y}] from queue.`)}if(o.size>Gi)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(l.segments.length>jr)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=l.process(a);for(let d=0,g=f.length;d<g;d++){const b=f[d];b.consumedBy===void 0&&o.insert(b)}s=o.size,c=o.pop()}tt.reset();const u=ft.factory(l.segments);return new Fr(u).getGeom()}}const ce=new qr;var ji={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 ce.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 ce.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 ce.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 ce.run("difference",i,t)}};function Zr(i,e={}){const t=[];if(Ct(i,r=>{t.push(r.coordinates)}),t.length<2)throw new Error("Must have at least 2 geometries");const n=ji.union(t[0],...t.slice(1));return n.length===0?null:n.length===1?Mt(n[0],e.properties):Si(n,e.properties)}var qi=Zr;function Qr(i){const e=[];if(Ct(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=ji.difference(e[0],...e.slice(1));return n.length===0?null:n.length===1?Mt(n[0],t):Si(n,t)}var Hr=Qr;function Vr(i){if(!i)throw new Error("geojson is required");var e=[];return pr(i,function(t){e.push(t)}),Je(e)}var Yr=Vr;function Zi(i,e){const t=Hr(Je([Mt([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),i]));if(!t)return;t.properties={isMask:!0};const n=Ve(kt(i)),r=(n[2]-n[0])/360/1e3,o=n[0]<-180,l=n[2]>180,s=Yr(i);if(s.features.length>1&&(o||l))for(const c of s.features){const u=Ve(kt(c));if(l&&u[0]<-180+r)for(const h of c.geometry.coordinates)for(const a of h)a[0]+=360-r;if(o&&u[2]>180-r)for(const h of c.geometry.coordinates)for(const a of h)a[0]-=360-r}e(Je([s.features.length<2?i:qi(s)??i,t]))}const Qi=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 Hi(i,e=!0,t=!0,n={},r={},o=Qi){let l;const s=[];let c,u;const h=ne.geoJSON(void 0,{style:o===!0?Qi:o===!1?void 0:o??void 0,interactive:!1}).addTo(i),a=d=>{l==null||l({type:"mapClick",coordinates:[d.latlng.lng,d.latlng.lat]})};function f(d,g=!1){const b=document.createElement("div");return new Zn({props:{displayIn:"leaflet"},target:b}),new ne.Marker(d,{interactive:g,icon:new ne.DivIcon({html:b,className:"",iconAnchor:[12,26],iconSize:[25,30],tooltipAnchor:[1,-24]})})}return{setEventHandler(d){d?(l=d,i.on("click",a)):(l=void 0,i.off("click",a))},flyTo(d,g){i.flyTo([d[1],d[0]],g,{duration:2,...n})},fitBounds(d,g,b){i.flyToBounds([[d[1],d[0]],[d[3],d[2]]],{padding:[g,g],duration:2,...b?{maxZoom:b}:{},...r})},indicateReverse(d){i.getContainer().style.cursor=d?"crosshair":""},setReverseMarker(d){var b;if(!e)return;const g=d&&[d[1],d[0]];u?g?u.setLatLng(g):(u.remove(),u=void 0):g&&(e instanceof Function?u=e(i)??void 0:(u=(typeof e=="object"?new ne.Marker(g,e):f(g)).addTo(i),(b=u.getElement())==null||b.classList.add("marker-reverse")))},setFeatures(d,g,b){function v(y){h.clearLayers(),y&&h.addData(y)}for(const y of s)y.remove();s.length=0,v();e:if(g){let y=!1;if(g.geometry.type==="GeometryCollection"){const E=g.geometry.geometries.filter(_=>_.type==="Polygon"||_.type==="MultiPolygon");t:if(E.length>0){const _=qi(Je(E.map(L=>Ke(L))));if(!_)break t;Zi({...g,geometry:_.geometry},v),y=!0}else{const _=g.geometry.geometries.filter(L=>L.type==="LineString"||L.type==="MultiLineString");_.length>0&&(v({...g,geometry:{type:"GeometryCollection",geometries:_}}),y=!0)}}if(!y){if(g.geometry.type==="Polygon"||g.geometry.type==="MultiPolygon")Zi(g,E=>{if(!E)return;const _=[...E.features],L=Ve(kt(g)),T=L[2]-L[0];L[0]-T/4<-180&&_.push(...Vi(E,-360).features),L[2]+T/4>180&&_.push(...Vi(E,360).features),v(Je(_))});else if(g.geometry.type==="LineString"||g.geometry.type==="MultiLineString"){v(g);break e}}if(!b&&g.geometry.type!=="Point")break e;if(e instanceof Function){const E=e(i,g);E&&s.push(E.addTo(i))}else if(e){const E=[g.center[1],g.center[0]];s.push(typeof e=="object"?new ne.Marker(E,e):f(E).addTo(i))}}if(t)for(const y of d??[]){if(y===g)continue;const E=[y.center[1],y.center[0]];let _;if(t instanceof Function){if(_=t(i,y),!_)continue}else _=(typeof t=="object"?new ne.Marker(E,t):f(E,!0)).addTo(i).bindTooltip(y.place_type[0]==="reverse"?y.place_name:y.place_name.replace(/,.*/,""),{direction:"top"});const L=_.getElement();L&&(L.addEventListener("click",T=>{T.stopPropagation(),l==null||l({type:"markerClick",id:y.id})}),L.addEventListener("mouseenter",()=>{l==null||l({type:"markerMouseEnter",id:y.id})}),L.addEventListener("mouseleave",()=>{l==null||l({type:"markerMouseLeave",id:y.id})}),L.classList.toggle("marker-fuzzy",!!y.matching_text)),s.push(_)}},setSelectedMarker(d){var g,b;c&&((g=c.getElement())==null||g.classList.toggle("marker-selected",!1)),c=d>-1?s[d]:void 0,(b=c==null?void 0:c.getElement())==null||b.classList.toggle("marker-selected",!0)},getCenterAndZoom(){const d=i.getCenter();return[i.getZoom(),d.lng,d.lat]}}}function Vi(i,e){const t=_r(i);for(const n of t.features)if(n.geometry.type=="MultiPolygon")for(const r of n.geometry.coordinates)Yi(r,e);else Yi(n.geometry.coordinates,e);return t}function Yi(i,e){for(const t of i)for(const n of t)n[0]+=e}class Xi extends ne.Control{}ne.Util.extend(Xi.prototype,ne.Evented.prototype);class Ki extends Xi{constructor(t){super(t);Jt(this,oe);Jt(this,Ae);$t(this,Ae,t)}onAdd(t){const n=document.createElement("div");n.className="leaflet-ctrl-geocoder",ne.DomEvent.disableClickPropagation(n),ne.DomEvent.disableScrollPropagation(n);const{marker:r,showResultMarkers:o,flyTo:l,fullGeometryStyle:s,position:c,...u}=se(this,Ae),h=typeof l=="boolean"?{}:l,a=Hi(t,r,o,h,h,s);$t(this,oe,new gr({target:n,props:{mapController:a,flyTo:l===void 0?!0:!!l,...u}}));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 d in f)se(this,oe).$on(d,g=>this.fire(d,g.detail));return n}setOptions(t){var c;Object.assign(se(this,Ae),t);const{marker:n,showResultMarkers:r,flyTo:o,fullGeometryStyle:l,...s}=se(this,Ae);(c=se(this,oe))==null||c.$set(s)}setQuery(t,n=!0){var r;(r=se(this,oe))==null||r.setQuery(t,n)}clearMap(){var t;(t=se(this,oe))==null||t.clearMap()}clearList(){var t;(t=se(this,oe))==null||t.clearList()}setReverseMode(t){var n;(n=se(this,oe))==null||n.$set({reverseActive:t})}focus(t){var n;(n=se(this,oe))==null||n.focus(t)}blur(){var t;(t=se(this,oe))==null||t.blur()}onRemove(){var t;(t=se(this,oe))==null||t.$destroy()}}oe=new WeakMap,Ae=new WeakMap;function Xr(...i){return new Ki(...i)}window.L&&typeof window.L=="object"&&typeof window.L.control=="function"&&(window.L.control.maptilerGeocoding=Xr),z.GeocodingControl=Ki,z.createLeafletMapController=Hi,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})});
|
|
23
23
|
//# sourceMappingURL=leaflet.umd.js.map
|