@maptiler/geocoding-control 2.0.0 → 2.0.1
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/MapLibreBasedGeocodingControl.d.ts +2616 -27
- package/leaflet-controller.d.ts +1 -1
- package/leaflet-controller.js +97 -95
- package/leaflet-controller.js.map +1 -1
- package/leaflet-controller.umd.js +2 -2
- package/leaflet-controller.umd.js.map +1 -1
- package/leaflet.d.ts +26 -4
- package/leaflet.js +906 -909
- package/leaflet.js.map +1 -1
- package/leaflet.umd.js +3 -3
- package/leaflet.umd.js.map +1 -1
- package/maplibregl-controller.d.ts +1 -1
- package/maplibregl-controller.js +480 -466
- package/maplibregl-controller.js.map +1 -1
- package/maplibregl-controller.umd.js +3 -3
- package/maplibregl-controller.umd.js.map +1 -1
- package/maplibregl.d.ts +2594 -9
- package/maplibregl.js +2094 -1969
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +3 -3
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.d.ts +2594 -9
- package/maptilersdk.js +2086 -1964
- package/maptilersdk.js.map +1 -1
- package/maptilersdk.umd.js +3 -3
- package/maptilersdk.umd.js.map +1 -1
- package/openlayers-controller.d.ts +1 -1
- package/openlayers-controller.js +62 -60
- package/openlayers-controller.js.map +1 -1
- package/openlayers-controller.umd.js +2 -2
- package/openlayers-controller.umd.js.map +1 -1
- package/openlayers.d.ts +21 -0
- package/openlayers.js +754 -786
- package/openlayers.js.map +1 -1
- package/openlayers.umd.js +3 -3
- package/openlayers.umd.js.map +1 -1
- package/package.json +18 -18
- package/react.d.ts +4 -4
- package/react.js +619 -619
- package/react.js.map +1 -1
- package/react.umd.js +1 -1
- package/react.umd.js.map +1 -1
- package/style.css +1 -1
- package/svelte/FeatureItem.svelte +1 -1
- package/svelte/FeatureItem.svelte.d.ts +2 -2
- package/svelte/GeocodingControl.svelte +31 -32
- package/svelte/GeocodingControl.svelte.d.ts +26 -13
- package/svelte/MapLibreBasedGeocodingControl.d.ts +2616 -27
- package/svelte/MapLibreBasedGeocodingControl.js +120 -17
- package/svelte/leaflet-controller.d.ts +1 -1
- package/svelte/leaflet-controller.js +4 -1
- package/svelte/leaflet.d.ts +26 -4
- package/svelte/leaflet.js +17 -19
- package/svelte/maplibregl-controller.d.ts +1 -1
- package/svelte/maplibregl-controller.js +45 -36
- package/svelte/maplibregl.d.ts +2594 -9
- package/svelte/maplibregl.js +11 -3
- package/svelte/maptilersdk.d.ts +2594 -9
- package/svelte/maptilersdk.js +11 -3
- package/svelte/openlayers-controller.d.ts +1 -1
- package/svelte/openlayers-controller.js +4 -1
- package/svelte/openlayers.d.ts +21 -0
- package/svelte/openlayers.js +30 -45
- package/svelte/react.d.ts +4 -4
- package/svelte/react.js +5 -5
- package/svelte/types.d.ts +84 -35
- package/svelte/vanilla.d.ts +14 -1
- package/svelte/vanilla.js +31 -8
- package/types.d.ts +84 -35
- package/vanilla.d.ts +14 -1
- package/vanilla.js +929 -901
- package/vanilla.js.map +1 -1
- package/vanilla.umd.js +1 -1
- package/vanilla.umd.js.map +1 -1
package/leaflet.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(O,B){typeof exports=="object"&&typeof module<"u"?B(exports,require("leaflet")):typeof define=="function"&&define.amd?define(["exports","leaflet"],B):(O=typeof globalThis<"u"?globalThis:O||self,B(O.leafletMaptilerGeocoder={},O.L))})(this,function(O,B){"use strict";var so=Object.defineProperty;var Hi=O=>{throw TypeError(O)};var lo=(O,B,K)=>B in O?so(O,B,{enumerable:!0,configurable:!0,writable:!0,value:K}):O[B]=K;var jt=(O,B,K)=>lo(O,typeof B!="symbol"?B+"":B,K),Vi=(O,B,K)=>B.has(O)||Hi("Cannot "+K);var de=(O,B,K)=>(Vi(O,B,"read from private field"),K?K.call(O):B.get(O)),Zt=(O,B,K)=>B.has(O)?Hi("Cannot add the same private member more than once"):B instanceof WeakSet?B.add(O):B.set(O,K),dt=(O,B,K,ee)=>(Vi(O,B,"write to private field"),ee?ee.call(O,K):B.set(O,K),K);var ue,Pe;function K(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const ee=K(B);function D(){}function Yi(i,e){for(const t in e)i[t]=e[t];return i}function qt(i){return i()}function Qt(){return Object.create(null)}function ye(i){i.forEach(qt)}function Ht(i){return typeof i=="function"}function we(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let $e;function J(i,e){return i===e?!0:($e||($e=document.createElement("a")),$e.href=e,i===$e.href)}function Xi(i){return Object.keys(i).length===0}function Ki(i,e,t,n){if(i){const r=Vt(i,e,t,n);return i[0](r)}}function Vt(i,e,t,n){return i[1]&&n?Yi(t.ctx.slice(),i[1](n(e))):t.ctx}function Ji(i,e,t,n){if(i[2]&&n){const r=i[2](n(t));if(e.dirty===void 0)return r;if(typeof r=="object"){const o=[],l=Math.max(e.dirty.length,r.length);for(let s=0;s<l;s+=1)o[s]=e.dirty[s]|r[s];return o}return e.dirty|r}return e.dirty}function $i(i,e,t,n,r,o){if(r){const l=Vt(e,t,n,o);i.p(l,r)}}function en(i){if(i.ctx.length>32){const e=[],t=i.ctx.length/32;for(let n=0;n<t;n++)e[n]=-1;return e}return-1}function Yt(i){return i??""}function P(i,e){i.appendChild(e)}function F(i,e,t){i.insertBefore(e,t||null)}function U(i){i.parentNode&&i.parentNode.removeChild(i)}function A(i){return document.createElement(i)}function ae(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function _e(i){return document.createTextNode(i)}function ne(){return _e(" ")}function tn(){return _e("")}function te(i,e,t,n){return i.addEventListener(e,t,n),()=>i.removeEventListener(e,t,n)}function nn(i){return function(e){return e.preventDefault(),i.call(this,e)}}function y(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}function rn(i){return Array.from(i.childNodes)}function Ge(i,e){e=""+e,i.data!==e&&(i.data=e)}function Xt(i,e){i.value=e??""}function se(i,e,t){i.classList.toggle(e,!!t)}function on(i,e,{bubbles:t=!1,cancelable:n=!1}={}){return new CustomEvent(i,{detail:e,bubbles:t,cancelable:n})}let ze;function je(i){ze=i}function Kt(){if(!ze)throw new Error("Function called outside component initialization");return ze}function sn(i){Kt().$$.on_destroy.push(i)}function ln(){const i=Kt();return(e,t,{cancelable:n=!1}={})=>{const r=i.$$.callbacks[e];if(r){const o=on(e,t,{cancelable:n});return r.slice().forEach(l=>{l.call(i,o)}),!o.defaultPrevented}return!0}}function Jt(i,e){const t=i.$$.callbacks[e.type];t&&t.slice().forEach(n=>n.call(this,e))}const Oe=[],ht=[];let We=[];const $t=[],un=Promise.resolve();let gt=!1;function an(){gt||(gt=!0,un.then(ei))}function mt(i){We.push(i)}const yt=new Set;let Ae=0;function ei(){if(Ae!==0)return;const i=ze;do{try{for(;Ae<Oe.length;){const e=Oe[Ae];Ae++,je(e),cn(e.$$)}}catch(e){throw Oe.length=0,Ae=0,e}for(je(null),Oe.length=0,Ae=0;ht.length;)ht.pop()();for(let e=0;e<We.length;e+=1){const t=We[e];yt.has(t)||(yt.add(t),t())}We.length=0}while(Oe.length);for(;$t.length;)$t.pop()();gt=!1,yt.clear(),je(i)}function cn(i){if(i.fragment!==null){i.update(),ye(i.before_update);const e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(mt)}}function fn(i){const e=[],t=[];We.forEach(n=>i.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),We=e}const et=new Set;let Te;function tt(){Te={r:0,c:[],p:Te}}function it(){Te.r||ye(Te.c),Te=Te.p}function Q(i,e){i&&i.i&&(et.delete(i),i.i(e))}function X(i,e,t,n){if(i&&i.o){if(et.has(i))return;et.add(i),Te.c.push(()=>{et.delete(i),n&&(t&&i.d(1),n())}),i.o(e)}else n&&n()}function ti(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function dn(i,e){X(i,1,1,()=>{e.delete(i.key)})}function hn(i,e,t,n,r,o,l,s,c,u,h,a){let f=i.length,d=o.length,m=f;const v={};for(;m--;)v[i[m].key]=m;const b=[],p=new Map,_=new Map,E=[];for(m=d;m--;){const L=a(r,o,m),w=t(L);let C=l.get(w);C?E.push(()=>C.p(L,e)):(C=u(w,L),C.c()),p.set(w,b[m]=C),w in v&&_.set(w,Math.abs(m-v[w]))}const S=new Set,k=new Set;function x(L){Q(L,1),L.m(s,h),l.set(L.key,L),h=L.first,d--}for(;f&&d;){const L=b[d-1],w=i[f-1],C=L.key,I=w.key;L===w?(h=L.first,f--,d--):p.has(I)?!l.has(C)||S.has(C)?x(L):k.has(I)?f--:_.get(C)>_.get(I)?(k.add(C),x(L)):(S.add(I),f--):(c(w,l),f--)}for(;f--;){const L=i[f];p.has(L.key)||c(L,l)}for(;d;)x(b[d-1]);return ye(E),b}function Ee(i){i&&i.c()}function pe(i,e,t){const{fragment:n,after_update:r}=i.$$;n&&n.m(e,t),mt(()=>{const o=i.$$.on_mount.map(qt).filter(Ht);i.$$.on_destroy?i.$$.on_destroy.push(...o):ye(o),i.$$.on_mount=[]}),r.forEach(mt)}function ve(i,e){const t=i.$$;t.fragment!==null&&(fn(t.after_update),ye(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function gn(i,e){i.$$.dirty[0]===-1&&(Oe.push(i),an(),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function Le(i,e,t,n,r,o,l=null,s=[-1]){const c=ze;je(i);const u=i.$$={fragment:null,ctx:[],props:o,update:D,not_equal:r,bound:Qt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:Qt(),dirty:s,skip_bound:!1,root:e.target||c.$$.root};l&&l(u.root);let h=!1;if(u.ctx=t?t(i,e.props||{},(a,f,...d)=>{const m=d.length?d[0]:f;return u.ctx&&r(u.ctx[a],u.ctx[a]=m)&&(!u.skip_bound&&u.bound[a]&&u.bound[a](m),h&&gn(i,a)),f}):[],u.update(),h=!0,ye(u.before_update),u.fragment=n?n(u.ctx):!1,e.target){if(e.hydrate){const a=rn(e.target);u.fragment&&u.fragment.l(a),a.forEach(U)}else u.fragment&&u.fragment.c();e.intro&&Q(i.$$.fragment),pe(i,e.target,e.anchor),ei()}je(c)}class Se{constructor(){jt(this,"$$");jt(this,"$$set")}$destroy(){ve(this,1),this.$destroy=D}$on(e,t){if(!Ht(t))return D;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const r=n.indexOf(t);r!==-1&&n.splice(r,1)}}$set(e){this.$$set&&!Xi(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const mn="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(mn);function yn(i){let e,t;return{c(){e=ae("svg"),t=ae("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(n,r){F(n,e,r),P(e,t)},p:D,i:D,o:D,d(n){n&&U(e)}}}class ii extends Se{constructor(e){super(),Le(this,e,null,yn,we,{})}}function pn(i){let e,t;return{c(){e=ae("svg"),t=ae("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(n,r){F(n,e,r),P(e,t)},p:D,i:D,o:D,d(n){n&&U(e)}}}class ni extends Se{constructor(e){super(),Le(this,e,null,pn,we,{})}}function vn(i){let e,t;return{c(){e=A("img"),J(e.src,t=i[3]+"area.svg")||y(e,"src",t),y(e,"alt",i[6]),y(e,"class","svelte-ltkwvy")},m(n,r){F(n,e,r)},p(n,r){r&8&&!J(e.src,t=n[3]+"area.svg")&&y(e,"src",t),r&64&&y(e,"alt",n[6])},d(n){n&&U(e)}}}function bn(i){let e,t;return{c(){e=A("img"),J(e.src,t=i[3]+"reverse.svg")||y(e,"src",t),y(e,"alt",i[6]),y(e,"class","svelte-ltkwvy")},m(n,r){F(n,e,r)},p(n,r){r&8&&!J(e.src,t=n[3]+"reverse.svg")&&y(e,"src",t),r&64&&y(e,"alt",n[6])},d(n){n&&U(e)}}}function wn(i){let e,t;return{c(){e=A("img"),J(e.src,t=i[3]+"poi.svg")||y(e,"src",t),y(e,"alt",i[6]),y(e,"class","svelte-ltkwvy")},m(n,r){F(n,e,r)},p(n,r){r&8&&!J(e.src,t=n[3]+"poi.svg")&&y(e,"src",t),r&64&&y(e,"alt",n[6])},d(n){n&&U(e)}}}function _n(i){let e,t;return{c(){e=A("img"),J(e.src,t=i[3]+"postal_code.svg")||y(e,"src",t),y(e,"alt",i[6]),y(e,"class","svelte-ltkwvy")},m(n,r){F(n,e,r)},p(n,r){r&8&&!J(e.src,t=n[3]+"postal_code.svg")&&y(e,"src",t),r&64&&y(e,"alt",n[6])},d(n){n&&U(e)}}}function En(i){let e,t;return{c(){e=A("img"),J(e.src,t=i[3]+"street.svg")||y(e,"src",t),y(e,"alt",i[6]),y(e,"class","svelte-ltkwvy")},m(n,r){F(n,e,r)},p(n,r){r&8&&!J(e.src,t=n[3]+"street.svg")&&y(e,"src",t),r&64&&y(e,"alt",n[6])},d(n){n&&U(e)}}}function Ln(i){let e,t;return{c(){e=A("img"),J(e.src,t=i[3]+"road.svg")||y(e,"src",t),y(e,"alt",i[6]),y(e,"class","svelte-ltkwvy")},m(n,r){F(n,e,r)},p(n,r){r&8&&!J(e.src,t=n[3]+"road.svg")&&y(e,"src",t),r&64&&y(e,"alt",n[6])},d(n){n&&U(e)}}}function Sn(i){let e,t;return{c(){e=A("img"),J(e.src,t=i[3]+"housenumber.svg")||y(e,"src",t),y(e,"alt",i[6]),y(e,"class","svelte-ltkwvy")},m(n,r){F(n,e,r)},p(n,r){r&8&&!J(e.src,t=n[3]+"housenumber.svg")&&y(e,"src",t),r&64&&y(e,"alt",n[6])},d(n){n&&U(e)}}}function xn(i){let e,t,n,r;return{c(){e=A("img"),J(e.src,t=i[5])||y(e,"src",t),y(e,"alt",i[4]),y(e,"class","svelte-ltkwvy")},m(o,l){F(o,e,l),n||(r=te(e,"error",i[14]),n=!0)},p(o,l){l&32&&!J(e.src,t=o[5])&&y(e,"src",t),l&16&&y(e,"alt",o[4])},d(o){o&&U(e),n=!1,r()}}}function ri(i){let e,t;return{c(){e=A("span"),t=_e(i[6]),y(e,"class","secondary svelte-ltkwvy")},m(n,r){F(n,e,r),P(e,t)},p(n,r){r&64&&Ge(t,n[6])},d(n){n&&U(e)}}}function Mn(i){let e,t,n,r,o,l,s,c,u,h=(i[7]?i[0].place_name:i[0].place_name.replace(/,.*/,""))+"",a,f,d=i[2]==="always"||i[2]&&!i[0].address&&!i[0].id.startsWith("road.")&&!i[0].id.startsWith("address.")&&!i[0].id.startsWith("postal_code.")&&(!i[0].id.startsWith("poi.")||!i[5])&&!i[7],m,v,b=(i[7]?"":i[0].place_name.replace(/[^,]*,?\s*/,""))+"",p,_,E;function S(w,C){return C&1&&(t=null),C&1&&(n=null),C&1&&(r=null),C&1&&(o=null),w[5]?xn:w[0].address?Sn:(t==null&&(t=!!w[0].id.startsWith("road.")),t?Ln:(n==null&&(n=!!w[0].id.startsWith("address.")),n?En:(r==null&&(r=!!w[0].id.startsWith("postal_code.")),r?_n:(o==null&&(o=!!w[0].id.startsWith("poi.")),o?wn:w[7]?bn:vn))))}let k=S(i,-1),x=k(i),L=d&&ri(i);return{c(){e=A("li"),x.c(),l=ne(),s=A("span"),c=A("span"),u=A("span"),a=_e(h),f=ne(),L&&L.c(),m=ne(),v=A("span"),p=_e(b),y(u,"class","primary svelte-ltkwvy"),y(c,"class","svelte-ltkwvy"),y(v,"class","line2 svelte-ltkwvy"),y(s,"class","texts svelte-ltkwvy"),y(e,"tabindex","0"),y(e,"data-selected",i[1]),y(e,"class","svelte-ltkwvy"),se(e,"selected",i[1])},m(w,C){F(w,e,C),x.m(e,null),P(e,l),P(e,s),P(s,c),P(c,u),P(u,a),P(c,f),L&&L.m(c,null),P(s,m),P(s,v),P(v,p),_||(E=[te(e,"mouseenter",i[12]),te(e,"focus",i[13])],_=!0)},p(w,[C]){k===(k=S(w,C))&&x?x.p(w,C):(x.d(1),x=k(w),x&&(x.c(),x.m(e,l))),C&1&&h!==(h=(w[7]?w[0].place_name:w[0].place_name.replace(/,.*/,""))+"")&&Ge(a,h),C&37&&(d=w[2]==="always"||w[2]&&!w[0].address&&!w[0].id.startsWith("road.")&&!w[0].id.startsWith("address.")&&!w[0].id.startsWith("postal_code.")&&(!w[0].id.startsWith("poi.")||!w[5])&&!w[7]),d?L?L.p(w,C):(L=ri(w),L.c(),L.m(c,null)):L&&(L.d(1),L=null),C&1&&b!==(b=(w[7]?"":w[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&Ge(p,b),C&2&&y(e,"data-selected",w[1]),C&2&&se(e,"selected",w[1])},i:D,o:D,d(w){w&&U(e),x.d(),L&&L.d(),_=!1,ye(E)}}}function Cn(i,e,t){var E;let n,r,{feature:o}=e,{selected:l=!1}=e,{showPlaceType:s}=e,{missingIconsCache:c}=e,{iconsBaseUrl:u}=e;const h=(E=o.properties)==null?void 0:E.categories;let a,f,d=0,m=o.place_type[0]==="reverse";function v(){f&&c.add(f),t(10,d++,d)}function b(S){Jt.call(this,i,S)}function p(S){Jt.call(this,i,S)}const _=()=>v();return i.$$set=S=>{"feature"in S&&t(0,o=S.feature),"selected"in S&&t(1,l=S.selected),"showPlaceType"in S&&t(2,s=S.showPlaceType),"missingIconsCache"in S&&t(9,c=S.missingIconsCache),"iconsBaseUrl"in S&&t(3,u=S.iconsBaseUrl)},i.$$.update=()=>{var S,k,x,L;if(i.$$.dirty&3640)do t(11,n--,n),t(4,a=h==null?void 0:h[n]),t(5,f=a?u+a.replace(/ /g,"_")+".svg":void 0);while(n>-1&&(!f||c.has(f)));i.$$.dirty&1&&t(6,r=((k=(S=o.properties)==null?void 0:S.categories)==null?void 0:k.join(", "))??((L=(x=o.properties)==null?void 0:x.place_type_name)==null?void 0:L[0])??o.place_type[0])},t(11,n=(h==null?void 0:h.length)??0),[o,l,s,u,a,f,r,m,v,c,d,n,b,p,_]}class kn extends Se{constructor(e){super(),Le(this,e,Cn,Mn,we,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function Nn(i){let e;return{c(){e=A("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,n){F(t,e,n)},p:D,i:D,o:D,d(t){t&&U(e)}}}class Tn extends Se{constructor(e){super(),Le(this,e,null,Nn,we,{})}}function Pn(i){let e,t,n;return{c(){e=ae("svg"),t=ae("path"),y(t,"stroke-width","4"),y(t,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),y(t,"class","svelte-gzo3ar"),y(e,"width",n=i[0]==="list"?20:void 0),y(e,"viewBox","0 0 70 85"),y(e,"fill","none"),y(e,"class","svelte-gzo3ar"),se(e,"in-map",i[0]!=="list"),se(e,"list-icon",i[0]==="list")},m(r,o){F(r,e,o),P(e,t)},p(r,[o]){o&1&&n!==(n=r[0]==="list"?20:void 0)&&y(e,"width",n),o&1&&se(e,"in-map",r[0]!=="list"),o&1&&se(e,"list-icon",r[0]==="list")},i:D,o:D,d(r){r&&U(e)}}}function Rn(i,e,t){let{displayIn:n}=e;return i.$$set=r=>{"displayIn"in r&&t(0,n=r.displayIn)},[n]}class In extends Se{constructor(e){super(),Le(this,e,Rn,Pn,we,{displayIn:0})}}function On(i){let e,t;return{c(){e=ae("svg"),t=ae("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(n,r){F(n,e,r),P(e,t)},p:D,i:D,o:D,d(n){n&&U(e)}}}class Wn extends Se{constructor(e){super(),Le(this,e,null,On,we,{})}}function An(i){let e,t,n;return{c(){e=ae("svg"),t=ae("circle"),n=ae("path"),y(t,"cx","4.789"),y(t,"cy","4.787"),y(t,"r","3.85"),y(t,"class","svelte-1aq105l"),y(n,"d","M12.063 12.063 7.635 7.635"),y(n,"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){F(r,e,o),P(e,t),P(e,n)},p:D,i:D,o:D,d(r){r&&U(e)}}}class Bn extends Se{constructor(e){super(),Le(this,e,null,An,we,{})}}function Dn(i,e,t){const n=e[1],r=e[0],o=n-r;return i===n&&t?i:((i-r)%o+o)%o+r}function Ze(i){const e=[...i];return e[2]<e[0]&&(Math.abs((e[0]+e[2]+360)/2)>Math.abs((e[0]-360+e[2])/2)?e[0]-=360:e[2]+=360),e}let qe;async function Un(i,e,t){const n=i==null?void 0:i.getCenterAndZoom();for(const r of e??[])if(!(n&&(r.minZoom!=null&&r.minZoom>n[0]||r.maxZoom!=null&&r.maxZoom<n[0]))){if(r.type==="fixed")return r.coordinates.join(",");e:if(r.type==="client-geolocation"){if(qe&&r.cachedLocationExpiry&&qe.time+r.cachedLocationExpiry>Date.now()){if(!qe.coords)break e;return qe.coords}let o;try{return o=await new Promise((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&&(qe={time:Date.now(),coords:o})}if(t.signal.aborted)return}if(r.type==="server-geolocation")return"ip";if(n&&r.type==="map-center")return n[1].toFixed(6)+","+n[2].toFixed(6)}}const Fn=/^(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,oi=/^([+-]?[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,})$/,si=/^(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,li=/^(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,ui=/^(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,ai=/^(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 Gn(i){if(!["DMS","DM","DD"].includes(i))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){const e=this.decimalCoordinates.split(",").map(d=>Number(d.trim())),t=Number(e[0]),n=Number(e[1]),r=Math.abs(t),o=Math.abs(n),l=t>0?"N":"S",s=n>0?"E":"W";let c;i=="DD"&&(c=`${r}° ${l}, ${o}° ${s}`);const u=Math.floor(r),h=Math.floor(o),a=(r-u)*60,f=(o-h)*60;if(i=="DM"){let d=ci(a,3).toFixed(3).padStart(6,"0"),m=ci(f,3).toFixed(3).padStart(6,"0");d.endsWith(".000")&&m.endsWith(".000")&&(d=d.replace(/\.000$/,""),m=m.replace(/\.000$/,"")),c=`${u}° ${d}' ${l}, ${h}° ${m}' ${s}`}if(i=="DMS"){const d=Math.floor(a),m=Math.floor(f);let v=((a-d)*60).toFixed(1).padStart(4,"0"),b=((f-m)*60).toFixed(1).padStart(4,"0");const p=d.toString().padStart(2,"0"),_=m.toString().padStart(2,"0");v.endsWith(".0")&&b.endsWith(".0")&&(v=v.replace(/\.0$/,""),b=b.replace(/\.0$/,"")),c=`${u}° ${p}' ${v}" ${l}, ${h}° ${_}' ${b}" ${s}`}return c}else throw new Error("no decimal coordinates to convert")}function ci(i,e){const t=Math.pow(10,e);return Math.round((i+Number.EPSILON)*t)/t}function pt(i,e){e||(e=5),i=i.replace(/\s+/g," ").trim();let t=null,n=null,r="",o="",l=null,s=[],c=!1;if(Fn.test(i))throw new Error("invalid coordinate value");if(oi.test(i))if(s=oi.exec(i),c=Qe(s),c)t=Math.abs(s[1])+s[2]/60,Number(s[1])<0&&(t*=-1),n=Math.abs(s[3])+s[4]/60,Number(s[3])<0&&(n*=-1),l="DM";else throw new Error("invalid coordinate format");else if(si.test(i))if(s=si.exec(i),c=Qe(s),c){if(t=s[2],n=s[6],t.includes(",")&&(t=t.replace(",",".")),n.includes(",")&&(n=n.replace(",",".")),l="DD",Number(Math.round(t))==Number(t))throw new Error("integer only coordinate provided");if(Number(Math.round(n))==Number(n))throw new Error("integer only coordinate provided");s[1]?(r=s[1],o=s[5]):s[4]&&(r=s[4],o=s[8])}else throw new Error("invalid decimal coordinate format");else if(li.test(i))if(s=li.exec(i),c=Qe(s),c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,l="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,l="DMS"),parseInt(s[2])<0&&(t=-1*t),n=Math.abs(parseInt(s[9])),s[11]&&(n+=s[11]/60),s[13]&&(n+=s[13].replace(",",".")/3600),parseInt(s[9])<0&&(n=-1*n),s[1]?(r=s[1],o=s[8]):s[7]&&(r=s[7],o=s[14]);else throw new Error("invalid DMS coordinates format");else if(ui.test(i))if(s=ui.exec(i),c=Qe(s),c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,l="DM"),s[6]&&(t+=s[6]/3600,l="DMS"),parseInt(s[2])<0&&(t=-1*t),n=Math.abs(parseInt(s[10])),s[12]&&(n+=s[12]/60),s[14]&&(n+=s[14]/3600),parseInt(s[10])<0&&(n=-1*n),s[1]?(r=s[1],o=s[9]):s[8]&&(r=s[8],o=s[16]);else throw new Error("invalid DMS coordinates format");else if(ai.test(i)){if(s=ai.exec(i),c=Qe(s),s.filter(u=>u).length<=5)throw new Error("invalid coordinates format");if(c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4].replace(",",".")/60,l="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,l="DMS"),parseInt(s[2])<0&&(t=-1*t),n=Math.abs(parseInt(s[10])),s[12]&&(n+=s[12].replace(",",".")/60),s[14]&&(n+=s[14].replace(",",".")/3600),parseInt(s[10])<0&&(n=-1*n),s[1]?(r=s[1],o=s[9]):s[8]&&(r=s[8],o=s[16]);else throw new Error("invalid coordinates format")}if(c){if(Math.abs(n)>=180)throw new Error("invalid longitude value");if(Math.abs(t)>=90)throw new Error("invalid latitude value");if(r&&!o||!r&&o)throw new Error("invalid coordinates value");if(r&&r==o)throw new Error("invalid coordinates format");t.toString().includes(",")&&(t=t.replace(",",".")),n.toString().includes(",")&&(n=n.replace(",","."));let u=/S|SOUTH/i;u.test(r)&&t>0&&(t=-1*t),u=/W|WEST/i,u.test(o)&&n>0&&(n=-1*n);const h=s[0].trim();let a,f;const d=/[,/;\u0020]/g,m=h.match(d);if(m==null){const p=Math.floor(i.length/2);a=h.substring(0,p).trim(),f=h.substring(p).trim()}else{let p;m.length%2==1?p=Math.floor(m.length/2):p=m.length/2-1;let _=0;if(p==0)_=h.indexOf(m[0]),a=h.substring(0,_).trim(),f=h.substring(_+1).trim();else{let E=0,S=0;for(;E<=p;)_=h.indexOf(m[E],S),S=_+1,E++;a=h.substring(0,_).trim(),f=h.substring(_+1).trim()}}const v=a.split(".");if(v.length==2&&v[1]==0&&v[1].length!=2)throw new Error("invalid coordinates format");const b=f.split(".");if(b.length==2&&b[1]==0&&b[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(a)||/^\d+$/.test(f))throw new Error("degree only coordinate/s provided");return t=Number(Number(t).toFixed(e)),n=Number(Number(n).toFixed(e)),Object.freeze({verbatimCoordinates:h,verbatimLatitude:a,verbatimLongitude:f,decimalLatitude:t,decimalLongitude:n,decimalCoordinates:`${t},${n}`,originalFormat:l,closeEnough:zn,toCoordinateFormat:Gn})}else throw new Error("coordinates pattern match failed")}function Qe(i){if(!isNaN(i[0]))return!1;const e=[...i];if(e.shift(),e.length%2>0)return!1;const t=/^[-+]?\d+([\.,]\d+)?$/,n=/[eastsouthnorthwest]+/i,r=e.length/2;for(let o=0;o<r;o++){const l=e[o],s=e[o+r],c=t.test(l)&&t.test(s),u=n.test(l)&&n.test(s),h=l==s;if(!(l==null&&s==null)){if(l==null||s==null)return!1;if(c||u||h)continue;return!1}}return!0}function fi(i,e){const t=Math.abs(i-e);return Number(t.toFixed(6))<=1e-5}function zn(i){if(!i)throw new Error("coords must be provided");if(i.includes(",")){const e=i.split(",");if(Number(e[0])==NaN||Number(e[1])==NaN)throw new Error("coords are not valid decimals");return fi(this.decimalLatitude,Number(e[0]))&&fi(this.decimalLongitude,e[1])}else throw new Error("coords being tested must be separated by a comma")}const jn=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});pt.to=jn;const Zn=[{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"}],qn={decimalLatitude:40.123,decimalLongitude:-74.123},Qn=[{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}],Hn=[{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 Vn(){const i=[];return Zn.forEach(e=>{e.decimalLatitude?i.push(e):i.push({...e,...qn})}),[...i,...Qn,...Hn]}const Yn=Vn();pt.formats=Yn.map(i=>i.verbatimCoordinates);const Xn=pt;function di(i,e,t){const n=i.slice();return n[84]=e[t],n[86]=t,n}function hi(i){let e,t;return e=new Tn({}),{c(){Ee(e.$$.fragment)},m(n,r){pe(e,n,r),t=!0},i(n){t||(Q(e.$$.fragment,n),t=!0)},o(n){X(e.$$.fragment,n),t=!1},d(n){ve(e,n)}}}function gi(i){let e,t,n,r,o;return t=new Wn({}),{c(){e=A("button"),Ee(t.$$.fragment),y(e,"type","button"),y(e,"title",i[9]),y(e,"class","svelte-1uvos7g"),se(e,"active",i[0])},m(l,s){F(l,e,s),pe(t,e,null),n=!0,r||(o=te(e,"click",i[69]),r=!0)},p(l,s){(!n||s[0]&512)&&y(e,"title",l[9]),(!n||s[0]&1)&&se(e,"active",l[0])},i(l){n||(Q(t.$$.fragment,l),n=!0)},o(l){X(t.$$.fragment,l),n=!1},d(l){l&&U(e),ve(t),r=!1,o()}}}function Kn(i){let e,t=[],n=new Map,r,o,l,s=ti(i[14]);const c=u=>u[84].id+(u[84].address?","+u[84].address:"");for(let u=0;u<s.length;u+=1){let h=di(i,s,u),a=c(h);n.set(a,t[u]=mi(a,h))}return{c(){e=A("ul");for(let u=0;u<t.length;u+=1)t[u].c();y(e,"class","svelte-1uvos7g")},m(u,h){F(u,e,h);for(let a=0;a<t.length;a+=1)t[a]&&t[a].m(e,null);r=!0,o||(l=[te(e,"mouseleave",i[73]),te(e,"blur",i[74])],o=!0)},p(u,h){h[0]&17880064&&(s=ti(u[14]),tt(),t=hn(t,h,c,1,u,s,n,e,dn,mi,null,di),it())},i(u){if(!r){for(let h=0;h<s.length;h+=1)Q(t[h]);r=!0}},o(u){for(let h=0;h<t.length;h+=1)X(t[h]);r=!1},d(u){u&&U(e);for(let h=0;h<t.length;h+=1)t[h].d();o=!1,ye(l)}}}function Jn(i){let e,t,n,r,o,l;return t=new ni({}),{c(){e=A("div"),Ee(t.$$.fragment),n=ne(),r=A("div"),o=_e(i[7]),y(r,"class","svelte-1uvos7g"),y(e,"class","no-results svelte-1uvos7g")},m(s,c){F(s,e,c),pe(t,e,null),P(e,n),P(e,r),P(r,o),l=!0},p(s,c){(!l||c[0]&128)&&Ge(o,s[7])},i(s){l||(Q(t.$$.fragment,s),l=!0)},o(s){X(t.$$.fragment,s),l=!1},d(s){s&&U(e),ve(t)}}}function $n(i){let e="",t;return{c(){t=_e(e)},m(n,r){F(n,t,r)},p:D,i:D,o:D,d(n){n&&U(t)}}}function er(i){let e,t,n,r,o,l,s,c,u,h,a;return t=new ni({}),c=new ii({}),{c(){e=A("div"),Ee(t.$$.fragment),n=ne(),r=A("div"),o=_e(i[6]),l=ne(),s=A("button"),Ee(c.$$.fragment),y(r,"class","svelte-1uvos7g"),y(s,"class","svelte-1uvos7g"),y(e,"class","error svelte-1uvos7g")},m(f,d){F(f,e,d),pe(t,e,null),P(e,n),P(e,r),P(r,o),P(e,l),P(e,s),pe(c,s,null),u=!0,h||(a=te(s,"click",i[70]),h=!0)},p(f,d){(!u||d[0]&64)&&Ge(o,f[6])},i(f){u||(Q(t.$$.fragment,f),Q(c.$$.fragment,f),u=!0)},o(f){X(t.$$.fragment,f),X(c.$$.fragment,f),u=!1},d(f){f&&U(e),ve(t),ve(c),h=!1,a()}}}function mi(i,e){let t,n,r;function o(){return e[71](e[86])}function l(){return e[72](e[84])}return n=new kn({props:{feature:e[84],showPlaceType:e[10],selected:e[15]===e[86],missingIconsCache:e[20],iconsBaseUrl:e[12]}}),n.$on("mouseenter",o),n.$on("focus",l),{key:i,first:null,c(){t=tn(),Ee(n.$$.fragment),this.first=t},m(s,c){F(s,t,c),pe(n,s,c),r=!0},p(s,c){e=s;const u={};c[0]&16384&&(u.feature=e[84]),c[0]&1024&&(u.showPlaceType=e[10]),c[0]&49152&&(u.selected=e[15]===e[86]),c[0]&4096&&(u.iconsBaseUrl=e[12]),n.$set(u)},i(s){r||(Q(n.$$.fragment,s),r=!0)},o(s){X(n.$$.fragment,s),r=!1},d(s){s&&U(t),ve(n,s)}}}function tr(i){let e,t,n,r,o,l,s,c,u,h,a,f,d,m,v,b,p,_,E,S,k,x=!1;o=new Bn({}),a=new ii({});let L=i[19]&&hi(),w=i[5]===!0&&gi(i);const C=i[61].default,I=Ki(C,i,i[60],null),G=[er,$n,Jn,Kn],j=[];function W(M,Z){var re,fe;return M[18]?0:M[16]?((re=M[14])==null?void 0:re.length)===0?2:M[16]&&((fe=M[14])!=null&&fe.length)?3:-1:1}return~(b=W(i))&&(p=j[b]=G[b](i)),{c(){e=ne(),t=A("form"),n=A("div"),r=A("button"),Ee(o.$$.fragment),l=ne(),s=A("input"),c=ne(),u=A("div"),h=A("button"),Ee(a.$$.fragment),f=ne(),L&&L.c(),d=ne(),w&&w.c(),m=ne(),I&&I.c(),v=ne(),p&&p.c(),y(r,"class","search-button svelte-1uvos7g"),y(r,"type","button"),y(s,"placeholder",i[8]),y(s,"aria-label",i[8]),y(s,"class","svelte-1uvos7g"),y(h,"type","button"),y(h,"title",i[3]),y(h,"class","svelte-1uvos7g"),y(u,"class","clear-button-container svelte-1uvos7g"),se(u,"displayable",i[1]!==""),y(n,"class","input-group svelte-1uvos7g"),y(t,"tabindex","0"),y(t,"class",_=Yt(i[2])+" svelte-1uvos7g"),se(t,"can-collapse",i[4]&&i[1]==="")},m(M,Z){F(M,e,Z),F(M,t,Z),P(t,n),P(n,r),pe(o,r,null),P(n,l),P(n,s),i[63](s),Xt(s,i[1]),P(n,c),P(n,u),P(u,h),pe(a,h,null),P(u,f),L&&L.m(u,null),P(n,d),w&&w.m(n,null),P(n,m),I&&I.m(n,null),P(t,v),~b&&j[b].m(t,null),E=!0,S||(k=[te(r,"click",i[62]),te(s,"input",i[64]),te(s,"focus",i[65]),te(s,"blur",i[66]),te(s,"keydown",i[22]),te(s,"input",i[67]),te(h,"click",i[68]),te(t,"submit",nn(i[21]))],S=!0)},p(M,Z){(!E||Z[0]&256)&&y(s,"placeholder",M[8]),(!E||Z[0]&256)&&y(s,"aria-label",M[8]),Z[0]&2&&s.value!==M[1]&&Xt(s,M[1]),(!E||Z[0]&8)&&y(h,"title",M[3]),M[19]?L?Z[0]&524288&&Q(L,1):(L=hi(),L.c(),Q(L,1),L.m(u,null)):L&&(tt(),X(L,1,1,()=>{L=null}),it()),(!E||Z[0]&2)&&se(u,"displayable",M[1]!==""),M[5]===!0?w?(w.p(M,Z),Z[0]&32&&Q(w,1)):(w=gi(M),w.c(),Q(w,1),w.m(n,m)):w&&(tt(),X(w,1,1,()=>{w=null}),it()),I&&I.p&&(!E||Z[1]&536870912)&&$i(I,C,M,M[60],E?Ji(C,M[60],Z,null):en(M[60]),null);let re=b;b=W(M),b===re?~b&&j[b].p(M,Z):(p&&(tt(),X(j[re],1,1,()=>{j[re]=null}),it()),~b?(p=j[b],p?p.p(M,Z):(p=j[b]=G[b](M),p.c()),Q(p,1),p.m(t,null)):p=null),(!E||Z[0]&4&&_!==(_=Yt(M[2])+" svelte-1uvos7g"))&&y(t,"class",_),(!E||Z[0]&22)&&se(t,"can-collapse",M[4]&&M[1]==="")},i(M){E||(Q(x),Q(o.$$.fragment,M),Q(a.$$.fragment,M),Q(L),Q(w),Q(I,M),Q(p),E=!0)},o(M){X(x),X(o.$$.fragment,M),X(a.$$.fragment,M),X(L),X(w),X(I,M),X(p),E=!1},d(M){M&&(U(e),U(t)),ve(o),i[63](null),ve(a),L&&L.d(),w&&w.d(),I&&I.d(M),~b&&j[b].d(),S=!1,ye(k)}}}function ir(i,e,t){let n,{$$slots:r={},$$scope:o}=e;const l={continental_marine:4,country:4,major_landform:8,region:5,subregion:6,county:7,joint_municipality:8,joint_submunicipality:9,municipality:10,municipal_district:11,locality:12,neighbourhood:13,place:14,postal_code:14,road:16,poi:17,address:18,"poi.peak":15,"poi.shop":18,"poi.cafe":18,"poi.restaurant":18,"poi.aerodrome":13};let{class:s=void 0}=e,{apiKey:c}=e,{bbox:u=void 0}=e,{clearButtonTitle:h="clear"}=e,{clearOnBlur:a=!1}=e,{collapsed:f=!1}=e,{country:d=void 0}=e,{debounceSearch:m=200}=e,{enableReverse:v=!1}=e,{errorMessage:b="Something went wrong…"}=e,{filter:p=()=>!0}=e,{flyTo:_=!0}=e,{fuzzyMatch:E=!0}=e,{language:S=void 0}=e,{limit:k=void 0}=e,{mapController:x=void 0}=e,{minLength:L=2}=e,{noResultsMessage:w="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=e,{placeholder:C="Search"}=e,{proximity:I=[{type:"server-geolocation"}]}=e,{reverseActive:G=v==="always"}=e,{reverseButtonTitle:j="toggle reverse geocoding"}=e,{searchValue:W=""}=e,{showFullGeometry:M=!0}=e,{showPlaceType:Z="ifNeeded"}=e,{showResultsWhileTyping:re=!0}=e,{selectFirst:fe=!0}=e,{flyToSelected:Pt=!1}=e,{markerOnSelected:st=!0}=e,{types:Re=void 0}=e,{exhaustiveReverseGeocoding:Rt=!1}=e,{excludeTypes:lt=!1}=e,{zoom:De=l}=e,{maxZoom:ut=void 0}=e,{apiUrl:It="https://api.maptiler.com/geocoding"}=e,{fetchParameters:Ot={}}=e,{iconsBaseUrl:ji="https://cdn.maptiler.com/maptiler-geocoding-control/v2.0.0/icons/"}=e,{adjustUrlQuery:Wt=()=>{}}=e;function Ur(){he.focus()}function Fr(){he.blur()}function Zi(g,q=!0,Y=!1){t(1,W=g),q?(t(15,z=-1),Qi()):(Ut(!Y,Y),setTimeout(()=>{he.focus(),he.select()}))}function Gr(){t(14,R=void 0),t(57,N=void 0),t(15,z=-1)}function zr(){t(56,H=[]),t(57,N=void 0)}let Ue=!1,R,H,N,qi="",he,z=-1,ge,at=[],Ie,Fe,ct,At;const jr=new Set,Ne=ln();sn(()=>{x&&(x.setEventHandler(void 0),x.indicateReverse(!1),x.setSelectedMarker(-1),x.setMarkers(void 0,void 0))});function Qi(g){if(Fe&&(clearTimeout(Fe),Fe=void 0),z>-1&&R)t(57,N=R[z]),t(1,W=N.place_type[0]==="reverse"?N.place_name:N.place_name.replace(/,.*/,"")),t(18,ge=void 0),t(56,H=void 0),t(15,z=-1);else if(W){const q=g||!Bt(W);Dt(W,{exact:!0}).then(()=>{t(56,H=R),t(57,N=void 0),q&&Zr()}).catch(Y=>t(18,ge=Y))}}function Bt(g){try{return Xn(g,6)}catch{return!1}}async function Dt(g,{byId:q=!1,exact:Y=!1}={}){t(18,ge=void 0),Ie==null||Ie.abort();const oe=new AbortController;t(19,Ie=oe);try{const T=Bt(g),V=new URLSearchParams;if(S!==void 0&&V.set("language",Array.isArray(S)?S.join(","):S??""),Re&&V.set("types",Re.join(",")),lt&&V.set("excludeTypes",String(lt)),u&&V.set("bbox",u.map(ft=>ft.toFixed(6)).join(",")),d&&V.set("country",Array.isArray(d)?d.join(","):d),!q&&!T){const ft=await Un(x,I,oe);ft&&V.set("proximity",ft),(Y||!re)&&V.set("autocomplete","false"),V.set("fuzzyMatch",String(E))}k!==void 0&&(Rt||!T||(Re==null?void 0:Re.length)===1)&&V.set("limit",String(k)),V.set("key",c),Wt(V);const me=It+"/"+encodeURIComponent(T?T.decimalLongitude+","+T.decimalLatitude:g)+".json?"+V.toString();if(me===qi){q?(t(14,R=void 0),t(57,N=at[0])):t(14,R=at);return}qi=me;const Gt=await fetch(me,{signal:oe.signal,...Ot});if(!Gt.ok)throw new Error(await Gt.text());const zt=await Gt.json();Ne("response",{url:me,featureCollection:zt}),q?(t(14,R=void 0),t(57,N=zt.features[0]),at=[N]):(t(14,R=zt.features.filter(p)),T&&R.unshift({type:"Feature",properties:{},id:"reverse_"+T.decimalLongitude+"_"+T.decimalLatitude,text:T.decimalLatitude+", "+T.decimalLongitude,place_name:T.decimalLatitude+", "+T.decimalLongitude,place_type:["reverse"],center:[T.decimalLongitude,T.decimalLatitude],bbox:[T.decimalLongitude,T.decimalLatitude,T.decimalLongitude,T.decimalLatitude],geometry:{type:"Point",coordinates:[T.decimalLongitude,T.decimalLatitude]}}),at=R,T&&he.focus())}catch(T){if(T&&typeof T=="object"&&"name"in T&&T.name==="AbortError")return;throw T}finally{oe===Ie&&t(19,Ie=void 0)}}function Zr(){var oe;if(!(H!=null&&H.length)||!_)return;const g=[180,90,-180,-90],q=!H.some(T=>!T.matching_text);let Y;for(const T of H){const V=Je(T);if(Y=ut??(Y===void 0?V:V===void 0?Y:Math.max(Y,V)),q||!T.matching_text)for(const me of[0,1,2,3])g[me]=Math[me<2?"min":"max"](g[me],((oe=T.bbox)==null?void 0:oe[me])??T.center[me%2])}x&&H.length>0&&(N&&g[0]===g[2]&&g[1]===g[3]?x.flyTo(N.center,Je(N)):x.fitBounds(Ze(g),50,Y))}function Je(g){var Y;if(!g.bbox||g.bbox[0]!==g.bbox[2]&&g.bbox[1]!==g.bbox[3])return;if(typeof De=="number")return g.id.startsWith("poi.")||g.id.startsWith("address.")?ut:De;const q=g.id.replace(/\..*/,"");return(Array.isArray((Y=g.properties)==null?void 0:Y.categories)?g.properties.categories.reduce((oe,T)=>{const V=De[q+"."+T];return oe===void 0?V:V===void 0?oe:Math.max(oe,V)},void 0):void 0)??De[q]}function qr(g){t(0,G=v==="always"),t(14,R=void 0),t(57,N=void 0),t(15,z=-1),Zi(g[1].toFixed(6)+", "+Dn(g[0],[-180,180],!0).toFixed(6),!1,!0)}function Qr(g){if(!R)return;let q=g.key==="ArrowDown"?1:g.key==="ArrowUp"?-1:0;q&&(z===(fe?0:-1)&&q===-1&&t(15,z=R.length),t(15,z+=q),z>=R.length&&t(15,z=-1),z<0&&fe&&t(15,z=0),g.preventDefault())}function Ut(g=!0,q=!1){if(t(18,ge=void 0),re||q){if(Fe&&clearTimeout(Fe),W.length<L)return;const Y=W;Fe=window.setTimeout(()=>{Dt(Y).catch(oe=>t(18,ge=oe))},g?m:0)}else t(14,R=void 0),t(18,ge=void 0)}function Ft(g){t(57,N=g),t(1,W=g.place_name),t(15,z=-1)}const Hr=()=>he.focus();function Vr(g){ht[g?"unshift":"push"](()=>{he=g,t(17,he)})}function Yr(){W=this.value,t(1,W),t(13,Ue),t(28,a)}const Xr=()=>t(13,Ue=!0),Kr=()=>t(13,Ue=!1),Jr=()=>Ut(),$r=()=>{t(1,W=""),he.focus()},eo=()=>t(0,G=!G),to=()=>t(18,ge=void 0),io=g=>t(15,z=g),no=g=>Ft(g),ro=()=>{fe||t(15,z=-1)},oo=()=>{};return i.$$set=g=>{"class"in g&&t(2,s=g.class),"apiKey"in g&&t(26,c=g.apiKey),"bbox"in g&&t(27,u=g.bbox),"clearButtonTitle"in g&&t(3,h=g.clearButtonTitle),"clearOnBlur"in g&&t(28,a=g.clearOnBlur),"collapsed"in g&&t(4,f=g.collapsed),"country"in g&&t(29,d=g.country),"debounceSearch"in g&&t(30,m=g.debounceSearch),"enableReverse"in g&&t(5,v=g.enableReverse),"errorMessage"in g&&t(6,b=g.errorMessage),"filter"in g&&t(31,p=g.filter),"flyTo"in g&&t(32,_=g.flyTo),"fuzzyMatch"in g&&t(33,E=g.fuzzyMatch),"language"in g&&t(34,S=g.language),"limit"in g&&t(35,k=g.limit),"mapController"in g&&t(36,x=g.mapController),"minLength"in g&&t(37,L=g.minLength),"noResultsMessage"in g&&t(7,w=g.noResultsMessage),"placeholder"in g&&t(8,C=g.placeholder),"proximity"in g&&t(38,I=g.proximity),"reverseActive"in g&&t(0,G=g.reverseActive),"reverseButtonTitle"in g&&t(9,j=g.reverseButtonTitle),"searchValue"in g&&t(1,W=g.searchValue),"showFullGeometry"in g&&t(39,M=g.showFullGeometry),"showPlaceType"in g&&t(10,Z=g.showPlaceType),"showResultsWhileTyping"in g&&t(40,re=g.showResultsWhileTyping),"selectFirst"in g&&t(11,fe=g.selectFirst),"flyToSelected"in g&&t(41,Pt=g.flyToSelected),"markerOnSelected"in g&&t(42,st=g.markerOnSelected),"types"in g&&t(43,Re=g.types),"exhaustiveReverseGeocoding"in g&&t(44,Rt=g.exhaustiveReverseGeocoding),"excludeTypes"in g&&t(45,lt=g.excludeTypes),"zoom"in g&&t(46,De=g.zoom),"maxZoom"in g&&t(47,ut=g.maxZoom),"apiUrl"in g&&t(48,It=g.apiUrl),"fetchParameters"in g&&t(49,Ot=g.fetchParameters),"iconsBaseUrl"in g&&t(12,ji=g.iconsBaseUrl),"adjustUrlQuery"in g&&t(50,Wt=g.adjustUrlQuery),"$$scope"in g&&t(60,o=g.$$scope)},i.$$.update=()=>{if(i.$$.dirty[0]&32&&t(0,G=v==="always"),i.$$.dirty[0]&268443648&&setTimeout(()=>{t(16,ct=Ue),a&&!Ue&&t(1,W="")}),i.$$.dirty[0]&16386|i.$$.dirty[1]&64&&W.length<L&&(t(57,N=void 0),t(14,R=void 0),t(18,ge=void 0),t(56,H=R)),i.$$.dirty[1]&67109120&&M&&N&&!N.address&&N.geometry.type==="Point"&&N.place_type[0]!=="reverse"&&Dt(N.id,{byId:!0}).catch(g=>t(18,ge=g)),i.$$.dirty[1]&201326626&&(x&&N&&N.id!==At&&_&&(!N.bbox||N.bbox[0]===N.bbox[2]&&N.bbox[1]===N.bbox[3]?x.flyTo(N.center,Je(N)):x.fitBounds(Ze(N.bbox),50,Je(N)),t(14,R=void 0),t(56,H=void 0),t(15,z=-1)),t(58,At=N==null?void 0:N.id)),i.$$.dirty[0]&18432&&fe&&R!=null&&R.length&&t(15,z=0),i.$$.dirty[0]&2&&t(15,z=-1),i.$$.dirty[0]&16384|i.$$.dirty[1]&33554432&&H!==R&&t(56,H=void 0),i.$$.dirty[0]&81921|i.$$.dirty[1]&33554464&&x&&x.setEventHandler(g=>{switch(g.type){case"mapClick":G&&qr(g.coordinates);break;case"markerClick":{const q=R==null?void 0:R.find(Y=>Y.id===g.id);q&&Ft(q)}break;case"markerMouseEnter":H&&t(15,z=ct?(R==null?void 0:R.findIndex(q=>q.id===g.id))??-1:-1);break;case"markerMouseLeave":H&&t(15,z=-1);break}}),i.$$.dirty[0]&49152&&t(59,n=R==null?void 0:R[z]),i.$$.dirty[1]&268436514&&x&&n&&_&&Pt&&x.flyTo(n.center,Je(n)),i.$$.dirty[1]&2080&&(st||x==null||x.setMarkers(void 0,void 0)),i.$$.dirty[1]&301991968&&x&&st&&!H&&(x.setMarkers(n?[n]:void 0,void 0),x.setSelectedMarker(n?0:-1)),i.$$.dirty[1]&100663328&&x&&x.setMarkers(H,N),i.$$.dirty[0]&32768|i.$$.dirty[1]&33554464&&H&&x&&x.setSelectedMarker(z),i.$$.dirty[0]&2|i.$$.dirty[1]&32&&x){const g=Bt(W);x.setReverseMarker(g?[g.decimalLongitude,g.decimalLatitude]:void 0)}i.$$.dirty[1]&268435456&&Ne("select",n),i.$$.dirty[1]&67108864&&Ne("pick",N),i.$$.dirty[0]&81920&&Ne("optionsVisibilityChange",ct&&!!R),i.$$.dirty[0]&16384&&Ne("featuresListed",R),i.$$.dirty[1]&33554432&&Ne("featuresMarked",H),i.$$.dirty[0]&1&&Ne("reverseToggle",G),i.$$.dirty[0]&2&&Ne("queryChange",W),i.$$.dirty[0]&1|i.$$.dirty[1]&32&&x&&x.indicateReverse(G)},[G,W,s,h,f,v,b,w,C,j,Z,fe,ji,Ue,R,z,ct,he,ge,Ie,jr,Qi,Qr,Ut,Ft,l,c,u,a,d,m,p,_,E,S,k,x,L,I,M,re,Pt,st,Re,Rt,lt,De,ut,It,Ot,Wt,Ur,Fr,Zi,Gr,zr,H,N,At,n,o,r,Hr,Vr,Yr,Xr,Kr,Jr,$r,eo,to,io,no,ro,oo]}let nr=class extends Se{constructor(e){super(),Le(this,e,ir,tr,we,{ZOOM_DEFAULTS:25,class:2,apiKey:26,bbox:27,clearButtonTitle:3,clearOnBlur:28,collapsed:4,country:29,debounceSearch:30,enableReverse:5,errorMessage:6,filter:31,flyTo:32,fuzzyMatch:33,language:34,limit:35,mapController:36,minLength:37,noResultsMessage:7,placeholder:8,proximity:38,reverseActive:0,reverseButtonTitle:9,searchValue:1,showFullGeometry:39,showPlaceType:10,showResultsWhileTyping:40,selectFirst:11,flyToSelected:41,markerOnSelected:42,types:43,exhaustiveReverseGeocoding:44,excludeTypes:45,zoom:46,maxZoom:47,apiUrl:48,fetchParameters:49,iconsBaseUrl:12,adjustUrlQuery:50,focus:51,blur:52,setQuery:53,clearList:54,clearMap:55},null,[-1,-1,-1])}get ZOOM_DEFAULTS(){return this.$$.ctx[25]}get focus(){return this.$$.ctx[51]}get blur(){return this.$$.ctx[52]}get setQuery(){return this.$$.ctx[53]}get clearList(){return this.$$.ctx[54]}get clearMap(){return this.$$.ctx[55]}};function He(i,e,t={}){const n={type:"Feature"};return(t.id===0||t.id)&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.properties=e||{},n.geometry=i,n}function vt(i,e,t={}){for(const r of i){if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(r[r.length-1].length!==r[0].length)throw new Error("First and last Position are not equivalent.");for(let o=0;o<r[r.length-1].length;o++)if(r[r.length-1][o]!==r[0][o])throw new Error("First and last Position are not equivalent.")}return He({type:"Polygon",coordinates:i},e,t)}function Ve(i,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=i,t}function yi(i,e,t={}){return He({type:"MultiPolygon",coordinates:i},e,t)}function pi(i,e,t){if(i!==null)for(var n,r,o,l,s,c,u,h=0,a=0,f,d=i.type,m=d==="FeatureCollection",v=d==="Feature",b=m?i.features.length:1,p=0;p<b;p++){u=m?i.features[p].geometry:v?i.geometry:i,f=u?u.type==="GeometryCollection":!1,s=f?u.geometries.length:1;for(var _=0;_<s;_++){var E=0,S=0;if(l=f?u.geometries[_]:u,l!==null){c=l.coordinates;var k=l.type;switch(h=0,k){case null:break;case"Point":if(e(c,a,p,E,S)===!1)return!1;a++,E++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(e(c[n],a,p,E,S)===!1)return!1;a++,k==="MultiPoint"&&E++}k==="LineString"&&E++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(r=0;r<c[n].length-h;r++){if(e(c[n][r],a,p,E,S)===!1)return!1;a++}k==="MultiLineString"&&E++,k==="Polygon"&&S++}k==="Polygon"&&E++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(S=0,r=0;r<c[n].length;r++){for(o=0;o<c[n][r].length-h;o++){if(e(c[n][r][o],a,p,E,S)===!1)return!1;a++}S++}E++}break;case"GeometryCollection":for(n=0;n<l.geometries.length;n++)if(pi(l.geometries[n],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function bt(i,e){var t,n,r,o,l,s,c,u,h,a,f=0,d=i.type==="FeatureCollection",m=i.type==="Feature",v=d?i.features.length:1;for(t=0;t<v;t++){for(s=d?i.features[t].geometry:m?i.geometry:i,u=d?i.features[t].properties:m?i.properties:{},h=d?i.features[t].bbox:m?i.bbox:void 0,a=d?i.features[t].id:m?i.id:void 0,c=s?s.type==="GeometryCollection":!1,l=c?s.geometries.length:1,r=0;r<l;r++){if(o=c?s.geometries[r]:s,o===null){if(e(null,f,u,h,a)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,f,u,h,a)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(e(o.geometries[n],f,u,h,a)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function rr(i,e){bt(i,function(t,n,r,o,l){var s=t===null?null:t.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return e(He(t,r,{bbox:o,id:l}),n,0)===!1?!1:void 0}var c;switch(s){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var u=0;u<t.coordinates.length;u++){var h=t.coordinates[u],a={type:c,coordinates:h};if(e(He(a,r),n,u)===!1)return!1}})}function or(i,e={}){if(i.bbox!=null&&e.recompute!==!0)return i.bbox;const t=[1/0,1/0,-1/0,-1/0];return pi(i,n=>{t[0]>n[0]&&(t[0]=n[0]),t[1]>n[1]&&(t[1]=n[1]),t[2]<n[0]&&(t[2]=n[0]),t[3]<n[1]&&(t[3]=n[1])}),t}var wt=or;function sr(i){if(!i)throw new Error("geojson is required");switch(i.type){case"Feature":return vi(i);case"FeatureCollection":return lr(i);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return _t(i);default:throw new Error("unknown GeoJSON type")}}function vi(i){const e={type:"Feature"};return Object.keys(i).forEach(t=>{switch(t){case"type":case"properties":case"geometry":return;default:e[t]=i[t]}}),e.properties=bi(i.properties),i.geometry==null?e.geometry=null:e.geometry=_t(i.geometry),e}function bi(i){const e={};return i&&Object.keys(i).forEach(t=>{const n=i[t];typeof n=="object"?n===null?e[t]=null:Array.isArray(n)?e[t]=n.map(r=>r):e[t]=bi(n):e[t]=n}),e}function lr(i){const e={type:"FeatureCollection"};return Object.keys(i).forEach(t=>{switch(t){case"type":case"features":return;default:e[t]=i[t]}}),e.features=i.features.map(t=>vi(t)),e}function _t(i){const e={type:i.type};return i.bbox&&(e.bbox=i.bbox),i.type==="GeometryCollection"?(e.geometries=i.geometries.map(t=>_t(t)),e):(e.coordinates=wi(i.coordinates),e)}function wi(i){const e=i;return typeof e[0]!="object"?e.slice():e.map(t=>wi(t))}var ur=sr;/**
|
|
1
|
+
(function(O,z){typeof exports=="object"&&typeof module<"u"?z(exports,require("leaflet")):typeof define=="function"&&define.amd?define(["exports","leaflet"],z):(O=typeof globalThis<"u"?globalThis:O||self,z(O.leafletMaptilerGeocoder={},O.L))})(this,function(O,z){"use strict";var so=Object.defineProperty;var Hi=O=>{throw TypeError(O)};var lo=(O,z,X)=>z in O?so(O,z,{enumerable:!0,configurable:!0,writable:!0,value:X}):O[z]=X;var Ut=(O,z,X)=>lo(O,typeof z!="symbol"?z+"":z,X),Vi=(O,z,X)=>z.has(O)||Hi("Cannot "+X);var ue=(O,z,X)=>(Vi(O,z,"read from private field"),X?X.call(O):z.get(O)),Gt=(O,z,X)=>z.has(O)?Hi("Cannot add the same private member more than once"):z instanceof WeakSet?z.add(O):z.set(O,X),jt=(O,z,X,ie)=>(Vi(O,z,"write to private field"),ie?ie.call(O,X):z.set(O,X),X);var le,Te;function X(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const ie=X(z);function B(){}function Yi(i,e){for(const t in e)i[t]=e[t];return i}function qt(i){return i()}function Zt(){return Object.create(null)}function me(i){i.forEach(qt)}function Qt(i){return typeof i=="function"}function we(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let $e;function K(i,e){return i===e?!0:($e||($e=document.createElement("a")),$e.href=e,i===$e.href)}function Xi(i){return Object.keys(i).length===0}function Ki(i,e,t,n){if(i){const r=Ht(i,e,t,n);return i[0](r)}}function Ht(i,e,t,n){return i[1]&&n?Yi(t.ctx.slice(),i[1](n(e))):t.ctx}function Ji(i,e,t,n){if(i[2]&&n){const r=i[2](n(t));if(e.dirty===void 0)return r;if(typeof r=="object"){const o=[],l=Math.max(e.dirty.length,r.length);for(let s=0;s<l;s+=1)o[s]=e.dirty[s]|r[s];return o}return e.dirty|r}return e.dirty}function $i(i,e,t,n,r,o){if(r){const l=Ht(e,t,n,o);i.p(l,r)}}function en(i){if(i.ctx.length>32){const e=[],t=i.ctx.length/32;for(let n=0;n<t;n++)e[n]=-1;return e}return-1}function Vt(i){return i??""}function T(i,e){i.appendChild(e)}function U(i,e,t){i.insertBefore(e,t||null)}function D(i){i.parentNode&&i.parentNode.removeChild(i)}function W(i){return document.createElement(i)}function ae(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function _e(i){return document.createTextNode(i)}function ne(){return _e(" ")}function tn(){return _e("")}function $(i,e,t,n){return i.addEventListener(e,t,n),()=>i.removeEventListener(e,t,n)}function nn(i){return function(e){return e.preventDefault(),i.call(this,e)}}function y(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}function rn(i){return Array.from(i.childNodes)}function Ue(i,e){e=""+e,i.data!==e&&(i.data=e)}function Yt(i,e){i.value=e??""}function oe(i,e,t){i.classList.toggle(e,!!t)}function on(i,e,{bubbles:t=!1,cancelable:n=!1}={}){return new CustomEvent(i,{detail:e,bubbles:t,cancelable:n})}let Ge;function je(i){Ge=i}function Xt(){if(!Ge)throw new Error("Function called outside component initialization");return Ge}function sn(i){Xt().$$.on_destroy.push(i)}function ln(){const i=Xt();return(e,t,{cancelable:n=!1}={})=>{const r=i.$$.callbacks[e];if(r){const o=on(e,t,{cancelable:n});return r.slice().forEach(l=>{l.call(i,o)}),!o.defaultPrevented}return!0}}function Kt(i,e){const t=i.$$.callbacks[e.type];t&&t.slice().forEach(n=>n.call(this,e))}const Oe=[],dt=[];let Ae=[];const Jt=[],un=Promise.resolve();let ht=!1;function an(){ht||(ht=!0,un.then($t))}function gt(i){Ae.push(i)}const mt=new Set;let We=0;function $t(){if(We!==0)return;const i=Ge;do{try{for(;We<Oe.length;){const e=Oe[We];We++,je(e),cn(e.$$)}}catch(e){throw Oe.length=0,We=0,e}for(je(null),Oe.length=0,We=0;dt.length;)dt.pop()();for(let e=0;e<Ae.length;e+=1){const t=Ae[e];mt.has(t)||(mt.add(t),t())}Ae.length=0}while(Oe.length);for(;Jt.length;)Jt.pop()();ht=!1,mt.clear(),je(i)}function cn(i){if(i.fragment!==null){i.update(),me(i.before_update);const e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(gt)}}function fn(i){const e=[],t=[];Ae.forEach(n=>i.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),Ae=e}const et=new Set;let Pe;function tt(){Pe={r:0,c:[],p:Pe}}function it(){Pe.r||me(Pe.c),Pe=Pe.p}function q(i,e){i&&i.i&&(et.delete(i),i.i(e))}function V(i,e,t,n){if(i&&i.o){if(et.has(i))return;et.add(i),Pe.c.push(()=>{et.delete(i),n&&(t&&i.d(1),n())}),i.o(e)}else n&&n()}function ei(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function dn(i,e){V(i,1,1,()=>{e.delete(i.key)})}function hn(i,e,t,n,r,o,l,s,c,u,d,a){let f=i.length,h=o.length,g=f;const v={};for(;g--;)v[i[g].key]=g;const w=[],p=new Map,S=new Map,L=[];for(g=h;g--;){const b=a(r,o,g),_=t(b);let C=l.get(_);C?L.push(()=>C.p(b,e)):(C=u(_,b),C.c()),p.set(_,w[g]=C),_ in v&&S.set(_,Math.abs(g-v[_]))}const E=new Set,M=new Set;function k(b){q(b,1),b.m(s,d),l.set(b.key,b),d=b.first,h--}for(;f&&h;){const b=w[h-1],_=i[f-1],C=b.key,I=_.key;b===_?(d=b.first,f--,h--):p.has(I)?!l.has(C)||E.has(C)?k(b):M.has(I)?f--:S.get(C)>S.get(I)?(M.add(C),k(b)):(E.add(I),f--):(c(_,l),f--)}for(;f--;){const b=i[f];p.has(b.key)||c(b,l)}for(;h;)k(w[h-1]);return me(L),w}function Ee(i){i&&i.c()}function ye(i,e,t){const{fragment:n,after_update:r}=i.$$;n&&n.m(e,t),gt(()=>{const o=i.$$.on_mount.map(qt).filter(Qt);i.$$.on_destroy?i.$$.on_destroy.push(...o):me(o),i.$$.on_mount=[]}),r.forEach(gt)}function pe(i,e){const t=i.$$;t.fragment!==null&&(fn(t.after_update),me(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function gn(i,e){i.$$.dirty[0]===-1&&(Oe.push(i),an(),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function Le(i,e,t,n,r,o,l=null,s=[-1]){const c=Ge;je(i);const u=i.$$={fragment:null,ctx:[],props:o,update:B,not_equal:r,bound:Zt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:Zt(),dirty:s,skip_bound:!1,root:e.target||c.$$.root};l&&l(u.root);let d=!1;if(u.ctx=t?t(i,e.props||{},(a,f,...h)=>{const g=h.length?h[0]:f;return u.ctx&&r(u.ctx[a],u.ctx[a]=g)&&(!u.skip_bound&&u.bound[a]&&u.bound[a](g),d&&gn(i,a)),f}):[],u.update(),d=!0,me(u.before_update),u.fragment=n?n(u.ctx):!1,e.target){if(e.hydrate){const a=rn(e.target);u.fragment&&u.fragment.l(a),a.forEach(D)}else u.fragment&&u.fragment.c();e.intro&&q(i.$$.fragment),ye(i,e.target,e.anchor),$t()}je(c)}class Se{constructor(){Ut(this,"$$");Ut(this,"$$set")}$destroy(){pe(this,1),this.$destroy=B}$on(e,t){if(!Qt(t))return B;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const r=n.indexOf(t);r!==-1&&n.splice(r,1)}}$set(e){this.$$set&&!Xi(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const mn="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(mn);function yn(i){let e,t;return{c(){e=ae("svg"),t=ae("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(n,r){U(n,e,r),T(e,t)},p:B,i:B,o:B,d(n){n&&D(e)}}}class ti extends Se{constructor(e){super(),Le(this,e,null,yn,we,{})}}function pn(i){let e,t;return{c(){e=ae("svg"),t=ae("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(n,r){U(n,e,r),T(e,t)},p:B,i:B,o:B,d(n){n&&D(e)}}}class ii extends Se{constructor(e){super(),Le(this,e,null,pn,we,{})}}function bn(i){let e,t;return{c(){e=W("img"),K(e.src,t=i[3]+"area.svg")||y(e,"src",t),y(e,"alt",i[6]),y(e,"class","svelte-ltkwvy")},m(n,r){U(n,e,r)},p(n,r){r&8&&!K(e.src,t=n[3]+"area.svg")&&y(e,"src",t),r&64&&y(e,"alt",n[6])},d(n){n&&D(e)}}}function vn(i){let e,t;return{c(){e=W("img"),K(e.src,t=i[3]+"reverse.svg")||y(e,"src",t),y(e,"alt",i[6]),y(e,"class","svelte-ltkwvy")},m(n,r){U(n,e,r)},p(n,r){r&8&&!K(e.src,t=n[3]+"reverse.svg")&&y(e,"src",t),r&64&&y(e,"alt",n[6])},d(n){n&&D(e)}}}function wn(i){let e,t;return{c(){e=W("img"),K(e.src,t=i[3]+"poi.svg")||y(e,"src",t),y(e,"alt",i[6]),y(e,"class","svelte-ltkwvy")},m(n,r){U(n,e,r)},p(n,r){r&8&&!K(e.src,t=n[3]+"poi.svg")&&y(e,"src",t),r&64&&y(e,"alt",n[6])},d(n){n&&D(e)}}}function _n(i){let e,t;return{c(){e=W("img"),K(e.src,t=i[3]+"postal_code.svg")||y(e,"src",t),y(e,"alt",i[6]),y(e,"class","svelte-ltkwvy")},m(n,r){U(n,e,r)},p(n,r){r&8&&!K(e.src,t=n[3]+"postal_code.svg")&&y(e,"src",t),r&64&&y(e,"alt",n[6])},d(n){n&&D(e)}}}function En(i){let e,t;return{c(){e=W("img"),K(e.src,t=i[3]+"street.svg")||y(e,"src",t),y(e,"alt",i[6]),y(e,"class","svelte-ltkwvy")},m(n,r){U(n,e,r)},p(n,r){r&8&&!K(e.src,t=n[3]+"street.svg")&&y(e,"src",t),r&64&&y(e,"alt",n[6])},d(n){n&&D(e)}}}function Ln(i){let e,t;return{c(){e=W("img"),K(e.src,t=i[3]+"road.svg")||y(e,"src",t),y(e,"alt",i[6]),y(e,"class","svelte-ltkwvy")},m(n,r){U(n,e,r)},p(n,r){r&8&&!K(e.src,t=n[3]+"road.svg")&&y(e,"src",t),r&64&&y(e,"alt",n[6])},d(n){n&&D(e)}}}function Sn(i){let e,t;return{c(){e=W("img"),K(e.src,t=i[3]+"housenumber.svg")||y(e,"src",t),y(e,"alt",i[6]),y(e,"class","svelte-ltkwvy")},m(n,r){U(n,e,r)},p(n,r){r&8&&!K(e.src,t=n[3]+"housenumber.svg")&&y(e,"src",t),r&64&&y(e,"alt",n[6])},d(n){n&&D(e)}}}function xn(i){let e,t,n,r;return{c(){e=W("img"),K(e.src,t=i[5])||y(e,"src",t),y(e,"alt",i[4]),y(e,"class","svelte-ltkwvy")},m(o,l){U(o,e,l),n||(r=$(e,"error",i[14]),n=!0)},p(o,l){l&32&&!K(e.src,t=o[5])&&y(e,"src",t),l&16&&y(e,"alt",o[4])},d(o){o&&D(e),n=!1,r()}}}function ni(i){let e,t;return{c(){e=W("span"),t=_e(i[6]),y(e,"class","secondary svelte-ltkwvy")},m(n,r){U(n,e,r),T(e,t)},p(n,r){r&64&&Ue(t,n[6])},d(n){n&&D(e)}}}function Mn(i){let e,t,n,r,o,l,s,c,u,d=(i[7]?i[0].place_name:i[0].place_name.replace(/,.*/,""))+"",a,f,h=i[2]==="always"||i[2]!=="never"&&!i[0].address&&!i[0].id.startsWith("road.")&&!i[0].id.startsWith("address.")&&!i[0].id.startsWith("postal_code.")&&(!i[0].id.startsWith("poi.")||!i[5])&&!i[7],g,v,w=(i[7]?"":i[0].place_name.replace(/[^,]*,?\s*/,""))+"",p,S,L;function E(_,C){return C&1&&(t=null),C&1&&(n=null),C&1&&(r=null),C&1&&(o=null),_[5]?xn:_[0].address?Sn:(t==null&&(t=!!_[0].id.startsWith("road.")),t?Ln:(n==null&&(n=!!_[0].id.startsWith("address.")),n?En:(r==null&&(r=!!_[0].id.startsWith("postal_code.")),r?_n:(o==null&&(o=!!_[0].id.startsWith("poi.")),o?wn:_[7]?vn:bn))))}let M=E(i,-1),k=M(i),b=h&&ni(i);return{c(){e=W("li"),k.c(),l=ne(),s=W("span"),c=W("span"),u=W("span"),a=_e(d),f=ne(),b&&b.c(),g=ne(),v=W("span"),p=_e(w),y(u,"class","primary svelte-ltkwvy"),y(c,"class","svelte-ltkwvy"),y(v,"class","line2 svelte-ltkwvy"),y(s,"class","texts svelte-ltkwvy"),y(e,"tabindex","0"),y(e,"data-selected",i[1]),y(e,"class","svelte-ltkwvy"),oe(e,"selected",i[1])},m(_,C){U(_,e,C),k.m(e,null),T(e,l),T(e,s),T(s,c),T(c,u),T(u,a),T(c,f),b&&b.m(c,null),T(s,g),T(s,v),T(v,p),S||(L=[$(e,"mouseenter",i[12]),$(e,"focus",i[13])],S=!0)},p(_,[C]){M===(M=E(_,C))&&k?k.p(_,C):(k.d(1),k=M(_),k&&(k.c(),k.m(e,l))),C&1&&d!==(d=(_[7]?_[0].place_name:_[0].place_name.replace(/,.*/,""))+"")&&Ue(a,d),C&37&&(h=_[2]==="always"||_[2]!=="never"&&!_[0].address&&!_[0].id.startsWith("road.")&&!_[0].id.startsWith("address.")&&!_[0].id.startsWith("postal_code.")&&(!_[0].id.startsWith("poi.")||!_[5])&&!_[7]),h?b?b.p(_,C):(b=ni(_),b.c(),b.m(c,null)):b&&(b.d(1),b=null),C&1&&w!==(w=(_[7]?"":_[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&Ue(p,w),C&2&&y(e,"data-selected",_[1]),C&2&&oe(e,"selected",_[1])},i:B,o:B,d(_){_&&D(e),k.d(),b&&b.d(),S=!1,me(L)}}}function Cn(i,e,t){var L;let n,r,{feature:o}=e,{selected:l=!1}=e,{showPlaceType:s}=e,{missingIconsCache:c}=e,{iconsBaseUrl:u}=e;const d=(L=o.properties)==null?void 0:L.categories;let a,f,h=0,g=o.place_type[0]==="reverse";function v(){f&&c.add(f),t(10,h++,h)}function w(E){Kt.call(this,i,E)}function p(E){Kt.call(this,i,E)}const S=()=>v();return i.$$set=E=>{"feature"in E&&t(0,o=E.feature),"selected"in E&&t(1,l=E.selected),"showPlaceType"in E&&t(2,s=E.showPlaceType),"missingIconsCache"in E&&t(9,c=E.missingIconsCache),"iconsBaseUrl"in E&&t(3,u=E.iconsBaseUrl)},i.$$.update=()=>{var E,M,k,b;if(i.$$.dirty&3640)do t(11,n--,n),t(4,a=d==null?void 0:d[n]),t(5,f=a?u+a.replace(/ /g,"_")+".svg":void 0);while(n>-1&&(!f||c.has(f)));i.$$.dirty&1&&t(6,r=((M=(E=o.properties)==null?void 0:E.categories)==null?void 0:M.join(", "))??((b=(k=o.properties)==null?void 0:k.place_type_name)==null?void 0:b[0])??o.place_type[0])},t(11,n=(d==null?void 0:d.length)??0),[o,l,s,u,a,f,r,g,v,c,h,n,w,p,S]}class kn extends Se{constructor(e){super(),Le(this,e,Cn,Mn,we,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function Nn(i){let e;return{c(){e=W("div"),e.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',y(e,"class","svelte-7cmwmc")},m(t,n){U(t,e,n)},p:B,i:B,o:B,d(t){t&&D(e)}}}class Pn extends Se{constructor(e){super(),Le(this,e,null,Nn,we,{})}}function Tn(i){let e,t,n;return{c(){e=ae("svg"),t=ae("path"),y(t,"stroke-width","4"),y(t,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),y(t,"class","svelte-gzo3ar"),y(e,"width",n=i[0]==="list"?20:void 0),y(e,"viewBox","0 0 70 85"),y(e,"fill","none"),y(e,"class","svelte-gzo3ar"),oe(e,"in-map",i[0]!=="list"),oe(e,"list-icon",i[0]==="list")},m(r,o){U(r,e,o),T(e,t)},p(r,[o]){o&1&&n!==(n=r[0]==="list"?20:void 0)&&y(e,"width",n),o&1&&oe(e,"in-map",r[0]!=="list"),o&1&&oe(e,"list-icon",r[0]==="list")},i:B,o:B,d(r){r&&D(e)}}}function Rn(i,e,t){let{displayIn:n}=e;return i.$$set=r=>{"displayIn"in r&&t(0,n=r.displayIn)},[n]}class In extends Se{constructor(e){super(),Le(this,e,Rn,Tn,we,{displayIn:0})}}function On(i){let e,t;return{c(){e=ae("svg"),t=ae("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(n,r){U(n,e,r),T(e,t)},p:B,i:B,o:B,d(n){n&&D(e)}}}class An extends Se{constructor(e){super(),Le(this,e,null,On,we,{})}}function Wn(i){let e,t,n;return{c(){e=ae("svg"),t=ae("circle"),n=ae("path"),y(t,"cx","4.789"),y(t,"cy","4.787"),y(t,"r","3.85"),y(t,"class","svelte-1aq105l"),y(n,"d","M12.063 12.063 7.635 7.635"),y(n,"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){U(r,e,o),T(e,t),T(e,n)},p:B,i:B,o:B,d(r){r&&D(e)}}}class zn extends Se{constructor(e){super(),Le(this,e,null,Wn,we,{})}}function Bn(i,e,t){const n=e[1],r=e[0],o=n-r;return i===n&&t?i:((i-r)%o+o)%o+r}function qe(i){const e=[...i];return e[2]<e[0]&&(Math.abs((e[0]+e[2]+360)/2)>Math.abs((e[0]-360+e[2])/2)?e[0]-=360:e[2]+=360),e}let Ze;async function Dn(i,e,t){const n=i==null?void 0:i.getCenterAndZoom();for(const r of e??[])if(!(n&&(r.minZoom!=null&&r.minZoom>n[0]||r.maxZoom!=null&&r.maxZoom<n[0]))){if(r.type==="fixed")return r.coordinates.join(",");e:if(r.type==="client-geolocation"){if(Ze&&r.cachedLocationExpiry&&Ze.time+r.cachedLocationExpiry>Date.now()){if(!Ze.coords)break e;return Ze.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&&(Ze={time:Date.now(),coords:o})}if(t.signal.aborted)return}if(r.type==="server-geolocation")return"ip";if(n&&r.type==="map-center")return n[1].toFixed(6)+","+n[2].toFixed(6)}}const Fn=/^(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,ri=/^([+-]?[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,})$/,oi=/^(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,si=/^(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,li=/^(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,ui=/^(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 Un(i){if(!["DMS","DM","DD"].includes(i))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){const e=this.decimalCoordinates.split(",").map(h=>Number(h.trim())),t=Number(e[0]),n=Number(e[1]),r=Math.abs(t),o=Math.abs(n),l=t>0?"N":"S",s=n>0?"E":"W";let c;i=="DD"&&(c=`${r}° ${l}, ${o}° ${s}`);const u=Math.floor(r),d=Math.floor(o),a=(r-u)*60,f=(o-d)*60;if(i=="DM"){let h=ai(a,3).toFixed(3).padStart(6,"0"),g=ai(f,3).toFixed(3).padStart(6,"0");h.endsWith(".000")&&g.endsWith(".000")&&(h=h.replace(/\.000$/,""),g=g.replace(/\.000$/,"")),c=`${u}° ${h}' ${l}, ${d}° ${g}' ${s}`}if(i=="DMS"){const h=Math.floor(a),g=Math.floor(f);let v=((a-h)*60).toFixed(1).padStart(4,"0"),w=((f-g)*60).toFixed(1).padStart(4,"0");const p=h.toString().padStart(2,"0"),S=g.toString().padStart(2,"0");v.endsWith(".0")&&w.endsWith(".0")&&(v=v.replace(/\.0$/,""),w=w.replace(/\.0$/,"")),c=`${u}° ${p}' ${v}" ${l}, ${d}° ${S}' ${w}" ${s}`}return c}else throw new Error("no decimal coordinates to convert")}function ai(i,e){const t=Math.pow(10,e);return Math.round((i+Number.EPSILON)*t)/t}function yt(i,e){e||(e=5),i=i.replace(/\s+/g," ").trim();let t=null,n=null,r="",o="",l=null,s=[],c=!1;if(Fn.test(i))throw new Error("invalid coordinate value");if(ri.test(i))if(s=ri.exec(i),c=Qe(s),c)t=Math.abs(s[1])+s[2]/60,Number(s[1])<0&&(t*=-1),n=Math.abs(s[3])+s[4]/60,Number(s[3])<0&&(n*=-1),l="DM";else throw new Error("invalid coordinate format");else if(oi.test(i))if(s=oi.exec(i),c=Qe(s),c){if(t=s[2],n=s[6],t.includes(",")&&(t=t.replace(",",".")),n.includes(",")&&(n=n.replace(",",".")),l="DD",Number(Math.round(t))==Number(t))throw new Error("integer only coordinate provided");if(Number(Math.round(n))==Number(n))throw new Error("integer only coordinate provided");s[1]?(r=s[1],o=s[5]):s[4]&&(r=s[4],o=s[8])}else throw new Error("invalid decimal coordinate format");else if(si.test(i))if(s=si.exec(i),c=Qe(s),c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,l="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,l="DMS"),parseInt(s[2])<0&&(t=-1*t),n=Math.abs(parseInt(s[9])),s[11]&&(n+=s[11]/60),s[13]&&(n+=s[13].replace(",",".")/3600),parseInt(s[9])<0&&(n=-1*n),s[1]?(r=s[1],o=s[8]):s[7]&&(r=s[7],o=s[14]);else throw new Error("invalid DMS coordinates format");else if(li.test(i))if(s=li.exec(i),c=Qe(s),c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,l="DM"),s[6]&&(t+=s[6]/3600,l="DMS"),parseInt(s[2])<0&&(t=-1*t),n=Math.abs(parseInt(s[10])),s[12]&&(n+=s[12]/60),s[14]&&(n+=s[14]/3600),parseInt(s[10])<0&&(n=-1*n),s[1]?(r=s[1],o=s[9]):s[8]&&(r=s[8],o=s[16]);else throw new Error("invalid DMS coordinates format");else if(ui.test(i)){if(s=ui.exec(i),c=Qe(s),s.filter(u=>u).length<=5)throw new Error("invalid coordinates format");if(c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4].replace(",",".")/60,l="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,l="DMS"),parseInt(s[2])<0&&(t=-1*t),n=Math.abs(parseInt(s[10])),s[12]&&(n+=s[12].replace(",",".")/60),s[14]&&(n+=s[14].replace(",",".")/3600),parseInt(s[10])<0&&(n=-1*n),s[1]?(r=s[1],o=s[9]):s[8]&&(r=s[8],o=s[16]);else throw new Error("invalid coordinates format")}if(c){if(Math.abs(n)>=180)throw new Error("invalid longitude value");if(Math.abs(t)>=90)throw new Error("invalid latitude value");if(r&&!o||!r&&o)throw new Error("invalid coordinates value");if(r&&r==o)throw new Error("invalid coordinates format");t.toString().includes(",")&&(t=t.replace(",",".")),n.toString().includes(",")&&(n=n.replace(",","."));let u=/S|SOUTH/i;u.test(r)&&t>0&&(t=-1*t),u=/W|WEST/i,u.test(o)&&n>0&&(n=-1*n);const d=s[0].trim();let a,f;const h=/[,/;\u0020]/g,g=d.match(h);if(g==null){const p=Math.floor(i.length/2);a=d.substring(0,p).trim(),f=d.substring(p).trim()}else{let p;g.length%2==1?p=Math.floor(g.length/2):p=g.length/2-1;let S=0;if(p==0)S=d.indexOf(g[0]),a=d.substring(0,S).trim(),f=d.substring(S+1).trim();else{let L=0,E=0;for(;L<=p;)S=d.indexOf(g[L],E),E=S+1,L++;a=d.substring(0,S).trim(),f=d.substring(S+1).trim()}}const v=a.split(".");if(v.length==2&&v[1]==0&&v[1].length!=2)throw new Error("invalid coordinates format");const w=f.split(".");if(w.length==2&&w[1]==0&&w[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(a)||/^\d+$/.test(f))throw new Error("degree only coordinate/s provided");return t=Number(Number(t).toFixed(e)),n=Number(Number(n).toFixed(e)),Object.freeze({verbatimCoordinates:d,verbatimLatitude:a,verbatimLongitude:f,decimalLatitude:t,decimalLongitude:n,decimalCoordinates:`${t},${n}`,originalFormat:l,closeEnough:Gn,toCoordinateFormat:Un})}else throw new Error("coordinates pattern match failed")}function Qe(i){if(!isNaN(i[0]))return!1;const e=[...i];if(e.shift(),e.length%2>0)return!1;const t=/^[-+]?\d+([\.,]\d+)?$/,n=/[eastsouthnorthwest]+/i,r=e.length/2;for(let o=0;o<r;o++){const l=e[o],s=e[o+r],c=t.test(l)&&t.test(s),u=n.test(l)&&n.test(s),d=l==s;if(!(l==null&&s==null)){if(l==null||s==null)return!1;if(c||u||d)continue;return!1}}return!0}function ci(i,e){const t=Math.abs(i-e);return Number(t.toFixed(6))<=1e-5}function Gn(i){if(!i)throw new Error("coords must be provided");if(i.includes(",")){const e=i.split(",");if(Number(e[0])==NaN||Number(e[1])==NaN)throw new Error("coords are not valid decimals");return ci(this.decimalLatitude,Number(e[0]))&&ci(this.decimalLongitude,e[1])}else throw new Error("coords being tested must be separated by a comma")}const jn=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});yt.to=jn;const qn=[{verbatimCoordinates:"40.123, -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:'40° 7´ 22.8" N 74° 7´ 22.8" W',verbatimLatitude:'40° 7´ 22.8" N',verbatimLongitude:'74° 7´ 22.8" W'},{verbatimCoordinates:"40° 7.38’ , -74° 7.38’",verbatimLatitude:"40° 7.38’",verbatimLongitude:"-74° 7.38’"},{verbatimCoordinates:"N40°7’22.8’’, W74°7’22.8’’",verbatimLatitude:"N40°7’22.8’’",verbatimLongitude:"W74°7’22.8’’"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:`40°7'22.8"N, 74°7'22.8"W`,verbatimLatitude:`40°7'22.8"N`,verbatimLongitude:`74°7'22.8"W`},{verbatimCoordinates:"40 7 22.8, -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"},{verbatimCoordinates:"40.123 -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123°,-74.123°",verbatimLatitude:"40.123°",verbatimLongitude:"-74.123°"},{verbatimCoordinates:"40.123N74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"4007.38N7407.38W",verbatimLatitude:"4007.38N",verbatimLongitude:"7407.38W"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:"400722.8N740722.8W",verbatimLatitude:"400722.8N",verbatimLongitude:"740722.8W"},{verbatimCoordinates:"N 40 7.38 W 74 7.38",verbatimLatitude:"N 40 7.38",verbatimLongitude:"W 74 7.38"},{verbatimCoordinates:"40:7:22.8N 74:7:22.8W",verbatimLatitude:"40:7:22.8N",verbatimLongitude:"74:7:22.8W"},{verbatimCoordinates:"40:7:23N,74:7:23W",verbatimLatitude:"40:7:23N",verbatimLongitude:"74:7:23W",decimalLatitude:40.1230555555,decimalLongitude:-74.1230555555},{verbatimCoordinates:'40°7’23"N 74°7’23"W',verbatimLatitude:'40°7’23"N',verbatimLongitude:'74°7’23"W',decimalLatitude:40.1230555555,decimalLongitude:-74.12305555555555},{verbatimCoordinates:'40°7’23"S 74°7’23"E',verbatimLatitude:'40°7’23"S',verbatimLongitude:'74°7’23"E',decimalLatitude:-40.1230555555,decimalLongitude:74.12305555555555},{verbatimCoordinates:'40°7’23" -74°7’23"',verbatimLatitude:'40°7’23"',verbatimLongitude:'-74°7’23"',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:'40d 7’ 23" N 74d 7’ 23" W',verbatimLatitude:'40d 7’ 23" N',verbatimLongitude:'74d 7’ 23" W',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:"40.123N 74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40 7 22.8; -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"}],Zn={decimalLatitude:40.123,decimalLongitude:-74.123},Qn=[{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}],Hn=[{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 Vn(){const i=[];return qn.forEach(e=>{e.decimalLatitude?i.push(e):i.push({...e,...Zn})}),[...i,...Qn,...Hn]}const Yn=Vn();yt.formats=Yn.map(i=>i.verbatimCoordinates);const Xn=yt;function fi(i,e,t){const n=i.slice();return n[84]=e[t],n[86]=t,n}function di(i){let e,t;return e=new Pn({}),{c(){Ee(e.$$.fragment)},m(n,r){ye(e,n,r),t=!0},i(n){t||(q(e.$$.fragment,n),t=!0)},o(n){V(e.$$.fragment,n),t=!1},d(n){pe(e,n)}}}function hi(i){let e,t,n,r,o;return t=new An({}),{c(){e=W("button"),Ee(t.$$.fragment),y(e,"type","button"),y(e,"title",i[9]),y(e,"class","svelte-bz0zu3"),oe(e,"active",i[0])},m(l,s){U(l,e,s),ye(t,e,null),n=!0,r||(o=$(e,"click",i[69]),r=!0)},p(l,s){(!n||s[0]&512)&&y(e,"title",l[9]),(!n||s[0]&1)&&oe(e,"active",l[0])},i(l){n||(q(t.$$.fragment,l),n=!0)},o(l){V(t.$$.fragment,l),n=!1},d(l){l&&D(e),pe(t),r=!1,o()}}}function Kn(i){let e,t=[],n=new Map,r,o,l,s=ei(i[14]);const c=u=>u[84].id+(u[84].address?","+u[84].address:"");for(let u=0;u<s.length;u+=1){let d=fi(i,s,u),a=c(d);n.set(a,t[u]=gi(a,d))}return{c(){e=W("ul");for(let u=0;u<t.length;u+=1)t[u].c();y(e,"class","options svelte-bz0zu3")},m(u,d){U(u,e,d);for(let a=0;a<t.length;a+=1)t[a]&&t[a].m(e,null);r=!0,o||(l=[$(e,"mouseleave",i[73]),$(e,"blur",i[74])],o=!0)},p(u,d){d[0]&17880064&&(s=ei(u[14]),tt(),t=hn(t,d,c,1,u,s,n,e,dn,gi,null,fi),it())},i(u){if(!r){for(let d=0;d<s.length;d+=1)q(t[d]);r=!0}},o(u){for(let d=0;d<t.length;d+=1)V(t[d]);r=!1},d(u){u&&D(e);for(let d=0;d<t.length;d+=1)t[d].d();o=!1,me(l)}}}function Jn(i){let e,t,n,r,o,l;return t=new ii({}),{c(){e=W("div"),Ee(t.$$.fragment),n=ne(),r=W("div"),o=_e(i[7]),y(r,"class","svelte-bz0zu3"),y(e,"class","no-results svelte-bz0zu3")},m(s,c){U(s,e,c),ye(t,e,null),T(e,n),T(e,r),T(r,o),l=!0},p(s,c){(!l||c[0]&128)&&Ue(o,s[7])},i(s){l||(q(t.$$.fragment,s),l=!0)},o(s){V(t.$$.fragment,s),l=!1},d(s){s&&D(e),pe(t)}}}function $n(i){let e="",t;return{c(){t=_e(e)},m(n,r){U(n,t,r)},p:B,i:B,o:B,d(n){n&&D(t)}}}function er(i){let e,t,n,r,o,l,s,c,u,d,a;return t=new ii({}),c=new ti({}),{c(){e=W("div"),Ee(t.$$.fragment),n=ne(),r=W("div"),o=_e(i[6]),l=ne(),s=W("button"),Ee(c.$$.fragment),y(r,"class","svelte-bz0zu3"),y(s,"class","svelte-bz0zu3"),y(e,"class","error svelte-bz0zu3")},m(f,h){U(f,e,h),ye(t,e,null),T(e,n),T(e,r),T(r,o),T(e,l),T(e,s),ye(c,s,null),u=!0,d||(a=$(s,"click",i[70]),d=!0)},p(f,h){(!u||h[0]&64)&&Ue(o,f[6])},i(f){u||(q(t.$$.fragment,f),q(c.$$.fragment,f),u=!0)},o(f){V(t.$$.fragment,f),V(c.$$.fragment,f),u=!1},d(f){f&&D(e),pe(t),pe(c),d=!1,a()}}}function gi(i,e){let t,n,r;function o(){return e[71](e[86])}function l(){return e[72](e[84])}return n=new kn({props:{feature:e[84],showPlaceType:e[10],selected:e[15]===e[86],missingIconsCache:e[20],iconsBaseUrl:e[12]}}),n.$on("mouseenter",o),n.$on("focus",l),{key:i,first:null,c(){t=tn(),Ee(n.$$.fragment),this.first=t},m(s,c){U(s,t,c),ye(n,s,c),r=!0},p(s,c){e=s;const u={};c[0]&16384&&(u.feature=e[84]),c[0]&1024&&(u.showPlaceType=e[10]),c[0]&49152&&(u.selected=e[15]===e[86]),c[0]&4096&&(u.iconsBaseUrl=e[12]),n.$set(u)},i(s){r||(q(n.$$.fragment,s),r=!0)},o(s){V(n.$$.fragment,s),r=!1},d(s){s&&D(t),pe(n,s)}}}function tr(i){let e,t,n,r,o,l,s,c,u,d,a,f,h,g,v,w,p,S,L,E,M,k=!1;o=new zn({}),a=new ti({});let b=i[19]&&di(),_=i[5]==="button"&&hi(i);const C=i[61].default,I=Ki(C,i,i[60],null),Y=[er,$n,Jn,Kn],A=[];function te(x,F){var fe,ve;return x[18]?0:x[16]?((fe=x[14])==null?void 0:fe.length)===0?2:x[16]&&((ve=x[14])!=null&&ve.length)?3:-1:1}return~(w=te(i))&&(p=A[w]=Y[w](i)),{c(){e=ne(),t=W("form"),n=W("div"),r=W("button"),Ee(o.$$.fragment),l=ne(),s=W("input"),c=ne(),u=W("div"),d=W("button"),Ee(a.$$.fragment),f=ne(),b&&b.c(),h=ne(),_&&_.c(),g=ne(),I&&I.c(),v=ne(),p&&p.c(),y(r,"class","search-button svelte-bz0zu3"),y(r,"type","button"),y(s,"placeholder",i[8]),y(s,"aria-label",i[8]),y(s,"class","svelte-bz0zu3"),y(d,"type","button"),y(d,"title",i[3]),y(d,"class","svelte-bz0zu3"),y(u,"class","clear-button-container svelte-bz0zu3"),oe(u,"displayable",i[1]!==""),y(n,"class","input-group svelte-bz0zu3"),y(t,"tabindex","0"),y(t,"class",S=Vt(i[2])+" svelte-bz0zu3"),oe(t,"can-collapse",i[4]&&i[1]==="")},m(x,F){U(x,e,F),U(x,t,F),T(t,n),T(n,r),ye(o,r,null),T(n,l),T(n,s),i[63](s),Yt(s,i[1]),T(n,c),T(n,u),T(u,d),ye(a,d,null),T(u,f),b&&b.m(u,null),T(n,h),_&&_.m(n,null),T(n,g),I&&I.m(n,null),T(t,v),~w&&A[w].m(t,null),L=!0,E||(M=[$(r,"click",i[62]),$(s,"input",i[64]),$(s,"focus",i[65]),$(s,"blur",i[66]),$(s,"keydown",i[22]),$(s,"input",i[67]),$(d,"click",i[68]),$(t,"submit",nn(i[21]))],E=!0)},p(x,F){(!L||F[0]&256)&&y(s,"placeholder",x[8]),(!L||F[0]&256)&&y(s,"aria-label",x[8]),F[0]&2&&s.value!==x[1]&&Yt(s,x[1]),(!L||F[0]&8)&&y(d,"title",x[3]),x[19]?b?F[0]&524288&&q(b,1):(b=di(),b.c(),q(b,1),b.m(u,null)):b&&(tt(),V(b,1,1,()=>{b=null}),it()),(!L||F[0]&2)&&oe(u,"displayable",x[1]!==""),x[5]==="button"?_?(_.p(x,F),F[0]&32&&q(_,1)):(_=hi(x),_.c(),q(_,1),_.m(n,g)):_&&(tt(),V(_,1,1,()=>{_=null}),it()),I&&I.p&&(!L||F[1]&536870912)&&$i(I,C,x,x[60],L?Ji(C,x[60],F,null):en(x[60]),null);let fe=w;w=te(x),w===fe?~w&&A[w].p(x,F):(p&&(tt(),V(A[fe],1,1,()=>{A[fe]=null}),it()),~w?(p=A[w],p?p.p(x,F):(p=A[w]=Y[w](x),p.c()),q(p,1),p.m(t,null)):p=null),(!L||F[0]&4&&S!==(S=Vt(x[2])+" svelte-bz0zu3"))&&y(t,"class",S),(!L||F[0]&22)&&oe(t,"can-collapse",x[4]&&x[1]==="")},i(x){L||(q(k),q(o.$$.fragment,x),q(a.$$.fragment,x),q(b),q(_),q(I,x),q(p),L=!0)},o(x){V(k),V(o.$$.fragment,x),V(a.$$.fragment,x),V(b),V(_),V(I,x),V(p),L=!1},d(x){x&&(D(e),D(t)),pe(o),i[63](null),pe(a),b&&b.d(),_&&_.d(),I&&I.d(x),~w&&A[w].d(),E=!1,me(M)}}}function ir(i,e,t){let n,r,{$$slots:o={},$$scope:l}=e;const s={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:c=void 0}=e,{apiKey:u}=e,{bbox:d=void 0}=e,{clearButtonTitle:a="clear"}=e,{clearOnBlur:f=!1}=e,{collapsed:h=!1}=e,{country:g=void 0}=e,{debounceSearch:v=200}=e,{enableReverse:w="never"}=e,{errorMessage:p="Something went wrong…"}=e,{filter:S=()=>!0}=e,{flyTo:L=!0}=e,{fuzzyMatch:E=!0}=e,{language:M=void 0}=e,{limit:k=void 0}=e,{mapController:b=void 0}=e,{minLength:_=2}=e,{noResultsMessage:C="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:I="Search"}=e,{proximity:Y=[{type:"server-geolocation"}]}=e,{reverseActive:A=w==="always"}=e,{reverseButtonTitle:te="toggle reverse geocoding"}=e,{searchValue:x=""}=e,{pickedResultStyle:F="full-geometry"}=e,{showPlaceType:fe="if-needed"}=e,{showResultsWhileTyping:ve=!0}=e,{selectFirst:Be=!0}=e,{flyToSelected:Nt=!1}=e,{markerOnSelected:st=!0}=e,{types:Re=void 0}=e,{exhaustiveReverseGeocoding:Pt=!1}=e,{excludeTypes:lt=!1}=e,{zoom:ut=s}=e,{apiUrl:Tt="https://api.maptiler.com/geocoding"}=e,{fetchParameters:Rt={}}=e,{iconsBaseUrl:ji="https://cdn.maptiler.com/maptiler-geocoding-control/v2.0.1/icons/"}=e,{adjustUrlQuery:It=()=>{}}=e;function Dr(){de.focus()}function Fr(){de.blur()}function qi(m,j=!0,H=!1){t(1,x=m),j?(t(15,G=-1),Qi()):(zt(!H,H),setTimeout(()=>{de.focus(),de.select()}))}function Ur(){t(14,R=void 0),t(56,N=void 0),t(15,G=-1)}function Gr(){t(55,Z=[]),t(56,N=void 0)}let De=!1,R,Z,N,Zi="",de,G=-1,he,at=[],Ie,Fe,ct,Ot;const jr=new Set,Ne=ln();sn(()=>{b&&(b.setEventHandler(void 0),b.indicateReverse(!1),b.setSelectedMarker(-1),b.setFeatures(void 0,void 0,!1))});function Qi(m){if(Fe&&(clearTimeout(Fe),Fe=void 0),G>-1&&R)t(56,N=R[G]),t(1,x=N.place_type[0]==="reverse"?N.place_name:N.place_name.replace(/,.*/,"")),t(18,he=void 0),t(55,Z=void 0),t(15,G=-1);else if(x){const j=m||!At(x);Wt(x,{exact:!0}).then(()=>{t(55,Z=R),t(56,N=void 0),j&&qr()}).catch(H=>t(18,he=H))}}function At(m){try{return Xn(m,6)}catch{return!1}}async function Wt(m,{byId:j=!1,exact:H=!1}={}){t(18,he=void 0),Ie==null||Ie.abort();const re=new AbortController;t(19,Ie=re);try{const P=At(m),Q=new URLSearchParams;if(M!==void 0&&Q.set("language",Array.isArray(M)?M.join(","):M??""),Re&&Q.set("types",Re.join(",")),lt&&Q.set("excludeTypes",String(lt)),d&&Q.set("bbox",d.map(ft=>ft.toFixed(6)).join(",")),g&&Q.set("country",Array.isArray(g)?g.join(","):g),!j&&!P){const ft=await Dn(b,Y,re);ft&&Q.set("proximity",ft),(H||!ve)&&Q.set("autocomplete","false"),Q.set("fuzzyMatch",String(E))}k!==void 0&&(Pt||!P||(Re==null?void 0:Re.length)===1)&&Q.set("limit",String(k)),Q.set("key",u),It(Q);const ge=Tt+"/"+encodeURIComponent(P?P.decimalLongitude+","+P.decimalLatitude:m)+".json?"+Q.toString();if(ge===Zi){j?(t(14,R=void 0),t(56,N=at[0])):t(14,R=at);return}Zi=ge;const Dt=await fetch(ge,{signal:re.signal,...Rt});if(!Dt.ok)throw new Error(await Dt.text());const Ft=await Dt.json();Ne("response",{url:ge,featureCollection:Ft}),j?(t(14,R=void 0),t(56,N=Ft.features[0]),at=[N]):(t(14,R=Ft.features.filter(S)),P&&R.unshift({type:"Feature",properties:{},id:"reverse_"+P.decimalLongitude+"_"+P.decimalLatitude,text:P.decimalLatitude+", "+P.decimalLongitude,place_name:P.decimalLatitude+", "+P.decimalLongitude,place_type:["reverse"],center:[P.decimalLongitude,P.decimalLatitude],bbox:[P.decimalLongitude,P.decimalLatitude,P.decimalLongitude,P.decimalLatitude],geometry:{type:"Point",coordinates:[P.decimalLongitude,P.decimalLatitude]}}),at=R,P&&de.focus())}catch(P){if(P&&typeof P=="object"&&"name"in P&&P.name==="AbortError")return;throw P}finally{re===Ie&&t(19,Ie=void 0)}}function qr(){var re;if(!(Z!=null&&Z.length)||!L)return;const m=[180,90,-180,-90],j=!Z.some(P=>!P.matching_text);let H;for(const P of Z){const Q=Je(P);if(H=H===void 0?Q:Q===void 0?H:Math.max(H,Q),j||!P.matching_text)for(const ge of[0,1,2,3])m[ge]=Math[ge<2?"min":"max"](m[ge],((re=P.bbox)==null?void 0:re[ge])??P.center[ge%2])}b&&Z.length>0&&(N&&m[0]===m[2]&&m[1]===m[3]?b.flyTo(N.center,Je(N)):b.fitBounds(qe(m),50,H))}function Je(m){var H;if(!m.bbox||m.bbox[0]!==m.bbox[2]&&m.bbox[1]!==m.bbox[3])return;const j=m.id.replace(/\..*/,"");return(Array.isArray((H=m.properties)==null?void 0:H.categories)?m.properties.categories.reduce((re,P)=>{const Q=ut[j+"."+P];return re===void 0?Q:Q===void 0?re:Math.max(re,Q)},void 0):void 0)??ut[j]}function Zr(m){t(0,A=w==="always"),t(14,R=void 0),t(56,N=void 0),t(15,G=-1),qi(m[1].toFixed(6)+", "+Bn(m[0],[-180,180],!0).toFixed(6),!1,!0)}function Qr(m){if(!R)return;let j=m.key==="ArrowDown"?1:m.key==="ArrowUp"?-1:0;j&&(G===(Be?0:-1)&&j===-1&&t(15,G=R.length),t(15,G+=j),G>=R.length&&t(15,G=-1),G<0&&Be&&t(15,G=0),m.preventDefault())}function zt(m=!0,j=!1){if(t(18,he=void 0),ve||j){if(Fe&&clearTimeout(Fe),x.length<_)return;const H=x;Fe=window.setTimeout(()=>{Wt(H).catch(re=>t(18,he=re))},m?v:0)}else t(14,R=void 0),t(18,he=void 0)}function Bt(m){t(56,N=m),t(1,x=m.place_name),t(15,G=-1)}const Hr=()=>de.focus();function Vr(m){dt[m?"unshift":"push"](()=>{de=m,t(17,de)})}function Yr(){x=this.value,t(1,x),t(13,De),t(28,f)}const Xr=()=>t(13,De=!0),Kr=()=>t(13,De=!1),Jr=()=>zt(),$r=()=>{t(1,x=""),de.focus()},eo=()=>t(0,A=!A),to=()=>t(18,he=void 0),io=m=>t(15,G=m),no=m=>Bt(m),ro=()=>{Be||t(15,G=-1)},oo=()=>{};return i.$$set=m=>{"class"in m&&t(2,c=m.class),"apiKey"in m&&t(26,u=m.apiKey),"bbox"in m&&t(27,d=m.bbox),"clearButtonTitle"in m&&t(3,a=m.clearButtonTitle),"clearOnBlur"in m&&t(28,f=m.clearOnBlur),"collapsed"in m&&t(4,h=m.collapsed),"country"in m&&t(29,g=m.country),"debounceSearch"in m&&t(30,v=m.debounceSearch),"enableReverse"in m&&t(5,w=m.enableReverse),"errorMessage"in m&&t(6,p=m.errorMessage),"filter"in m&&t(31,S=m.filter),"flyTo"in m&&t(32,L=m.flyTo),"fuzzyMatch"in m&&t(33,E=m.fuzzyMatch),"language"in m&&t(34,M=m.language),"limit"in m&&t(35,k=m.limit),"mapController"in m&&t(36,b=m.mapController),"minLength"in m&&t(37,_=m.minLength),"noResultsMessage"in m&&t(7,C=m.noResultsMessage),"placeholder"in m&&t(8,I=m.placeholder),"proximity"in m&&t(38,Y=m.proximity),"reverseActive"in m&&t(0,A=m.reverseActive),"reverseButtonTitle"in m&&t(9,te=m.reverseButtonTitle),"searchValue"in m&&t(1,x=m.searchValue),"pickedResultStyle"in m&&t(39,F=m.pickedResultStyle),"showPlaceType"in m&&t(10,fe=m.showPlaceType),"showResultsWhileTyping"in m&&t(40,ve=m.showResultsWhileTyping),"selectFirst"in m&&t(11,Be=m.selectFirst),"flyToSelected"in m&&t(41,Nt=m.flyToSelected),"markerOnSelected"in m&&t(42,st=m.markerOnSelected),"types"in m&&t(43,Re=m.types),"exhaustiveReverseGeocoding"in m&&t(44,Pt=m.exhaustiveReverseGeocoding),"excludeTypes"in m&&t(45,lt=m.excludeTypes),"zoom"in m&&t(46,ut=m.zoom),"apiUrl"in m&&t(47,Tt=m.apiUrl),"fetchParameters"in m&&t(48,Rt=m.fetchParameters),"iconsBaseUrl"in m&&t(12,ji=m.iconsBaseUrl),"adjustUrlQuery"in m&&t(49,It=m.adjustUrlQuery),"$$scope"in m&&t(60,l=m.$$scope)},i.$$.update=()=>{if(i.$$.dirty[0]&32&&t(0,A=w==="always"),i.$$.dirty[0]&268443648&&setTimeout(()=>{t(16,ct=De),f&&!De&&t(1,x="")}),i.$$.dirty[0]&16386|i.$$.dirty[1]&64&&x.length<_&&(t(56,N=void 0),t(14,R=void 0),t(18,he=void 0),t(55,Z=R)),i.$$.dirty[1]&33554688&&F!=="marker-only"&&N&&!N.address&&N.geometry.type==="Point"&&N.place_type[0]!=="reverse"&&Wt(N.id,{byId:!0}).catch(m=>t(18,he=m)),i.$$.dirty[1]&100663330&&(b&&N&&N.id!==Ot&&L&&(!N.bbox||N.bbox[0]===N.bbox[2]&&N.bbox[1]===N.bbox[3]?b.flyTo(N.center,Je(N)):b.fitBounds(qe(N.bbox),50,Je(N)),t(14,R=void 0),t(55,Z=void 0),t(15,G=-1)),t(57,Ot=N==null?void 0:N.id)),i.$$.dirty[0]&18432&&Be&&R!=null&&R.length&&t(15,G=0),i.$$.dirty[0]&2&&t(15,G=-1),i.$$.dirty[0]&16384|i.$$.dirty[1]&16777216&&Z!==R&&t(55,Z=void 0),i.$$.dirty[0]&81921|i.$$.dirty[1]&16777248&&b&&b.setEventHandler(m=>{switch(m.type){case"mapClick":A&&Zr(m.coordinates);break;case"markerClick":{const j=R==null?void 0:R.find(H=>H.id===m.id);j&&Bt(j)}break;case"markerMouseEnter":Z&&t(15,G=ct?(R==null?void 0:R.findIndex(j=>j.id===m.id))??-1:-1);break;case"markerMouseLeave":Z&&t(15,G=-1);break}}),i.$$.dirty[0]&49152&&t(58,r=R==null?void 0:R[G]),i.$$.dirty[1]&134218786&&b&&r&&L&&Nt&&b.flyTo(r.center,Je(r)),i.$$.dirty[1]&256&&t(59,n=F==="full-geometry-including-polygon-center-marker"),i.$$.dirty[1]&268437536&&(st||b==null||b.setFeatures(void 0,void 0,n)),i.$$.dirty[1]&419432480&&b&&st&&!Z&&(b.setFeatures(r?[r]:void 0,void 0,n),b.setSelectedMarker(r?0:-1)),i.$$.dirty[1]&318767136&&b&&b.setFeatures(Z,N,n),i.$$.dirty[0]&32768|i.$$.dirty[1]&16777248&&Z&&b&&b.setSelectedMarker(G),i.$$.dirty[0]&2|i.$$.dirty[1]&32&&b){const m=At(x);b.setReverseMarker(m?[m.decimalLongitude,m.decimalLatitude]:void 0)}i.$$.dirty[1]&134217728&&Ne("select",{feature:r}),i.$$.dirty[1]&33554432&&Ne("pick",{feature:N}),i.$$.dirty[0]&81920&&Ne("optionsvisibilitychange",{optionsVisible:ct&&!!R}),i.$$.dirty[0]&16384&&Ne("featureslisted",{features:R}),i.$$.dirty[1]&16777216&&Ne("featuresmarked",{features:Z}),i.$$.dirty[0]&1&&Ne("reversetoggle",{reverse:A}),i.$$.dirty[0]&2&&Ne("querychange",{query:x}),i.$$.dirty[0]&1|i.$$.dirty[1]&32&&b&&b.indicateReverse(A)},[A,x,c,a,h,w,p,C,I,te,fe,Be,ji,De,R,G,ct,de,he,Ie,jr,Qi,Qr,zt,Bt,s,u,d,f,g,v,S,L,E,M,k,b,_,Y,F,ve,Nt,st,Re,Pt,lt,ut,Tt,Rt,It,Dr,Fr,qi,Ur,Gr,Z,N,Ot,r,n,l,o,Hr,Vr,Yr,Xr,Kr,Jr,$r,eo,to,io,no,ro,oo]}let nr=class extends Se{constructor(e){super(),Le(this,e,ir,tr,we,{ZOOM_DEFAULTS:25,class:2,apiKey:26,bbox:27,clearButtonTitle:3,clearOnBlur:28,collapsed:4,country:29,debounceSearch:30,enableReverse:5,errorMessage:6,filter:31,flyTo:32,fuzzyMatch:33,language:34,limit:35,mapController:36,minLength:37,noResultsMessage:7,placeholder:8,proximity:38,reverseActive:0,reverseButtonTitle:9,searchValue:1,pickedResultStyle:39,showPlaceType:10,showResultsWhileTyping:40,selectFirst:11,flyToSelected:41,markerOnSelected:42,types:43,exhaustiveReverseGeocoding:44,excludeTypes:45,zoom:46,apiUrl:47,fetchParameters:48,iconsBaseUrl:12,adjustUrlQuery:49,focus:50,blur:51,setQuery:52,clearList:53,clearMap:54},null,[-1,-1,-1])}get ZOOM_DEFAULTS(){return this.$$.ctx[25]}get focus(){return this.$$.ctx[50]}get blur(){return this.$$.ctx[51]}get setQuery(){return this.$$.ctx[52]}get clearList(){return this.$$.ctx[53]}get clearMap(){return this.$$.ctx[54]}};function He(i,e,t={}){const n={type:"Feature"};return(t.id===0||t.id)&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.properties=e||{},n.geometry=i,n}function pt(i,e,t={}){for(const r of i){if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(r[r.length-1].length!==r[0].length)throw new Error("First and last Position are not equivalent.");for(let o=0;o<r[r.length-1].length;o++)if(r[r.length-1][o]!==r[0][o])throw new Error("First and last Position are not equivalent.")}return He({type:"Polygon",coordinates:i},e,t)}function Ve(i,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=i,t}function mi(i,e,t={}){return He({type:"MultiPolygon",coordinates:i},e,t)}function yi(i,e,t){if(i!==null)for(var n,r,o,l,s,c,u,d=0,a=0,f,h=i.type,g=h==="FeatureCollection",v=h==="Feature",w=g?i.features.length:1,p=0;p<w;p++){u=g?i.features[p].geometry:v?i.geometry:i,f=u?u.type==="GeometryCollection":!1,s=f?u.geometries.length:1;for(var S=0;S<s;S++){var L=0,E=0;if(l=f?u.geometries[S]:u,l!==null){c=l.coordinates;var M=l.type;switch(d=0,M){case null:break;case"Point":if(e(c,a,p,L,E)===!1)return!1;a++,L++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(e(c[n],a,p,L,E)===!1)return!1;a++,M==="MultiPoint"&&L++}M==="LineString"&&L++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(r=0;r<c[n].length-d;r++){if(e(c[n][r],a,p,L,E)===!1)return!1;a++}M==="MultiLineString"&&L++,M==="Polygon"&&E++}M==="Polygon"&&L++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(E=0,r=0;r<c[n].length;r++){for(o=0;o<c[n][r].length-d;o++){if(e(c[n][r][o],a,p,L,E)===!1)return!1;a++}E++}L++}break;case"GeometryCollection":for(n=0;n<l.geometries.length;n++)if(yi(l.geometries[n],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function bt(i,e){var t,n,r,o,l,s,c,u,d,a,f=0,h=i.type==="FeatureCollection",g=i.type==="Feature",v=h?i.features.length:1;for(t=0;t<v;t++){for(s=h?i.features[t].geometry:g?i.geometry:i,u=h?i.features[t].properties:g?i.properties:{},d=h?i.features[t].bbox:g?i.bbox:void 0,a=h?i.features[t].id:g?i.id:void 0,c=s?s.type==="GeometryCollection":!1,l=c?s.geometries.length:1,r=0;r<l;r++){if(o=c?s.geometries[r]:s,o===null){if(e(null,f,u,d,a)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,f,u,d,a)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(e(o.geometries[n],f,u,d,a)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function rr(i,e){bt(i,function(t,n,r,o,l){var s=t===null?null:t.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return e(He(t,r,{bbox:o,id:l}),n,0)===!1?!1:void 0}var c;switch(s){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var u=0;u<t.coordinates.length;u++){var d=t.coordinates[u],a={type:c,coordinates:d};if(e(He(a,r),n,u)===!1)return!1}})}function or(i,e={}){if(i.bbox!=null&&e.recompute!==!0)return i.bbox;const t=[1/0,1/0,-1/0,-1/0];return yi(i,n=>{t[0]>n[0]&&(t[0]=n[0]),t[1]>n[1]&&(t[1]=n[1]),t[2]<n[0]&&(t[2]=n[0]),t[3]<n[1]&&(t[3]=n[1])}),t}var vt=or;function sr(i){if(!i)throw new Error("geojson is required");switch(i.type){case"Feature":return pi(i);case"FeatureCollection":return lr(i);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return wt(i);default:throw new Error("unknown GeoJSON type")}}function pi(i){const e={type:"Feature"};return Object.keys(i).forEach(t=>{switch(t){case"type":case"properties":case"geometry":return;default:e[t]=i[t]}}),e.properties=bi(i.properties),i.geometry==null?e.geometry=null:e.geometry=wt(i.geometry),e}function bi(i){const e={};return i&&Object.keys(i).forEach(t=>{const n=i[t];typeof n=="object"?n===null?e[t]=null:Array.isArray(n)?e[t]=n.map(r=>r):e[t]=bi(n):e[t]=n}),e}function lr(i){const e={type:"FeatureCollection"};return Object.keys(i).forEach(t=>{switch(t){case"type":case"features":return;default:e[t]=i[t]}}),e.features=i.features.map(t=>pi(t)),e}function wt(i){const e={type:i.type};return i.bbox&&(e.bbox=i.bbox),i.type==="GeometryCollection"?(e.geometries=i.geometries.map(t=>wt(t)),e):(e.coordinates=vi(i.coordinates),e)}function vi(i){const e=i;return typeof e[0]!="object"?e.slice():e.map(t=>vi(t))}var ur=sr;/**
|
|
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 ar(i,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,r,o,l;return l={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function s(u){return function(
|
|
22
|
-
`);var o=e+(t?" ":"│ ");i.left&&Lt(i.left,o,!1,n,r),i.right&&Lt(i.right,o,!0,n,r)}}var St=function(){function i(e){e===void 0&&(e=cr),this._root=null,this._size=0,this._comparator=e}return i.prototype.insert=function(e,t){return this._size++,this._root=Et(e,t,this._root,this._comparator)},i.prototype.add=function(e,t){var n=new xe(e,t);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var r=this._comparator,o=Me(e,this._root,r),l=r(e,o.key);return l===0?this._root=o:(l<0?(n.left=o.left,n.right=o,o.left=null):l>0&&(n.right=o.right,n.left=o,o.right=null),this._size++,this._root=n),this._root},i.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},i.prototype._remove=function(e,t,n){var r;if(t===null)return null;t=Me(e,t,n);var o=n(e,t.key);return o===0?(t.left===null?r=t.right:(r=Me(e,t.left,n),r.right=t.right),this._size--,r):t},i.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=Me(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},i.prototype.findStatic=function(e){for(var t=this._root,n=this._comparator;t;){var r=n(e,t.key);if(r===0)return t;r<0?t=t.left:t=t.right}return null},i.prototype.find=function(e){return this._root&&(this._root=Me(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root},i.prototype.contains=function(e){for(var t=this._root,n=this._comparator;t;){var r=n(e,t.key);if(r===0)return!0;r<0?t=t.left:t=t.right}return!1},i.prototype.forEach=function(e,t){for(var n=this._root,r=[],o=!1;!o;)n!==null?(r.push(n),n=n.left):r.length!==0?(n=r.pop(),e.call(t,n),n=n.right):o=!0;return this},i.prototype.range=function(e,t,n,r){for(var o=[],l=this._comparator,s=this._root,c;o.length!==0||s;)if(s)o.push(s),s=s.left;else{if(s=o.pop(),c=l(s.key,t),c>0)break;if(l(s.key,e)>=0&&n.call(r,s))return this;s=s.right}return this},i.prototype.keys=function(){var e=[];return this.forEach(function(t){var n=t.key;return e.push(n)}),e},i.prototype.values=function(){var e=[];return this.forEach(function(t){var n=t.data;return e.push(n)}),e},i.prototype.min=function(){return this._root?this.minNode(this._root).key:null},i.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},i.prototype.minNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.left;)e=e.left;return e},i.prototype.maxNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.right;)e=e.right;return e},i.prototype.at=function(e){for(var t=this._root,n=!1,r=0,o=[];!n;)if(t)o.push(t),t=t.left;else if(o.length>0){if(t=o.pop(),r===e)return t;r++,t=t.right}else n=!0;return null},i.prototype.next=function(e){var t=this._root,n=null;if(e.right){for(n=e.right;n.left;)n=n.left;return n}for(var r=this._comparator;t;){var o=r(e.key,t.key);if(o===0)break;o<0?(n=t,t=t.left):t=t.right}return n},i.prototype.prev=function(e){var t=this._root,n=null;if(e.left!==null){for(n=e.left;n.right;)n=n.right;return n}for(var r=this._comparator;t;){var o=r(e.key,t.key);if(o===0)break;o<0?t=t.left:(n=t,t=t.right)}return n},i.prototype.clear=function(){return this._root=null,this._size=0,this},i.prototype.toList=function(){return hr(this._root)},i.prototype.load=function(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!1);var r=e.length,o=this._comparator;if(n&&Ct(e,t,0,r-1,o),this._root===null)this._root=xt(e,t,0,r),this._size=r;else{var l=gr(this.toList(),dr(e,t),o);r=this._size+r,this._root=Mt({head:l},0,r)}return this},i.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(i.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),i.prototype.toString=function(e){e===void 0&&(e=function(n){return String(n.key)});var t=[];return Lt(this._root,"",!0,function(n){return t.push(n)},e),t.join("")},i.prototype.update=function(e,t,n){var r=this._comparator,o=_i(e,this._root,r),l=o.left,s=o.right;r(e,t)<0?s=Et(t,n,s,r):l=Et(t,n,l,r),this._root=fr(l,s,r)},i.prototype.split=function(e){return _i(e,this._root,this._comparator)},i.prototype[Symbol.iterator]=function(){var e,t,n;return ar(this,function(r){switch(r.label){case 0:e=this._root,t=[],n=!1,r.label=1;case 1:return n?[3,6]:e===null?[3,2]:(t.push(e),e=e.left,[3,5]);case 2:return t.length===0?[3,4]:(e=t.pop(),[4,e]);case 3:return r.sent(),e=e.right,[3,5];case 4:n=!0,r.label=5;case 5:return[3,1];case 6:return[2]}})},i}();function xt(i,e,t,n){var r=n-t;if(r>0){var o=t+Math.floor(r/2),l=i[o],s=e[o],c=new xe(l,s);return c.left=xt(i,e,t,o),c.right=xt(i,e,o+1,n),c}return null}function dr(i,e){for(var t=new xe(null,null),n=t,r=0;r<i.length;r++)n=n.next=new xe(i[r],e[r]);return n.next=null,t.next}function hr(i){for(var e=i,t=[],n=!1,r=new xe(null,null),o=r;!n;)e?(t.push(e),e=e.left):t.length>0?(e=o=o.next=t.pop(),e=e.right):n=!0;return o.next=null,r.next}function Mt(i,e,t){var n=t-e;if(n>0){var r=e+Math.floor(n/2),o=Mt(i,e,r),l=i.head;return l.left=o,i.head=i.head.next,l.right=Mt(i,r+1,t),l}return null}function gr(i,e,t){for(var n=new xe(null,null),r=n,o=i,l=e;o!==null&&l!==null;)t(o.key,l.key)<0?(r.next=o,o=o.next):(r.next=l,l=l.next),r=r.next;return o!==null?r.next=o:l!==null&&(r.next=l),n.next}function Ct(i,e,t,n,r){if(!(t>=n)){for(var o=i[t+n>>1],l=t-1,s=n+1;;){do l++;while(r(i[l],o)<0);do s--;while(r(i[s],o)>0);if(l>=s)break;var c=i[l];i[l]=i[s],i[s]=c,c=e[l],e[l]=e[s],e[s]=c}Ct(i,e,t,s,r),Ct(i,e,s+1,n,r)}}const be=11102230246251565e-32,$=134217729,mr=(3+8*be)*be;function kt(i,e,t,n,r){let o,l,s,c,u=e[0],h=n[0],a=0,f=0;h>u==h>-u?(o=u,u=e[++a]):(o=h,h=n[++f]);let d=0;if(a<i&&f<t)for(h>u==h>-u?(l=u+o,s=o-(l-u),u=e[++a]):(l=h+o,s=o-(l-h),h=n[++f]),o=l,s!==0&&(r[d++]=s);a<i&&f<t;)h>u==h>-u?(l=o+u,c=l-o,s=o-(l-c)+(u-c),u=e[++a]):(l=o+h,c=l-o,s=o-(l-c)+(h-c),h=n[++f]),o=l,s!==0&&(r[d++]=s);for(;a<i;)l=o+u,c=l-o,s=o-(l-c)+(u-c),u=e[++a],o=l,s!==0&&(r[d++]=s);for(;f<t;)l=o+h,c=l-o,s=o-(l-c)+(h-c),h=n[++f],o=l,s!==0&&(r[d++]=s);return(o!==0||d===0)&&(r[d++]=o),d}function yr(i,e){let t=e[0];for(let n=1;n<i;n++)t+=e[n];return t}function Ye(i){return new Float64Array(i)}const pr=(3+16*be)*be,vr=(2+12*be)*be,br=(9+64*be)*be*be,Be=Ye(4),Ei=Ye(8),Li=Ye(12),Si=Ye(16),ie=Ye(4);function wr(i,e,t,n,r,o,l){let s,c,u,h,a,f,d,m,v,b,p,_,E,S,k,x,L,w;const C=i-r,I=t-r,G=e-o,j=n-o;S=C*j,f=$*C,d=f-(f-C),m=C-d,f=$*j,v=f-(f-j),b=j-v,k=m*b-(S-d*v-m*v-d*b),x=G*I,f=$*G,d=f-(f-G),m=G-d,f=$*I,v=f-(f-I),b=I-v,L=m*b-(x-d*v-m*v-d*b),p=k-L,a=k-p,Be[0]=k-(p+a)+(a-L),_=S+p,a=_-S,E=S-(_-a)+(p-a),p=E-x,a=E-p,Be[1]=E-(p+a)+(a-x),w=_+p,a=w-_,Be[2]=_-(w-a)+(p-a),Be[3]=w;let W=yr(4,Be),M=vr*l;if(W>=M||-W>=M||(a=i-C,s=i-(C+a)+(a-r),a=t-I,u=t-(I+a)+(a-r),a=e-G,c=e-(G+a)+(a-o),a=n-j,h=n-(j+a)+(a-o),s===0&&c===0&&u===0&&h===0)||(M=br*l+mr*Math.abs(W),W+=C*h+j*s-(G*u+I*c),W>=M||-W>=M))return W;S=s*j,f=$*s,d=f-(f-s),m=s-d,f=$*j,v=f-(f-j),b=j-v,k=m*b-(S-d*v-m*v-d*b),x=c*I,f=$*c,d=f-(f-c),m=c-d,f=$*I,v=f-(f-I),b=I-v,L=m*b-(x-d*v-m*v-d*b),p=k-L,a=k-p,ie[0]=k-(p+a)+(a-L),_=S+p,a=_-S,E=S-(_-a)+(p-a),p=E-x,a=E-p,ie[1]=E-(p+a)+(a-x),w=_+p,a=w-_,ie[2]=_-(w-a)+(p-a),ie[3]=w;const Z=kt(4,Be,4,ie,Ei);S=C*h,f=$*C,d=f-(f-C),m=C-d,f=$*h,v=f-(f-h),b=h-v,k=m*b-(S-d*v-m*v-d*b),x=G*u,f=$*G,d=f-(f-G),m=G-d,f=$*u,v=f-(f-u),b=u-v,L=m*b-(x-d*v-m*v-d*b),p=k-L,a=k-p,ie[0]=k-(p+a)+(a-L),_=S+p,a=_-S,E=S-(_-a)+(p-a),p=E-x,a=E-p,ie[1]=E-(p+a)+(a-x),w=_+p,a=w-_,ie[2]=_-(w-a)+(p-a),ie[3]=w;const re=kt(Z,Ei,4,ie,Li);S=s*h,f=$*s,d=f-(f-s),m=s-d,f=$*h,v=f-(f-h),b=h-v,k=m*b-(S-d*v-m*v-d*b),x=c*u,f=$*c,d=f-(f-c),m=c-d,f=$*u,v=f-(f-u),b=u-v,L=m*b-(x-d*v-m*v-d*b),p=k-L,a=k-p,ie[0]=k-(p+a)+(a-L),_=S+p,a=_-S,E=S-(_-a)+(p-a),p=E-x,a=E-p,ie[1]=E-(p+a)+(a-x),w=_+p,a=w-_,ie[2]=_-(w-a)+(p-a),ie[3]=w;const fe=kt(re,Li,4,ie,Si);return Si[fe-1]}function _r(i,e,t,n,r,o){const l=(e-o)*(t-r),s=(i-r)*(n-o),c=l-s,u=Math.abs(l+s);return Math.abs(c)>=pr*u?c:-wr(i,e,t,n,r,o,u)}const Xe=(i,e)=>i.ll.x<=e.x&&e.x<=i.ur.x&&i.ll.y<=e.y&&e.y<=i.ur.y,Nt=(i,e)=>{if(e.ur.x<i.ll.x||i.ur.x<e.ll.x||e.ur.y<i.ll.y||i.ur.y<e.ll.y)return null;const t=i.ll.x<e.ll.x?e.ll.x:i.ll.x,n=i.ur.x<e.ur.x?i.ur.x:e.ur.x,r=i.ll.y<e.ll.y?e.ll.y:i.ll.y,o=i.ur.y<e.ur.y?i.ur.y:e.ur.y;return{ll:{x:t,y:r},ur:{x:n,y:o}}};let Ce=Number.EPSILON;Ce===void 0&&(Ce=Math.pow(2,-52));const Er=Ce*Ce,xi=(i,e)=>{if(-Ce<i&&i<Ce&&-Ce<e&&e<Ce)return 0;const t=i-e;return t*t<Er*i*e?0:i<e?-1:1};class Lr{constructor(){this.reset()}reset(){this.xRounder=new Mi,this.yRounder=new Mi}round(e,t){return{x:this.xRounder.round(e),y:this.yRounder.round(t)}}}class Mi{constructor(){this.tree=new St,this.round(0)}round(e){const t=this.tree.add(e),n=this.tree.prev(t);if(n!==null&&xi(t.key,n.key)===0)return this.tree.remove(e),n.key;const r=this.tree.next(t);return r!==null&&xi(t.key,r.key)===0?(this.tree.remove(e),r.key):e}}const Ke=new Lr,nt=(i,e)=>i.x*e.y-i.y*e.x,Ci=(i,e)=>i.x*e.x+i.y*e.y,ki=(i,e,t)=>{const n=_r(i.x,i.y,e.x,e.y,t.x,t.y);return n>0?-1:n<0?1:0},rt=i=>Math.sqrt(Ci(i,i)),Sr=(i,e,t)=>{const n={x:e.x-i.x,y:e.y-i.y},r={x:t.x-i.x,y:t.y-i.y};return nt(r,n)/rt(r)/rt(n)},xr=(i,e,t)=>{const n={x:e.x-i.x,y:e.y-i.y},r={x:t.x-i.x,y:t.y-i.y};return Ci(r,n)/rt(r)/rt(n)},Ni=(i,e,t)=>e.y===0?null:{x:i.x+e.x/e.y*(t-i.y),y:t},Ti=(i,e,t)=>e.x===0?null:{x:t,y:i.y+e.y/e.x*(t-i.x)},Mr=(i,e,t,n)=>{if(e.x===0)return Ti(t,n,i.x);if(n.x===0)return Ti(i,e,t.x);if(e.y===0)return Ni(t,n,i.y);if(n.y===0)return Ni(i,e,t.y);const r=nt(e,n);if(r==0)return null;const o={x:t.x-i.x,y:t.y-i.y},l=nt(o,e)/r,s=nt(o,n)/r,c=i.x+s*e.x,u=t.x+l*n.x,h=i.y+s*e.y,a=t.y+l*n.y,f=(c+u)/2,d=(h+a)/2;return{x:f,y:d}};class le{static compare(e,t){const n=le.comparePoints(e.point,t.point);return n!==0?n:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:ke.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0}constructor(e,t){e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let n=0,r=t.length;n<r;n++){const o=t[n];this.point.events.push(o),o.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let t=0;t<e;t++){const n=this.point.events[t];if(n.segment.consumedBy===void 0)for(let r=t+1;r<e;r++){const o=this.point.events[r];o.consumedBy===void 0&&n.otherSE.point.events===o.otherSE.point.events&&n.segment.consume(o.segment)}}}getAvailableLinkedEvents(){const e=[];for(let t=0,n=this.point.events.length;t<n;t++){const r=this.point.events[t];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&e.push(r)}return e}getLeftmostComparator(e){const t=new Map,n=r=>{const o=r.otherSE;t.set(r,{sine:Sr(this.point,e.point,o.point),cosine:xr(this.point,e.point,o.point)})};return(r,o)=>{t.has(r)||n(r),t.has(o)||n(o);const{sine:l,cosine:s}=t.get(r),{sine:c,cosine:u}=t.get(o);return l>=0&&c>=0?s<u?1:s>u?-1:0:l<0&&c<0?s<u?-1:s>u?1:0:c<l?-1:c>l?1:0}}}let Cr=0;class ke{static compare(e,t){const n=e.leftSE.point.x,r=t.leftSE.point.x,o=e.rightSE.point.x,l=t.rightSE.point.x;if(l<n)return 1;if(o<r)return-1;const s=e.leftSE.point.y,c=t.leftSE.point.y,u=e.rightSE.point.y,h=t.rightSE.point.y;if(n<r){if(c<s&&c<u)return 1;if(c>s&&c>u)return-1;const a=e.comparePoint(t.leftSE.point);if(a<0)return 1;if(a>0)return-1;const f=t.comparePoint(e.rightSE.point);return f!==0?f:-1}if(n>r){if(s<c&&s<h)return-1;if(s>c&&s>h)return 1;const a=t.comparePoint(e.leftSE.point);if(a!==0)return a;const f=e.comparePoint(t.rightSE.point);return f<0?1:f>0?-1:1}if(s<c)return-1;if(s>c)return 1;if(o<l){const a=t.comparePoint(e.rightSE.point);if(a!==0)return a}if(o>l){const a=e.comparePoint(t.rightSE.point);if(a<0)return 1;if(a>0)return-1}if(o!==l){const a=u-s,f=o-n,d=h-c,m=l-r;if(a>f&&d<m)return 1;if(a<f&&d>m)return-1}return o>l?1:o<l||u<h?-1:u>h?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,n,r){this.id=++Cr,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=n,this.windings=r}static fromRing(e,t,n){let r,o,l;const s=le.comparePoints(e,t);if(s<0)r=e,o=t,l=1;else if(s>0)r=t,o=e,l=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const c=new le(r,!0),u=new le(o,!1);return new ke(c,u,[n],[l])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<t?e:t},ur:{x:this.rightSE.point.x,y:e>t?e:t}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}comparePoint(e){if(this.isAnEndpoint(e))return 0;const t=this.leftSE.point,n=this.rightSE.point,r=this.vector();if(t.x===n.x)return e.x===t.x?0:e.x<t.x?1:-1;const o=(e.y-t.y)/r.y,l=t.x+o*r.x;if(e.x===l)return 0;const s=(e.x-t.x)/r.x,c=t.y+s*r.y;return e.y===c?0:e.y<c?-1:1}getIntersection(e){const t=this.bbox(),n=e.bbox(),r=Nt(t,n);if(r===null)return null;const o=this.leftSE.point,l=this.rightSE.point,s=e.leftSE.point,c=e.rightSE.point,u=Xe(t,s)&&this.comparePoint(s)===0,h=Xe(n,o)&&e.comparePoint(o)===0,a=Xe(t,c)&&this.comparePoint(c)===0,f=Xe(n,l)&&e.comparePoint(l)===0;if(h&&u)return f&&!a?l:!f&&a?c:null;if(h)return a&&o.x===c.x&&o.y===c.y?null:o;if(u)return f&&l.x===s.x&&l.y===s.y?null:s;if(f&&a)return null;if(f)return l;if(a)return c;const d=Mr(o,this.vector(),s,e.vector());return d===null||!Xe(r,d)?null:Ke.round(d.x,d.y)}split(e){const t=[],n=e.events!==void 0,r=new le(e,!0),o=new le(e,!1),l=this.rightSE;this.replaceRightSE(o),t.push(o),t.push(r);const s=new ke(r,l,this.rings.slice(),this.windings.slice());return le.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),le.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),o.checkForConsuming()),t}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,n=this.windings.length;t<n;t++)this.windings[t]*=-1}consume(e){let t=this,n=e;for(;t.consumedBy;)t=t.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const r=ke.compare(t,n);if(r!==0){if(r>0){const o=t;t=n,n=o}if(t.prev===n){const o=t;t=n,n=o}for(let o=0,l=n.rings.length;o<l;o++){const s=n.rings[o],c=n.windings[o],u=t.rings.indexOf(s);u===-1?(t.rings.push(s),t.windings.push(c)):t.windings[u]+=c}n.rings=null,n.windings=null,n.consumedBy=t,n.leftSE.consumedBy=t.leftSE,n.rightSE.consumedBy=t.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};const t=this._afterState.rings,n=this._afterState.windings,r=this._afterState.multiPolys;for(let s=0,c=this.rings.length;s<c;s++){const u=this.rings[s],h=this.windings[s],a=t.indexOf(u);a===-1?(t.push(u),n.push(h)):n[a]+=h}const o=[],l=[];for(let s=0,c=t.length;s<c;s++){if(n[s]===0)continue;const u=t[s],h=u.poly;if(l.indexOf(h)===-1)if(u.isExterior)o.push(h);else{l.indexOf(h)===-1&&l.push(h);const a=o.indexOf(u.poly);a!==-1&&o.splice(a,1)}}for(let s=0,c=o.length;s<c;s++){const u=o[s].multiPoly;r.indexOf(u)===-1&&r.push(u)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(ce.type){case"union":{const n=e.length===0,r=t.length===0;this._isInResult=n!==r;break}case"intersection":{let n,r;e.length<t.length?(n=e.length,r=t.length):(n=t.length,r=e.length),this._isInResult=r===ce.numMultiPolys&&n<r;break}case"xor":{const n=Math.abs(e.length-t.length);this._isInResult=n%2===1;break}case"difference":{const n=r=>r.length===1&&r[0].isSubject;this._isInResult=n(e)!==n(t);break}default:throw new Error(`Unrecognized operation type found ${ce.type}`)}return this._isInResult}}class Pi{constructor(e,t,n){if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=n,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const r=Ke.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=Ke.round(e[l][0],e[l][1]);c.x===o.x&&c.y===o.y||(this.segments.push(ke.fromRing(o,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),o=c)}(r.x!==o.x||r.y!==o.y)&&this.segments.push(ke.fromRing(o,r,this))}getSweepEvents(){const e=[];for(let t=0,n=this.segments.length;t<n;t++){const r=this.segments[t];e.push(r.leftSE),e.push(r.rightSE)}return e}}class kr{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Pi(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let n=1,r=e.length;n<r;n++){const o=new Pi(e[n],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=t}getSweepEvents(){const e=this.exteriorRing.getSweepEvents();for(let t=0,n=this.interiorRings.length;t<n;t++){const r=this.interiorRings[t].getSweepEvents();for(let o=0,l=r.length;o<l;o++)e.push(r[o])}return e}}class Ri{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof e[0][0][0]=="number"&&(e=[e])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let n=0,r=e.length;n<r;n++){const o=new kr(e[n],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=t}getSweepEvents(){const e=[];for(let t=0,n=this.polys.length;t<n;t++){const r=this.polys[t].getSweepEvents();for(let o=0,l=r.length;o<l;o++)e.push(r[o])}return e}}class ot{static factory(e){const t=[];for(let n=0,r=e.length;n<r;n++){const o=e[n];if(!o.isInResult()||o.ringOut)continue;let l=null,s=o.leftSE,c=o.rightSE;const u=[s],h=s.point,a=[];for(;l=s,s=c,u.push(s),s.point!==h;)for(;;){const f=s.getAvailableLinkedEvents();if(f.length===0){const v=u[0].point,b=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${v.x}, ${v.y}]. Last matching segment found ends at [${b.x}, ${b.y}].`)}if(f.length===1){c=f[0].otherSE;break}let d=null;for(let v=0,b=a.length;v<b;v++)if(a[v].point===s.point){d=v;break}if(d!==null){const v=a.splice(d)[0],b=u.splice(v.index);b.unshift(b[0].otherSE),t.push(new ot(b.reverse()));continue}a.push({index:u.length,point:s.point});const m=s.getLeftmostComparator(l);c=f.sort(m)[0].otherSE;break}t.push(new ot(u))}return t}constructor(e){this.events=e;for(let t=0,n=e.length;t<n;t++)e[t].segment.ringOut=this;this.poly=null}getGeom(){let e=this.events[0].point;const t=[e];for(let u=1,h=this.events.length-1;u<h;u++){const a=this.events[u].point,f=this.events[u+1].point;ki(a,e,f)!==0&&(t.push(a),e=a)}if(t.length===1)return null;const n=t[0],r=t[1];ki(n,e,r)===0&&t.shift(),t.push(t[0]);const o=this.isExteriorRing()?1:-1,l=this.isExteriorRing()?0:t.length-1,s=this.isExteriorRing()?t.length:-1,c=[];for(let u=l;u!=s;u+=o)c.push([t[u].x,t[u].y]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){const e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let e=this.events[0];for(let r=1,o=this.events.length;r<o;r++){const l=this.events[r];le.compare(e,l)>0&&(e=l)}let t=e.segment.prevInResult(),n=t?t.prevInResult():null;for(;;){if(!t)return null;if(!n)return t.ringOut;if(n.ringOut!==t.ringOut)return n.ringOut.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut.enclosingRing();t=n.prevInResult(),n=t?t.prevInResult():null}}}class Ii{constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){const e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(let t=0,n=this.interiorRings.length;t<n;t++){const r=this.interiorRings[t].getGeom();r!==null&&e.push(r)}return e}}class Nr{constructor(e){this.rings=e,this.polys=this._composePolys(e)}getGeom(){const e=[];for(let t=0,n=this.polys.length;t<n;t++){const r=this.polys[t].getGeom();r!==null&&e.push(r)}return e}_composePolys(e){const t=[];for(let n=0,r=e.length;n<r;n++){const o=e[n];if(!o.poly)if(o.isExteriorRing())t.push(new Ii(o));else{const l=o.enclosingRing();l.poly||t.push(new Ii(l)),l.poly.addInterior(o)}}return t}}class Tr{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ke.compare;this.queue=e,this.tree=new St(t),this.segments=[]}process(e){const t=e.segment,n=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),n;const r=e.isLeft?this.tree.add(t):this.tree.find(t);if(!r)throw new Error(`Unable to find segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] in SweepLine tree.`);let o=r,l=r,s,c;for(;s===void 0;)o=this.tree.prev(o),o===null?s=null:o.key.consumedBy===void 0&&(s=o.key);for(;c===void 0;)l=this.tree.next(l),l===null?c=null:l.key.consumedBy===void 0&&(c=l.key);if(e.isLeft){let u=null;if(s){const a=s.getIntersection(t);if(a!==null&&(t.isAnEndpoint(a)||(u=a),!s.isAnEndpoint(a))){const f=this._splitSafely(s,a);for(let d=0,m=f.length;d<m;d++)n.push(f[d])}}let h=null;if(c){const a=c.getIntersection(t);if(a!==null&&(t.isAnEndpoint(a)||(h=a),!c.isAnEndpoint(a))){const f=this._splitSafely(c,a);for(let d=0,m=f.length;d<m;d++)n.push(f[d])}}if(u!==null||h!==null){let a=null;u===null?a=h:h===null?a=u:a=le.comparePoints(u,h)<=0?u:h,this.queue.remove(t.rightSE),n.push(t.rightSE);const f=t.split(a);for(let d=0,m=f.length;d<m;d++)n.push(f[d])}n.length>0?(this.tree.remove(t),n.push(e)):(this.segments.push(t),t.prev=s)}else{if(s&&c){const u=s.getIntersection(c);if(u!==null){if(!s.isAnEndpoint(u)){const h=this._splitSafely(s,u);for(let a=0,f=h.length;a<f;a++)n.push(h[a])}if(!c.isAnEndpoint(u)){const h=this._splitSafely(c,u);for(let a=0,f=h.length;a<f;a++)n.push(h[a])}}}this.tree.remove(t)}return n}_splitSafely(e,t){this.tree.remove(e);const n=e.rightSE;this.queue.remove(n);const r=e.split(t);return r.push(n),e.consumedBy===void 0&&this.tree.add(e),r}}const Oi=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Pr=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Rr{run(e,t,n){ce.type=e,Ke.reset();const r=[new Ri(t,!0)];for(let a=0,f=n.length;a<f;a++)r.push(new Ri(n[a],!1));if(ce.numMultiPolys=r.length,ce.type==="difference"){const a=r[0];let f=1;for(;f<r.length;)Nt(r[f].bbox,a.bbox)!==null?f++:r.splice(f,1)}if(ce.type==="intersection")for(let a=0,f=r.length;a<f;a++){const d=r[a];for(let m=a+1,v=r.length;m<v;m++)if(Nt(d.bbox,r[m].bbox)===null)return[]}const o=new St(le.compare);for(let a=0,f=r.length;a<f;a++){const d=r[a].getSweepEvents();for(let m=0,v=d.length;m<v;m++)if(o.insert(d[m]),o.size>Oi)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const l=new Tr(o);let s=o.size,c=o.pop();for(;c;){const a=c.key;if(o.size===s){const d=a.segment;throw new Error(`Unable to pop() ${a.isLeft?"left":"right"} SweepEvent [${a.point.x}, ${a.point.y}] from segment #${d.id} [${d.leftSE.point.x}, ${d.leftSE.point.y}] -> [${d.rightSE.point.x}, ${d.rightSE.point.y}] from queue.`)}if(o.size>Oi)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(l.segments.length>Pr)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=l.process(a);for(let d=0,m=f.length;d<m;d++){const v=f[d];v.consumedBy===void 0&&o.insert(v)}s=o.size,c=o.pop()}Ke.reset();const u=ot.factory(l.segments);return new Nr(u).getGeom()}}const ce=new Rr;var Wi={union:function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return ce.run("union",i,t)},intersection:function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return ce.run("intersection",i,t)},xor:function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return ce.run("xor",i,t)},difference:function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return ce.run("difference",i,t)}};function Ir(i,e={}){const t=[];if(bt(i,r=>{t.push(r.coordinates)}),t.length<2)throw new Error("Must have at least 2 geometries");const n=Wi.union(t[0],...t.slice(1));return n.length===0?null:n.length===1?vt(n[0],e.properties):yi(n,e.properties)}var Ai=Ir;function Or(i){const e=[];if(bt(i,r=>{e.push(r.coordinates)}),e.length<2)throw new Error("Must have at least two features");const t=i.features[0].properties||{},n=Wi.difference(e[0],...e.slice(1));return n.length===0?null:n.length===1?vt(n[0],t):yi(n,t)}var Wr=Or;function Ar(i){if(!i)throw new Error("geojson is required");var e=[];return rr(i,function(t){e.push(t)}),Ve(e)}var Br=Ar;function Bi(i,e){const t=Wr(Ve([vt([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),i]));if(!t)return;t.properties={isMask:!0};const n=Ze(wt(i)),r=(n[2]-n[0])/360/1e3,o=n[0]<-180,l=n[2]>180,s=Br(i);if(s.features.length>1&&(o||l))for(const c of s.features){const u=Ze(wt(c));if(l&&u[0]<-180+r)for(const h of c.geometry.coordinates)for(const a of h)a[0]+=360-r;if(o&&u[2]>180-r)for(const h of c.geometry.coordinates)for(const a of h)a[0]-=360-r}e(Ve([s.features.length<2?i:Ai(s)??i,t]))}const Di=i=>{var n,r,o;const e=(n=i==null?void 0:i.geometry)==null?void 0:n.type,t=(r=i==null?void 0:i.properties)!=null&&r.isMask?0:e==="LineString"||e==="MultiLineString"?3:2;return{color:"#3170fe",fillColor:"#000",fillOpacity:(o=i==null?void 0:i.properties)!=null&&o.isMask?.1:0,weight:t,dashArray:[t,t],lineCap:"butt"}};function Ui(i,e=!0,t=!0,n={},r={},o=Di){let l;const s=[];let c,u;const h=ee.geoJSON(void 0,{style:o===!0?Di:o===!1?void 0:o??void 0,interactive:!1}).addTo(i),a=d=>{l==null||l({type:"mapClick",coordinates:[d.latlng.lng,d.latlng.lat]})};function f(d,m=!1){const v=document.createElement("div");return new In({props:{displayIn:"leaflet"},target:v}),new ee.Marker(d,{interactive:m,icon:new ee.DivIcon({html:v,className:"",iconAnchor:[12,26],iconSize:[25,30],tooltipAnchor:[1,-24]})})}return{setEventHandler(d){d?(l=d,i.on("click",a)):(l=void 0,i.off("click",a))},flyTo(d,m){i.flyTo([d[1],d[0]],m,{duration:2,...n})},fitBounds(d,m,v){i.flyToBounds([[d[1],d[0]],[d[3],d[2]]],{padding:[m,m],duration:2,...v?{maxZoom:v}:{},...r})},indicateReverse(d){i.getContainer().style.cursor=d?"crosshair":""},setReverseMarker(d){var v;if(!e)return;const m=d&&[d[1],d[0]];u?m?u.setLatLng(m):(u.remove(),u=void 0):m&&(e instanceof Function?u=e(i)??void 0:(u=(typeof e=="object"?new ee.Marker(m,e):f(m)).addTo(i),(v=u.getElement())==null||v.classList.add("marker-reverse")))},setMarkers(d,m){function v(b){h.clearLayers(),b&&h.addData(b)}for(const b of s)b.remove();if(s.length=0,v(),m){let b=!1;if(m.geometry.type==="GeometryCollection"){const p=m.geometry.geometries.filter(_=>_.type==="Polygon"||_.type==="MultiPolygon");e:if(p.length>0){const _=Ai(Ve(p.map(E=>He(E))));if(!_)break e;Bi({...m,geometry:_.geometry},v),b=!0}else{const _=m.geometry.geometries.filter(E=>E.type==="LineString"||E.type==="MultiLineString");_.length>0&&(v({...m,geometry:{type:"GeometryCollection",geometries:_}}),b=!0)}}if(!b){if(m.geometry.type==="Polygon"||m.geometry.type==="MultiPolygon")Bi(m,p=>{if(!p)return;const _=[...p.features],E=Ze(wt(m)),S=E[2]-E[0];E[0]-S/4<-180&&_.push(...Fi(p,-360).features),E[2]+S/4>180&&_.push(...Fi(p,360).features),v(Ve(_))});else if(m.geometry.type==="LineString"||m.geometry.type==="MultiLineString"){v(m);return}}if(e instanceof Function){const p=e(i,m);p&&s.push(p.addTo(i))}else if(e){const p=[m.center[1],m.center[0]];s.push(typeof e=="object"?new ee.Marker(p,e):f(p).addTo(i))}}if(t)for(const b of d??[]){if(b===m)continue;const p=[b.center[1],b.center[0]];let _;if(t instanceof Function){if(_=t(i,b),!_)continue}else _=(typeof t=="object"?new ee.Marker(p,t):f(p,!0)).addTo(i).bindTooltip(b.place_type[0]==="reverse"?b.place_name:b.place_name.replace(/,.*/,""),{direction:"top"});const E=_.getElement();E&&(E.addEventListener("click",S=>{S.stopPropagation(),l==null||l({type:"markerClick",id:b.id})}),E.addEventListener("mouseenter",()=>{l==null||l({type:"markerMouseEnter",id:b.id})}),E.addEventListener("mouseleave",()=>{l==null||l({type:"markerMouseLeave",id:b.id})}),E.classList.toggle("marker-fuzzy",!!b.matching_text)),s.push(_)}},setSelectedMarker(d){var m,v;c&&((m=c.getElement())==null||m.classList.toggle("marker-selected",!1)),c=d>-1?s[d]:void 0,(v=c==null?void 0:c.getElement())==null||v.classList.toggle("marker-selected",!0)},getCenterAndZoom(){const d=i.getCenter();return[i.getZoom(),d.lng,d.lat]}}}function Fi(i,e){const t=ur(i);for(const n of t.features)if(n.geometry.type=="MultiPolygon")for(const r of n.geometry.coordinates)Gi(r,e);else Gi(n.geometry.coordinates,e);return t}function Gi(i,e){for(const t of i)for(const n of t)n[0]+=e}class Tt{constructor(...e){}}ee.Util.extend(Tt.prototype,ee.Control.prototype),ee.Util.extend(Tt.prototype,ee.Evented.prototype);class zi extends Tt{constructor(t){super();Zt(this,ue);Zt(this,Pe);dt(this,Pe,t)}onAdd(t){const n=document.createElement("div");n.className="leaflet-ctrl-geocoder",ee.DomEvent.disableClickPropagation(n),ee.DomEvent.disableScrollPropagation(n);const{marker:r,showResultMarkers:o,flyTo:l,fullGeometryStyle:s,...c}=de(this,Pe),u=typeof l=="boolean"?{}:l,h=Ui(t,r,o,u,u,s);dt(this,ue,new nr({target:n,props:{mapController:h,flyTo:l===void 0?!0:!!l,...c}}));for(const a of["select","pick","featuresListed","featuresMarked","response","optionsVisibilityChange","reverseToggle","queryChange"])de(this,ue).$on(a,f=>this.fire(a.toLowerCase(),f.detail));return n}setOptions(t){var c;dt(this,Pe,t);const{marker:n,showResultMarkers:r,flyTo:o,fullGeometryStyle:l,...s}=de(this,Pe);(c=de(this,ue))==null||c.$set(s)}setQuery(t,n=!0){var r;(r=de(this,ue))==null||r.setQuery(t,n)}clearMap(){var t;(t=de(this,ue))==null||t.clearMap()}clearList(){var t;(t=de(this,ue))==null||t.clearList()}focus(){var t;(t=de(this,ue))==null||t.focus()}blur(){var t;(t=de(this,ue))==null||t.blur()}onRemove(){var t;(t=de(this,ue))==null||t.$destroy()}}ue=new WeakMap,Pe=new WeakMap;function Dr(...i){return new zi(...i)}window.L&&typeof window.L=="object"&&typeof window.L.control=="function"&&(window.L.control.maptilerGeocoding=Dr),O.GeocodingControl=zi,O.createLeafletMapController=Ui,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});
|
|
21
|
+
***************************************************************************** */function ar(i,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,r,o,l;return l={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function s(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,r&&(o=u[0]&2?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,r=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1],o=u;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(u);break}o[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(i,t)}catch(d){u=[6,d],r=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var xe=function(){function i(e,t){this.next=null,this.key=e,this.data=t,this.left=null,this.right=null}return i}();function cr(i,e){return i>e?1:i<e?-1:0}function Me(i,e,t){for(var n=new xe(null,null),r=n,o=n;;){var l=t(i,e.key);if(l<0){if(e.left===null)break;if(t(i,e.left.key)<0){var s=e.left;if(e.left=s.right,s.right=e,e=s,e.left===null)break}o.left=e,o=e,e=e.left}else if(l>0){if(e.right===null)break;if(t(i,e.right.key)>0){var s=e.right;if(e.right=s.left,s.left=e,e=s,e.right===null)break}r.right=e,r=e,e=e.right}else break}return r.right=e.left,o.left=e.right,e.left=n.right,e.right=n.left,e}function _t(i,e,t,n){var r=new xe(i,e);if(t===null)return r.left=r.right=null,r;t=Me(i,t,n);var o=n(i,t.key);return o<0?(r.left=t.left,r.right=t,t.left=null):o>=0&&(r.right=t.right,r.left=t,t.right=null),r}function wi(i,e,t){var n=null,r=null;if(e){e=Me(i,e,t);var o=t(e.key,i);o===0?(n=e.left,r=e.right):o<0?(r=e.right,e.right=null,n=e):(n=e.left,e.left=null,r=e)}return{left:n,right:r}}function fr(i,e,t){return e===null?i:(i===null||(e=Me(i.key,e,t),e.left=i),e)}function Et(i,e,t,n,r){if(i){n(""+e+(t?"└── ":"├── ")+r(i)+`
|
|
22
|
+
`);var o=e+(t?" ":"│ ");i.left&&Et(i.left,o,!1,n,r),i.right&&Et(i.right,o,!0,n,r)}}var Lt=function(){function i(e){e===void 0&&(e=cr),this._root=null,this._size=0,this._comparator=e}return i.prototype.insert=function(e,t){return this._size++,this._root=_t(e,t,this._root,this._comparator)},i.prototype.add=function(e,t){var n=new xe(e,t);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var r=this._comparator,o=Me(e,this._root,r),l=r(e,o.key);return l===0?this._root=o:(l<0?(n.left=o.left,n.right=o,o.left=null):l>0&&(n.right=o.right,n.left=o,o.right=null),this._size++,this._root=n),this._root},i.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},i.prototype._remove=function(e,t,n){var r;if(t===null)return null;t=Me(e,t,n);var o=n(e,t.key);return o===0?(t.left===null?r=t.right:(r=Me(e,t.left,n),r.right=t.right),this._size--,r):t},i.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=Me(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},i.prototype.findStatic=function(e){for(var t=this._root,n=this._comparator;t;){var r=n(e,t.key);if(r===0)return t;r<0?t=t.left:t=t.right}return null},i.prototype.find=function(e){return this._root&&(this._root=Me(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root},i.prototype.contains=function(e){for(var t=this._root,n=this._comparator;t;){var r=n(e,t.key);if(r===0)return!0;r<0?t=t.left:t=t.right}return!1},i.prototype.forEach=function(e,t){for(var n=this._root,r=[],o=!1;!o;)n!==null?(r.push(n),n=n.left):r.length!==0?(n=r.pop(),e.call(t,n),n=n.right):o=!0;return this},i.prototype.range=function(e,t,n,r){for(var o=[],l=this._comparator,s=this._root,c;o.length!==0||s;)if(s)o.push(s),s=s.left;else{if(s=o.pop(),c=l(s.key,t),c>0)break;if(l(s.key,e)>=0&&n.call(r,s))return this;s=s.right}return this},i.prototype.keys=function(){var e=[];return this.forEach(function(t){var n=t.key;return e.push(n)}),e},i.prototype.values=function(){var e=[];return this.forEach(function(t){var n=t.data;return e.push(n)}),e},i.prototype.min=function(){return this._root?this.minNode(this._root).key:null},i.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},i.prototype.minNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.left;)e=e.left;return e},i.prototype.maxNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.right;)e=e.right;return e},i.prototype.at=function(e){for(var t=this._root,n=!1,r=0,o=[];!n;)if(t)o.push(t),t=t.left;else if(o.length>0){if(t=o.pop(),r===e)return t;r++,t=t.right}else n=!0;return null},i.prototype.next=function(e){var t=this._root,n=null;if(e.right){for(n=e.right;n.left;)n=n.left;return n}for(var r=this._comparator;t;){var o=r(e.key,t.key);if(o===0)break;o<0?(n=t,t=t.left):t=t.right}return n},i.prototype.prev=function(e){var t=this._root,n=null;if(e.left!==null){for(n=e.left;n.right;)n=n.right;return n}for(var r=this._comparator;t;){var o=r(e.key,t.key);if(o===0)break;o<0?t=t.left:(n=t,t=t.right)}return n},i.prototype.clear=function(){return this._root=null,this._size=0,this},i.prototype.toList=function(){return hr(this._root)},i.prototype.load=function(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!1);var r=e.length,o=this._comparator;if(n&&Mt(e,t,0,r-1,o),this._root===null)this._root=St(e,t,0,r),this._size=r;else{var l=gr(this.toList(),dr(e,t),o);r=this._size+r,this._root=xt({head:l},0,r)}return this},i.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(i.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),i.prototype.toString=function(e){e===void 0&&(e=function(n){return String(n.key)});var t=[];return Et(this._root,"",!0,function(n){return t.push(n)},e),t.join("")},i.prototype.update=function(e,t,n){var r=this._comparator,o=wi(e,this._root,r),l=o.left,s=o.right;r(e,t)<0?s=_t(t,n,s,r):l=_t(t,n,l,r),this._root=fr(l,s,r)},i.prototype.split=function(e){return wi(e,this._root,this._comparator)},i.prototype[Symbol.iterator]=function(){var e,t,n;return ar(this,function(r){switch(r.label){case 0:e=this._root,t=[],n=!1,r.label=1;case 1:return n?[3,6]:e===null?[3,2]:(t.push(e),e=e.left,[3,5]);case 2:return t.length===0?[3,4]:(e=t.pop(),[4,e]);case 3:return r.sent(),e=e.right,[3,5];case 4:n=!0,r.label=5;case 5:return[3,1];case 6:return[2]}})},i}();function St(i,e,t,n){var r=n-t;if(r>0){var o=t+Math.floor(r/2),l=i[o],s=e[o],c=new xe(l,s);return c.left=St(i,e,t,o),c.right=St(i,e,o+1,n),c}return null}function dr(i,e){for(var t=new xe(null,null),n=t,r=0;r<i.length;r++)n=n.next=new xe(i[r],e[r]);return n.next=null,t.next}function hr(i){for(var e=i,t=[],n=!1,r=new xe(null,null),o=r;!n;)e?(t.push(e),e=e.left):t.length>0?(e=o=o.next=t.pop(),e=e.right):n=!0;return o.next=null,r.next}function xt(i,e,t){var n=t-e;if(n>0){var r=e+Math.floor(n/2),o=xt(i,e,r),l=i.head;return l.left=o,i.head=i.head.next,l.right=xt(i,r+1,t),l}return null}function gr(i,e,t){for(var n=new xe(null,null),r=n,o=i,l=e;o!==null&&l!==null;)t(o.key,l.key)<0?(r.next=o,o=o.next):(r.next=l,l=l.next),r=r.next;return o!==null?r.next=o:l!==null&&(r.next=l),n.next}function Mt(i,e,t,n,r){if(!(t>=n)){for(var o=i[t+n>>1],l=t-1,s=n+1;;){do l++;while(r(i[l],o)<0);do s--;while(r(i[s],o)>0);if(l>=s)break;var c=i[l];i[l]=i[s],i[s]=c,c=e[l],e[l]=e[s],e[s]=c}Mt(i,e,t,s,r),Mt(i,e,s+1,n,r)}}const be=11102230246251565e-32,J=134217729,mr=(3+8*be)*be;function Ct(i,e,t,n,r){let o,l,s,c,u=e[0],d=n[0],a=0,f=0;d>u==d>-u?(o=u,u=e[++a]):(o=d,d=n[++f]);let h=0;if(a<i&&f<t)for(d>u==d>-u?(l=u+o,s=o-(l-u),u=e[++a]):(l=d+o,s=o-(l-d),d=n[++f]),o=l,s!==0&&(r[h++]=s);a<i&&f<t;)d>u==d>-u?(l=o+u,c=l-o,s=o-(l-c)+(u-c),u=e[++a]):(l=o+d,c=l-o,s=o-(l-c)+(d-c),d=n[++f]),o=l,s!==0&&(r[h++]=s);for(;a<i;)l=o+u,c=l-o,s=o-(l-c)+(u-c),u=e[++a],o=l,s!==0&&(r[h++]=s);for(;f<t;)l=o+d,c=l-o,s=o-(l-c)+(d-c),d=n[++f],o=l,s!==0&&(r[h++]=s);return(o!==0||h===0)&&(r[h++]=o),h}function yr(i,e){let t=e[0];for(let n=1;n<i;n++)t+=e[n];return t}function Ye(i){return new Float64Array(i)}const pr=(3+16*be)*be,br=(2+12*be)*be,vr=(9+64*be)*be*be,ze=Ye(4),_i=Ye(8),Ei=Ye(12),Li=Ye(16),ee=Ye(4);function wr(i,e,t,n,r,o,l){let s,c,u,d,a,f,h,g,v,w,p,S,L,E,M,k,b,_;const C=i-r,I=t-r,Y=e-o,A=n-o;E=C*A,f=J*C,h=f-(f-C),g=C-h,f=J*A,v=f-(f-A),w=A-v,M=g*w-(E-h*v-g*v-h*w),k=Y*I,f=J*Y,h=f-(f-Y),g=Y-h,f=J*I,v=f-(f-I),w=I-v,b=g*w-(k-h*v-g*v-h*w),p=M-b,a=M-p,ze[0]=M-(p+a)+(a-b),S=E+p,a=S-E,L=E-(S-a)+(p-a),p=L-k,a=L-p,ze[1]=L-(p+a)+(a-k),_=S+p,a=_-S,ze[2]=S-(_-a)+(p-a),ze[3]=_;let te=yr(4,ze),x=br*l;if(te>=x||-te>=x||(a=i-C,s=i-(C+a)+(a-r),a=t-I,u=t-(I+a)+(a-r),a=e-Y,c=e-(Y+a)+(a-o),a=n-A,d=n-(A+a)+(a-o),s===0&&c===0&&u===0&&d===0)||(x=vr*l+mr*Math.abs(te),te+=C*d+A*s-(Y*u+I*c),te>=x||-te>=x))return te;E=s*A,f=J*s,h=f-(f-s),g=s-h,f=J*A,v=f-(f-A),w=A-v,M=g*w-(E-h*v-g*v-h*w),k=c*I,f=J*c,h=f-(f-c),g=c-h,f=J*I,v=f-(f-I),w=I-v,b=g*w-(k-h*v-g*v-h*w),p=M-b,a=M-p,ee[0]=M-(p+a)+(a-b),S=E+p,a=S-E,L=E-(S-a)+(p-a),p=L-k,a=L-p,ee[1]=L-(p+a)+(a-k),_=S+p,a=_-S,ee[2]=S-(_-a)+(p-a),ee[3]=_;const F=Ct(4,ze,4,ee,_i);E=C*d,f=J*C,h=f-(f-C),g=C-h,f=J*d,v=f-(f-d),w=d-v,M=g*w-(E-h*v-g*v-h*w),k=Y*u,f=J*Y,h=f-(f-Y),g=Y-h,f=J*u,v=f-(f-u),w=u-v,b=g*w-(k-h*v-g*v-h*w),p=M-b,a=M-p,ee[0]=M-(p+a)+(a-b),S=E+p,a=S-E,L=E-(S-a)+(p-a),p=L-k,a=L-p,ee[1]=L-(p+a)+(a-k),_=S+p,a=_-S,ee[2]=S-(_-a)+(p-a),ee[3]=_;const fe=Ct(F,_i,4,ee,Ei);E=s*d,f=J*s,h=f-(f-s),g=s-h,f=J*d,v=f-(f-d),w=d-v,M=g*w-(E-h*v-g*v-h*w),k=c*u,f=J*c,h=f-(f-c),g=c-h,f=J*u,v=f-(f-u),w=u-v,b=g*w-(k-h*v-g*v-h*w),p=M-b,a=M-p,ee[0]=M-(p+a)+(a-b),S=E+p,a=S-E,L=E-(S-a)+(p-a),p=L-k,a=L-p,ee[1]=L-(p+a)+(a-k),_=S+p,a=_-S,ee[2]=S-(_-a)+(p-a),ee[3]=_;const ve=Ct(fe,Ei,4,ee,Li);return Li[ve-1]}function _r(i,e,t,n,r,o){const l=(e-o)*(t-r),s=(i-r)*(n-o),c=l-s,u=Math.abs(l+s);return Math.abs(c)>=pr*u?c:-wr(i,e,t,n,r,o,u)}const Xe=(i,e)=>i.ll.x<=e.x&&e.x<=i.ur.x&&i.ll.y<=e.y&&e.y<=i.ur.y,kt=(i,e)=>{if(e.ur.x<i.ll.x||i.ur.x<e.ll.x||e.ur.y<i.ll.y||i.ur.y<e.ll.y)return null;const t=i.ll.x<e.ll.x?e.ll.x:i.ll.x,n=i.ur.x<e.ur.x?i.ur.x:e.ur.x,r=i.ll.y<e.ll.y?e.ll.y:i.ll.y,o=i.ur.y<e.ur.y?i.ur.y:e.ur.y;return{ll:{x:t,y:r},ur:{x:n,y:o}}};let Ce=Number.EPSILON;Ce===void 0&&(Ce=Math.pow(2,-52));const Er=Ce*Ce,Si=(i,e)=>{if(-Ce<i&&i<Ce&&-Ce<e&&e<Ce)return 0;const t=i-e;return t*t<Er*i*e?0:i<e?-1:1};class Lr{constructor(){this.reset()}reset(){this.xRounder=new xi,this.yRounder=new xi}round(e,t){return{x:this.xRounder.round(e),y:this.yRounder.round(t)}}}class xi{constructor(){this.tree=new Lt,this.round(0)}round(e){const t=this.tree.add(e),n=this.tree.prev(t);if(n!==null&&Si(t.key,n.key)===0)return this.tree.remove(e),n.key;const r=this.tree.next(t);return r!==null&&Si(t.key,r.key)===0?(this.tree.remove(e),r.key):e}}const Ke=new Lr,nt=(i,e)=>i.x*e.y-i.y*e.x,Mi=(i,e)=>i.x*e.x+i.y*e.y,Ci=(i,e,t)=>{const n=_r(i.x,i.y,e.x,e.y,t.x,t.y);return n>0?-1:n<0?1:0},rt=i=>Math.sqrt(Mi(i,i)),Sr=(i,e,t)=>{const n={x:e.x-i.x,y:e.y-i.y},r={x:t.x-i.x,y:t.y-i.y};return nt(r,n)/rt(r)/rt(n)},xr=(i,e,t)=>{const n={x:e.x-i.x,y:e.y-i.y},r={x:t.x-i.x,y:t.y-i.y};return Mi(r,n)/rt(r)/rt(n)},ki=(i,e,t)=>e.y===0?null:{x:i.x+e.x/e.y*(t-i.y),y:t},Ni=(i,e,t)=>e.x===0?null:{x:t,y:i.y+e.y/e.x*(t-i.x)},Mr=(i,e,t,n)=>{if(e.x===0)return Ni(t,n,i.x);if(n.x===0)return Ni(i,e,t.x);if(e.y===0)return ki(t,n,i.y);if(n.y===0)return ki(i,e,t.y);const r=nt(e,n);if(r==0)return null;const o={x:t.x-i.x,y:t.y-i.y},l=nt(o,e)/r,s=nt(o,n)/r,c=i.x+s*e.x,u=t.x+l*n.x,d=i.y+s*e.y,a=t.y+l*n.y,f=(c+u)/2,h=(d+a)/2;return{x:f,y:h}};class se{static compare(e,t){const n=se.comparePoints(e.point,t.point);return n!==0?n:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:ke.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0}constructor(e,t){e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let n=0,r=t.length;n<r;n++){const o=t[n];this.point.events.push(o),o.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let t=0;t<e;t++){const n=this.point.events[t];if(n.segment.consumedBy===void 0)for(let r=t+1;r<e;r++){const o=this.point.events[r];o.consumedBy===void 0&&n.otherSE.point.events===o.otherSE.point.events&&n.segment.consume(o.segment)}}}getAvailableLinkedEvents(){const e=[];for(let t=0,n=this.point.events.length;t<n;t++){const r=this.point.events[t];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&e.push(r)}return e}getLeftmostComparator(e){const t=new Map,n=r=>{const o=r.otherSE;t.set(r,{sine:Sr(this.point,e.point,o.point),cosine:xr(this.point,e.point,o.point)})};return(r,o)=>{t.has(r)||n(r),t.has(o)||n(o);const{sine:l,cosine:s}=t.get(r),{sine:c,cosine:u}=t.get(o);return l>=0&&c>=0?s<u?1:s>u?-1:0:l<0&&c<0?s<u?-1:s>u?1:0:c<l?-1:c>l?1:0}}}let Cr=0;class ke{static compare(e,t){const n=e.leftSE.point.x,r=t.leftSE.point.x,o=e.rightSE.point.x,l=t.rightSE.point.x;if(l<n)return 1;if(o<r)return-1;const s=e.leftSE.point.y,c=t.leftSE.point.y,u=e.rightSE.point.y,d=t.rightSE.point.y;if(n<r){if(c<s&&c<u)return 1;if(c>s&&c>u)return-1;const a=e.comparePoint(t.leftSE.point);if(a<0)return 1;if(a>0)return-1;const f=t.comparePoint(e.rightSE.point);return f!==0?f:-1}if(n>r){if(s<c&&s<d)return-1;if(s>c&&s>d)return 1;const a=t.comparePoint(e.leftSE.point);if(a!==0)return a;const f=e.comparePoint(t.rightSE.point);return f<0?1:f>0?-1:1}if(s<c)return-1;if(s>c)return 1;if(o<l){const a=t.comparePoint(e.rightSE.point);if(a!==0)return a}if(o>l){const a=e.comparePoint(t.rightSE.point);if(a<0)return 1;if(a>0)return-1}if(o!==l){const a=u-s,f=o-n,h=d-c,g=l-r;if(a>f&&h<g)return 1;if(a<f&&h>g)return-1}return o>l?1:o<l||u<d?-1:u>d?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,n,r){this.id=++Cr,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=n,this.windings=r}static fromRing(e,t,n){let r,o,l;const s=se.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 se(r,!0),u=new se(o,!1);return new ke(c,u,[n],[l])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<t?e:t},ur:{x:this.rightSE.point.x,y:e>t?e:t}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}comparePoint(e){if(this.isAnEndpoint(e))return 0;const t=this.leftSE.point,n=this.rightSE.point,r=this.vector();if(t.x===n.x)return e.x===t.x?0:e.x<t.x?1:-1;const o=(e.y-t.y)/r.y,l=t.x+o*r.x;if(e.x===l)return 0;const s=(e.x-t.x)/r.x,c=t.y+s*r.y;return e.y===c?0:e.y<c?-1:1}getIntersection(e){const t=this.bbox(),n=e.bbox(),r=kt(t,n);if(r===null)return null;const o=this.leftSE.point,l=this.rightSE.point,s=e.leftSE.point,c=e.rightSE.point,u=Xe(t,s)&&this.comparePoint(s)===0,d=Xe(n,o)&&e.comparePoint(o)===0,a=Xe(t,c)&&this.comparePoint(c)===0,f=Xe(n,l)&&e.comparePoint(l)===0;if(d&&u)return f&&!a?l:!f&&a?c:null;if(d)return a&&o.x===c.x&&o.y===c.y?null:o;if(u)return f&&l.x===s.x&&l.y===s.y?null:s;if(f&&a)return null;if(f)return l;if(a)return c;const h=Mr(o,this.vector(),s,e.vector());return h===null||!Xe(r,h)?null:Ke.round(h.x,h.y)}split(e){const t=[],n=e.events!==void 0,r=new se(e,!0),o=new se(e,!1),l=this.rightSE;this.replaceRightSE(o),t.push(o),t.push(r);const s=new ke(r,l,this.rings.slice(),this.windings.slice());return se.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),se.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),o.checkForConsuming()),t}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,n=this.windings.length;t<n;t++)this.windings[t]*=-1}consume(e){let t=this,n=e;for(;t.consumedBy;)t=t.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const r=ke.compare(t,n);if(r!==0){if(r>0){const o=t;t=n,n=o}if(t.prev===n){const o=t;t=n,n=o}for(let o=0,l=n.rings.length;o<l;o++){const s=n.rings[o],c=n.windings[o],u=t.rings.indexOf(s);u===-1?(t.rings.push(s),t.windings.push(c)):t.windings[u]+=c}n.rings=null,n.windings=null,n.consumedBy=t,n.leftSE.consumedBy=t.leftSE,n.rightSE.consumedBy=t.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};const t=this._afterState.rings,n=this._afterState.windings,r=this._afterState.multiPolys;for(let s=0,c=this.rings.length;s<c;s++){const u=this.rings[s],d=this.windings[s],a=t.indexOf(u);a===-1?(t.push(u),n.push(d)):n[a]+=d}const o=[],l=[];for(let s=0,c=t.length;s<c;s++){if(n[s]===0)continue;const u=t[s],d=u.poly;if(l.indexOf(d)===-1)if(u.isExterior)o.push(d);else{l.indexOf(d)===-1&&l.push(d);const a=o.indexOf(u.poly);a!==-1&&o.splice(a,1)}}for(let s=0,c=o.length;s<c;s++){const u=o[s].multiPoly;r.indexOf(u)===-1&&r.push(u)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(ce.type){case"union":{const n=e.length===0,r=t.length===0;this._isInResult=n!==r;break}case"intersection":{let n,r;e.length<t.length?(n=e.length,r=t.length):(n=t.length,r=e.length),this._isInResult=r===ce.numMultiPolys&&n<r;break}case"xor":{const n=Math.abs(e.length-t.length);this._isInResult=n%2===1;break}case"difference":{const n=r=>r.length===1&&r[0].isSubject;this._isInResult=n(e)!==n(t);break}default:throw new Error(`Unrecognized operation type found ${ce.type}`)}return this._isInResult}}class Pi{constructor(e,t,n){if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=n,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const r=Ke.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=Ke.round(e[l][0],e[l][1]);c.x===o.x&&c.y===o.y||(this.segments.push(ke.fromRing(o,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),o=c)}(r.x!==o.x||r.y!==o.y)&&this.segments.push(ke.fromRing(o,r,this))}getSweepEvents(){const e=[];for(let t=0,n=this.segments.length;t<n;t++){const r=this.segments[t];e.push(r.leftSE),e.push(r.rightSE)}return e}}class kr{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Pi(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let n=1,r=e.length;n<r;n++){const o=new Pi(e[n],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=t}getSweepEvents(){const e=this.exteriorRing.getSweepEvents();for(let t=0,n=this.interiorRings.length;t<n;t++){const r=this.interiorRings[t].getSweepEvents();for(let o=0,l=r.length;o<l;o++)e.push(r[o])}return e}}class Ti{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof e[0][0][0]=="number"&&(e=[e])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let n=0,r=e.length;n<r;n++){const o=new kr(e[n],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=t}getSweepEvents(){const e=[];for(let t=0,n=this.polys.length;t<n;t++){const r=this.polys[t].getSweepEvents();for(let o=0,l=r.length;o<l;o++)e.push(r[o])}return e}}class ot{static factory(e){const t=[];for(let n=0,r=e.length;n<r;n++){const o=e[n];if(!o.isInResult()||o.ringOut)continue;let l=null,s=o.leftSE,c=o.rightSE;const u=[s],d=s.point,a=[];for(;l=s,s=c,u.push(s),s.point!==d;)for(;;){const f=s.getAvailableLinkedEvents();if(f.length===0){const v=u[0].point,w=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${v.x}, ${v.y}]. Last matching segment found ends at [${w.x}, ${w.y}].`)}if(f.length===1){c=f[0].otherSE;break}let h=null;for(let v=0,w=a.length;v<w;v++)if(a[v].point===s.point){h=v;break}if(h!==null){const v=a.splice(h)[0],w=u.splice(v.index);w.unshift(w[0].otherSE),t.push(new ot(w.reverse()));continue}a.push({index:u.length,point:s.point});const g=s.getLeftmostComparator(l);c=f.sort(g)[0].otherSE;break}t.push(new ot(u))}return t}constructor(e){this.events=e;for(let t=0,n=e.length;t<n;t++)e[t].segment.ringOut=this;this.poly=null}getGeom(){let e=this.events[0].point;const t=[e];for(let u=1,d=this.events.length-1;u<d;u++){const a=this.events[u].point,f=this.events[u+1].point;Ci(a,e,f)!==0&&(t.push(a),e=a)}if(t.length===1)return null;const n=t[0],r=t[1];Ci(n,e,r)===0&&t.shift(),t.push(t[0]);const o=this.isExteriorRing()?1:-1,l=this.isExteriorRing()?0:t.length-1,s=this.isExteriorRing()?t.length:-1,c=[];for(let u=l;u!=s;u+=o)c.push([t[u].x,t[u].y]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){const e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let e=this.events[0];for(let r=1,o=this.events.length;r<o;r++){const l=this.events[r];se.compare(e,l)>0&&(e=l)}let t=e.segment.prevInResult(),n=t?t.prevInResult():null;for(;;){if(!t)return null;if(!n)return t.ringOut;if(n.ringOut!==t.ringOut)return n.ringOut.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut.enclosingRing();t=n.prevInResult(),n=t?t.prevInResult():null}}}class Ri{constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){const e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(let t=0,n=this.interiorRings.length;t<n;t++){const r=this.interiorRings[t].getGeom();r!==null&&e.push(r)}return e}}class Nr{constructor(e){this.rings=e,this.polys=this._composePolys(e)}getGeom(){const e=[];for(let t=0,n=this.polys.length;t<n;t++){const r=this.polys[t].getGeom();r!==null&&e.push(r)}return e}_composePolys(e){const t=[];for(let n=0,r=e.length;n<r;n++){const o=e[n];if(!o.poly)if(o.isExteriorRing())t.push(new Ri(o));else{const l=o.enclosingRing();l.poly||t.push(new Ri(l)),l.poly.addInterior(o)}}return t}}class Pr{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ke.compare;this.queue=e,this.tree=new Lt(t),this.segments=[]}process(e){const t=e.segment,n=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),n;const r=e.isLeft?this.tree.add(t):this.tree.find(t);if(!r)throw new Error(`Unable to find segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] in SweepLine tree.`);let o=r,l=r,s,c;for(;s===void 0;)o=this.tree.prev(o),o===null?s=null:o.key.consumedBy===void 0&&(s=o.key);for(;c===void 0;)l=this.tree.next(l),l===null?c=null:l.key.consumedBy===void 0&&(c=l.key);if(e.isLeft){let u=null;if(s){const a=s.getIntersection(t);if(a!==null&&(t.isAnEndpoint(a)||(u=a),!s.isAnEndpoint(a))){const f=this._splitSafely(s,a);for(let h=0,g=f.length;h<g;h++)n.push(f[h])}}let d=null;if(c){const a=c.getIntersection(t);if(a!==null&&(t.isAnEndpoint(a)||(d=a),!c.isAnEndpoint(a))){const f=this._splitSafely(c,a);for(let h=0,g=f.length;h<g;h++)n.push(f[h])}}if(u!==null||d!==null){let a=null;u===null?a=d:d===null?a=u:a=se.comparePoints(u,d)<=0?u:d,this.queue.remove(t.rightSE),n.push(t.rightSE);const f=t.split(a);for(let h=0,g=f.length;h<g;h++)n.push(f[h])}n.length>0?(this.tree.remove(t),n.push(e)):(this.segments.push(t),t.prev=s)}else{if(s&&c){const u=s.getIntersection(c);if(u!==null){if(!s.isAnEndpoint(u)){const d=this._splitSafely(s,u);for(let a=0,f=d.length;a<f;a++)n.push(d[a])}if(!c.isAnEndpoint(u)){const d=this._splitSafely(c,u);for(let a=0,f=d.length;a<f;a++)n.push(d[a])}}}this.tree.remove(t)}return n}_splitSafely(e,t){this.tree.remove(e);const n=e.rightSE;this.queue.remove(n);const r=e.split(t);return r.push(n),e.consumedBy===void 0&&this.tree.add(e),r}}const Ii=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Tr=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Rr{run(e,t,n){ce.type=e,Ke.reset();const r=[new Ti(t,!0)];for(let a=0,f=n.length;a<f;a++)r.push(new Ti(n[a],!1));if(ce.numMultiPolys=r.length,ce.type==="difference"){const a=r[0];let f=1;for(;f<r.length;)kt(r[f].bbox,a.bbox)!==null?f++:r.splice(f,1)}if(ce.type==="intersection")for(let a=0,f=r.length;a<f;a++){const h=r[a];for(let g=a+1,v=r.length;g<v;g++)if(kt(h.bbox,r[g].bbox)===null)return[]}const o=new Lt(se.compare);for(let a=0,f=r.length;a<f;a++){const h=r[a].getSweepEvents();for(let g=0,v=h.length;g<v;g++)if(o.insert(h[g]),o.size>Ii)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const l=new Pr(o);let s=o.size,c=o.pop();for(;c;){const a=c.key;if(o.size===s){const h=a.segment;throw new Error(`Unable to pop() ${a.isLeft?"left":"right"} SweepEvent [${a.point.x}, ${a.point.y}] from segment #${h.id} [${h.leftSE.point.x}, ${h.leftSE.point.y}] -> [${h.rightSE.point.x}, ${h.rightSE.point.y}] from queue.`)}if(o.size>Ii)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(l.segments.length>Tr)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=l.process(a);for(let h=0,g=f.length;h<g;h++){const v=f[h];v.consumedBy===void 0&&o.insert(v)}s=o.size,c=o.pop()}Ke.reset();const u=ot.factory(l.segments);return new Nr(u).getGeom()}}const ce=new Rr;var Oi={union:function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return ce.run("union",i,t)},intersection:function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return ce.run("intersection",i,t)},xor:function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return ce.run("xor",i,t)},difference:function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return ce.run("difference",i,t)}};function Ir(i,e={}){const t=[];if(bt(i,r=>{t.push(r.coordinates)}),t.length<2)throw new Error("Must have at least 2 geometries");const n=Oi.union(t[0],...t.slice(1));return n.length===0?null:n.length===1?pt(n[0],e.properties):mi(n,e.properties)}var Ai=Ir;function Or(i){const e=[];if(bt(i,r=>{e.push(r.coordinates)}),e.length<2)throw new Error("Must have at least two features");const t=i.features[0].properties||{},n=Oi.difference(e[0],...e.slice(1));return n.length===0?null:n.length===1?pt(n[0],t):mi(n,t)}var Ar=Or;function Wr(i){if(!i)throw new Error("geojson is required");var e=[];return rr(i,function(t){e.push(t)}),Ve(e)}var zr=Wr;function Wi(i,e){const t=Ar(Ve([pt([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),i]));if(!t)return;t.properties={isMask:!0};const n=qe(vt(i)),r=(n[2]-n[0])/360/1e3,o=n[0]<-180,l=n[2]>180,s=zr(i);if(s.features.length>1&&(o||l))for(const c of s.features){const u=qe(vt(c));if(l&&u[0]<-180+r)for(const d of c.geometry.coordinates)for(const a of d)a[0]+=360-r;if(o&&u[2]>180-r)for(const d of c.geometry.coordinates)for(const a of d)a[0]-=360-r}e(Ve([s.features.length<2?i:Ai(s)??i,t]))}const zi=i=>{var n,r,o;const e=(n=i==null?void 0:i.geometry)==null?void 0:n.type,t=(r=i==null?void 0:i.properties)!=null&&r.isMask?0:e==="LineString"||e==="MultiLineString"?3:2;return{color:"#3170fe",fillColor:"#000",fillOpacity:(o=i==null?void 0:i.properties)!=null&&o.isMask?.1:0,weight:t,dashArray:[t,t],lineCap:"butt"}};function Bi(i,e=!0,t=!0,n={},r={},o=zi){let l;const s=[];let c,u;const d=ie.geoJSON(void 0,{style:o===!0?zi:o===!1?void 0:o??void 0,interactive:!1}).addTo(i),a=h=>{l==null||l({type:"mapClick",coordinates:[h.latlng.lng,h.latlng.lat]})};function f(h,g=!1){const v=document.createElement("div");return new In({props:{displayIn:"leaflet"},target:v}),new ie.Marker(h,{interactive:g,icon:new ie.DivIcon({html:v,className:"",iconAnchor:[12,26],iconSize:[25,30],tooltipAnchor:[1,-24]})})}return{setEventHandler(h){h?(l=h,i.on("click",a)):(l=void 0,i.off("click",a))},flyTo(h,g){i.flyTo([h[1],h[0]],g,{duration:2,...n})},fitBounds(h,g,v){i.flyToBounds([[h[1],h[0]],[h[3],h[2]]],{padding:[g,g],duration:2,...v?{maxZoom:v}:{},...r})},indicateReverse(h){i.getContainer().style.cursor=h?"crosshair":""},setReverseMarker(h){var v;if(!e)return;const g=h&&[h[1],h[0]];u?g?u.setLatLng(g):(u.remove(),u=void 0):g&&(e instanceof Function?u=e(i)??void 0:(u=(typeof e=="object"?new ie.Marker(g,e):f(g)).addTo(i),(v=u.getElement())==null||v.classList.add("marker-reverse")))},setFeatures(h,g,v){function w(p){d.clearLayers(),p&&d.addData(p)}for(const p of s)p.remove();if(s.length=0,w(),g){let p=!1;if(g.geometry.type==="GeometryCollection"){const S=g.geometry.geometries.filter(L=>L.type==="Polygon"||L.type==="MultiPolygon");e:if(S.length>0){const L=Ai(Ve(S.map(E=>He(E))));if(!L)break e;Wi({...g,geometry:L.geometry},w),p=!0}else{const L=g.geometry.geometries.filter(E=>E.type==="LineString"||E.type==="MultiLineString");L.length>0&&(w({...g,geometry:{type:"GeometryCollection",geometries:L}}),p=!0)}}if(!p){if(g.geometry.type==="Polygon"||g.geometry.type==="MultiPolygon")Wi(g,S=>{if(!S)return;const L=[...S.features],E=qe(vt(g)),M=E[2]-E[0];E[0]-M/4<-180&&L.push(...Di(S,-360).features),E[2]+M/4>180&&L.push(...Di(S,360).features),w(Ve(L))});else if(g.geometry.type==="LineString"||g.geometry.type==="MultiLineString"){w(g);return}}if(!v&&g.geometry.type!=="Point")return;if(e instanceof Function){const S=e(i,g);S&&s.push(S.addTo(i))}else if(e){const S=[g.center[1],g.center[0]];s.push(typeof e=="object"?new ie.Marker(S,e):f(S).addTo(i))}}if(t)for(const p of h??[]){if(p===g)continue;const S=[p.center[1],p.center[0]];let L;if(t instanceof Function){if(L=t(i,p),!L)continue}else L=(typeof t=="object"?new ie.Marker(S,t):f(S,!0)).addTo(i).bindTooltip(p.place_type[0]==="reverse"?p.place_name:p.place_name.replace(/,.*/,""),{direction:"top"});const E=L.getElement();E&&(E.addEventListener("click",M=>{M.stopPropagation(),l==null||l({type:"markerClick",id:p.id})}),E.addEventListener("mouseenter",()=>{l==null||l({type:"markerMouseEnter",id:p.id})}),E.addEventListener("mouseleave",()=>{l==null||l({type:"markerMouseLeave",id:p.id})}),E.classList.toggle("marker-fuzzy",!!p.matching_text)),s.push(L)}},setSelectedMarker(h){var g,v;c&&((g=c.getElement())==null||g.classList.toggle("marker-selected",!1)),c=h>-1?s[h]:void 0,(v=c==null?void 0:c.getElement())==null||v.classList.toggle("marker-selected",!0)},getCenterAndZoom(){const h=i.getCenter();return[i.getZoom(),h.lng,h.lat]}}}function Di(i,e){const t=ur(i);for(const n of t.features)if(n.geometry.type=="MultiPolygon")for(const r of n.geometry.coordinates)Fi(r,e);else Fi(n.geometry.coordinates,e);return t}function Fi(i,e){for(const t of i)for(const n of t)n[0]+=e}class Ui extends ie.Control{}ie.Util.extend(Ui.prototype,ie.Evented.prototype);class Gi extends Ui{constructor(t){super(t);Gt(this,le);Gt(this,Te);jt(this,Te,t)}onAdd(t){const n=document.createElement("div");n.className="leaflet-ctrl-geocoder",ie.DomEvent.disableClickPropagation(n),ie.DomEvent.disableScrollPropagation(n);const{marker:r,showResultMarkers:o,flyTo:l,fullGeometryStyle:s,position:c,...u}=ue(this,Te),d=typeof l=="boolean"?{}:l,a=Bi(t,r,o,d,d,s);jt(this,le,new nr({target:n,props:{mapController:a,flyTo:l===void 0?!0:!!l,...u}}));const f={select:void 0,pick:void 0,featureslisted:void 0,featuresmarked:void 0,response:void 0,optionsvisibilitychange:void 0,reversetoggle:void 0,querychange:void 0};for(const h in f)ue(this,le).$on(h,g=>this.fire(h,g.detail));return n}setOptions(t){var c;Object.assign(ue(this,Te),t);const{marker:n,showResultMarkers:r,flyTo:o,fullGeometryStyle:l,...s}=ue(this,Te);(c=ue(this,le))==null||c.$set(s)}setQuery(t,n=!0){var r;(r=ue(this,le))==null||r.setQuery(t,n)}clearMap(){var t;(t=ue(this,le))==null||t.clearMap()}clearList(){var t;(t=ue(this,le))==null||t.clearList()}focus(){var t;(t=ue(this,le))==null||t.focus()}blur(){var t;(t=ue(this,le))==null||t.blur()}onRemove(){var t;(t=ue(this,le))==null||t.$destroy()}}le=new WeakMap,Te=new WeakMap;function Br(...i){return new Gi(...i)}window.L&&typeof window.L=="object"&&typeof window.L.control=="function"&&(window.L.control.maptilerGeocoding=Br),O.GeocodingControl=Gi,O.createLeafletMapController=Bi,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});
|
|
23
23
|
//# sourceMappingURL=leaflet.umd.js.map
|