@maptiler/geocoding-control 2.1.0-rc1 → 2.1.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/leaflet-controller.js +1942 -1523
- package/leaflet-controller.js.map +1 -1
- package/leaflet-controller.umd.js +1 -22
- package/leaflet-controller.umd.js.map +1 -1
- package/leaflet.js +2800 -2368
- package/leaflet.js.map +1 -1
- package/leaflet.umd.js +1 -22
- package/leaflet.umd.js.map +1 -1
- package/maplibregl-controller.js +1918 -1498
- package/maplibregl-controller.js.map +1 -1
- package/maplibregl-controller.umd.js +1 -22
- package/maplibregl-controller.umd.js.map +1 -1
- package/maplibregl.js +2858 -2425
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +1 -22
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.js +2863 -2428
- package/maptilersdk.js.map +1 -1
- package/maptilersdk.umd.js +1 -22
- package/maptilersdk.umd.js.map +1 -1
- package/openlayers-controller.js +1686 -1264
- package/openlayers-controller.js.map +1 -1
- package/openlayers-controller.umd.js +1 -22
- package/openlayers-controller.umd.js.map +1 -1
- package/openlayers.js +2785 -2353
- package/openlayers.js.map +1 -1
- package/openlayers.umd.js +1 -22
- package/openlayers.umd.js.map +1 -1
- package/package.json +19 -19
- package/react.js +800 -784
- package/react.js.map +1 -1
- package/react.umd.js +1 -1
- package/react.umd.js.map +1 -1
- package/{MapLibreBasedGeocodingControl.d.ts → src/MapLibreBasedGeocodingControl.d.ts} +35 -69
- package/{maplibregl.d.ts → src/maplibregl.d.ts} +34 -68
- package/{maptilersdk.d.ts → src/maptilersdk.d.ts} +34 -68
- package/src/types.d.ts +391 -0
- package/svelte/GeocodingControl.svelte +55 -14
- package/svelte/GeocodingControl.svelte.d.ts +5 -2
- package/svelte/MapLibreBasedGeocodingControl.d.ts +35 -69
- package/svelte/maplibregl.d.ts +34 -68
- package/svelte/maptilersdk.d.ts +34 -68
- package/svelte/maptilersdk.js +2 -0
- package/svelte/react.js +3 -0
- package/svelte/types.d.ts +175 -127
- package/vanilla.js +870 -857
- package/vanilla.js.map +1 -1
- package/vanilla.umd.js +1 -1
- package/vanilla.umd.js.map +1 -1
- package/types.d.ts +0 -343
- /package/{geo-coordinates-parser.t.d.ts → src/geo-coordinates-parser.t.d.ts} +0 -0
- /package/{geoUtils.d.ts → src/geoUtils.d.ts} +0 -0
- /package/{leaflet-controller.d.ts → src/leaflet-controller.d.ts} +0 -0
- /package/{leaflet.d.ts → src/leaflet.d.ts} +0 -0
- /package/{maplibregl-controller.d.ts → src/maplibregl-controller.d.ts} +0 -0
- /package/{mask.d.ts → src/mask.d.ts} +0 -0
- /package/{openlayers-controller.d.ts → src/openlayers-controller.d.ts} +0 -0
- /package/{openlayers.d.ts → src/openlayers.d.ts} +0 -0
- /package/{proximity.d.ts → src/proximity.d.ts} +0 -0
- /package/{react.d.ts → src/react.d.ts} +0 -0
- /package/{vanilla.d.ts → src/vanilla.d.ts} +0 -0
package/openlayers.umd.js
CHANGED
|
@@ -1,23 +1,2 @@
|
|
|
1
|
-
(function(N,D){typeof exports=="object"&&typeof module<"u"?D(exports,require("ol/control"),require("ol/events/Event"),require("ol"),require("ol/geom"),require("ol/layer/Vector"),require("ol/proj"),require("ol/source/Vector"),require("ol/style/Fill"),require("ol/style/Icon"),require("ol/style/Stroke"),require("ol/style/Style"),require("ol/style/Text")):typeof define=="function"&&define.amd?define(["exports","ol/control","ol/events/Event","ol","ol/geom","ol/layer/Vector","ol/proj","ol/source/Vector","ol/style/Fill","ol/style/Icon","ol/style/Stroke","ol/style/Style","ol/style/Text"],D):(N=typeof globalThis<"u"?globalThis:N||self,D(N.openlayersMaptilerGeocoder={},N.ol.control,N.ol.events.Event,N.ol,N.ol.geom,N.ol.layer.Vector,N.ol.proj,N.ol.source.Vector,N.ol.style.Fill,N.ol.style.Icon,N.ol.style.Stroke,N.ol.style.Style,N.ol.style.Text))})(this,function(N,D,B,le,ue,un,Le,an,Kt,cn,Jt,fn,dn){"use strict";var _o=Object.defineProperty;var sn=N=>{throw TypeError(N)};var Eo=(N,D,B)=>D in N?_o(N,D,{enumerable:!0,configurable:!0,writable:!0,value:B}):N[D]=B;var ce=(N,D,B)=>Eo(N,typeof D!="symbol"?D+"":D,B),ln=(N,D,B)=>D.has(N)||sn("Cannot "+B);var K=(N,D,B)=>(ln(N,D,"read from private field"),B?B.call(N):D.get(N)),Yt=(N,D,B)=>D.has(N)?sn("Cannot add the same private member more than once"):D instanceof WeakSet?D.add(N):D.set(N,B),Xt=(N,D,B,le)=>(ln(N,D,"write to private field"),le?le.call(N,B):D.set(N,B),B);var Y,ze;function q(){}function hn(n,e){for(const t in e)n[t]=e[t];return n}function $t(n){return n()}function ei(){return Object.create(null)}function pe(n){n.forEach($t)}function ti(n){return typeof n=="function"}function Te(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let tt;function ee(n,e){return n===e?!0:(tt||(tt=document.createElement("a")),tt.href=e,n===tt.href)}function gn(n){return Object.keys(n).length===0}function mn(n,e,t,i){if(n){const r=ii(n,e,t,i);return n[0](r)}}function ii(n,e,t,i){return n[1]&&i?hn(t.ctx.slice(),n[1](i(e))):t.ctx}function yn(n,e,t,i){if(n[2]&&i){const r=n[2](i(t));if(e.dirty===void 0)return r;if(typeof r=="object"){const o=[],l=Math.max(e.dirty.length,r.length);for(let s=0;s<l;s+=1)o[s]=e.dirty[s]|r[s];return o}return e.dirty|r}return e.dirty}function pn(n,e,t,i,r,o){if(r){const l=ii(e,t,i,o);n.p(l,r)}}function vn(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let i=0;i<t;i++)e[i]=-1;return e}return-1}function it(n){return n??""}function z(n,e){n.appendChild(e)}function j(n,e,t){n.insertBefore(e,t||null)}function G(n){n.parentNode&&n.parentNode.removeChild(n)}function U(n){return document.createElement(n)}function ve(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function Se(n){return document.createTextNode(n)}function re(){return Se(" ")}function bn(){return Se("")}function J(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function wn(n){return function(e){return e.preventDefault(),n.call(this,e)}}function y(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function _n(n){return Array.from(n.childNodes)}function Qe(n,e){e=""+e,n.data!==e&&(n.data=e)}function ni(n,e){n.value=e??""}function Fe(n,e,t){n.classList.toggle(e,!!t)}function En(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}let Ze;function He(n){Ze=n}function ri(){if(!Ze)throw new Error("Function called outside component initialization");return Ze}function Ln(n){ri().$$.on_destroy.push(n)}function oi(){const n=ri();return(e,t,{cancelable:i=!1}={})=>{const r=n.$$.callbacks[e];if(r){const o=En(e,t,{cancelable:i});return r.slice().forEach(l=>{l.call(n,o)}),!o.defaultPrevented}return!0}}function Sn(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Ue=[],wt=[];let De=[];const si=[],xn=Promise.resolve();let _t=!1;function Mn(){_t||(_t=!0,xn.then(li))}function Et(n){De.push(n)}const Lt=new Set;let Be=0;function li(){if(Be!==0)return;const n=Ze;do{try{for(;Be<Ue.length;){const e=Ue[Be];Be++,He(e),kn(e.$$)}}catch(e){throw Ue.length=0,Be=0,e}for(He(null),Ue.length=0,Be=0;wt.length;)wt.pop()();for(let e=0;e<De.length;e+=1){const t=De[e];Lt.has(t)||(Lt.add(t),t())}De.length=0}while(Ue.length);for(;si.length;)si.pop()();_t=!1,Lt.clear(),He(n)}function kn(n){if(n.fragment!==null){n.update(),pe(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Et)}}function Cn(n){const e=[],t=[];De.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),De=e}const nt=new Set;let Re;function rt(){Re={r:0,c:[],p:Re}}function ot(){Re.r||pe(Re.c),Re=Re.p}function Z(n,e){n&&n.i&&(nt.delete(n),n.i(e))}function $(n,e,t,i){if(n&&n.o){if(nt.has(n))return;nt.add(n),Re.c.push(()=>{nt.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}function ui(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function Pn(n,e){$(n,1,1,()=>{e.delete(n.key)})}function Nn(n,e,t,i,r,o,l,s,c,u,f,a){let d=n.length,g=o.length,m=d;const p={};for(;m--;)p[n[m].key]=m;const b=[],v=new Map,w=new Map,E=[];for(m=g;m--;){const x=a(r,o,m),S=t(x);let T=l.get(S);T?E.push(()=>T.p(x,e)):(T=u(S,x),T.c()),v.set(S,b[m]=T),S in p&&w.set(S,Math.abs(m-p[S]))}const L=new Set,R=new Set;function P(x){Z(x,1),x.m(s,f),l.set(x.key,x),f=x.first,g--}for(;d&&g;){const x=b[g-1],S=n[d-1],T=x.key,_=S.key;x===S?(f=x.first,d--,g--):v.has(_)?!l.has(T)||L.has(T)?P(x):R.has(_)?d--:w.get(T)>w.get(_)?(R.add(T),P(x)):(L.add(_),d--):(c(S,l),d--)}for(;d--;){const x=n[d];v.has(x.key)||c(x,l)}for(;g;)P(b[g-1]);return pe(E),b}function xe(n){n&&n.c()}function be(n,e,t){const{fragment:i,after_update:r}=n.$$;i&&i.m(e,t),Et(()=>{const o=n.$$.on_mount.map($t).filter(ti);n.$$.on_destroy?n.$$.on_destroy.push(...o):pe(o),n.$$.on_mount=[]}),r.forEach(Et)}function we(n,e){const t=n.$$;t.fragment!==null&&(Cn(t.after_update),pe(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Tn(n,e){n.$$.dirty[0]===-1&&(Ue.push(n),Mn(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function Ie(n,e,t,i,r,o,l=null,s=[-1]){const c=Ze;He(n);const u=n.$$={fragment:null,ctx:[],props:o,update:q,not_equal:r,bound:ei(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:ei(),dirty:s,skip_bound:!1,root:e.target||c.$$.root};l&&l(u.root);let f=!1;if(u.ctx=t?t(n,e.props||{},(a,d,...g)=>{const m=g.length?g[0]:d;return u.ctx&&r(u.ctx[a],u.ctx[a]=m)&&(!u.skip_bound&&u.bound[a]&&u.bound[a](m),f&&Tn(n,a)),d}):[],u.update(),f=!0,pe(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const a=_n(e.target);u.fragment&&u.fragment.l(a),a.forEach(G)}else u.fragment&&u.fragment.c();e.intro&&Z(n.$$.fragment),be(n,e.target,e.anchor),li()}He(c)}class Oe{constructor(){ce(this,"$$");ce(this,"$$set")}$destroy(){we(this,1),this.$destroy=q}$on(e,t){if(!ti(t))return q;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const r=i.indexOf(t);r!==-1&&i.splice(r,1)}}$set(e){this.$$set&&!gn(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Rn="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Rn);function In(n){let e,t;return{c(){e=ve("svg"),t=ve("path"),y(t,"d","M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"),y(e,"viewBox","0 0 14 14"),y(e,"width","13"),y(e,"height","13"),y(e,"class","svelte-en2qvf")},m(i,r){j(i,e,r),z(e,t)},p:q,i:q,o:q,d(i){i&&G(e)}}}class ai extends Oe{constructor(e){super(),Ie(this,e,null,In,Te,{})}}function On(n){let e,t;return{c(){e=ve("svg"),t=ve("path"),y(t,"d","M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"),y(e,"viewBox","0 0 30 30"),y(e,"fill","none"),y(e,"xmlns","http://www.w3.org/2000/svg"),y(e,"class","svelte-d2loi5")},m(i,r){j(i,e,r),z(e,t)},p:q,i:q,o:q,d(i){i&&G(e)}}}class ci extends Oe{constructor(e){super(),Ie(this,e,null,On,Te,{})}}function zn(n){let e,t;return{c(){e=U("img"),ee(e.src,t=n[3]+"area.svg")||y(e,"src",t),y(e,"alt",n[6]),y(e,"title",n[6]),y(e,"class","svelte-z7p9pp")},m(i,r){j(i,e,r)},p(i,r){r&8&&!ee(e.src,t=i[3]+"area.svg")&&y(e,"src",t),r&64&&y(e,"alt",i[6]),r&64&&y(e,"title",i[6])},d(i){i&&G(e)}}}function Wn(n){let e,t;return{c(){e=U("img"),ee(e.src,t=n[3]+"reverse.svg")||y(e,"src",t),y(e,"alt",n[6]),y(e,"title",n[6]),y(e,"class","svelte-z7p9pp")},m(i,r){j(i,e,r)},p(i,r){r&8&&!ee(e.src,t=i[3]+"reverse.svg")&&y(e,"src",t),r&64&&y(e,"alt",i[6]),r&64&&y(e,"title",i[6])},d(i){i&&G(e)}}}function An(n){let e,t;return{c(){e=U("img"),ee(e.src,t=n[3]+"poi.svg")||y(e,"src",t),y(e,"alt",n[6]),y(e,"title",n[6]),y(e,"class","svelte-z7p9pp")},m(i,r){j(i,e,r)},p(i,r){r&8&&!ee(e.src,t=i[3]+"poi.svg")&&y(e,"src",t),r&64&&y(e,"alt",i[6]),r&64&&y(e,"title",i[6])},d(i){i&&G(e)}}}function Fn(n){let e,t;return{c(){e=U("img"),ee(e.src,t=n[3]+"postal_code.svg")||y(e,"src",t),y(e,"alt",n[6]),y(e,"title",n[6]),y(e,"class","svelte-z7p9pp")},m(i,r){j(i,e,r)},p(i,r){r&8&&!ee(e.src,t=i[3]+"postal_code.svg")&&y(e,"src",t),r&64&&y(e,"alt",i[6]),r&64&&y(e,"title",i[6])},d(i){i&&G(e)}}}function Un(n){let e,t;return{c(){e=U("img"),ee(e.src,t=n[3]+"street.svg")||y(e,"src",t),y(e,"alt",n[6]),y(e,"title",n[6]),y(e,"class","svelte-z7p9pp")},m(i,r){j(i,e,r)},p(i,r){r&8&&!ee(e.src,t=i[3]+"street.svg")&&y(e,"src",t),r&64&&y(e,"alt",i[6]),r&64&&y(e,"title",i[6])},d(i){i&&G(e)}}}function Dn(n){let e,t;return{c(){e=U("img"),ee(e.src,t=n[3]+"road.svg")||y(e,"src",t),y(e,"alt",n[6]),y(e,"title",n[6]),y(e,"class","svelte-z7p9pp")},m(i,r){j(i,e,r)},p(i,r){r&8&&!ee(e.src,t=i[3]+"road.svg")&&y(e,"src",t),r&64&&y(e,"alt",i[6]),r&64&&y(e,"title",i[6])},d(i){i&&G(e)}}}function Bn(n){let e,t;return{c(){e=U("img"),ee(e.src,t=n[3]+"housenumber.svg")||y(e,"src",t),y(e,"alt",n[6]),y(e,"title",n[6]),y(e,"class","svelte-z7p9pp")},m(i,r){j(i,e,r)},p(i,r){r&8&&!ee(e.src,t=i[3]+"housenumber.svg")&&y(e,"src",t),r&64&&y(e,"alt",i[6]),r&64&&y(e,"title",i[6])},d(i){i&&G(e)}}}function Gn(n){let e,t,i,r;return{c(){e=U("img"),ee(e.src,t=n[5])||y(e,"src",t),y(e,"alt",n[4]),y(e,"title",n[6]),y(e,"class","svelte-z7p9pp")},m(o,l){j(o,e,l),i||(r=J(e,"error",n[14]),i=!0)},p(o,l){l&32&&!ee(e.src,t=o[5])&&y(e,"src",t),l&16&&y(e,"alt",o[4]),l&64&&y(e,"title",o[6])},d(o){o&&G(e),i=!1,r()}}}function fi(n){let e,t;return{c(){e=U("span"),t=Se(n[6]),y(e,"class","secondary svelte-z7p9pp")},m(i,r){j(i,e,r),z(e,t)},p(i,r){r&64&&Qe(t,i[6])},d(i){i&&G(e)}}}function qn(n){let e,t,i,r,o,l,s,c,u,f=(n[8]?n[0].place_name:n[0].place_name.replace(/,.*/,""))+"",a,d,g=n[2]==="always"||n[2]!=="never"&&!n[0].address&&!n[0].id.startsWith("road.")&&!n[0].id.startsWith("address.")&&!n[0].id.startsWith("postal_code.")&&(!n[0].id.startsWith("poi.")||!n[5])&&!n[8],m,p,b=(n[8]?"":n[0].place_name.replace(/[^,]*,?\s*/,""))+"",v,w,E,L,R,P;function x(M,I){return I&1&&(t=null),I&1&&(i=null),I&1&&(r=null),I&1&&(o=null),M[5]?Gn:M[0].address?Bn:(t==null&&(t=!!M[0].id.startsWith("road.")),t?Dn:(i==null&&(i=!!M[0].id.startsWith("address.")),i?Un:(r==null&&(r=!!M[0].id.startsWith("postal_code.")),r?Fn:(o==null&&(o=!!M[0].id.startsWith("poi.")),o?An:M[8]?Wn:zn))))}let S=x(n,-1),T=S(n),_=g&&fi(n);return{c(){e=U("li"),T.c(),l=re(),s=U("span"),c=U("span"),u=U("span"),a=Se(f),d=re(),_&&_.c(),m=re(),p=U("span"),v=Se(b),y(u,"class","primary svelte-z7p9pp"),y(c,"class","svelte-z7p9pp"),y(p,"class","line2 svelte-z7p9pp"),y(s,"class","texts svelte-z7p9pp"),y(e,"tabindex","-1"),y(e,"role","option"),y(e,"aria-selected",w=n[1]==="selected"),y(e,"aria-checked",E=n[1]==="picked"),y(e,"class",L=it(n[1])+" svelte-z7p9pp")},m(M,I){j(M,e,I),T.m(e,null),z(e,l),z(e,s),z(s,c),z(c,u),z(u,a),z(c,d),_&&_.m(c,null),z(s,m),z(s,p),z(p,v),R||(P=[J(e,"mouseenter",n[13]),J(e,"focus",n[15]),J(e,"click",n[16])],R=!0)},p(M,[I]){S===(S=x(M,I))&&T?T.p(M,I):(T.d(1),T=S(M),T&&(T.c(),T.m(e,l))),I&1&&f!==(f=(M[8]?M[0].place_name:M[0].place_name.replace(/,.*/,""))+"")&&Qe(a,f),I&37&&(g=M[2]==="always"||M[2]!=="never"&&!M[0].address&&!M[0].id.startsWith("road.")&&!M[0].id.startsWith("address.")&&!M[0].id.startsWith("postal_code.")&&(!M[0].id.startsWith("poi.")||!M[5])&&!M[8]),g?_?_.p(M,I):(_=fi(M),_.c(),_.m(c,null)):_&&(_.d(1),_=null),I&1&&b!==(b=(M[8]?"":M[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&Qe(v,b),I&2&&w!==(w=M[1]==="selected")&&y(e,"aria-selected",w),I&2&&E!==(E=M[1]==="picked")&&y(e,"aria-checked",E),I&2&&L!==(L=it(M[1])+" svelte-z7p9pp")&&y(e,"class",L)},i:q,o:q,d(M){M&&G(e),T.d(),_&&_.d(),R=!1,pe(P)}}}function jn(n,e,t){var R;let i,r,{feature:o}=e,{style:l="default"}=e,{showPlaceType:s}=e,{missingIconsCache:c}=e,{iconsBaseUrl:u}=e;const f=oi(),a=(R=o.properties)==null?void 0:R.categories;let d,g,m=0,p=o.place_type[0]==="reverse";function b(){g&&c.add(g),t(11,m++,m)}function v(P){Sn.call(this,n,P)}const w=()=>b(),E=()=>f("select",void 0),L=P=>{document.activeElement!==P.target&&f("select",void 0)};return n.$$set=P=>{"feature"in P&&t(0,o=P.feature),"style"in P&&t(1,l=P.style),"showPlaceType"in P&&t(2,s=P.showPlaceType),"missingIconsCache"in P&&t(10,c=P.missingIconsCache),"iconsBaseUrl"in P&&t(3,u=P.iconsBaseUrl)},n.$$.update=()=>{var P,x,S,T;if(n.$$.dirty&7224)do t(12,i--,i),t(4,d=a==null?void 0:a[i]),t(5,g=d?u+d.replace(/ /g,"_")+".svg":void 0);while(i>-1&&(!g||c.has(g)));n.$$.dirty&1&&t(6,r=((x=(P=o.properties)==null?void 0:P.categories)==null?void 0:x.join(", "))??((T=(S=o.properties)==null?void 0:S.place_type_name)==null?void 0:T[0])??o.place_type[0])},t(12,i=(a==null?void 0:a.length)??0),[o,l,s,u,d,g,r,f,p,b,c,m,i,v,w,E,L]}class Vn extends Oe{constructor(e){super(),Ie(this,e,jn,qn,Te,{feature:0,style:1,showPlaceType:2,missingIconsCache:10,iconsBaseUrl:3})}}function Qn(n){let e;return{c(){e=U("div"),e.innerHTML='<svg viewBox="0 0 18 18" width="24" height="24" class="svelte-7cmwmc"><path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"></path><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"></path></svg>',y(e,"class","svelte-7cmwmc")},m(t,i){j(t,e,i)},p:q,i:q,o:q,d(t){t&&G(e)}}}class Zn extends Oe{constructor(e){super(),Ie(this,e,null,Qn,Te,{})}}function Hn(n){let e,t;return{c(){e=ve("svg"),t=ve("path"),y(t,"d","M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"),y(e,"viewBox","0 0 60.006 21.412"),y(e,"width","14"),y(e,"height","20"),y(e,"class","svelte-en2qvf")},m(i,r){j(i,e,r),z(e,t)},p:q,i:q,o:q,d(i){i&&G(e)}}}class Yn extends Oe{constructor(e){super(),Ie(this,e,null,Hn,Te,{})}}function Xn(n){let e,t,i;return{c(){e=ve("svg"),t=ve("circle"),i=ve("path"),y(t,"cx","4.789"),y(t,"cy","4.787"),y(t,"r","3.85"),y(t,"class","svelte-1aq105l"),y(i,"d","M12.063 12.063 7.635 7.635"),y(i,"class","svelte-1aq105l"),y(e,"xmlns","http://www.w3.org/2000/svg"),y(e,"width","13"),y(e,"height","13"),y(e,"viewBox","0 0 13 13"),y(e,"class","svelte-1aq105l")},m(r,o){j(r,e,o),z(e,t),z(e,i)},p:q,i:q,o:q,d(r){r&&G(e)}}}class Kn extends Oe{constructor(e){super(),Ie(this,e,null,Xn,Te,{})}}function Jn(n,e,t){const i=e[1],r=e[0],o=i-r;return n===i&&t?n:((n-r)%o+o)%o+r}function st(n){const e=[...n];return e[2]<e[0]&&(Math.abs((e[0]+e[2]+360)/2)>Math.abs((e[0]-360+e[2])/2)?e[0]-=360:e[2]+=360),e}let Ye;async function $n(n,e,t){const i=n==null?void 0:n.getCenterAndZoom();for(const r of e??[])if(!(i&&(r.minZoom!=null&&r.minZoom>i[0]||r.maxZoom!=null&&r.maxZoom<i[0]))){if(r.type==="fixed")return r.coordinates.join(",");e:if(r.type==="client-geolocation"){if(Ye&&r.cachedLocationExpiry&&Ye.time+r.cachedLocationExpiry>Date.now()){if(!Ye.coords)break e;return Ye.coords}let o;try{return o=await new Promise((l,s)=>{t.signal.addEventListener("abort",()=>{s(Error("aborted"))}),navigator.geolocation.getCurrentPosition(c=>{l([c.coords.longitude,c.coords.latitude].map(u=>u.toFixed(6)).join(","))},c=>{s(c)},r)}),o}catch{}finally{r.cachedLocationExpiry&&(Ye={time:Date.now(),coords:o})}if(t.signal.aborted)return}if(r.type==="server-geolocation")return"ip";if(i&&r.type==="map-center")return i[1].toFixed(6)+","+i[2].toFixed(6)}}const er=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(EAST|WEST|[EW])?$/i,di=/^([+-]?[0-8]?[0-9])\s+([0-5]?[0-9]\.\d{3,})[\s,]{1,}([+-]?[0-1]?[0-9]?[0-9])\s+([0-5]?[0-9]\.\d{3,})$/,hi=/^(NORTH|SOUTH|[NS])?[\s]*([+-]?[0-8]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(NORTH|SOUTH|[NS])?[\s]*[,/;]?[\s]*(EAST|WEST|[EW])?[\s]*([+-]?[0-1]?[0-9]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(EAST|WEST|[EW])?$/i,gi=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(EAST|WEST|[EW])?$/i,mi=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)\s*(EAST|WEST|[EW])?$/i,yi=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|’’|´´|["″”\.])?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|´´|’’|["″”\.])?\s*(EAST|WEST|[EW])?$/i;function tr(n){if(!["DMS","DM","DD"].includes(n))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){const e=this.decimalCoordinates.split(",").map(g=>Number(g.trim())),t=Number(e[0]),i=Number(e[1]),r=Math.abs(t),o=Math.abs(i),l=t>0?"N":"S",s=i>0?"E":"W";let c;n=="DD"&&(c=`${r}° ${l}, ${o}° ${s}`);const u=Math.floor(r),f=Math.floor(o),a=(r-u)*60,d=(o-f)*60;if(n=="DM"){let g=pi(a,3).toFixed(3).padStart(6,"0"),m=pi(d,3).toFixed(3).padStart(6,"0");g.endsWith(".000")&&m.endsWith(".000")&&(g=g.replace(/\.000$/,""),m=m.replace(/\.000$/,"")),c=`${u}° ${g}' ${l}, ${f}° ${m}' ${s}`}if(n=="DMS"){const g=Math.floor(a),m=Math.floor(d);let p=((a-g)*60).toFixed(1).padStart(4,"0"),b=((d-m)*60).toFixed(1).padStart(4,"0");const v=g.toString().padStart(2,"0"),w=m.toString().padStart(2,"0");p.endsWith(".0")&&b.endsWith(".0")&&(p=p.replace(/\.0$/,""),b=b.replace(/\.0$/,"")),c=`${u}° ${v}' ${p}" ${l}, ${f}° ${w}' ${b}" ${s}`}return c}else throw new Error("no decimal coordinates to convert")}function pi(n,e){const t=Math.pow(10,e);return Math.round((n+Number.EPSILON)*t)/t}function St(n,e){e||(e=5),n=n.replace(/\s+/g," ").trim();let t=null,i=null,r="",o="",l=null,s=[],c=!1;if(er.test(n))throw new Error("invalid coordinate value");if(di.test(n))if(s=di.exec(n),c=Xe(s),c)t=Math.abs(s[1])+s[2]/60,Number(s[1])<0&&(t*=-1),i=Math.abs(s[3])+s[4]/60,Number(s[3])<0&&(i*=-1),l="DM";else throw new Error("invalid coordinate format");else if(hi.test(n))if(s=hi.exec(n),c=Xe(s),c){if(t=s[2],i=s[6],t.includes(",")&&(t=t.replace(",",".")),i.includes(",")&&(i=i.replace(",",".")),l="DD",Number(Math.round(t))==Number(t))throw new Error("integer only coordinate provided");if(Number(Math.round(i))==Number(i))throw new Error("integer only coordinate provided");s[1]?(r=s[1],o=s[5]):s[4]&&(r=s[4],o=s[8])}else throw new Error("invalid decimal coordinate format");else if(gi.test(n))if(s=gi.exec(n),c=Xe(s),c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,l="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,l="DMS"),parseInt(s[2])<0&&(t=-1*t),i=Math.abs(parseInt(s[9])),s[11]&&(i+=s[11]/60),s[13]&&(i+=s[13].replace(",",".")/3600),parseInt(s[9])<0&&(i=-1*i),s[1]?(r=s[1],o=s[8]):s[7]&&(r=s[7],o=s[14]);else throw new Error("invalid DMS coordinates format");else if(mi.test(n))if(s=mi.exec(n),c=Xe(s),c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,l="DM"),s[6]&&(t+=s[6]/3600,l="DMS"),parseInt(s[2])<0&&(t=-1*t),i=Math.abs(parseInt(s[10])),s[12]&&(i+=s[12]/60),s[14]&&(i+=s[14]/3600),parseInt(s[10])<0&&(i=-1*i),s[1]?(r=s[1],o=s[9]):s[8]&&(r=s[8],o=s[16]);else throw new Error("invalid DMS coordinates format");else if(yi.test(n)){if(s=yi.exec(n),c=Xe(s),s.filter(u=>u).length<=5)throw new Error("invalid coordinates format");if(c)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4].replace(",",".")/60,l="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,l="DMS"),parseInt(s[2])<0&&(t=-1*t),i=Math.abs(parseInt(s[10])),s[12]&&(i+=s[12].replace(",",".")/60),s[14]&&(i+=s[14].replace(",",".")/3600),parseInt(s[10])<0&&(i=-1*i),s[1]?(r=s[1],o=s[9]):s[8]&&(r=s[8],o=s[16]);else throw new Error("invalid coordinates format")}if(c){if(Math.abs(i)>=180)throw new Error("invalid longitude value");if(Math.abs(t)>=90)throw new Error("invalid latitude value");if(r&&!o||!r&&o)throw new Error("invalid coordinates value");if(r&&r==o)throw new Error("invalid coordinates format");t.toString().includes(",")&&(t=t.replace(",",".")),i.toString().includes(",")&&(i=i.replace(",","."));let u=/S|SOUTH/i;u.test(r)&&t>0&&(t=-1*t),u=/W|WEST/i,u.test(o)&&i>0&&(i=-1*i);const f=s[0].trim();let a,d;const g=/[,/;\u0020]/g,m=f.match(g);if(m==null){const v=Math.floor(n.length/2);a=f.substring(0,v).trim(),d=f.substring(v).trim()}else{let v;m.length%2==1?v=Math.floor(m.length/2):v=m.length/2-1;let w=0;if(v==0)w=f.indexOf(m[0]),a=f.substring(0,w).trim(),d=f.substring(w+1).trim();else{let E=0,L=0;for(;E<=v;)w=f.indexOf(m[E],L),L=w+1,E++;a=f.substring(0,w).trim(),d=f.substring(w+1).trim()}}const p=a.split(".");if(p.length==2&&p[1]==0&&p[1].length!=2)throw new Error("invalid coordinates format");const b=d.split(".");if(b.length==2&&b[1]==0&&b[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(a)||/^\d+$/.test(d))throw new Error("degree only coordinate/s provided");return t=Number(Number(t).toFixed(e)),i=Number(Number(i).toFixed(e)),Object.freeze({verbatimCoordinates:f,verbatimLatitude:a,verbatimLongitude:d,decimalLatitude:t,decimalLongitude:i,decimalCoordinates:`${t},${i}`,originalFormat:l,closeEnough:ir,toCoordinateFormat:tr})}else throw new Error("coordinates pattern match failed")}function Xe(n){if(!isNaN(n[0]))return!1;const e=[...n];if(e.shift(),e.length%2>0)return!1;const t=/^[-+]?\d+([\.,]\d+)?$/,i=/[eastsouthnorthwest]+/i,r=e.length/2;for(let o=0;o<r;o++){const l=e[o],s=e[o+r],c=t.test(l)&&t.test(s),u=i.test(l)&&i.test(s),f=l==s;if(!(l==null&&s==null)){if(l==null||s==null)return!1;if(c||u||f)continue;return!1}}return!0}function vi(n,e){const t=Math.abs(n-e);return Number(t.toFixed(6))<=1e-5}function ir(n){if(!n)throw new Error("coords must be provided");if(n.includes(",")){const e=n.split(",");if(Number(e[0])==NaN||Number(e[1])==NaN)throw new Error("coords are not valid decimals");return vi(this.decimalLatitude,Number(e[0]))&&vi(this.decimalLongitude,e[1])}else throw new Error("coords being tested must be separated by a comma")}const nr=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});St.to=nr;const rr=[{verbatimCoordinates:"40.123, -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:'40° 7´ 22.8" N 74° 7´ 22.8" W',verbatimLatitude:'40° 7´ 22.8" N',verbatimLongitude:'74° 7´ 22.8" W'},{verbatimCoordinates:"40° 7.38’ , -74° 7.38’",verbatimLatitude:"40° 7.38’",verbatimLongitude:"-74° 7.38’"},{verbatimCoordinates:"N40°7’22.8’’, W74°7’22.8’’",verbatimLatitude:"N40°7’22.8’’",verbatimLongitude:"W74°7’22.8’’"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:`40°7'22.8"N, 74°7'22.8"W`,verbatimLatitude:`40°7'22.8"N`,verbatimLongitude:`74°7'22.8"W`},{verbatimCoordinates:"40 7 22.8, -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"},{verbatimCoordinates:"40.123 -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123°,-74.123°",verbatimLatitude:"40.123°",verbatimLongitude:"-74.123°"},{verbatimCoordinates:"40.123N74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"4007.38N7407.38W",verbatimLatitude:"4007.38N",verbatimLongitude:"7407.38W"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:"400722.8N740722.8W",verbatimLatitude:"400722.8N",verbatimLongitude:"740722.8W"},{verbatimCoordinates:"N 40 7.38 W 74 7.38",verbatimLatitude:"N 40 7.38",verbatimLongitude:"W 74 7.38"},{verbatimCoordinates:"40:7:22.8N 74:7:22.8W",verbatimLatitude:"40:7:22.8N",verbatimLongitude:"74:7:22.8W"},{verbatimCoordinates:"40:7:23N,74:7:23W",verbatimLatitude:"40:7:23N",verbatimLongitude:"74:7:23W",decimalLatitude:40.1230555555,decimalLongitude:-74.1230555555},{verbatimCoordinates:'40°7’23"N 74°7’23"W',verbatimLatitude:'40°7’23"N',verbatimLongitude:'74°7’23"W',decimalLatitude:40.1230555555,decimalLongitude:-74.12305555555555},{verbatimCoordinates:'40°7’23"S 74°7’23"E',verbatimLatitude:'40°7’23"S',verbatimLongitude:'74°7’23"E',decimalLatitude:-40.1230555555,decimalLongitude:74.12305555555555},{verbatimCoordinates:'40°7’23" -74°7’23"',verbatimLatitude:'40°7’23"',verbatimLongitude:'-74°7’23"',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:'40d 7’ 23" N 74d 7’ 23" W',verbatimLatitude:'40d 7’ 23" N',verbatimLongitude:'74d 7’ 23" W',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:"40.123N 74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40 7 22.8; -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"}],or={decimalLatitude:40.123,decimalLongitude:-74.123},sr=[{verbatimCoordinates:`50°4'17.698"south, 14°24'2.826"east`,verbatimLatitude:`50°4'17.698"south`,verbatimLongitude:`14°24'2.826"east`,decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"50d4m17.698S 14d24m2.826E",verbatimLatitude:"50d4m17.698S",verbatimLongitude:"14d24m2.826E",decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"40:26:46N,79:56:55W",verbatimLatitude:"40:26:46N",verbatimLongitude:"79:56:55W",decimalLatitude:40.44611111111111,decimalLongitude:-79.9486111111111},{verbatimCoordinates:"40:26:46.302N 79:56:55.903W",verbatimLatitude:"40:26:46.302N",verbatimLongitude:"79:56:55.903W",decimalLatitude:40.446195,decimalLongitude:-79.94886194444445},{verbatimCoordinates:"40°26′47″N 79°58′36″W",verbatimLatitude:"40°26′47″N",verbatimLongitude:"79°58′36″W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40d 26′ 47″ N 79d 58′ 36″ W",verbatimLatitude:"40d 26′ 47″ N",verbatimLongitude:"79d 58′ 36″ W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40.446195N 79.948862W",verbatimLatitude:"40.446195N",verbatimLongitude:"79.948862W",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40,446195° 79,948862°",verbatimLatitude:"40,446195°",verbatimLongitude:"79,948862°",decimalLatitude:40.446195,decimalLongitude:79.948862},{verbatimCoordinates:"40° 26.7717, -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.446195, -79.948862",verbatimLatitude:"40.446195",verbatimLongitude:"-79.948862",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.123256; -74.123256",verbatimLatitude:"40.123256",verbatimLongitude:"-74.123256",decimalLatitude:40.123256,decimalLongitude:-74.123256},{verbatimCoordinates:"18°24S 22°45E",verbatimLatitude:"18°24S",verbatimLongitude:"22°45E",decimalLatitude:-18.4,decimalLongitude:22.75}],lr=[{verbatimCoordinates:"10.432342S 10.6345345E",verbatimLatitude:"10.432342S",verbatimLongitude:"10.6345345E",decimalLatitude:-10.432342,decimalLongitude:10.6345345},{verbatimCoordinates:"10.00S 10.00E",verbatimLatitude:"10.00S",verbatimLongitude:"10.00E",decimalLatitude:-10,decimalLongitude:10},{verbatimCoordinates:"00.00S 01.00E",verbatimLatitude:"00.00S",verbatimLongitude:"01.00E",decimalLatitude:0,decimalLongitude:1},{verbatimCoordinates:"18.24S 22.45E",verbatimLatitude:"18.24S",verbatimLongitude:"22.45E",decimalLatitude:-18.4,decimalLongitude:22.75},{verbatimCoordinates:"27deg 15min 45.2sec S 18deg 32min 53.7sec E",verbatimLatitude:"27deg 15min 45.2sec S",verbatimLongitude:"18deg 32min 53.7sec E",decimalLatitude:-27.262555555555554,decimalLongitude:18.54825},{verbatimCoordinates:"-23.3245° S / 28.2344° E",verbatimLatitude:"-23.3245° S",verbatimLongitude:"28.2344° E",decimalLatitude:-23.3245,decimalLongitude:28.2344},{verbatimCoordinates:"40° 26.7717 -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"27.15.45S 18.32.53E",verbatimLatitude:"27.15.45S",verbatimLongitude:"18.32.53E",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"-27.15.45 18.32.53",verbatimLatitude:"-27.15.45",verbatimLongitude:"18.32.53",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"27.15.45.2S 18.32.53.4E",verbatimLatitude:"27.15.45.2S",verbatimLongitude:"18.32.53.4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"27.15.45,2S 18.32.53,4E",verbatimLatitude:"27.15.45,2S",verbatimLongitude:"18.32.53,4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"S23.43563 ° E22.45634 °",verbatimLatitude:"S23.43563 °",verbatimLongitude:"E22.45634 °",decimalLatitude:-23.43563,decimalLongitude:22.45634},{verbatimCoordinates:"27,71372° S 23,07771° E",verbatimLatitude:"27,71372° S",verbatimLongitude:"23,07771° E",decimalLatitude:-27.71372,decimalLongitude:23.07771},{verbatimCoordinates:"27.45.34 S 23.23.23 E",verbatimLatitude:"27.45.34 S",verbatimLongitude:"23.23.23 E",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"S 27.45.34 E 23.23.23",verbatimLatitude:"S 27.45.34",verbatimLongitude:"E 23.23.23",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"53 16.3863,4 52.8171",verbatimLatitude:"53 16.3863",verbatimLongitude:"4 52.8171",decimalLatitude:53.273105,decimalLongitude:4.88029},{verbatimCoordinates:"50 8.2914,-5 2.4447",verbatimLatitude:"50 8.2914",verbatimLongitude:"-5 2.4447",decimalLatitude:50.13819,decimalLongitude:-5.040745},{verbatimCoordinates:"N 48° 30,6410', E 18° 57,4583'",verbatimLatitude:"N 48° 30,6410'",verbatimLongitude:"E 18° 57,4583'",decimalLatitude:48.51068,decimalLongitude:18.95764},{verbatimCoordinates:"1.23456, 18.33453",verbatimLatitude:"1.23456",verbatimLongitude:"18.33453",decimalLatitude:1.23456,decimalLongitude:18.33453}];function ur(){const n=[];return rr.forEach(e=>{e.decimalLatitude?n.push(e):n.push({...e,...or})}),[...n,...sr,...lr]}const ar=ur();St.formats=ar.map(n=>n.verbatimCoordinates);const cr=St;function bi(n,e,t){const i=n.slice();return i[91]=e[t],i[93]=t,i}function wi(n){let e,t;return e=new Zn({}),{c(){xe(e.$$.fragment)},m(i,r){be(e,i,r),t=!0},i(i){t||(Z(e.$$.fragment,i),t=!0)},o(i){$(e.$$.fragment,i),t=!1},d(i){we(e,i)}}}function _i(n){let e,t,i,r,o;return t=new Yn({}),{c(){e=U("button"),xe(t.$$.fragment),y(e,"type","button"),y(e,"title",n[10]),y(e,"class","svelte-bz0zu3"),Fe(e,"active",n[0])},m(l,s){j(l,e,s),be(t,e,null),i=!0,r||(o=J(e,"click",n[76]),r=!0)},p(l,s){(!i||s[0]&1024)&&y(e,"title",l[10]),(!i||s[0]&1)&&Fe(e,"active",l[0])},i(l){i||(Z(t.$$.fragment,l),i=!0)},o(l){$(t.$$.fragment,l),i=!1},d(l){l&&G(e),we(t),r=!1,o()}}}function fr(n){let e,t=[],i=new Map,r,o,l,s=ui(n[13]);const c=u=>u[91].id+(u[91].address?","+u[91].address:"");for(let u=0;u<s.length;u+=1){let f=bi(n,s,u),a=c(f);i.set(a,t[u]=Ei(a,f))}return{c(){e=U("ul");for(let u=0;u<t.length;u+=1)t[u].c();y(e,"class","options svelte-bz0zu3"),y(e,"role","listbox")},m(u,f){j(u,e,f);for(let a=0;a<t.length;a+=1)t[a]&&t[a].m(e,null);r=!0,o||(l=[J(e,"mouseleave",n[27]),J(e,"blur",n[80]),J(e,"keydown",n[23])],o=!0)},p(u,f){f[0]&102823936&&(s=ui(u[13]),rt(),t=Nn(t,f,c,1,u,s,i,e,Pn,Ei,null,bi),ot())},i(u){if(!r){for(let f=0;f<s.length;f+=1)Z(t[f]);r=!0}},o(u){for(let f=0;f<t.length;f+=1)$(t[f]);r=!1},d(u){u&&G(e);for(let f=0;f<t.length;f+=1)t[f].d();o=!1,pe(l)}}}function dr(n){let e,t,i,r,o,l;return t=new ci({}),{c(){e=U("div"),xe(t.$$.fragment),i=re(),r=U("div"),o=Se(n[8]),y(r,"class","svelte-bz0zu3"),y(e,"class","no-results svelte-bz0zu3")},m(s,c){j(s,e,c),be(t,e,null),z(e,i),z(e,r),z(r,o),l=!0},p(s,c){(!l||c[0]&256)&&Qe(o,s[8])},i(s){l||(Z(t.$$.fragment,s),l=!0)},o(s){$(t.$$.fragment,s),l=!1},d(s){s&&G(e),we(t)}}}function hr(n){let e="",t;return{c(){t=Se(e)},m(i,r){j(i,t,r)},p:q,i:q,o:q,d(i){i&&G(t)}}}function gr(n){let e,t,i,r,o,l,s,c,u,f,a;return t=new ci({}),c=new ai({}),{c(){e=U("div"),xe(t.$$.fragment),i=re(),r=U("div"),o=Se(n[7]),l=re(),s=U("button"),xe(c.$$.fragment),y(r,"class","svelte-bz0zu3"),y(s,"class","svelte-bz0zu3"),y(e,"class","error svelte-bz0zu3")},m(d,g){j(d,e,g),be(t,e,null),z(e,i),z(e,r),z(r,o),z(e,l),z(e,s),be(c,s,null),u=!0,f||(a=J(s,"click",n[77]),f=!0)},p(d,g){(!u||g[0]&128)&&Qe(o,d[7])},i(d){u||(Z(t.$$.fragment,d),Z(c.$$.fragment,d),u=!0)},o(d){$(t.$$.fragment,d),$(c.$$.fragment,d),u=!1},d(d){d&&G(e),we(t),we(c),f=!1,a()}}}function Ei(n,e){var s;let t,i,r;function o(){return e[78](e[93])}function l(){return e[79](e[91])}return i=new Vn({props:{feature:e[91],showPlaceType:e[11],style:e[15]===e[93]?"selected":((s=e[14])==null?void 0:s.id)===e[91].id?"picked":"default",missingIconsCache:e[21],iconsBaseUrl:e[12]}}),i.$on("mouseenter",o),i.$on("select",l),{key:n,first:null,c(){t=bn(),xe(i.$$.fragment),this.first=t},m(c,u){j(c,t,u),be(i,c,u),r=!0},p(c,u){var a;e=c;const f={};u[0]&8192&&(f.feature=e[91]),u[0]&2048&&(f.showPlaceType=e[11]),u[0]&57344&&(f.style=e[15]===e[93]?"selected":((a=e[14])==null?void 0:a.id)===e[91].id?"picked":"default"),u[0]&4096&&(f.iconsBaseUrl=e[12]),i.$set(f)},i(c){r||(Z(i.$$.fragment,c),r=!0)},o(c){$(i.$$.fragment,c),r=!1},d(c){c&&G(t),we(i,c)}}}function mr(n){let e,t,i,r,o,l,s,c,u,f,a,d,g,m,p,b,v,w,E,L,R,P=!1;o=new Kn({}),a=new ai({});let x=n[20]&&wi(),S=n[6]==="button"&&_i(n);const T=n[67].default,_=mn(T,n,n[66],null),M=[gr,hr,dr,fr],I=[];function ne(k,A){var de,Q;return k[19]?0:!k[16]&&!k[4]?1:((de=k[13])==null?void 0:de.length)===0?2:(Q=k[13])!=null&&Q.length&&(k[16]||k[4])?3:-1}return~(b=ne(n))&&(v=I[b]=M[b](n)),{c(){e=re(),t=U("form"),i=U("div"),r=U("button"),xe(o.$$.fragment),l=re(),s=U("input"),c=re(),u=U("div"),f=U("button"),xe(a.$$.fragment),d=re(),x&&x.c(),g=re(),S&&S.c(),m=re(),_&&_.c(),p=re(),v&&v.c(),y(r,"class","search-button svelte-bz0zu3"),y(r,"type","button"),y(s,"placeholder",n[9]),y(s,"aria-label",n[9]),y(s,"class","svelte-bz0zu3"),y(f,"type","button"),y(f,"title",n[3]),y(f,"class","svelte-bz0zu3"),y(u,"class","clear-button-container svelte-bz0zu3"),Fe(u,"displayable",n[1]!==""),y(i,"class","input-group svelte-bz0zu3"),y(t,"class",w=it(n[2])+" svelte-bz0zu3"),Fe(t,"can-collapse",n[5]&&n[1]==="")},m(k,A){j(k,e,A),j(k,t,A),z(t,i),z(i,r),be(o,r,null),z(i,l),z(i,s),n[69](s),ni(s,n[1]),z(i,c),z(i,u),z(u,f),be(a,f,null),z(u,d),x&&x.m(u,null),z(i,g),S&&S.m(i,null),z(i,m),_&&_.m(i,null),z(t,p),~b&&I[b].m(t,null),E=!0,L||(R=[J(r,"click",n[68]),J(s,"input",n[70]),J(s,"focus",n[71]),J(s,"blur",n[72]),J(s,"click",n[73]),J(s,"keydown",n[23]),J(s,"input",n[24]),J(s,"change",n[74]),J(f,"click",n[75]),J(t,"submit",wn(n[22]))],L=!0)},p(k,A){(!E||A[0]&512)&&y(s,"placeholder",k[9]),(!E||A[0]&512)&&y(s,"aria-label",k[9]),A[0]&2&&s.value!==k[1]&&ni(s,k[1]),(!E||A[0]&8)&&y(f,"title",k[3]),k[20]?x?A[0]&1048576&&Z(x,1):(x=wi(),x.c(),Z(x,1),x.m(u,null)):x&&(rt(),$(x,1,1,()=>{x=null}),ot()),(!E||A[0]&2)&&Fe(u,"displayable",k[1]!==""),k[6]==="button"?S?(S.p(k,A),A[0]&64&&Z(S,1)):(S=_i(k),S.c(),Z(S,1),S.m(i,m)):S&&(rt(),$(S,1,1,()=>{S=null}),ot()),_&&_.p&&(!E||A[2]&16)&&pn(_,T,k,k[66],E?yn(T,k[66],A,null):vn(k[66]),null);let de=b;b=ne(k),b===de?~b&&I[b].p(k,A):(v&&(rt(),$(I[de],1,1,()=>{I[de]=null}),ot()),~b?(v=I[b],v?v.p(k,A):(v=I[b]=M[b](k),v.c()),Z(v,1),v.m(t,null)):v=null),(!E||A[0]&4&&w!==(w=it(k[2])+" svelte-bz0zu3"))&&y(t,"class",w),(!E||A[0]&38)&&Fe(t,"can-collapse",k[5]&&k[1]==="")},i(k){E||(Z(P),Z(o.$$.fragment,k),Z(a.$$.fragment,k),Z(x),Z(S),Z(_,k),Z(v),E=!0)},o(k){$(P),$(o.$$.fragment,k),$(a.$$.fragment,k),$(x),$(S),$(_,k),$(v),E=!1},d(k){k&&(G(e),G(t)),we(o),n[69](null),we(a),x&&x.d(),S&&S.d(),_&&_.d(k),~b&&I[b].d(),L=!1,pe(R)}}}function yr(n,e,t){let i,r,o,{$$slots:l={},$$scope:s}=e;const c={continental_marine:4,country:4,major_landform:8,region:5,subregion:6,county:7,joint_municipality:8,joint_submunicipality:9,municipality:10,municipal_district:11,locality:12,neighbourhood:13,place:14,postal_code:14,road:16,poi:17,address:18,"poi.peak":15,"poi.shop":18,"poi.cafe":18,"poi.restaurant":18,"poi.aerodrome":13};let{class:u=void 0}=e,{apiKey:f}=e,{bbox:a=void 0}=e,{clearButtonTitle:d="clear"}=e,{clearOnBlur:g=!1}=e,{clearListOnPick:m=!1}=e,{keepListOpen:p=!1}=e,{collapsed:b=!1}=e,{country:v=void 0}=e,{debounceSearch:w=200}=e,{enableReverse:E="never"}=e,{errorMessage:L="Something went wrong…"}=e,{filter:R=()=>!0}=e,{flyTo:P=!0}=e,{fuzzyMatch:x=!0}=e,{language:S=void 0}=e,{limit:T=void 0}=e,{mapController:_=void 0}=e,{minLength:M=2}=e,{noResultsMessage:I="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=e,{placeholder:ne="Search"}=e,{proximity:k=[{type:"server-geolocation"}]}=e,{reverseActive:A=E==="always"}=e,{reverseButtonTitle:de="toggle reverse geocoding"}=e,{searchValue:Q=""}=e,{pickedResultStyle:ft="full-geometry"}=e,{showPlaceType:Ji="if-needed"}=e,{showResultsWhileTyping:dt=!0}=e,{selectFirst:qe=!0}=e,{flyToSelected:ht=!1}=e,{markerOnSelected:gt=!0}=e,{types:We=void 0}=e,{exhaustiveReverseGeocoding:Wt=!1}=e,{excludeTypes:mt=!1}=e,{zoom:yt=c}=e,{apiUrl:At="https://api.maptiler.com/geocoding"}=e,{fetchParameters:Ft={}}=e,{iconsBaseUrl:$i="https://cdn.maptiler.com/maptiler-geocoding-control/v2.1.0-rc1/icons/"}=e,{adjustUrlQuery:Ut=()=>{}}=e,{adjustUrl:Dt=()=>{}}=e;function Jr(h){he.focus(h)}function $r(){he.blur()}function en(h,V=!0,H=!1){t(1,Q=h),V?(t(15,F=-1),nn()):(rn(void 0,!H,H),setTimeout(()=>{he.focus(),he.select()}))}function eo(){t(13,O=void 0),t(14,C=void 0),t(15,F=-1)}function to(){t(61,X=[]),t(14,C=void 0)}let O,X,C,tn="",he,F=-1,me,pt=[],Ae,je,Ve,Bt,Ee=!1;const io=new Set,Ne=oi();Ln(()=>{_&&(_.setEventHandler(void 0),_.indicateReverse(!1),_.setSelectedMarker(-1),_.setFeatures(void 0,void 0,!1))});function nn(h){if(t(17,Ee=!1),je&&(clearTimeout(je),je=void 0),F>-1&&O)t(14,C=O[F]),t(1,Q=C.place_type[0]==="reverse"?C.place_name:C.place_name.replace(/,.*/,"")),t(19,me=void 0),t(61,X=void 0),t(15,F=-1);else if(Q){const V=h||!Gt(Q);qt(Q,{exact:!0}).then(()=>{t(61,X=O),t(14,C=void 0),V&&no()}).catch(H=>t(19,me=H))}}function Gt(h){try{return cr(h,6)}catch{return!1}}async function qt(h,{byId:V=!1,exact:H=!1}={}){var se,ye;t(19,me=void 0),Ae==null||Ae.abort();const oe=new AbortController;t(20,Ae=oe);try{const W=Gt(h),Qt=new URL(At+"/"+encodeURIComponent(W?W.decimalLongitude+","+W.decimalLatitude:h)+".json"),ge=Qt.searchParams;if(S!==void 0&&ge.set("language",Array.isArray(S)?S.join(","):S??""),We&&ge.set("types",We.join(",")),mt&&ge.set("excludeTypes",String(mt)),a&&ge.set("bbox",a.map(bt=>bt.toFixed(6)).join(",")),v&&ge.set("country",Array.isArray(v)?v.join(","):v),!V&&!W){const bt=await $n(_,k,oe);bt&&ge.set("proximity",bt),(H||!dt)&&ge.set("autocomplete","false"),ge.set("fuzzyMatch",String(x))}T!==void 0&&(Wt||!W||(We==null?void 0:We.length)===1)&&ge.set("limit",String(T)),ge.set("key",f),Ut(ge),Dt(Qt);const vt=Qt.toString();if(vt===tn){V?(m&&t(13,O=void 0),t(14,C=pt[0])):(t(13,O=pt),((se=O[F])==null?void 0:se.id)!==(r==null?void 0:r.id)&&t(15,F=-1));return}tn=vt;const Zt=await fetch(vt,{signal:oe.signal,...Ft});if(!Zt.ok)throw new Error(await Zt.text());const Ht=await Zt.json();Ne("response",{url:vt,featureCollection:Ht}),V?(m&&t(13,O=void 0),t(14,C=Ht.features[0]),pt=[C]):(t(13,O=Ht.features.filter(R)),W&&O.unshift({type:"Feature",properties:{},id:"reverse_"+W.decimalLongitude+"_"+W.decimalLatitude,text:W.decimalLatitude+", "+W.decimalLongitude,place_name:W.decimalLatitude+", "+W.decimalLongitude,place_type:["reverse"],center:[W.decimalLongitude,W.decimalLatitude],bbox:[W.decimalLongitude,W.decimalLatitude,W.decimalLongitude,W.decimalLatitude],geometry:{type:"Point",coordinates:[W.decimalLongitude,W.decimalLatitude]}}),pt=O,((ye=O[F])==null?void 0:ye.id)!==(r==null?void 0:r.id)&&t(15,F=-1),W&&he.focus())}catch(W){if(W&&typeof W=="object"&&"name"in W&&W.name==="AbortError")return;throw W}finally{oe===Ae&&t(20,Ae=void 0)}}function no(){var oe;if(!(X!=null&&X.length)||!P)return;const h=[180,90,-180,-90],V=!X.some(se=>!se.matching_text);let H;for(const se of X){const ye=et(se);if(H=H===void 0?ye:ye===void 0?H:Math.max(H,ye),V||!se.matching_text)for(const W of[0,1,2,3])h[W]=Math[W<2?"min":"max"](h[W],((oe=se.bbox)==null?void 0:oe[W])??se.center[W%2])}_&&X.length>0&&(C&&h[0]===h[2]&&h[1]===h[3]?_.flyTo(C.center,et(C)):_.fitBounds(st(h),50,H))}function jt(){!C||!_||(!C.bbox||C.bbox[0]===C.bbox[2]&&C.bbox[1]===C.bbox[3]?_.flyTo(C.center,et(C)):_.fitBounds(st(C.bbox),50,et(C)))}function et(h){var H;if(!h.bbox||h.bbox[0]!==h.bbox[2]&&h.bbox[1]!==h.bbox[3])return;const V=h.id.replace(/\..*/,"");return(Array.isArray((H=h.properties)==null?void 0:H.categories)?h.properties.categories.reduce((oe,se)=>{const ye=yt[V+"."+se];return oe===void 0?ye:ye===void 0?oe:Math.max(oe,ye)},void 0):void 0)??yt[V]}function ro(h){t(0,A=E==="always"),t(13,O=void 0),t(14,C=void 0),t(15,F=-1),en(h[1].toFixed(6)+", "+Jn(h[0],[-180,180],!0).toFixed(6),!1,!0)}function oo(h){if(!O)return;let V=h.key==="ArrowDown"?1:h.key==="ArrowUp"?-1:0;V&&(he.focus(),t(17,Ee=!0),h.preventDefault(),C&&F===-1&&t(15,F=O.findIndex(H=>H.id===(C==null?void 0:C.id))),F===(C||qe?0:-1)&&V===-1&&t(15,F=O.length),t(15,F+=V),F>=O.length&&t(15,F=-1),F<0&&(C||qe)&&t(15,F=0))}function rn(h,V=!0,H=!1){if(t(19,me=void 0),t(14,C=void 0),t(17,Ee=!0),dt||H){if(je&&clearTimeout(je),Q.length<M)return;const oe=Q;je=window.setTimeout(()=>{qt(oe).catch(se=>t(19,me=se))},V?w:0)}else t(13,O=void 0),t(19,me=void 0)}function Vt(h){C&&(C==null?void 0:C.id)===(h==null?void 0:h.id)?jt():(t(14,C=h),t(1,Q=h.place_name))}function on(h){t(15,F=h)}function so(){(!qe||C)&&t(15,F=-1),ht&&jt()}const lo=()=>he.focus();function uo(h){wt[h?"unshift":"push"](()=>{he=h,t(18,he)})}function ao(){Q=this.value,t(1,Q),t(17,Ee),t(31,g),t(16,Ve)}const co=()=>t(17,Ee=!0),fo=()=>t(17,Ee=!1),ho=()=>t(17,Ee=!0),go=()=>t(14,C=void 0),mo=()=>{t(1,Q=""),he.focus()},yo=()=>t(0,A=!A),po=()=>t(19,me=void 0),vo=h=>on(h),bo=h=>Vt(h),wo=()=>{};return n.$$set=h=>{"class"in h&&t(2,u=h.class),"apiKey"in h&&t(29,f=h.apiKey),"bbox"in h&&t(30,a=h.bbox),"clearButtonTitle"in h&&t(3,d=h.clearButtonTitle),"clearOnBlur"in h&&t(31,g=h.clearOnBlur),"clearListOnPick"in h&&t(32,m=h.clearListOnPick),"keepListOpen"in h&&t(4,p=h.keepListOpen),"collapsed"in h&&t(5,b=h.collapsed),"country"in h&&t(33,v=h.country),"debounceSearch"in h&&t(34,w=h.debounceSearch),"enableReverse"in h&&t(6,E=h.enableReverse),"errorMessage"in h&&t(7,L=h.errorMessage),"filter"in h&&t(35,R=h.filter),"flyTo"in h&&t(36,P=h.flyTo),"fuzzyMatch"in h&&t(37,x=h.fuzzyMatch),"language"in h&&t(38,S=h.language),"limit"in h&&t(39,T=h.limit),"mapController"in h&&t(40,_=h.mapController),"minLength"in h&&t(41,M=h.minLength),"noResultsMessage"in h&&t(8,I=h.noResultsMessage),"placeholder"in h&&t(9,ne=h.placeholder),"proximity"in h&&t(42,k=h.proximity),"reverseActive"in h&&t(0,A=h.reverseActive),"reverseButtonTitle"in h&&t(10,de=h.reverseButtonTitle),"searchValue"in h&&t(1,Q=h.searchValue),"pickedResultStyle"in h&&t(43,ft=h.pickedResultStyle),"showPlaceType"in h&&t(11,Ji=h.showPlaceType),"showResultsWhileTyping"in h&&t(44,dt=h.showResultsWhileTyping),"selectFirst"in h&&t(45,qe=h.selectFirst),"flyToSelected"in h&&t(46,ht=h.flyToSelected),"markerOnSelected"in h&&t(47,gt=h.markerOnSelected),"types"in h&&t(48,We=h.types),"exhaustiveReverseGeocoding"in h&&t(49,Wt=h.exhaustiveReverseGeocoding),"excludeTypes"in h&&t(50,mt=h.excludeTypes),"zoom"in h&&t(51,yt=h.zoom),"apiUrl"in h&&t(52,At=h.apiUrl),"fetchParameters"in h&&t(53,Ft=h.fetchParameters),"iconsBaseUrl"in h&&t(12,$i=h.iconsBaseUrl),"adjustUrlQuery"in h&&t(54,Ut=h.adjustUrlQuery),"adjustUrl"in h&&t(55,Dt=h.adjustUrl),"$$scope"in h&&t(66,s=h.$$scope)},n.$$.update=()=>{if(n.$$.dirty[0]&64&&t(0,A=E==="always"),n.$$.dirty[0]&16384|n.$$.dirty[1]&4096&&ft!=="marker-only"&&C&&!C.address&&C.geometry.type==="Point"&&C.place_type[0]!=="reverse"&&qt(C.id,{byId:!0}).catch(h=>t(19,me=h)),n.$$.dirty[0]&16384|n.$$.dirty[1]&546|n.$$.dirty[2]&1&&(_&&C&&C.id!==Bt&&P&&(jt(),m&&t(13,O=void 0),t(61,X=void 0),t(15,F=-1)),t(62,Bt=C==null?void 0:C.id)),n.$$.dirty[0]&196608|n.$$.dirty[1]&1&&setTimeout(()=>{t(16,Ve=Ee),g&&!Ve&&t(1,Q="")}),n.$$.dirty[0]&8194|n.$$.dirty[1]&1024&&Q.length<M&&(t(13,O=void 0),t(19,me=void 0),t(61,X=O)),n.$$.dirty[0]&57344|n.$$.dirty[1]&16384&&qe&&O!=null&&O.length&&F==-1&&!C&&t(15,F=0),n.$$.dirty[0]&8192|n.$$.dirty[1]&1073741824&&X!==O&&t(61,X=void 0),n.$$.dirty[0]&73729|n.$$.dirty[1]&1073742336&&_&&_.setEventHandler(h=>{switch(h.type){case"mapClick":A&&ro(h.coordinates);break;case"markerClick":{const V=O==null?void 0:O.find(H=>H.id===h.id);V&&Vt(V)}break;case"markerMouseEnter":X&&t(15,F=Ve?(O==null?void 0:O.findIndex(V=>V.id===h.id))??-1:-1);break;case"markerMouseLeave":X&&t(15,F=-1);break}}),n.$$.dirty[0]&40960&&t(63,r=O==null?void 0:O[F]),n.$$.dirty[1]&33312|n.$$.dirty[2]&2&&_&&r&&P&&ht&&_.flyTo(r.center,et(r)),n.$$.dirty[1]&4096&&t(65,i=ft==="full-geometry-including-polygon-center-marker"),n.$$.dirty[1]&66048|n.$$.dirty[2]&8&&(gt||_==null||_.setFeatures(void 0,void 0,i)),n.$$.dirty[0]&16384|n.$$.dirty[1]&1073807872|n.$$.dirty[2]&10&&_&>&&!X&&(_.setFeatures(r?[r]:void 0,C,i),_.setSelectedMarker(r?0:-1)),n.$$.dirty[0]&16384|n.$$.dirty[1]&1073742336|n.$$.dirty[2]&8&&_&&_.setFeatures(X,C,i),n.$$.dirty[0]&32768|n.$$.dirty[1]&1073742336&&X&&_&&_.setSelectedMarker(F),n.$$.dirty[0]&2|n.$$.dirty[1]&512&&_){const h=Gt(Q);_.setReverseMarker(h?[h.decimalLongitude,h.decimalLatitude]:void 0)}n.$$.dirty[2]&2&&Ne("select",{feature:r}),n.$$.dirty[0]&16384&&Ne("pick",{feature:C}),n.$$.dirty[0]&73744&&t(64,o=!!(O!=null&&O.length)&&(Ve||p)),n.$$.dirty[2]&4&&Ne("optionsvisibilitychange",{optionsVisible:o}),n.$$.dirty[0]&8192&&Ne("featureslisted",{features:O}),n.$$.dirty[1]&1073741824&&Ne("featuresmarked",{features:X}),n.$$.dirty[0]&1&&Ne("reversetoggle",{reverse:A}),n.$$.dirty[0]&2&&Ne("querychange",{query:Q}),n.$$.dirty[0]&1|n.$$.dirty[1]&512&&_&&_.indicateReverse(A)},[A,Q,u,d,p,b,E,L,I,ne,de,Ji,$i,O,C,F,Ve,Ee,he,me,Ae,io,nn,oo,rn,Vt,on,so,c,f,a,g,m,v,w,R,P,x,S,T,_,M,k,ft,dt,qe,ht,gt,We,Wt,mt,yt,At,Ft,Ut,Dt,Jr,$r,en,eo,to,X,Bt,r,o,i,s,l,lo,uo,ao,co,fo,ho,go,mo,yo,po,vo,bo,wo]}let pr=class extends Oe{constructor(e){super(),Ie(this,e,yr,mr,Te,{ZOOM_DEFAULTS:28,class:2,apiKey:29,bbox:30,clearButtonTitle:3,clearOnBlur:31,clearListOnPick:32,keepListOpen:4,collapsed:5,country:33,debounceSearch:34,enableReverse:6,errorMessage:7,filter:35,flyTo:36,fuzzyMatch:37,language:38,limit:39,mapController:40,minLength:41,noResultsMessage:8,placeholder:9,proximity:42,reverseActive:0,reverseButtonTitle:10,searchValue:1,pickedResultStyle:43,showPlaceType:11,showResultsWhileTyping:44,selectFirst:45,flyToSelected:46,markerOnSelected:47,types:48,exhaustiveReverseGeocoding:49,excludeTypes:50,zoom:51,apiUrl:52,fetchParameters:53,iconsBaseUrl:12,adjustUrlQuery:54,adjustUrl:55,focus:56,blur:57,setQuery:58,clearList:59,clearMap:60},null,[-1,-1,-1,-1])}get ZOOM_DEFAULTS(){return this.$$.ctx[28]}get focus(){return this.$$.ctx[56]}get blur(){return this.$$.ctx[57]}get setQuery(){return this.$$.ctx[58]}get clearList(){return this.$$.ctx[59]}get clearMap(){return this.$$.ctx[60]}};function lt(n,e,t={}){const i={type:"Feature"};return(t.id===0||t.id)&&(i.id=t.id),t.bbox&&(i.bbox=t.bbox),i.properties=e||{},i.geometry=n,i}function xt(n,e,t={}){for(const r of n){if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(r[r.length-1].length!==r[0].length)throw new Error("First and last Position are not equivalent.");for(let o=0;o<r[r.length-1].length;o++)if(r[r.length-1][o]!==r[0][o])throw new Error("First and last Position are not equivalent.")}return lt({type:"Polygon",coordinates:n},e,t)}function Mt(n,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=n,t}function Li(n,e,t={}){return lt({type:"MultiPolygon",coordinates:n},e,t)}function Si(n,e,t){if(n!==null)for(var i,r,o,l,s,c,u,f=0,a=0,d,g=n.type,m=g==="FeatureCollection",p=g==="Feature",b=m?n.features.length:1,v=0;v<b;v++){u=m?n.features[v].geometry:p?n.geometry:n,d=u?u.type==="GeometryCollection":!1,s=d?u.geometries.length:1;for(var w=0;w<s;w++){var E=0,L=0;if(l=d?u.geometries[w]:u,l!==null){c=l.coordinates;var R=l.type;switch(f=0,R){case null:break;case"Point":if(e(c,a,v,E,L)===!1)return!1;a++,E++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(e(c[i],a,v,E,L)===!1)return!1;a++,R==="MultiPoint"&&E++}R==="LineString"&&E++;break;case"Polygon":case"MultiLineString":for(i=0;i<c.length;i++){for(r=0;r<c[i].length-f;r++){if(e(c[i][r],a,v,E,L)===!1)return!1;a++}R==="MultiLineString"&&E++,R==="Polygon"&&L++}R==="Polygon"&&E++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for(L=0,r=0;r<c[i].length;r++){for(o=0;o<c[i][r].length-f;o++){if(e(c[i][r][o],a,v,E,L)===!1)return!1;a++}L++}E++}break;case"GeometryCollection":for(i=0;i<l.geometries.length;i++)if(Si(l.geometries[i],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function kt(n,e){var t,i,r,o,l,s,c,u,f,a,d=0,g=n.type==="FeatureCollection",m=n.type==="Feature",p=g?n.features.length:1;for(t=0;t<p;t++){for(s=g?n.features[t].geometry:m?n.geometry:n,u=g?n.features[t].properties:m?n.properties:{},f=g?n.features[t].bbox:m?n.bbox:void 0,a=g?n.features[t].id:m?n.id:void 0,c=s?s.type==="GeometryCollection":!1,l=c?s.geometries.length:1,r=0;r<l;r++){if(o=c?s.geometries[r]:s,o===null){if(e(null,d,u,f,a)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,d,u,f,a)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<o.geometries.length;i++)if(e(o.geometries[i],d,u,f,a)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}d++}}function vr(n,e){kt(n,function(t,i,r,o,l){var s=t===null?null:t.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return e(lt(t,r,{bbox:o,id:l}),i,0)===!1?!1:void 0}var c;switch(s){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var u=0;u<t.coordinates.length;u++){var f=t.coordinates[u],a={type:c,coordinates:f};if(e(lt(a,r),i,u)===!1)return!1}})}function br(n,e={}){if(n.bbox!=null&&e.recompute!==!0)return n.bbox;const t=[1/0,1/0,-1/0,-1/0];return Si(n,i=>{t[0]>i[0]&&(t[0]=i[0]),t[1]>i[1]&&(t[1]=i[1]),t[2]<i[0]&&(t[2]=i[0]),t[3]<i[1]&&(t[3]=i[1])}),t}var xi=br;/**
|
|
2
|
-
* splaytree v3.1.2
|
|
3
|
-
* Fast Splay tree for Node and browser
|
|
4
|
-
*
|
|
5
|
-
* @author Alexander Milevski <info@w8r.name>
|
|
6
|
-
* @license MIT
|
|
7
|
-
* @preserve
|
|
8
|
-
*//*! *****************************************************************************
|
|
9
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
10
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
11
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
12
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
-
|
|
14
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
16
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
17
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
18
|
-
|
|
19
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
20
|
-
and limitations under the License.
|
|
21
|
-
***************************************************************************** */function wr(n,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,l;return l={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function s(u){return function(f){return c([u,f])}}function c(u){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,r&&(o=u[0]&2?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,r=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1],o=u;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(u);break}o[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(n,t)}catch(f){u=[6,f],r=0}finally{i=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var Me=function(){function n(e,t){this.next=null,this.key=e,this.data=t,this.left=null,this.right=null}return n}();function _r(n,e){return n>e?1:n<e?-1:0}function ke(n,e,t){for(var i=new Me(null,null),r=i,o=i;;){var l=t(n,e.key);if(l<0){if(e.left===null)break;if(t(n,e.left.key)<0){var s=e.left;if(e.left=s.right,s.right=e,e=s,e.left===null)break}o.left=e,o=e,e=e.left}else if(l>0){if(e.right===null)break;if(t(n,e.right.key)>0){var s=e.right;if(e.right=s.left,s.left=e,e=s,e.right===null)break}r.right=e,r=e,e=e.right}else break}return r.right=e.left,o.left=e.right,e.left=i.right,e.right=i.left,e}function Ct(n,e,t,i){var r=new Me(n,e);if(t===null)return r.left=r.right=null,r;t=ke(n,t,i);var o=i(n,t.key);return o<0?(r.left=t.left,r.right=t,t.left=null):o>=0&&(r.right=t.right,r.left=t,t.right=null),r}function Mi(n,e,t){var i=null,r=null;if(e){e=ke(n,e,t);var o=t(e.key,n);o===0?(i=e.left,r=e.right):o<0?(r=e.right,e.right=null,i=e):(i=e.left,e.left=null,r=e)}return{left:i,right:r}}function Er(n,e,t){return e===null?n:(n===null||(e=ke(n.key,e,t),e.left=n),e)}function Pt(n,e,t,i,r){if(n){i(""+e+(t?"└── ":"├── ")+r(n)+`
|
|
22
|
-
`);var o=e+(t?" ":"│ ");n.left&&Pt(n.left,o,!1,i,r),n.right&&Pt(n.right,o,!0,i,r)}}var Nt=function(){function n(e){e===void 0&&(e=_r),this._root=null,this._size=0,this._comparator=e}return n.prototype.insert=function(e,t){return this._size++,this._root=Ct(e,t,this._root,this._comparator)},n.prototype.add=function(e,t){var i=new Me(e,t);this._root===null&&(i.left=i.right=null,this._size++,this._root=i);var r=this._comparator,o=ke(e,this._root,r),l=r(e,o.key);return l===0?this._root=o:(l<0?(i.left=o.left,i.right=o,o.left=null):l>0&&(i.right=o.right,i.left=o,o.right=null),this._size++,this._root=i),this._root},n.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},n.prototype._remove=function(e,t,i){var r;if(t===null)return null;t=ke(e,t,i);var o=i(e,t.key);return o===0?(t.left===null?r=t.right:(r=ke(e,t.left,i),r.right=t.right),this._size--,r):t},n.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=ke(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},n.prototype.findStatic=function(e){for(var t=this._root,i=this._comparator;t;){var r=i(e,t.key);if(r===0)return t;r<0?t=t.left:t=t.right}return null},n.prototype.find=function(e){return this._root&&(this._root=ke(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root},n.prototype.contains=function(e){for(var t=this._root,i=this._comparator;t;){var r=i(e,t.key);if(r===0)return!0;r<0?t=t.left:t=t.right}return!1},n.prototype.forEach=function(e,t){for(var i=this._root,r=[],o=!1;!o;)i!==null?(r.push(i),i=i.left):r.length!==0?(i=r.pop(),e.call(t,i),i=i.right):o=!0;return this},n.prototype.range=function(e,t,i,r){for(var o=[],l=this._comparator,s=this._root,c;o.length!==0||s;)if(s)o.push(s),s=s.left;else{if(s=o.pop(),c=l(s.key,t),c>0)break;if(l(s.key,e)>=0&&i.call(r,s))return this;s=s.right}return this},n.prototype.keys=function(){var e=[];return this.forEach(function(t){var i=t.key;return e.push(i)}),e},n.prototype.values=function(){var e=[];return this.forEach(function(t){var i=t.data;return e.push(i)}),e},n.prototype.min=function(){return this._root?this.minNode(this._root).key:null},n.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},n.prototype.minNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.left;)e=e.left;return e},n.prototype.maxNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.right;)e=e.right;return e},n.prototype.at=function(e){for(var t=this._root,i=!1,r=0,o=[];!i;)if(t)o.push(t),t=t.left;else if(o.length>0){if(t=o.pop(),r===e)return t;r++,t=t.right}else i=!0;return null},n.prototype.next=function(e){var t=this._root,i=null;if(e.right){for(i=e.right;i.left;)i=i.left;return i}for(var r=this._comparator;t;){var o=r(e.key,t.key);if(o===0)break;o<0?(i=t,t=t.left):t=t.right}return i},n.prototype.prev=function(e){var t=this._root,i=null;if(e.left!==null){for(i=e.left;i.right;)i=i.right;return i}for(var r=this._comparator;t;){var o=r(e.key,t.key);if(o===0)break;o<0?t=t.left:(i=t,t=t.right)}return i},n.prototype.clear=function(){return this._root=null,this._size=0,this},n.prototype.toList=function(){return Sr(this._root)},n.prototype.load=function(e,t,i){t===void 0&&(t=[]),i===void 0&&(i=!1);var r=e.length,o=this._comparator;if(i&&It(e,t,0,r-1,o),this._root===null)this._root=Tt(e,t,0,r),this._size=r;else{var l=xr(this.toList(),Lr(e,t),o);r=this._size+r,this._root=Rt({head:l},0,r)}return this},n.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(n.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),n.prototype.toString=function(e){e===void 0&&(e=function(i){return String(i.key)});var t=[];return Pt(this._root,"",!0,function(i){return t.push(i)},e),t.join("")},n.prototype.update=function(e,t,i){var r=this._comparator,o=Mi(e,this._root,r),l=o.left,s=o.right;r(e,t)<0?s=Ct(t,i,s,r):l=Ct(t,i,l,r),this._root=Er(l,s,r)},n.prototype.split=function(e){return Mi(e,this._root,this._comparator)},n.prototype[Symbol.iterator]=function(){var e,t,i;return wr(this,function(r){switch(r.label){case 0:e=this._root,t=[],i=!1,r.label=1;case 1:return i?[3,6]:e===null?[3,2]:(t.push(e),e=e.left,[3,5]);case 2:return t.length===0?[3,4]:(e=t.pop(),[4,e]);case 3:return r.sent(),e=e.right,[3,5];case 4:i=!0,r.label=5;case 5:return[3,1];case 6:return[2]}})},n}();function Tt(n,e,t,i){var r=i-t;if(r>0){var o=t+Math.floor(r/2),l=n[o],s=e[o],c=new Me(l,s);return c.left=Tt(n,e,t,o),c.right=Tt(n,e,o+1,i),c}return null}function Lr(n,e){for(var t=new Me(null,null),i=t,r=0;r<n.length;r++)i=i.next=new Me(n[r],e[r]);return i.next=null,t.next}function Sr(n){for(var e=n,t=[],i=!1,r=new Me(null,null),o=r;!i;)e?(t.push(e),e=e.left):t.length>0?(e=o=o.next=t.pop(),e=e.right):i=!0;return o.next=null,r.next}function Rt(n,e,t){var i=t-e;if(i>0){var r=e+Math.floor(i/2),o=Rt(n,e,r),l=n.head;return l.left=o,n.head=n.head.next,l.right=Rt(n,r+1,t),l}return null}function xr(n,e,t){for(var i=new Me(null,null),r=i,o=n,l=e;o!==null&&l!==null;)t(o.key,l.key)<0?(r.next=o,o=o.next):(r.next=l,l=l.next),r=r.next;return o!==null?r.next=o:l!==null&&(r.next=l),i.next}function It(n,e,t,i,r){if(!(t>=i)){for(var o=n[t+i>>1],l=t-1,s=i+1;;){do l++;while(r(n[l],o)<0);do s--;while(r(n[s],o)>0);if(l>=s)break;var c=n[l];n[l]=n[s],n[s]=c,c=e[l],e[l]=e[s],e[s]=c}It(n,e,t,s,r),It(n,e,s+1,i,r)}}const _e=11102230246251565e-32,te=134217729,Mr=(3+8*_e)*_e;function Ot(n,e,t,i,r){let o,l,s,c,u=e[0],f=i[0],a=0,d=0;f>u==f>-u?(o=u,u=e[++a]):(o=f,f=i[++d]);let g=0;if(a<n&&d<t)for(f>u==f>-u?(l=u+o,s=o-(l-u),u=e[++a]):(l=f+o,s=o-(l-f),f=i[++d]),o=l,s!==0&&(r[g++]=s);a<n&&d<t;)f>u==f>-u?(l=o+u,c=l-o,s=o-(l-c)+(u-c),u=e[++a]):(l=o+f,c=l-o,s=o-(l-c)+(f-c),f=i[++d]),o=l,s!==0&&(r[g++]=s);for(;a<n;)l=o+u,c=l-o,s=o-(l-c)+(u-c),u=e[++a],o=l,s!==0&&(r[g++]=s);for(;d<t;)l=o+f,c=l-o,s=o-(l-c)+(f-c),f=i[++d],o=l,s!==0&&(r[g++]=s);return(o!==0||g===0)&&(r[g++]=o),g}function kr(n,e){let t=e[0];for(let i=1;i<n;i++)t+=e[i];return t}function Ke(n){return new Float64Array(n)}const Cr=(3+16*_e)*_e,Pr=(2+12*_e)*_e,Nr=(9+64*_e)*_e*_e,Ge=Ke(4),ki=Ke(8),Ci=Ke(12),Pi=Ke(16),ie=Ke(4);function Tr(n,e,t,i,r,o,l){let s,c,u,f,a,d,g,m,p,b,v,w,E,L,R,P,x,S;const T=n-r,_=t-r,M=e-o,I=i-o;L=T*I,d=te*T,g=d-(d-T),m=T-g,d=te*I,p=d-(d-I),b=I-p,R=m*b-(L-g*p-m*p-g*b),P=M*_,d=te*M,g=d-(d-M),m=M-g,d=te*_,p=d-(d-_),b=_-p,x=m*b-(P-g*p-m*p-g*b),v=R-x,a=R-v,Ge[0]=R-(v+a)+(a-x),w=L+v,a=w-L,E=L-(w-a)+(v-a),v=E-P,a=E-v,Ge[1]=E-(v+a)+(a-P),S=w+v,a=S-w,Ge[2]=w-(S-a)+(v-a),Ge[3]=S;let ne=kr(4,Ge),k=Pr*l;if(ne>=k||-ne>=k||(a=n-T,s=n-(T+a)+(a-r),a=t-_,u=t-(_+a)+(a-r),a=e-M,c=e-(M+a)+(a-o),a=i-I,f=i-(I+a)+(a-o),s===0&&c===0&&u===0&&f===0)||(k=Nr*l+Mr*Math.abs(ne),ne+=T*f+I*s-(M*u+_*c),ne>=k||-ne>=k))return ne;L=s*I,d=te*s,g=d-(d-s),m=s-g,d=te*I,p=d-(d-I),b=I-p,R=m*b-(L-g*p-m*p-g*b),P=c*_,d=te*c,g=d-(d-c),m=c-g,d=te*_,p=d-(d-_),b=_-p,x=m*b-(P-g*p-m*p-g*b),v=R-x,a=R-v,ie[0]=R-(v+a)+(a-x),w=L+v,a=w-L,E=L-(w-a)+(v-a),v=E-P,a=E-v,ie[1]=E-(v+a)+(a-P),S=w+v,a=S-w,ie[2]=w-(S-a)+(v-a),ie[3]=S;const A=Ot(4,Ge,4,ie,ki);L=T*f,d=te*T,g=d-(d-T),m=T-g,d=te*f,p=d-(d-f),b=f-p,R=m*b-(L-g*p-m*p-g*b),P=M*u,d=te*M,g=d-(d-M),m=M-g,d=te*u,p=d-(d-u),b=u-p,x=m*b-(P-g*p-m*p-g*b),v=R-x,a=R-v,ie[0]=R-(v+a)+(a-x),w=L+v,a=w-L,E=L-(w-a)+(v-a),v=E-P,a=E-v,ie[1]=E-(v+a)+(a-P),S=w+v,a=S-w,ie[2]=w-(S-a)+(v-a),ie[3]=S;const de=Ot(A,ki,4,ie,Ci);L=s*f,d=te*s,g=d-(d-s),m=s-g,d=te*f,p=d-(d-f),b=f-p,R=m*b-(L-g*p-m*p-g*b),P=c*u,d=te*c,g=d-(d-c),m=c-g,d=te*u,p=d-(d-u),b=u-p,x=m*b-(P-g*p-m*p-g*b),v=R-x,a=R-v,ie[0]=R-(v+a)+(a-x),w=L+v,a=w-L,E=L-(w-a)+(v-a),v=E-P,a=E-v,ie[1]=E-(v+a)+(a-P),S=w+v,a=S-w,ie[2]=w-(S-a)+(v-a),ie[3]=S;const Q=Ot(de,Ci,4,ie,Pi);return Pi[Q-1]}function Rr(n,e,t,i,r,o){const l=(e-o)*(t-r),s=(n-r)*(i-o),c=l-s,u=Math.abs(l+s);return Math.abs(c)>=Cr*u?c:-Tr(n,e,t,i,r,o,u)}const Je=(n,e)=>n.ll.x<=e.x&&e.x<=n.ur.x&&n.ll.y<=e.y&&e.y<=n.ur.y,zt=(n,e)=>{if(e.ur.x<n.ll.x||n.ur.x<e.ll.x||e.ur.y<n.ll.y||n.ur.y<e.ll.y)return null;const t=n.ll.x<e.ll.x?e.ll.x:n.ll.x,i=n.ur.x<e.ur.x?n.ur.x:e.ur.x,r=n.ll.y<e.ll.y?e.ll.y:n.ll.y,o=n.ur.y<e.ur.y?n.ur.y:e.ur.y;return{ll:{x:t,y:r},ur:{x:i,y:o}}};let Ce=Number.EPSILON;Ce===void 0&&(Ce=Math.pow(2,-52));const Ir=Ce*Ce,Ni=(n,e)=>{if(-Ce<n&&n<Ce&&-Ce<e&&e<Ce)return 0;const t=n-e;return t*t<Ir*n*e?0:n<e?-1:1};class Or{constructor(){this.reset()}reset(){this.xRounder=new Ti,this.yRounder=new Ti}round(e,t){return{x:this.xRounder.round(e),y:this.yRounder.round(t)}}}class Ti{constructor(){this.tree=new Nt,this.round(0)}round(e){const t=this.tree.add(e),i=this.tree.prev(t);if(i!==null&&Ni(t.key,i.key)===0)return this.tree.remove(e),i.key;const r=this.tree.next(t);return r!==null&&Ni(t.key,r.key)===0?(this.tree.remove(e),r.key):e}}const $e=new Or,ut=(n,e)=>n.x*e.y-n.y*e.x,Ri=(n,e)=>n.x*e.x+n.y*e.y,Ii=(n,e,t)=>{const i=Rr(n.x,n.y,e.x,e.y,t.x,t.y);return i>0?-1:i<0?1:0},at=n=>Math.sqrt(Ri(n,n)),zr=(n,e,t)=>{const i={x:e.x-n.x,y:e.y-n.y},r={x:t.x-n.x,y:t.y-n.y};return ut(r,i)/at(r)/at(i)},Wr=(n,e,t)=>{const i={x:e.x-n.x,y:e.y-n.y},r={x:t.x-n.x,y:t.y-n.y};return Ri(r,i)/at(r)/at(i)},Oi=(n,e,t)=>e.y===0?null:{x:n.x+e.x/e.y*(t-n.y),y:t},zi=(n,e,t)=>e.x===0?null:{x:t,y:n.y+e.y/e.x*(t-n.x)},Ar=(n,e,t,i)=>{if(e.x===0)return zi(t,i,n.x);if(i.x===0)return zi(n,e,t.x);if(e.y===0)return Oi(t,i,n.y);if(i.y===0)return Oi(n,e,t.y);const r=ut(e,i);if(r==0)return null;const o={x:t.x-n.x,y:t.y-n.y},l=ut(o,e)/r,s=ut(o,i)/r,c=n.x+s*e.x,u=t.x+l*i.x,f=n.y+s*e.y,a=t.y+l*i.y,d=(c+u)/2,g=(f+a)/2;return{x:d,y:g}};class ae{static compare(e,t){const i=ae.comparePoints(e.point,t.point);return i!==0?i:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:Pe.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0}constructor(e,t){e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let i=0,r=t.length;i<r;i++){const o=t[i];this.point.events.push(o),o.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let t=0;t<e;t++){const i=this.point.events[t];if(i.segment.consumedBy===void 0)for(let r=t+1;r<e;r++){const o=this.point.events[r];o.consumedBy===void 0&&i.otherSE.point.events===o.otherSE.point.events&&i.segment.consume(o.segment)}}}getAvailableLinkedEvents(){const e=[];for(let t=0,i=this.point.events.length;t<i;t++){const r=this.point.events[t];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&e.push(r)}return e}getLeftmostComparator(e){const t=new Map,i=r=>{const o=r.otherSE;t.set(r,{sine:zr(this.point,e.point,o.point),cosine:Wr(this.point,e.point,o.point)})};return(r,o)=>{t.has(r)||i(r),t.has(o)||i(o);const{sine:l,cosine:s}=t.get(r),{sine:c,cosine:u}=t.get(o);return l>=0&&c>=0?s<u?1:s>u?-1:0:l<0&&c<0?s<u?-1:s>u?1:0:c<l?-1:c>l?1:0}}}let Fr=0;class Pe{static compare(e,t){const i=e.leftSE.point.x,r=t.leftSE.point.x,o=e.rightSE.point.x,l=t.rightSE.point.x;if(l<i)return 1;if(o<r)return-1;const s=e.leftSE.point.y,c=t.leftSE.point.y,u=e.rightSE.point.y,f=t.rightSE.point.y;if(i<r){if(c<s&&c<u)return 1;if(c>s&&c>u)return-1;const a=e.comparePoint(t.leftSE.point);if(a<0)return 1;if(a>0)return-1;const d=t.comparePoint(e.rightSE.point);return d!==0?d:-1}if(i>r){if(s<c&&s<f)return-1;if(s>c&&s>f)return 1;const a=t.comparePoint(e.leftSE.point);if(a!==0)return a;const d=e.comparePoint(t.rightSE.point);return d<0?1:d>0?-1:1}if(s<c)return-1;if(s>c)return 1;if(o<l){const a=t.comparePoint(e.rightSE.point);if(a!==0)return a}if(o>l){const a=e.comparePoint(t.rightSE.point);if(a<0)return 1;if(a>0)return-1}if(o!==l){const a=u-s,d=o-i,g=f-c,m=l-r;if(a>d&&g<m)return 1;if(a<d&&g>m)return-1}return o>l?1:o<l||u<f?-1:u>f?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,i,r){this.id=++Fr,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=i,this.windings=r}static fromRing(e,t,i){let r,o,l;const s=ae.comparePoints(e,t);if(s<0)r=e,o=t,l=1;else if(s>0)r=t,o=e,l=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const c=new ae(r,!0),u=new ae(o,!1);return new Pe(c,u,[i],[l])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<t?e:t},ur:{x:this.rightSE.point.x,y:e>t?e:t}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}comparePoint(e){if(this.isAnEndpoint(e))return 0;const t=this.leftSE.point,i=this.rightSE.point,r=this.vector();if(t.x===i.x)return e.x===t.x?0:e.x<t.x?1:-1;const o=(e.y-t.y)/r.y,l=t.x+o*r.x;if(e.x===l)return 0;const s=(e.x-t.x)/r.x,c=t.y+s*r.y;return e.y===c?0:e.y<c?-1:1}getIntersection(e){const t=this.bbox(),i=e.bbox(),r=zt(t,i);if(r===null)return null;const o=this.leftSE.point,l=this.rightSE.point,s=e.leftSE.point,c=e.rightSE.point,u=Je(t,s)&&this.comparePoint(s)===0,f=Je(i,o)&&e.comparePoint(o)===0,a=Je(t,c)&&this.comparePoint(c)===0,d=Je(i,l)&&e.comparePoint(l)===0;if(f&&u)return d&&!a?l:!d&&a?c:null;if(f)return a&&o.x===c.x&&o.y===c.y?null:o;if(u)return d&&l.x===s.x&&l.y===s.y?null:s;if(d&&a)return null;if(d)return l;if(a)return c;const g=Ar(o,this.vector(),s,e.vector());return g===null||!Je(r,g)?null:$e.round(g.x,g.y)}split(e){const t=[],i=e.events!==void 0,r=new ae(e,!0),o=new ae(e,!1),l=this.rightSE;this.replaceRightSE(o),t.push(o),t.push(r);const s=new Pe(r,l,this.rings.slice(),this.windings.slice());return ae.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),ae.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(r.checkForConsuming(),o.checkForConsuming()),t}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,i=this.windings.length;t<i;t++)this.windings[t]*=-1}consume(e){let t=this,i=e;for(;t.consumedBy;)t=t.consumedBy;for(;i.consumedBy;)i=i.consumedBy;const r=Pe.compare(t,i);if(r!==0){if(r>0){const o=t;t=i,i=o}if(t.prev===i){const o=t;t=i,i=o}for(let o=0,l=i.rings.length;o<l;o++){const s=i.rings[o],c=i.windings[o],u=t.rings.indexOf(s);u===-1?(t.rings.push(s),t.windings.push(c)):t.windings[u]+=c}i.rings=null,i.windings=null,i.consumedBy=t,i.leftSE.consumedBy=t.leftSE,i.rightSE.consumedBy=t.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};const t=this._afterState.rings,i=this._afterState.windings,r=this._afterState.multiPolys;for(let s=0,c=this.rings.length;s<c;s++){const u=this.rings[s],f=this.windings[s],a=t.indexOf(u);a===-1?(t.push(u),i.push(f)):i[a]+=f}const o=[],l=[];for(let s=0,c=t.length;s<c;s++){if(i[s]===0)continue;const u=t[s],f=u.poly;if(l.indexOf(f)===-1)if(u.isExterior)o.push(f);else{l.indexOf(f)===-1&&l.push(f);const a=o.indexOf(u.poly);a!==-1&&o.splice(a,1)}}for(let s=0,c=o.length;s<c;s++){const u=o[s].multiPoly;r.indexOf(u)===-1&&r.push(u)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(fe.type){case"union":{const i=e.length===0,r=t.length===0;this._isInResult=i!==r;break}case"intersection":{let i,r;e.length<t.length?(i=e.length,r=t.length):(i=t.length,r=e.length),this._isInResult=r===fe.numMultiPolys&&i<r;break}case"xor":{const i=Math.abs(e.length-t.length);this._isInResult=i%2===1;break}case"difference":{const i=r=>r.length===1&&r[0].isSubject;this._isInResult=i(e)!==i(t);break}default:throw new Error(`Unrecognized operation type found ${fe.type}`)}return this._isInResult}}class Wi{constructor(e,t,i){if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=i,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const r=$e.round(e[0][0],e[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};let o=r;for(let l=1,s=e.length;l<s;l++){if(typeof e[l][0]!="number"||typeof e[l][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=$e.round(e[l][0],e[l][1]);c.x===o.x&&c.y===o.y||(this.segments.push(Pe.fromRing(o,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),o=c)}(r.x!==o.x||r.y!==o.y)&&this.segments.push(Pe.fromRing(o,r,this))}getSweepEvents(){const e=[];for(let t=0,i=this.segments.length;t<i;t++){const r=this.segments[t];e.push(r.leftSE),e.push(r.rightSE)}return e}}class Ur{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Wi(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let i=1,r=e.length;i<r;i++){const o=new Wi(e[i],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=t}getSweepEvents(){const e=this.exteriorRing.getSweepEvents();for(let t=0,i=this.interiorRings.length;t<i;t++){const r=this.interiorRings[t].getSweepEvents();for(let o=0,l=r.length;o<l;o++)e.push(r[o])}return e}}class Ai{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof e[0][0][0]=="number"&&(e=[e])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let i=0,r=e.length;i<r;i++){const o=new Ur(e[i],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=t}getSweepEvents(){const e=[];for(let t=0,i=this.polys.length;t<i;t++){const r=this.polys[t].getSweepEvents();for(let o=0,l=r.length;o<l;o++)e.push(r[o])}return e}}class ct{static factory(e){const t=[];for(let i=0,r=e.length;i<r;i++){const o=e[i];if(!o.isInResult()||o.ringOut)continue;let l=null,s=o.leftSE,c=o.rightSE;const u=[s],f=s.point,a=[];for(;l=s,s=c,u.push(s),s.point!==f;)for(;;){const d=s.getAvailableLinkedEvents();if(d.length===0){const p=u[0].point,b=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${p.x}, ${p.y}]. Last matching segment found ends at [${b.x}, ${b.y}].`)}if(d.length===1){c=d[0].otherSE;break}let g=null;for(let p=0,b=a.length;p<b;p++)if(a[p].point===s.point){g=p;break}if(g!==null){const p=a.splice(g)[0],b=u.splice(p.index);b.unshift(b[0].otherSE),t.push(new ct(b.reverse()));continue}a.push({index:u.length,point:s.point});const m=s.getLeftmostComparator(l);c=d.sort(m)[0].otherSE;break}t.push(new ct(u))}return t}constructor(e){this.events=e;for(let t=0,i=e.length;t<i;t++)e[t].segment.ringOut=this;this.poly=null}getGeom(){let e=this.events[0].point;const t=[e];for(let u=1,f=this.events.length-1;u<f;u++){const a=this.events[u].point,d=this.events[u+1].point;Ii(a,e,d)!==0&&(t.push(a),e=a)}if(t.length===1)return null;const i=t[0],r=t[1];Ii(i,e,r)===0&&t.shift(),t.push(t[0]);const o=this.isExteriorRing()?1:-1,l=this.isExteriorRing()?0:t.length-1,s=this.isExteriorRing()?t.length:-1,c=[];for(let u=l;u!=s;u+=o)c.push([t[u].x,t[u].y]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){const e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let e=this.events[0];for(let r=1,o=this.events.length;r<o;r++){const l=this.events[r];ae.compare(e,l)>0&&(e=l)}let t=e.segment.prevInResult(),i=t?t.prevInResult():null;for(;;){if(!t)return null;if(!i)return t.ringOut;if(i.ringOut!==t.ringOut)return i.ringOut.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut.enclosingRing();t=i.prevInResult(),i=t?t.prevInResult():null}}}class Fi{constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){const e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(let t=0,i=this.interiorRings.length;t<i;t++){const r=this.interiorRings[t].getGeom();r!==null&&e.push(r)}return e}}class Dr{constructor(e){this.rings=e,this.polys=this._composePolys(e)}getGeom(){const e=[];for(let t=0,i=this.polys.length;t<i;t++){const r=this.polys[t].getGeom();r!==null&&e.push(r)}return e}_composePolys(e){const t=[];for(let i=0,r=e.length;i<r;i++){const o=e[i];if(!o.poly)if(o.isExteriorRing())t.push(new Fi(o));else{const l=o.enclosingRing();l.poly||t.push(new Fi(l)),l.poly.addInterior(o)}}return t}}class Br{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Pe.compare;this.queue=e,this.tree=new Nt(t),this.segments=[]}process(e){const t=e.segment,i=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),i;const r=e.isLeft?this.tree.add(t):this.tree.find(t);if(!r)throw new Error(`Unable to find segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] in SweepLine tree.`);let o=r,l=r,s,c;for(;s===void 0;)o=this.tree.prev(o),o===null?s=null:o.key.consumedBy===void 0&&(s=o.key);for(;c===void 0;)l=this.tree.next(l),l===null?c=null:l.key.consumedBy===void 0&&(c=l.key);if(e.isLeft){let u=null;if(s){const a=s.getIntersection(t);if(a!==null&&(t.isAnEndpoint(a)||(u=a),!s.isAnEndpoint(a))){const d=this._splitSafely(s,a);for(let g=0,m=d.length;g<m;g++)i.push(d[g])}}let f=null;if(c){const a=c.getIntersection(t);if(a!==null&&(t.isAnEndpoint(a)||(f=a),!c.isAnEndpoint(a))){const d=this._splitSafely(c,a);for(let g=0,m=d.length;g<m;g++)i.push(d[g])}}if(u!==null||f!==null){let a=null;u===null?a=f:f===null?a=u:a=ae.comparePoints(u,f)<=0?u:f,this.queue.remove(t.rightSE),i.push(t.rightSE);const d=t.split(a);for(let g=0,m=d.length;g<m;g++)i.push(d[g])}i.length>0?(this.tree.remove(t),i.push(e)):(this.segments.push(t),t.prev=s)}else{if(s&&c){const u=s.getIntersection(c);if(u!==null){if(!s.isAnEndpoint(u)){const f=this._splitSafely(s,u);for(let a=0,d=f.length;a<d;a++)i.push(f[a])}if(!c.isAnEndpoint(u)){const f=this._splitSafely(c,u);for(let a=0,d=f.length;a<d;a++)i.push(f[a])}}}this.tree.remove(t)}return i}_splitSafely(e,t){this.tree.remove(e);const i=e.rightSE;this.queue.remove(i);const r=e.split(t);return r.push(i),e.consumedBy===void 0&&this.tree.add(e),r}}const Ui=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Gr=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class qr{run(e,t,i){fe.type=e,$e.reset();const r=[new Ai(t,!0)];for(let a=0,d=i.length;a<d;a++)r.push(new Ai(i[a],!1));if(fe.numMultiPolys=r.length,fe.type==="difference"){const a=r[0];let d=1;for(;d<r.length;)zt(r[d].bbox,a.bbox)!==null?d++:r.splice(d,1)}if(fe.type==="intersection")for(let a=0,d=r.length;a<d;a++){const g=r[a];for(let m=a+1,p=r.length;m<p;m++)if(zt(g.bbox,r[m].bbox)===null)return[]}const o=new Nt(ae.compare);for(let a=0,d=r.length;a<d;a++){const g=r[a].getSweepEvents();for(let m=0,p=g.length;m<p;m++)if(o.insert(g[m]),o.size>Ui)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const l=new Br(o);let s=o.size,c=o.pop();for(;c;){const a=c.key;if(o.size===s){const g=a.segment;throw new Error(`Unable to pop() ${a.isLeft?"left":"right"} SweepEvent [${a.point.x}, ${a.point.y}] from segment #${g.id} [${g.leftSE.point.x}, ${g.leftSE.point.y}] -> [${g.rightSE.point.x}, ${g.rightSE.point.y}] from queue.`)}if(o.size>Ui)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(l.segments.length>Gr)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const d=l.process(a);for(let g=0,m=d.length;g<m;g++){const p=d[g];p.consumedBy===void 0&&o.insert(p)}s=o.size,c=o.pop()}$e.reset();const u=ct.factory(l.segments);return new Dr(u).getGeom()}}const fe=new qr;var Di={union:function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return fe.run("union",n,t)},intersection:function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return fe.run("intersection",n,t)},xor:function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return fe.run("xor",n,t)},difference:function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return fe.run("difference",n,t)}};function jr(n){const e=[];if(kt(n,r=>{e.push(r.coordinates)}),e.length<2)throw new Error("Must have at least two features");const t=n.features[0].properties||{},i=Di.difference(e[0],...e.slice(1));return i.length===0?null:i.length===1?xt(i[0],t):Li(i,t)}var Vr=jr;function Qr(n){if(!n)throw new Error("geojson is required");var e=[];return vr(n,function(t){e.push(t)}),Mt(e)}var Zr=Qr;function Hr(n,e={}){const t=[];if(kt(n,r=>{t.push(r.coordinates)}),t.length<2)throw new Error("Must have at least 2 geometries");const i=Di.union(t[0],...t.slice(1));return i.length===0?null:i.length===1?xt(i[0],e.properties):Li(i,e.properties)}var Yr=Hr;function Bi(n,e){const t=Vr(Mt([xt([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),n]));if(!t)return;t.properties={isMask:!0};const i=st(xi(n)),r=(i[2]-i[0])/360/1e3,o=i[0]<-180,l=i[2]>180,s=Zr(n);if(s.features.length>1&&(o||l))for(const c of s.features){const u=st(xi(c));if(l&&u[0]<-180+r)for(const f of c.geometry.coordinates)for(const a of f)a[0]+=360-r;if(o&&u[2]>180-r)for(const f of c.geometry.coordinates)for(const a of f)a[0]-=360-r}e(Mt([s.features.length<2?n:Yr(s)??n,t]))}const Gi="EPSG:4326";function Xr(n){var o;const e=n.getProperties(),{isMask:t}=e,i=(o=n.getGeometry())==null?void 0:o.getType(),r=t?0:i==="LineString"||i==="MultiLineString"?3:2;return new fn({stroke:t?void 0:new Jt({color:"#3170fe",lineDash:[r,r],width:r,lineCap:"butt"}),fill:t?new Kt({color:"#00000020"}):void 0,image:new cn({src:`/icons/marker_${e.isReverse?"reverse":e.isSelected?"selected":"unselected"}.svg`,anchor:[.5,1]}),zIndex:e.isSelected?2:e.isReverse?0:1,text:e.isSelected&&e.tooltip?new dn({backgroundFill:new Kt({color:"white"}),text:e.tooltip,offsetY:-40,backgroundStroke:new Jt({color:"white",lineJoin:"round",width:3}),padding:[2,0,0,2]}):void 0})}function qi(n,e={},t={},i=Xr){let r=-1,o,l,s,c=!1;const u=new un({updateWhileAnimating:!0});n.addLayer(u);const f=new an({});u.setSource(f),u.setStyle(i),n.on("click",m=>{n.forEachFeatureAtPixel(m.pixel,p=>{const b=p.getId();if(b)return m.stopPropagation(),l==null||l({type:"markerClick",id:b}),p})}),n.on("pointermove",m=>{const p=n.forEachFeatureAtPixel(m.pixel,b=>b.getId());o!==p&&(o&&(l==null||l({type:"markerMouseLeave",id:o})),p&&(l==null||l({type:"markerMouseEnter",id:p})),n.getTargetElement().style.cursor=p?"pointer":c?"crosshair":"",o=p)});function a(){return Le.getUserProjection()??n.getView().getProjection()}function d(m){return m.transform(Gi,a())}const g=m=>{l==null||l({type:"mapClick",coordinates:Le.toLonLat(m.coordinate,a())})};return{setEventHandler(m){m?(l=m,n.on("click",g)):(l=void 0,n.un("click",g))},flyTo(m,p){n.getView().animate({center:Le.fromLonLat(m,a()),...p?{zoom:p}:{},duration:2e3,...e})},fitBounds(m,p,b){n.getView().fit(Le.transformExtent(m,Gi,a()),{padding:[p,p,p,p],...b?{maxZoom:b}:{},duration:2e3,...t})},indicateReverse(m){c=m,n.getTargetElement().style.cursor=m?"crosshair":""},setReverseMarker(m){s?m?s.getGeometry().setCoordinates(Le.fromLonLat(m,a())):(f.removeFeature(s),s.dispose(),s=void 0):m&&(s=new le.Feature(new ue.Point(Le.fromLonLat(m,a()))),s.setProperties({isReverse:!0}),f.addFeature(s))},setFeatures(m,p,b){function v(w){var E;if(w)for(const L of w.features){const R=L.geometry.type==="Polygon"?new ue.Polygon(L.geometry.coordinates):L.geometry.type==="MultiPolygon"?new ue.MultiPolygon(L.geometry.coordinates):null;R&&f.addFeature(new le.Feature({isMask:!!((E=L.properties)!=null&&E.isMask),geometry:d(R)}))}}f.clear(),s&&f.addFeature(s);e:if(p){let w=!1;if(p.geometry.type==="GeometryCollection"){const E=p.geometry.geometries.map(L=>L.type==="Polygon"?new ue.Polygon(L.coordinates):L.type==="MultiPolygon"?new ue.MultiPolygon(L.coordinates):null).filter(L=>!!L);if(E.length>0)f.addFeature(new le.Feature(d(new ue.GeometryCollection(E)))),w=!0;else for(const L of p.geometry.geometries)L.type==="LineString"?(f.addFeature(new le.Feature(d(new ue.LineString(L.coordinates)))),w=!0):L.type==="MultiLineString"&&f.addFeature(new le.Feature(d(new ue.MultiLineString(L.coordinates)))),w=!0}if(!w){if(p.geometry.type==="Polygon")Bi(p,v);else if(p.geometry.type==="MultiPolygon")Bi(p,v);else if(p.geometry.type==="LineString"){f.addFeature(new le.Feature(d(new ue.LineString(p.geometry.coordinates))));break e}else if(p.geometry.type==="MultiLineString"){f.addFeature(new le.Feature(d(new ue.MultiLineString(p.geometry.coordinates))));break e}}if(!b&&p.geometry.type!=="Point")break e;f.addFeature(new le.Feature(d(new ue.Point(p.center))))}for(const w of m??[]){if(w===p)continue;const E=new le.Feature(new ue.Point(Le.fromLonLat(w.center,a())));E.setId(w.id),E.setProperties({fuzzy:!!w.matching_text,tooltip:w.place_type[0]==="reverse"?w.place_name:w.place_name.replace(/,.*/,"")}),f.addFeature(E)}},setSelectedMarker(m){var v,w,E;const p=f.getFeatures(),b=(v=p[0])!=null&&v.getProperties().isReverse?1:0;r>-1&&((w=p[r+b])==null||w.setProperties({isSelected:!1})),m>-1&&((E=p[m+b])==null||E.setProperties({isSelected:!0})),r=m},getCenterAndZoom(){const m=n.getView(),p=m.getCenter(),b=m.getZoom();if(!(!p||b===void 0))return[b,...Le.toLonLat(p,a())]}}}class Kr extends D.Control{constructor(t){const i=document.createElement("div");i.className="ol-search";super({element:i,target:t.target});Yt(this,Y);Yt(this,ze);const{flyTo:r,fullGeometryStyle:o,...l}=t;Xt(this,Y,new pr({target:i,props:{flyTo:r===void 0?!0:!!r,...l}})),K(this,Y).$on("select",s=>{this.dispatchEvent(new ji(s.detail.feature))}),K(this,Y).$on("pick",s=>{this.dispatchEvent(new Hi(s.detail.feature))}),K(this,Y).$on("featureslisted",s=>{this.dispatchEvent(new Vi(s.detail.features))}),K(this,Y).$on("featuresmarked",s=>{this.dispatchEvent(new Qi(s.detail.features))}),K(this,Y).$on("response",s=>{this.dispatchEvent(new Xi(s.detail.url,s.detail.featureCollection))}),K(this,Y).$on("optionsvisibilitychange",s=>{this.dispatchEvent(new Zi(s.detail.optionsVisible))}),K(this,Y).$on("reversetoggle",s=>{this.dispatchEvent(new Ki(s.detail.reverse))}),K(this,Y).$on("querychange",s=>{this.dispatchEvent(new Yi(s.detail.query))}),Xt(this,ze,t)}setMap(t){var i;if(super.setMap(t),t){const{flyTo:r,fullGeometryStyle:o}=K(this,ze),l=qi(t,typeof r=="boolean"?void 0:r,typeof r=="boolean"?void 0:r,o);(i=K(this,Y))==null||i.$set({mapController:l})}}setOptions(t){var l;Object.assign(K(this,ze),t);const{flyTo:i,fullGeometryStyle:r,...o}=K(this,ze);(l=K(this,Y))==null||l.$set({...o,flyTo:i===void 0?!0:!!i})}setQuery(t,i=!0){var r;(r=K(this,Y))==null||r.setQuery(t,i)}clearMap(){var t;(t=K(this,Y))==null||t.clearMap()}clearList(){var t;(t=K(this,Y))==null||t.clearList()}setReverseMode(t){var i;(i=K(this,Y))==null||i.$set({reverseActive:t})}focus(t){var i;(i=K(this,Y))==null||i.focus(t)}blur(){var t;(t=K(this,Y))==null||t.blur()}}Y=new WeakMap,ze=new WeakMap;class ji extends B{constructor(t){super("select");ce(this,"feature");this.feature=t}}class Vi extends B{constructor(t){super("featureslisted");ce(this,"features");this.features=t}}class Qi extends B{constructor(t){super("featuresmarked");ce(this,"features");this.features=t}}class Zi extends B{constructor(t){super("optionsvisibilitychange");ce(this,"optionsVisible");this.optionsVisible=t}}class Hi extends B{constructor(t){super("pick");ce(this,"feature");this.feature=t}}class Yi extends B{constructor(t){super("querychange");ce(this,"query");this.query=t}}class Xi extends B{constructor(t,i){super("response");ce(this,"url");ce(this,"featureCollection");this.url=t,this.featureCollection=i}}class Ki extends B{constructor(t){super("reversetoggle");ce(this,"reverse");this.reverse=t}}N.FeaturesListedEvent=Vi,N.FeaturesMarkedEvent=Qi,N.GeocodingControl=Kr,N.OptionsVisibilityChangeEvent=Zi,N.PickEvent=Hi,N.QueryChangeEvent=Yi,N.ResponseEvent=Xi,N.ReverseToggleEvent=Ki,N.SelectEvent=ji,N.createOpenLayersMapController=qi,Object.defineProperty(N,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(W,$){typeof exports=="object"&&typeof module<"u"?$(exports,require("ol/control"),require("ol/events/Event"),require("ol"),require("ol/geom"),require("ol/layer/Vector"),require("ol/proj"),require("ol/source/Vector"),require("ol/style/Fill"),require("ol/style/Icon"),require("ol/style/Stroke"),require("ol/style/Style"),require("ol/style/Text")):typeof define=="function"&&define.amd?define(["exports","ol/control","ol/events/Event","ol","ol/geom","ol/layer/Vector","ol/proj","ol/source/Vector","ol/style/Fill","ol/style/Icon","ol/style/Stroke","ol/style/Style","ol/style/Text"],$):(W=typeof globalThis<"u"?globalThis:W||self,$(W.openlayersMaptilerGeocoder={},W.ol.control,W.ol.events.Event,W.ol,W.ol.geom,W.ol.layer.Vector,W.ol.proj,W.ol.source.Vector,W.ol.style.Fill,W.ol.style.Icon,W.ol.style.Stroke,W.ol.style.Style,W.ol.style.Text))})(this,function(W,$,te,Te,Me,xn,Ke,Tn,mi,Mn,pi,Nn,Cn){"use strict";var Rs=Object.defineProperty;var Ln=W=>{throw TypeError(W)};var Is=(W,$,te)=>$ in W?Rs(W,$,{enumerable:!0,configurable:!0,writable:!0,value:te}):W[$]=te;var P=(W,$,te)=>Is(W,typeof $!="symbol"?$+"":$,te),Sn=(W,$,te)=>$.has(W)||Ln("Cannot "+te);var he=(W,$,te)=>(Sn(W,$,"read from private field"),te?te.call(W):$.get(W)),hi=(W,$,te)=>$.has(W)?Ln("Cannot add the same private member more than once"):$ instanceof WeakSet?$.add(W):$.set(W,te),di=(W,$,te,Te)=>(Sn(W,$,"write to private field"),Te?Te.call(W,te):$.set(W,te),te);var dn,gn,fe,st;function re(){}function kn(i,e){for(const t in e)i[t]=e[t];return i}function yi(i){return i()}function vi(){return Object.create(null)}function Fe(i){i.forEach(yi)}function bi(i){return typeof i=="function"}function et(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let Nt;function ve(i,e){return i===e?!0:(Nt||(Nt=document.createElement("a")),Nt.href=e,i===Nt.href)}function On(i){return Object.keys(i).length===0}function Pn(i,e,t,n){if(i){const r=wi(i,e,t,n);return i[0](r)}}function wi(i,e,t,n){return i[1]&&n?kn(t.ctx.slice(),i[1](n(e))):t.ctx}function Rn(i,e,t,n){return i[2],e.dirty}function In(i,e,t,n,r,u){if(r){const a=wi(e,t,n,u);i.p(a,r)}}function An(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 Ct(i){return i??""}function H(i,e){i.appendChild(e)}function se(i,e,t){i.insertBefore(e,t||null)}function ie(i){i.parentNode&&i.parentNode.removeChild(i)}function J(i){return document.createElement(i)}function De(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function Ye(i){return document.createTextNode(i)}function Ee(){return Ye(" ")}function Gn(){return Ye("")}function de(i,e,t,n){return i.addEventListener(e,t,n),()=>i.removeEventListener(e,t,n)}function Bn(i){return function(e){return e.preventDefault(),i.call(this,e)}}function x(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}function zn(i){return Array.from(i.childNodes)}function mt(i,e){e=""+e,i.data!==e&&(i.data=e)}function Ei(i,e){i.value=e??""}function at(i,e,t){i.classList.toggle(e,!!t)}function Wn(i,e,{bubbles:t=!1,cancelable:n=!1}={}){return new CustomEvent(i,{detail:e,bubbles:t,cancelable:n})}let pt;function yt(i){pt=i}function Li(){if(!pt)throw new Error("Function called outside component initialization");return pt}function Fn(i){Li().$$.on_destroy.push(i)}function Si(){const i=Li();return(e,t,{cancelable:n=!1}={})=>{const r=i.$$.callbacks[e];if(r){const u=Wn(e,t,{cancelable:n});return r.slice().forEach(a=>{a.call(i,u)}),!u.defaultPrevented}return!0}}function Dn(i,e){const t=i.$$.callbacks[e.type];t&&t.slice().forEach(n=>n.call(this,e))}const ft=[],jt=[];let ct=[];const _i=[],Un=Promise.resolve();let Ht=!1;function qn(){Ht||(Ht=!0,Un.then(xi))}function Zt(i){ct.push(i)}const Kt=new Set;let ht=0;function xi(){if(ht!==0)return;const i=pt;do{try{for(;ht<ft.length;){const e=ft[ht];ht++,yt(e),Vn(e.$$)}}catch(e){throw ft.length=0,ht=0,e}for(yt(null),ft.length=0,ht=0;jt.length;)jt.pop()();for(let e=0;e<ct.length;e+=1){const t=ct[e];Kt.has(t)||(Kt.add(t),t())}ct.length=0}while(ft.length);for(;_i.length;)_i.pop()();Ht=!1,Kt.clear(),yt(i)}function Vn(i){if(i.fragment!==null){i.update(),Fe(i.before_update);const e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(Zt)}}function jn(i){const e=[],t=[];ct.forEach(n=>i.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),ct=e}const kt=new Set;let tt;function Ot(){tt={r:0,c:[],p:tt}}function Pt(){tt.r||Fe(tt.c),tt=tt.p}function ue(i,e){i&&i.i&&(kt.delete(i),i.i(e))}function pe(i,e,t,n){if(i&&i.o){if(kt.has(i))return;kt.add(i),tt.c.push(()=>{kt.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 Hn(i,e){pe(i,1,1,()=>{e.delete(i.key)})}function Zn(i,e,t,n,r,u,a,s,g,h,b,S){let M=i.length,k=u.length,N=M;const C={};for(;N--;)C[i[N].key]=N;const O=[],A=new Map,_=new Map,R=[];for(N=k;N--;){const G=S(r,u,N),o=t(G);let l=a.get(o);l?R.push(()=>l.p(G,e)):(l=h(o,G),l.c()),A.set(o,O[N]=l),o in C&&_.set(o,Math.abs(N-C[o]))}const F=new Set,K=new Set;function D(G){ue(G,1),G.m(s,b),a.set(G.key,G),b=G.first,k--}for(;M&&k;){const G=O[k-1],o=i[M-1],l=G.key,f=o.key;G===o?(b=G.first,M--,k--):A.has(f)?!a.has(l)||F.has(l)?D(G):K.has(f)?M--:_.get(l)>_.get(f)?(K.add(l),D(G)):(F.add(f),M--):(g(o,a),M--)}for(;M--;){const G=i[M];A.has(G.key)||g(G,a)}for(;k;)D(O[k-1]);return Fe(R),O}function Qe(i){i&&i.c()}function Ue(i,e,t){const{fragment:n,after_update:r}=i.$$;n&&n.m(e,t),Zt(()=>{const u=i.$$.on_mount.map(yi).filter(bi);i.$$.on_destroy?i.$$.on_destroy.push(...u):Fe(u),i.$$.on_mount=[]}),r.forEach(Zt)}function qe(i,e){const t=i.$$;t.fragment!==null&&(jn(t.after_update),Fe(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Kn(i,e){i.$$.dirty[0]===-1&&(ft.push(i),qn(),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function it(i,e,t,n,r,u,a=null,s=[-1]){const g=pt;yt(i);const h=i.$$={fragment:null,ctx:[],props:u,update:re,not_equal:r,bound:vi(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(g?g.$$.context:[])),callbacks:vi(),dirty:s,skip_bound:!1,root:e.target||g.$$.root};a&&a(h.root);let b=!1;if(h.ctx=t?t(i,e.props||{},(S,M,...k)=>{const N=k.length?k[0]:M;return h.ctx&&r(h.ctx[S],h.ctx[S]=N)&&(!h.skip_bound&&h.bound[S]&&h.bound[S](N),b&&Kn(i,S)),M}):[],h.update(),b=!0,Fe(h.before_update),h.fragment=n?n(h.ctx):!1,e.target){if(e.hydrate){const S=zn(e.target);h.fragment&&h.fragment.l(S),S.forEach(ie)}else h.fragment&&h.fragment.c();e.intro&&ue(i.$$.fragment),Ue(i,e.target,e.anchor),xi()}yt(g)}class nt{constructor(){P(this,"$$");P(this,"$$set")}$destroy(){qe(this,1),this.$destroy=re}$on(e,t){if(!bi(t))return re;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&&!On(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Yn="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Yn);function Qn(i){let e,t;return{c(){e=De("svg"),t=De("path"),x(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"),x(e,"viewBox","0 0 14 14"),x(e,"width","13"),x(e,"height","13"),x(e,"class","svelte-en2qvf")},m(n,r){se(n,e,r),H(e,t)},p:re,i:re,o:re,d(n){n&&ie(e)}}}class Mi extends nt{constructor(e){super(),it(this,e,null,Qn,et,{})}}function Xn(i){let e,t;return{c(){e=De("svg"),t=De("path"),x(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"),x(e,"viewBox","0 0 30 30"),x(e,"fill","none"),x(e,"xmlns","http://www.w3.org/2000/svg"),x(e,"class","svelte-d2loi5")},m(n,r){se(n,e,r),H(e,t)},p:re,i:re,o:re,d(n){n&&ie(e)}}}class Ni extends nt{constructor(e){super(),it(this,e,null,Xn,et,{})}}function Jn(i){let e,t;return{c(){e=J("img"),ve(e.src,t=i[3]+"area.svg")||x(e,"src",t),x(e,"alt",i[6]),x(e,"title",i[6]),x(e,"class","svelte-z7p9pp")},m(n,r){se(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"area.svg")&&x(e,"src",t),r&64&&x(e,"alt",n[6]),r&64&&x(e,"title",n[6])},d(n){n&&ie(e)}}}function $n(i){let e,t;return{c(){e=J("img"),ve(e.src,t=i[3]+"reverse.svg")||x(e,"src",t),x(e,"alt",i[6]),x(e,"title",i[6]),x(e,"class","svelte-z7p9pp")},m(n,r){se(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"reverse.svg")&&x(e,"src",t),r&64&&x(e,"alt",n[6]),r&64&&x(e,"title",n[6])},d(n){n&&ie(e)}}}function er(i){let e,t;return{c(){e=J("img"),ve(e.src,t=i[3]+"poi.svg")||x(e,"src",t),x(e,"alt",i[6]),x(e,"title",i[6]),x(e,"class","svelte-z7p9pp")},m(n,r){se(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"poi.svg")&&x(e,"src",t),r&64&&x(e,"alt",n[6]),r&64&&x(e,"title",n[6])},d(n){n&&ie(e)}}}function tr(i){let e,t;return{c(){e=J("img"),ve(e.src,t=i[3]+"postal_code.svg")||x(e,"src",t),x(e,"alt",i[6]),x(e,"title",i[6]),x(e,"class","svelte-z7p9pp")},m(n,r){se(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"postal_code.svg")&&x(e,"src",t),r&64&&x(e,"alt",n[6]),r&64&&x(e,"title",n[6])},d(n){n&&ie(e)}}}function ir(i){let e,t;return{c(){e=J("img"),ve(e.src,t=i[3]+"street.svg")||x(e,"src",t),x(e,"alt",i[6]),x(e,"title",i[6]),x(e,"class","svelte-z7p9pp")},m(n,r){se(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"street.svg")&&x(e,"src",t),r&64&&x(e,"alt",n[6]),r&64&&x(e,"title",n[6])},d(n){n&&ie(e)}}}function nr(i){let e,t;return{c(){e=J("img"),ve(e.src,t=i[3]+"road.svg")||x(e,"src",t),x(e,"alt",i[6]),x(e,"title",i[6]),x(e,"class","svelte-z7p9pp")},m(n,r){se(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"road.svg")&&x(e,"src",t),r&64&&x(e,"alt",n[6]),r&64&&x(e,"title",n[6])},d(n){n&&ie(e)}}}function rr(i){let e,t;return{c(){e=J("img"),ve(e.src,t=i[3]+"housenumber.svg")||x(e,"src",t),x(e,"alt",i[6]),x(e,"title",i[6]),x(e,"class","svelte-z7p9pp")},m(n,r){se(n,e,r)},p(n,r){r&8&&!ve(e.src,t=n[3]+"housenumber.svg")&&x(e,"src",t),r&64&&x(e,"alt",n[6]),r&64&&x(e,"title",n[6])},d(n){n&&ie(e)}}}function sr(i){let e,t,n,r;return{c(){e=J("img"),ve(e.src,t=i[5])||x(e,"src",t),x(e,"alt",i[4]),x(e,"title",i[6]),x(e,"class","svelte-z7p9pp")},m(u,a){se(u,e,a),n||(r=de(e,"error",i[14]),n=!0)},p(u,a){a&32&&!ve(e.src,t=u[5])&&x(e,"src",t),a&16&&x(e,"alt",u[4]),a&64&&x(e,"title",u[6])},d(u){u&&ie(e),n=!1,r()}}}function Ci(i){let e,t;return{c(){e=J("span"),t=Ye(i[6]),x(e,"class","secondary svelte-z7p9pp")},m(n,r){se(n,e,r),H(e,t)},p(n,r){r&64&&mt(t,n[6])},d(n){n&&ie(e)}}}function or(i){let e,t,n,r,u,a,s,g,h,b=(i[8]?i[0].place_name:i[0].place_name.replace(/,.*/,""))+"",S,M,k=i[2]==="always"||i[2]!=="never"&&!i[0].address&&!i[0].id.startsWith("road.")&&!i[0].id.startsWith("address.")&&!i[0].id.startsWith("postal_code.")&&(!i[0].id.startsWith("poi.")||!i[5])&&!i[8],N,C,O=(i[8]?"":i[0].place_name.replace(/[^,]*,?\s*/,""))+"",A,_,R,F,K,D;function G(m,c){return c&1&&(t=null),c&1&&(n=null),c&1&&(r=null),c&1&&(u=null),m[5]?sr:m[0].address?rr:(t==null&&(t=!!m[0].id.startsWith("road.")),t?nr:(n==null&&(n=!!m[0].id.startsWith("address.")),n?ir:(r==null&&(r=!!m[0].id.startsWith("postal_code.")),r?tr:(u==null&&(u=!!m[0].id.startsWith("poi.")),u?er:m[8]?$n:Jn))))}let o=G(i,-1),l=o(i),f=k&&Ci(i);return{c(){e=J("li"),l.c(),a=Ee(),s=J("span"),g=J("span"),h=J("span"),S=Ye(b),M=Ee(),f&&f.c(),N=Ee(),C=J("span"),A=Ye(O),x(h,"class","primary svelte-z7p9pp"),x(g,"class","svelte-z7p9pp"),x(C,"class","line2 svelte-z7p9pp"),x(s,"class","texts svelte-z7p9pp"),x(e,"tabindex","-1"),x(e,"role","option"),x(e,"aria-selected",_=i[1]==="selected"),x(e,"aria-checked",R=i[1]==="picked"),x(e,"class",F=Ct(i[1])+" svelte-z7p9pp")},m(m,c){se(m,e,c),l.m(e,null),H(e,a),H(e,s),H(s,g),H(g,h),H(h,S),H(g,M),f&&f.m(g,null),H(s,N),H(s,C),H(C,A),K||(D=[de(e,"mouseenter",i[13]),de(e,"focus",i[15]),de(e,"click",i[16])],K=!0)},p(m,[c]){o===(o=G(m,c))&&l?l.p(m,c):(l.d(1),l=o(m),l&&(l.c(),l.m(e,a))),c&1&&b!==(b=(m[8]?m[0].place_name:m[0].place_name.replace(/,.*/,""))+"")&&mt(S,b),c&37&&(k=m[2]==="always"||m[2]!=="never"&&!m[0].address&&!m[0].id.startsWith("road.")&&!m[0].id.startsWith("address.")&&!m[0].id.startsWith("postal_code.")&&(!m[0].id.startsWith("poi.")||!m[5])&&!m[8]),k?f?f.p(m,c):(f=Ci(m),f.c(),f.m(g,null)):f&&(f.d(1),f=null),c&1&&O!==(O=(m[8]?"":m[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&mt(A,O),c&2&&_!==(_=m[1]==="selected")&&x(e,"aria-selected",_),c&2&&R!==(R=m[1]==="picked")&&x(e,"aria-checked",R),c&2&&F!==(F=Ct(m[1])+" svelte-z7p9pp")&&x(e,"class",F)},i:re,o:re,d(m){m&&ie(e),l.d(),f&&f.d(),K=!1,Fe(D)}}}function lr(i,e,t){var K;let n,r,{feature:u}=e,{style:a="default"}=e,{showPlaceType:s}=e,{missingIconsCache:g}=e,{iconsBaseUrl:h}=e;const b=Si(),S=(K=u.properties)==null?void 0:K.categories;let M,k,N=0,C=u.place_type[0]==="reverse";function O(){k&&g.add(k),t(11,N++,N)}function A(D){Dn.call(this,i,D)}const _=()=>O(),R=()=>b("select",void 0),F=D=>{document.activeElement!==D.target&&b("select",void 0)};return i.$$set=D=>{"feature"in D&&t(0,u=D.feature),"style"in D&&t(1,a=D.style),"showPlaceType"in D&&t(2,s=D.showPlaceType),"missingIconsCache"in D&&t(10,g=D.missingIconsCache),"iconsBaseUrl"in D&&t(3,h=D.iconsBaseUrl)},i.$$.update=()=>{var D,G,o,l;if(i.$$.dirty&7224)do t(12,n--,n),t(4,M=S==null?void 0:S[n]),t(5,k=M?h+M.replace(/ /g,"_")+".svg":void 0);while(n>-1&&(!k||g.has(k)));i.$$.dirty&1&&t(6,r=((G=(D=u.properties)==null?void 0:D.categories)==null?void 0:G.join(", "))??((l=(o=u.properties)==null?void 0:o.place_type_name)==null?void 0:l[0])??u.place_type[0])},t(12,n=(S==null?void 0:S.length)??0),[u,a,s,h,M,k,r,b,C,O,g,N,n,A,_,R,F]}class ur extends nt{constructor(e){super(),it(this,e,lr,or,et,{feature:0,style:1,showPlaceType:2,missingIconsCache:10,iconsBaseUrl:3})}}function ar(i){let e;return{c(){e=J("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>',x(e,"class","svelte-7cmwmc")},m(t,n){se(t,e,n)},p:re,i:re,o:re,d(t){t&&ie(e)}}}class fr extends nt{constructor(e){super(),it(this,e,null,ar,et,{})}}function cr(i){let e,t;return{c(){e=De("svg"),t=De("path"),x(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"),x(e,"viewBox","0 0 60.006 21.412"),x(e,"width","14"),x(e,"height","20"),x(e,"class","svelte-en2qvf")},m(n,r){se(n,e,r),H(e,t)},p:re,i:re,o:re,d(n){n&&ie(e)}}}class hr extends nt{constructor(e){super(),it(this,e,null,cr,et,{})}}function dr(i){let e,t,n;return{c(){e=De("svg"),t=De("circle"),n=De("path"),x(t,"cx","4.789"),x(t,"cy","4.787"),x(t,"r","3.85"),x(t,"class","svelte-1aq105l"),x(n,"d","M12.063 12.063 7.635 7.635"),x(n,"class","svelte-1aq105l"),x(e,"xmlns","http://www.w3.org/2000/svg"),x(e,"width","13"),x(e,"height","13"),x(e,"viewBox","0 0 13 13"),x(e,"class","svelte-1aq105l")},m(r,u){se(r,e,u),H(e,t),H(e,n)},p:re,i:re,o:re,d(r){r&&ie(e)}}}class gr extends nt{constructor(e){super(),it(this,e,null,dr,et,{})}}function mr(i,e,t){const n=e[1],r=e[0],u=n-r;return i===n&&t?i:((i-r)%u+u)%u+r}function Rt(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 vt;async function pr(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(vt&&r.cachedLocationExpiry&&vt.time+r.cachedLocationExpiry>Date.now()){if(!vt.coords)break e;return vt.coords}let u;try{return u=await new Promise((a,s)=>{t.signal.addEventListener("abort",()=>{s(Error("aborted"))}),navigator.geolocation.getCurrentPosition(g=>{a([g.coords.longitude,g.coords.latitude].map(h=>h.toFixed(6)).join(","))},g=>{s(g)},r)}),u}catch{}finally{r.cachedLocationExpiry&&(vt={time:Date.now(),coords:u})}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 yr=/^(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,ki=/^([+-]?[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,Pi=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(EAST|WEST|[EW])?$/i,Ri=/^(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,Ii=/^(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 vr(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(k=>Number(k.trim())),t=Number(e[0]),n=Number(e[1]),r=Math.abs(t),u=Math.abs(n),a=t>0?"N":"S",s=n>0?"E":"W";let g;i=="DD"&&(g=`${r}° ${a}, ${u}° ${s}`);const h=Math.floor(r),b=Math.floor(u),S=(r-h)*60,M=(u-b)*60;if(i=="DM"){let k=Ai(S,3).toFixed(3).padStart(6,"0"),N=Ai(M,3).toFixed(3).padStart(6,"0");k.endsWith(".000")&&N.endsWith(".000")&&(k=k.replace(/\.000$/,""),N=N.replace(/\.000$/,"")),g=`${h}° ${k}' ${a}, ${b}° ${N}' ${s}`}if(i=="DMS"){const k=Math.floor(S),N=Math.floor(M);let C=((S-k)*60).toFixed(1).padStart(4,"0"),O=((M-N)*60).toFixed(1).padStart(4,"0");const A=k.toString().padStart(2,"0"),_=N.toString().padStart(2,"0");C.endsWith(".0")&&O.endsWith(".0")&&(C=C.replace(/\.0$/,""),O=O.replace(/\.0$/,"")),g=`${h}° ${A}' ${C}" ${a}, ${b}° ${_}' ${O}" ${s}`}return g}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="",u="",a=null,s=[],g=!1;if(yr.test(i))throw new Error("invalid coordinate value");if(ki.test(i))if(s=ki.exec(i),g=bt(s),g)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),a="DM";else throw new Error("invalid coordinate format");else if(Oi.test(i))if(s=Oi.exec(i),g=bt(s),g){if(t=s[2],n=s[6],t.includes(",")&&(t=t.replace(",",".")),n.includes(",")&&(n=n.replace(",",".")),a="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],u=s[5]):s[4]&&(r=s[4],u=s[8])}else throw new Error("invalid decimal coordinate format");else if(Pi.test(i))if(s=Pi.exec(i),g=bt(s),g)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,a="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,a="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],u=s[8]):s[7]&&(r=s[7],u=s[14]);else throw new Error("invalid DMS coordinates format");else if(Ri.test(i))if(s=Ri.exec(i),g=bt(s),g)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4]/60,a="DM"),s[6]&&(t+=s[6]/3600,a="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],u=s[9]):s[8]&&(r=s[8],u=s[16]);else throw new Error("invalid DMS coordinates format");else if(Ii.test(i)){if(s=Ii.exec(i),g=bt(s),s.filter(h=>h).length<=5)throw new Error("invalid coordinates format");if(g)t=Math.abs(parseInt(s[2])),s[4]&&(t+=s[4].replace(",",".")/60,a="DM"),s[6]&&(t+=s[6].replace(",",".")/3600,a="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],u=s[9]):s[8]&&(r=s[8],u=s[16]);else throw new Error("invalid coordinates format")}if(g){if(Math.abs(n)>=180)throw new Error("invalid longitude value");if(Math.abs(t)>=90)throw new Error("invalid latitude value");if(r&&!u||!r&&u)throw new Error("invalid coordinates value");if(r&&r==u)throw new Error("invalid coordinates format");t.toString().includes(",")&&(t=t.replace(",",".")),n.toString().includes(",")&&(n=n.replace(",","."));let h=/S|SOUTH/i;h.test(r)&&t>0&&(t=-1*t),h=/W|WEST/i,h.test(u)&&n>0&&(n=-1*n);const b=s[0].trim();let S,M;const k=/[,/;\u0020]/g,N=b.match(k);if(N==null){const A=Math.floor(i.length/2);S=b.substring(0,A).trim(),M=b.substring(A).trim()}else{let A;N.length%2==1?A=Math.floor(N.length/2):A=N.length/2-1;let _=0;if(A==0)_=b.indexOf(N[0]),S=b.substring(0,_).trim(),M=b.substring(_+1).trim();else{let R=0,F=0;for(;R<=A;)_=b.indexOf(N[R],F),F=_+1,R++;S=b.substring(0,_).trim(),M=b.substring(_+1).trim()}}const C=S.split(".");if(C.length==2&&C[1]==0&&C[1].length!=2)throw new Error("invalid coordinates format");const O=M.split(".");if(O.length==2&&O[1]==0&&O[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(S)||/^\d+$/.test(M))throw new Error("degree only coordinate/s provided");return t=Number(Number(t).toFixed(e)),n=Number(Number(n).toFixed(e)),Object.freeze({verbatimCoordinates:b,verbatimLatitude:S,verbatimLongitude:M,decimalLatitude:t,decimalLongitude:n,decimalCoordinates:`${t},${n}`,originalFormat:a,closeEnough:br,toCoordinateFormat:vr})}else throw new Error("coordinates pattern match failed")}function bt(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 u=0;u<r;u++){const a=e[u],s=e[u+r],g=t.test(a)&&t.test(s),h=n.test(a)&&n.test(s),b=a==s;if(!(a==null&&s==null)){if(a==null||s==null)return!1;if(g||h||b)continue;return!1}}return!0}function Gi(i,e){const t=Math.abs(i-e);return Number(t.toFixed(6))<=1e-5}function br(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 Gi(this.decimalLatitude,Number(e[0]))&&Gi(this.decimalLongitude,e[1])}else throw new Error("coords being tested must be separated by a comma")}const wr=Object.freeze({DMS:"DMS",DM:"DM",DD:"DD"});Yt.to=wr;const Er=[{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"}],Lr={decimalLatitude:40.123,decimalLongitude:-74.123},Sr=[{verbatimCoordinates:`50°4'17.698"south, 14°24'2.826"east`,verbatimLatitude:`50°4'17.698"south`,verbatimLongitude:`14°24'2.826"east`,decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"50d4m17.698S 14d24m2.826E",verbatimLatitude:"50d4m17.698S",verbatimLongitude:"14d24m2.826E",decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"40:26:46N,79:56:55W",verbatimLatitude:"40:26:46N",verbatimLongitude:"79:56:55W",decimalLatitude:40.44611111111111,decimalLongitude:-79.9486111111111},{verbatimCoordinates:"40:26:46.302N 79:56:55.903W",verbatimLatitude:"40:26:46.302N",verbatimLongitude:"79:56:55.903W",decimalLatitude:40.446195,decimalLongitude:-79.94886194444445},{verbatimCoordinates:"40°26′47″N 79°58′36″W",verbatimLatitude:"40°26′47″N",verbatimLongitude:"79°58′36″W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40d 26′ 47″ N 79d 58′ 36″ W",verbatimLatitude:"40d 26′ 47″ N",verbatimLongitude:"79d 58′ 36″ W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40.446195N 79.948862W",verbatimLatitude:"40.446195N",verbatimLongitude:"79.948862W",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40,446195° 79,948862°",verbatimLatitude:"40,446195°",verbatimLongitude:"79,948862°",decimalLatitude:40.446195,decimalLongitude:79.948862},{verbatimCoordinates:"40° 26.7717, -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.446195, -79.948862",verbatimLatitude:"40.446195",verbatimLongitude:"-79.948862",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.123256; -74.123256",verbatimLatitude:"40.123256",verbatimLongitude:"-74.123256",decimalLatitude:40.123256,decimalLongitude:-74.123256},{verbatimCoordinates:"18°24S 22°45E",verbatimLatitude:"18°24S",verbatimLongitude:"22°45E",decimalLatitude:-18.4,decimalLongitude:22.75}],_r=[{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 xr(){const i=[];return Er.forEach(e=>{e.decimalLatitude?i.push(e):i.push({...e,...Lr})}),[...i,...Sr,..._r]}const Tr=xr();Yt.formats=Tr.map(i=>i.verbatimCoordinates);const Mr=Yt;function Bi(i,e,t){const n=i.slice();return n[97]=e[t],n[99]=t,n}function zi(i){let e,t;return e=new fr({}),{c(){Qe(e.$$.fragment)},m(n,r){Ue(e,n,r),t=!0},i(n){t||(ue(e.$$.fragment,n),t=!0)},o(n){pe(e.$$.fragment,n),t=!1},d(n){qe(e,n)}}}function Wi(i){let e,t,n,r,u;return t=new hr({}),{c(){e=J("button"),Qe(t.$$.fragment),x(e,"type","button"),x(e,"title",i[10]),x(e,"class","svelte-bz0zu3"),at(e,"active",i[0])},m(a,s){se(a,e,s),Ue(t,e,null),n=!0,r||(u=de(e,"click",i[79]),r=!0)},p(a,s){(!n||s[0]&1024)&&x(e,"title",a[10]),(!n||s[0]&1)&&at(e,"active",a[0])},i(a){n||(ue(t.$$.fragment,a),n=!0)},o(a){pe(t.$$.fragment,a),n=!1},d(a){a&&ie(e),qe(t),r=!1,u()}}}function Nr(i){let e,t=[],n=new Map,r,u,a,s=Ti(i[13]);const g=h=>h[97].id+(h[97].address?","+h[97].address:"");for(let h=0;h<s.length;h+=1){let b=Bi(i,s,h),S=g(b);n.set(S,t[h]=Fi(S,b))}return{c(){e=J("ul");for(let h=0;h<t.length;h+=1)t[h].c();x(e,"class","options svelte-bz0zu3"),x(e,"role","listbox")},m(h,b){se(h,e,b);for(let S=0;S<t.length;S+=1)t[S]&&t[S].m(e,null);r=!0,u||(a=[de(e,"mouseleave",i[27]),de(e,"blur",i[83]),de(e,"keydown",i[23])],u=!0)},p(h,b){b[0]&102823936&&(s=Ti(h[13]),Ot(),t=Zn(t,b,g,1,h,s,n,e,Hn,Fi,null,Bi),Pt())},i(h){if(!r){for(let b=0;b<s.length;b+=1)ue(t[b]);r=!0}},o(h){for(let b=0;b<t.length;b+=1)pe(t[b]);r=!1},d(h){h&&ie(e);for(let b=0;b<t.length;b+=1)t[b].d();u=!1,Fe(a)}}}function Cr(i){let e,t,n,r,u,a;return t=new Ni({}),{c(){e=J("div"),Qe(t.$$.fragment),n=Ee(),r=J("div"),u=Ye(i[8]),x(r,"class","svelte-bz0zu3"),x(e,"class","no-results svelte-bz0zu3")},m(s,g){se(s,e,g),Ue(t,e,null),H(e,n),H(e,r),H(r,u),a=!0},p(s,g){(!a||g[0]&256)&&mt(u,s[8])},i(s){a||(ue(t.$$.fragment,s),a=!0)},o(s){pe(t.$$.fragment,s),a=!1},d(s){s&&ie(e),qe(t)}}}function kr(i){let e="",t;return{c(){t=Ye(e)},m(n,r){se(n,t,r)},p:re,i:re,o:re,d(n){n&&ie(t)}}}function Or(i){let e,t,n,r,u,a,s,g,h,b,S;return t=new Ni({}),g=new Mi({}),{c(){e=J("div"),Qe(t.$$.fragment),n=Ee(),r=J("div"),u=Ye(i[7]),a=Ee(),s=J("button"),Qe(g.$$.fragment),x(r,"class","svelte-bz0zu3"),x(s,"class","svelte-bz0zu3"),x(e,"class","error svelte-bz0zu3")},m(M,k){se(M,e,k),Ue(t,e,null),H(e,n),H(e,r),H(r,u),H(e,a),H(e,s),Ue(g,s,null),h=!0,b||(S=de(s,"click",i[80]),b=!0)},p(M,k){(!h||k[0]&128)&&mt(u,M[7])},i(M){h||(ue(t.$$.fragment,M),ue(g.$$.fragment,M),h=!0)},o(M){pe(t.$$.fragment,M),pe(g.$$.fragment,M),h=!1},d(M){M&&ie(e),qe(t),qe(g),b=!1,S()}}}function Fi(i,e){var s;let t,n,r;function u(){return e[81](e[99])}function a(){return e[82](e[97])}return n=new ur({props:{feature:e[97],showPlaceType:e[11],style:e[15]===e[99]?"selected":((s=e[14])==null?void 0:s.id)===e[97].id?"picked":"default",missingIconsCache:e[21],iconsBaseUrl:e[12]}}),n.$on("mouseenter",u),n.$on("select",a),{key:i,first:null,c(){t=Gn(),Qe(n.$$.fragment),this.first=t},m(g,h){se(g,t,h),Ue(n,g,h),r=!0},p(g,h){var S;e=g;const b={};h[0]&8192&&(b.feature=e[97]),h[0]&2048&&(b.showPlaceType=e[11]),h[0]&57344&&(b.style=e[15]===e[99]?"selected":((S=e[14])==null?void 0:S.id)===e[97].id?"picked":"default"),h[0]&4096&&(b.iconsBaseUrl=e[12]),n.$set(b)},i(g){r||(ue(n.$$.fragment,g),r=!0)},o(g){pe(n.$$.fragment,g),r=!1},d(g){g&&ie(t),qe(n,g)}}}function Pr(i){let e,t,n,r,u,a,s,g,h,b,S,M,k,N,C,O,A,_,R,F,K,D=!1;u=new gr({}),S=new Mi({});let G=i[20]&&zi(),o=i[6]==="button"&&Wi(i);const l=i[70].default,f=Pn(l,i,i[69],null),m=[Or,kr,Cr,Nr],c=[];function v(p,d){var y,w;return p[19]?0:!p[16]&&!p[4]?1:((y=p[13])==null?void 0:y.length)===0?2:(w=p[13])!=null&&w.length&&(p[16]||p[4])?3:-1}return~(O=v(i))&&(A=c[O]=m[O](i)),{c(){e=Ee(),t=J("form"),n=J("div"),r=J("button"),Qe(u.$$.fragment),a=Ee(),s=J("input"),g=Ee(),h=J("div"),b=J("button"),Qe(S.$$.fragment),M=Ee(),G&&G.c(),k=Ee(),o&&o.c(),N=Ee(),f&&f.c(),C=Ee(),A&&A.c(),x(r,"class","search-button svelte-bz0zu3"),x(r,"type","button"),x(s,"placeholder",i[9]),x(s,"aria-label",i[9]),x(s,"class","svelte-bz0zu3"),x(b,"type","button"),x(b,"title",i[3]),x(b,"class","svelte-bz0zu3"),x(h,"class","clear-button-container svelte-bz0zu3"),at(h,"displayable",i[1]!==""),x(n,"class","input-group svelte-bz0zu3"),x(t,"class",_=Ct(i[2])+" svelte-bz0zu3"),at(t,"can-collapse",i[5]&&i[1]==="")},m(p,d){se(p,e,d),se(p,t,d),H(t,n),H(n,r),Ue(u,r,null),H(n,a),H(n,s),i[72](s),Ei(s,i[1]),H(n,g),H(n,h),H(h,b),Ue(S,b,null),H(h,M),G&&G.m(h,null),H(n,k),o&&o.m(n,null),H(n,N),f&&f.m(n,null),H(t,C),~O&&c[O].m(t,null),R=!0,F||(K=[de(r,"click",i[71]),de(s,"input",i[73]),de(s,"focus",i[74]),de(s,"blur",i[75]),de(s,"click",i[76]),de(s,"keydown",i[23]),de(s,"input",i[24]),de(s,"change",i[77]),de(b,"click",i[78]),de(t,"submit",Bn(i[22]))],F=!0)},p(p,d){(!R||d[0]&512)&&x(s,"placeholder",p[9]),(!R||d[0]&512)&&x(s,"aria-label",p[9]),d[0]&2&&s.value!==p[1]&&Ei(s,p[1]),(!R||d[0]&8)&&x(b,"title",p[3]),p[20]?G?d[0]&1048576&&ue(G,1):(G=zi(),G.c(),ue(G,1),G.m(h,null)):G&&(Ot(),pe(G,1,1,()=>{G=null}),Pt()),(!R||d[0]&2)&&at(h,"displayable",p[1]!==""),p[6]==="button"?o?(o.p(p,d),d[0]&64&&ue(o,1)):(o=Wi(p),o.c(),ue(o,1),o.m(n,N)):o&&(Ot(),pe(o,1,1,()=>{o=null}),Pt()),f&&f.p&&(!R||d[2]&128)&&In(f,l,p,p[69],R?Rn(l,p[69],d,null):An(p[69]),null);let y=O;O=v(p),O===y?~O&&c[O].p(p,d):(A&&(Ot(),pe(c[y],1,1,()=>{c[y]=null}),Pt()),~O?(A=c[O],A?A.p(p,d):(A=c[O]=m[O](p),A.c()),ue(A,1),A.m(t,null)):A=null),(!R||d[0]&4&&_!==(_=Ct(p[2])+" svelte-bz0zu3"))&&x(t,"class",_),(!R||d[0]&38)&&at(t,"can-collapse",p[5]&&p[1]==="")},i(p){R||(ue(D),ue(u.$$.fragment,p),ue(S.$$.fragment,p),ue(G),ue(o),ue(f,p),ue(A),R=!0)},o(p){pe(D),pe(u.$$.fragment,p),pe(S.$$.fragment,p),pe(G),pe(o),pe(f,p),pe(A),R=!1},d(p){p&&(ie(e),ie(t)),qe(u),i[72](null),qe(S),G&&G.d(),o&&o.d(),f&&f.d(p),~O&&c[O].d(),F=!1,Fe(K)}}}function Rr(i,e,t){let n,r,u,{$$slots:a={},$$scope:s}=e;const g={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:h=void 0}=e,{apiKey:b}=e,{bbox:S=void 0}=e,{clearButtonTitle:M="clear"}=e,{clearOnBlur:k=!1}=e,{clearListOnPick:N=!1}=e,{keepListOpen:C=!1}=e,{collapsed:O=!1}=e,{country:A=void 0}=e,{debounceSearch:_=200}=e,{enableReverse:R="never"}=e,{errorMessage:F="Something went wrong…"}=e,{filter:K=()=>!0}=e,{flyTo:D=!0}=e,{fuzzyMatch:G=!0}=e,{language:o=void 0}=e,{limit:l=void 0}=e;const f=41415112612;let{reverseGeocodingLimit:m=f}=e,{mapController:c=void 0}=e,{minLength:v=2}=e,{noResultsMessage:p="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:d="Search"}=e,{proximity:y=[{type:"server-geolocation"}]}=e,{reverseActive:w=R==="always"}=e,{reverseButtonTitle:E="toggle reverse geocoding"}=e,{searchValue:T=""}=e,{pickedResultStyle:I="full-geometry"}=e,{showPlaceType:B="if-needed"}=e,{showResultsWhileTyping:j=!0}=e,{selectFirst:Y=!0}=e,{flyToSelected:ne=!1}=e,{markerOnSelected:V=!0}=e,{types:Z=void 0}=e;const ge=[];let{reverseGeocodingTypes:He=ge}=e,{exhaustiveReverseGeocoding:ot=!1}=e,{excludeTypes:lt=!1}=e;const Se=void 0;let{reverseGeocodingExcludeTypes:Ge=Se}=e,{zoom:ye=g}=e,{apiUrl:me="https://api.maptiler.com/geocoding"}=e,{fetchParameters:ee={}}=e,{iconsBaseUrl:mn="https://cdn.maptiler.com/maptiler-geocoding-control/v2.1.1/icons/"}=e,{adjustUrlQuery:ri=()=>{}}=e,{adjustUrl:si=()=>{}}=e;function fs(L){Re.focus(L)}function cs(){Re.blur()}function pn(L,le=!0,ae=!1){t(1,T=L),le?(t(15,Q=-1),vn()):(bn(void 0,!ae,ae),setTimeout(()=>{Re.focus(),Re.select()}))}function hs(){t(13,q=void 0),t(14,z=void 0),t(15,Q=-1)}function ds(){t(64,ce=[]),t(14,z=void 0)}let q,ce,z,yn="",Re,Q=-1,Be,Ut=[],ut,dt,gt,oi,Ze=!1;const gs=new Set,Je=Si();Fn(()=>{c&&(c.setEventHandler(void 0),c.indicateReverse(!1),c.setSelectedMarker(-1),c.setFeatures(void 0,void 0,!1))});function vn(L){if(t(17,Ze=!1),dt&&(clearTimeout(dt),dt=void 0),Q>-1&&q)t(14,z=q[Q]),t(1,T=z.place_type[0]==="reverse"?z.place_name:z.place_name.replace(/,.*/,"")),t(19,Be=void 0),t(64,ce=void 0),t(15,Q=-1);else if(T){const le=L||!li(T);ui(T,{exact:!0}).then(()=>{t(64,ce=q),t(14,z=void 0),le&&ms()}).catch(ae=>t(19,Be=ae))}}function li(L){try{return Mr(L,6)}catch{return!1}}async function ui(L,{byId:le=!1,exact:ae=!1}={}){var xe,ze,$e;t(19,Be=void 0),ut==null||ut.abort();const _e=new AbortController;t(20,ut=_e);try{const X=li(L),_t=new URL(me+"/"+encodeURIComponent(X?X.decimalLongitude+","+X.decimalLatitude:L)+".json"),Oe=_t.searchParams;o!==void 0&&Oe.set("language",Array.isArray(o)?o.join(","):o??"");const[ci]=(c==null?void 0:c.getCenterAndZoom())??[];let We=(xe=!X||He===ge?Z:He)==null?void 0:xe.map(be=>typeof be=="string"?be:ci===void 0||(be[0]??0)<=ci&&ci<(be[1]??1/0)?be[2]:void 0).filter(be=>be!==void 0);We&&(We=[...new Set(We)],Oe.set("types",We.join(",")));const En=!X||Ge===Se?lt:Ge;if(En&&Oe.set("excludeTypes",String(En)),S&&Oe.set("bbox",S.map(be=>be.toFixed(6)).join(",")),A&&Oe.set("country",Array.isArray(A)?A.join(","):A),!le&&!X){const be=await pr(c,y,_e);be&&Oe.set("proximity",be),(ae||!j)&&Oe.set("autocomplete","false"),Oe.set("fuzzyMatch",String(G))}const xt=m===f?l:m;xt!==void 0&&xt>1&&(We==null?void 0:We.length)!==1&&console.warn("For reverse geocoding when limit > 1 then types must contain single value."),X?(xt===1||xt!==void 0&&(ot||(We==null?void 0:We.length)===1))&&Oe.set("limit",String(xt)):l!==void 0&&Oe.set("limit",String(l)),Oe.set("key",b),ri(Oe),si(_t);const Ps=_t.searchParams.get("types")===""&&_t.searchParams.get("excludeTypes")!=="true",qt=_t.toString();if(qt===yn){le?(N&&t(13,q=void 0),t(14,z=Ut[0])):(t(13,q=Ut),((ze=q[Q])==null?void 0:ze.id)!==(r==null?void 0:r.id)&&t(15,Q=-1));return}yn=qt;let Tt;if(Ps)Tt={type:"FeatureCollection",features:[]};else{const be=await fetch(qt,{signal:_e.signal,...ee});if(!be.ok)throw new Error(await be.text());Tt=await be.json()}Je("response",{url:qt,featureCollection:Tt}),le?(N&&t(13,q=void 0),t(14,z=Tt.features[0]),Ut=[z]):(t(13,q=Tt.features.filter(K)),X&&q.unshift({type:"Feature",properties:{},id:"reverse_"+X.decimalLongitude+"_"+X.decimalLatitude,text:X.decimalLatitude+", "+X.decimalLongitude,place_name:X.decimalLatitude+", "+X.decimalLongitude,place_type:["reverse"],center:[X.decimalLongitude,X.decimalLatitude],bbox:[X.decimalLongitude,X.decimalLatitude,X.decimalLongitude,X.decimalLatitude],geometry:{type:"Point",coordinates:[X.decimalLongitude,X.decimalLatitude]}}),Ut=q,(($e=q[Q])==null?void 0:$e.id)!==(r==null?void 0:r.id)&&t(15,Q=-1),X&&Re.focus())}catch(X){if(X&&typeof X=="object"&&"name"in X&&X.name==="AbortError")return;throw X}finally{_e===ut&&t(20,ut=void 0)}}function ms(){var _e;if(!(ce!=null&&ce.length)||!D)return;const L=[180,90,-180,-90],le=!ce.some(xe=>!xe.matching_text);let ae;for(const xe of ce){const ze=St(xe);if(ae=ae===void 0?ze:ze===void 0?ae:Math.max(ae,ze),le||!xe.matching_text)for(const $e of[0,1,2,3])L[$e]=Math[$e<2?"min":"max"](L[$e],((_e=xe.bbox)==null?void 0:_e[$e])??xe.center[$e%2])}c&&ce.length>0&&(z&&L[0]===L[2]&&L[1]===L[3]?c.flyTo(z.center,St(z)):c.fitBounds(Rt(L),50,ae))}function ai(){!z||!c||(!z.bbox||z.bbox[0]===z.bbox[2]&&z.bbox[1]===z.bbox[3]?c.flyTo(z.center,St(z)):c.fitBounds(Rt(z.bbox),50,St(z)))}function St(L){var ae;if(!L.bbox||L.bbox[0]!==L.bbox[2]&&L.bbox[1]!==L.bbox[3])return;const le=L.id.replace(/\..*/,"");return(Array.isArray((ae=L.properties)==null?void 0:ae.categories)?L.properties.categories.reduce((_e,xe)=>{const ze=ye[le+"."+xe];return _e===void 0?ze:ze===void 0?_e:Math.max(_e,ze)},void 0):void 0)??ye[le]}function ps(L){t(0,w=R==="always"),t(13,q=void 0),t(14,z=void 0),t(15,Q=-1),pn(L[1].toFixed(6)+", "+mr(L[0],[-180,180],!0).toFixed(6),!1,!0)}function ys(L){if(!q)return;let le=L.key==="ArrowDown"?1:L.key==="ArrowUp"?-1:0;le&&(Re.focus(),t(17,Ze=!0),L.preventDefault(),z&&Q===-1&&t(15,Q=q.findIndex(ae=>ae.id===(z==null?void 0:z.id))),Q===(z||Y?0:-1)&&le===-1&&t(15,Q=q.length),t(15,Q+=le),Q>=q.length&&t(15,Q=-1),Q<0&&(z||Y)&&t(15,Q=0))}function bn(L,le=!0,ae=!1){if(t(19,Be=void 0),t(14,z=void 0),t(17,Ze=!0),j||ae){if(dt&&clearTimeout(dt),T.length<v)return;const _e=T;dt=window.setTimeout(()=>{ui(_e).catch(xe=>t(19,Be=xe))},le?_:0)}else t(13,q=void 0),t(19,Be=void 0)}function fi(L){z&&(z==null?void 0:z.id)===(L==null?void 0:L.id)?ai():(t(14,z=L),t(1,T=L.place_name))}function wn(L){t(15,Q=L)}function vs(){(!Y||z)&&t(15,Q=-1),ne&&ai()}const bs=()=>Re.focus();function ws(L){jt[L?"unshift":"push"](()=>{Re=L,t(18,Re)})}function Es(){T=this.value,t(1,T),t(17,Ze),t(31,k),t(16,gt)}const Ls=()=>t(17,Ze=!0),Ss=()=>t(17,Ze=!1),_s=()=>t(17,Ze=!0),xs=()=>t(14,z=void 0),Ts=()=>{t(1,T=""),Re.focus()},Ms=()=>t(0,w=!w),Ns=()=>t(19,Be=void 0),Cs=L=>wn(L),ks=L=>fi(L),Os=()=>{};return i.$$set=L=>{"class"in L&&t(2,h=L.class),"apiKey"in L&&t(29,b=L.apiKey),"bbox"in L&&t(30,S=L.bbox),"clearButtonTitle"in L&&t(3,M=L.clearButtonTitle),"clearOnBlur"in L&&t(31,k=L.clearOnBlur),"clearListOnPick"in L&&t(32,N=L.clearListOnPick),"keepListOpen"in L&&t(4,C=L.keepListOpen),"collapsed"in L&&t(5,O=L.collapsed),"country"in L&&t(33,A=L.country),"debounceSearch"in L&&t(34,_=L.debounceSearch),"enableReverse"in L&&t(6,R=L.enableReverse),"errorMessage"in L&&t(7,F=L.errorMessage),"filter"in L&&t(35,K=L.filter),"flyTo"in L&&t(36,D=L.flyTo),"fuzzyMatch"in L&&t(37,G=L.fuzzyMatch),"language"in L&&t(38,o=L.language),"limit"in L&&t(39,l=L.limit),"reverseGeocodingLimit"in L&&t(40,m=L.reverseGeocodingLimit),"mapController"in L&&t(41,c=L.mapController),"minLength"in L&&t(42,v=L.minLength),"noResultsMessage"in L&&t(8,p=L.noResultsMessage),"placeholder"in L&&t(9,d=L.placeholder),"proximity"in L&&t(43,y=L.proximity),"reverseActive"in L&&t(0,w=L.reverseActive),"reverseButtonTitle"in L&&t(10,E=L.reverseButtonTitle),"searchValue"in L&&t(1,T=L.searchValue),"pickedResultStyle"in L&&t(44,I=L.pickedResultStyle),"showPlaceType"in L&&t(11,B=L.showPlaceType),"showResultsWhileTyping"in L&&t(45,j=L.showResultsWhileTyping),"selectFirst"in L&&t(46,Y=L.selectFirst),"flyToSelected"in L&&t(47,ne=L.flyToSelected),"markerOnSelected"in L&&t(48,V=L.markerOnSelected),"types"in L&&t(49,Z=L.types),"reverseGeocodingTypes"in L&&t(50,He=L.reverseGeocodingTypes),"exhaustiveReverseGeocoding"in L&&t(51,ot=L.exhaustiveReverseGeocoding),"excludeTypes"in L&&t(52,lt=L.excludeTypes),"reverseGeocodingExcludeTypes"in L&&t(53,Ge=L.reverseGeocodingExcludeTypes),"zoom"in L&&t(54,ye=L.zoom),"apiUrl"in L&&t(55,me=L.apiUrl),"fetchParameters"in L&&t(56,ee=L.fetchParameters),"iconsBaseUrl"in L&&t(12,mn=L.iconsBaseUrl),"adjustUrlQuery"in L&&t(57,ri=L.adjustUrlQuery),"adjustUrl"in L&&t(58,si=L.adjustUrl),"$$scope"in L&&t(69,s=L.$$scope)},i.$$.update=()=>{if(i.$$.dirty[0]&64&&t(0,w=R==="always"),i.$$.dirty[0]&16384|i.$$.dirty[1]&8192&&I!=="marker-only"&&z&&!z.address&&z.geometry.type==="Point"&&z.place_type[0]!=="reverse"&&ui(z.id,{byId:!0}).catch(L=>t(19,Be=L)),i.$$.dirty[0]&16384|i.$$.dirty[1]&1058|i.$$.dirty[2]&8&&(c&&z&&z.id!==oi&&D&&(ai(),N&&t(13,q=void 0),t(64,ce=void 0),t(15,Q=-1)),t(65,oi=z==null?void 0:z.id)),i.$$.dirty[0]&196608|i.$$.dirty[1]&1&&setTimeout(()=>{t(16,gt=Ze),k&&!gt&&t(1,T="")}),i.$$.dirty[0]&8194|i.$$.dirty[1]&2048&&T.length<v&&(t(13,q=void 0),t(19,Be=void 0),t(64,ce=q)),i.$$.dirty[0]&57344|i.$$.dirty[1]&32768&&Y&&q!=null&&q.length&&Q==-1&&!z&&t(15,Q=0),i.$$.dirty[0]&8192|i.$$.dirty[2]&4&&ce!==q&&t(64,ce=void 0),i.$$.dirty[0]&73729|i.$$.dirty[1]&1024|i.$$.dirty[2]&4&&c&&c.setEventHandler(L=>{switch(L.type){case"mapClick":w&&ps(L.coordinates);break;case"markerClick":{const le=q==null?void 0:q.find(ae=>ae.id===L.id);le&&fi(le)}break;case"markerMouseEnter":ce&&t(15,Q=gt?(q==null?void 0:q.findIndex(le=>le.id===L.id))??-1:-1);break;case"markerMouseLeave":ce&&t(15,Q=-1);break}}),i.$$.dirty[0]&40960&&t(66,r=q==null?void 0:q[Q]),i.$$.dirty[1]&66592|i.$$.dirty[2]&16&&c&&r&&D&&ne&&c.flyTo(r.center,St(r)),i.$$.dirty[1]&8192&&t(68,n=I==="full-geometry-including-polygon-center-marker"),i.$$.dirty[1]&132096|i.$$.dirty[2]&64&&(V||c==null||c.setFeatures(void 0,void 0,n)),i.$$.dirty[0]&16384|i.$$.dirty[1]&132096|i.$$.dirty[2]&84&&c&&V&&!ce&&(c.setFeatures(r?[r]:void 0,z,n),c.setSelectedMarker(r?0:-1)),i.$$.dirty[0]&16384|i.$$.dirty[1]&1024|i.$$.dirty[2]&68&&c&&c.setFeatures(ce,z,n),i.$$.dirty[0]&32768|i.$$.dirty[1]&1024|i.$$.dirty[2]&4&&ce&&c&&c.setSelectedMarker(Q),i.$$.dirty[0]&2|i.$$.dirty[1]&1024&&c){const L=li(T);c.setReverseMarker(L?[L.decimalLongitude,L.decimalLatitude]:void 0)}i.$$.dirty[2]&16&&Je("select",{feature:r}),i.$$.dirty[0]&16384&&Je("pick",{feature:z}),i.$$.dirty[0]&73744&&t(67,u=!!(q!=null&&q.length)&&(gt||C)),i.$$.dirty[2]&32&&Je("optionsvisibilitychange",{optionsVisible:u}),i.$$.dirty[0]&8192&&Je("featureslisted",{features:q}),i.$$.dirty[2]&4&&Je("featuresmarked",{features:ce}),i.$$.dirty[0]&1&&Je("reversetoggle",{reverse:w}),i.$$.dirty[0]&2&&Je("querychange",{query:T}),i.$$.dirty[0]&1|i.$$.dirty[1]&1024&&c&&c.indicateReverse(w)},[w,T,h,M,C,O,R,F,p,d,E,B,mn,q,z,Q,gt,Ze,Re,Be,ut,gs,vn,ys,bn,fi,wn,vs,g,b,S,k,N,A,_,K,D,G,o,l,m,c,v,y,I,j,Y,ne,V,Z,He,ot,lt,Ge,ye,me,ee,ri,si,fs,cs,pn,hs,ds,ce,oi,r,u,n,s,a,bs,ws,Es,Ls,Ss,_s,xs,Ts,Ms,Ns,Cs,ks,Os]}let Ir=class extends nt{constructor(e){super(),it(this,e,Rr,Pr,et,{ZOOM_DEFAULTS:28,class:2,apiKey:29,bbox:30,clearButtonTitle:3,clearOnBlur:31,clearListOnPick:32,keepListOpen:4,collapsed:5,country:33,debounceSearch:34,enableReverse:6,errorMessage:7,filter:35,flyTo:36,fuzzyMatch:37,language:38,limit:39,reverseGeocodingLimit:40,mapController:41,minLength:42,noResultsMessage:8,placeholder:9,proximity:43,reverseActive:0,reverseButtonTitle:10,searchValue:1,pickedResultStyle:44,showPlaceType:11,showResultsWhileTyping:45,selectFirst:46,flyToSelected:47,markerOnSelected:48,types:49,reverseGeocodingTypes:50,exhaustiveReverseGeocoding:51,excludeTypes:52,reverseGeocodingExcludeTypes:53,zoom:54,apiUrl:55,fetchParameters:56,iconsBaseUrl:12,adjustUrlQuery:57,adjustUrl:58,focus:59,blur:60,setQuery:61,clearList:62,clearMap:63},null,[-1,-1,-1,-1])}get ZOOM_DEFAULTS(){return this.$$.ctx[28]}get focus(){return this.$$.ctx[59]}get blur(){return this.$$.ctx[60]}get setQuery(){return this.$$.ctx[61]}get clearList(){return this.$$.ctx[62]}get clearMap(){return this.$$.ctx[63]}};function It(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 Qt(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 u=0;u<r[r.length-1].length;u++)if(r[r.length-1][u]!==r[0][u])throw new Error("First and last Position are not equivalent.")}return It({type:"Polygon",coordinates:i},e,t)}function Xt(i,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=i,t}function Di(i,e,t={}){return It({type:"MultiPolygon",coordinates:i},e,t)}function Ui(i,e,t){if(i!==null)for(var n,r,u,a,s,g,h,b=0,S=0,M,k=i.type,N=k==="FeatureCollection",C=k==="Feature",O=N?i.features.length:1,A=0;A<O;A++){h=N?i.features[A].geometry:C?i.geometry:i,M=h?h.type==="GeometryCollection":!1,s=M?h.geometries.length:1;for(var _=0;_<s;_++){var R=0,F=0;if(a=M?h.geometries[_]:h,a!==null){g=a.coordinates;var K=a.type;switch(b=0,K){case null:break;case"Point":if(e(g,S,A,R,F)===!1)return!1;S++,R++;break;case"LineString":case"MultiPoint":for(n=0;n<g.length;n++){if(e(g[n],S,A,R,F)===!1)return!1;S++,K==="MultiPoint"&&R++}K==="LineString"&&R++;break;case"Polygon":case"MultiLineString":for(n=0;n<g.length;n++){for(r=0;r<g[n].length-b;r++){if(e(g[n][r],S,A,R,F)===!1)return!1;S++}K==="MultiLineString"&&R++,K==="Polygon"&&F++}K==="Polygon"&&R++;break;case"MultiPolygon":for(n=0;n<g.length;n++){for(F=0,r=0;r<g[n].length;r++){for(u=0;u<g[n][r].length-b;u++){if(e(g[n][r][u],S,A,R,F)===!1)return!1;S++}F++}R++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(Ui(a.geometries[n],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Jt(i,e){var t,n,r,u,a,s,g,h,b,S,M=0,k=i.type==="FeatureCollection",N=i.type==="Feature",C=k?i.features.length:1;for(t=0;t<C;t++){for(s=k?i.features[t].geometry:N?i.geometry:i,h=k?i.features[t].properties:N?i.properties:{},b=k?i.features[t].bbox:N?i.bbox:void 0,S=k?i.features[t].id:N?i.id:void 0,g=s?s.type==="GeometryCollection":!1,a=g?s.geometries.length:1,r=0;r<a;r++){if(u=g?s.geometries[r]:s,u===null){if(e(null,M,h,b,S)===!1)return!1;continue}switch(u.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(u,M,h,b,S)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<u.geometries.length;n++)if(e(u.geometries[n],M,h,b,S)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}M++}}function Ar(i,e){Jt(i,function(t,n,r,u,a){var s=t===null?null:t.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return e(It(t,r,{bbox:u,id:a}),n,0)===!1?!1:void 0}var g;switch(s){case"MultiPoint":g="Point";break;case"MultiLineString":g="LineString";break;case"MultiPolygon":g="Polygon";break}for(var h=0;h<t.coordinates.length;h++){var b=t.coordinates[h],S={type:g,coordinates:b};if(e(It(S,r),n,h)===!1)return!1}})}function Gr(i,e={}){if(i.bbox!=null&&e.recompute!==!0)return i.bbox;const t=[1/0,1/0,-1/0,-1/0];return Ui(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 qi=Gr,Br=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,$t=Math.ceil,Ne=Math.floor,we="[BigNumber Error] ",Vi=we+"Number primitive has more than 15 significant digits: ",Pe=1e14,U=14,ji=9007199254740991,ei=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Xe=1e7,Le=1e9;function Hi(i){var e,t,n,r=_.prototype={constructor:_,toString:null,valueOf:null},u=new _(1),a=20,s=4,g=-7,h=21,b=-1e7,S=1e7,M=!1,k=1,N=0,C={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},O="0123456789abcdefghijklmnopqrstuvwxyz",A=!0;function _(o,l){var f,m,c,v,p,d,y,w,E=this;if(!(E instanceof _))return new _(o,l);if(l==null){if(o&&o._isBigNumber===!0){E.s=o.s,!o.c||o.e>S?E.c=E.e=null:o.e<b?E.c=[E.e=0]:(E.e=o.e,E.c=o.c.slice());return}if((d=typeof o=="number")&&o*0==0){if(E.s=1/o<0?(o=-o,-1):1,o===~~o){for(v=0,p=o;p>=10;p/=10,v++);v>S?E.c=E.e=null:(E.e=v,E.c=[o]);return}w=String(o)}else{if(!Br.test(w=String(o)))return n(E,w,d);E.s=w.charCodeAt(0)==45?(w=w.slice(1),-1):1}(v=w.indexOf("."))>-1&&(w=w.replace(".","")),(p=w.search(/e/i))>0?(v<0&&(v=p),v+=+w.slice(p+1),w=w.substring(0,p)):v<0&&(v=w.length)}else{if(oe(l,2,O.length,"Base"),l==10&&A)return E=new _(o),D(E,a+E.e+1,s);if(w=String(o),d=typeof o=="number"){if(o*0!=0)return n(E,w,d,l);if(E.s=1/o<0?(w=w.slice(1),-1):1,_.DEBUG&&w.replace(/^0\.0*|\./,"").length>15)throw Error(Vi+o)}else E.s=w.charCodeAt(0)===45?(w=w.slice(1),-1):1;for(f=O.slice(0,l),v=p=0,y=w.length;p<y;p++)if(f.indexOf(m=w.charAt(p))<0){if(m=="."){if(p>v){v=y;continue}}else if(!c&&(w==w.toUpperCase()&&(w=w.toLowerCase())||w==w.toLowerCase()&&(w=w.toUpperCase()))){c=!0,p=-1,v=0;continue}return n(E,String(o),d,l)}d=!1,w=t(w,l,10,E.s),(v=w.indexOf("."))>-1?w=w.replace(".",""):v=w.length}for(p=0;w.charCodeAt(p)===48;p++);for(y=w.length;w.charCodeAt(--y)===48;);if(w=w.slice(p,++y)){if(y-=p,d&&_.DEBUG&&y>15&&(o>ji||o!==Ne(o)))throw Error(Vi+E.s*o);if((v=v-p-1)>S)E.c=E.e=null;else if(v<b)E.c=[E.e=0];else{if(E.e=v,E.c=[],p=(v+1)%U,v<0&&(p+=U),p<y){for(p&&E.c.push(+w.slice(0,p)),y-=U;p<y;)E.c.push(+w.slice(p,p+=U));p=U-(w=w.slice(p)).length}else p-=y;for(;p--;w+="0");E.c.push(+w)}}else E.c=[E.e=0]}_.clone=Hi,_.ROUND_UP=0,_.ROUND_DOWN=1,_.ROUND_CEIL=2,_.ROUND_FLOOR=3,_.ROUND_HALF_UP=4,_.ROUND_HALF_DOWN=5,_.ROUND_HALF_EVEN=6,_.ROUND_HALF_CEIL=7,_.ROUND_HALF_FLOOR=8,_.EUCLID=9,_.config=_.set=function(o){var l,f;if(o!=null)if(typeof o=="object"){if(o.hasOwnProperty(l="DECIMAL_PLACES")&&(f=o[l],oe(f,0,Le,l),a=f),o.hasOwnProperty(l="ROUNDING_MODE")&&(f=o[l],oe(f,0,8,l),s=f),o.hasOwnProperty(l="EXPONENTIAL_AT")&&(f=o[l],f&&f.pop?(oe(f[0],-1e9,0,l),oe(f[1],0,Le,l),g=f[0],h=f[1]):(oe(f,-1e9,Le,l),g=-(h=f<0?-f:f))),o.hasOwnProperty(l="RANGE"))if(f=o[l],f&&f.pop)oe(f[0],-1e9,-1,l),oe(f[1],1,Le,l),b=f[0],S=f[1];else if(oe(f,-1e9,Le,l),f)b=-(S=f<0?-f:f);else throw Error(we+l+" cannot be zero: "+f);if(o.hasOwnProperty(l="CRYPTO"))if(f=o[l],f===!!f)if(f)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))M=f;else throw M=!f,Error(we+"crypto unavailable");else M=f;else throw Error(we+l+" not true or false: "+f);if(o.hasOwnProperty(l="MODULO_MODE")&&(f=o[l],oe(f,0,9,l),k=f),o.hasOwnProperty(l="POW_PRECISION")&&(f=o[l],oe(f,0,Le,l),N=f),o.hasOwnProperty(l="FORMAT"))if(f=o[l],typeof f=="object")C=f;else throw Error(we+l+" not an object: "+f);if(o.hasOwnProperty(l="ALPHABET"))if(f=o[l],typeof f=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(f))A=f.slice(0,10)=="0123456789",O=f;else throw Error(we+l+" invalid: "+f)}else throw Error(we+"Object expected: "+o);return{DECIMAL_PLACES:a,ROUNDING_MODE:s,EXPONENTIAL_AT:[g,h],RANGE:[b,S],CRYPTO:M,MODULO_MODE:k,POW_PRECISION:N,FORMAT:C,ALPHABET:O}},_.isBigNumber=function(o){if(!o||o._isBigNumber!==!0)return!1;if(!_.DEBUG)return!0;var l,f,m=o.c,c=o.e,v=o.s;e:if({}.toString.call(m)=="[object Array]"){if((v===1||v===-1)&&c>=-1e9&&c<=Le&&c===Ne(c)){if(m[0]===0){if(c===0&&m.length===1)return!0;break e}if(l=(c+1)%U,l<1&&(l+=U),String(m[0]).length==l){for(l=0;l<m.length;l++)if(f=m[l],f<0||f>=Pe||f!==Ne(f))break e;if(f!==0)return!0}}}else if(m===null&&c===null&&(v===null||v===1||v===-1))return!0;throw Error(we+"Invalid BigNumber: "+o)},_.maximum=_.max=function(){return F(arguments,-1)},_.minimum=_.min=function(){return F(arguments,1)},_.random=function(){var o=9007199254740992,l=Math.random()*o&2097151?function(){return Ne(Math.random()*o)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(f){var m,c,v,p,d,y=0,w=[],E=new _(u);if(f==null?f=a:oe(f,0,Le),p=$t(f/U),M)if(crypto.getRandomValues){for(m=crypto.getRandomValues(new Uint32Array(p*=2));y<p;)d=m[y]*131072+(m[y+1]>>>11),d>=9e15?(c=crypto.getRandomValues(new Uint32Array(2)),m[y]=c[0],m[y+1]=c[1]):(w.push(d%1e14),y+=2);y=p/2}else if(crypto.randomBytes){for(m=crypto.randomBytes(p*=7);y<p;)d=(m[y]&31)*281474976710656+m[y+1]*1099511627776+m[y+2]*4294967296+m[y+3]*16777216+(m[y+4]<<16)+(m[y+5]<<8)+m[y+6],d>=9e15?crypto.randomBytes(7).copy(m,y):(w.push(d%1e14),y+=7);y=p/7}else throw M=!1,Error(we+"crypto unavailable");if(!M)for(;y<p;)d=l(),d<9e15&&(w[y++]=d%1e14);for(p=w[--y],f%=U,p&&f&&(d=ei[U-f],w[y]=Ne(p/d)*d);w[y]===0;w.pop(),y--);if(y<0)w=[v=0];else{for(v=-1;w[0]===0;w.splice(0,1),v-=U);for(y=1,d=w[0];d>=10;d/=10,y++);y<U&&(v-=U-y)}return E.e=v,E.c=w,E}}(),_.sum=function(){for(var o=1,l=arguments,f=new _(l[0]);o<l.length;)f=f.plus(l[o++]);return f},t=function(){var o="0123456789";function l(f,m,c,v){for(var p,d=[0],y,w=0,E=f.length;w<E;){for(y=d.length;y--;d[y]*=m);for(d[0]+=v.indexOf(f.charAt(w++)),p=0;p<d.length;p++)d[p]>c-1&&(d[p+1]==null&&(d[p+1]=0),d[p+1]+=d[p]/c|0,d[p]%=c)}return d.reverse()}return function(f,m,c,v,p){var d,y,w,E,T,I,B,j,Y=f.indexOf("."),ne=a,V=s;for(Y>=0&&(E=N,N=0,f=f.replace(".",""),j=new _(m),I=j.pow(f.length-Y),N=E,j.c=l(Ve(ke(I.c),I.e,"0"),10,c,o),j.e=j.c.length),B=l(f,m,c,p?(d=O,o):(d=o,O)),w=E=B.length;B[--E]==0;B.pop());if(!B[0])return d.charAt(0);if(Y<0?--w:(I.c=B,I.e=w,I.s=v,I=e(I,j,ne,V,c),B=I.c,T=I.r,w=I.e),y=w+ne+1,Y=B[y],E=c/2,T=T||y<0||B[y+1]!=null,T=V<4?(Y!=null||T)&&(V==0||V==(I.s<0?3:2)):Y>E||Y==E&&(V==4||T||V==6&&B[y-1]&1||V==(I.s<0?8:7)),y<1||!B[0])f=T?Ve(d.charAt(1),-ne,d.charAt(0)):d.charAt(0);else{if(B.length=y,T)for(--c;++B[--y]>c;)B[y]=0,y||(++w,B=[1].concat(B));for(E=B.length;!B[--E];);for(Y=0,f="";Y<=E;f+=d.charAt(B[Y++]));f=Ve(f,w,d.charAt(0))}return f}}(),e=function(){function o(m,c,v){var p,d,y,w,E=0,T=m.length,I=c%Xe,B=c/Xe|0;for(m=m.slice();T--;)y=m[T]%Xe,w=m[T]/Xe|0,p=B*y+w*I,d=I*y+p%Xe*Xe+E,E=(d/v|0)+(p/Xe|0)+B*w,m[T]=d%v;return E&&(m=[E].concat(m)),m}function l(m,c,v,p){var d,y;if(v!=p)y=v>p?1:-1;else for(d=y=0;d<v;d++)if(m[d]!=c[d]){y=m[d]>c[d]?1:-1;break}return y}function f(m,c,v,p){for(var d=0;v--;)m[v]-=d,d=m[v]<c[v]?1:0,m[v]=d*p+m[v]-c[v];for(;!m[0]&&m.length>1;m.splice(0,1));}return function(m,c,v,p,d){var y,w,E,T,I,B,j,Y,ne,V,Z,ge,He,ot,lt,Se,Ge,ye=m.s==c.s?1:-1,me=m.c,ee=c.c;if(!me||!me[0]||!ee||!ee[0])return new _(!m.s||!c.s||(me?ee&&me[0]==ee[0]:!ee)?NaN:me&&me[0]==0||!ee?ye*0:ye/0);for(Y=new _(ye),ne=Y.c=[],w=m.e-c.e,ye=v+w+1,d||(d=Pe,w=Ce(m.e/U)-Ce(c.e/U),ye=ye/U|0),E=0;ee[E]==(me[E]||0);E++);if(ee[E]>(me[E]||0)&&w--,ye<0)ne.push(1),T=!0;else{for(ot=me.length,Se=ee.length,E=0,ye+=2,I=Ne(d/(ee[0]+1)),I>1&&(ee=o(ee,I,d),me=o(me,I,d),Se=ee.length,ot=me.length),He=Se,V=me.slice(0,Se),Z=V.length;Z<Se;V[Z++]=0);Ge=ee.slice(),Ge=[0].concat(Ge),lt=ee[0],ee[1]>=d/2&<++;do{if(I=0,y=l(ee,V,Se,Z),y<0){if(ge=V[0],Se!=Z&&(ge=ge*d+(V[1]||0)),I=Ne(ge/lt),I>1)for(I>=d&&(I=d-1),B=o(ee,I,d),j=B.length,Z=V.length;l(B,V,j,Z)==1;)I--,f(B,Se<j?Ge:ee,j,d),j=B.length,y=1;else I==0&&(y=I=1),B=ee.slice(),j=B.length;if(j<Z&&(B=[0].concat(B)),f(V,B,Z,d),Z=V.length,y==-1)for(;l(ee,V,Se,Z)<1;)I++,f(V,Se<Z?Ge:ee,Z,d),Z=V.length}else y===0&&(I++,V=[0]);ne[E++]=I,V[0]?V[Z++]=me[He]||0:(V=[me[He]],Z=1)}while((He++<ot||V[0]!=null)&&ye--);T=V[0]!=null,ne[0]||ne.splice(0,1)}if(d==Pe){for(E=1,ye=ne[0];ye>=10;ye/=10,E++);D(Y,v+(Y.e=E+w*U-1)+1,p,T)}else Y.e=w,Y.r=+T;return Y}}();function R(o,l,f,m){var c,v,p,d,y;if(f==null?f=s:oe(f,0,8),!o.c)return o.toString();if(c=o.c[0],p=o.e,l==null)y=ke(o.c),y=m==1||m==2&&(p<=g||p>=h)?Gt(y,p):Ve(y,p,"0");else if(o=D(new _(o),l,f),v=o.e,y=ke(o.c),d=y.length,m==1||m==2&&(l<=v||v<=g)){for(;d<l;y+="0",d++);y=Gt(y,v)}else if(l-=p,y=Ve(y,v,"0"),v+1>d){if(--l>0)for(y+=".";l--;y+="0");}else if(l+=v-d,l>0)for(v+1==d&&(y+=".");l--;y+="0");return o.s<0&&c?"-"+y:y}function F(o,l){for(var f,m,c=1,v=new _(o[0]);c<o.length;c++)m=new _(o[c]),(!m.s||(f=rt(v,m))===l||f===0&&v.s===l)&&(v=m);return v}function K(o,l,f){for(var m=1,c=l.length;!l[--c];l.pop());for(c=l[0];c>=10;c/=10,m++);return(f=m+f*U-1)>S?o.c=o.e=null:f<b?o.c=[o.e=0]:(o.e=f,o.c=l),o}n=function(){var o=/^(-?)0([xbo])(?=\w[\w.]*$)/i,l=/^([^.]+)\.$/,f=/^\.([^.]+)$/,m=/^-?(Infinity|NaN)$/,c=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(v,p,d,y){var w,E=d?p:p.replace(c,"");if(m.test(E))v.s=isNaN(E)?null:E<0?-1:1;else{if(!d&&(E=E.replace(o,function(T,I,B){return w=(B=B.toLowerCase())=="x"?16:B=="b"?2:8,!y||y==w?I:T}),y&&(w=y,E=E.replace(l,"$1").replace(f,"0.$1")),p!=E))return new _(E,w);if(_.DEBUG)throw Error(we+"Not a"+(y?" base "+y:"")+" number: "+p);v.s=null}v.c=v.e=null}}();function D(o,l,f,m){var c,v,p,d,y,w,E,T=o.c,I=ei;if(T){e:{for(c=1,d=T[0];d>=10;d/=10,c++);if(v=l-c,v<0)v+=U,p=l,y=T[w=0],E=Ne(y/I[c-p-1]%10);else if(w=$t((v+1)/U),w>=T.length)if(m){for(;T.length<=w;T.push(0));y=E=0,c=1,v%=U,p=v-U+1}else break e;else{for(y=d=T[w],c=1;d>=10;d/=10,c++);v%=U,p=v-U+c,E=p<0?0:Ne(y/I[c-p-1]%10)}if(m=m||l<0||T[w+1]!=null||(p<0?y:y%I[c-p-1]),m=f<4?(E||m)&&(f==0||f==(o.s<0?3:2)):E>5||E==5&&(f==4||m||f==6&&(v>0?p>0?y/I[c-p]:0:T[w-1])%10&1||f==(o.s<0?8:7)),l<1||!T[0])return T.length=0,m?(l-=o.e+1,T[0]=I[(U-l%U)%U],o.e=-l||0):T[0]=o.e=0,o;if(v==0?(T.length=w,d=1,w--):(T.length=w+1,d=I[U-v],T[w]=p>0?Ne(y/I[c-p]%I[p])*d:0),m)for(;;)if(w==0){for(v=1,p=T[0];p>=10;p/=10,v++);for(p=T[0]+=d,d=1;p>=10;p/=10,d++);v!=d&&(o.e++,T[0]==Pe&&(T[0]=1));break}else{if(T[w]+=d,T[w]!=Pe)break;T[w--]=0,d=1}for(v=T.length;T[--v]===0;T.pop());}o.e>S?o.c=o.e=null:o.e<b&&(o.c=[o.e=0])}return o}function G(o){var l,f=o.e;return f===null?o.toString():(l=ke(o.c),l=f<=g||f>=h?Gt(l,f):Ve(l,f,"0"),o.s<0?"-"+l:l)}return r.absoluteValue=r.abs=function(){var o=new _(this);return o.s<0&&(o.s=1),o},r.comparedTo=function(o,l){return rt(this,new _(o,l))},r.decimalPlaces=r.dp=function(o,l){var f,m,c,v=this;if(o!=null)return oe(o,0,Le),l==null?l=s:oe(l,0,8),D(new _(v),o+v.e+1,l);if(!(f=v.c))return null;if(m=((c=f.length-1)-Ce(this.e/U))*U,c=f[c])for(;c%10==0;c/=10,m--);return m<0&&(m=0),m},r.dividedBy=r.div=function(o,l){return e(this,new _(o,l),a,s)},r.dividedToIntegerBy=r.idiv=function(o,l){return e(this,new _(o,l),0,1)},r.exponentiatedBy=r.pow=function(o,l){var f,m,c,v,p,d,y,w,E,T=this;if(o=new _(o),o.c&&!o.isInteger())throw Error(we+"Exponent not an integer: "+G(o));if(l!=null&&(l=new _(l)),d=o.e>14,!T.c||!T.c[0]||T.c[0]==1&&!T.e&&T.c.length==1||!o.c||!o.c[0])return E=new _(Math.pow(+G(T),d?o.s*(2-At(o)):+G(o))),l?E.mod(l):E;if(y=o.s<0,l){if(l.c?!l.c[0]:!l.s)return new _(NaN);m=!y&&T.isInteger()&&l.isInteger(),m&&(T=T.mod(l))}else{if(o.e>9&&(T.e>0||T.e<-1||(T.e==0?T.c[0]>1||d&&T.c[1]>=24e7:T.c[0]<8e13||d&&T.c[0]<=9999975e7)))return v=T.s<0&&At(o)?-0:0,T.e>-1&&(v=1/v),new _(y?1/v:v);N&&(v=$t(N/U+2))}for(d?(f=new _(.5),y&&(o.s=1),w=At(o)):(c=Math.abs(+G(o)),w=c%2),E=new _(u);;){if(w){if(E=E.times(T),!E.c)break;v?E.c.length>v&&(E.c.length=v):m&&(E=E.mod(l))}if(c){if(c=Ne(c/2),c===0)break;w=c%2}else if(o=o.times(f),D(o,o.e+1,1),o.e>14)w=At(o);else{if(c=+G(o),c===0)break;w=c%2}T=T.times(T),v?T.c&&T.c.length>v&&(T.c.length=v):m&&(T=T.mod(l))}return m?E:(y&&(E=u.div(E)),l?E.mod(l):v?D(E,N,s,p):E)},r.integerValue=function(o){var l=new _(this);return o==null?o=s:oe(o,0,8),D(l,l.e+1,o)},r.isEqualTo=r.eq=function(o,l){return rt(this,new _(o,l))===0},r.isFinite=function(){return!!this.c},r.isGreaterThan=r.gt=function(o,l){return rt(this,new _(o,l))>0},r.isGreaterThanOrEqualTo=r.gte=function(o,l){return(l=rt(this,new _(o,l)))===1||l===0},r.isInteger=function(){return!!this.c&&Ce(this.e/U)>this.c.length-2},r.isLessThan=r.lt=function(o,l){return rt(this,new _(o,l))<0},r.isLessThanOrEqualTo=r.lte=function(o,l){return(l=rt(this,new _(o,l)))===-1||l===0},r.isNaN=function(){return!this.s},r.isNegative=function(){return this.s<0},r.isPositive=function(){return this.s>0},r.isZero=function(){return!!this.c&&this.c[0]==0},r.minus=function(o,l){var f,m,c,v,p=this,d=p.s;if(o=new _(o,l),l=o.s,!d||!l)return new _(NaN);if(d!=l)return o.s=-l,p.plus(o);var y=p.e/U,w=o.e/U,E=p.c,T=o.c;if(!y||!w){if(!E||!T)return E?(o.s=-l,o):new _(T?p:NaN);if(!E[0]||!T[0])return T[0]?(o.s=-l,o):new _(E[0]?p:s==3?-0:0)}if(y=Ce(y),w=Ce(w),E=E.slice(),d=y-w){for((v=d<0)?(d=-d,c=E):(w=y,c=T),c.reverse(),l=d;l--;c.push(0));c.reverse()}else for(m=(v=(d=E.length)<(l=T.length))?d:l,d=l=0;l<m;l++)if(E[l]!=T[l]){v=E[l]<T[l];break}if(v&&(c=E,E=T,T=c,o.s=-o.s),l=(m=T.length)-(f=E.length),l>0)for(;l--;E[f++]=0);for(l=Pe-1;m>d;){if(E[--m]<T[m]){for(f=m;f&&!E[--f];E[f]=l);--E[f],E[m]+=Pe}E[m]-=T[m]}for(;E[0]==0;E.splice(0,1),--w);return E[0]?K(o,E,w):(o.s=s==3?-1:1,o.c=[o.e=0],o)},r.modulo=r.mod=function(o,l){var f,m,c=this;return o=new _(o,l),!c.c||!o.s||o.c&&!o.c[0]?new _(NaN):!o.c||c.c&&!c.c[0]?new _(c):(k==9?(m=o.s,o.s=1,f=e(c,o,0,3),o.s=m,f.s*=m):f=e(c,o,0,k),o=c.minus(f.times(o)),!o.c[0]&&k==1&&(o.s=c.s),o)},r.multipliedBy=r.times=function(o,l){var f,m,c,v,p,d,y,w,E,T,I,B,j,Y,ne,V=this,Z=V.c,ge=(o=new _(o,l)).c;if(!Z||!ge||!Z[0]||!ge[0])return!V.s||!o.s||Z&&!Z[0]&&!ge||ge&&!ge[0]&&!Z?o.c=o.e=o.s=null:(o.s*=V.s,!Z||!ge?o.c=o.e=null:(o.c=[0],o.e=0)),o;for(m=Ce(V.e/U)+Ce(o.e/U),o.s*=V.s,y=Z.length,T=ge.length,y<T&&(j=Z,Z=ge,ge=j,c=y,y=T,T=c),c=y+T,j=[];c--;j.push(0));for(Y=Pe,ne=Xe,c=T;--c>=0;){for(f=0,I=ge[c]%ne,B=ge[c]/ne|0,p=y,v=c+p;v>c;)w=Z[--p]%ne,E=Z[p]/ne|0,d=B*w+E*I,w=I*w+d%ne*ne+j[v]+f,f=(w/Y|0)+(d/ne|0)+B*E,j[v--]=w%Y;j[v]=f}return f?++m:j.splice(0,1),K(o,j,m)},r.negated=function(){var o=new _(this);return o.s=-o.s||null,o},r.plus=function(o,l){var f,m=this,c=m.s;if(o=new _(o,l),l=o.s,!c||!l)return new _(NaN);if(c!=l)return o.s=-l,m.minus(o);var v=m.e/U,p=o.e/U,d=m.c,y=o.c;if(!v||!p){if(!d||!y)return new _(c/0);if(!d[0]||!y[0])return y[0]?o:new _(d[0]?m:c*0)}if(v=Ce(v),p=Ce(p),d=d.slice(),c=v-p){for(c>0?(p=v,f=y):(c=-c,f=d),f.reverse();c--;f.push(0));f.reverse()}for(c=d.length,l=y.length,c-l<0&&(f=y,y=d,d=f,l=c),c=0;l;)c=(d[--l]=d[l]+y[l]+c)/Pe|0,d[l]=Pe===d[l]?0:d[l]%Pe;return c&&(d=[c].concat(d),++p),K(o,d,p)},r.precision=r.sd=function(o,l){var f,m,c,v=this;if(o!=null&&o!==!!o)return oe(o,1,Le),l==null?l=s:oe(l,0,8),D(new _(v),o,l);if(!(f=v.c))return null;if(c=f.length-1,m=c*U+1,c=f[c]){for(;c%10==0;c/=10,m--);for(c=f[0];c>=10;c/=10,m++);}return o&&v.e+1>m&&(m=v.e+1),m},r.shiftedBy=function(o){return oe(o,-9007199254740991,ji),this.times("1e"+o)},r.squareRoot=r.sqrt=function(){var o,l,f,m,c,v=this,p=v.c,d=v.s,y=v.e,w=a+4,E=new _("0.5");if(d!==1||!p||!p[0])return new _(!d||d<0&&(!p||p[0])?NaN:p?v:1/0);if(d=Math.sqrt(+G(v)),d==0||d==1/0?(l=ke(p),(l.length+y)%2==0&&(l+="0"),d=Math.sqrt(+l),y=Ce((y+1)/2)-(y<0||y%2),d==1/0?l="5e"+y:(l=d.toExponential(),l=l.slice(0,l.indexOf("e")+1)+y),f=new _(l)):f=new _(d+""),f.c[0]){for(y=f.e,d=y+w,d<3&&(d=0);;)if(c=f,f=E.times(c.plus(e(v,c,w,1))),ke(c.c).slice(0,d)===(l=ke(f.c)).slice(0,d))if(f.e<y&&--d,l=l.slice(d-3,d+1),l=="9999"||!m&&l=="4999"){if(!m&&(D(c,c.e+a+2,0),c.times(c).eq(v))){f=c;break}w+=4,d+=4,m=1}else{(!+l||!+l.slice(1)&&l.charAt(0)=="5")&&(D(f,f.e+a+2,1),o=!f.times(f).eq(v));break}}return D(f,f.e+a+1,s,o)},r.toExponential=function(o,l){return o!=null&&(oe(o,0,Le),o++),R(this,o,l,1)},r.toFixed=function(o,l){return o!=null&&(oe(o,0,Le),o=o+this.e+1),R(this,o,l)},r.toFormat=function(o,l,f){var m,c=this;if(f==null)o!=null&&l&&typeof l=="object"?(f=l,l=null):o&&typeof o=="object"?(f=o,o=l=null):f=C;else if(typeof f!="object")throw Error(we+"Argument not an object: "+f);if(m=c.toFixed(o,l),c.c){var v,p=m.split("."),d=+f.groupSize,y=+f.secondaryGroupSize,w=f.groupSeparator||"",E=p[0],T=p[1],I=c.s<0,B=I?E.slice(1):E,j=B.length;if(y&&(v=d,d=y,y=v,j-=v),d>0&&j>0){for(v=j%d||d,E=B.substr(0,v);v<j;v+=d)E+=w+B.substr(v,d);y>0&&(E+=w+B.slice(v)),I&&(E="-"+E)}m=T?E+(f.decimalSeparator||"")+((y=+f.fractionGroupSize)?T.replace(new RegExp("\\d{"+y+"}\\B","g"),"$&"+(f.fractionGroupSeparator||"")):T):E}return(f.prefix||"")+m+(f.suffix||"")},r.toFraction=function(o){var l,f,m,c,v,p,d,y,w,E,T,I,B=this,j=B.c;if(o!=null&&(d=new _(o),!d.isInteger()&&(d.c||d.s!==1)||d.lt(u)))throw Error(we+"Argument "+(d.isInteger()?"out of range: ":"not an integer: ")+G(d));if(!j)return new _(B);for(l=new _(u),w=f=new _(u),m=y=new _(u),I=ke(j),v=l.e=I.length-B.e-1,l.c[0]=ei[(p=v%U)<0?U+p:p],o=!o||d.comparedTo(l)>0?v>0?l:w:d,p=S,S=1/0,d=new _(I),y.c[0]=0;E=e(d,l,0,1),c=f.plus(E.times(m)),c.comparedTo(o)!=1;)f=m,m=c,w=y.plus(E.times(c=w)),y=c,l=d.minus(E.times(c=l)),d=c;return c=e(o.minus(f),m,0,1),y=y.plus(c.times(w)),f=f.plus(c.times(m)),y.s=w.s=B.s,v=v*2,T=e(w,m,v,s).minus(B).abs().comparedTo(e(y,f,v,s).minus(B).abs())<1?[w,m]:[y,f],S=p,T},r.toNumber=function(){return+G(this)},r.toPrecision=function(o,l){return o!=null&&oe(o,1,Le),R(this,o,l,2)},r.toString=function(o){var l,f=this,m=f.s,c=f.e;return c===null?m?(l="Infinity",m<0&&(l="-"+l)):l="NaN":(o==null?l=c<=g||c>=h?Gt(ke(f.c),c):Ve(ke(f.c),c,"0"):o===10&&A?(f=D(new _(f),a+c+1,s),l=Ve(ke(f.c),f.e,"0")):(oe(o,2,O.length,"Base"),l=t(Ve(ke(f.c),c,"0"),10,o,m,!0)),m<0&&f.c[0]&&(l="-"+l)),l},r.valueOf=r.toJSON=function(){return G(this)},r._isBigNumber=!0,r[Symbol.toStringTag]="BigNumber",r[Symbol.for("nodejs.util.inspect.custom")]=r.valueOf,i!=null&&_.set(i),_}function Ce(i){var e=i|0;return i>0||i===e?e:e-1}function ke(i){for(var e,t,n=1,r=i.length,u=i[0]+"";n<r;){for(e=i[n++]+"",t=U-e.length;t--;e="0"+e);u+=e}for(r=u.length;u.charCodeAt(--r)===48;);return u.slice(0,r+1||1)}function rt(i,e){var t,n,r=i.c,u=e.c,a=i.s,s=e.s,g=i.e,h=e.e;if(!a||!s)return null;if(t=r&&!r[0],n=u&&!u[0],t||n)return t?n?0:-s:a;if(a!=s)return a;if(t=a<0,n=g==h,!r||!u)return n?0:!r^t?1:-1;if(!n)return g>h^t?1:-1;for(s=(g=r.length)<(h=u.length)?g:h,a=0;a<s;a++)if(r[a]!=u[a])return r[a]>u[a]^t?1:-1;return g==h?0:g>h^t?1:-1}function oe(i,e,t,n){if(i<e||i>t||i!==Ne(i))throw Error(we+(n||"Argument")+(typeof i=="number"?i<e||i>t?" out of range: ":" not an integer: ":" not a primitive number: ")+String(i))}function At(i){var e=i.c.length-1;return Ce(i.e/U)==e&&i.c[e]%2!=0}function Gt(i,e){return(i.length>1?i.charAt(0)+"."+i.slice(1):i)+(e<0?"e":"e+")+e}function Ve(i,e,t){var n,r;if(e<0){for(r=t+".";++e;r+=t);i=r+i}else if(n=i.length,++e>n){for(r=t,e-=n;--e;r+=t);i+=r}else e<n&&(i=i.slice(0,e)+"."+i.slice(e));return i}var Ie=Hi(),zr=class{constructor(i){P(this,"key");P(this,"left",null);P(this,"right",null);this.key=i}},wt=class extends zr{constructor(i){super(i)}},Wr=class{constructor(){P(this,"size",0);P(this,"modificationCount",0);P(this,"splayCount",0)}splay(i){const e=this.root;if(e==null)return this.compare(i,i),-1;let t=null,n=null,r=null,u=null,a=e;const s=this.compare;let g;for(;;)if(g=s(a.key,i),g>0){let h=a.left;if(h==null||(g=s(h.key,i),g>0&&(a.left=h.right,h.right=a,a=h,h=a.left,h==null)))break;t==null?n=a:t.left=a,t=a,a=h}else if(g<0){let h=a.right;if(h==null||(g=s(h.key,i),g<0&&(a.right=h.left,h.left=a,a=h,h=a.right,h==null)))break;r==null?u=a:r.right=a,r=a,a=h}else break;return r!=null&&(r.right=a.left,a.left=u),t!=null&&(t.left=a.right,a.right=n),this.root!==a&&(this.root=a,this.splayCount++),g}splayMin(i){let e=i,t=e.left;for(;t!=null;){const n=t;e.left=n.right,n.right=e,e=n,t=e.left}return e}splayMax(i){let e=i,t=e.right;for(;t!=null;){const n=t;e.right=n.left,n.left=e,e=n,t=e.right}return e}_delete(i){if(this.root==null||this.splay(i)!=0)return null;let t=this.root;const n=t,r=t.left;if(this.size--,r==null)this.root=t.right;else{const u=t.right;t=this.splayMax(r),t.right=u,this.root=t}return this.modificationCount++,n}addNewRoot(i,e){this.size++,this.modificationCount++;const t=this.root;if(t==null){this.root=i;return}e<0?(i.left=t,i.right=t.right,t.right=null):(i.right=t,i.left=t.left,t.left=null),this.root=i}_first(){const i=this.root;return i==null?null:(this.root=this.splayMin(i),this.root)}_last(){const i=this.root;return i==null?null:(this.root=this.splayMax(i),this.root)}clear(){this.root=null,this.size=0,this.modificationCount++}has(i){return this.validKey(i)&&this.splay(i)==0}defaultCompare(){return(i,e)=>i<e?-1:i>e?1:0}wrap(){return{getRoot:()=>this.root,setRoot:i=>{this.root=i},getSize:()=>this.size,getModificationCount:()=>this.modificationCount,getSplayCount:()=>this.splayCount,setSplayCount:i=>{this.splayCount=i},splay:i=>this.splay(i),has:i=>this.has(i)}}},Bt=class Mt extends Wr{constructor(t,n){super();P(this,"root",null);P(this,"compare");P(this,"validKey");P(this,dn,"[object Set]");this.compare=t??this.defaultCompare(),this.validKey=n??(r=>r!=null&&r!=null)}delete(t){return this.validKey(t)?this._delete(t)!=null:!1}deleteAll(t){for(const n of t)this.delete(n)}forEach(t){const n=this[Symbol.iterator]();let r;for(;r=n.next(),!r.done;)t(r.value,r.value,this)}add(t){const n=this.splay(t);return n!=0&&this.addNewRoot(new wt(t),n),this}addAndReturn(t){const n=this.splay(t);return n!=0&&this.addNewRoot(new wt(t),n),this.root.key}addAll(t){for(const n of t)this.add(n)}isEmpty(){return this.root==null}isNotEmpty(){return this.root!=null}single(){if(this.size==0)throw"Bad state: No element";if(this.size>1)throw"Bad state: Too many element";return this.root.key}first(){if(this.size==0)throw"Bad state: No element";return this._first().key}last(){if(this.size==0)throw"Bad state: No element";return this._last().key}lastBefore(t){if(t==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(t)<0)return this.root.key;let r=this.root.left;if(r==null)return null;let u=r.right;for(;u!=null;)r=u,u=r.right;return r.key}firstAfter(t){if(t==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(t)>0)return this.root.key;let r=this.root.right;if(r==null)return null;let u=r.left;for(;u!=null;)r=u,u=r.left;return r.key}retainAll(t){const n=new Mt(this.compare,this.validKey),r=this.modificationCount;for(const u of t){if(r!=this.modificationCount)throw"Concurrent modification during iteration.";this.validKey(u)&&this.splay(u)==0&&n.add(this.root.key)}n.size!=this.size&&(this.root=n.root,this.size=n.size,this.modificationCount++)}lookup(t){return!this.validKey(t)||this.splay(t)!=0?null:this.root.key}intersection(t){const n=new Mt(this.compare,this.validKey);for(const r of this)t.has(r)&&n.add(r);return n}difference(t){const n=new Mt(this.compare,this.validKey);for(const r of this)t.has(r)||n.add(r);return n}union(t){const n=this.clone();return n.addAll(t),n}clone(){const t=new Mt(this.compare,this.validKey);return t.size=this.size,t.root=this.copyNode(this.root),t}copyNode(t){if(t==null)return null;function n(u,a){let s,g;do{if(s=u.left,g=u.right,s!=null){const h=new wt(s.key);a.left=h,n(s,h)}if(g!=null){const h=new wt(g.key);a.right=h,u=g,a=h}}while(g!=null)}const r=new wt(t.key);return n(t,r),r}toSet(){return this.clone()}entries(){return new Dr(this.wrap())}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}[(gn=Symbol.iterator,dn=Symbol.toStringTag,gn)](){return new Fr(this.wrap())}},Zi=class{constructor(i){P(this,"tree");P(this,"path",new Array);P(this,"modificationCount",null);P(this,"splayCount");this.tree=i,this.splayCount=i.getSplayCount()}[Symbol.iterator](){return this}next(){return this.moveNext()?{done:!1,value:this.current()}:{done:!0,value:null}}current(){if(!this.path.length)return null;const i=this.path[this.path.length-1];return this.getValue(i)}rebuildPath(i){this.path.splice(0,this.path.length),this.tree.splay(i),this.path.push(this.tree.getRoot()),this.splayCount=this.tree.getSplayCount()}findLeftMostDescendent(i){for(;i!=null;)this.path.push(i),i=i.left}moveNext(){if(this.modificationCount!=this.tree.getModificationCount()){if(this.modificationCount==null){this.modificationCount=this.tree.getModificationCount();let t=this.tree.getRoot();for(;t!=null;)this.path.push(t),t=t.left;return this.path.length>0}throw"Concurrent modification during iteration."}if(!this.path.length)return!1;this.splayCount!=this.tree.getSplayCount()&&this.rebuildPath(this.path[this.path.length-1].key);let i=this.path[this.path.length-1],e=i.right;if(e!=null){for(;e!=null;)this.path.push(e),e=e.left;return!0}for(this.path.pop();this.path.length&&this.path[this.path.length-1].right===i;)i=this.path.pop();return this.path.length>0}},Fr=class extends Zi{getValue(i){return i.key}},Dr=class extends Zi{getValue(i){return[i.key,i.key]}},Ki=i=>()=>i,ti=i=>{const e=i?(t,n)=>n.minus(t).abs().isLessThanOrEqualTo(i):Ki(!1);return(t,n)=>e(t,n)?0:t.comparedTo(n)};function Ur(i){const e=i?(t,n,r,u,a)=>t.exponentiatedBy(2).isLessThanOrEqualTo(u.minus(n).exponentiatedBy(2).plus(a.minus(r).exponentiatedBy(2)).times(i)):Ki(!1);return(t,n,r)=>{const u=t.x,a=t.y,s=r.x,g=r.y,h=a.minus(g).times(n.x.minus(s)).minus(u.minus(s).times(n.y.minus(g)));return e(h,u,a,s,g)?0:h.comparedTo(0)}}var qr=i=>i,Vr=i=>{if(i){const e=new Bt(ti(i)),t=new Bt(ti(i)),n=(u,a)=>a.addAndReturn(u),r=u=>({x:n(u.x,e),y:n(u.y,t)});return r({x:new Ie(0),y:new Ie(0)}),r}return qr},ii=i=>({set:e=>{je=ii(e)},reset:()=>ii(i),compare:ti(i),snap:Vr(i),orient:Ur(i)}),je=ii(),Et=(i,e)=>i.ll.x.isLessThanOrEqualTo(e.x)&&e.x.isLessThanOrEqualTo(i.ur.x)&&i.ll.y.isLessThanOrEqualTo(e.y)&&e.y.isLessThanOrEqualTo(i.ur.y),ni=(i,e)=>{if(e.ur.x.isLessThan(i.ll.x)||i.ur.x.isLessThan(e.ll.x)||e.ur.y.isLessThan(i.ll.y)||i.ur.y.isLessThan(e.ll.y))return null;const t=i.ll.x.isLessThan(e.ll.x)?e.ll.x:i.ll.x,n=i.ur.x.isLessThan(e.ur.x)?i.ur.x:e.ur.x,r=i.ll.y.isLessThan(e.ll.y)?e.ll.y:i.ll.y,u=i.ur.y.isLessThan(e.ur.y)?i.ur.y:e.ur.y;return{ll:{x:t,y:r},ur:{x:n,y:u}}},zt=(i,e)=>i.x.times(e.y).minus(i.y.times(e.x)),Yi=(i,e)=>i.x.times(e.x).plus(i.y.times(e.y)),Wt=i=>Yi(i,i).sqrt(),jr=(i,e,t)=>{const n={x:e.x.minus(i.x),y:e.y.minus(i.y)},r={x:t.x.minus(i.x),y:t.y.minus(i.y)};return zt(r,n).div(Wt(r)).div(Wt(n))},Hr=(i,e,t)=>{const n={x:e.x.minus(i.x),y:e.y.minus(i.y)},r={x:t.x.minus(i.x),y:t.y.minus(i.y)};return Yi(r,n).div(Wt(r)).div(Wt(n))},Qi=(i,e,t)=>e.y.isZero()?null:{x:i.x.plus(e.x.div(e.y).times(t.minus(i.y))),y:t},Xi=(i,e,t)=>e.x.isZero()?null:{x:t,y:i.y.plus(e.y.div(e.x).times(t.minus(i.x)))},Zr=(i,e,t,n)=>{if(e.x.isZero())return Xi(t,n,i.x);if(n.x.isZero())return Xi(i,e,t.x);if(e.y.isZero())return Qi(t,n,i.y);if(n.y.isZero())return Qi(i,e,t.y);const r=zt(e,n);if(r.isZero())return null;const u={x:t.x.minus(i.x),y:t.y.minus(i.y)},a=zt(u,e).div(r),s=zt(u,n).div(r),g=i.x.plus(s.times(e.x)),h=t.x.plus(a.times(n.x)),b=i.y.plus(s.times(e.y)),S=t.y.plus(a.times(n.y)),M=g.plus(h).div(2),k=b.plus(S).div(2);return{x:M,y:k}},Ae=class _n{constructor(e,t){P(this,"point");P(this,"isLeft");P(this,"segment");P(this,"otherSE");P(this,"consumedBy");e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}static compare(e,t){const n=_n.comparePoints(e.point,t.point);return n!==0?n:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:Dt.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x.isLessThan(t.x)?-1:e.x.isGreaterThan(t.x)?1:e.y.isLessThan(t.y)?-1:e.y.isGreaterThan(t.y)?1:0}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 u=t[n];this.point.events.push(u),u.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 u=this.point.events[r];u.consumedBy===void 0&&n.otherSE.point.events===u.otherSE.point.events&&n.segment.consume(u.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 u=r.otherSE;t.set(r,{sine:jr(this.point,e.point,u.point),cosine:Hr(this.point,e.point,u.point)})};return(r,u)=>{t.has(r)||n(r),t.has(u)||n(u);const{sine:a,cosine:s}=t.get(r),{sine:g,cosine:h}=t.get(u);return a.isGreaterThanOrEqualTo(0)&&g.isGreaterThanOrEqualTo(0)?s.isLessThan(h)?1:s.isGreaterThan(h)?-1:0:a.isLessThan(0)&&g.isLessThan(0)?s.isLessThan(h)?-1:s.isGreaterThan(h)?1:0:g.isLessThan(a)?-1:g.isGreaterThan(a)?1:0}}},Kr=class gi{constructor(e){P(this,"events");P(this,"poly");P(this,"_isExteriorRing");P(this,"_enclosingRing");this.events=e;for(let t=0,n=e.length;t<n;t++)e[t].segment.ringOut=this;this.poly=null}static factory(e){const t=[];for(let n=0,r=e.length;n<r;n++){const u=e[n];if(!u.isInResult()||u.ringOut)continue;let a=null,s=u.leftSE,g=u.rightSE;const h=[s],b=s.point,S=[];for(;a=s,s=g,h.push(s),s.point!==b;)for(;;){const M=s.getAvailableLinkedEvents();if(M.length===0){const C=h[0].point,O=h[h.length-1].point;throw new Error(`Unable to complete output ring starting at [${C.x}, ${C.y}]. Last matching segment found ends at [${O.x}, ${O.y}].`)}if(M.length===1){g=M[0].otherSE;break}let k=null;for(let C=0,O=S.length;C<O;C++)if(S[C].point===s.point){k=C;break}if(k!==null){const C=S.splice(k)[0],O=h.splice(C.index);O.unshift(O[0].otherSE),t.push(new gi(O.reverse()));continue}S.push({index:h.length,point:s.point});const N=s.getLeftmostComparator(a);g=M.sort(N)[0].otherSE;break}t.push(new gi(h))}return t}getGeom(){let e=this.events[0].point;const t=[e];for(let h=1,b=this.events.length-1;h<b;h++){const S=this.events[h].point,M=this.events[h+1].point;je.orient(S,e,M)!==0&&(t.push(S),e=S)}if(t.length===1)return null;const n=t[0],r=t[1];je.orient(n,e,r)===0&&t.shift(),t.push(t[0]);const u=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:t.length-1,s=this.isExteriorRing()?t.length:-1,g=[];for(let h=a;h!=s;h+=u)g.push([t[h].x.toNumber(),t[h].y.toNumber()]);return g}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(){var r,u;let e=this.events[0];for(let a=1,s=this.events.length;a<s;a++){const g=this.events[a];Ae.compare(e,g)>0&&(e=g)}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((r=n.ringOut)==null?void 0:r.enclosingRing())!==t.ringOut?t.ringOut:(u=t.ringOut)==null?void 0:u.enclosingRing();t=n.prevInResult(),n=t?t.prevInResult():null}}},Ji=class{constructor(i){P(this,"exteriorRing");P(this,"interiorRings");this.exteriorRing=i,i.poly=this,this.interiorRings=[]}addInterior(i){this.interiorRings.push(i),i.poly=this}getGeom(){const i=this.exteriorRing.getGeom();if(i===null)return null;const e=[i];for(let t=0,n=this.interiorRings.length;t<n;t++){const r=this.interiorRings[t].getGeom();r!==null&&e.push(r)}return e}},Yr=class{constructor(i){P(this,"rings");P(this,"polys");this.rings=i,this.polys=this._composePolys(i)}getGeom(){const i=[];for(let e=0,t=this.polys.length;e<t;e++){const n=this.polys[e].getGeom();n!==null&&i.push(n)}return i}_composePolys(i){var t;const e=[];for(let n=0,r=i.length;n<r;n++){const u=i[n];if(!u.poly)if(u.isExteriorRing())e.push(new Ji(u));else{const a=u.enclosingRing();a!=null&&a.poly||e.push(new Ji(a)),(t=a==null?void 0:a.poly)==null||t.addInterior(u)}}return e}},Qr=class{constructor(i,e=Dt.compare){P(this,"queue");P(this,"tree");P(this,"segments");this.queue=i,this.tree=new Bt(e),this.segments=[]}process(i){const e=i.segment,t=[];if(i.consumedBy)return i.isLeft?this.queue.delete(i.otherSE):this.tree.delete(e),t;i.isLeft&&this.tree.add(e);let n=e,r=e;do n=this.tree.lastBefore(n);while(n!=null&&n.consumedBy!=null);do r=this.tree.firstAfter(r);while(r!=null&&r.consumedBy!=null);if(i.isLeft){let u=null;if(n){const s=n.getIntersection(e);if(s!==null&&(e.isAnEndpoint(s)||(u=s),!n.isAnEndpoint(s))){const g=this._splitSafely(n,s);for(let h=0,b=g.length;h<b;h++)t.push(g[h])}}let a=null;if(r){const s=r.getIntersection(e);if(s!==null&&(e.isAnEndpoint(s)||(a=s),!r.isAnEndpoint(s))){const g=this._splitSafely(r,s);for(let h=0,b=g.length;h<b;h++)t.push(g[h])}}if(u!==null||a!==null){let s=null;u===null?s=a:a===null?s=u:s=Ae.comparePoints(u,a)<=0?u:a,this.queue.delete(e.rightSE),t.push(e.rightSE);const g=e.split(s);for(let h=0,b=g.length;h<b;h++)t.push(g[h])}t.length>0?(this.tree.delete(e),t.push(i)):(this.segments.push(e),e.prev=n)}else{if(n&&r){const u=n.getIntersection(r);if(u!==null){if(!n.isAnEndpoint(u)){const a=this._splitSafely(n,u);for(let s=0,g=a.length;s<g;s++)t.push(a[s])}if(!r.isAnEndpoint(u)){const a=this._splitSafely(r,u);for(let s=0,g=a.length;s<g;s++)t.push(a[s])}}}this.tree.delete(e)}return t}_splitSafely(i,e){this.tree.delete(i);const t=i.rightSE;this.queue.delete(t);const n=i.split(e);return n.push(t),i.consumedBy===void 0&&this.tree.add(i),n}},Xr=class{constructor(){P(this,"type");P(this,"numMultiPolys")}run(i,e,t){Lt.type=i;const n=[new en(e,!0)];for(let h=0,b=t.length;h<b;h++)n.push(new en(t[h],!1));if(Lt.numMultiPolys=n.length,Lt.type==="difference"){const h=n[0];let b=1;for(;b<n.length;)ni(n[b].bbox,h.bbox)!==null?b++:n.splice(b,1)}if(Lt.type==="intersection")for(let h=0,b=n.length;h<b;h++){const S=n[h];for(let M=h+1,k=n.length;M<k;M++)if(ni(S.bbox,n[M].bbox)===null)return[]}const r=new Bt(Ae.compare);for(let h=0,b=n.length;h<b;h++){const S=n[h].getSweepEvents();for(let M=0,k=S.length;M<k;M++)r.add(S[M])}const u=new Qr(r);let a=null;for(r.size!=0&&(a=r.first(),r.delete(a));a;){const h=u.process(a);for(let b=0,S=h.length;b<S;b++){const M=h[b];M.consumedBy===void 0&&r.add(M)}r.size!=0?(a=r.first(),r.delete(a)):a=null}je.reset();const s=Kr.factory(u.segments);return new Yr(s).getGeom()}},Lt=new Xr,Ft=Lt,Jr=0,Dt=class Vt{constructor(e,t,n,r){P(this,"id");P(this,"leftSE");P(this,"rightSE");P(this,"rings");P(this,"windings");P(this,"ringOut");P(this,"consumedBy");P(this,"prev");P(this,"_prevInResult");P(this,"_beforeState");P(this,"_afterState");P(this,"_isInResult");this.id=++Jr,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 compare(e,t){const n=e.leftSE.point.x,r=t.leftSE.point.x,u=e.rightSE.point.x,a=t.rightSE.point.x;if(a.isLessThan(n))return 1;if(u.isLessThan(r))return-1;const s=e.leftSE.point.y,g=t.leftSE.point.y,h=e.rightSE.point.y,b=t.rightSE.point.y;if(n.isLessThan(r)){if(g.isLessThan(s)&&g.isLessThan(h))return 1;if(g.isGreaterThan(s)&&g.isGreaterThan(h))return-1;const S=e.comparePoint(t.leftSE.point);if(S<0)return 1;if(S>0)return-1;const M=t.comparePoint(e.rightSE.point);return M!==0?M:-1}if(n.isGreaterThan(r)){if(s.isLessThan(g)&&s.isLessThan(b))return-1;if(s.isGreaterThan(g)&&s.isGreaterThan(b))return 1;const S=t.comparePoint(e.leftSE.point);if(S!==0)return S;const M=e.comparePoint(t.rightSE.point);return M<0?1:M>0?-1:1}if(s.isLessThan(g))return-1;if(s.isGreaterThan(g))return 1;if(u.isLessThan(a)){const S=t.comparePoint(e.rightSE.point);if(S!==0)return S}if(u.isGreaterThan(a)){const S=e.comparePoint(t.rightSE.point);if(S<0)return 1;if(S>0)return-1}if(!u.eq(a)){const S=h.minus(s),M=u.minus(n),k=b.minus(g),N=a.minus(r);if(S.isGreaterThan(M)&&k.isLessThan(N))return 1;if(S.isLessThan(M)&&k.isGreaterThan(N))return-1}return u.isGreaterThan(a)?1:u.isLessThan(a)||h.isLessThan(b)?-1:h.isGreaterThan(b)?1:e.id<t.id?-1:e.id>t.id?1:0}static fromRing(e,t,n){let r,u,a;const s=Ae.comparePoints(e,t);if(s<0)r=e,u=t,a=1;else if(s>0)r=t,u=e,a=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const g=new Ae(r,!0),h=new Ae(u,!1);return new Vt(g,h,[n],[a])}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.isLessThan(t)?e:t},ur:{x:this.rightSE.point.x,y:e.isGreaterThan(t)?e:t}}}vector(){return{x:this.rightSE.point.x.minus(this.leftSE.point.x),y:this.rightSE.point.y.minus(this.leftSE.point.y)}}isAnEndpoint(e){return e.x.eq(this.leftSE.point.x)&&e.y.eq(this.leftSE.point.y)||e.x.eq(this.rightSE.point.x)&&e.y.eq(this.rightSE.point.y)}comparePoint(e){return je.orient(this.leftSE.point,e,this.rightSE.point)}getIntersection(e){const t=this.bbox(),n=e.bbox(),r=ni(t,n);if(r===null)return null;const u=this.leftSE.point,a=this.rightSE.point,s=e.leftSE.point,g=e.rightSE.point,h=Et(t,s)&&this.comparePoint(s)===0,b=Et(n,u)&&e.comparePoint(u)===0,S=Et(t,g)&&this.comparePoint(g)===0,M=Et(n,a)&&e.comparePoint(a)===0;if(b&&h)return M&&!S?a:!M&&S?g:null;if(b)return S&&u.x.eq(g.x)&&u.y.eq(g.y)?null:u;if(h)return M&&a.x.eq(s.x)&&a.y.eq(s.y)?null:s;if(M&&S)return null;if(M)return a;if(S)return g;const k=Zr(u,this.vector(),s,e.vector());return k===null||!Et(r,k)?null:je.snap(k)}split(e){const t=[],n=e.events!==void 0,r=new Ae(e,!0),u=new Ae(e,!1),a=this.rightSE;this.replaceRightSE(u),t.push(u),t.push(r);const s=new Vt(r,a,this.rings.slice(),this.windings.slice());return Ae.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),Ae.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),u.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=Vt.compare(t,n);if(r!==0){if(r>0){const u=t;t=n,n=u}if(t.prev===n){const u=t;t=n,n=u}for(let u=0,a=n.rings.length;u<a;u++){const s=n.rings[u],g=n.windings[u],h=t.rings.indexOf(s);h===-1?(t.rings.push(s),t.windings.push(g)):t.windings[h]+=g}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,g=this.rings.length;s<g;s++){const h=this.rings[s],b=this.windings[s],S=t.indexOf(h);S===-1?(t.push(h),n.push(b)):n[S]+=b}const u=[],a=[];for(let s=0,g=t.length;s<g;s++){if(n[s]===0)continue;const h=t[s],b=h.poly;if(a.indexOf(b)===-1)if(h.isExterior)u.push(b);else{a.indexOf(b)===-1&&a.push(b);const S=u.indexOf(h.poly);S!==-1&&u.splice(S,1)}}for(let s=0,g=u.length;s<g;s++){const h=u[s].multiPoly;r.indexOf(h)===-1&&r.push(h)}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(Ft.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===Ft.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}}return this._isInResult}},$i=class{constructor(i,e,t){P(this,"poly");P(this,"isExterior");P(this,"segments");P(this,"bbox");if(!Array.isArray(i)||i.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=t,this.segments=[],typeof i[0][0]!="number"||typeof i[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const n=je.snap({x:new Ie(i[0][0]),y:new Ie(i[0][1])});this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};let r=n;for(let u=1,a=i.length;u<a;u++){if(typeof i[u][0]!="number"||typeof i[u][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const s=je.snap({x:new Ie(i[u][0]),y:new Ie(i[u][1])});s.x.eq(r.x)&&s.y.eq(r.y)||(this.segments.push(Dt.fromRing(r,s,this)),s.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=s.x),s.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=s.y),s.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=s.x),s.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=s.y),r=s)}(!n.x.eq(r.x)||!n.y.eq(r.y))&&this.segments.push(Dt.fromRing(r,n,this))}getSweepEvents(){const i=[];for(let e=0,t=this.segments.length;e<t;e++){const n=this.segments[e];i.push(n.leftSE),i.push(n.rightSE)}return i}},$r=class{constructor(i,e){P(this,"multiPoly");P(this,"exteriorRing");P(this,"interiorRings");P(this,"bbox");if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new $i(i[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 t=1,n=i.length;t<n;t++){const r=new $i(i[t],this,!1);r.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=r.bbox.ur.y),this.interiorRings.push(r)}this.multiPoly=e}getSweepEvents(){const i=this.exteriorRing.getSweepEvents();for(let e=0,t=this.interiorRings.length;e<t;e++){const n=this.interiorRings[e].getSweepEvents();for(let r=0,u=n.length;r<u;r++)i.push(n[r])}return i}},en=class{constructor(i,e){P(this,"isSubject");P(this,"polys");P(this,"bbox");if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof i[0][0][0]=="number"&&(i=[i])}catch{}this.polys=[],this.bbox={ll:{x:new Ie(Number.POSITIVE_INFINITY),y:new Ie(Number.POSITIVE_INFINITY)},ur:{x:new Ie(Number.NEGATIVE_INFINITY),y:new Ie(Number.NEGATIVE_INFINITY)}};for(let t=0,n=i.length;t<n;t++){const r=new $r(i[t],this);r.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=r.bbox.ur.y),this.polys.push(r)}this.isSubject=e}getSweepEvents(){const i=[];for(let e=0,t=this.polys.length;e<t;e++){const n=this.polys[e].getSweepEvents();for(let r=0,u=n.length;r<u;r++)i.push(n[r])}return i}},es=(i,...e)=>Ft.run("union",i,e),ts=(i,...e)=>Ft.run("difference",i,e);je.set;function is(i){const e=[];if(Jt(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=ts(e[0],...e.slice(1));return n.length===0?null:n.length===1?Qt(n[0],t):Di(n,t)}var ns=is;function rs(i){if(!i)throw new Error("geojson is required");var e=[];return Ar(i,function(t){e.push(t)}),Xt(e)}var ss=rs;function os(i,e={}){const t=[];if(Jt(i,r=>{t.push(r.coordinates)}),t.length<2)throw new Error("Must have at least 2 geometries");const n=es(t[0],...t.slice(1));return n.length===0?null:n.length===1?Qt(n[0],e.properties):Di(n,e.properties)}var ls=os;function tn(i,e){const t=ns(Xt([Qt([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),i]));if(!t)return;t.properties={isMask:!0};const n=Rt(qi(i)),r=(n[2]-n[0])/360/1e3,u=n[0]<-180,a=n[2]>180,s=ss(i);if(s.features.length>1&&(u||a))for(const g of s.features){const h=Rt(qi(g));if(a&&h[0]<-180+r)for(const b of g.geometry.coordinates)for(const S of b)S[0]+=360-r;if(u&&h[2]>180-r)for(const b of g.geometry.coordinates)for(const S of b)S[0]-=360-r}e(Xt([s.features.length<2?i:ls(s)??i,t]))}const nn="EPSG:4326";function us(i){var u;const e=i.getProperties(),{isMask:t}=e,n=(u=i.getGeometry())==null?void 0:u.getType(),r=t?0:n==="LineString"||n==="MultiLineString"?3:2;return new Nn({stroke:t?void 0:new pi({color:"#3170fe",lineDash:[r,r],width:r,lineCap:"butt"}),fill:t?new mi({color:"#00000020"}):void 0,image:new Mn({src:`/icons/marker_${e.isReverse?"reverse":e.isSelected?"selected":"unselected"}.svg`,anchor:[.5,1]}),zIndex:e.isSelected?2:e.isReverse?0:1,text:e.isSelected&&e.tooltip?new Cn({backgroundFill:new mi({color:"white"}),text:e.tooltip,offsetY:-40,backgroundStroke:new pi({color:"white",lineJoin:"round",width:3}),padding:[2,0,0,2]}):void 0})}function rn(i,e={},t={},n=us){let r=-1,u,a,s,g=!1;const h=new xn({updateWhileAnimating:!0});i.addLayer(h);const b=new Tn({});h.setSource(b),h.setStyle(n),i.on("click",N=>{i.forEachFeatureAtPixel(N.pixel,C=>{const O=C.getId();if(O)return N.stopPropagation(),a==null||a({type:"markerClick",id:O}),C})}),i.on("pointermove",N=>{const C=i.forEachFeatureAtPixel(N.pixel,O=>O.getId());u!==C&&(u&&(a==null||a({type:"markerMouseLeave",id:u})),C&&(a==null||a({type:"markerMouseEnter",id:C})),i.getTargetElement().style.cursor=C?"pointer":g?"crosshair":"",u=C)});function S(){return Ke.getUserProjection()??i.getView().getProjection()}function M(N){return N.transform(nn,S())}const k=N=>{a==null||a({type:"mapClick",coordinates:Ke.toLonLat(N.coordinate,S())})};return{setEventHandler(N){N?(a=N,i.on("click",k)):(a=void 0,i.un("click",k))},flyTo(N,C){i.getView().animate({center:Ke.fromLonLat(N,S()),...C?{zoom:C}:{},duration:2e3,...e})},fitBounds(N,C,O){i.getView().fit(Ke.transformExtent(N,nn,S()),{padding:[C,C,C,C],...O?{maxZoom:O}:{},duration:2e3,...t})},indicateReverse(N){g=N,i.getTargetElement().style.cursor=N?"crosshair":""},setReverseMarker(N){s?N?s.getGeometry().setCoordinates(Ke.fromLonLat(N,S())):(b.removeFeature(s),s.dispose(),s=void 0):N&&(s=new Te.Feature(new Me.Point(Ke.fromLonLat(N,S()))),s.setProperties({isReverse:!0}),b.addFeature(s))},setFeatures(N,C,O){function A(_){var R;if(_)for(const F of _.features){const K=F.geometry.type==="Polygon"?new Me.Polygon(F.geometry.coordinates):F.geometry.type==="MultiPolygon"?new Me.MultiPolygon(F.geometry.coordinates):null;K&&b.addFeature(new Te.Feature({isMask:!!((R=F.properties)!=null&&R.isMask),geometry:M(K)}))}}b.clear(),s&&b.addFeature(s);e:if(C){let _=!1;if(C.geometry.type==="GeometryCollection"){const R=C.geometry.geometries.map(F=>F.type==="Polygon"?new Me.Polygon(F.coordinates):F.type==="MultiPolygon"?new Me.MultiPolygon(F.coordinates):null).filter(F=>!!F);if(R.length>0)b.addFeature(new Te.Feature(M(new Me.GeometryCollection(R)))),_=!0;else for(const F of C.geometry.geometries)F.type==="LineString"?(b.addFeature(new Te.Feature(M(new Me.LineString(F.coordinates)))),_=!0):F.type==="MultiLineString"&&b.addFeature(new Te.Feature(M(new Me.MultiLineString(F.coordinates)))),_=!0}if(!_){if(C.geometry.type==="Polygon")tn(C,A);else if(C.geometry.type==="MultiPolygon")tn(C,A);else if(C.geometry.type==="LineString"){b.addFeature(new Te.Feature(M(new Me.LineString(C.geometry.coordinates))));break e}else if(C.geometry.type==="MultiLineString"){b.addFeature(new Te.Feature(M(new Me.MultiLineString(C.geometry.coordinates))));break e}}if(!O&&C.geometry.type!=="Point")break e;b.addFeature(new Te.Feature(M(new Me.Point(C.center))))}for(const _ of N??[]){if(_===C)continue;const R=new Te.Feature(new Me.Point(Ke.fromLonLat(_.center,S())));R.setId(_.id),R.setProperties({fuzzy:!!_.matching_text,tooltip:_.place_type[0]==="reverse"?_.place_name:_.place_name.replace(/,.*/,"")}),b.addFeature(R)}},setSelectedMarker(N){var A,_,R;const C=b.getFeatures(),O=(A=C[0])!=null&&A.getProperties().isReverse?1:0;r>-1&&((_=C[r+O])==null||_.setProperties({isSelected:!1})),N>-1&&((R=C[N+O])==null||R.setProperties({isSelected:!0})),r=N},getCenterAndZoom(){const N=i.getView(),C=N.getCenter(),O=N.getZoom();if(!(!C||O===void 0))return[O,...Ke.toLonLat(C,S())]}}}class as extends $.Control{constructor(t){const n=document.createElement("div");n.className="ol-search";super({element:n,target:t.target});hi(this,fe);hi(this,st);const{flyTo:r,fullGeometryStyle:u,...a}=t;di(this,fe,new Ir({target:n,props:{flyTo:r===void 0?!0:!!r,...a}})),he(this,fe).$on("select",s=>{this.dispatchEvent(new sn(s.detail.feature))}),he(this,fe).$on("pick",s=>{this.dispatchEvent(new an(s.detail.feature))}),he(this,fe).$on("featureslisted",s=>{this.dispatchEvent(new on(s.detail.features))}),he(this,fe).$on("featuresmarked",s=>{this.dispatchEvent(new ln(s.detail.features))}),he(this,fe).$on("response",s=>{this.dispatchEvent(new cn(s.detail.url,s.detail.featureCollection))}),he(this,fe).$on("optionsvisibilitychange",s=>{this.dispatchEvent(new un(s.detail.optionsVisible))}),he(this,fe).$on("reversetoggle",s=>{this.dispatchEvent(new hn(s.detail.reverse))}),he(this,fe).$on("querychange",s=>{this.dispatchEvent(new fn(s.detail.query))}),di(this,st,t)}setMap(t){var n;if(super.setMap(t),t){const{flyTo:r,fullGeometryStyle:u}=he(this,st),a=rn(t,typeof r=="boolean"?void 0:r,typeof r=="boolean"?void 0:r,u);(n=he(this,fe))==null||n.$set({mapController:a})}}setOptions(t){var a;Object.assign(he(this,st),t);const{flyTo:n,fullGeometryStyle:r,...u}=he(this,st);(a=he(this,fe))==null||a.$set({...u,flyTo:n===void 0?!0:!!n})}setQuery(t,n=!0){var r;(r=he(this,fe))==null||r.setQuery(t,n)}clearMap(){var t;(t=he(this,fe))==null||t.clearMap()}clearList(){var t;(t=he(this,fe))==null||t.clearList()}setReverseMode(t){var n;(n=he(this,fe))==null||n.$set({reverseActive:t})}focus(t){var n;(n=he(this,fe))==null||n.focus(t)}blur(){var t;(t=he(this,fe))==null||t.blur()}}fe=new WeakMap,st=new WeakMap;class sn extends te{constructor(t){super("select");P(this,"feature");this.feature=t}}class on extends te{constructor(t){super("featureslisted");P(this,"features");this.features=t}}class ln extends te{constructor(t){super("featuresmarked");P(this,"features");this.features=t}}class un extends te{constructor(t){super("optionsvisibilitychange");P(this,"optionsVisible");this.optionsVisible=t}}class an extends te{constructor(t){super("pick");P(this,"feature");this.feature=t}}class fn extends te{constructor(t){super("querychange");P(this,"query");this.query=t}}class cn extends te{constructor(t,n){super("response");P(this,"url");P(this,"featureCollection");this.url=t,this.featureCollection=n}}class hn extends te{constructor(t){super("reversetoggle");P(this,"reverse");this.reverse=t}}W.FeaturesListedEvent=on,W.FeaturesMarkedEvent=ln,W.GeocodingControl=as,W.OptionsVisibilityChangeEvent=un,W.PickEvent=an,W.QueryChangeEvent=fn,W.ResponseEvent=cn,W.ReverseToggleEvent=hn,W.SelectEvent=sn,W.createOpenLayersMapController=rn,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
|
|
23
2
|
//# sourceMappingURL=openlayers.umd.js.map
|