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