@maptiler/geocoding-control
Version:
The Javascript & TypeScript Map Control component for MapTiler Geocoding service. Easy to be integrated into any JavaScript mapping application.
1 lines • 52.7 kB
JavaScript
(function(D,V){typeof exports=="object"&&typeof module<"u"?V(exports,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","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"],V):(D=typeof globalThis<"u"?globalThis:D||self,V(D.openlayersMaptilerGeocodingController={},D.ol,D.ol.geom,D.ol.layer.Vector,D.ol.proj,D.ol.source.Vector,D.ol.style.Fill,D.ol.style.Icon,D.ol.style.Stroke,D.ol.style.Style,D.ol.style.Text))})(this,function(D,V,K,lt,he,ut,Fe,ft,De,ht,ct){"use strict";var zt=Object.defineProperty;var Ut=(D,V,K)=>V in D?zt(D,V,{enumerable:!0,configurable:!0,writable:!0,value:K}):D[V]=K;var M=(D,V,K)=>Ut(D,typeof V!="symbol"?V+"":V,K);var rt,st;function xe(i,t,e={}){const n={type:"Feature"};return(e.id===0||e.id)&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.properties=t||{},n.geometry=i,n}function Re(i,t,e={}){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 f=0;f<r[r.length-1].length;f++)if(r[r.length-1][f]!==r[0][f])throw new Error("First and last Position are not equivalent.")}return xe({type:"Polygon",coordinates:i},t,e)}function Oe(i,t={}){const e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=i,e}function ze(i,t,e={}){return xe({type:"MultiPolygon",coordinates:i},t,e)}function Ue(i,t,e){if(i!==null)for(var n,r,f,a,c,E,m,L=0,T=0,b,N=i.type,O=N==="FeatureCollection",P=N==="Feature",A=O?i.features.length:1,X=0;X<A;X++){m=O?i.features[X].geometry:P?i.geometry:i,b=m?m.type==="GeometryCollection":!1,c=b?m.geometries.length:1;for(var S=0;S<c;S++){var q=0,B=0;if(a=b?m.geometries[S]:m,a!==null){E=a.coordinates;var J=a.type;switch(L=0,J){case null:break;case"Point":if(t(E,T,X,q,B)===!1)return!1;T++,q++;break;case"LineString":case"MultiPoint":for(n=0;n<E.length;n++){if(t(E[n],T,X,q,B)===!1)return!1;T++,J==="MultiPoint"&&q++}J==="LineString"&&q++;break;case"Polygon":case"MultiLineString":for(n=0;n<E.length;n++){for(r=0;r<E[n].length-L;r++){if(t(E[n][r],T,X,q,B)===!1)return!1;T++}J==="MultiLineString"&&q++,J==="Polygon"&&B++}J==="Polygon"&&q++;break;case"MultiPolygon":for(n=0;n<E.length;n++){for(B=0,r=0;r<E[n].length;r++){for(f=0;f<E[n][r].length-L;f++){if(t(E[n][r][f],T,X,q,B)===!1)return!1;T++}B++}q++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(Ue(a.geometries[n],t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function _e(i,t){var e,n,r,f,a,c,E,m,L,T,b=0,N=i.type==="FeatureCollection",O=i.type==="Feature",P=N?i.features.length:1;for(e=0;e<P;e++){for(c=N?i.features[e].geometry:O?i.geometry:i,m=N?i.features[e].properties:O?i.properties:{},L=N?i.features[e].bbox:O?i.bbox:void 0,T=N?i.features[e].id:O?i.id:void 0,E=c?c.type==="GeometryCollection":!1,a=E?c.geometries.length:1,r=0;r<a;r++){if(f=E?c.geometries[r]:c,f===null){if(t(null,b,m,L,T)===!1)return!1;continue}switch(f.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(f,b,m,L,T)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<f.geometries.length;n++)if(t(f.geometries[n],b,m,L,T)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}b++}}function at(i,t){_e(i,function(e,n,r,f,a){var c=e===null?null:e.type;switch(c){case null:case"Point":case"LineString":case"Polygon":return t(xe(e,r,{bbox:f,id:a}),n,0)===!1?!1:void 0}var E;switch(c){case"MultiPoint":E="Point";break;case"MultiLineString":E="LineString";break;case"MultiPolygon":E="Polygon";break}for(var m=0;m<e.coordinates.length;m++){var L=e.coordinates[m],T={type:E,coordinates:L};if(t(xe(T,r),n,m)===!1)return!1}})}function pt(i,t={}){if(i.bbox!=null&&t.recompute!==!0)return i.bbox;const e=[1/0,1/0,-1/0,-1/0];return Ue(i,n=>{e[0]>n[0]&&(e[0]=n[0]),e[1]>n[1]&&(e[1]=n[1]),e[2]<n[0]&&(e[2]=n[0]),e[3]<n[1]&&(e[3]=n[1])}),e}var Ve=pt,gt=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Ce=Math.ceil,Q=Math.floor,Z="[BigNumber Error] ",$e=Z+"Number primitive has more than 15 significant digits: ",ne=1e14,C=14,Ke=9007199254740991,Ne=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],ce=1e7,H=1e9;function Xe(i){var t,e,n,r=S.prototype={constructor:S,toString:null,valueOf:null},f=new S(1),a=20,c=4,E=-7,m=21,L=-1e7,T=1e7,b=!1,N=1,O=0,P={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},A="0123456789abcdefghijklmnopqrstuvwxyz",X=!0;function S(s,o){var l,d,h,g,w,u,p,x,y=this;if(!(y instanceof S))return new S(s,o);if(o==null){if(s&&s._isBigNumber===!0){y.s=s.s,!s.c||s.e>T?y.c=y.e=null:s.e<L?y.c=[y.e=0]:(y.e=s.e,y.c=s.c.slice());return}if((u=typeof s=="number")&&s*0==0){if(y.s=1/s<0?(s=-s,-1):1,s===~~s){for(g=0,w=s;w>=10;w/=10,g++);g>T?y.c=y.e=null:(y.e=g,y.c=[s]);return}x=String(s)}else{if(!gt.test(x=String(s)))return n(y,x,u);y.s=x.charCodeAt(0)==45?(x=x.slice(1),-1):1}(g=x.indexOf("."))>-1&&(x=x.replace(".","")),(w=x.search(/e/i))>0?(g<0&&(g=w),g+=+x.slice(w+1),x=x.substring(0,w)):g<0&&(g=x.length)}else{if(F(o,2,A.length,"Base"),o==10&&X)return y=new S(s),te(y,a+y.e+1,c);if(x=String(s),u=typeof s=="number"){if(s*0!=0)return n(y,x,u,o);if(y.s=1/s<0?(x=x.slice(1),-1):1,S.DEBUG&&x.replace(/^0\.0*|\./,"").length>15)throw Error($e+s)}else y.s=x.charCodeAt(0)===45?(x=x.slice(1),-1):1;for(l=A.slice(0,o),g=w=0,p=x.length;w<p;w++)if(l.indexOf(d=x.charAt(w))<0){if(d=="."){if(w>g){g=p;continue}}else if(!h&&(x==x.toUpperCase()&&(x=x.toLowerCase())||x==x.toLowerCase()&&(x=x.toUpperCase()))){h=!0,w=-1,g=0;continue}return n(y,String(s),u,o)}u=!1,x=e(x,o,10,y.s),(g=x.indexOf("."))>-1?x=x.replace(".",""):g=x.length}for(w=0;x.charCodeAt(w)===48;w++);for(p=x.length;x.charCodeAt(--p)===48;);if(x=x.slice(w,++p)){if(p-=w,u&&S.DEBUG&&p>15&&(s>Ke||s!==Q(s)))throw Error($e+y.s*s);if((g=g-w-1)>T)y.c=y.e=null;else if(g<L)y.c=[y.e=0];else{if(y.e=g,y.c=[],w=(g+1)%C,g<0&&(w+=C),w<p){for(w&&y.c.push(+x.slice(0,w)),p-=C;w<p;)y.c.push(+x.slice(w,w+=C));w=C-(x=x.slice(w)).length}else w-=p;for(;w--;x+="0");y.c.push(+x)}}else y.c=[y.e=0]}S.clone=Xe,S.ROUND_UP=0,S.ROUND_DOWN=1,S.ROUND_CEIL=2,S.ROUND_FLOOR=3,S.ROUND_HALF_UP=4,S.ROUND_HALF_DOWN=5,S.ROUND_HALF_EVEN=6,S.ROUND_HALF_CEIL=7,S.ROUND_HALF_FLOOR=8,S.EUCLID=9,S.config=S.set=function(s){var o,l;if(s!=null)if(typeof s=="object"){if(s.hasOwnProperty(o="DECIMAL_PLACES")&&(l=s[o],F(l,0,H,o),a=l),s.hasOwnProperty(o="ROUNDING_MODE")&&(l=s[o],F(l,0,8,o),c=l),s.hasOwnProperty(o="EXPONENTIAL_AT")&&(l=s[o],l&&l.pop?(F(l[0],-1e9,0,o),F(l[1],0,H,o),E=l[0],m=l[1]):(F(l,-1e9,H,o),E=-(m=l<0?-l:l))),s.hasOwnProperty(o="RANGE"))if(l=s[o],l&&l.pop)F(l[0],-1e9,-1,o),F(l[1],1,H,o),L=l[0],T=l[1];else if(F(l,-1e9,H,o),l)L=-(T=l<0?-l:l);else throw Error(Z+o+" cannot be zero: "+l);if(s.hasOwnProperty(o="CRYPTO"))if(l=s[o],l===!!l)if(l)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))b=l;else throw b=!l,Error(Z+"crypto unavailable");else b=l;else throw Error(Z+o+" not true or false: "+l);if(s.hasOwnProperty(o="MODULO_MODE")&&(l=s[o],F(l,0,9,o),N=l),s.hasOwnProperty(o="POW_PRECISION")&&(l=s[o],F(l,0,H,o),O=l),s.hasOwnProperty(o="FORMAT"))if(l=s[o],typeof l=="object")P=l;else throw Error(Z+o+" not an object: "+l);if(s.hasOwnProperty(o="ALPHABET"))if(l=s[o],typeof l=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(l))X=l.slice(0,10)=="0123456789",A=l;else throw Error(Z+o+" invalid: "+l)}else throw Error(Z+"Object expected: "+s);return{DECIMAL_PLACES:a,ROUNDING_MODE:c,EXPONENTIAL_AT:[E,m],RANGE:[L,T],CRYPTO:b,MODULO_MODE:N,POW_PRECISION:O,FORMAT:P,ALPHABET:A}},S.isBigNumber=function(s){if(!s||s._isBigNumber!==!0)return!1;if(!S.DEBUG)return!0;var o,l,d=s.c,h=s.e,g=s.s;e:if({}.toString.call(d)=="[object Array]"){if((g===1||g===-1)&&h>=-1e9&&h<=H&&h===Q(h)){if(d[0]===0){if(h===0&&d.length===1)return!0;break e}if(o=(h+1)%C,o<1&&(o+=C),String(d[0]).length==o){for(o=0;o<d.length;o++)if(l=d[o],l<0||l>=ne||l!==Q(l))break e;if(l!==0)return!0}}}else if(d===null&&h===null&&(g===null||g===1||g===-1))return!0;throw Error(Z+"Invalid BigNumber: "+s)},S.maximum=S.max=function(){return B(arguments,-1)},S.minimum=S.min=function(){return B(arguments,1)},S.random=function(){var s=9007199254740992,o=Math.random()*s&2097151?function(){return Q(Math.random()*s)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(l){var d,h,g,w,u,p=0,x=[],y=new S(f);if(l==null?l=a:F(l,0,H),w=Ce(l/C),b)if(crypto.getRandomValues){for(d=crypto.getRandomValues(new Uint32Array(w*=2));p<w;)u=d[p]*131072+(d[p+1]>>>11),u>=9e15?(h=crypto.getRandomValues(new Uint32Array(2)),d[p]=h[0],d[p+1]=h[1]):(x.push(u%1e14),p+=2);p=w/2}else if(crypto.randomBytes){for(d=crypto.randomBytes(w*=7);p<w;)u=(d[p]&31)*281474976710656+d[p+1]*1099511627776+d[p+2]*4294967296+d[p+3]*16777216+(d[p+4]<<16)+(d[p+5]<<8)+d[p+6],u>=9e15?crypto.randomBytes(7).copy(d,p):(x.push(u%1e14),p+=7);p=w/7}else throw b=!1,Error(Z+"crypto unavailable");if(!b)for(;p<w;)u=o(),u<9e15&&(x[p++]=u%1e14);for(w=x[--p],l%=C,w&&l&&(u=Ne[C-l],x[p]=Q(w/u)*u);x[p]===0;x.pop(),p--);if(p<0)x=[g=0];else{for(g=-1;x[0]===0;x.splice(0,1),g-=C);for(p=1,u=x[0];u>=10;u/=10,p++);p<C&&(g-=C-p)}return y.e=g,y.c=x,y}}(),S.sum=function(){for(var s=1,o=arguments,l=new S(o[0]);s<o.length;)l=l.plus(o[s++]);return l},e=function(){var s="0123456789";function o(l,d,h,g){for(var w,u=[0],p,x=0,y=l.length;x<y;){for(p=u.length;p--;u[p]*=d);for(u[0]+=g.indexOf(l.charAt(x++)),w=0;w<u.length;w++)u[w]>h-1&&(u[w+1]==null&&(u[w+1]=0),u[w+1]+=u[w]/h|0,u[w]%=h)}return u.reverse()}return function(l,d,h,g,w){var u,p,x,y,v,R,_,k,z=l.indexOf("."),$=a,I=c;for(z>=0&&(y=O,O=0,l=l.replace(".",""),k=new S(d),R=k.pow(l.length-z),O=y,k.c=o(le(ee(R.c),R.e,"0"),10,h,s),k.e=k.c.length),_=o(l,d,h,w?(u=A,s):(u=s,A)),x=y=_.length;_[--y]==0;_.pop());if(!_[0])return u.charAt(0);if(z<0?--x:(R.c=_,R.e=x,R.s=g,R=t(R,k,$,I,h),_=R.c,v=R.r,x=R.e),p=x+$+1,z=_[p],y=h/2,v=v||p<0||_[p+1]!=null,v=I<4?(z!=null||v)&&(I==0||I==(R.s<0?3:2)):z>y||z==y&&(I==4||v||I==6&&_[p-1]&1||I==(R.s<0?8:7)),p<1||!_[0])l=v?le(u.charAt(1),-$,u.charAt(0)):u.charAt(0);else{if(_.length=p,v)for(--h;++_[--p]>h;)_[p]=0,p||(++x,_=[1].concat(_));for(y=_.length;!_[--y];);for(z=0,l="";z<=y;l+=u.charAt(_[z++]));l=le(l,x,u.charAt(0))}return l}}(),t=function(){function s(d,h,g){var w,u,p,x,y=0,v=d.length,R=h%ce,_=h/ce|0;for(d=d.slice();v--;)p=d[v]%ce,x=d[v]/ce|0,w=_*p+x*R,u=R*p+w%ce*ce+y,y=(u/g|0)+(w/ce|0)+_*x,d[v]=u%g;return y&&(d=[y].concat(d)),d}function o(d,h,g,w){var u,p;if(g!=w)p=g>w?1:-1;else for(u=p=0;u<g;u++)if(d[u]!=h[u]){p=d[u]>h[u]?1:-1;break}return p}function l(d,h,g,w){for(var u=0;g--;)d[g]-=u,u=d[g]<h[g]?1:0,d[g]=u*w+d[g]-h[g];for(;!d[0]&&d.length>1;d.splice(0,1));}return function(d,h,g,w,u){var p,x,y,v,R,_,k,z,$,I,G,W,Pe,Be,Ge,oe,de,ie=d.s==h.s?1:-1,Y=d.c,U=h.c;if(!Y||!Y[0]||!U||!U[0])return new S(!d.s||!h.s||(Y?U&&Y[0]==U[0]:!U)?NaN:Y&&Y[0]==0||!U?ie*0:ie/0);for(z=new S(ie),$=z.c=[],x=d.e-h.e,ie=g+x+1,u||(u=ne,x=j(d.e/C)-j(h.e/C),ie=ie/C|0),y=0;U[y]==(Y[y]||0);y++);if(U[y]>(Y[y]||0)&&x--,ie<0)$.push(1),v=!0;else{for(Be=Y.length,oe=U.length,y=0,ie+=2,R=Q(u/(U[0]+1)),R>1&&(U=s(U,R,u),Y=s(Y,R,u),oe=U.length,Be=Y.length),Pe=oe,I=Y.slice(0,oe),G=I.length;G<oe;I[G++]=0);de=U.slice(),de=[0].concat(de),Ge=U[0],U[1]>=u/2&&Ge++;do{if(R=0,p=o(U,I,oe,G),p<0){if(W=I[0],oe!=G&&(W=W*u+(I[1]||0)),R=Q(W/Ge),R>1)for(R>=u&&(R=u-1),_=s(U,R,u),k=_.length,G=I.length;o(_,I,k,G)==1;)R--,l(_,oe<k?de:U,k,u),k=_.length,p=1;else R==0&&(p=R=1),_=U.slice(),k=_.length;if(k<G&&(_=[0].concat(_)),l(I,_,G,u),G=I.length,p==-1)for(;o(U,I,oe,G)<1;)R++,l(I,oe<G?de:U,G,u),G=I.length}else p===0&&(R++,I=[0]);$[y++]=R,I[0]?I[G++]=Y[Pe]||0:(I=[Y[Pe]],G=1)}while((Pe++<Be||I[0]!=null)&&ie--);v=I[0]!=null,$[0]||$.splice(0,1)}if(u==ne){for(y=1,ie=$[0];ie>=10;ie/=10,y++);te(z,g+(z.e=y+x*C-1)+1,w,v)}else z.e=x,z.r=+v;return z}}();function q(s,o,l,d){var h,g,w,u,p;if(l==null?l=c:F(l,0,8),!s.c)return s.toString();if(h=s.c[0],w=s.e,o==null)p=ee(s.c),p=d==1||d==2&&(w<=E||w>=m)?Ee(p,w):le(p,w,"0");else if(s=te(new S(s),o,l),g=s.e,p=ee(s.c),u=p.length,d==1||d==2&&(o<=g||g<=E)){for(;u<o;p+="0",u++);p=Ee(p,g)}else if(o-=w,p=le(p,g,"0"),g+1>u){if(--o>0)for(p+=".";o--;p+="0");}else if(o+=g-u,o>0)for(g+1==u&&(p+=".");o--;p+="0");return s.s<0&&h?"-"+p:p}function B(s,o){for(var l,d,h=1,g=new S(s[0]);h<s.length;h++)d=new S(s[h]),(!d.s||(l=ae(g,d))===o||l===0&&g.s===o)&&(g=d);return g}function J(s,o,l){for(var d=1,h=o.length;!o[--h];o.pop());for(h=o[0];h>=10;h/=10,d++);return(l=d+l*C-1)>T?s.c=s.e=null:l<L?s.c=[s.e=0]:(s.e=l,s.c=o),s}n=function(){var s=/^(-?)0([xbo])(?=\w[\w.]*$)/i,o=/^([^.]+)\.$/,l=/^\.([^.]+)$/,d=/^-?(Infinity|NaN)$/,h=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(g,w,u,p){var x,y=u?w:w.replace(h,"");if(d.test(y))g.s=isNaN(y)?null:y<0?-1:1;else{if(!u&&(y=y.replace(s,function(v,R,_){return x=(_=_.toLowerCase())=="x"?16:_=="b"?2:8,!p||p==x?R:v}),p&&(x=p,y=y.replace(o,"$1").replace(l,"0.$1")),w!=y))return new S(y,x);if(S.DEBUG)throw Error(Z+"Not a"+(p?" base "+p:"")+" number: "+w);g.s=null}g.c=g.e=null}}();function te(s,o,l,d){var h,g,w,u,p,x,y,v=s.c,R=Ne;if(v){e:{for(h=1,u=v[0];u>=10;u/=10,h++);if(g=o-h,g<0)g+=C,w=o,p=v[x=0],y=Q(p/R[h-w-1]%10);else if(x=Ce((g+1)/C),x>=v.length)if(d){for(;v.length<=x;v.push(0));p=y=0,h=1,g%=C,w=g-C+1}else break e;else{for(p=u=v[x],h=1;u>=10;u/=10,h++);g%=C,w=g-C+h,y=w<0?0:Q(p/R[h-w-1]%10)}if(d=d||o<0||v[x+1]!=null||(w<0?p:p%R[h-w-1]),d=l<4?(y||d)&&(l==0||l==(s.s<0?3:2)):y>5||y==5&&(l==4||d||l==6&&(g>0?w>0?p/R[h-w]:0:v[x-1])%10&1||l==(s.s<0?8:7)),o<1||!v[0])return v.length=0,d?(o-=s.e+1,v[0]=R[(C-o%C)%C],s.e=-o||0):v[0]=s.e=0,s;if(g==0?(v.length=x,u=1,x--):(v.length=x+1,u=R[C-g],v[x]=w>0?Q(p/R[h-w]%R[w])*u:0),d)for(;;)if(x==0){for(g=1,w=v[0];w>=10;w/=10,g++);for(w=v[0]+=u,u=1;w>=10;w/=10,u++);g!=u&&(s.e++,v[0]==ne&&(v[0]=1));break}else{if(v[x]+=u,v[x]!=ne)break;v[x--]=0,u=1}for(g=v.length;v[--g]===0;v.pop());}s.e>T?s.c=s.e=null:s.e<L&&(s.c=[s.e=0])}return s}function fe(s){var o,l=s.e;return l===null?s.toString():(o=ee(s.c),o=l<=E||l>=m?Ee(o,l):le(o,l,"0"),s.s<0?"-"+o:o)}return r.absoluteValue=r.abs=function(){var s=new S(this);return s.s<0&&(s.s=1),s},r.comparedTo=function(s,o){return ae(this,new S(s,o))},r.decimalPlaces=r.dp=function(s,o){var l,d,h,g=this;if(s!=null)return F(s,0,H),o==null?o=c:F(o,0,8),te(new S(g),s+g.e+1,o);if(!(l=g.c))return null;if(d=((h=l.length-1)-j(this.e/C))*C,h=l[h])for(;h%10==0;h/=10,d--);return d<0&&(d=0),d},r.dividedBy=r.div=function(s,o){return t(this,new S(s,o),a,c)},r.dividedToIntegerBy=r.idiv=function(s,o){return t(this,new S(s,o),0,1)},r.exponentiatedBy=r.pow=function(s,o){var l,d,h,g,w,u,p,x,y,v=this;if(s=new S(s),s.c&&!s.isInteger())throw Error(Z+"Exponent not an integer: "+fe(s));if(o!=null&&(o=new S(o)),u=s.e>14,!v.c||!v.c[0]||v.c[0]==1&&!v.e&&v.c.length==1||!s.c||!s.c[0])return y=new S(Math.pow(+fe(v),u?s.s*(2-we(s)):+fe(s))),o?y.mod(o):y;if(p=s.s<0,o){if(o.c?!o.c[0]:!o.s)return new S(NaN);d=!p&&v.isInteger()&&o.isInteger(),d&&(v=v.mod(o))}else{if(s.e>9&&(v.e>0||v.e<-1||(v.e==0?v.c[0]>1||u&&v.c[1]>=24e7:v.c[0]<8e13||u&&v.c[0]<=9999975e7)))return g=v.s<0&&we(s)?-0:0,v.e>-1&&(g=1/g),new S(p?1/g:g);O&&(g=Ce(O/C+2))}for(u?(l=new S(.5),p&&(s.s=1),x=we(s)):(h=Math.abs(+fe(s)),x=h%2),y=new S(f);;){if(x){if(y=y.times(v),!y.c)break;g?y.c.length>g&&(y.c.length=g):d&&(y=y.mod(o))}if(h){if(h=Q(h/2),h===0)break;x=h%2}else if(s=s.times(l),te(s,s.e+1,1),s.e>14)x=we(s);else{if(h=+fe(s),h===0)break;x=h%2}v=v.times(v),g?v.c&&v.c.length>g&&(v.c.length=g):d&&(v=v.mod(o))}return d?y:(p&&(y=f.div(y)),o?y.mod(o):g?te(y,O,c,w):y)},r.integerValue=function(s){var o=new S(this);return s==null?s=c:F(s,0,8),te(o,o.e+1,s)},r.isEqualTo=r.eq=function(s,o){return ae(this,new S(s,o))===0},r.isFinite=function(){return!!this.c},r.isGreaterThan=r.gt=function(s,o){return ae(this,new S(s,o))>0},r.isGreaterThanOrEqualTo=r.gte=function(s,o){return(o=ae(this,new S(s,o)))===1||o===0},r.isInteger=function(){return!!this.c&&j(this.e/C)>this.c.length-2},r.isLessThan=r.lt=function(s,o){return ae(this,new S(s,o))<0},r.isLessThanOrEqualTo=r.lte=function(s,o){return(o=ae(this,new S(s,o)))===-1||o===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(s,o){var l,d,h,g,w=this,u=w.s;if(s=new S(s,o),o=s.s,!u||!o)return new S(NaN);if(u!=o)return s.s=-o,w.plus(s);var p=w.e/C,x=s.e/C,y=w.c,v=s.c;if(!p||!x){if(!y||!v)return y?(s.s=-o,s):new S(v?w:NaN);if(!y[0]||!v[0])return v[0]?(s.s=-o,s):new S(y[0]?w:c==3?-0:0)}if(p=j(p),x=j(x),y=y.slice(),u=p-x){for((g=u<0)?(u=-u,h=y):(x=p,h=v),h.reverse(),o=u;o--;h.push(0));h.reverse()}else for(d=(g=(u=y.length)<(o=v.length))?u:o,u=o=0;o<d;o++)if(y[o]!=v[o]){g=y[o]<v[o];break}if(g&&(h=y,y=v,v=h,s.s=-s.s),o=(d=v.length)-(l=y.length),o>0)for(;o--;y[l++]=0);for(o=ne-1;d>u;){if(y[--d]<v[d]){for(l=d;l&&!y[--l];y[l]=o);--y[l],y[d]+=ne}y[d]-=v[d]}for(;y[0]==0;y.splice(0,1),--x);return y[0]?J(s,y,x):(s.s=c==3?-1:1,s.c=[s.e=0],s)},r.modulo=r.mod=function(s,o){var l,d,h=this;return s=new S(s,o),!h.c||!s.s||s.c&&!s.c[0]?new S(NaN):!s.c||h.c&&!h.c[0]?new S(h):(N==9?(d=s.s,s.s=1,l=t(h,s,0,3),s.s=d,l.s*=d):l=t(h,s,0,N),s=h.minus(l.times(s)),!s.c[0]&&N==1&&(s.s=h.s),s)},r.multipliedBy=r.times=function(s,o){var l,d,h,g,w,u,p,x,y,v,R,_,k,z,$,I=this,G=I.c,W=(s=new S(s,o)).c;if(!G||!W||!G[0]||!W[0])return!I.s||!s.s||G&&!G[0]&&!W||W&&!W[0]&&!G?s.c=s.e=s.s=null:(s.s*=I.s,!G||!W?s.c=s.e=null:(s.c=[0],s.e=0)),s;for(d=j(I.e/C)+j(s.e/C),s.s*=I.s,p=G.length,v=W.length,p<v&&(k=G,G=W,W=k,h=p,p=v,v=h),h=p+v,k=[];h--;k.push(0));for(z=ne,$=ce,h=v;--h>=0;){for(l=0,R=W[h]%$,_=W[h]/$|0,w=p,g=h+w;g>h;)x=G[--w]%$,y=G[w]/$|0,u=_*x+y*R,x=R*x+u%$*$+k[g]+l,l=(x/z|0)+(u/$|0)+_*y,k[g--]=x%z;k[g]=l}return l?++d:k.splice(0,1),J(s,k,d)},r.negated=function(){var s=new S(this);return s.s=-s.s||null,s},r.plus=function(s,o){var l,d=this,h=d.s;if(s=new S(s,o),o=s.s,!h||!o)return new S(NaN);if(h!=o)return s.s=-o,d.minus(s);var g=d.e/C,w=s.e/C,u=d.c,p=s.c;if(!g||!w){if(!u||!p)return new S(h/0);if(!u[0]||!p[0])return p[0]?s:new S(u[0]?d:h*0)}if(g=j(g),w=j(w),u=u.slice(),h=g-w){for(h>0?(w=g,l=p):(h=-h,l=u),l.reverse();h--;l.push(0));l.reverse()}for(h=u.length,o=p.length,h-o<0&&(l=p,p=u,u=l,o=h),h=0;o;)h=(u[--o]=u[o]+p[o]+h)/ne|0,u[o]=ne===u[o]?0:u[o]%ne;return h&&(u=[h].concat(u),++w),J(s,u,w)},r.precision=r.sd=function(s,o){var l,d,h,g=this;if(s!=null&&s!==!!s)return F(s,1,H),o==null?o=c:F(o,0,8),te(new S(g),s,o);if(!(l=g.c))return null;if(h=l.length-1,d=h*C+1,h=l[h]){for(;h%10==0;h/=10,d--);for(h=l[0];h>=10;h/=10,d++);}return s&&g.e+1>d&&(d=g.e+1),d},r.shiftedBy=function(s){return F(s,-9007199254740991,Ke),this.times("1e"+s)},r.squareRoot=r.sqrt=function(){var s,o,l,d,h,g=this,w=g.c,u=g.s,p=g.e,x=a+4,y=new S("0.5");if(u!==1||!w||!w[0])return new S(!u||u<0&&(!w||w[0])?NaN:w?g:1/0);if(u=Math.sqrt(+fe(g)),u==0||u==1/0?(o=ee(w),(o.length+p)%2==0&&(o+="0"),u=Math.sqrt(+o),p=j((p+1)/2)-(p<0||p%2),u==1/0?o="5e"+p:(o=u.toExponential(),o=o.slice(0,o.indexOf("e")+1)+p),l=new S(o)):l=new S(u+""),l.c[0]){for(p=l.e,u=p+x,u<3&&(u=0);;)if(h=l,l=y.times(h.plus(t(g,h,x,1))),ee(h.c).slice(0,u)===(o=ee(l.c)).slice(0,u))if(l.e<p&&--u,o=o.slice(u-3,u+1),o=="9999"||!d&&o=="4999"){if(!d&&(te(h,h.e+a+2,0),h.times(h).eq(g))){l=h;break}x+=4,u+=4,d=1}else{(!+o||!+o.slice(1)&&o.charAt(0)=="5")&&(te(l,l.e+a+2,1),s=!l.times(l).eq(g));break}}return te(l,l.e+a+1,c,s)},r.toExponential=function(s,o){return s!=null&&(F(s,0,H),s++),q(this,s,o,1)},r.toFixed=function(s,o){return s!=null&&(F(s,0,H),s=s+this.e+1),q(this,s,o)},r.toFormat=function(s,o,l){var d,h=this;if(l==null)s!=null&&o&&typeof o=="object"?(l=o,o=null):s&&typeof s=="object"?(l=s,s=o=null):l=P;else if(typeof l!="object")throw Error(Z+"Argument not an object: "+l);if(d=h.toFixed(s,o),h.c){var g,w=d.split("."),u=+l.groupSize,p=+l.secondaryGroupSize,x=l.groupSeparator||"",y=w[0],v=w[1],R=h.s<0,_=R?y.slice(1):y,k=_.length;if(p&&(g=u,u=p,p=g,k-=g),u>0&&k>0){for(g=k%u||u,y=_.substr(0,g);g<k;g+=u)y+=x+_.substr(g,u);p>0&&(y+=x+_.slice(g)),R&&(y="-"+y)}d=v?y+(l.decimalSeparator||"")+((p=+l.fractionGroupSize)?v.replace(new RegExp("\\d{"+p+"}\\B","g"),"$&"+(l.fractionGroupSeparator||"")):v):y}return(l.prefix||"")+d+(l.suffix||"")},r.toFraction=function(s){var o,l,d,h,g,w,u,p,x,y,v,R,_=this,k=_.c;if(s!=null&&(u=new S(s),!u.isInteger()&&(u.c||u.s!==1)||u.lt(f)))throw Error(Z+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+fe(u));if(!k)return new S(_);for(o=new S(f),x=l=new S(f),d=p=new S(f),R=ee(k),g=o.e=R.length-_.e-1,o.c[0]=Ne[(w=g%C)<0?C+w:w],s=!s||u.comparedTo(o)>0?g>0?o:x:u,w=T,T=1/0,u=new S(R),p.c[0]=0;y=t(u,o,0,1),h=l.plus(y.times(d)),h.comparedTo(s)!=1;)l=d,d=h,x=p.plus(y.times(h=x)),p=h,o=u.minus(y.times(h=o)),u=h;return h=t(s.minus(l),d,0,1),p=p.plus(h.times(x)),l=l.plus(h.times(d)),p.s=x.s=_.s,g=g*2,v=t(x,d,g,c).minus(_).abs().comparedTo(t(p,l,g,c).minus(_).abs())<1?[x,d]:[p,l],T=w,v},r.toNumber=function(){return+fe(this)},r.toPrecision=function(s,o){return s!=null&&F(s,1,H),q(this,s,o,2)},r.toString=function(s){var o,l=this,d=l.s,h=l.e;return h===null?d?(o="Infinity",d<0&&(o="-"+o)):o="NaN":(s==null?o=h<=E||h>=m?Ee(ee(l.c),h):le(ee(l.c),h,"0"):s===10&&X?(l=te(new S(l),a+h+1,c),o=le(ee(l.c),l.e,"0")):(F(s,2,A.length,"Base"),o=e(le(ee(l.c),h,"0"),10,s,d,!0)),d<0&&l.c[0]&&(o="-"+o)),o},r.valueOf=r.toJSON=function(){return fe(this)},r._isBigNumber=!0,r[Symbol.toStringTag]="BigNumber",r[Symbol.for("nodejs.util.inspect.custom")]=r.valueOf,i!=null&&S.set(i),S}function j(i){var t=i|0;return i>0||i===t?t:t-1}function ee(i){for(var t,e,n=1,r=i.length,f=i[0]+"";n<r;){for(t=i[n++]+"",e=C-t.length;e--;t="0"+t);f+=t}for(r=f.length;f.charCodeAt(--r)===48;);return f.slice(0,r+1||1)}function ae(i,t){var e,n,r=i.c,f=t.c,a=i.s,c=t.s,E=i.e,m=t.e;if(!a||!c)return null;if(e=r&&!r[0],n=f&&!f[0],e||n)return e?n?0:-c:a;if(a!=c)return a;if(e=a<0,n=E==m,!r||!f)return n?0:!r^e?1:-1;if(!n)return E>m^e?1:-1;for(c=(E=r.length)<(m=f.length)?E:m,a=0;a<c;a++)if(r[a]!=f[a])return r[a]>f[a]^e?1:-1;return E==m?0:E>m^e?1:-1}function F(i,t,e,n){if(i<t||i>e||i!==Q(i))throw Error(Z+(n||"Argument")+(typeof i=="number"?i<t||i>e?" out of range: ":" not an integer: ":" not a primitive number: ")+String(i))}function we(i){var t=i.c.length-1;return j(i.e/C)==t&&i.c[t]%2!=0}function Ee(i,t){return(i.length>1?i.charAt(0)+"."+i.slice(1):i)+(t<0?"e":"e+")+t}function le(i,t,e){var n,r;if(t<0){for(r=e+".";++t;r+=e);i=r+i}else if(n=i.length,++t>n){for(r=e,t-=n;--t;r+=e);i+=r}else t<n&&(i=i.slice(0,t)+"."+i.slice(t));return i}var re=Xe(),yt=class{constructor(i){M(this,"key");M(this,"left",null);M(this,"right",null);this.key=i}},pe=class extends yt{constructor(i){super(i)}},dt=class{constructor(){M(this,"size",0);M(this,"modificationCount",0);M(this,"splayCount",0)}splay(i){const t=this.root;if(t==null)return this.compare(i,i),-1;let e=null,n=null,r=null,f=null,a=t;const c=this.compare;let E;for(;;)if(E=c(a.key,i),E>0){let m=a.left;if(m==null||(E=c(m.key,i),E>0&&(a.left=m.right,m.right=a,a=m,m=a.left,m==null)))break;e==null?n=a:e.left=a,e=a,a=m}else if(E<0){let m=a.right;if(m==null||(E=c(m.key,i),E<0&&(a.right=m.left,m.left=a,a=m,m=a.right,m==null)))break;r==null?f=a:r.right=a,r=a,a=m}else break;return r!=null&&(r.right=a.left,a.left=f),e!=null&&(e.left=a.right,a.right=n),this.root!==a&&(this.root=a,this.splayCount++),E}splayMin(i){let t=i,e=t.left;for(;e!=null;){const n=e;t.left=n.right,n.right=t,t=n,e=t.left}return t}splayMax(i){let t=i,e=t.right;for(;e!=null;){const n=e;t.right=n.left,n.left=t,t=n,e=t.right}return t}_delete(i){if(this.root==null||this.splay(i)!=0)return null;let e=this.root;const n=e,r=e.left;if(this.size--,r==null)this.root=e.right;else{const f=e.right;e=this.splayMax(r),e.right=f,this.root=e}return this.modificationCount++,n}addNewRoot(i,t){this.size++,this.modificationCount++;const e=this.root;if(e==null){this.root=i;return}t<0?(i.left=e,i.right=e.right,e.right=null):(i.right=e,i.left=e.left,e.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,t)=>i<t?-1:i>t?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)}}},Se=class me extends dt{constructor(e,n){super();M(this,"root",null);M(this,"compare");M(this,"validKey");M(this,rt,"[object Set]");this.compare=e??this.defaultCompare(),this.validKey=n??(r=>r!=null&&r!=null)}delete(e){return this.validKey(e)?this._delete(e)!=null:!1}deleteAll(e){for(const n of e)this.delete(n)}forEach(e){const n=this[Symbol.iterator]();let r;for(;r=n.next(),!r.done;)e(r.value,r.value,this)}add(e){const n=this.splay(e);return n!=0&&this.addNewRoot(new pe(e),n),this}addAndReturn(e){const n=this.splay(e);return n!=0&&this.addNewRoot(new pe(e),n),this.root.key}addAll(e){for(const n of e)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(e){if(e==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(e)<0)return this.root.key;let r=this.root.left;if(r==null)return null;let f=r.right;for(;f!=null;)r=f,f=r.right;return r.key}firstAfter(e){if(e==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(e)>0)return this.root.key;let r=this.root.right;if(r==null)return null;let f=r.left;for(;f!=null;)r=f,f=r.left;return r.key}retainAll(e){const n=new me(this.compare,this.validKey),r=this.modificationCount;for(const f of e){if(r!=this.modificationCount)throw"Concurrent modification during iteration.";this.validKey(f)&&this.splay(f)==0&&n.add(this.root.key)}n.size!=this.size&&(this.root=n.root,this.size=n.size,this.modificationCount++)}lookup(e){return!this.validKey(e)||this.splay(e)!=0?null:this.root.key}intersection(e){const n=new me(this.compare,this.validKey);for(const r of this)e.has(r)&&n.add(r);return n}difference(e){const n=new me(this.compare,this.validKey);for(const r of this)e.has(r)||n.add(r);return n}union(e){const n=this.clone();return n.addAll(e),n}clone(){const e=new me(this.compare,this.validKey);return e.size=this.size,e.root=this.copyNode(this.root),e}copyNode(e){if(e==null)return null;function n(f,a){let c,E;do{if(c=f.left,E=f.right,c!=null){const m=new pe(c.key);a.left=m,n(c,m)}if(E!=null){const m=new pe(E.key);a.right=m,f=E,a=m}}while(E!=null)}const r=new pe(e.key);return n(e,r),r}toSet(){return this.clone()}entries(){return new xt(this.wrap())}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}[(st=Symbol.iterator,rt=Symbol.toStringTag,st)](){return new mt(this.wrap())}},We=class{constructor(i){M(this,"tree");M(this,"path",new Array);M(this,"modificationCount",null);M(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 e=this.tree.getRoot();for(;e!=null;)this.path.push(e),e=e.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],t=i.right;if(t!=null){for(;t!=null;)this.path.push(t),t=t.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}},mt=class extends We{getValue(i){return i.key}},xt=class extends We{getValue(i){return[i.key,i.key]}},Ye=i=>()=>i,Ae=i=>{const t=i?(e,n)=>n.minus(e).abs().isLessThanOrEqualTo(i):Ye(!1);return(e,n)=>t(e,n)?0:e.comparedTo(n)};function wt(i){const t=i?(e,n,r,f,a)=>e.exponentiatedBy(2).isLessThanOrEqualTo(f.minus(n).exponentiatedBy(2).plus(a.minus(r).exponentiatedBy(2)).times(i)):Ye(!1);return(e,n,r)=>{const f=e.x,a=e.y,c=r.x,E=r.y,m=a.minus(E).times(n.x.minus(c)).minus(f.minus(c).times(n.y.minus(E)));return t(m,f,a,c,E)?0:m.comparedTo(0)}}var Et=i=>i,St=i=>{if(i){const t=new Se(Ae(i)),e=new Se(Ae(i)),n=(f,a)=>a.addAndReturn(f),r=f=>({x:n(f.x,t),y:n(f.y,e)});return r({x:new re(0),y:new re(0)}),r}return Et},Ie=i=>({set:t=>{ue=Ie(t)},reset:()=>Ie(i),compare:Ae(i),snap:St(i),orient:wt(i)}),ue=Ie(),ge=(i,t)=>i.ll.x.isLessThanOrEqualTo(t.x)&&t.x.isLessThanOrEqualTo(i.ur.x)&&i.ll.y.isLessThanOrEqualTo(t.y)&&t.y.isLessThanOrEqualTo(i.ur.y),ke=(i,t)=>{if(t.ur.x.isLessThan(i.ll.x)||i.ur.x.isLessThan(t.ll.x)||t.ur.y.isLessThan(i.ll.y)||i.ur.y.isLessThan(t.ll.y))return null;const e=i.ll.x.isLessThan(t.ll.x)?t.ll.x:i.ll.x,n=i.ur.x.isLessThan(t.ur.x)?i.ur.x:t.ur.x,r=i.ll.y.isLessThan(t.ll.y)?t.ll.y:i.ll.y,f=i.ur.y.isLessThan(t.ur.y)?i.ur.y:t.ur.y;return{ll:{x:e,y:r},ur:{x:n,y:f}}},ve=(i,t)=>i.x.times(t.y).minus(i.y.times(t.x)),Ze=(i,t)=>i.x.times(t.x).plus(i.y.times(t.y)),Te=i=>Ze(i,i).sqrt(),vt=(i,t,e)=>{const n={x:t.x.minus(i.x),y:t.y.minus(i.y)},r={x:e.x.minus(i.x),y:e.y.minus(i.y)};return ve(r,n).div(Te(r)).div(Te(n))},Tt=(i,t,e)=>{const n={x:t.x.minus(i.x),y:t.y.minus(i.y)},r={x:e.x.minus(i.x),y:e.y.minus(i.y)};return Ze(r,n).div(Te(r)).div(Te(n))},He=(i,t,e)=>t.y.isZero()?null:{x:i.x.plus(t.x.div(t.y).times(e.minus(i.y))),y:e},Je=(i,t,e)=>t.x.isZero()?null:{x:e,y:i.y.plus(t.y.div(t.x).times(e.minus(i.x)))},Lt=(i,t,e,n)=>{if(t.x.isZero())return Je(e,n,i.x);if(n.x.isZero())return Je(i,t,e.x);if(t.y.isZero())return He(e,n,i.y);if(n.y.isZero())return He(i,t,e.y);const r=ve(t,n);if(r.isZero())return null;const f={x:e.x.minus(i.x),y:e.y.minus(i.y)},a=ve(f,t).div(r),c=ve(f,n).div(r),E=i.x.plus(c.times(t.x)),m=e.x.plus(a.times(n.x)),L=i.y.plus(c.times(t.y)),T=e.y.plus(a.times(n.y)),b=E.plus(m).div(2),N=L.plus(T).div(2);return{x:b,y:N}},se=class ot{constructor(t,e){M(this,"point");M(this,"isLeft");M(this,"segment");M(this,"otherSE");M(this,"consumedBy");t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}static compare(t,e){const n=ot.comparePoints(t.point,e.point);return n!==0?n:(t.point!==e.point&&t.link(e),t.isLeft!==e.isLeft?t.isLeft?1:-1:be.compare(t.segment,e.segment))}static comparePoints(t,e){return t.x.isLessThan(e.x)?-1:t.x.isGreaterThan(e.x)?1:t.y.isLessThan(e.y)?-1:t.y.isGreaterThan(e.y)?1:0}link(t){if(t.point===this.point)throw new Error("Tried to link already linked events");const e=t.point.events;for(let n=0,r=e.length;n<r;n++){const f=e[n];this.point.events.push(f),f.point=this.point}this.checkForConsuming()}checkForConsuming(){const t=this.point.events.length;for(let e=0;e<t;e++){const n=this.point.events[e];if(n.segment.consumedBy===void 0)for(let r=e+1;r<t;r++){const f=this.point.events[r];f.consumedBy===void 0&&n.otherSE.point.events===f.otherSE.point.events&&n.segment.consume(f.segment)}}}getAvailableLinkedEvents(){const t=[];for(let e=0,n=this.point.events.length;e<n;e++){const r=this.point.events[e];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&t.push(r)}return t}getLeftmostComparator(t){const e=new Map,n=r=>{const f=r.otherSE;e.set(r,{sine:vt(this.point,t.point,f.point),cosine:Tt(this.point,t.point,f.point)})};return(r,f)=>{e.has(r)||n(r),e.has(f)||n(f);const{sine:a,cosine:c}=e.get(r),{sine:E,cosine:m}=e.get(f);return a.isGreaterThanOrEqualTo(0)&&E.isGreaterThanOrEqualTo(0)?c.isLessThan(m)?1:c.isGreaterThan(m)?-1:0:a.isLessThan(0)&&E.isLessThan(0)?c.isLessThan(m)?-1:c.isGreaterThan(m)?1:0:E.isLessThan(a)?-1:E.isGreaterThan(a)?1:0}}},bt=class qe{constructor(t){M(this,"events");M(this,"poly");M(this,"_isExteriorRing");M(this,"_enclosingRing");this.events=t;for(let e=0,n=t.length;e<n;e++)t[e].segment.ringOut=this;this.poly=null}static factory(t){const e=[];for(let n=0,r=t.length;n<r;n++){const f=t[n];if(!f.isInResult()||f.ringOut)continue;let a=null,c=f.leftSE,E=f.rightSE;const m=[c],L=c.point,T=[];for(;a=c,c=E,m.push(c),c.point!==L;)for(;;){const b=c.getAvailableLinkedEvents();if(b.length===0){const P=m[0].point,A=m[m.length-1].point;throw new Error(`Unable to complete output ring starting at [${P.x}, ${P.y}]. Last matching segment found ends at [${A.x}, ${A.y}].`)}if(b.length===1){E=b[0].otherSE;break}let N=null;for(let P=0,A=T.length;P<A;P++)if(T[P].point===c.point){N=P;break}if(N!==null){const P=T.splice(N)[0],A=m.splice(P.index);A.unshift(A[0].otherSE),e.push(new qe(A.reverse()));continue}T.push({index:m.length,point:c.point});const O=c.getLeftmostComparator(a);E=b.sort(O)[0].otherSE;break}e.push(new qe(m))}return e}getGeom(){let t=this.events[0].point;const e=[t];for(let m=1,L=this.events.length-1;m<L;m++){const T=this.events[m].point,b=this.events[m+1].point;ue.orient(T,t,b)!==0&&(e.push(T),t=T)}if(e.length===1)return null;const n=e[0],r=e[1];ue.orient(n,t,r)===0&&e.shift(),e.push(e[0]);const f=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:e.length-1,c=this.isExteriorRing()?e.length:-1,E=[];for(let m=a;m!=c;m+=f)E.push([e[m].x.toNumber(),e[m].y.toNumber()]);return E}isExteriorRing(){if(this._isExteriorRing===void 0){const t=this.enclosingRing();this._isExteriorRing=t?!t.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){var r,f;let t=this.events[0];for(let a=1,c=this.events.length;a<c;a++){const E=this.events[a];se.compare(t,E)>0&&(t=E)}let e=t.segment.prevInResult(),n=e?e.prevInResult():null;for(;;){if(!e)return null;if(!n)return e.ringOut;if(n.ringOut!==e.ringOut)return((r=n.ringOut)==null?void 0:r.enclosingRing())!==e.ringOut?e.ringOut:(f=e.ringOut)==null?void 0:f.enclosingRing();e=n.prevInResult(),n=e?e.prevInResult():null}}},Qe=class{constructor(i){M(this,"exteriorRing");M(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 t=[i];for(let e=0,n=this.interiorRings.length;e<n;e++){const r=this.interiorRings[e].getGeom();r!==null&&t.push(r)}return t}},Pt=class{constructor(i){M(this,"rings");M(this,"polys");this.rings=i,this.polys=this._composePolys(i)}getGeom(){const i=[];for(let t=0,e=this.polys.length;t<e;t++){const n=this.polys[t].getGeom();n!==null&&i.push(n)}return i}_composePolys(i){var e;const t=[];for(let n=0,r=i.length;n<r;n++){const f=i[n];if(!f.poly)if(f.isExteriorRing())t.push(new Qe(f));else{const a=f.enclosingRing();a!=null&&a.poly||t.push(new Qe(a)),(e=a==null?void 0:a.poly)==null||e.addInterior(f)}}return t}},Mt=class{constructor(i,t=be.compare){M(this,"queue");M(this,"tree");M(this,"segments");this.queue=i,this.tree=new Se(t),this.segments=[]}process(i){const t=i.segment,e=[];if(i.consumedBy)return i.isLeft?this.queue.delete(i.otherSE):this.tree.delete(t),e;i.isLeft&&this.tree.add(t);let n=t,r=t;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 f=null;if(n){const c=n.getIntersection(t);if(c!==null&&(t.isAnEndpoint(c)||(f=c),!n.isAnEndpoint(c))){const E=this._splitSafely(n,c);for(let m=0,L=E.length;m<L;m++)e.push(E[m])}}let a=null;if(r){const c=r.getIntersection(t);if(c!==null&&(t.isAnEndpoint(c)||(a=c),!r.isAnEndpoint(c))){const E=this._splitSafely(r,c);for(let m=0,L=E.length;m<L;m++)e.push(E[m])}}if(f!==null||a!==null){let c=null;f===null?c=a:a===null?c=f:c=se.comparePoints(f,a)<=0?f:a,this.queue.delete(t.rightSE),e.push(t.rightSE);const E=t.split(c);for(let m=0,L=E.length;m<L;m++)e.push(E[m])}e.length>0?(this.tree.delete(t),e.push(i)):(this.segments.push(t),t.prev=n)}else{if(n&&r){const f=n.getIntersection(r);if(f!==null){if(!n.isAnEndpoint(f)){const a=this._splitSafely(n,f);for(let c=0,E=a.length;c<E;c++)e.push(a[c])}if(!r.isAnEndpoint(f)){const a=this._splitSafely(r,f);for(let c=0,E=a.length;c<E;c++)e.push(a[c])}}}this.tree.delete(t)}return e}_splitSafely(i,t){this.tree.delete(i);const e=i.rightSE;this.queue.delete(e);const n=i.split(t);return n.push(e),i.consumedBy===void 0&&this.tree.add(i),n}},Rt=class{constructor(){M(this,"type");M(this,"numMultiPolys")}run(i,t,e){ye.type=i;const n=[new et(t,!0)];for(let m=0,L=e.length;m<L;m++)n.push(new et(e[m],!1));if(ye.numMultiPolys=n.length,ye.type==="difference"){const m=n[0];let L=1;for(;L<n.length;)ke(n[L].bbox,m.bbox)!==null?L++:n.splice(L,1)}if(ye.type==="intersection")for(let m=0,L=n.length;m<L;m++){const T=n[m];for(let b=m+1,N=n.length;b<N;b++)if(ke(T.bbox,n[b].bbox)===null)return[]}const r=new Se(se.compare);for(let m=0,L=n.length;m<L;m++){const T=n[m].getSweepEvents();for(let b=0,N=T.length;b<N;b++)r.add(T[b])}const f=new Mt(r);let a=null;for(r.size!=0&&(a=r.first(),r.delete(a));a;){const m=f.process(a);for(let L=0,T=m.length;L<T;L++){const b=m[L];b.consumedBy===void 0&&r.add(b)}r.size!=0?(a=r.first(),r.delete(a)):a=null}ue.reset();const c=bt.factory(f.segments);return new Pt(c).getGeom()}},ye=new Rt,Le=ye,Ot=0,be=class Me{constructor(t,e,n,r){M(this,"id");M(this,"leftSE");M(this,"rightSE");M(this,"rings");M(this,"windings");M(this,"ringOut");M(this,"consumedBy");M(this,"prev");M(this,"_prevInResult");M(this,"_beforeState");M(this,"_afterState");M(this,"_isInResult");this.id=++Ot,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=n,this.windings=r}static compare(t,e){const n=t.leftSE.point.x,r=e.leftSE.point.x,f=t.rightSE.point.x,a=e.rightSE.point.x;if(a.isLessThan(n))return 1;if(f.isLessThan(r))return-1;const c=t.leftSE.point.y,E=e.leftSE.point.y,m=t.rightSE.point.y,L=e.rightSE.point.y;if(n.isLessThan(r)){if(E.isLessThan(c)&&E.isLessThan(m))return 1;if(E.isGreaterThan(c)&&E.isGreaterThan(m))return-1;const T=t.comparePoint(e.leftSE.point);if(T<0)return 1;if(T>0)return-1;const b=e.comparePoint(t.rightSE.point);return b!==0?b:-1}if(n.isGreaterThan(r)){if(c.isLessThan(E)&&c.isLessThan(L))return-1;if(c.isGreaterThan(E)&&c.isGreaterThan(L))return 1;const T=e.comparePoint(t.leftSE.point);if(T!==0)return T;const b=t.comparePoint(e.rightSE.point);return b<0?1:b>0?-1:1}if(c.isLessThan(E))return-1;if(c.isGreaterThan(E))return 1;if(f.isLessThan(a)){const T=e.comparePoint(t.rightSE.point);if(T!==0)return T}if(f.isGreaterThan(a)){const T=t.comparePoint(e.rightSE.point);if(T<0)return 1;if(T>0)return-1}if(!f.eq(a)){const T=m.minus(c),b=f.minus(n),N=L.minus(E),O=a.minus(r);if(T.isGreaterThan(b)&&N.isLessThan(O))return 1;if(T.isLessThan(b)&&N.isGreaterThan(O))return-1}return f.isGreaterThan(a)?1:f.isLessThan(a)||m.isLessThan(L)?-1:m.isGreaterThan(L)?1:t.id<e.id?-1:t.id>e.id?1:0}static fromRing(t,e,n){let r,f,a;const c=se.comparePoints(t,e);if(c<0)r=t,f=e,a=1;else if(c>0)r=e,f=t,a=-1;else throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);const E=new se(r,!0),m=new se(f,!1);return new Me(E,m,[n],[a])}replaceRightSE(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t.isLessThan(e)?t:e},ur:{x:this.rightSE.point.x,y:t.isGreaterThan(e)?t:e}}}vector(){return{x:this.rightSE.point.x.minus(this.leftSE.point.x),y:this.rightSE.point.y.minus(this.leftSE.point.y)}}isAnEndpoint(t){return t.x.eq(this.leftSE.point.x)&&t.y.eq(this.leftSE.point.y)||t.x.eq(this.rightSE.point.x)&&t.y.eq(this.rightSE.point.y)}comparePoint(t){return ue.orient(this.leftSE.point,t,this.rightSE.point)}getIntersection(t){const e=this.bbox(),n=t.bbox(),r=ke(e,n);if(r===null)return null;const f=this.leftSE.point,a=this.rightSE.point,c=t.leftSE.point,E=t.rightSE.point,m=ge(e,c)&&this.comparePoint(c)===0,L=ge(n,f)&&t.comparePoint(f)===0,T=ge(e,E)&&this.comparePoint(E)===0,b=ge(n,a)&&t.comparePoint(a)===0;if(L&&m)return b&&!T?a:!b&&T?E:null;if(L)return T&&f.x.eq(E.x)&&f.y.eq(E.y)?null:f;if(m)return b&&a.x.eq(c.x)&&a.y.eq(c.y)?null:c;if(b&&T)return null;if(b)return a;if(T)return E;const N=Lt(f,this.vector(),c,t.vector());return N===null||!ge(r,N)?null:ue.snap(N)}split(t){const e=[],n=t.events!==void 0,r=new se(t,!0),f=new se(t,!1),a=this.rightSE;this.replaceRightSE(f),e.push(f),e.push(r);const c=new Me(r,a,this.rings.slice(),this.windings.slice());return se.comparePoints(c.leftSE.point,c.rightSE.point)>0&&c.swapEvents(),se.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),f.checkForConsuming()),e}swapEvents(){const t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,n=this.windings.length;e<n;e++)this.windings[e]*=-1}consume(t){let e=this,n=t;for(;e.consumedBy;)e=e.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const r=Me.compare(e,n);if(r!==0){if(r>0){const f=e;e=n,n=f}if(e.prev===n){const f=e;e=n,n=f}for(let f=0,a=n.rings.length;f<a;f++){const c=n.rings[f],E=n.windings[f],m=e.rings.indexOf(c);m===-1?(e.rings.push(c),e.windings.push(E)):e.windings[m]+=E}n.rings=null,n.windings=null,n.consumedBy=e,n.leftSE.consumedBy=e.leftSE,n.rightSE.consumedBy=e.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 t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,n=this._afterState.windings,r=this._afterState.multiPolys;for(let c=0,E=this.rings.length;c<E;c++){const m=this.rings[c],L=this.windings[c],T=e.indexOf(m);T===-1?(e.push(m),n.push(L)):n[T]+=L}const f=[],a=[];for(let c=0,E=e.length;c<E;c++){if(n[c]===0)continue;const m=e[c],L=m.poly;if(a.indexOf(L)===-1)if(m.isExterior)f.push(L);else{a.indexOf(L)===-1&&a.push(L);const T=f.indexOf(m.poly);T!==-1&&f.splice(T,1)}}for(let c=0,E=f.length;c<E;c++){const m=f[c].multiPoly;r.indexOf(m)===-1&&r.push(m)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(Le.type){case"union":{const n=t.length===0,r=e.length===0;this._isInResult=n!==r;break}case"intersection":{let n,r;t.length<e.length?(n=t.length,r=e.length):(n=e.length,r=t.length),this._isInResult=r===Le.numMultiPolys&&n<r;break}case"xor":{const n=Math.abs(t.length-e.length);this._isInResult=n%2===1;break}case"difference":{const n=r=>r.length===1&&r[0].isSubject;this._isInResult=n(t)!==n(e);break}}return this._isInResult}},je=class{constructor(i,t,e){M(this,"poly");M(this,"isExterior");M(this,"segments");M(this,"bbox");if(!Array.isArray(i)||i.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=e,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=ue.snap({x:new re(i[0][0]),y:new re(i[0][1])});this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};let r=n;for(let f=1,a=i.length;f<a;f++){if(typeof i[f][0]!="number"||typeof i[f][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const c=ue.snap({x:new re(i[f][0]),y:new re(i[f][1])});c.x.eq(r.x)&&c.y.eq(r.y)||(this.segments.push(be.fromRing(r,c,this)),c.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=c.x),c.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=c.y),c.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=c.x),c.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=c.y),r=c)}(!n.x.eq(r.x)||!n.y.eq(r.y))&&this.segments.push(be.fromRing(r,n,this))}getSweepEvents(){const i=[];for(let t=0,e=this.segments.length;t<e;t++){const n=this.segments[t];i.push(n.leftSE),i.push(n.rightSE)}return i}},_t=class{constructor(i,t){M(this,"multiPoly");M(this,"exteriorRing");M(this,"interiorRings");M(this,"bbox");if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new je(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 e=1,n=i.length;e<n;e++){const r=new je(i[e],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=t}getSweepEvents(){const i=this.exteriorRing.getSweepEvents();for(let t=0,e=this.interiorRings.length;t<e;t++){const n=this.interiorRings[t].getSweepEvents();for(let r=0,f=n.length;r<f;r++)i.push(n[r])}return i}},et=class{constructor(i,t){M(this,"isSubject");M(this,"polys");M(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 re(Number.POSITIVE_INFINITY),y:new re(Number.POSITIVE_INFINITY)},ur:{x:new re(Number.NEGATIVE_INFINITY),y:new re(Number.NEGATIVE_INFINITY)}};for(let e=0,n=i.length;e<n;e++){const r=new _t(i[e],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=t}getSweepEvents(){const i=[];for(let t=0,e=this.polys.length;t<e;t++){const n=this.polys[t].getSweepEvents();for(let r=0,f=n.length;r<f;r++)i.push(n[r])}return i}},Ct=(i,...t)=>Le.run("union",i,t),Nt=(i,...t)=>Le.run("difference",i,t);ue.set;function At(i){const t=[];if(_e(i,r=>{t.push(r.coordinates)}),t.length<2)throw new Error("Must have at least two features");const e=i.features[0].properties||{},n=Nt(t[0],...t.slice(1));return n.length===0?null:n.length===1?Re(n[0],e):ze(n,e)}var It=At;function kt(i){if(!i)throw new Error("geojson is required");var t=[];return at(i,function(e){t.push(e)}),Oe(t)}var Bt=kt;function Gt(i,t={}){const e=[];if(_e(i,r=>{e.push(r.coordinates)}),e.length<2)throw new Error("Must have at least 2 geometries");const n=Ct(e[0],...e.slice(1));return n.length===0?null:n.length===1?Re(n[0],t.properties):ze(n,t.properties)}var qt=Gt;function tt(i){const t=[...i];return t[2]<t[0]&&(Math.abs((t[0]+t[2]+360)/2)>Math.abs((t[0]-360+t[2])/2)?t[0]-=360:t[2]+=360),t}function it(i,t){const e=It(Oe([Re([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),i]));if(!e)return;e.properties={isMask:!0};const n=tt(Ve(i)),r=(n[2]-n[0])/360/1e3,f=n[0]<-180,a=n[2]>180,c=Bt(i);if(c.features.length>1&&(f||a))for(const E of c.features){const m=tt(Ve(E));if(a&&m[0]<-180+r)for(const L of E.geometry.coordinates)for(const T of L)T[0]+=360-r;if(f&&m[2]>180-r)for(const L of E.geometry.coordinates)for(const T of L)T[0]-=360-r}t(Oe([c.features.length<2?i:qt(c)??i,e]))}const nt="EPSG:4326";function Ft(i){var f;const t=i.getProperties(),{isMask:e}=t,n=(f=i.getGeometry())==null?void 0:f.getType(),r=e?0:n==="LineString"||n==="MultiLineString"?3:2;return new ht({stroke:e?void 0:new De({color:"#3170fe",lineDash:[r,r],width:r,lineCap:"butt"}),fill:e?new Fe({color:"#00000020"}):void 0,image:new ft({src:`/icons/marker_${t.isReverse?"reverse":t.isSelected?"selected":"unselected"}.svg`,anchor:[.5,1]}),zIndex:t.isSelected?2:t.isReverse?0:1,text:t.isSelected&&t.tooltip?new ct({backgroundFill:new Fe({color:"white"}),text:t.tooltip,offsetY:-40,backgroundStroke:new De({color:"white",lineJoin:"round",width:3}),padding:[2,0,0,2]}):void 0})}function Dt(i,t={},e={},n=Ft){let r=-1,f,a,c,E=!1;const m=new lt({updateWhileAnimating:!0});i.addLayer(m);const L=new ut({});m.setSource(L),m.setStyle(n),i.on("click",O=>{i.forEachFeatureAtPixel(O.pixel,P=>{const A=P.getId();if(A)return O.stopPropagation(),a==null||a({type:"markerClick",id:A}),P})}),i.on("pointermove",O=>{const P=i.forEachFeatureAtPixel(O.pixel,A=>A.getId());f!==P&&(f&&(a==null||a({type:"markerMouseLeave",id:f})),P&&(a==null||a({type:"markerMouseEnter",id:P})),i.getTargetElement().style.cursor=P?"pointer":E?"crosshair":"",f=P)});function T(){return he.getUserProjection()??i.getView().getProjection()}function b(O){return O.transform(nt,T())}const N=O=>{a==null||a({type:"mapClick",coordinates:he.toLonLat(O.coordinate,T())})};return{s