@mappedin/react-sdk 6.0.1-beta.48 → 6.0.1-beta.49

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.
@@ -1 +0,0 @@
1
- import{$ as Ob,A as Tu,Aa as a0,B as mS,Ba as l0,C as gS,D as om,E as Ho,F as us,G as VN,H as ti,I as So,J as zN,K as po,L as HN,M as Lc,N as yS,O as Mi,P as PE,Q as Fs,R as WN,S as sm,T as Eu,U as mn,V as Ar,W as Mb,X as TE,Y as vS,Z as EE,_ as KN,a as fN,aa as JN,b as dN,ba as i0,c as hN,ca as o0,d as ce,da as QN,e as xE,ea as nl,f as fS,fa as ek,g as $N,ga as tk,h as r0,ha as ME,i as dS,ia as bS,j as jN,ja as xS,k as hS,ka as rk,l as im,la as nk,m as Mc,ma as ik,n as GN,na as IS,o as UN,oa as ok,p as CE,pa as sk,q as xn,qa as ak,r as Lt,ra as lk,s as Jp,sa as Ol,t as Oc,ta as OE,u as Tn,ua as uk,v as Gn,va as ck,w as Bi,wa as am,x as er,xa as Lb,y as n0,ya as s0,z as wE,za as _S}from"./chunk-Z5U7QCEH.js";import{a as qN,b as Gse,da as ZN,l as XN,w as YN}from"./chunk-B3CVW3UU.js";import{a as Ll}from"./chunk-EIMXVMO4.js";import{$ as jt,A as bN,Aa as uS,B as sS,Ba as SE,C as aS,Ca as Pc,D as xN,Da as Tc,E as IN,Ea as wu,Fa as cS,G as _N,Ga as AN,H as Yt,Ha as DN,I as wt,Ja as Pu,M as SN,N as CN,O as wN,P as Eb,Q as ht,R as co,S as PN,T as Su,Ta as t0,U as Yp,V as Zp,W as An,Xa as pS,Y as _o,Ya as FN,Z as Kp,_ as TN,aa as Cu,ab as NN,b as nS,c as iS,ca as Td,cb as Ec,d as mN,da as EN,db as kN,e as Wp,ea as IE,eb as RN,f as gN,g as wc,ga as Ed,gb as BN,la as MN,oa as Md,p as yN,pa as ON,q as vN,qa as lS,r as oS,ra as _E,ta as e0,ya as LN,z as Xp,za as Od}from"./chunk-63UMH2J3.js";import{a as k,b as re,c as o,d as rS,e as ls,f as fe,g as Cc,h as Pn,i as x,j as d,k as G,l as q,m as ke,n as V,o as pN,p as Ve,q as g,r as I}from"./chunk-JMCXCPZD.js";var CS=fe((E7e,fk)=>{"use strict";g();var pk=Object.getOwnPropertySymbols,Hse=Object.prototype.hasOwnProperty,Wse=Object.prototype.propertyIsEnumerable;function Xse(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}o(Xse,"toObject");function Yse(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(t).map(function(s){return t[s]});if(n.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(s){i[s]=s}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch(s){return!1}}o(Yse,"shouldUseNative");fk.exports=Yse()?Object.assign:function(e,t){for(var r,n=Xse(e),i,s=1;s<arguments.length;s++){r=Object(arguments[s]);for(var l in r)Hse.call(r,l)&&(n[l]=r[l]);if(pk){i=pk(r);for(var c=0;c<i.length;c++)Wse.call(r,i[c])&&(n[i[c]]=r[i[c]])}}return n}});var XE=fe((HE,WE)=>{g();(function(e,t){typeof HE=="object"&&typeof WE<"u"?WE.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(HE,function(){"use strict";function e(T,O,D,A,R){o(function j(X,Y,N,Z,ae){for(;Z>N;){if(Z-N>600){var se=Z-N+1,U=Y-N+1,xe=Math.log(se),ne=.5*Math.exp(2*xe/3),Pe=.5*Math.sqrt(xe*ne*(se-ne)/se)*(U-se/2<0?-1:1),Ce=Math.max(N,Math.floor(Y-U*ne/se+Pe)),Ue=Math.min(Z,Math.floor(Y+(se-U)*ne/se+Pe));j(X,Y,Ce,Ue,ae)}var _e=X[Y],Me=N,Q=Z;for(t(X,N,Y),ae(X[Z],_e)>0&&t(X,N,Z);Me<Q;){for(t(X,Me,Q),Me++,Q--;ae(X[Me],_e)<0;)Me++;for(;ae(X[Q],_e)>0;)Q--}ae(X[N],_e)===0?t(X,N,Q):t(X,++Q,Z),Q<=Y&&(N=Q+1),Y<=Q&&(Z=Q-1)}},"t")(T,O,D||0,A||T.length-1,R||r)}o(e,"t");function t(T,O,D){var A=T[O];T[O]=T[D],T[D]=A}o(t,"i");function r(T,O){return T<O?-1:T>O?1:0}o(r,"n");var n=o(function(T){T===void 0&&(T=9),this._maxEntries=Math.max(4,T),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()},"r");function i(T,O,D){if(!D)return O.indexOf(T);for(var A=0;A<O.length;A++)if(D(T,O[A]))return A;return-1}o(i,"e");function s(T,O){l(T,0,T.children.length,O,T)}o(s,"a");function l(T,O,D,A,R){R||(R=P(null)),R.minX=1/0,R.minY=1/0,R.maxX=-1/0,R.maxY=-1/0;for(var j=O;j<D;j++){var X=T.children[j];c(R,T.leaf?A(X):X)}return R}o(l,"h");function c(T,O){return T.minX=Math.min(T.minX,O.minX),T.minY=Math.min(T.minY,O.minY),T.maxX=Math.max(T.maxX,O.maxX),T.maxY=Math.max(T.maxY,O.maxY),T}o(c,"o");function p(T,O){return T.minX-O.minX}o(p,"s");function h(T,O){return T.minY-O.minY}o(h,"l");function y(T){return(T.maxX-T.minX)*(T.maxY-T.minY)}o(y,"f");function b(T){return T.maxX-T.minX+(T.maxY-T.minY)}o(b,"u");function _(T,O){return T.minX<=O.minX&&T.minY<=O.minY&&O.maxX<=T.maxX&&O.maxY<=T.maxY}o(_,"m");function C(T,O){return O.minX<=T.maxX&&O.minY<=T.maxY&&O.maxX>=T.minX&&O.maxY>=T.minY}o(C,"c");function P(T){return{children:T,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}o(P,"p");function E(T,O,D,A,R){for(var j=[O,D];j.length;)if(!((D=j.pop())-(O=j.pop())<=A)){var X=O+Math.ceil((D-O)/A/2)*A;e(T,X,O,D,R),j.push(O,X,X,D)}}return o(E,"d"),n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(T){var O=this.data,D=[];if(!C(T,O))return D;for(var A=this.toBBox,R=[];O;){for(var j=0;j<O.children.length;j++){var X=O.children[j],Y=O.leaf?A(X):X;C(T,Y)&&(O.leaf?D.push(X):_(T,Y)?this._all(X,D):R.push(X))}O=R.pop()}return D},n.prototype.collides=function(T){var O=this.data;if(!C(T,O))return!1;for(var D=[];O;){for(var A=0;A<O.children.length;A++){var R=O.children[A],j=O.leaf?this.toBBox(R):R;if(C(T,j)){if(O.leaf||_(T,j))return!0;D.push(R)}}O=D.pop()}return!1},n.prototype.load=function(T){if(!T||!T.length)return this;if(T.length<this._minEntries){for(var O=0;O<T.length;O++)this.insert(T[O]);return this}var D=this._build(T.slice(),0,T.length-1,0);if(this.data.children.length)if(this.data.height===D.height)this._splitRoot(this.data,D);else{if(this.data.height<D.height){var A=this.data;this.data=D,D=A}this._insert(D,this.data.height-D.height-1,!0)}else this.data=D;return this},n.prototype.insert=function(T){return T&&this._insert(T,this.data.height-1),this},n.prototype.clear=function(){return this.data=P([]),this},n.prototype.remove=function(T,O){if(!T)return this;for(var D,A,R,j=this.data,X=this.toBBox(T),Y=[],N=[];j||Y.length;){if(j||(j=Y.pop(),A=Y[Y.length-1],D=N.pop(),R=!0),j.leaf){var Z=i(T,j.children,O);if(Z!==-1)return j.children.splice(Z,1),Y.push(j),this._condense(Y),this}R||j.leaf||!_(j,X)?A?(D++,j=A.children[D],R=!1):j=null:(Y.push(j),N.push(D),D=0,A=j,j=j.children[0])}return this},n.prototype.toBBox=function(T){return T},n.prototype.compareMinX=function(T,O){return T.minX-O.minX},n.prototype.compareMinY=function(T,O){return T.minY-O.minY},n.prototype.toJSON=function(){return this.data},n.prototype.fromJSON=function(T){return this.data=T,this},n.prototype._all=function(T,O){for(var D=[];T;)T.leaf?O.push.apply(O,T.children):D.push.apply(D,T.children),T=D.pop();return O},n.prototype._build=function(T,O,D,A){var R,j=D-O+1,X=this._maxEntries;if(j<=X)return s(R=P(T.slice(O,D+1)),this.toBBox),R;A||(A=Math.ceil(Math.log(j)/Math.log(X)),X=Math.ceil(j/Math.pow(X,A-1))),(R=P([])).leaf=!1,R.height=A;var Y=Math.ceil(j/X),N=Y*Math.ceil(Math.sqrt(X));E(T,O,D,N,this.compareMinX);for(var Z=O;Z<=D;Z+=N){var ae=Math.min(Z+N-1,D);E(T,Z,ae,Y,this.compareMinY);for(var se=Z;se<=ae;se+=Y){var U=Math.min(se+Y-1,ae);R.children.push(this._build(T,se,U,A-1))}}return s(R,this.toBBox),R},n.prototype._chooseSubtree=function(T,O,D,A){for(;A.push(O),!O.leaf&&A.length-1!==D;){for(var R=1/0,j=1/0,X=void 0,Y=0;Y<O.children.length;Y++){var N=O.children[Y],Z=y(N),ae=(se=T,U=N,(Math.max(U.maxX,se.maxX)-Math.min(U.minX,se.minX))*(Math.max(U.maxY,se.maxY)-Math.min(U.minY,se.minY))-Z);ae<j?(j=ae,R=Z<R?Z:R,X=N):ae===j&&Z<R&&(R=Z,X=N)}O=X||O.children[0]}var se,U;return O},n.prototype._insert=function(T,O,D){var A=D?T:this.toBBox(T),R=[],j=this._chooseSubtree(A,this.data,O,R);for(j.children.push(T),c(j,A);O>=0&&R[O].children.length>this._maxEntries;)this._split(R,O),O--;this._adjustParentBBoxes(A,R,O)},n.prototype._split=function(T,O){var D=T[O],A=D.children.length,R=this._minEntries;this._chooseSplitAxis(D,R,A);var j=this._chooseSplitIndex(D,R,A),X=P(D.children.splice(j,D.children.length-j));X.height=D.height,X.leaf=D.leaf,s(D,this.toBBox),s(X,this.toBBox),O?T[O-1].children.push(X):this._splitRoot(D,X)},n.prototype._splitRoot=function(T,O){this.data=P([T,O]),this.data.height=T.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(T,O,D){for(var A,R,j,X,Y,N,Z,ae=1/0,se=1/0,U=O;U<=D-O;U++){var xe=l(T,0,U,this.toBBox),ne=l(T,U,D,this.toBBox),Pe=(R=xe,j=ne,X=void 0,Y=void 0,N=void 0,Z=void 0,X=Math.max(R.minX,j.minX),Y=Math.max(R.minY,j.minY),N=Math.min(R.maxX,j.maxX),Z=Math.min(R.maxY,j.maxY),Math.max(0,N-X)*Math.max(0,Z-Y)),Ce=y(xe)+y(ne);Pe<ae?(ae=Pe,A=U,se=Ce<se?Ce:se):Pe===ae&&Ce<se&&(se=Ce,A=U)}return A||D-O},n.prototype._chooseSplitAxis=function(T,O,D){var A=T.leaf?this.compareMinX:p,R=T.leaf?this.compareMinY:h;this._allDistMargin(T,O,D,A)<this._allDistMargin(T,O,D,R)&&T.children.sort(A)},n.prototype._allDistMargin=function(T,O,D,A){T.children.sort(A);for(var R=this.toBBox,j=l(T,0,O,R),X=l(T,D-O,D,R),Y=b(j)+b(X),N=O;N<D-O;N++){var Z=T.children[N];c(j,T.leaf?R(Z):Z),Y+=b(j)}for(var ae=D-O-1;ae>=O;ae--){var se=T.children[ae];c(X,T.leaf?R(se):se),Y+=b(X)}return Y},n.prototype._adjustParentBBoxes=function(T,O,D){for(var A=D;A>=0;A--)c(O[A],T)},n.prototype._condense=function(T){for(var O=T.length-1,D=void 0;O>=0;O--)T[O].children.length===0?O>0?(D=T[O-1].children).splice(D.indexOf(T[O]),1):this.clear():s(T[O],this.toBBox)},n})});var hk=fe((j7e,dk)=>{g();dk.exports=o(function(t,r,n,i){var s=t[0],l=t[1],c=!1;n===void 0&&(n=0),i===void 0&&(i=r.length);for(var p=(i-n)/2,h=0,y=p-1;h<p;y=h++){var b=r[n+h*2+0],_=r[n+h*2+1],C=r[n+y*2+0],P=r[n+y*2+1],E=_>l!=P>l&&s<(C-b)*(l-_)/(P-_)+b;E&&(c=!c)}return c},"pointInPolygonFlat")});var gk=fe((V7e,mk)=>{g();mk.exports=o(function(t,r,n,i){var s=t[0],l=t[1],c=!1;n===void 0&&(n=0),i===void 0&&(i=r.length);for(var p=i-n,h=0,y=p-1;h<p;y=h++){var b=r[h+n][0],_=r[h+n][1],C=r[y+n][0],P=r[y+n][1],E=_>l!=P>l&&s<(C-b)*(l-_)/(P-_)+b;E&&(c=!c)}return c},"pointInPolygonNested")});var bk=fe((H7e,PS)=>{g();var yk=hk(),vk=gk();PS.exports=o(function(t,r,n,i){return r.length>0&&Array.isArray(r[0])?vk(t,r,n,i):yk(t,r,n,i)},"pointInPolygon");PS.exports.nested=vk;PS.exports.flat=yk});var Ik=fe((TS,xk)=>{g();(function(e,t){typeof TS=="object"&&typeof xk<"u"?t(TS):typeof define=="function"&&define.amd?define(["exports"],t):t((e=e||self).predicates={})})(TS,function(e){"use strict";let r=33306690738754706e-32;function n(C,P,E,T,O){let D,A,R,j,X=P[0],Y=T[0],N=0,Z=0;Y>X==Y>-X?(D=X,X=P[++N]):(D=Y,Y=T[++Z]);let ae=0;if(N<C&&Z<E)for(Y>X==Y>-X?(R=D-((A=X+D)-X),X=P[++N]):(R=D-((A=Y+D)-Y),Y=T[++Z]),D=A,R!==0&&(O[ae++]=R);N<C&&Z<E;)Y>X==Y>-X?(R=D-((A=D+X)-(j=A-D))+(X-j),X=P[++N]):(R=D-((A=D+Y)-(j=A-D))+(Y-j),Y=T[++Z]),D=A,R!==0&&(O[ae++]=R);for(;N<C;)R=D-((A=D+X)-(j=A-D))+(X-j),X=P[++N],D=A,R!==0&&(O[ae++]=R);for(;Z<E;)R=D-((A=D+Y)-(j=A-D))+(Y-j),Y=T[++Z],D=A,R!==0&&(O[ae++]=R);return D===0&&ae!==0||(O[ae++]=D),ae}o(n,"r");function i(C){return new Float64Array(C)}o(i,"o");let s=33306690738754716e-32,l=22204460492503146e-32,c=11093356479670487e-47,p=i(4),h=i(8),y=i(12),b=i(16),_=i(4);e.orient2d=function(C,P,E,T,O,D){let A=(P-D)*(E-O),R=(C-O)*(T-D),j=A-R;if(A===0||R===0||A>0!=R>0)return j;let X=Math.abs(A+R);return Math.abs(j)>=s*X?j:-function(Y,N,Z,ae,se,U,xe){let ne,Pe,Ce,Ue,_e,Me,Q,it,Ke,rt,Ae,Be,We,je,Se,H,ie,ee,Ee=Y-se,Ne=Z-se,Oe=N-U,Ye=ae-U;_e=(Se=(it=Ee-(Q=(Me=134217729*Ee)-(Me-Ee)))*(rt=Ye-(Ke=(Me=134217729*Ye)-(Me-Ye)))-((je=Ee*Ye)-Q*Ke-it*Ke-Q*rt))-(Ae=Se-(ie=(it=Oe-(Q=(Me=134217729*Oe)-(Me-Oe)))*(rt=Ne-(Ke=(Me=134217729*Ne)-(Me-Ne)))-((H=Oe*Ne)-Q*Ke-it*Ke-Q*rt))),p[0]=Se-(Ae+_e)+(_e-ie),_e=(We=je-((Be=je+Ae)-(_e=Be-je))+(Ae-_e))-(Ae=We-H),p[1]=We-(Ae+_e)+(_e-H),_e=(ee=Be+Ae)-Be,p[2]=Be-(ee-_e)+(Ae-_e),p[3]=ee;let Pt=function(Jo,Ro){let Ks=Ro[0];for(let Ri=1;Ri<Jo;Ri++)Ks+=Ro[Ri];return Ks}(4,p),Er=l*xe;if(Pt>=Er||-Pt>=Er||(ne=Y-(Ee+(_e=Y-Ee))+(_e-se),Ce=Z-(Ne+(_e=Z-Ne))+(_e-se),Pe=N-(Oe+(_e=N-Oe))+(_e-U),Ue=ae-(Ye+(_e=ae-Ye))+(_e-U),ne===0&&Pe===0&&Ce===0&&Ue===0)||(Er=c*xe+r*Math.abs(Pt),(Pt+=Ee*Ue+Ye*ne-(Oe*Ce+Ne*Pe))>=Er||-Pt>=Er))return Pt;_e=(Se=(it=ne-(Q=(Me=134217729*ne)-(Me-ne)))*(rt=Ye-(Ke=(Me=134217729*Ye)-(Me-Ye)))-((je=ne*Ye)-Q*Ke-it*Ke-Q*rt))-(Ae=Se-(ie=(it=Pe-(Q=(Me=134217729*Pe)-(Me-Pe)))*(rt=Ne-(Ke=(Me=134217729*Ne)-(Me-Ne)))-((H=Pe*Ne)-Q*Ke-it*Ke-Q*rt))),_[0]=Se-(Ae+_e)+(_e-ie),_e=(We=je-((Be=je+Ae)-(_e=Be-je))+(Ae-_e))-(Ae=We-H),_[1]=We-(Ae+_e)+(_e-H),_e=(ee=Be+Ae)-Be,_[2]=Be-(ee-_e)+(Ae-_e),_[3]=ee;let $n=n(4,p,4,_,h);_e=(Se=(it=Ee-(Q=(Me=134217729*Ee)-(Me-Ee)))*(rt=Ue-(Ke=(Me=134217729*Ue)-(Me-Ue)))-((je=Ee*Ue)-Q*Ke-it*Ke-Q*rt))-(Ae=Se-(ie=(it=Oe-(Q=(Me=134217729*Oe)-(Me-Oe)))*(rt=Ce-(Ke=(Me=134217729*Ce)-(Me-Ce)))-((H=Oe*Ce)-Q*Ke-it*Ke-Q*rt))),_[0]=Se-(Ae+_e)+(_e-ie),_e=(We=je-((Be=je+Ae)-(_e=Be-je))+(Ae-_e))-(Ae=We-H),_[1]=We-(Ae+_e)+(_e-H),_e=(ee=Be+Ae)-Be,_[2]=Be-(ee-_e)+(Ae-_e),_[3]=ee;let ot=n($n,h,4,_,y);_e=(Se=(it=ne-(Q=(Me=134217729*ne)-(Me-ne)))*(rt=Ue-(Ke=(Me=134217729*Ue)-(Me-Ue)))-((je=ne*Ue)-Q*Ke-it*Ke-Q*rt))-(Ae=Se-(ie=(it=Pe-(Q=(Me=134217729*Pe)-(Me-Pe)))*(rt=Ce-(Ke=(Me=134217729*Ce)-(Me-Ce)))-((H=Pe*Ce)-Q*Ke-it*Ke-Q*rt))),_[0]=Se-(Ae+_e)+(_e-ie),_e=(We=je-((Be=je+Ae)-(_e=Be-je))+(Ae-_e))-(Ae=We-H),_[1]=We-(Ae+_e)+(_e-H),_e=(ee=Be+Ae)-Be,_[2]=Be-(ee-_e)+(Ae-_e),_[3]=ee;let zt=n(ot,y,4,_,b);return b[zt-1]}(C,P,E,T,O,D,X)},e.orient2dfast=function(C,P,E,T,O,D){return(P-D)*(E-O)-(C-O)*(T-D)},Object.defineProperty(e,"__esModule",{value:!0})})});var Tk=fe((K7e,JE)=>{"use strict";g();var _k=XE(),MS=qN(),Kse=bk(),Jse=Ik().orient2d;MS.default&&(MS=MS.default);JE.exports=Pk;JE.exports.default=Pk;function Pk(e,t,r){t=Math.max(0,t===void 0?2:t),r=r||0;var n=nae(e),i=new _k(16);i.toBBox=function(D){return{minX:D[0],minY:D[1],maxX:D[0],maxY:D[1]}},i.compareMinX=function(D,A){return D[0]-A[0]},i.compareMinY=function(D,A){return D[1]-A[1]},i.load(e);for(var s=[],l=0,c;l<n.length;l++){var p=n[l];i.remove(p),c=wk(p,c),s.push(c)}var h=new _k(16);for(l=0;l<s.length;l++)h.insert(YE(s[l]));for(var y=t*t,b=r*r;s.length;){var _=s.shift(),C=_.p,P=_.next.p,E=ZE(C,P);if(!(E<b)){var T=E/y;p=Qse(i,_.prev.p,C,P,_.next.next.p,T,h),p&&Math.min(ZE(p,C),ZE(p,P))<=T&&(s.push(_),s.push(wk(p,_)),i.remove(p),h.remove(_),h.insert(YE(_)),h.insert(YE(_.next)))}}_=c;var O=[];do O.push(_.p),_=_.next;while(_!==c);return O.push(_.p),O}o(Pk,"concaveman");function Qse(e,t,r,n,i,s,l){for(var c=new MS([],eae),p=e.data;p;){for(var h=0;h<p.children.length;h++){var y=p.children[h],b=p.leaf?KE(y,r,n):tae(r,n,y);b>s||c.push({node:y,dist:b})}for(;c.length&&!c.peek().node.children;){var _=c.pop(),C=_.node,P=KE(C,t,r),E=KE(C,n,i);if(_.dist<P&&_.dist<E&&Ck(r,C,l)&&Ck(n,C,l))return C}p=c.pop(),p&&(p=p.node)}return null}o(Qse,"findCandidate");function eae(e,t){return e.dist-t.dist}o(eae,"compareDist");function tae(e,t,r){if(Sk(e,r)||Sk(t,r))return 0;var n=ES(e[0],e[1],t[0],t[1],r.minX,r.minY,r.maxX,r.minY);if(n===0)return 0;var i=ES(e[0],e[1],t[0],t[1],r.minX,r.minY,r.minX,r.maxY);if(i===0)return 0;var s=ES(e[0],e[1],t[0],t[1],r.maxX,r.minY,r.maxX,r.maxY);if(s===0)return 0;var l=ES(e[0],e[1],t[0],t[1],r.minX,r.maxY,r.maxX,r.maxY);return l===0?0:Math.min(n,i,s,l)}o(tae,"sqSegBoxDist");function Sk(e,t){return e[0]>=t.minX&&e[0]<=t.maxX&&e[1]>=t.minY&&e[1]<=t.maxY}o(Sk,"inside");function Ck(e,t,r){for(var n=Math.min(e[0],t[0]),i=Math.min(e[1],t[1]),s=Math.max(e[0],t[0]),l=Math.max(e[1],t[1]),c=r.search({minX:n,minY:i,maxX:s,maxY:l}),p=0;p<c.length;p++)if(rae(c[p].p,c[p].next.p,e,t))return!1;return!0}o(Ck,"noIntersections");function h0(e,t,r){return Jse(e[0],e[1],t[0],t[1],r[0],r[1])}o(h0,"cross");function rae(e,t,r,n){return e!==n&&t!==r&&h0(e,t,r)>0!=h0(e,t,n)>0&&h0(r,n,e)>0!=h0(r,n,t)>0}o(rae,"intersects");function YE(e){var t=e.p,r=e.next.p;return e.minX=Math.min(t[0],r[0]),e.minY=Math.min(t[1],r[1]),e.maxX=Math.max(t[0],r[0]),e.maxY=Math.max(t[1],r[1]),e}o(YE,"updateBBox");function nae(e){for(var t=e[0],r=e[0],n=e[0],i=e[0],s=0;s<e.length;s++){var l=e[s];l[0]<t[0]&&(t=l),l[0]>n[0]&&(n=l),l[1]<r[1]&&(r=l),l[1]>i[1]&&(i=l)}var c=[t,r,n,i],p=c.slice();for(s=0;s<e.length;s++)Kse(e[s],c)||p.push(e[s]);return oae(p)}o(nae,"fastConvexHull");function wk(e,t){var r={p:e,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(r.next=t.next,r.prev=t,t.next.prev=r,t.next=r):(r.prev=r,r.next=r),r}o(wk,"insertNode");function ZE(e,t){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}o(ZE,"getSqDist");function KE(e,t,r){var n=t[0],i=t[1],s=r[0]-n,l=r[1]-i;if(s!==0||l!==0){var c=((e[0]-n)*s+(e[1]-i)*l)/(s*s+l*l);c>1?(n=r[0],i=r[1]):c>0&&(n+=s*c,i+=l*c)}return s=e[0]-n,l=e[1]-i,s*s+l*l}o(KE,"sqSegDist");function ES(e,t,r,n,i,s,l,c){var p=r-e,h=n-t,y=l-i,b=c-s,_=e-i,C=t-s,P=p*p+h*h,E=p*y+h*b,T=y*y+b*b,O=p*_+h*C,D=y*_+b*C,A=P*T-E*E,R,j,X,Y,N=A,Z=A;A===0?(j=0,N=1,Y=D,Z=T):(j=E*D-T*O,Y=P*D-E*O,j<0?(j=0,Y=D,Z=T):j>N&&(j=N,Y=D+E,Z=T)),Y<0?(Y=0,-O<0?j=0:-O>P?j=N:(j=-O,N=P)):Y>Z&&(Y=Z,-O+E<0?j=0:-O+E>P?j=N:(j=-O+E,N=P)),R=j===0?0:j/N,X=Y===0?0:Y/Z;var ae=(1-R)*e+R*r,se=(1-R)*t+R*n,U=(1-X)*i+X*l,xe=(1-X)*s+X*c,ne=U-ae,Pe=xe-se;return ne*ne+Pe*Pe}o(ES,"sqSegSegDist");function iae(e,t){return e[0]===t[0]?e[1]-t[1]:e[0]-t[0]}o(iae,"compareByX");function oae(e){e.sort(iae);for(var t=[],r=0;r<e.length;r++){for(;t.length>=2&&h0(t[t.length-2],t[t.length-1],e[r])<=0;)t.pop();t.push(e[r])}for(var n=[],i=e.length-1;i>=0;i--){for(;n.length>=2&&h0(n[n.length-2],n[n.length-1],e[i])<=0;)n.pop();n.push(e[i])}return n.pop(),t.pop(),t.concat(n)}o(oae,"convexHull")});var Ak=fe((eM,tM)=>{g();(function(e,t){typeof eM=="object"&&typeof tM<"u"?tM.exports=t():typeof define=="function"&&define.amd?define(t):e.quickselect=t()})(eM,function(){"use strict";function e(i,s,l,c,p){t(i,s,l||0,c||i.length-1,p||n)}o(e,"quickselect");function t(i,s,l,c,p){for(;c>l;){if(c-l>600){var h=c-l+1,y=s-l+1,b=Math.log(h),_=.5*Math.exp(2*b/3),C=.5*Math.sqrt(b*_*(h-_)/h)*(y-h/2<0?-1:1),P=Math.max(l,Math.floor(s-y*_/h+C)),E=Math.min(c,Math.floor(s+(h-y)*_/h+C));t(i,s,P,E,p)}var T=i[s],O=l,D=c;for(r(i,l,s),p(i[c],T)>0&&r(i,l,c);O<D;){for(r(i,O,D),O++,D--;p(i[O],T)<0;)O++;for(;p(i[D],T)>0;)D--}p(i[l],T)===0?r(i,l,D):(D++,r(i,D,c)),D<=s&&(l=D+1),s<=D&&(c=D-1)}}o(t,"quickselectStep");function r(i,s,l){var c=i[s];i[s]=i[l],i[l]=c}o(r,"swap");function n(i,s){return i<s?-1:i>s?1:0}return o(n,"defaultCompare"),e})});var oM=fe((WNe,iM)=>{"use strict";g();iM.exports=jb;iM.exports.default=jb;var bae=Ak();function jb(e,t){if(!(this instanceof jb))return new jb(e,t);this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),t&&this._initFormat(t),this.clear()}o(jb,"rbush");jb.prototype={all:o(function(){return this._all(this.data,[])},"all"),search:o(function(e){var t=this.data,r=[],n=this.toBBox;if(!LS(e,t))return r;for(var i=[],s,l,c,p;t;){for(s=0,l=t.children.length;s<l;s++)c=t.children[s],p=t.leaf?n(c):c,LS(e,p)&&(t.leaf?r.push(c):nM(e,p)?this._all(c,r):i.push(c));t=i.pop()}return r},"search"),collides:o(function(e){var t=this.data,r=this.toBBox;if(!LS(e,t))return!1;for(var n=[],i,s,l,c;t;){for(i=0,s=t.children.length;i<s;i++)if(l=t.children[i],c=t.leaf?r(l):l,LS(e,c)){if(t.leaf||nM(e,c))return!0;n.push(l)}t=n.pop()}return!1},"collides"),load:o(function(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(var t=0,r=e.length;t<r;t++)this.insert(e[t]);return this}var n=this._build(e.slice(),0,e.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}return this},"load"),insert:o(function(e){return e&&this._insert(e,this.data.height-1),this},"insert"),clear:o(function(){return this.data=y0([]),this},"clear"),remove:o(function(e,t){if(!e)return this;for(var r=this.data,n=this.toBBox(e),i=[],s=[],l,c,p,h;r||i.length;){if(r||(r=i.pop(),c=i[i.length-1],l=s.pop(),h=!0),r.leaf&&(p=xae(e,r.children,t),p!==-1))return r.children.splice(p,1),i.push(r),this._condense(i),this;!h&&!r.leaf&&nM(r,n)?(i.push(r),s.push(l),l=0,c=r,r=r.children[0]):c?(l++,r=c.children[l],h=!1):r=null}return this},"remove"),toBBox:o(function(e){return e},"toBBox"),compareMinX:Dk,compareMinY:Fk,toJSON:o(function(){return this.data},"toJSON"),fromJSON:o(function(e){return this.data=e,this},"fromJSON"),_all:o(function(e,t){for(var r=[];e;)e.leaf?t.push.apply(t,e.children):r.push.apply(r,e.children),e=r.pop();return t},"_all"),_build:o(function(e,t,r,n){var i=r-t+1,s=this._maxEntries,l;if(i<=s)return l=y0(e.slice(t,r+1)),g0(l,this.toBBox),l;n||(n=Math.ceil(Math.log(i)/Math.log(s)),s=Math.ceil(i/Math.pow(s,n-1))),l=y0([]),l.leaf=!1,l.height=n;var c=Math.ceil(i/s),p=c*Math.ceil(Math.sqrt(s)),h,y,b,_;for(Nk(e,t,r,p,this.compareMinX),h=t;h<=r;h+=p)for(b=Math.min(h+p-1,r),Nk(e,h,b,c,this.compareMinY),y=h;y<=b;y+=c)_=Math.min(y+c-1,b),l.children.push(this._build(e,y,_,n-1));return g0(l,this.toBBox),l},"_build"),_chooseSubtree:o(function(e,t,r,n){for(var i,s,l,c,p,h,y,b;n.push(t),!(t.leaf||n.length-1===r);){for(y=b=1/0,i=0,s=t.children.length;i<s;i++)l=t.children[i],p=rM(l),h=Iae(e,l)-p,h<b?(b=h,y=p<y?p:y,c=l):h===b&&p<y&&(y=p,c=l);t=c||t.children[0]}return t},"_chooseSubtree"),_insert:o(function(e,t,r){var n=this.toBBox,i=r?e:n(e),s=[],l=this._chooseSubtree(i,this.data,t,s);for(l.children.push(e),$b(l,i);t>=0&&s[t].children.length>this._maxEntries;)this._split(s,t),t--;this._adjustParentBBoxes(i,s,t)},"_insert"),_split:o(function(e,t){var r=e[t],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);var s=this._chooseSplitIndex(r,i,n),l=y0(r.children.splice(s,r.children.length-s));l.height=r.height,l.leaf=r.leaf,g0(r,this.toBBox),g0(l,this.toBBox),t?e[t-1].children.push(l):this._splitRoot(r,l)},"_split"),_splitRoot:o(function(e,t){this.data=y0([e,t]),this.data.height=e.height+1,this.data.leaf=!1,g0(this.data,this.toBBox)},"_splitRoot"),_chooseSplitIndex:o(function(e,t,r){var n,i,s,l,c,p,h,y;for(p=h=1/0,n=t;n<=r-t;n++)i=Bb(e,0,n,this.toBBox),s=Bb(e,n,r,this.toBBox),l=_ae(i,s),c=rM(i)+rM(s),l<p?(p=l,y=n,h=c<h?c:h):l===p&&c<h&&(h=c,y=n);return y},"_chooseSplitIndex"),_chooseSplitAxis:o(function(e,t,r){var n=e.leaf?this.compareMinX:Dk,i=e.leaf?this.compareMinY:Fk,s=this._allDistMargin(e,t,r,n),l=this._allDistMargin(e,t,r,i);s<l&&e.children.sort(n)},"_chooseSplitAxis"),_allDistMargin:o(function(e,t,r,n){e.children.sort(n);var i=this.toBBox,s=Bb(e,0,t,i),l=Bb(e,r-t,r,i),c=OS(s)+OS(l),p,h;for(p=t;p<r-t;p++)h=e.children[p],$b(s,e.leaf?i(h):h),c+=OS(s);for(p=r-t-1;p>=t;p--)h=e.children[p],$b(l,e.leaf?i(h):h),c+=OS(l);return c},"_allDistMargin"),_adjustParentBBoxes:o(function(e,t,r){for(var n=r;n>=0;n--)$b(t[n],e)},"_adjustParentBBoxes"),_condense:o(function(e){for(var t=e.length-1,r;t>=0;t--)e[t].children.length===0?t>0?(r=e[t-1].children,r.splice(r.indexOf(e[t]),1)):this.clear():g0(e[t],this.toBBox)},"_condense"),_initFormat:o(function(e){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(e[0])),this.compareMinY=new Function("a","b",t.join(e[1])),this.toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")},"_initFormat")};function xae(e,t,r){if(!r)return t.indexOf(e);for(var n=0;n<t.length;n++)if(r(e,t[n]))return n;return-1}o(xae,"findItem");function g0(e,t){Bb(e,0,e.children.length,t,e)}o(g0,"calcBBox");function Bb(e,t,r,n,i){i||(i=y0(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var s=t,l;s<r;s++)l=e.children[s],$b(i,e.leaf?n(l):l);return i}o(Bb,"distBBox");function $b(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}o($b,"extend");function Dk(e,t){return e.minX-t.minX}o(Dk,"compareNodeMinX");function Fk(e,t){return e.minY-t.minY}o(Fk,"compareNodeMinY");function rM(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}o(rM,"bboxArea");function OS(e){return e.maxX-e.minX+(e.maxY-e.minY)}o(OS,"bboxMargin");function Iae(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}o(Iae,"enlargedArea");function _ae(e,t){var r=Math.max(e.minX,t.minX),n=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),s=Math.min(e.maxY,t.maxY);return Math.max(0,i-r)*Math.max(0,s-n)}o(_ae,"intersectionArea");function nM(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}o(nM,"contains");function LS(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}o(LS,"intersects");function y0(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}o(y0,"createNode");function Nk(e,t,r,n,i){for(var s=[t,r],l;s.length;)r=s.pop(),t=s.pop(),!(r-t<=n)&&(l=t+Math.ceil((r-t)/n/2)*n,bae(e,l,t,r,i),s.push(t,l,l,r))}o(Nk,"multiSelect")});var pM=fe(Et=>{"use strict";g();Object.defineProperty(Et,"__esModule",{value:!0});Et.earthRadius=63710088e-1;Et.factors={centimeters:Et.earthRadius*100,centimetres:Et.earthRadius*100,degrees:Et.earthRadius/111325,feet:Et.earthRadius*3.28084,inches:Et.earthRadius*39.37,kilometers:Et.earthRadius/1e3,kilometres:Et.earthRadius/1e3,meters:Et.earthRadius,metres:Et.earthRadius,miles:Et.earthRadius/1609.344,millimeters:Et.earthRadius*1e3,millimetres:Et.earthRadius*1e3,nauticalmiles:Et.earthRadius/1852,radians:1,yards:Et.earthRadius*1.0936};Et.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/Et.earthRadius,yards:1.0936133};Et.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Rd(e,t,r){r===void 0&&(r={});var n={type:"Feature"};return(r.id===0||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}o(Rd,"feature");Et.feature=Rd;function Nae(e,t,r){switch(r===void 0&&(r={}),e){case"Point":return aM(t).geometry;case"LineString":return uM(t).geometry;case"Polygon":return lM(t).geometry;case"MultiPoint":return Rk(t).geometry;case"MultiLineString":return kk(t).geometry;case"MultiPolygon":return Bk(t).geometry;default:throw new Error(e+" is invalid")}}o(Nae,"geometry");Et.geometry=Nae;function aM(e,t,r){if(r===void 0&&(r={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!DS(e[0])||!DS(e[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:e};return Rd(n,t,r)}o(aM,"point");Et.point=aM;function kae(e,t,r){return r===void 0&&(r={}),FS(e.map(function(n){return aM(n,t)}),r)}o(kae,"points");Et.points=kae;function lM(e,t,r){r===void 0&&(r={});for(var n=0,i=e;n<i.length;n++){var s=i[n];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var l=0;l<s[s.length-1].length;l++)if(s[s.length-1][l]!==s[0][l])throw new Error("First and last Position are not equivalent.")}var c={type:"Polygon",coordinates:e};return Rd(c,t,r)}o(lM,"polygon");Et.polygon=lM;function Rae(e,t,r){return r===void 0&&(r={}),FS(e.map(function(n){return lM(n,t)}),r)}o(Rae,"polygons");Et.polygons=Rae;function uM(e,t,r){if(r===void 0&&(r={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:e};return Rd(n,t,r)}o(uM,"lineString");Et.lineString=uM;function Bae(e,t,r){return r===void 0&&(r={}),FS(e.map(function(n){return uM(n,t)}),r)}o(Bae,"lineStrings");Et.lineStrings=Bae;function FS(e,t){t===void 0&&(t={});var r={type:"FeatureCollection"};return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r}o(FS,"featureCollection");Et.featureCollection=FS;function kk(e,t,r){r===void 0&&(r={});var n={type:"MultiLineString",coordinates:e};return Rd(n,t,r)}o(kk,"multiLineString");Et.multiLineString=kk;function Rk(e,t,r){r===void 0&&(r={});var n={type:"MultiPoint",coordinates:e};return Rd(n,t,r)}o(Rk,"multiPoint");Et.multiPoint=Rk;function Bk(e,t,r){r===void 0&&(r={});var n={type:"MultiPolygon",coordinates:e};return Rd(n,t,r)}o(Bk,"multiPolygon");Et.multiPolygon=Bk;function $ae(e,t,r){r===void 0&&(r={});var n={type:"GeometryCollection",geometries:e};return Rd(n,t,r)}o($ae,"geometryCollection");Et.geometryCollection=$ae;function jae(e,t){if(t===void 0&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var r=Math.pow(10,t||0);return Math.round(e*r)/r}o(jae,"round");Et.round=jae;function $k(e,t){t===void 0&&(t="kilometers");var r=Et.factors[t];if(!r)throw new Error(t+" units is invalid");return e*r}o($k,"radiansToLength");Et.radiansToLength=$k;function cM(e,t){t===void 0&&(t="kilometers");var r=Et.factors[t];if(!r)throw new Error(t+" units is invalid");return e/r}o(cM,"lengthToRadians");Et.lengthToRadians=cM;function Gae(e,t){return jk(cM(e,t))}o(Gae,"lengthToDegrees");Et.lengthToDegrees=Gae;function Uae(e){var t=e%360;return t<0&&(t+=360),t}o(Uae,"bearingToAzimuth");Et.bearingToAzimuth=Uae;function jk(e){var t=e%(2*Math.PI);return t*180/Math.PI}o(jk,"radiansToDegrees");Et.radiansToDegrees=jk;function Vae(e){var t=e%360;return t*Math.PI/180}o(Vae,"degreesToRadians");Et.degreesToRadians=Vae;function zae(e,t,r){if(t===void 0&&(t="kilometers"),r===void 0&&(r="kilometers"),!(e>=0))throw new Error("length must be a positive number");return $k(cM(e,t),r)}o(zae,"convertLength");Et.convertLength=zae;function qae(e,t,r){if(t===void 0&&(t="meters"),r===void 0&&(r="kilometers"),!(e>=0))throw new Error("area must be a positive number");var n=Et.areaFactors[t];if(!n)throw new Error("invalid original units");var i=Et.areaFactors[r];if(!i)throw new Error("invalid final units");return e/n*i}o(qae,"convertArea");Et.convertArea=qae;function DS(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}o(DS,"isNumber");Et.isNumber=DS;function Hae(e){return!!e&&e.constructor===Object}o(Hae,"isObject");Et.isObject=Hae;function Wae(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(e.length!==4&&e.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach(function(t){if(!DS(t))throw new Error("bbox must only contain numbers")})}o(Wae,"validateBBox");Et.validateBBox=Wae;function Xae(e){if(!e)throw new Error("id is required");if(["string","number"].indexOf(typeof e)===-1)throw new Error("id must be a number or a string")}o(Xae,"validateId");Et.validateId=Xae});var dM=fe(Po=>{"use strict";g();Object.defineProperty(Po,"__esModule",{value:!0});var ks=pM();function Ub(e,t,r){if(e!==null)for(var n,i,s,l,c,p,h,y=0,b=0,_,C=e.type,P=C==="FeatureCollection",E=C==="Feature",T=P?e.features.length:1,O=0;O<T;O++){h=P?e.features[O].geometry:E?e.geometry:e,_=h?h.type==="GeometryCollection":!1,c=_?h.geometries.length:1;for(var D=0;D<c;D++){var A=0,R=0;if(l=_?h.geometries[D]:h,l!==null){p=l.coordinates;var j=l.type;switch(y=r&&(j==="Polygon"||j==="MultiPolygon")?1:0,j){case null:break;case"Point":if(t(p,b,O,A,R)===!1)return!1;b++,A++;break;case"LineString":case"MultiPoint":for(n=0;n<p.length;n++){if(t(p[n],b,O,A,R)===!1)return!1;b++,j==="MultiPoint"&&A++}j==="LineString"&&A++;break;case"Polygon":case"MultiLineString":for(n=0;n<p.length;n++){for(i=0;i<p[n].length-y;i++){if(t(p[n][i],b,O,A,R)===!1)return!1;b++}j==="MultiLineString"&&A++,j==="Polygon"&&R++}j==="Polygon"&&A++;break;case"MultiPolygon":for(n=0;n<p.length;n++){for(R=0,i=0;i<p[n].length;i++){for(s=0;s<p[n][i].length-y;s++){if(t(p[n][i][s],b,O,A,R)===!1)return!1;b++}R++}A++}break;case"GeometryCollection":for(n=0;n<l.geometries.length;n++)if(Ub(l.geometries[n],t,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}o(Ub,"coordEach");function Yae(e,t,r,n){var i=r;return Ub(e,function(s,l,c,p,h){l===0&&r===void 0?i=s:i=t(i,s,l,c,p,h)},n),i}o(Yae,"coordReduce");function Gk(e,t){var r;switch(e.type){case"FeatureCollection":for(r=0;r<e.features.length&&t(e.features[r].properties,r)!==!1;r++);break;case"Feature":t(e.properties,0);break}}o(Gk,"propEach");function Zae(e,t,r){var n=r;return Gk(e,function(i,s){s===0&&r===void 0?n=i:n=t(n,i,s)}),n}o(Zae,"propReduce");function Uk(e,t){if(e.type==="Feature")t(e,0);else if(e.type==="FeatureCollection")for(var r=0;r<e.features.length&&t(e.features[r],r)!==!1;r++);}o(Uk,"featureEach");function Kae(e,t,r){var n=r;return Uk(e,function(i,s){s===0&&r===void 0?n=i:n=t(n,i,s)}),n}o(Kae,"featureReduce");function Jae(e){var t=[];return Ub(e,function(r){t.push(r)}),t}o(Jae,"coordAll");function fM(e,t){var r,n,i,s,l,c,p,h,y,b,_=0,C=e.type==="FeatureCollection",P=e.type==="Feature",E=C?e.features.length:1;for(r=0;r<E;r++){for(c=C?e.features[r].geometry:P?e.geometry:e,h=C?e.features[r].properties:P?e.properties:{},y=C?e.features[r].bbox:P?e.bbox:void 0,b=C?e.features[r].id:P?e.id:void 0,p=c?c.type==="GeometryCollection":!1,l=p?c.geometries.length:1,i=0;i<l;i++){if(s=p?c.geometries[i]:c,s===null){if(t(null,_,h,y,b)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(s,_,h,y,b)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<s.geometries.length;n++)if(t(s.geometries[n],_,h,y,b)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}_++}}o(fM,"geomEach");function Qae(e,t,r){var n=r;return fM(e,function(i,s,l,c,p){s===0&&r===void 0?n=i:n=t(n,i,s,l,c,p)}),n}o(Qae,"geomReduce");function NS(e,t){fM(e,function(r,n,i,s,l){var c=r===null?null:r.type;switch(c){case null:case"Point":case"LineString":case"Polygon":return t(ks.feature(r,i,{bbox:s,id:l}),n,0)===!1?!1:void 0}var p;switch(c){case"MultiPoint":p="Point";break;case"MultiLineString":p="LineString";break;case"MultiPolygon":p="Polygon";break}for(var h=0;h<r.coordinates.length;h++){var y=r.coordinates[h],b={type:p,coordinates:y};if(t(ks.feature(b,i),n,h)===!1)return!1}})}o(NS,"flattenEach");function ele(e,t,r){var n=r;return NS(e,function(i,s,l){s===0&&l===0&&r===void 0?n=i:n=t(n,i,s,l)}),n}o(ele,"flattenReduce");function Vk(e,t){NS(e,function(r,n,i){var s=0;if(r.geometry){var l=r.geometry.type;if(!(l==="Point"||l==="MultiPoint")){var c,p=0,h=0,y=0;if(Ub(r,function(b,_,C,P,E){if(c===void 0||n>p||P>h||E>y){c=b,p=n,h=P,y=E,s=0;return}var T=ks.lineString([c,b],r.properties);if(t(T,n,i,E,s)===!1)return!1;s++,c=b})===!1)return!1}}})}o(Vk,"segmentEach");function tle(e,t,r){var n=r,i=!1;return Vk(e,function(s,l,c,p,h){i===!1&&r===void 0?n=s:n=t(n,s,l,c,p,h),i=!0}),n}o(tle,"segmentReduce");function zk(e,t){if(!e)throw new Error("geojson is required");NS(e,function(r,n,i){if(r.geometry!==null){var s=r.geometry.type,l=r.geometry.coordinates;switch(s){case"LineString":if(t(r,n,i,0,0)===!1)return!1;break;case"Polygon":for(var c=0;c<l.length;c++)if(t(ks.lineString(l[c],r.properties),n,i,c)===!1)return!1;break}}})}o(zk,"lineEach");function rle(e,t,r){var n=r;return zk(e,function(i,s,l,c){s===0&&r===void 0?n=i:n=t(n,i,s,l,c)}),n}o(rle,"lineReduce");function nle(e,t){if(t=t||{},!ks.isObject(t))throw new Error("options is invalid");var r=t.featureIndex||0,n=t.multiFeatureIndex||0,i=t.geometryIndex||0,s=t.segmentIndex||0,l=t.properties,c;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),l=l||e.features[r].properties,c=e.features[r].geometry;break;case"Feature":l=l||e.properties,c=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":c=e;break;default:throw new Error("geojson is invalid")}if(c===null)return null;var p=c.coordinates;switch(c.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=p.length+s-1),ks.lineString([p[s],p[s+1]],l,t);case"Polygon":return i<0&&(i=p.length+i),s<0&&(s=p[i].length+s-1),ks.lineString([p[i][s],p[i][s+1]],l,t);case"MultiLineString":return n<0&&(n=p.length+n),s<0&&(s=p[n].length+s-1),ks.lineString([p[n][s],p[n][s+1]],l,t);case"MultiPolygon":return n<0&&(n=p.length+n),i<0&&(i=p[n].length+i),s<0&&(s=p[n][i].length-s-1),ks.lineString([p[n][i][s],p[n][i][s+1]],l,t)}throw new Error("geojson is invalid")}o(nle,"findSegment");function ile(e,t){if(t=t||{},!ks.isObject(t))throw new Error("options is invalid");var r=t.featureIndex||0,n=t.multiFeatureIndex||0,i=t.geometryIndex||0,s=t.coordIndex||0,l=t.properties,c;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),l=l||e.features[r].properties,c=e.features[r].geometry;break;case"Feature":l=l||e.properties,c=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":c=e;break;default:throw new Error("geojson is invalid")}if(c===null)return null;var p=c.coordinates;switch(c.type){case"Point":return ks.point(p,l,t);case"MultiPoint":return n<0&&(n=p.length+n),ks.point(p[n],l,t);case"LineString":return s<0&&(s=p.length+s),ks.point(p[s],l,t);case"Polygon":return i<0&&(i=p.length+i),s<0&&(s=p[i].length+s),ks.point(p[i][s],l,t);case"MultiLineString":return n<0&&(n=p.length+n),s<0&&(s=p[n].length+s),ks.point(p[n][s],l,t);case"MultiPolygon":return n<0&&(n=p.length+n),i<0&&(i=p[n].length+i),s<0&&(s=p[n][i].length-s),ks.point(p[n][i][s],l,t)}throw new Error("geojson is invalid")}o(ile,"findPoint");Po.coordAll=Jae;Po.coordEach=Ub;Po.coordReduce=Yae;Po.featureEach=Uk;Po.featureReduce=Kae;Po.findPoint=ile;Po.findSegment=nle;Po.flattenEach=NS;Po.flattenReduce=ele;Po.geomEach=fM;Po.geomReduce=Qae;Po.lineEach=zk;Po.lineReduce=rle;Po.propEach=Gk;Po.propReduce=Zae;Po.segmentEach=Vk;Po.segmentReduce=tle});var qk=fe(mM=>{"use strict";g();Object.defineProperty(mM,"__esModule",{value:!0});var ole=dM();function hM(e){var t=[1/0,1/0,-1/0,-1/0];return ole.coordEach(e,function(r){t[0]>r[0]&&(t[0]=r[0]),t[1]>r[1]&&(t[1]=r[1]),t[2]<r[0]&&(t[2]=r[0]),t[3]<r[1]&&(t[3]=r[1])}),t}o(hM,"bbox");hM.default=hM;mM.default=hM});var kS=fe((IBe,gM)=>{g();var kc=XE(),Wk=pM(),Xk=dM(),b0=qk().default,sle=Xk.featureEach,bBe=Xk.coordEach,xBe=Wk.polygon,Hk=Wk.featureCollection;function Yk(e){var t=new kc(e);return t.insert=function(r){if(r.type!=="Feature")throw new Error("invalid feature");return r.bbox=r.bbox?r.bbox:b0(r),kc.prototype.insert.call(this,r)},t.load=function(r){var n=[];return Array.isArray(r)?r.forEach(function(i){if(i.type!=="Feature")throw new Error("invalid features");i.bbox=i.bbox?i.bbox:b0(i),n.push(i)}):sle(r,function(i){if(i.type!=="Feature")throw new Error("invalid features");i.bbox=i.bbox?i.bbox:b0(i),n.push(i)}),kc.prototype.load.call(this,n)},t.remove=function(r,n){if(r.type!=="Feature")throw new Error("invalid feature");return r.bbox=r.bbox?r.bbox:b0(r),kc.prototype.remove.call(this,r,n)},t.clear=function(){return kc.prototype.clear.call(this)},t.search=function(r){var n=kc.prototype.search.call(this,this.toBBox(r));return Hk(n)},t.collides=function(r){return kc.prototype.collides.call(this,this.toBBox(r))},t.all=function(){var r=kc.prototype.all.call(this);return Hk(r)},t.toJSON=function(){return kc.prototype.toJSON.call(this)},t.fromJSON=function(r){return kc.prototype.fromJSON.call(this,r)},t.toBBox=function(r){var n;if(r.bbox)n=r.bbox;else if(Array.isArray(r)&&r.length===4)n=r;else if(Array.isArray(r)&&r.length===6)n=[r[0],r[1],r[3],r[4]];else if(r.type==="Feature")n=b0(r);else if(r.type==="FeatureCollection")n=b0(r);else throw new Error("invalid geojson");return{minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]}},t}o(Yk,"geojsonRbush");gM.exports=Yk;gM.exports.default=Yk});var IM=fe((LGe,uR)=>{"use strict";g();var lR=Object.prototype.toString;uR.exports=o(function(t){var r=lR.call(t),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&lR.call(t.callee)==="[object Function]"),n},"isArguments")});var vR=fe((FGe,yR)=>{"use strict";g();var gR;Object.keys||(zb=Object.prototype.hasOwnProperty,_M=Object.prototype.toString,cR=IM(),SM=Object.prototype.propertyIsEnumerable,pR=!SM.call({toString:null},"toString"),fR=SM.call(function(){},"prototype"),qb=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],$S=o(function(e){var t=e.constructor;return t&&t.prototype===e},"equalsConstructorPrototype"),dR={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},hR=function(){if(typeof window>"u")return!1;for(var e in window)try{if(!dR["$"+e]&&zb.call(window,e)&&window[e]!==null&&typeof window[e]=="object")try{$S(window[e])}catch(t){return!0}}catch(t){return!0}return!1}(),mR=o(function(e){if(typeof window>"u"||!hR)return $S(e);try{return $S(e)}catch(t){return!1}},"equalsConstructorPrototypeIfNotBuggy"),gR=o(function(t){var r=t!==null&&typeof t=="object",n=_M.call(t)==="[object Function]",i=cR(t),s=r&&_M.call(t)==="[object String]",l=[];if(!r&&!n&&!i)throw new TypeError("Object.keys called on a non-object");var c=fR&&n;if(s&&t.length>0&&!zb.call(t,0))for(var p=0;p<t.length;++p)l.push(String(p));if(i&&t.length>0)for(var h=0;h<t.length;++h)l.push(String(h));else for(var y in t)!(c&&y==="prototype")&&zb.call(t,y)&&l.push(String(y));if(pR)for(var b=mR(t),_=0;_<qb.length;++_)!(b&&qb[_]==="constructor")&&zb.call(t,qb[_])&&l.push(qb[_]);return l},"keys"));var zb,_M,cR,SM,pR,fR,qb,$S,dR,hR,mR;yR.exports=gR});var CM=fe((RGe,IR)=>{"use strict";g();var Ile=Array.prototype.slice,_le=IM(),bR=Object.keys,jS=bR?o(function(t){return bR(t)},"keys"):vR(),xR=Object.keys;jS.shim=o(function(){if(Object.keys){var t=function(){var r=Object.keys(arguments);return r&&r.length===arguments.length}(1,2);t||(Object.keys=o(function(n){return _le(n)?xR(Ile.call(n)):xR(n)},"keys"))}else Object.keys=jS;return Object.keys||jS},"shimObjectKeys");IR.exports=jS});var wM=fe((jGe,_R)=>{"use strict";g();_R.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var s in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var l=Object.getOwnPropertySymbols(t);if(l.length!==1||l[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(t,r);if(c.value!==i||c.enumerable!==!0)return!1}return!0},"hasSymbols")});var GS=fe((VGe,SR)=>{"use strict";g();var Sle=wM();SR.exports=o(function(){return Sle()&&!!Symbol.toStringTag},"hasToStringTagShams")});var PM=fe((HGe,CR)=>{"use strict";g();CR.exports=Object});var TM=fe((XGe,wR)=>{"use strict";g();wR.exports=Error});var TR=fe((ZGe,PR)=>{"use strict";g();PR.exports=EvalError});var MR=fe((JGe,ER)=>{"use strict";g();ER.exports=RangeError});var LR=fe((eUe,OR)=>{"use strict";g();OR.exports=ReferenceError});var EM=fe((rUe,AR)=>{"use strict";g();AR.exports=SyntaxError});var Tm=fe((iUe,DR)=>{"use strict";g();DR.exports=TypeError});var NR=fe((sUe,FR)=>{"use strict";g();FR.exports=URIError});var RR=fe((lUe,kR)=>{"use strict";g();kR.exports=Math.abs});var $R=fe((cUe,BR)=>{"use strict";g();BR.exports=Math.floor});var GR=fe((fUe,jR)=>{"use strict";g();jR.exports=Math.max});var VR=fe((hUe,UR)=>{"use strict";g();UR.exports=Math.min});var qR=fe((gUe,zR)=>{"use strict";g();zR.exports=Math.pow});var WR=fe((vUe,HR)=>{"use strict";g();HR.exports=Math.round});var YR=fe((xUe,XR)=>{"use strict";g();XR.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var KR=fe((SUe,ZR)=>{"use strict";g();var Cle=YR();ZR.exports=o(function(t){return Cle(t)||t===0?t:t<0?-1:1},"sign")});var QR=fe((PUe,JR)=>{"use strict";g();JR.exports=Object.getOwnPropertyDescriptor});var Em=fe((EUe,eB)=>{"use strict";g();var US=QR();if(US)try{US([],"length")}catch(e){US=null}eB.exports=US});var Hb=fe((OUe,tB)=>{"use strict";g();var VS=Object.defineProperty||!1;if(VS)try{VS({},"a",{value:1})}catch(e){VS=!1}tB.exports=VS});var iB=fe((AUe,nB)=>{"use strict";g();var rB=typeof Symbol<"u"&&Symbol,wle=wM();nB.exports=o(function(){return typeof rB!="function"||typeof Symbol!="function"||typeof rB("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:wle()},"hasNativeSymbols")});var MM=fe((NUe,oB)=>{"use strict";g();oB.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var OM=fe((RUe,sB)=>{"use strict";g();var Ple=PM();sB.exports=Ple.getPrototypeOf||null});var uB=fe(($Ue,lB)=>{"use strict";g();var Tle="Function.prototype.bind called on incompatible ",Ele=Object.prototype.toString,Mle=Math.max,Ole="[object Function]",aB=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var s=0;s<r.length;s+=1)n[s+t.length]=r[s];return n},"concatty"),Lle=o(function(t,r){for(var n=[],i=r||0,s=0;i<t.length;i+=1,s+=1)n[s]=t[i];return n},"slicy"),Ale=o(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");lB.exports=o(function(t){var r=this;if(typeof r!="function"||Ele.apply(r)!==Ole)throw new TypeError(Tle+r);for(var n=Lle(arguments,1),i,s=o(function(){if(this instanceof i){var y=r.apply(this,aB(n,arguments));return Object(y)===y?y:this}return r.apply(t,aB(n,arguments))},"binder"),l=Mle(0,r.length-n.length),c=[],p=0;p<l;p++)c[p]="$"+p;if(i=Function("binder","return function ("+Ale(c,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var h=o(function(){},"Empty");h.prototype=r.prototype,i.prototype=new h,h.prototype=null}return i},"bind")});var I0=fe((UUe,cB)=>{"use strict";g();var Dle=uB();cB.exports=Function.prototype.bind||Dle});var zS=fe((zUe,pB)=>{"use strict";g();pB.exports=Function.prototype.call});var qS=fe((HUe,fB)=>{"use strict";g();fB.exports=Function.prototype.apply});var hB=fe((XUe,dB)=>{"use strict";g();dB.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var LM=fe((ZUe,mB)=>{"use strict";g();var Fle=I0(),Nle=qS(),kle=zS(),Rle=hB();mB.exports=Rle||Fle.call(kle,Nle)});var HS=fe((JUe,gB)=>{"use strict";g();var Ble=I0(),$le=Tm(),jle=zS(),Gle=LM();gB.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new $le("a function is required");return Gle(Ble,jle,t)},"callBindBasic")});var _B=fe((tVe,IB)=>{"use strict";g();var Ule=HS(),yB=Em(),bB;try{bB=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var AM=!!bB&&yB&&yB(Object.prototype,"__proto__"),xB=Object,vB=xB.getPrototypeOf;IB.exports=AM&&typeof AM.get=="function"?Ule([AM.get]):typeof vB=="function"?o(function(t){return vB(t==null?t:xB(t))},"getDunder"):!1});var DM=fe((iVe,PB)=>{"use strict";g();var SB=MM(),CB=OM(),wB=_B();PB.exports=SB?o(function(t){return SB(t)},"getProto"):CB?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return CB(t)},"getProto"):wB?o(function(t){return wB(t)},"getProto"):null});var FM=fe((aVe,TB)=>{"use strict";g();var Vle=Function.prototype.call,zle=Object.prototype.hasOwnProperty,qle=I0();TB.exports=qle.call(Vle,zle)});var RM=fe((uVe,DB)=>{"use strict";g();var Dr,Hle=PM(),Wle=TM(),Xle=TR(),Yle=MR(),Zle=LR(),w0=EM(),C0=Tm(),Kle=NR(),Jle=RR(),Qle=$R(),eue=GR(),tue=VR(),rue=qR(),nue=WR(),iue=KR(),LB=Function,NM=o(function(e){try{return LB('"use strict"; return ('+e+").constructor;")()}catch(t){}},"getEvalledConstructor"),Wb=Em(),oue=Hb(),kM=o(function(){throw new C0},"throwTypeError"),sue=Wb?function(){try{return arguments.callee,kM}catch(e){try{return Wb(arguments,"callee").get}catch(t){return kM}}}():kM,_0=iB()(),Wo=DM(),aue=OM(),lue=MM(),AB=qS(),Xb=zS(),S0={},uue=typeof Uint8Array>"u"||!Wo?Dr:Wo(Uint8Array),Mm={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Dr:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Dr:ArrayBuffer,"%ArrayIteratorPrototype%":_0&&Wo?Wo([][Symbol.iterator]()):Dr,"%AsyncFromSyncIteratorPrototype%":Dr,"%AsyncFunction%":S0,"%AsyncGenerator%":S0,"%AsyncGeneratorFunction%":S0,"%AsyncIteratorPrototype%":S0,"%Atomics%":typeof Atomics>"u"?Dr:Atomics,"%BigInt%":typeof BigInt>"u"?Dr:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Dr:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Dr:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Dr:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Wle,"%eval%":eval,"%EvalError%":Xle,"%Float16Array%":typeof Float16Array>"u"?Dr:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Dr:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Dr:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Dr:FinalizationRegistry,"%Function%":LB,"%GeneratorFunction%":S0,"%Int8Array%":typeof Int8Array>"u"?Dr:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Dr:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Dr:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":_0&&Wo?Wo(Wo([][Symbol.iterator]())):Dr,"%JSON%":typeof JSON=="object"?JSON:Dr,"%Map%":typeof Map>"u"?Dr:Map,"%MapIteratorPrototype%":typeof Map>"u"||!_0||!Wo?Dr:Wo(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Hle,"%Object.getOwnPropertyDescriptor%":Wb,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Dr:Promise,"%Proxy%":typeof Proxy>"u"?Dr:Proxy,"%RangeError%":Yle,"%ReferenceError%":Zle,"%Reflect%":typeof Reflect>"u"?Dr:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Dr:Set,"%SetIteratorPrototype%":typeof Set>"u"||!_0||!Wo?Dr:Wo(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Dr:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":_0&&Wo?Wo(""[Symbol.iterator]()):Dr,"%Symbol%":_0?Symbol:Dr,"%SyntaxError%":w0,"%ThrowTypeError%":sue,"%TypedArray%":uue,"%TypeError%":C0,"%Uint8Array%":typeof Uint8Array>"u"?Dr:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Dr:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Dr:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Dr:Uint32Array,"%URIError%":Kle,"%WeakMap%":typeof WeakMap>"u"?Dr:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Dr:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Dr:WeakSet,"%Function.prototype.call%":Xb,"%Function.prototype.apply%":AB,"%Object.defineProperty%":oue,"%Object.getPrototypeOf%":aue,"%Math.abs%":Jle,"%Math.floor%":Qle,"%Math.max%":eue,"%Math.min%":tue,"%Math.pow%":rue,"%Math.round%":nue,"%Math.sign%":iue,"%Reflect.getPrototypeOf%":lue};if(Wo)try{null.error}catch(e){EB=Wo(Wo(e)),Mm["%Error.prototype%"]=EB}var EB,cue=o(function e(t){var r;if(t==="%AsyncFunction%")r=NM("async function () {}");else if(t==="%GeneratorFunction%")r=NM("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=NM("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Wo&&(r=Wo(i.prototype))}return Mm[t]=r,r},"doEval"),MB={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Yb=I0(),WS=FM(),pue=Yb.call(Xb,Array.prototype.concat),fue=Yb.call(AB,Array.prototype.splice),OB=Yb.call(Xb,String.prototype.replace),XS=Yb.call(Xb,String.prototype.slice),due=Yb.call(Xb,RegExp.prototype.exec),hue=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,mue=/\\(\\)?/g,gue=o(function(t){var r=XS(t,0,1),n=XS(t,-1);if(r==="%"&&n!=="%")throw new w0("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new w0("invalid intrinsic syntax, expected opening `%`");var i=[];return OB(t,hue,function(s,l,c,p){i[i.length]=c?OB(p,mue,"$1"):l||s}),i},"stringToPath"),yue=o(function(t,r){var n=t,i;if(WS(MB,n)&&(i=MB[n],n="%"+i[0]+"%"),WS(Mm,n)){var s=Mm[n];if(s===S0&&(s=cue(n)),typeof s>"u"&&!r)throw new C0("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new w0("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");DB.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new C0("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new C0('"allowMissing" argument must be a boolean');if(due(/^%?[^%]*%?$/,t)===null)throw new w0("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=gue(t),i=n.length>0?n[0]:"",s=yue("%"+i+"%",r),l=s.name,c=s.value,p=!1,h=s.alias;h&&(i=h[0],fue(n,pue([0,1],h)));for(var y=1,b=!0;y<n.length;y+=1){var _=n[y],C=XS(_,0,1),P=XS(_,-1);if((C==='"'||C==="'"||C==="`"||P==='"'||P==="'"||P==="`")&&C!==P)throw new w0("property names with quotes must have matching quotes");if((_==="constructor"||!b)&&(p=!0),i+="."+_,l="%"+i+"%",WS(Mm,l))c=Mm[l];else if(c!=null){if(!(_ in c)){if(!r)throw new C0("base intrinsic for "+t+" exists, but the property is not available.");return}if(Wb&&y+1>=n.length){var E=Wb(c,_);b=!!E,b&&"get"in E&&!("originalValue"in E.get)?c=E.get:c=c[_]}else b=WS(c,_),c=c[_];b&&!p&&(Mm[l]=c)}}return c},"GetIntrinsic")});var YS=fe((fVe,kB)=>{"use strict";g();var FB=RM(),NB=HS(),vue=NB([FB("%String.prototype.indexOf%")]);kB.exports=o(function(t,r){var n=FB(t,!!r);return typeof n=="function"&&vue(t,".prototype.")>-1?NB([n]):n},"callBoundIntrinsic")});var $B=fe((mVe,BB)=>{"use strict";g();var bue=GS()(),xue=YS(),BM=xue("Object.prototype.toString"),ZS=o(function(t){return bue&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:BM(t)==="[object Arguments]"},"isArguments"),RB=o(function(t){return ZS(t)?!0:t!==null&&typeof t=="object"&&"length"in t&&typeof t.length=="number"&&t.length>=0&&BM(t)!=="[object Array]"&&"callee"in t&&BM(t.callee)==="[object Function]"},"isArguments"),Iue=function(){return ZS(arguments)}();ZS.isLegacyArguments=RB;BB.exports=Iue?ZS:RB});var KS=fe((vVe,UB)=>{"use strict";g();var jB=Hb(),_ue=EM(),P0=Tm(),GB=Em();UB.exports=o(function(t,r,n){if(!t||typeof t!="object"&&typeof t!="function")throw new P0("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new P0("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new P0("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new P0("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new P0("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new P0("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,p=!!GB&&GB(t,r);if(jB)jB(t,r,{configurable:l===null&&p?p.configurable:!l,enumerable:i===null&&p?p.enumerable:!i,value:n,writable:s===null&&p?p.writable:!s});else if(c||!i&&!s&&!l)t[r]=n;else throw new _ue("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},"defineDataProperty")});var JS=fe((IVe,zB)=>{"use strict";g();var $M=Hb(),VB=o(function(){return!!$M},"hasPropertyDescriptors");VB.hasArrayLengthDefineBug=o(function(){if(!$M)return null;try{return $M([],"length",{value:1}).length!==1}catch(t){return!0}},"hasArrayLengthDefineBug");zB.exports=VB});var T0=fe((CVe,XB)=>{"use strict";g();var Sue=CM(),Cue=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",wue=Object.prototype.toString,Pue=Array.prototype.concat,qB=KS(),Tue=o(function(e){return typeof e=="function"&&wue.call(e)==="[object Function]"},"isFunction"),HB=JS()(),Eue=o(function(e,t,r,n){if(t in e){if(n===!0){if(e[t]===r)return}else if(!Tue(n)||!n())return}HB?qB(e,t,r,!0):qB(e,t,r)},"defineProperty"),WB=o(function(e,t){var r=arguments.length>2?arguments[2]:{},n=Sue(t);Cue&&(n=Pue.call(n,Object.getOwnPropertySymbols(t)));for(var i=0;i<n.length;i+=1)Eue(e,n[i],t[n[i]],r[n[i]])},"defineProperties");WB.supportsDescriptors=!!HB;XB.exports=WB});var QB=fe((TVe,JB)=>{"use strict";g();var Mue=RM(),YB=KS(),Oue=JS()(),ZB=Em(),KB=Tm(),Lue=Mue("%Math.floor%");JB.exports=o(function(t,r){if(typeof t!="function")throw new KB("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||Lue(r)!==r)throw new KB("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,s=!0;if("length"in t&&ZB){var l=ZB(t,"length");l&&!l.configurable&&(i=!1),l&&!l.writable&&(s=!1)}return(i||s||!n)&&(Oue?YB(t,"length",r,!0,!0):YB(t,"length",r)),t},"setFunctionLength")});var t$=fe((OVe,e$)=>{"use strict";g();var Aue=I0(),Due=qS(),Fue=LM();e$.exports=o(function(){return Fue(Aue,Due,arguments)},"applyBind")});var jM=fe((DVe,QS)=>{"use strict";g();var Nue=QB(),r$=Hb(),kue=HS(),n$=t$();QS.exports=o(function(t){var r=kue(arguments),n=t.length-(arguments.length-1);return Nue(r,1+(n>0?n:0),!0)},"callBind");r$?r$(QS.exports,"apply",{value:n$}):QS.exports.apply=n$});var GM=fe((kVe,o$)=>{"use strict";g();var i$=o(function(e){return e!==e},"numberIsNaN");o$.exports=o(function(t,r){return t===0&&r===0?1/t===1/r:!!(t===r||i$(t)&&i$(r))},"is")});var UM=fe(($Ve,s$)=>{"use strict";g();var Rue=GM();s$.exports=o(function(){return typeof Object.is=="function"?Object.is:Rue},"getPolyfill")});var l$=fe((UVe,a$)=>{"use strict";g();var Bue=UM(),$ue=T0();a$.exports=o(function(){var t=Bue();return $ue(Object,{is:t},{is:o(function(){return Object.is!==t},"testObjectIs")}),t},"shimObjectIs")});var f$=fe((qVe,p$)=>{"use strict";g();var jue=T0(),Gue=jM(),Uue=GM(),u$=UM(),Vue=l$(),c$=Gue(u$(),Object);jue(c$,{getPolyfill:u$,implementation:Uue,shim:Vue});p$.exports=c$});var v$=fe((WVe,y$)=>{"use strict";g();var d$=YS(),zue=GS()(),que=FM(),Hue=Em(),qM;zue?(h$=d$("RegExp.prototype.exec"),VM={},eC=o(function(){throw VM},"throwRegexMarker"),zM={toString:eC,valueOf:eC},typeof Symbol.toPrimitive=="symbol"&&(zM[Symbol.toPrimitive]=eC),qM=o(function(t){if(!t||typeof t!="object")return!1;var r=Hue(t,"lastIndex"),n=r&&que(r,"value");if(!n)return!1;try{h$(t,zM)}catch(i){return i===VM}},"isRegex")):(m$=d$("Object.prototype.toString"),g$="[object RegExp]",qM=o(function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:m$(t)===g$},"isRegex"));var h$,VM,eC,zM,m$,g$;y$.exports=qM});var x$=fe((ZVe,b$)=>{"use strict";g();var Kb=o(function(){return typeof o(function(){},"f").name=="string"},"functionsHaveNames"),Zb=Object.getOwnPropertyDescriptor;if(Zb)try{Zb([],"length")}catch(e){Zb=null}Kb.functionsHaveConfigurableNames=o(function(){if(!Kb()||!Zb)return!1;var t=Zb(function(){},"name");return!!t&&!!t.configurable},"functionsHaveConfigurableNames");var Wue=Function.prototype.bind;Kb.boundFunctionsHaveNames=o(function(){return Kb()&&typeof Wue=="function"&&o(function(){},"f").bind().name!==""},"boundFunctionsHaveNames");b$.exports=Kb});var S$=fe((QVe,_$)=>{"use strict";g();var I$=KS(),Xue=JS()(),Yue=x$().functionsHaveConfigurableNames(),Zue=Tm();_$.exports=o(function(t,r){if(typeof t!="function")throw new Zue("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return(!n||Yue)&&(Xue?I$(t,"name",r,!0,!0):I$(t,"name",r)),t},"setFunctionName")});var HM=fe((rze,C$)=>{"use strict";g();var Kue=S$(),Jue=Tm(),Que=Object;C$.exports=Kue(o(function(){if(this==null||this!==Que(this))throw new Jue("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"flags"),"get flags",!0)});var WM=fe((oze,w$)=>{"use strict";g();var ece=HM(),tce=T0().supportsDescriptors,rce=Object.getOwnPropertyDescriptor;w$.exports=o(function(){if(tce&&/a/mig.flags==="gim"){var t=rce(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var r="",n={};if(Object.defineProperty(n,"hasIndices",{get:o(function(){r+="d"},"get")}),Object.defineProperty(n,"sticky",{get:o(function(){r+="y"},"get")}),t.get.call(n),r==="dy")return t.get}}return ece},"getPolyfill")});var E$=fe((lze,T$)=>{"use strict";g();var nce=T0().supportsDescriptors,ice=WM(),oce=Em(),sce=Object.defineProperty,ace=TM(),P$=DM(),lce=/a/;T$.exports=o(function(){if(!nce||!P$)throw new ace("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=ice(),r=P$(lce),n=oce(r,"flags");return(!n||n.get!==t)&&sce(r,"flags",{configurable:!0,enumerable:!1,get:t}),t},"shimFlags")});var A$=fe((pze,L$)=>{"use strict";g();var uce=T0(),cce=jM(),pce=HM(),M$=WM(),fce=E$(),O$=cce(M$());uce(O$,{getPolyfill:M$,implementation:pce,shim:fce});L$.exports=O$});var N$=fe((dze,F$)=>{"use strict";g();var D$=YS(),dce=D$("Date.prototype.getDay"),hce=o(function(t){try{return dce(t),!0}catch(r){return!1}},"tryDateGetDayCall"),mce=D$("Object.prototype.toString"),gce="[object Date]",yce=GS()();F$.exports=o(function(t){return typeof t!="object"||t===null?!1:yce?hce(t):mce(t)===gce},"isDateObject")});var XM=fe((gze,H$)=>{g();var k$=CM(),R$=$B(),B$=f$(),$$=v$(),j$=A$(),G$=N$(),U$=Date.prototype.getTime;function q$(e,t,r){var n=r||{};return(n.strict?B$(e,t):e===t)?!0:!e||!t||typeof e!="object"&&typeof t!="object"?n.strict?B$(e,t):e==t:vce(e,t,n)}o(q$,"deepEqual");function V$(e){return e==null}o(V$,"isUndefinedOrNull");function z$(e){return!(!e||typeof e!="object"||typeof e.length!="number"||typeof e.copy!="function"||typeof e.slice!="function"||e.length>0&&typeof e[0]!="number")}o(z$,"isBuffer");function vce(e,t,r){var n,i;if(typeof e!=typeof t||V$(e)||V$(t)||e.prototype!==t.prototype||R$(e)!==R$(t))return!1;var s=$$(e),l=$$(t);if(s!==l)return!1;if(s||l)return e.source===t.source&&j$(e)===j$(t);if(G$(e)&&G$(t))return U$.call(e)===U$.call(t);var c=z$(e),p=z$(t);if(c!==p)return!1;if(c||p){if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}if(typeof e!=typeof t)return!1;try{var h=k$(e),y=k$(t)}catch(b){return!1}if(h.length!==y.length)return!1;for(h.sort(),y.sort(),n=h.length-1;n>=0;n--)if(h[n]!=y[n])return!1;for(n=h.length-1;n>=0;n--)if(i=h[n],!q$(e[i],t[i],r))return!1;return!0}o(vce,"objEquiv");H$.exports=q$});var aO=fe((pWe,ej)=>{g();var hpe=XM(),Bc=o(function(e){this.precision=e&&e.precision?e.precision:17,this.direction=e&&e.direction?e.direction:!1,this.pseudoNode=e&&e.pseudoNode?e.pseudoNode:!1,this.objectComparator=e&&e.objectComparator?e.objectComparator:mpe},"Equality");Bc.prototype.compare=function(e,t){if(e.type!==t.type||!Q$(e,t))return!1;switch(e.type){case"Point":return this.compareCoord(e.coordinates,t.coordinates);case"LineString":return this.compareLine(e.coordinates,t.coordinates,0,!1);case"Polygon":return this.comparePolygon(e,t);case"Feature":return this.compareFeature(e,t);default:if(e.type.indexOf("Multi")===0){var r=this,n=J$(e),i=J$(t);return n.every(function(s){return this.some(function(l){return r.compare(s,l)})},i)}}return!1};function J$(e){return e.coordinates.map(function(t){return{type:e.type.replace("Multi",""),coordinates:t}})}o(J$,"explode");function Q$(e,t){return e.hasOwnProperty("coordinates")?e.coordinates.length===t.coordinates.length:e.length===t.length}o(Q$,"sameLength");Bc.prototype.compareCoord=function(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(e[r].toFixed(this.precision)!==t[r].toFixed(this.precision))return!1;return!0};Bc.prototype.compareLine=function(e,t,r,n){if(!Q$(e,t))return!1;var i=this.pseudoNode?e:this.removePseudo(e),s=this.pseudoNode?t:this.removePseudo(t);if(!(n&&!this.compareCoord(i[0],s[0])&&(s=this.fixStartIndex(s,i),!s))){var l=this.compareCoord(i[r],s[r]);return this.direction||l?this.comparePath(i,s):this.compareCoord(i[r],s[s.length-(1+r)])?this.comparePath(i.slice().reverse(),s):!1}};Bc.prototype.fixStartIndex=function(e,t){for(var r,n=-1,i=0;i<e.length;i++)if(this.compareCoord(e[i],t[0])){n=i;break}return n>=0&&(r=[].concat(e.slice(n,e.length),e.slice(1,n+1))),r};Bc.prototype.comparePath=function(e,t){var r=this;return e.every(function(n,i){return r.compareCoord(n,this[i])},t)};Bc.prototype.comparePolygon=function(e,t){if(this.compareLine(e.coordinates[0],t.coordinates[0],1,!0)){var r=e.coordinates.slice(1,e.coordinates.length),n=t.coordinates.slice(1,t.coordinates.length),i=this;return r.every(function(s){return this.some(function(l){return i.compareLine(s,l,1,!0)})},n)}else return!1};Bc.prototype.compareFeature=function(e,t){return e.id!==t.id||!this.objectComparator(e.properties,t.properties)||!this.compareBBox(e,t)?!1:this.compare(e.geometry,t.geometry)};Bc.prototype.compareBBox=function(e,t){return!!(!e.bbox&&!t.bbox||e.bbox&&t.bbox&&this.compareCoord(e.bbox,t.bbox))};Bc.prototype.removePseudo=function(e){return e};function mpe(e,t){return hpe(e,t,{strict:!0})}o(mpe,"objectComparator");ej.exports=Bc});var tj=fe((LWe,nC)=>{g();function Bd(e,t,r,n){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(e,t,r,n)}o(Bd,"DBSCAN");Bd.prototype.run=function(e,t,r,n){this._init(e,t,r,n);for(var i=0;i<this._datasetLength;i++)if(this._visited[i]!==1){this._visited[i]=1;var s=this._regionQuery(i);if(s.length<this.minPts)this.noise.push(i);else{var l=this.clusters.length;this.clusters.push([]),this._addToCluster(i,l),this._expandCluster(l,s)}}return this.clusters};Bd.prototype._init=function(e,t,r,n){if(e){if(!(e instanceof Array))throw Error("Dataset must be of type array, "+typeof e+" given");this.dataset=e,this.clusters=[],this.noise=[],this._datasetLength=e.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}t&&(this.epsilon=t),r&&(this.minPts=r),n&&(this.distance=n)};Bd.prototype._expandCluster=function(e,t){for(var r=0;r<t.length;r++){var n=t[r];if(this._visited[n]!==1){this._visited[n]=1;var i=this._regionQuery(n);i.length>=this.minPts&&(t=this._mergeArrays(t,i))}this._assigned[n]!==1&&this._addToCluster(n,e)}};Bd.prototype._addToCluster=function(e,t){this.clusters[t].push(e),this._assigned[e]=1};Bd.prototype._regionQuery=function(e){for(var t=[],r=0;r<this._datasetLength;r++){var n=this.distance(this.dataset[e],this.dataset[r]);n<this.epsilon&&t.push(r)}return t};Bd.prototype._mergeArrays=function(e,t){for(var r=t.length,n=0;n<r;n++){var i=t[n];e.indexOf(i)<0&&e.push(i)}return e};Bd.prototype._euclideanDistance=function(e,t){for(var r=0,n=Math.min(e.length,t.length);n--;)r+=(e[n]-t[n])*(e[n]-t[n]);return Math.sqrt(r)};typeof nC<"u"&&nC.exports&&(nC.exports=Bd)});var rj=fe((FWe,iC)=>{g();function $d(e,t,r){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(e,t,r)}o($d,"KMEANS");$d.prototype.init=function(e,t,r){this.assignments=[],this.centroids=[],typeof e<"u"&&(this.dataset=e),typeof t<"u"&&(this.k=t),typeof r<"u"&&(this.distance=r)};$d.prototype.run=function(e,t){this.init(e,t);for(var r=this.dataset.length,n=0;n<this.k;n++)this.centroids[n]=this.randomCentroid();for(var i=!0;i;){i=this.assign();for(var s=0;s<this.k;s++){for(var l=new Array(y),c=0,p=0;p<y;p++)l[p]=0;for(var h=0;h<r;h++){var y=this.dataset[h].length;if(s===this.assignments[h]){for(var p=0;p<y;p++)l[p]+=this.dataset[h][p];c++}}if(c>0){for(var p=0;p<y;p++)l[p]/=c;this.centroids[s]=l}else this.centroids[s]=this.randomCentroid(),i=!0}}return this.getClusters()};$d.prototype.randomCentroid=function(){var e=this.dataset.length-1,t,r;do r=Math.round(Math.random()*e),t=this.dataset[r];while(this.centroids.indexOf(t)>=0);return t};$d.prototype.assign=function(){for(var e=!1,t=this.dataset.length,r,n=0;n<t;n++)r=this.argmin(this.dataset[n],this.centroids,this.distance),r!=this.assignments[n]&&(this.assignments[n]=r,e=!0);return e};$d.prototype.getClusters=function(){for(var e=new Array(this.k),t,r=0;r<this.assignments.length;r++)t=this.assignments[r],typeof e[t]>"u"&&(e[t]=[]),e[t].push(r);return e};$d.prototype.argmin=function(e,t,r){for(var n=Number.MAX_VALUE,i=0,s=t.length,l,c=0;c<s;c++)l=r(e,t[c]),l<n&&(n=l,i=c);return i};$d.prototype.distance=function(e,t){for(var r=0,n=Math.min(e.length,t.length);n--;){var i=e[n]-t[n];r+=i*i}return Math.sqrt(r)};typeof iC<"u"&&iC.exports&&(iC.exports=$d)});var lO=fe((RWe,oC)=>{g();function $c(e,t,r){this._queue=[],this._priorities=[],this._sorting="desc",this._init(e,t,r)}o($c,"PriorityQueue");$c.prototype.insert=function(e,t){for(var r=this._queue.length,n=r;n--;){var i=this._priorities[n];this._sorting==="desc"?t>i&&(r=n):t<i&&(r=n)}this._insertAt(e,t,r)};$c.prototype.remove=function(e){for(var t=this._queue.length;t--;){var r=this._queue[t];if(e===r){this._queue.splice(t,1),this._priorities.splice(t,1);break}}};$c.prototype.forEach=function(e){this._queue.forEach(e)};$c.prototype.getElements=function(){return this._queue};$c.prototype.getElementPriority=function(e){return this._priorities[e]};$c.prototype.getPriorities=function(){return this._priorities};$c.prototype.getElementsWithPriorities=function(){for(var e=[],t=0,r=this._queue.length;t<r;t++)e.push([this._queue[t],this._priorities[t]]);return e};$c.prototype._init=function(e,t,r){if(e&&t){if(this._queue=[],this._priorities=[],e.length!==t.length)throw new Error("Arrays must have the same length");for(var n=0;n<e.length;n++)this.insert(e[n],t[n])}r&&(this._sorting=r)};$c.prototype._insertAt=function(e,t,r){this._queue.length===r?(this._queue.push(e),this._priorities.push(t)):(this._queue.splice(r,0,e),this._priorities.splice(r,0,t))};typeof oC<"u"&&oC.exports&&(oC.exports=$c)});var ij=fe((jWe,M0)=>{g();typeof M0<"u"&&M0.exports&&(nj=lO());var nj;function af(e,t,r,n){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(e,t,r,n)}o(af,"OPTICS");af.prototype.run=function(e,t,r,n){this._init(e,t,r,n);for(var i=0,s=this.dataset.length;i<s;i++)if(this._processed[i]!==1){this._processed[i]=1,this.clusters.push([i]);var l=this.clusters.length-1;this._orderedList.push(i);var c=new nj(null,null,"asc"),p=this._regionQuery(i);this._distanceToCore(i)!==void 0&&(this._updateQueue(i,p,c),this._expandCluster(l,c))}return this.clusters};af.prototype.getReachabilityPlot=function(){for(var e=[],t=0,r=this._orderedList.length;t<r;t++){var n=this._orderedList[t],i=this._reachability[n];e.push([n,i])}return e};af.prototype._init=function(e,t,r,n){if(e){if(!(e instanceof Array))throw Error("Dataset must be of type array, "+typeof e+" given");this.dataset=e,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}t&&(this.epsilon=t),r&&(this.minPts=r),n&&(this.distance=n)};af.prototype._updateQueue=function(e,t,r){var n=this;this._coreDistance=this._distanceToCore(e),t.forEach(function(i){if(n._processed[i]===void 0){var s=n.distance(n.dataset[e],n.dataset[i]),l=Math.max(n._coreDistance,s);n._reachability[i]===void 0?(n._reachability[i]=l,r.insert(i,l)):l<n._reachability[i]&&(n._reachability[i]=l,r.remove(i),r.insert(i,l))}})};af.prototype._expandCluster=function(e,t){for(var r=t.getElements(),n=0,i=r.length;n<i;n++){var s=r[n];if(this._processed[s]===void 0){var l=this._regionQuery(s);this._processed[s]=1,this.clusters[e].push(s),this._orderedList.push(s),this._distanceToCore(s)!==void 0&&(this._updateQueue(s,l,t),this._expandCluster(e,t))}}};af.prototype._distanceToCore=function(e){for(var t=this.epsilon,r=0;r<t;r++){var n=this._regionQuery(e,r);if(n.length>=this.minPts)return r}};af.prototype._regionQuery=function(e,t){t=t||this.epsilon;for(var r=[],n=0,i=this.dataset.length;n<i;n++)this.distance(this.dataset[e],this.dataset[n])<t&&r.push(n);return r};af.prototype._euclideanDistance=function(e,t){for(var r=0,n=Math.min(e.length,t.length);n--;)r+=(e[n]-t[n])*(e[n]-t[n]);return Math.sqrt(r)};typeof M0<"u"&&M0.exports&&(M0.exports=af)});var oj=fe((VWe,sC)=>{g();typeof sC<"u"&&sC.exports&&(sC.exports={DBSCAN:tj(),KMEANS:rj(),OPTICS:ij(),PriorityQueue:lO()})});var uO=fe((JWe,aj)=>{"use strict";g();aj.exports={eudist:o(function(t,r,n){for(var i=t.length,s=0,l=0;l<i;l++){var c=(t[l]||0)-(r[l]||0);s+=c*c}return n?Math.sqrt(s):s},"eudist"),mandist:o(function(t,r,n){for(var i=t.length,s=0,l=0;l<i;l++)s+=Math.abs((t[l]||0)-(r[l]||0));return n?Math.sqrt(s):s},"mandist"),dist:o(function(t,r,n){var i=Math.abs(t-r);return n?i:i*i},"dist")}});var cj=fe((tXe,uj)=>{"use strict";g();var lj=uO(),xpe=lj.eudist,Ipe=lj.dist;uj.exports={kmrand:o(function(t,r){for(var n={},i=[],s=r<<2,l=t.length,c=t[0].length>0;i.length<r&&s-- >0;){var p=t[Math.floor(Math.random()*l)],h=c?p.join("_"):""+p;n[h]||(n[h]=!0,i.push(p))}if(i.length<r)throw new Error("Error initializating clusters");return i},"kmrand"),kmpp:o(function(t,r){var n=t[0].length?xpe:Ipe,i=[],s=t.length,l=t[0].length>0,c={},p=t[Math.floor(Math.random()*s)],h=l?p.join("_"):""+p;for(i.push(p),c[h]=!0;i.length<r;){for(var y=[],b=i.length,_=0,C=[],P=0;P<s;P++){for(var E=1/0,T=0;T<b;T++){var O=n(t[P],i[T]);O<=E&&(E=O)}y[P]=E}for(var D=0;D<s;D++)_+=y[D];for(var A=0;A<s;A++)C[A]={i:A,v:t[A],pr:y[A]/_,cs:0};C.sort(function(Y,N){return Y.pr-N.pr}),C[0].cs=C[0].pr;for(var R=1;R<s;R++)C[R].cs=C[R-1].cs+C[R].pr;for(var j=Math.random(),X=0;X<s-1&&C[X++].cs<j;);i.push(C[X-1].v)}return i},"kmpp")}});var mj=fe((sXe,hj)=>{"use strict";g();var cO=uO(),dj=cj(),_pe=cO.eudist,iXe=cO.mandist,oXe=cO.dist,Spe=dj.kmrand,Cpe=dj.kmpp,pj=1e4;function fj(e,t,r){r=r||[];for(var n=0;n<e;n++)r[n]=t;return r}o(fj,"init");function wpe(e,t,r,n){var i=[],s=[],l=[],c=[],p=!1,h=n||pj,y=e.length,b=e[0].length,_=b>0,C=[];if(r)r=="kmrand"?i=Spe(e,t):r=="kmpp"?i=Cpe(e,t):i=r;else for(var P={};i.length<t;){var E=Math.floor(Math.random()*y);P[E]||(P[E]=!0,i.push(e[E]))}do{fj(t,0,C);for(var T=0;T<y;T++){for(var O=1/0,D=0,A=0;A<t;A++){var c=_?_pe(e[T],i[A]):Math.abs(e[T]-i[A]);c<=O&&(O=c,D=A)}l[T]=D,C[D]++}for(var R=[],s=[],j=0,X=0;X<t;X++)R[X]=_?fj(b,0,R[X]):0,s[X]=i[X];if(_){for(var Y=0;Y<t;Y++)i[Y]=[];for(var N=0;N<y;N++)for(var Z=l[N],ae=R[Z],se=e[N],U=0;U<b;U++)ae[U]+=se[U];p=!0;for(var xe=0;xe<t;xe++){for(var ne=i[xe],Pe=R[xe],Ce=s[xe],Ue=C[xe],_e=0;_e<b;_e++)ne[_e]=Pe[_e]/Ue||0;if(p){for(var Me=0;Me<b;Me++)if(Ce[Me]!=ne[Me]){p=!1;break}}}}else{for(var Q=0;Q<y;Q++){var it=l[Q];R[it]+=e[Q]}for(var Ke=0;Ke<t;Ke++)i[Ke]=R[Ke]/C[Ke]||0;p=!0;for(var rt=0;rt<t;rt++)if(s[rt]!=i[rt]){p=!1;break}}p=p||--h<=0}while(!p);return{it:pj-h,k:t,idxs:l,centroids:i}}o(wpe,"skmeans");hj.exports=wpe});var F0=fe((gO,yO)=>{g();(function(e,t){typeof gO=="object"&&typeof yO<"u"?yO.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.polygonClipping=t())})(gO,function(){"use strict";function e(ue,F){var $={label:0,sent:o(function(){if(K[0]&1)throw K[1];return K[1]},"sent"),trys:[],ops:[]},W,J,K,Ie;return Ie={next:ge(0),throw:ge(1),return:ge(2)},typeof Symbol=="function"&&(Ie[Symbol.iterator]=function(){return this}),Ie;function ge(we){return function(Qe){return De([we,Qe])}}function De(we){if(W)throw new TypeError("Generator is already executing.");for(;$;)try{if(W=1,J&&(K=we[0]&2?J.return:we[0]?J.throw||((K=J.return)&&K.call(J),0):J.next)&&!(K=K.call(J,we[1])).done)return K;switch(J=0,K&&(we=[we[0]&2,K.value]),we[0]){case 0:case 1:K=we;break;case 4:return $.label++,{value:we[1],done:!1};case 5:$.label++,J=we[1],we=[0];continue;case 7:we=$.ops.pop(),$.trys.pop();continue;default:if(K=$.trys,!(K=K.length>0&&K[K.length-1])&&(we[0]===6||we[0]===2)){$=0;continue}if(we[0]===3&&(!K||we[1]>K[0]&&we[1]<K[3])){$.label=we[1];break}if(we[0]===6&&$.label<K[1]){$.label=K[1],K=we;break}if(K&&$.label<K[2]){$.label=K[2],$.ops.push(we);break}K[2]&&$.ops.pop(),$.trys.pop();continue}we=F.call(ue,$)}catch(Qe){we=[6,Qe],J=0}finally{W=K=0}if(we[0]&5)throw we[1];return{value:we[0]?we[1]:void 0,done:!0}}}o(e,"__generator");var t=function(){function ue(F,$){this.next=null,this.key=F,this.data=$,this.left=null,this.right=null}return o(ue,"Node"),ue}();function r(ue,F){return ue>F?1:ue<F?-1:0}o(r,"DEFAULT_COMPARE");function n(ue,F,$){for(var W=new t(null,null),J=W,K=W;;){var Ie=$(ue,F.key);if(Ie<0){if(F.left===null)break;if($(ue,F.left.key)<0){var ge=F.left;if(F.left=ge.right,ge.right=F,F=ge,F.left===null)break}K.left=F,K=F,F=F.left}else if(Ie>0){if(F.right===null)break;if($(ue,F.right.key)>0){var ge=F.right;if(F.right=ge.left,ge.left=F,F=ge,F.right===null)break}J.right=F,J=F,F=F.right}else break}return J.right=F.left,K.left=F.right,F.left=W.right,F.right=W.left,F}o(n,"splay");function i(ue,F,$,W){var J=new t(ue,F);if($===null)return J.left=J.right=null,J;$=n(ue,$,W);var K=W(ue,$.key);return K<0?(J.left=$.left,J.right=$,$.left=null):K>=0&&(J.right=$.right,J.left=$,$.right=null),J}o(i,"insert");function s(ue,F,$){var W=null,J=null;if(F){F=n(ue,F,$);var K=$(F.key,ue);K===0?(W=F.left,J=F.right):K<0?(J=F.right,F.right=null,W=F):(W=F.left,F.left=null,J=F)}return{left:W,right:J}}o(s,"split");function l(ue,F,$){return F===null?ue:(ue===null||(F=n(ue.key,F,$),F.left=ue),F)}o(l,"merge");function c(ue,F,$,W,J){if(ue){W(""+F+($?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+J(ue)+"\n");var K=F+($?" ":"\u2502 ");ue.left&&c(ue.left,K,!1,W,J),ue.right&&c(ue.right,K,!0,W,J)}}o(c,"printRow");var p=function(){function ue(F){F===void 0&&(F=r),this._root=null,this._size=0,this._comparator=F}return o(ue,"Tree"),ue.prototype.insert=function(F,$){return this._size++,this._root=i(F,$,this._root,this._comparator)},ue.prototype.add=function(F,$){var W=new t(F,$);this._root===null&&(W.left=W.right=null,this._size++,this._root=W);var J=this._comparator,K=n(F,this._root,J),Ie=J(F,K.key);return Ie===0?this._root=K:(Ie<0?(W.left=K.left,W.right=K,K.left=null):Ie>0&&(W.right=K.right,W.left=K,K.right=null),this._size++,this._root=W),this._root},ue.prototype.remove=function(F){this._root=this._remove(F,this._root,this._comparator)},ue.prototype._remove=function(F,$,W){var J;if($===null)return null;$=n(F,$,W);var K=W(F,$.key);return K===0?($.left===null?J=$.right:(J=n(F,$.left,W),J.right=$.right),this._size--,J):$},ue.prototype.pop=function(){var F=this._root;if(F){for(;F.left;)F=F.left;return this._root=n(F.key,this._root,this._comparator),this._root=this._remove(F.key,this._root,this._comparator),{key:F.key,data:F.data}}return null},ue.prototype.findStatic=function(F){for(var $=this._root,W=this._comparator;$;){var J=W(F,$.key);if(J===0)return $;J<0?$=$.left:$=$.right}return null},ue.prototype.find=function(F){return this._root&&(this._root=n(F,this._root,this._comparator),this._comparator(F,this._root.key)!==0)?null:this._root},ue.prototype.contains=function(F){for(var $=this._root,W=this._comparator;$;){var J=W(F,$.key);if(J===0)return!0;J<0?$=$.left:$=$.right}return!1},ue.prototype.forEach=function(F,$){for(var W=this._root,J=[],K=!1;!K;)W!==null?(J.push(W),W=W.left):J.length!==0?(W=J.pop(),F.call($,W),W=W.right):K=!0;return this},ue.prototype.range=function(F,$,W,J){for(var K=[],Ie=this._comparator,ge=this._root,De;K.length!==0||ge;)if(ge)K.push(ge),ge=ge.left;else{if(ge=K.pop(),De=Ie(ge.key,$),De>0)break;if(Ie(ge.key,F)>=0&&W.call(J,ge))return this;ge=ge.right}return this},ue.prototype.keys=function(){var F=[];return this.forEach(function($){var W=$.key;return F.push(W)}),F},ue.prototype.values=function(){var F=[];return this.forEach(function($){var W=$.data;return F.push(W)}),F},ue.prototype.min=function(){return this._root?this.minNode(this._root).key:null},ue.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},ue.prototype.minNode=function(F){if(F===void 0&&(F=this._root),F)for(;F.left;)F=F.left;return F},ue.prototype.maxNode=function(F){if(F===void 0&&(F=this._root),F)for(;F.right;)F=F.right;return F},ue.prototype.at=function(F){for(var $=this._root,W=!1,J=0,K=[];!W;)if($)K.push($),$=$.left;else if(K.length>0){if($=K.pop(),J===F)return $;J++,$=$.right}else W=!0;return null},ue.prototype.next=function(F){var $=this._root,W=null;if(F.right){for(W=F.right;W.left;)W=W.left;return W}for(var J=this._comparator;$;){var K=J(F.key,$.key);if(K===0)break;K<0?(W=$,$=$.left):$=$.right}return W},ue.prototype.prev=function(F){var $=this._root,W=null;if(F.left!==null){for(W=F.left;W.right;)W=W.right;return W}for(var J=this._comparator;$;){var K=J(F.key,$.key);if(K===0)break;K<0?$=$.left:(W=$,$=$.right)}return W},ue.prototype.clear=function(){return this._root=null,this._size=0,this},ue.prototype.toList=function(){return b(this._root)},ue.prototype.load=function(F,$,W){$===void 0&&($=[]),W===void 0&&(W=!1);var J=F.length,K=this._comparator;if(W&&P(F,$,0,J-1,K),this._root===null)this._root=h(F,$,0,J),this._size=J;else{var Ie=C(this.toList(),y(F,$),K);J=this._size+J,this._root=_({head:Ie},0,J)}return this},ue.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(ue.prototype,"size",{get:o(function(){return this._size},"get"),enumerable:!0,configurable:!0}),Object.defineProperty(ue.prototype,"root",{get:o(function(){return this._root},"get"),enumerable:!0,configurable:!0}),ue.prototype.toString=function(F){F===void 0&&(F=o(function(W){return String(W.key)},"printNode"));var $=[];return c(this._root,"",!0,function(W){return $.push(W)},F),$.join("")},ue.prototype.update=function(F,$,W){var J=this._comparator,K=s(F,this._root,J),Ie=K.left,ge=K.right;J(F,$)<0?ge=i($,W,ge,J):Ie=i($,W,Ie,J),this._root=l(Ie,ge,J)},ue.prototype.split=function(F){return s(F,this._root,this._comparator)},ue.prototype[Symbol.iterator]=function(){var F,$,W;return e(this,function(J){switch(J.label){case 0:F=this._root,$=[],W=!1,J.label=1;case 1:return W?[3,6]:F===null?[3,2]:($.push(F),F=F.left,[3,5]);case 2:return $.length===0?[3,4]:(F=$.pop(),[4,F]);case 3:return J.sent(),F=F.right,[3,5];case 4:W=!0,J.label=5;case 5:return[3,1];case 6:return[2]}})},ue}();function h(ue,F,$,W){var J=W-$;if(J>0){var K=$+Math.floor(J/2),Ie=ue[K],ge=F[K],De=new t(Ie,ge);return De.left=h(ue,F,$,K),De.right=h(ue,F,K+1,W),De}return null}o(h,"loadRecursive");function y(ue,F){for(var $=new t(null,null),W=$,J=0;J<ue.length;J++)W=W.next=new t(ue[J],F[J]);return W.next=null,$.next}o(y,"createList");function b(ue){for(var F=ue,$=[],W=!1,J=new t(null,null),K=J;!W;)F?($.push(F),F=F.left):$.length>0?(F=K=K.next=$.pop(),F=F.right):W=!0;return K.next=null,J.next}o(b,"toList");function _(ue,F,$){var W=$-F;if(W>0){var J=F+Math.floor(W/2),K=_(ue,F,J),Ie=ue.head;return Ie.left=K,ue.head=ue.head.next,Ie.right=_(ue,J+1,$),Ie}return null}o(_,"sortedListToBST");function C(ue,F,$){for(var W=new t(null,null),J=W,K=ue,Ie=F;K!==null&&Ie!==null;)$(K.key,Ie.key)<0?(J.next=K,K=K.next):(J.next=Ie,Ie=Ie.next),J=J.next;return K!==null?J.next=K:Ie!==null&&(J.next=Ie),W.next}o(C,"mergeLists");function P(ue,F,$,W,J){if(!($>=W)){for(var K=ue[$+W>>1],Ie=$-1,ge=W+1;;){do Ie++;while(J(ue[Ie],K)<0);do ge--;while(J(ue[ge],K)>0);if(Ie>=ge)break;var De=ue[Ie];ue[Ie]=ue[ge],ue[ge]=De,De=F[Ie],F[Ie]=F[ge],F[ge]=De}P(ue,F,$,ge,J),P(ue,F,ge+1,W,J)}}o(P,"sort");let E=o((ue,F)=>ue.ll.x<=F.x&&F.x<=ue.ur.x&&ue.ll.y<=F.y&&F.y<=ue.ur.y,"isInBbox"),T=o((ue,F)=>{if(F.ur.x<ue.ll.x||ue.ur.x<F.ll.x||F.ur.y<ue.ll.y||ue.ur.y<F.ll.y)return null;let $=ue.ll.x<F.ll.x?F.ll.x:ue.ll.x,W=ue.ur.x<F.ur.x?ue.ur.x:F.ur.x,J=ue.ll.y<F.ll.y?F.ll.y:ue.ll.y,K=ue.ur.y<F.ur.y?ue.ur.y:F.ur.y;return{ll:{x:$,y:J},ur:{x:W,y:K}}},"getBboxOverlap"),O=Number.EPSILON;O===void 0&&(O=Math.pow(2,-52));let D=O*O,A=o((ue,F)=>{if(-O<ue&&ue<O&&-O<F&&F<O)return 0;let $=ue-F;return $*$<D*ue*F?0:ue<F?-1:1},"cmp"),Qo=class Qo{constructor(){this.reset()}reset(){this.xRounder=new j,this.yRounder=new j}round(F,$){return{x:this.xRounder.round(F),y:this.yRounder.round($)}}};o(Qo,"PtRounder");let R=Qo,ro=class ro{constructor(){this.tree=new p,this.round(0)}round(F){let $=this.tree.add(F),W=this.tree.prev($);if(W!==null&&A($.key,W.key)===0)return this.tree.remove(F),W.key;let J=this.tree.next($);return J!==null&&A($.key,J.key)===0?(this.tree.remove(F),J.key):F}};o(ro,"CoordRounder");let j=ro,X=new R,Y=11102230246251565e-32,N=134217729,Z=(3+8*Y)*Y;function ae(ue,F,$,W,J){let K,Ie,ge,De,we=F[0],Qe=W[0],de=0,Fe=0;Qe>we==Qe>-we?(K=we,we=F[++de]):(K=Qe,Qe=W[++Fe]);let Le=0;if(de<ue&&Fe<$)for(Qe>we==Qe>-we?(Ie=we+K,ge=K-(Ie-we),we=F[++de]):(Ie=Qe+K,ge=K-(Ie-Qe),Qe=W[++Fe]),K=Ie,ge!==0&&(J[Le++]=ge);de<ue&&Fe<$;)Qe>we==Qe>-we?(Ie=K+we,De=Ie-K,ge=K-(Ie-De)+(we-De),we=F[++de]):(Ie=K+Qe,De=Ie-K,ge=K-(Ie-De)+(Qe-De),Qe=W[++Fe]),K=Ie,ge!==0&&(J[Le++]=ge);for(;de<ue;)Ie=K+we,De=Ie-K,ge=K-(Ie-De)+(we-De),we=F[++de],K=Ie,ge!==0&&(J[Le++]=ge);for(;Fe<$;)Ie=K+Qe,De=Ie-K,ge=K-(Ie-De)+(Qe-De),Qe=W[++Fe],K=Ie,ge!==0&&(J[Le++]=ge);return(K!==0||Le===0)&&(J[Le++]=K),Le}o(ae,"sum");function se(ue,F){let $=F[0];for(let W=1;W<ue;W++)$+=F[W];return $}o(se,"estimate");function U(ue){return new Float64Array(ue)}o(U,"vec");let xe=(3+16*Y)*Y,ne=(2+12*Y)*Y,Pe=(9+64*Y)*Y*Y,Ce=U(4),Ue=U(8),_e=U(12),Me=U(16),Q=U(4);function it(ue,F,$,W,J,K,Ie){let ge,De,we,Qe,de,Fe,Le,bt,dt,kt,xt,dn,_n,si,Sn,no,Qt,Gt,rs=ue-J,jn=$-J,Hi=F-K,Xr=W-K;si=rs*Xr,Fe=N*rs,Le=Fe-(Fe-rs),bt=rs-Le,Fe=N*Xr,dt=Fe-(Fe-Xr),kt=Xr-dt,Sn=bt*kt-(si-Le*dt-bt*dt-Le*kt),no=Hi*jn,Fe=N*Hi,Le=Fe-(Fe-Hi),bt=Hi-Le,Fe=N*jn,dt=Fe-(Fe-jn),kt=jn-dt,Qt=bt*kt-(no-Le*dt-bt*dt-Le*kt),xt=Sn-Qt,de=Sn-xt,Ce[0]=Sn-(xt+de)+(de-Qt),dn=si+xt,de=dn-si,_n=si-(dn-de)+(xt-de),xt=_n-no,de=_n-xt,Ce[1]=_n-(xt+de)+(de-no),Gt=dn+xt,de=Gt-dn,Ce[2]=dn-(Gt-de)+(xt-de),Ce[3]=Gt;let Es=se(4,Ce),ns=ne*Ie;if(Es>=ns||-Es>=ns||(de=ue-rs,ge=ue-(rs+de)+(de-J),de=$-jn,we=$-(jn+de)+(de-J),de=F-Hi,De=F-(Hi+de)+(de-K),de=W-Xr,Qe=W-(Xr+de)+(de-K),ge===0&&De===0&&we===0&&Qe===0)||(ns=Pe*Ie+Z*Math.abs(Es),Es+=rs*Qe+Xr*ge-(Hi*we+jn*De),Es>=ns||-Es>=ns))return Es;si=ge*Xr,Fe=N*ge,Le=Fe-(Fe-ge),bt=ge-Le,Fe=N*Xr,dt=Fe-(Fe-Xr),kt=Xr-dt,Sn=bt*kt-(si-Le*dt-bt*dt-Le*kt),no=De*jn,Fe=N*De,Le=Fe-(Fe-De),bt=De-Le,Fe=N*jn,dt=Fe-(Fe-jn),kt=jn-dt,Qt=bt*kt-(no-Le*dt-bt*dt-Le*kt),xt=Sn-Qt,de=Sn-xt,Q[0]=Sn-(xt+de)+(de-Qt),dn=si+xt,de=dn-si,_n=si-(dn-de)+(xt-de),xt=_n-no,de=_n-xt,Q[1]=_n-(xt+de)+(de-no),Gt=dn+xt,de=Gt-dn,Q[2]=dn-(Gt-de)+(xt-de),Q[3]=Gt;let Ka=ae(4,Ce,4,Q,Ue);si=rs*Qe,Fe=N*rs,Le=Fe-(Fe-rs),bt=rs-Le,Fe=N*Qe,dt=Fe-(Fe-Qe),kt=Qe-dt,Sn=bt*kt-(si-Le*dt-bt*dt-Le*kt),no=Hi*we,Fe=N*Hi,Le=Fe-(Fe-Hi),bt=Hi-Le,Fe=N*we,dt=Fe-(Fe-we),kt=we-dt,Qt=bt*kt-(no-Le*dt-bt*dt-Le*kt),xt=Sn-Qt,de=Sn-xt,Q[0]=Sn-(xt+de)+(de-Qt),dn=si+xt,de=dn-si,_n=si-(dn-de)+(xt-de),xt=_n-no,de=_n-xt,Q[1]=_n-(xt+de)+(de-no),Gt=dn+xt,de=Gt-dn,Q[2]=dn-(Gt-de)+(xt-de),Q[3]=Gt;let Ms=ae(Ka,Ue,4,Q,_e);si=ge*Qe,Fe=N*ge,Le=Fe-(Fe-ge),bt=ge-Le,Fe=N*Qe,dt=Fe-(Fe-Qe),kt=Qe-dt,Sn=bt*kt-(si-Le*dt-bt*dt-Le*kt),no=De*we,Fe=N*De,Le=Fe-(Fe-De),bt=De-Le,Fe=N*we,dt=Fe-(Fe-we),kt=we-dt,Qt=bt*kt-(no-Le*dt-bt*dt-Le*kt),xt=Sn-Qt,de=Sn-xt,Q[0]=Sn-(xt+de)+(de-Qt),dn=si+xt,de=dn-si,_n=si-(dn-de)+(xt-de),xt=_n-no,de=_n-xt,Q[1]=_n-(xt+de)+(de-no),Gt=dn+xt,de=Gt-dn,Q[2]=dn-(Gt-de)+(xt-de),Q[3]=Gt;let Uy=ae(Ms,_e,4,Q,Me);return Me[Uy-1]}o(it,"orient2dadapt");function Ke(ue,F,$,W,J,K){let Ie=(F-K)*($-J),ge=(ue-J)*(W-K),De=Ie-ge,we=Math.abs(Ie+ge);return Math.abs(De)>=xe*we?De:-it(ue,F,$,W,J,K,we)}o(Ke,"orient2d");let rt=o((ue,F)=>ue.x*F.y-ue.y*F.x,"crossProduct"),Ae=o((ue,F)=>ue.x*F.x+ue.y*F.y,"dotProduct"),Be=o((ue,F,$)=>{let W=Ke(ue.x,ue.y,F.x,F.y,$.x,$.y);return W>0?-1:W<0?1:0},"compareVectorAngles"),We=o(ue=>Math.sqrt(Ae(ue,ue)),"length"),je=o((ue,F,$)=>{let W={x:F.x-ue.x,y:F.y-ue.y},J={x:$.x-ue.x,y:$.y-ue.y};return rt(J,W)/We(J)/We(W)},"sineOfAngle"),Se=o((ue,F,$)=>{let W={x:F.x-ue.x,y:F.y-ue.y},J={x:$.x-ue.x,y:$.y-ue.y};return Ae(J,W)/We(J)/We(W)},"cosineOfAngle"),H=o((ue,F,$)=>F.y===0?null:{x:ue.x+F.x/F.y*($-ue.y),y:$},"horizontalIntersection"),ie=o((ue,F,$)=>F.x===0?null:{x:$,y:ue.y+F.y/F.x*($-ue.x)},"verticalIntersection"),ee=o((ue,F,$,W)=>{if(F.x===0)return ie($,W,ue.x);if(W.x===0)return ie(ue,F,$.x);if(F.y===0)return H($,W,ue.y);if(W.y===0)return H(ue,F,$.y);let J=rt(F,W);if(J==0)return null;let K={x:$.x-ue.x,y:$.y-ue.y},Ie=rt(K,F)/J,ge=rt(K,W)/J,De=ue.x+ge*F.x,we=$.x+Ie*W.x,Qe=ue.y+ge*F.y,de=$.y+Ie*W.y,Fe=(De+we)/2,Le=(Qe+de)/2;return{x:Fe,y:Le}},"intersection$1"),es=class es{static compare(F,$){let W=es.comparePoints(F.point,$.point);return W!==0?W:(F.point!==$.point&&F.link($),F.isLeft!==$.isLeft?F.isLeft?1:-1:Oe.compare(F.segment,$.segment))}static comparePoints(F,$){return F.x<$.x?-1:F.x>$.x?1:F.y<$.y?-1:F.y>$.y?1:0}constructor(F,$){F.events===void 0?F.events=[this]:F.events.push(this),this.point=F,this.isLeft=$}link(F){if(F.point===this.point)throw new Error("Tried to link already linked events");let $=F.point.events;for(let W=0,J=$.length;W<J;W++){let K=$[W];this.point.events.push(K),K.point=this.point}this.checkForConsuming()}checkForConsuming(){let F=this.point.events.length;for(let $=0;$<F;$++){let W=this.point.events[$];if(W.segment.consumedBy===void 0)for(let J=$+1;J<F;J++){let K=this.point.events[J];K.consumedBy===void 0&&W.otherSE.point.events===K.otherSE.point.events&&W.segment.consume(K.segment)}}}getAvailableLinkedEvents(){let F=[];for(let $=0,W=this.point.events.length;$<W;$++){let J=this.point.events[$];J!==this&&!J.segment.ringOut&&J.segment.isInResult()&&F.push(J)}return F}getLeftmostComparator(F){let $=new Map,W=o(J=>{let K=J.otherSE;$.set(J,{sine:je(this.point,F.point,K.point),cosine:Se(this.point,F.point,K.point)})},"fillCache");return(J,K)=>{$.has(J)||W(J),$.has(K)||W(K);let{sine:Ie,cosine:ge}=$.get(J),{sine:De,cosine:we}=$.get(K);return Ie>=0&&De>=0?ge<we?1:ge>we?-1:0:Ie<0&&De<0?ge<we?-1:ge>we?1:0:De<Ie?-1:De>Ie?1:0}}};o(es,"SweepEvent");let Ee=es,Ne=0,Za=class Za{static compare(F,$){let W=F.leftSE.point.x,J=$.leftSE.point.x,K=F.rightSE.point.x,Ie=$.rightSE.point.x;if(Ie<W)return 1;if(K<J)return-1;let ge=F.leftSE.point.y,De=$.leftSE.point.y,we=F.rightSE.point.y,Qe=$.rightSE.point.y;if(W<J){if(De<ge&&De<we)return 1;if(De>ge&&De>we)return-1;let de=F.comparePoint($.leftSE.point);if(de<0)return 1;if(de>0)return-1;let Fe=$.comparePoint(F.rightSE.point);return Fe!==0?Fe:-1}if(W>J){if(ge<De&&ge<Qe)return-1;if(ge>De&&ge>Qe)return 1;let de=$.comparePoint(F.leftSE.point);if(de!==0)return de;let Fe=F.comparePoint($.rightSE.point);return Fe<0?1:Fe>0?-1:1}if(ge<De)return-1;if(ge>De)return 1;if(K<Ie){let de=$.comparePoint(F.rightSE.point);if(de!==0)return de}if(K>Ie){let de=F.comparePoint($.rightSE.point);if(de<0)return 1;if(de>0)return-1}if(K!==Ie){let de=we-ge,Fe=K-W,Le=Qe-De,bt=Ie-J;if(de>Fe&&Le<bt)return 1;if(de<Fe&&Le>bt)return-1}return K>Ie?1:K<Ie||we<Qe?-1:we>Qe?1:F.id<$.id?-1:F.id>$.id?1:0}constructor(F,$,W,J){this.id=++Ne,this.leftSE=F,F.segment=this,F.otherSE=$,this.rightSE=$,$.segment=this,$.otherSE=F,this.rings=W,this.windings=J}static fromRing(F,$,W){let J,K,Ie,ge=Ee.comparePoints(F,$);if(ge<0)J=F,K=$,Ie=1;else if(ge>0)J=$,K=F,Ie=-1;else throw new Error("Tried to create degenerate segment at [".concat(F.x,", ").concat(F.y,"]"));let De=new Ee(J,!0),we=new Ee(K,!1);return new Za(De,we,[W],[Ie])}replaceRightSE(F){this.rightSE=F,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let F=this.leftSE.point.y,$=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:F<$?F:$},ur:{x:this.rightSE.point.x,y:F>$?F:$}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(F){return F.x===this.leftSE.point.x&&F.y===this.leftSE.point.y||F.x===this.rightSE.point.x&&F.y===this.rightSE.point.y}comparePoint(F){if(this.isAnEndpoint(F))return 0;let $=this.leftSE.point,W=this.rightSE.point,J=this.vector();if($.x===W.x)return F.x===$.x?0:F.x<$.x?1:-1;let K=(F.y-$.y)/J.y,Ie=$.x+K*J.x;if(F.x===Ie)return 0;let ge=(F.x-$.x)/J.x,De=$.y+ge*J.y;return F.y===De?0:F.y<De?-1:1}getIntersection(F){let $=this.bbox(),W=F.bbox(),J=T($,W);if(J===null)return null;let K=this.leftSE.point,Ie=this.rightSE.point,ge=F.leftSE.point,De=F.rightSE.point,we=E($,ge)&&this.comparePoint(ge)===0,Qe=E(W,K)&&F.comparePoint(K)===0,de=E($,De)&&this.comparePoint(De)===0,Fe=E(W,Ie)&&F.comparePoint(Ie)===0;if(Qe&&we)return Fe&&!de?Ie:!Fe&&de?De:null;if(Qe)return de&&K.x===De.x&&K.y===De.y?null:K;if(we)return Fe&&Ie.x===ge.x&&Ie.y===ge.y?null:ge;if(Fe&&de)return null;if(Fe)return Ie;if(de)return De;let Le=ee(K,this.vector(),ge,F.vector());return Le===null||!E(J,Le)?null:X.round(Le.x,Le.y)}split(F){let $=[],W=F.events!==void 0,J=new Ee(F,!0),K=new Ee(F,!1),Ie=this.rightSE;this.replaceRightSE(K),$.push(K),$.push(J);let ge=new Za(J,Ie,this.rings.slice(),this.windings.slice());return Ee.comparePoints(ge.leftSE.point,ge.rightSE.point)>0&&ge.swapEvents(),Ee.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),W&&(J.checkForConsuming(),K.checkForConsuming()),$}swapEvents(){let F=this.rightSE;this.rightSE=this.leftSE,this.leftSE=F,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let $=0,W=this.windings.length;$<W;$++)this.windings[$]*=-1}consume(F){let $=this,W=F;for(;$.consumedBy;)$=$.consumedBy;for(;W.consumedBy;)W=W.consumedBy;let J=Za.compare($,W);if(J!==0){if(J>0){let K=$;$=W,W=K}if($.prev===W){let K=$;$=W,W=K}for(let K=0,Ie=W.rings.length;K<Ie;K++){let ge=W.rings[K],De=W.windings[K],we=$.rings.indexOf(ge);we===-1?($.rings.push(ge),$.windings.push(De)):$.windings[we]+=De}W.rings=null,W.windings=null,W.consumedBy=$,W.leftSE.consumedBy=$.leftSE,W.rightSE.consumedBy=$.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{let F=this.prev.consumedBy||this.prev;this._beforeState=F.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let F=this.beforeState();this._afterState={rings:F.rings.slice(0),windings:F.windings.slice(0),multiPolys:[]};let $=this._afterState.rings,W=this._afterState.windings,J=this._afterState.multiPolys;for(let ge=0,De=this.rings.length;ge<De;ge++){let we=this.rings[ge],Qe=this.windings[ge],de=$.indexOf(we);de===-1?($.push(we),W.push(Qe)):W[de]+=Qe}let K=[],Ie=[];for(let ge=0,De=$.length;ge<De;ge++){if(W[ge]===0)continue;let we=$[ge],Qe=we.poly;if(Ie.indexOf(Qe)===-1)if(we.isExterior)K.push(Qe);else{Ie.indexOf(Qe)===-1&&Ie.push(Qe);let de=K.indexOf(we.poly);de!==-1&&K.splice(de,1)}}for(let ge=0,De=K.length;ge<De;ge++){let we=K[ge].multiPoly;J.indexOf(we)===-1&&J.push(we)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let F=this.beforeState().multiPolys,$=this.afterState().multiPolys;switch(ze.type){case"union":{let W=F.length===0,J=$.length===0;this._isInResult=W!==J;break}case"intersection":{let W,J;F.length<$.length?(W=F.length,J=$.length):(W=$.length,J=F.length),this._isInResult=J===ze.numMultiPolys&&W<J;break}case"xor":{let W=Math.abs(F.length-$.length);this._isInResult=W%2===1;break}case"difference":{let W=o(J=>J.length===1&&J[0].isSubject,"isJustSubject");this._isInResult=W(F)!==W($);break}default:throw new Error("Unrecognized operation type found ".concat(ze.type))}return this._isInResult}};o(Za,"Segment");let Oe=Za,hc=class hc{constructor(F,$,W){if(!Array.isArray(F)||F.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=$,this.isExterior=W,this.segments=[],typeof F[0][0]!="number"||typeof F[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let J=X.round(F[0][0],F[0][1]);this.bbox={ll:{x:J.x,y:J.y},ur:{x:J.x,y:J.y}};let K=J;for(let Ie=1,ge=F.length;Ie<ge;Ie++){if(typeof F[Ie][0]!="number"||typeof F[Ie][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let De=X.round(F[Ie][0],F[Ie][1]);De.x===K.x&&De.y===K.y||(this.segments.push(Oe.fromRing(K,De,this)),De.x<this.bbox.ll.x&&(this.bbox.ll.x=De.x),De.y<this.bbox.ll.y&&(this.bbox.ll.y=De.y),De.x>this.bbox.ur.x&&(this.bbox.ur.x=De.x),De.y>this.bbox.ur.y&&(this.bbox.ur.y=De.y),K=De)}(J.x!==K.x||J.y!==K.y)&&this.segments.push(Oe.fromRing(K,J,this))}getSweepEvents(){let F=[];for(let $=0,W=this.segments.length;$<W;$++){let J=this.segments[$];F.push(J.leftSE),F.push(J.rightSE)}return F}};o(hc,"RingIn");let Ye=hc,mc=class mc{constructor(F,$){if(!Array.isArray(F))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Ye(F[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 W=1,J=F.length;W<J;W++){let K=new Ye(F[W],this,!1);K.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=K.bbox.ll.x),K.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=K.bbox.ll.y),K.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=K.bbox.ur.x),K.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=K.bbox.ur.y),this.interiorRings.push(K)}this.multiPoly=$}getSweepEvents(){let F=this.exteriorRing.getSweepEvents();for(let $=0,W=this.interiorRings.length;$<W;$++){let J=this.interiorRings[$].getSweepEvents();for(let K=0,Ie=J.length;K<Ie;K++)F.push(J[K])}return F}};o(mc,"PolyIn");let Pt=mc,gc=class gc{constructor(F,$){if(!Array.isArray(F))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof F[0][0][0]=="number"&&(F=[F])}catch(W){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let W=0,J=F.length;W<J;W++){let K=new Pt(F[W],this);K.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=K.bbox.ll.x),K.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=K.bbox.ll.y),K.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=K.bbox.ur.x),K.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=K.bbox.ur.y),this.polys.push(K)}this.isSubject=$}getSweepEvents(){let F=[];for(let $=0,W=this.polys.length;$<W;$++){let J=this.polys[$].getSweepEvents();for(let K=0,Ie=J.length;K<Ie;K++)F.push(J[K])}return F}};o(gc,"MultiPolyIn");let Er=gc,On=class On{static factory(F){let $=[];for(let W=0,J=F.length;W<J;W++){let K=F[W];if(!K.isInResult()||K.ringOut)continue;let Ie=null,ge=K.leftSE,De=K.rightSE,we=[ge],Qe=ge.point,de=[];for(;Ie=ge,ge=De,we.push(ge),ge.point!==Qe;)for(;;){let Fe=ge.getAvailableLinkedEvents();if(Fe.length===0){let dt=we[0].point,kt=we[we.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(dt.x,",")+" ".concat(dt.y,"]. Last matching segment found ends at")+" [".concat(kt.x,", ").concat(kt.y,"]."))}if(Fe.length===1){De=Fe[0].otherSE;break}let Le=null;for(let dt=0,kt=de.length;dt<kt;dt++)if(de[dt].point===ge.point){Le=dt;break}if(Le!==null){let dt=de.splice(Le)[0],kt=we.splice(dt.index);kt.unshift(kt[0].otherSE),$.push(new On(kt.reverse()));continue}de.push({index:we.length,point:ge.point});let bt=ge.getLeftmostComparator(Ie);De=Fe.sort(bt)[0].otherSE;break}$.push(new On(we))}return $}constructor(F){this.events=F;for(let $=0,W=F.length;$<W;$++)F[$].segment.ringOut=this;this.poly=null}getGeom(){let F=this.events[0].point,$=[F];for(let we=1,Qe=this.events.length-1;we<Qe;we++){let de=this.events[we].point,Fe=this.events[we+1].point;Be(de,F,Fe)!==0&&($.push(de),F=de)}if($.length===1)return null;let W=$[0],J=$[1];Be(W,F,J)===0&&$.shift(),$.push($[0]);let K=this.isExteriorRing()?1:-1,Ie=this.isExteriorRing()?0:$.length-1,ge=this.isExteriorRing()?$.length:-1,De=[];for(let we=Ie;we!=ge;we+=K)De.push([$[we].x,$[we].y]);return De}isExteriorRing(){if(this._isExteriorRing===void 0){let F=this.enclosingRing();this._isExteriorRing=F?!F.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let F=this.events[0];for(let J=1,K=this.events.length;J<K;J++){let Ie=this.events[J];Ee.compare(F,Ie)>0&&(F=Ie)}let $=F.segment.prevInResult(),W=$?$.prevInResult():null;for(;;){if(!$)return null;if(!W)return $.ringOut;if(W.ringOut!==$.ringOut)return W.ringOut.enclosingRing()!==$.ringOut?$.ringOut:$.ringOut.enclosingRing();$=W.prevInResult(),W=$?$.prevInResult():null}}};o(On,"RingOut");let $n=On,yc=class yc{constructor(F){this.exteriorRing=F,F.poly=this,this.interiorRings=[]}addInterior(F){this.interiorRings.push(F),F.poly=this}getGeom(){let F=[this.exteriorRing.getGeom()];if(F[0]===null)return null;for(let $=0,W=this.interiorRings.length;$<W;$++){let J=this.interiorRings[$].getGeom();J!==null&&F.push(J)}return F}};o(yc,"PolyOut");let ot=yc,ts=class ts{constructor(F){this.rings=F,this.polys=this._composePolys(F)}getGeom(){let F=[];for(let $=0,W=this.polys.length;$<W;$++){let J=this.polys[$].getGeom();J!==null&&F.push(J)}return F}_composePolys(F){let $=[];for(let W=0,J=F.length;W<J;W++){let K=F[W];if(!K.poly)if(K.isExteriorRing())$.push(new ot(K));else{let Ie=K.enclosingRing();Ie.poly||$.push(new ot(Ie)),Ie.poly.addInterior(K)}}return $}};o(ts,"MultiPolyOut");let zt=ts,He=class He{constructor(F){let $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Oe.compare;this.queue=F,this.tree=new p($),this.segments=[]}process(F){let $=F.segment,W=[];if(F.consumedBy)return F.isLeft?this.queue.remove(F.otherSE):this.tree.remove($),W;let J=F.isLeft?this.tree.add($):this.tree.find($);if(!J)throw new Error("Unable to find segment #".concat($.id," ")+"[".concat($.leftSE.point.x,", ").concat($.leftSE.point.y,"] -> ")+"[".concat($.rightSE.point.x,", ").concat($.rightSE.point.y,"] ")+"in SweepLine tree.");let K=J,Ie=J,ge,De;for(;ge===void 0;)K=this.tree.prev(K),K===null?ge=null:K.key.consumedBy===void 0&&(ge=K.key);for(;De===void 0;)Ie=this.tree.next(Ie),Ie===null?De=null:Ie.key.consumedBy===void 0&&(De=Ie.key);if(F.isLeft){let we=null;if(ge){let de=ge.getIntersection($);if(de!==null&&($.isAnEndpoint(de)||(we=de),!ge.isAnEndpoint(de))){let Fe=this._splitSafely(ge,de);for(let Le=0,bt=Fe.length;Le<bt;Le++)W.push(Fe[Le])}}let Qe=null;if(De){let de=De.getIntersection($);if(de!==null&&($.isAnEndpoint(de)||(Qe=de),!De.isAnEndpoint(de))){let Fe=this._splitSafely(De,de);for(let Le=0,bt=Fe.length;Le<bt;Le++)W.push(Fe[Le])}}if(we!==null||Qe!==null){let de=null;we===null?de=Qe:Qe===null?de=we:de=Ee.comparePoints(we,Qe)<=0?we:Qe,this.queue.remove($.rightSE),W.push($.rightSE);let Fe=$.split(de);for(let Le=0,bt=Fe.length;Le<bt;Le++)W.push(Fe[Le])}W.length>0?(this.tree.remove($),W.push(F)):(this.segments.push($),$.prev=ge)}else{if(ge&&De){let we=ge.getIntersection(De);if(we!==null){if(!ge.isAnEndpoint(we)){let Qe=this._splitSafely(ge,we);for(let de=0,Fe=Qe.length;de<Fe;de++)W.push(Qe[de])}if(!De.isAnEndpoint(we)){let Qe=this._splitSafely(De,we);for(let de=0,Fe=Qe.length;de<Fe;de++)W.push(Qe[de])}}}this.tree.remove($)}return W}_splitSafely(F,$){this.tree.remove(F);let W=F.rightSE;this.queue.remove(W);let J=F.split($);return J.push(W),F.consumedBy===void 0&&this.tree.add(F),J}};o(He,"SweepLine");let Jo=He,Ro=typeof I<"u"&&I.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Ks=typeof I<"u"&&I.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,db=class db{run(F,$,W){ze.type=F,X.reset();let J=[new Er($,!0)];for(let de=0,Fe=W.length;de<Fe;de++)J.push(new Er(W[de],!1));if(ze.numMultiPolys=J.length,ze.type==="difference"){let de=J[0],Fe=1;for(;Fe<J.length;)T(J[Fe].bbox,de.bbox)!==null?Fe++:J.splice(Fe,1)}if(ze.type==="intersection")for(let de=0,Fe=J.length;de<Fe;de++){let Le=J[de];for(let bt=de+1,dt=J.length;bt<dt;bt++)if(T(Le.bbox,J[bt].bbox)===null)return[]}let K=new p(Ee.compare);for(let de=0,Fe=J.length;de<Fe;de++){let Le=J[de].getSweepEvents();for(let bt=0,dt=Le.length;bt<dt;bt++)if(K.insert(Le[bt]),K.size>Ro)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let Ie=new Jo(K),ge=K.size,De=K.pop();for(;De;){let de=De.key;if(K.size===ge){let Le=de.segment;throw new Error("Unable to pop() ".concat(de.isLeft?"left":"right"," SweepEvent ")+"[".concat(de.point.x,", ").concat(de.point.y,"] from segment #").concat(Le.id," ")+"[".concat(Le.leftSE.point.x,", ").concat(Le.leftSE.point.y,"] -> ")+"[".concat(Le.rightSE.point.x,", ").concat(Le.rightSE.point.y,"] from queue."))}if(K.size>Ro)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(Ie.segments.length>Ks)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let Fe=Ie.process(de);for(let Le=0,bt=Fe.length;Le<bt;Le++){let dt=Fe[Le];dt.consumedBy===void 0&&K.insert(dt)}ge=K.size,De=K.pop()}X.reset();let we=$n.factory(Ie.segments);return new zt(we).getGeom()}};o(db,"Operation");let Ri=db,ze=new Ri;var dc={union:o(function(ue){for(var F=arguments.length,$=new Array(F>1?F-1:0),W=1;W<F;W++)$[W-1]=arguments[W];return ze.run("union",ue,$)},"union"),intersection:o(function(ue){for(var F=arguments.length,$=new Array(F>1?F-1:0),W=1;W<F;W++)$[W-1]=arguments[W];return ze.run("intersection",ue,$)},"intersection"),xor:o(function(ue){for(var F=arguments.length,$=new Array(F>1?F-1:0),W=1;W<F;W++)$[W-1]=arguments[W];return ze.run("xor",ue,$)},"xor"),difference:o(function(ue){for(var F=arguments.length,$=new Array(F>1?F-1:0),W=1;W<F;W++)$[W-1]=arguments[W];return ze.run("difference",ue,$)},"difference")};return dc})});var Fj=fe((cC,Dj)=>{g();(function(e,t){typeof cC=="object"&&typeof Dj<"u"?t(cC):typeof define=="function"&&define.amd?define(["exports"],t):t(e.jsts={})})(cC,function(e){"use strict";function t(){}o(t,"e");function r(a){this.message=a||""}o(r,"n");function n(a){this.message=a||""}o(n,"i");function i(a){this.message=a||""}o(i,"r");function s(){}o(s,"o");function l(a){return a===null?we:a.color}o(l,"s");function c(a){return a===null?null:a.parent}o(c,"a");function p(a,u){a!==null&&(a.color=u)}o(p,"u");function h(a){return a===null?null:a.left}o(h,"l");function y(a){return a===null?null:a.right}o(y,"c");function b(){this.root_=null,this.size_=0}o(b,"p");function _(){}o(_,"h");function C(){this.array_=[],arguments[0]instanceof On&&this.addAll(arguments[0])}o(C,"f");function P(){}o(P,"g");function E(a){this.message=a||""}o(E,"d");function T(){this.array_=[]}o(T,"y"),"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:o(function(a){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var u=Object(this),f=Math.max(Math.min(u.length,9007199254740991),0)||0,m=1 in arguments&&parseInt(Number(arguments[1]),10)||0;m=m<0?Math.max(f+m,0):Math.min(m,f);var v=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:f;for(v=v<0?Math.max(f+arguments[2],0):Math.min(v,f);m<v;)u[m]=a,++m;return u},"value"),writable:!0}),Number.isFinite=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},Number.isInteger=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(a){return a!=a},Math.trunc=Math.trunc||function(a){return a<0?Math.ceil(a):Math.floor(a)};var O=o(function(){},"_");O.prototype.interfaces_=function(){return[]},O.prototype.getClass=function(){return O},O.prototype.equalsWithTolerance=function(a,u,f){return Math.abs(a-u)<=f};var D=function(a){function u(f){a.call(this,f),this.name="IllegalArgumentException",this.message=f,this.stack=new a().stack}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u}(Error),A=o(function(){},"v"),R={MAX_VALUE:{configurable:!0}};A.isNaN=function(a){return Number.isNaN(a)},A.doubleToLongBits=function(a){return a},A.longBitsToDouble=function(a){return a},A.isInfinite=function(a){return!Number.isFinite(a)},R.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(A,R);var j=o(function(){},"E"),X=o(function(){},"x"),Y=o(function(){},"N"),N=o(function a(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=a.NULL_ORDINATE;else if(arguments.length===1){var u=arguments[0];this.x=u.x,this.y=u.y,this.z=u.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=a.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},"t"),Z={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};N.prototype.setOrdinate=function(a,u){switch(a){case N.X:this.x=u;break;case N.Y:this.y=u;break;case N.Z:this.z=u;break;default:throw new D("Invalid ordinate index: "+a)}},N.prototype.equals2D=function(){if(arguments.length===1){var a=arguments[0];return this.x===a.x&&this.y===a.y}if(arguments.length===2){var u=arguments[0],f=arguments[1];return!!O.equalsWithTolerance(this.x,u.x,f)&&!!O.equalsWithTolerance(this.y,u.y,f)}},N.prototype.getOrdinate=function(a){switch(a){case N.X:return this.x;case N.Y:return this.y;case N.Z:return this.z}throw new D("Invalid ordinate index: "+a)},N.prototype.equals3D=function(a){return this.x===a.x&&this.y===a.y&&(this.z===a.z||A.isNaN(this.z))&&A.isNaN(a.z)},N.prototype.equals=function(a){return a instanceof N&&this.equals2D(a)},N.prototype.equalInZ=function(a,u){return O.equalsWithTolerance(this.z,a.z,u)},N.prototype.compareTo=function(a){var u=a;return this.x<u.x?-1:this.x>u.x?1:this.y<u.y?-1:this.y>u.y?1:0},N.prototype.clone=function(){},N.prototype.copy=function(){return new N(this)},N.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},N.prototype.distance3D=function(a){var u=this.x-a.x,f=this.y-a.y,m=this.z-a.z;return Math.sqrt(u*u+f*f+m*m)},N.prototype.distance=function(a){var u=this.x-a.x,f=this.y-a.y;return Math.sqrt(u*u+f*f)},N.prototype.hashCode=function(){var a=17;return a=37*a+N.hashCode(this.x),a=37*a+N.hashCode(this.y)},N.prototype.setCoordinate=function(a){this.x=a.x,this.y=a.y,this.z=a.z},N.prototype.interfaces_=function(){return[j,X,t]},N.prototype.getClass=function(){return N},N.hashCode=function(){if(arguments.length===1){var a=arguments[0],u=A.doubleToLongBits(a);return Math.trunc((u^u)>>>32)}},Z.DimensionalComparator.get=function(){return ae},Z.serialVersionUID.get=function(){return 6683108902428367e3},Z.NULL_ORDINATE.get=function(){return A.NaN},Z.X.get=function(){return 0},Z.Y.get=function(){return 1},Z.Z.get=function(){return 2},Object.defineProperties(N,Z);var ae=o(function(a){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var u=arguments[0];if(u!==2&&u!==3)throw new D("only 2 or 3 dimensions may be specified");this._dimensionsToTest=u}}},"L");ae.prototype.compare=function(a,u){var f=a,m=u,v=ae.compare(f.x,m.x);if(v!==0)return v;var S=ae.compare(f.y,m.y);return S!==0?S:this._dimensionsToTest<=2?0:ae.compare(f.z,m.z)},ae.prototype.interfaces_=function(){return[Y]},ae.prototype.getClass=function(){return ae},ae.compare=function(a,u){return a<u?-1:a>u?1:A.isNaN(a)?A.isNaN(u)?0:-1:A.isNaN(u)?1:0};var se=o(function(){},"b");se.prototype.create=function(){},se.prototype.interfaces_=function(){return[]},se.prototype.getClass=function(){return se};var U=o(function(){},"w"),xe={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};U.prototype.interfaces_=function(){return[]},U.prototype.getClass=function(){return U},U.toLocationSymbol=function(a){switch(a){case U.EXTERIOR:return"e";case U.BOUNDARY:return"b";case U.INTERIOR:return"i";case U.NONE:return"-"}throw new D("Unknown location value: "+a)},xe.INTERIOR.get=function(){return 0},xe.BOUNDARY.get=function(){return 1},xe.EXTERIOR.get=function(){return 2},xe.NONE.get=function(){return-1},Object.defineProperties(U,xe);var ne=o(function(a,u){return a.interfaces_&&a.interfaces_().indexOf(u)>-1},"T"),Pe=o(function(){},"R"),Ce={LOG_10:{configurable:!0}};Pe.prototype.interfaces_=function(){return[]},Pe.prototype.getClass=function(){return Pe},Pe.log10=function(a){var u=Math.log(a);return A.isInfinite(u)||A.isNaN(u)?u:u/Pe.LOG_10},Pe.min=function(a,u,f,m){var v=a;return u<v&&(v=u),f<v&&(v=f),m<v&&(v=m),v},Pe.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var a=arguments[0],u=arguments[1],f=arguments[2];return a<u?u:a>f?f:a}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var m=arguments[0],v=arguments[1],S=arguments[2];return m<v?v:m>S?S:m}},Pe.wrap=function(a,u){return a<0?u- -a%u:a%u},Pe.max=function(){if(arguments.length===3){var a=arguments[0],u=arguments[1],f=arguments[2],m=a;return u>m&&(m=u),f>m&&(m=f),m}if(arguments.length===4){var v=arguments[0],S=arguments[1],M=arguments[2],B=arguments[3],z=v;return S>z&&(z=S),M>z&&(z=M),B>z&&(z=B),z}},Pe.average=function(a,u){return(a+u)/2},Ce.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(Pe,Ce);var Ue=o(function(a){this.str=a},"D");Ue.prototype.append=function(a){this.str+=a},Ue.prototype.setCharAt=function(a,u){this.str=this.str.substr(0,a)+u+this.str.substr(a+1)},Ue.prototype.toString=function(a){return this.str};var _e=o(function(a){this.value=a},"M");_e.prototype.intValue=function(){return this.value},_e.prototype.compareTo=function(a){return this.value<a?-1:this.value>a?1:0},_e.isNaN=function(a){return Number.isNaN(a)};var Me=o(function(){},"A");Me.isWhitespace=function(a){return a<=32&&a>=0||a===127},Me.toUpperCase=function(a){return a.toUpperCase()};var Q=o(function a(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var u=arguments[0];this.init(u)}else if(arguments[0]instanceof a){var f=arguments[0];this.init(f)}else if(typeof arguments[0]=="string"){var m=arguments[0];a.call(this,a.parse(m))}}else if(arguments.length===2){var v=arguments[0],S=arguments[1];this.init(v,S)}},"t"),it={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};Q.prototype.le=function(a){return(this._hi<a._hi||this._hi===a._hi)&&this._lo<=a._lo},Q.prototype.extractSignificantDigits=function(a,u){var f=this.abs(),m=Q.magnitude(f._hi),v=Q.TEN.pow(m);(f=f.divide(v)).gt(Q.TEN)?(f=f.divide(Q.TEN),m+=1):f.lt(Q.ONE)&&(f=f.multiply(Q.TEN),m-=1);for(var S=m+1,M=new Ue,B=Q.MAX_PRINT_DIGITS-1,z=0;z<=B;z++){a&&z===S&&M.append(".");var te=Math.trunc(f._hi);if(te<0)break;var pe=!1,ye=0;te>9?(pe=!0,ye="9"):ye="0"+te,M.append(ye),f=f.subtract(Q.valueOf(te)).multiply(Q.TEN),pe&&f.selfAdd(Q.TEN);var Xe=!0,Ze=Q.magnitude(f._hi);if(Ze<0&&Math.abs(Ze)>=B-z&&(Xe=!1),!Xe)break}return u[0]=m,M.toString()},Q.prototype.sqr=function(){return this.multiply(this)},Q.prototype.doubleValue=function(){return this._hi+this._lo},Q.prototype.subtract=function(){if(arguments[0]instanceof Q){var a=arguments[0];return this.add(a.negate())}if(typeof arguments[0]=="number"){var u=arguments[0];return this.add(-u)}},Q.prototype.equals=function(){if(arguments.length===1){var a=arguments[0];return this._hi===a._hi&&this._lo===a._lo}},Q.prototype.isZero=function(){return this._hi===0&&this._lo===0},Q.prototype.selfSubtract=function(){if(arguments[0]instanceof Q){var a=arguments[0];return this.isNaN()?this:this.selfAdd(-a._hi,-a._lo)}if(typeof arguments[0]=="number"){var u=arguments[0];return this.isNaN()?this:this.selfAdd(-u,0)}},Q.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},Q.prototype.min=function(a){return this.le(a)?this:a},Q.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof Q){var a=arguments[0];return this.selfDivide(a._hi,a._lo)}if(typeof arguments[0]=="number"){var u=arguments[0];return this.selfDivide(u,0)}}else if(arguments.length===2){var f=arguments[0],m=arguments[1],v=null,S=null,M=null,B=null,z=null,te=null,pe=null,ye=null;return z=this._hi/f,te=Q.SPLIT*z,v=te-z,ye=Q.SPLIT*f,v=te-v,S=z-v,M=ye-f,pe=z*f,M=ye-M,B=f-M,ye=v*M-pe+v*B+S*M+S*B,te=(this._hi-pe-ye+this._lo-z*m)/f,ye=z+te,this._hi=ye,this._lo=z-ye+te,this}},Q.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},Q.prototype.divide=function(){if(arguments[0]instanceof Q){var a=arguments[0],u=null,f=null,m=null,v=null,S=null,M=null,B=null,z=null;return f=(S=this._hi/a._hi)-(u=(M=Q.SPLIT*S)-(u=M-S)),z=u*(m=(z=Q.SPLIT*a._hi)-(m=z-a._hi))-(B=S*a._hi)+u*(v=a._hi-m)+f*m+f*v,M=(this._hi-B-z+this._lo-S*a._lo)/a._hi,new Q(z=S+M,S-z+M)}if(typeof arguments[0]=="number"){var te=arguments[0];return A.isNaN(te)?Q.createNaN():Q.copy(this).selfDivide(te,0)}},Q.prototype.ge=function(a){return(this._hi>a._hi||this._hi===a._hi)&&this._lo>=a._lo},Q.prototype.pow=function(a){if(a===0)return Q.valueOf(1);var u=new Q(this),f=Q.valueOf(1),m=Math.abs(a);if(m>1)for(;m>0;)m%2==1&&f.selfMultiply(u),(m/=2)>0&&(u=u.sqr());else f=u;return a<0?f.reciprocal():f},Q.prototype.ceil=function(){if(this.isNaN())return Q.NaN;var a=Math.ceil(this._hi),u=0;return a===this._hi&&(u=Math.ceil(this._lo)),new Q(a,u)},Q.prototype.compareTo=function(a){var u=a;return this._hi<u._hi?-1:this._hi>u._hi?1:this._lo<u._lo?-1:this._lo>u._lo?1:0},Q.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},Q.prototype.setValue=function(){if(arguments[0]instanceof Q){var a=arguments[0];return this.init(a),this}if(typeof arguments[0]=="number"){var u=arguments[0];return this.init(u),this}},Q.prototype.max=function(a){return this.ge(a)?this:a},Q.prototype.sqrt=function(){if(this.isZero())return Q.valueOf(0);if(this.isNegative())return Q.NaN;var a=1/Math.sqrt(this._hi),u=this._hi*a,f=Q.valueOf(u),m=this.subtract(f.sqr())._hi*(.5*a);return f.add(m)},Q.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof Q){var a=arguments[0];return this.selfAdd(a._hi,a._lo)}if(typeof arguments[0]=="number"){var u=arguments[0],f=null,m=null,v=null,S=null,M=null,B=null;return v=this._hi+u,M=v-this._hi,S=v-M,S=u-M+(this._hi-S),B=S+this._lo,f=v+B,m=B+(v-f),this._hi=f+m,this._lo=m+(f-this._hi),this}}else if(arguments.length===2){var z=arguments[0],te=arguments[1],pe=null,ye=null,Xe=null,Ze=null,nt=null,mt=null,Zr=null;Ze=this._hi+z,ye=this._lo+te,nt=Ze-(mt=Ze-this._hi),Xe=ye-(Zr=ye-this._lo);var Ii=(pe=Ze+(mt=(nt=z-mt+(this._hi-nt))+ye))+(mt=(Xe=te-Zr+(this._lo-Xe))+(mt+(Ze-pe))),qo=mt+(pe-Ii);return this._hi=Ii,this._lo=qo,this}},Q.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof Q){var a=arguments[0];return this.selfMultiply(a._hi,a._lo)}if(typeof arguments[0]=="number"){var u=arguments[0];return this.selfMultiply(u,0)}}else if(arguments.length===2){var f=arguments[0],m=arguments[1],v=null,S=null,M=null,B=null,z=null,te=null;v=(z=Q.SPLIT*this._hi)-this._hi,te=Q.SPLIT*f,v=z-v,S=this._hi-v,M=te-f;var pe=(z=this._hi*f)+(te=v*(M=te-M)-z+v*(B=f-M)+S*M+S*B+(this._hi*m+this._lo*f)),ye=te+(v=z-pe);return this._hi=pe,this._lo=ye,this}},Q.prototype.selfSqr=function(){return this.selfMultiply(this)},Q.prototype.floor=function(){if(this.isNaN())return Q.NaN;var a=Math.floor(this._hi),u=0;return a===this._hi&&(u=Math.floor(this._lo)),new Q(a,u)},Q.prototype.negate=function(){return this.isNaN()?this:new Q(-this._hi,-this._lo)},Q.prototype.clone=function(){},Q.prototype.multiply=function(){if(arguments[0]instanceof Q){var a=arguments[0];return a.isNaN()?Q.createNaN():Q.copy(this).selfMultiply(a)}if(typeof arguments[0]=="number"){var u=arguments[0];return A.isNaN(u)?Q.createNaN():Q.copy(this).selfMultiply(u,0)}},Q.prototype.isNaN=function(){return A.isNaN(this._hi)},Q.prototype.intValue=function(){return Math.trunc(this._hi)},Q.prototype.toString=function(){var a=Q.magnitude(this._hi);return a>=-3&&a<=20?this.toStandardNotation():this.toSciNotation()},Q.prototype.toStandardNotation=function(){var a=this.getSpecialNumberString();if(a!==null)return a;var u=new Array(1).fill(null),f=this.extractSignificantDigits(!0,u),m=u[0]+1,v=f;if(f.charAt(0)===".")v="0"+f;else if(m<0)v="0."+Q.stringOfChar("0",-m)+f;else if(f.indexOf(".")===-1){var S=m-f.length;v=f+Q.stringOfChar("0",S)+".0"}return this.isNegative()?"-"+v:v},Q.prototype.reciprocal=function(){var a=null,u=null,f=null,m=null,v=null,S=null,M=null,B=null;u=(v=1/this._hi)-(a=(S=Q.SPLIT*v)-(a=S-v)),f=(B=Q.SPLIT*this._hi)-this._hi;var z=v+(S=(1-(M=v*this._hi)-(B=a*(f=B-f)-M+a*(m=this._hi-f)+u*f+u*m)-v*this._lo)/this._hi);return new Q(z,v-z+S)},Q.prototype.toSciNotation=function(){if(this.isZero())return Q.SCI_NOT_ZERO;var a=this.getSpecialNumberString();if(a!==null)return a;var u=new Array(1).fill(null),f=this.extractSignificantDigits(!1,u),m=Q.SCI_NOT_EXPONENT_CHAR+u[0];if(f.charAt(0)==="0")throw new Error("Found leading zero: "+f);var v="";f.length>1&&(v=f.substring(1));var S=f.charAt(0)+"."+v;return this.isNegative()?"-"+S+m:S+m},Q.prototype.abs=function(){return this.isNaN()?Q.NaN:this.isNegative()?this.negate():new Q(this)},Q.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},Q.prototype.lt=function(a){return(this._hi<a._hi||this._hi===a._hi)&&this._lo<a._lo},Q.prototype.add=function(){if(arguments[0]instanceof Q){var a=arguments[0];return Q.copy(this).selfAdd(a)}if(typeof arguments[0]=="number"){var u=arguments[0];return Q.copy(this).selfAdd(u)}},Q.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var a=arguments[0];this._hi=a,this._lo=0}else if(arguments[0]instanceof Q){var u=arguments[0];this._hi=u._hi,this._lo=u._lo}}else if(arguments.length===2){var f=arguments[0],m=arguments[1];this._hi=f,this._lo=m}},Q.prototype.gt=function(a){return(this._hi>a._hi||this._hi===a._hi)&&this._lo>a._lo},Q.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},Q.prototype.trunc=function(){return this.isNaN()?Q.NaN:this.isPositive()?this.floor():this.ceil()},Q.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},Q.prototype.interfaces_=function(){return[t,j,X]},Q.prototype.getClass=function(){return Q},Q.sqr=function(a){return Q.valueOf(a).selfMultiply(a)},Q.valueOf=function(){if(typeof arguments[0]=="string"){var a=arguments[0];return Q.parse(a)}if(typeof arguments[0]=="number"){var u=arguments[0];return new Q(u)}},Q.sqrt=function(a){return Q.valueOf(a).sqrt()},Q.parse=function(a){for(var u=0,f=a.length;Me.isWhitespace(a.charAt(u));)u++;var m=!1;if(u<f){var v=a.charAt(u);v!=="-"&&v!=="+"||(u++,v==="-"&&(m=!0))}for(var S=new Q,M=0,B=0,z=0;!(u>=f);){var te=a.charAt(u);if(u++,Me.isDigit(te)){var pe=te-"0";S.selfMultiply(Q.TEN),S.selfAdd(pe),M++}else{if(te!=="."){if(te==="e"||te==="E"){var ye=a.substring(u);try{z=_e.parseInt(ye)}catch(Zr){throw Zr instanceof Error?new Error("Invalid exponent "+ye+" in string "+a):Zr}break}throw new Error("Unexpected character '"+te+"' at position "+u+" in string "+a)}B=M}}var Xe=S,Ze=M-B-z;if(Ze===0)Xe=S;else if(Ze>0){var nt=Q.TEN.pow(Ze);Xe=S.divide(nt)}else if(Ze<0){var mt=Q.TEN.pow(-Ze);Xe=S.multiply(mt)}return m?Xe.negate():Xe},Q.createNaN=function(){return new Q(A.NaN,A.NaN)},Q.copy=function(a){return new Q(a)},Q.magnitude=function(a){var u=Math.abs(a),f=Math.log(u)/Math.log(10),m=Math.trunc(Math.floor(f));return 10*Math.pow(10,m)<=u&&(m+=1),m},Q.stringOfChar=function(a,u){for(var f=new Ue,m=0;m<u;m++)f.append(a);return f.toString()},it.PI.get=function(){return new Q(3.141592653589793,12246467991473532e-32)},it.TWO_PI.get=function(){return new Q(6.283185307179586,24492935982947064e-32)},it.PI_2.get=function(){return new Q(1.5707963267948966,6123233995736766e-32)},it.E.get=function(){return new Q(2.718281828459045,14456468917292502e-32)},it.NaN.get=function(){return new Q(A.NaN,A.NaN)},it.EPS.get=function(){return 123259516440783e-46},it.SPLIT.get=function(){return 134217729},it.MAX_PRINT_DIGITS.get=function(){return 32},it.TEN.get=function(){return Q.valueOf(10)},it.ONE.get=function(){return Q.valueOf(1)},it.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},it.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(Q,it);var Ke=o(function(){},"q"),rt={DP_SAFE_EPSILON:{configurable:!0}};Ke.prototype.interfaces_=function(){return[]},Ke.prototype.getClass=function(){return Ke},Ke.orientationIndex=function(a,u,f){var m=Ke.orientationIndexFilter(a,u,f);if(m<=1)return m;var v=Q.valueOf(u.x).selfAdd(-a.x),S=Q.valueOf(u.y).selfAdd(-a.y),M=Q.valueOf(f.x).selfAdd(-u.x),B=Q.valueOf(f.y).selfAdd(-u.y);return v.selfMultiply(B).selfSubtract(S.selfMultiply(M)).signum()},Ke.signOfDet2x2=function(a,u,f,m){return a.multiply(m).selfSubtract(u.multiply(f)).signum()},Ke.intersection=function(a,u,f,m){var v=Q.valueOf(m.y).selfSubtract(f.y).selfMultiply(Q.valueOf(u.x).selfSubtract(a.x)),S=Q.valueOf(m.x).selfSubtract(f.x).selfMultiply(Q.valueOf(u.y).selfSubtract(a.y)),M=v.subtract(S),B=Q.valueOf(m.x).selfSubtract(f.x).selfMultiply(Q.valueOf(a.y).selfSubtract(f.y)),z=Q.valueOf(m.y).selfSubtract(f.y).selfMultiply(Q.valueOf(a.x).selfSubtract(f.x)),te=B.subtract(z).selfDivide(M).doubleValue(),pe=Q.valueOf(a.x).selfAdd(Q.valueOf(u.x).selfSubtract(a.x).selfMultiply(te)).doubleValue(),ye=Q.valueOf(u.x).selfSubtract(a.x).selfMultiply(Q.valueOf(a.y).selfSubtract(f.y)),Xe=Q.valueOf(u.y).selfSubtract(a.y).selfMultiply(Q.valueOf(a.x).selfSubtract(f.x)),Ze=ye.subtract(Xe).selfDivide(M).doubleValue(),nt=Q.valueOf(f.y).selfAdd(Q.valueOf(m.y).selfSubtract(f.y).selfMultiply(Ze)).doubleValue();return new N(pe,nt)},Ke.orientationIndexFilter=function(a,u,f){var m=null,v=(a.x-f.x)*(u.y-f.y),S=(a.y-f.y)*(u.x-f.x),M=v-S;if(v>0){if(S<=0)return Ke.signum(M);m=v+S}else{if(!(v<0)||S>=0)return Ke.signum(M);m=-v-S}var B=Ke.DP_SAFE_EPSILON*m;return M>=B||-M>=B?Ke.signum(M):2},Ke.signum=function(a){return a>0?1:a<0?-1:0},rt.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(Ke,rt);var Ae=o(function(){},"V"),Be={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Be.X.get=function(){return 0},Be.Y.get=function(){return 1},Be.Z.get=function(){return 2},Be.M.get=function(){return 3},Ae.prototype.setOrdinate=function(a,u,f){},Ae.prototype.size=function(){},Ae.prototype.getOrdinate=function(a,u){},Ae.prototype.getCoordinate=function(){},Ae.prototype.getCoordinateCopy=function(a){},Ae.prototype.getDimension=function(){},Ae.prototype.getX=function(a){},Ae.prototype.clone=function(){},Ae.prototype.expandEnvelope=function(a){},Ae.prototype.copy=function(){},Ae.prototype.getY=function(a){},Ae.prototype.toCoordinateArray=function(){},Ae.prototype.interfaces_=function(){return[X]},Ae.prototype.getClass=function(){return Ae},Object.defineProperties(Ae,Be);var We=o(function(){},"z"),je=function(a){function u(){a.call(this,"Projective point not representable on the Cartesian plane.")}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(We),Se=o(function(){},"Y");Se.arraycopy=function(a,u,f,m,v){for(var S=0,M=u;M<u+v;M++)f[m+S]=a[M],S++},Se.getProperty=function(a){return{"line.separator":"\n"}[a]};var H=o(function a(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var u=arguments[0];this.x=u.x,this.y=u.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var f=arguments[0],m=arguments[1];this.x=f,this.y=m,this.w=1}else if(arguments[0]instanceof a&&arguments[1]instanceof a){var v=arguments[0],S=arguments[1];this.x=v.y*S.w-S.y*v.w,this.y=S.x*v.w-v.x*S.w,this.w=v.x*S.y-S.x*v.y}else if(arguments[0]instanceof N&&arguments[1]instanceof N){var M=arguments[0],B=arguments[1];this.x=M.y-B.y,this.y=B.x-M.x,this.w=M.x*B.y-B.x*M.y}}else if(arguments.length===3){var z=arguments[0],te=arguments[1],pe=arguments[2];this.x=z,this.y=te,this.w=pe}else if(arguments.length===4){var ye=arguments[0],Xe=arguments[1],Ze=arguments[2],nt=arguments[3],mt=ye.y-Xe.y,Zr=Xe.x-ye.x,Ii=ye.x*Xe.y-Xe.x*ye.y,qo=Ze.y-nt.y,_u=nt.x-Ze.x,Hp=Ze.x*nt.y-nt.x*Ze.y;this.x=Zr*Hp-_u*Ii,this.y=qo*Ii-mt*Hp,this.w=mt*_u-qo*Zr}},"t");H.prototype.getY=function(){var a=this.y/this.w;if(A.isNaN(a)||A.isInfinite(a))throw new je;return a},H.prototype.getX=function(){var a=this.x/this.w;if(A.isNaN(a)||A.isInfinite(a))throw new je;return a},H.prototype.getCoordinate=function(){var a=new N;return a.x=this.getX(),a.y=this.getY(),a},H.prototype.interfaces_=function(){return[]},H.prototype.getClass=function(){return H},H.intersection=function(a,u,f,m){var v=a.y-u.y,S=u.x-a.x,M=a.x*u.y-u.x*a.y,B=f.y-m.y,z=m.x-f.x,te=f.x*m.y-m.x*f.y,pe=v*z-B*S,ye=(S*te-z*M)/pe,Xe=(B*M-v*te)/pe;if(A.isNaN(ye)||A.isInfinite(ye)||A.isNaN(Xe)||A.isInfinite(Xe))throw new je;return new N(ye,Xe)};var ie=o(function a(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof N){var u=arguments[0];this.init(u.x,u.x,u.y,u.y)}else if(arguments[0]instanceof a){var f=arguments[0];this.init(f)}}else if(arguments.length===2){var m=arguments[0],v=arguments[1];this.init(m.x,v.x,m.y,v.y)}else if(arguments.length===4){var S=arguments[0],M=arguments[1],B=arguments[2],z=arguments[3];this.init(S,M,B,z)}},"t"),ee={serialVersionUID:{configurable:!0}};ie.prototype.getArea=function(){return this.getWidth()*this.getHeight()},ie.prototype.equals=function(a){if(!(a instanceof ie))return!1;var u=a;return this.isNull()?u.isNull():this._maxx===u.getMaxX()&&this._maxy===u.getMaxY()&&this._minx===u.getMinX()&&this._miny===u.getMinY()},ie.prototype.intersection=function(a){if(this.isNull()||a.isNull()||!this.intersects(a))return new ie;var u=this._minx>a._minx?this._minx:a._minx,f=this._miny>a._miny?this._miny:a._miny,m=this._maxx<a._maxx?this._maxx:a._maxx,v=this._maxy<a._maxy?this._maxy:a._maxy;return new ie(u,m,f,v)},ie.prototype.isNull=function(){return this._maxx<this._minx},ie.prototype.getMaxX=function(){return this._maxx},ie.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof N){var a=arguments[0];return this.covers(a.x,a.y)}if(arguments[0]instanceof ie){var u=arguments[0];return!this.isNull()&&!u.isNull()&&u.getMinX()>=this._minx&&u.getMaxX()<=this._maxx&&u.getMinY()>=this._miny&&u.getMaxY()<=this._maxy}}else if(arguments.length===2){var f=arguments[0],m=arguments[1];return!this.isNull()&&f>=this._minx&&f<=this._maxx&&m>=this._miny&&m<=this._maxy}},ie.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof ie){var a=arguments[0];return!this.isNull()&&!a.isNull()&&!(a._minx>this._maxx||a._maxx<this._minx||a._miny>this._maxy||a._maxy<this._miny)}if(arguments[0]instanceof N){var u=arguments[0];return this.intersects(u.x,u.y)}}else if(arguments.length===2){var f=arguments[0],m=arguments[1];return!this.isNull()&&!(f>this._maxx||f<this._minx||m>this._maxy||m<this._miny)}},ie.prototype.getMinY=function(){return this._miny},ie.prototype.getMinX=function(){return this._minx},ie.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof N){var a=arguments[0];this.expandToInclude(a.x,a.y)}else if(arguments[0]instanceof ie){var u=arguments[0];if(u.isNull())return null;this.isNull()?(this._minx=u.getMinX(),this._maxx=u.getMaxX(),this._miny=u.getMinY(),this._maxy=u.getMaxY()):(u._minx<this._minx&&(this._minx=u._minx),u._maxx>this._maxx&&(this._maxx=u._maxx),u._miny<this._miny&&(this._miny=u._miny),u._maxy>this._maxy&&(this._maxy=u._maxy))}}else if(arguments.length===2){var f=arguments[0],m=arguments[1];this.isNull()?(this._minx=f,this._maxx=f,this._miny=m,this._maxy=m):(f<this._minx&&(this._minx=f),f>this._maxx&&(this._maxx=f),m<this._miny&&(this._miny=m),m>this._maxy&&(this._maxy=m))}},ie.prototype.minExtent=function(){if(this.isNull())return 0;var a=this.getWidth(),u=this.getHeight();return a<u?a:u},ie.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},ie.prototype.compareTo=function(a){var u=a;return this.isNull()?u.isNull()?0:-1:u.isNull()?1:this._minx<u._minx?-1:this._minx>u._minx?1:this._miny<u._miny?-1:this._miny>u._miny?1:this._maxx<u._maxx?-1:this._maxx>u._maxx?1:this._maxy<u._maxy?-1:this._maxy>u._maxy?1:0},ie.prototype.translate=function(a,u){if(this.isNull())return null;this.init(this.getMinX()+a,this.getMaxX()+a,this.getMinY()+u,this.getMaxY()+u)},ie.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},ie.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},ie.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},ie.prototype.maxExtent=function(){if(this.isNull())return 0;var a=this.getWidth(),u=this.getHeight();return a>u?a:u},ie.prototype.expandBy=function(){if(arguments.length===1){var a=arguments[0];this.expandBy(a,a)}else if(arguments.length===2){var u=arguments[0],f=arguments[1];if(this.isNull())return null;this._minx-=u,this._maxx+=u,this._miny-=f,this._maxy+=f,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},ie.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof ie){var a=arguments[0];return this.covers(a)}if(arguments[0]instanceof N){var u=arguments[0];return this.covers(u)}}else if(arguments.length===2){var f=arguments[0],m=arguments[1];return this.covers(f,m)}},ie.prototype.centre=function(){return this.isNull()?null:new N((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},ie.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof N){var a=arguments[0];this.init(a.x,a.x,a.y,a.y)}else if(arguments[0]instanceof ie){var u=arguments[0];this._minx=u._minx,this._maxx=u._maxx,this._miny=u._miny,this._maxy=u._maxy}}else if(arguments.length===2){var f=arguments[0],m=arguments[1];this.init(f.x,m.x,f.y,m.y)}else if(arguments.length===4){var v=arguments[0],S=arguments[1],M=arguments[2],B=arguments[3];v<S?(this._minx=v,this._maxx=S):(this._minx=S,this._maxx=v),M<B?(this._miny=M,this._maxy=B):(this._miny=B,this._maxy=M)}},ie.prototype.getMaxY=function(){return this._maxy},ie.prototype.distance=function(a){if(this.intersects(a))return 0;var u=0;this._maxx<a._minx?u=a._minx-this._maxx:this._minx>a._maxx&&(u=this._minx-a._maxx);var f=0;return this._maxy<a._miny?f=a._miny-this._maxy:this._miny>a._maxy&&(f=this._miny-a._maxy),u===0?f:f===0?u:Math.sqrt(u*u+f*f)},ie.prototype.hashCode=function(){var a=17;return a=37*a+N.hashCode(this._minx),a=37*a+N.hashCode(this._maxx),a=37*a+N.hashCode(this._miny),a=37*a+N.hashCode(this._maxy)},ie.prototype.interfaces_=function(){return[j,t]},ie.prototype.getClass=function(){return ie},ie.intersects=function(){if(arguments.length===3){var a=arguments[0],u=arguments[1],f=arguments[2];return f.x>=(a.x<u.x?a.x:u.x)&&f.x<=(a.x>u.x?a.x:u.x)&&f.y>=(a.y<u.y?a.y:u.y)&&f.y<=(a.y>u.y?a.y:u.y)}if(arguments.length===4){var m=arguments[0],v=arguments[1],S=arguments[2],M=arguments[3],B=Math.min(S.x,M.x),z=Math.max(S.x,M.x),te=Math.min(m.x,v.x),pe=Math.max(m.x,v.x);return!(te>z)&&!(pe<B)&&(B=Math.min(S.y,M.y),z=Math.max(S.y,M.y),te=Math.min(m.y,v.y),pe=Math.max(m.y,v.y),!(te>z)&&!(pe<B))}},ee.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(ie,ee);var Ee={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},Ne=o(function(a){this.geometryFactory=a||new $t},"K");Ne.prototype.read=function(a){var u,f,m;a=a.replace(/[\n\r]/g," ");var v=Ee.typeStr.exec(a);if(a.search("EMPTY")!==-1&&((v=Ee.emptyTypeStr.exec(a))[2]=void 0),v&&(f=v[1].toLowerCase(),m=v[2],Ye[f]&&(u=Ye[f].apply(this,[m]))),u===void 0)throw new Error("Could not parse WKT "+a);return u},Ne.prototype.write=function(a){return this.extractGeometry(a)},Ne.prototype.extractGeometry=function(a){var u=a.getGeometryType().toLowerCase();if(!Oe[u])return null;var f=u.toUpperCase();return a.isEmpty()?f+" EMPTY":f+"("+Oe[u].apply(this,[a])+")"};var Oe={coordinate:o(function(a){return a.x+" "+a.y},"coordinate"),point:o(function(a){return Oe.coordinate.call(this,a._coordinates._coordinates[0])},"point"),multipoint:o(function(a){for(var u=[],f=0,m=a._geometries.length;f<m;++f)u.push("("+Oe.point.apply(this,[a._geometries[f]])+")");return u.join(",")},"multipoint"),linestring:o(function(a){for(var u=[],f=0,m=a._points._coordinates.length;f<m;++f)u.push(Oe.coordinate.apply(this,[a._points._coordinates[f]]));return u.join(",")},"linestring"),linearring:o(function(a){for(var u=[],f=0,m=a._points._coordinates.length;f<m;++f)u.push(Oe.coordinate.apply(this,[a._points._coordinates[f]]));return u.join(",")},"linearring"),multilinestring:o(function(a){for(var u=[],f=0,m=a._geometries.length;f<m;++f)u.push("("+Oe.linestring.apply(this,[a._geometries[f]])+")");return u.join(",")},"multilinestring"),polygon:o(function(a){var u=[];u.push("("+Oe.linestring.apply(this,[a._shell])+")");for(var f=0,m=a._holes.length;f<m;++f)u.push("("+Oe.linestring.apply(this,[a._holes[f]])+")");return u.join(",")},"polygon"),multipolygon:o(function(a){for(var u=[],f=0,m=a._geometries.length;f<m;++f)u.push("("+Oe.polygon.apply(this,[a._geometries[f]])+")");return u.join(",")},"multipolygon"),geometrycollection:o(function(a){for(var u=[],f=0,m=a._geometries.length;f<m;++f)u.push(this.extractGeometry(a._geometries[f]));return u.join(",")},"geometrycollection")},Ye={point:o(function(a){if(a===void 0)return this.geometryFactory.createPoint();var u=a.trim().split(Ee.spaces);return this.geometryFactory.createPoint(new N(Number.parseFloat(u[0]),Number.parseFloat(u[1])))},"point"),multipoint:o(function(a){if(a===void 0)return this.geometryFactory.createMultiPoint();for(var u,f=a.trim().split(","),m=[],v=0,S=f.length;v<S;++v)u=f[v].replace(Ee.trimParens,"$1"),m.push(Ye.point.apply(this,[u]));return this.geometryFactory.createMultiPoint(m)},"multipoint"),linestring:o(function(a){if(a===void 0)return this.geometryFactory.createLineString();for(var u,f=a.trim().split(","),m=[],v=0,S=f.length;v<S;++v)u=f[v].trim().split(Ee.spaces),m.push(new N(Number.parseFloat(u[0]),Number.parseFloat(u[1])));return this.geometryFactory.createLineString(m)},"linestring"),linearring:o(function(a){if(a===void 0)return this.geometryFactory.createLinearRing();for(var u,f=a.trim().split(","),m=[],v=0,S=f.length;v<S;++v)u=f[v].trim().split(Ee.spaces),m.push(new N(Number.parseFloat(u[0]),Number.parseFloat(u[1])));return this.geometryFactory.createLinearRing(m)},"linearring"),multilinestring:o(function(a){if(a===void 0)return this.geometryFactory.createMultiLineString();for(var u,f=a.trim().split(Ee.parenComma),m=[],v=0,S=f.length;v<S;++v)u=f[v].replace(Ee.trimParens,"$1"),m.push(Ye.linestring.apply(this,[u]));return this.geometryFactory.createMultiLineString(m)},"multilinestring"),polygon:o(function(a){if(a===void 0)return this.geometryFactory.createPolygon();for(var u,f,m,v,S=a.trim().split(Ee.parenComma),M=[],B=0,z=S.length;B<z;++B)u=S[B].replace(Ee.trimParens,"$1"),f=Ye.linestring.apply(this,[u]),m=this.geometryFactory.createLinearRing(f._points),B===0?v=m:M.push(m);return this.geometryFactory.createPolygon(v,M)},"polygon"),multipolygon:o(function(a){if(a===void 0)return this.geometryFactory.createMultiPolygon();for(var u,f=a.trim().split(Ee.doubleParenComma),m=[],v=0,S=f.length;v<S;++v)u=f[v].replace(Ee.trimParens,"$1"),m.push(Ye.polygon.apply(this,[u]));return this.geometryFactory.createMultiPolygon(m)},"multipolygon"),geometrycollection:o(function(a){if(a===void 0)return this.geometryFactory.createGeometryCollection();for(var u=(a=a.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),f=[],m=0,v=u.length;m<v;++m)f.push(this.read(u[m]));return this.geometryFactory.createGeometryCollection(f)},"geometrycollection")},Pt=o(function(a){this.parser=new Ne(a)},"Z");Pt.prototype.write=function(a){return this.parser.write(a)},Pt.toLineString=function(a,u){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+a.x+" "+a.y+", "+u.x+" "+u.y+" )"};var Er=function(a){function u(f){a.call(this,f),this.name="RuntimeException",this.message=f,this.stack=new a().stack}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u}(Error),$n=function(a){function u(){if(a.call(this),arguments.length===0)a.call(this);else if(arguments.length===1){var f=arguments[0];a.call(this,f)}}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(Er),ot=o(function(){},"et");ot.prototype.interfaces_=function(){return[]},ot.prototype.getClass=function(){return ot},ot.shouldNeverReachHere=function(){if(arguments.length===0)ot.shouldNeverReachHere(null);else if(arguments.length===1){var a=arguments[0];throw new $n("Should never reach here"+(a!==null?": "+a:""))}},ot.isTrue=function(){var a,u;if(arguments.length===1)a=arguments[0],ot.isTrue(a,null);else if(arguments.length===2&&(a=arguments[0],u=arguments[1],!a))throw u===null?new $n:new $n(u)},ot.equals=function(){var a,u,f;if(arguments.length===2)a=arguments[0],u=arguments[1],ot.equals(a,u,null);else if(arguments.length===3&&(a=arguments[0],u=arguments[1],f=arguments[2],!u.equals(a)))throw new $n("Expected "+a+" but encountered "+u+(f!==null?": "+f:""))};var zt=o(function(){this._result=null,this._inputLines=Array(2).fill().map(function(){return Array(2)}),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new N,this._intPt[1]=new N,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},"nt"),Jo={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};zt.prototype.getIndexAlongSegment=function(a,u){return this.computeIntLineIndex(),this._intLineIndex[a][u]},zt.prototype.getTopologySummary=function(){var a=new Ue;return this.isEndPoint()&&a.append(" endpoint"),this._isProper&&a.append(" proper"),this.isCollinear()&&a.append(" collinear"),a.toString()},zt.prototype.computeIntersection=function(a,u,f,m){this._inputLines[0][0]=a,this._inputLines[0][1]=u,this._inputLines[1][0]=f,this._inputLines[1][1]=m,this._result=this.computeIntersect(a,u,f,m)},zt.prototype.getIntersectionNum=function(){return this._result},zt.prototype.computeIntLineIndex=function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var a=arguments[0];this.getEdgeDistance(a,0)>this.getEdgeDistance(a,1)?(this._intLineIndex[a][0]=0,this._intLineIndex[a][1]=1):(this._intLineIndex[a][0]=1,this._intLineIndex[a][1]=0)}},zt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},zt.prototype.setPrecisionModel=function(a){this._precisionModel=a},zt.prototype.isInteriorIntersection=function(){if(arguments.length===0)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(arguments.length===1){for(var a=arguments[0],u=0;u<this._result;u++)if(!this._intPt[u].equals2D(this._inputLines[a][0])&&!this._intPt[u].equals2D(this._inputLines[a][1]))return!0;return!1}},zt.prototype.getIntersection=function(a){return this._intPt[a]},zt.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},zt.prototype.hasIntersection=function(){return this._result!==zt.NO_INTERSECTION},zt.prototype.getEdgeDistance=function(a,u){return zt.computeEdgeDistance(this._intPt[u],this._inputLines[a][0],this._inputLines[a][1])},zt.prototype.isCollinear=function(){return this._result===zt.COLLINEAR_INTERSECTION},zt.prototype.toString=function(){return Pt.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Pt.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},zt.prototype.getEndpoint=function(a,u){return this._inputLines[a][u]},zt.prototype.isIntersection=function(a){for(var u=0;u<this._result;u++)if(this._intPt[u].equals2D(a))return!0;return!1},zt.prototype.getIntersectionAlongSegment=function(a,u){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[a][u]]},zt.prototype.interfaces_=function(){return[]},zt.prototype.getClass=function(){return zt},zt.computeEdgeDistance=function(a,u,f){var m=Math.abs(f.x-u.x),v=Math.abs(f.y-u.y),S=-1;if(a.equals(u))S=0;else if(a.equals(f))S=m>v?m:v;else{var M=Math.abs(a.x-u.x),B=Math.abs(a.y-u.y);(S=m>v?M:B)!==0||a.equals(u)||(S=Math.max(M,B))}return ot.isTrue(!(S===0&&!a.equals(u)),"Bad distance calculation"),S},zt.nonRobustComputeEdgeDistance=function(a,u,f){var m=a.x-u.x,v=a.y-u.y,S=Math.sqrt(m*m+v*v);return ot.isTrue(!(S===0&&!a.equals(u)),"Invalid distance calculation"),S},Jo.DONT_INTERSECT.get=function(){return 0},Jo.DO_INTERSECT.get=function(){return 1},Jo.COLLINEAR.get=function(){return 2},Jo.NO_INTERSECTION.get=function(){return 0},Jo.POINT_INTERSECTION.get=function(){return 1},Jo.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(zt,Jo);var Ro=function(a){function u(){a.apply(this,arguments)}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.isInSegmentEnvelopes=function(f){var m=new ie(this._inputLines[0][0],this._inputLines[0][1]),v=new ie(this._inputLines[1][0],this._inputLines[1][1]);return m.contains(f)&&v.contains(f)},u.prototype.computeIntersection=function(){if(arguments.length!==3)return a.prototype.computeIntersection.apply(this,arguments);var f=arguments[0],m=arguments[1],v=arguments[2];if(this._isProper=!1,ie.intersects(m,v,f)&&ze.orientationIndex(m,v,f)===0&&ze.orientationIndex(v,m,f)===0)return this._isProper=!0,(f.equals(m)||f.equals(v))&&(this._isProper=!1),this._result=a.POINT_INTERSECTION,null;this._result=a.NO_INTERSECTION},u.prototype.normalizeToMinimum=function(f,m,v,S,M){M.x=this.smallestInAbsValue(f.x,m.x,v.x,S.x),M.y=this.smallestInAbsValue(f.y,m.y,v.y,S.y),f.x-=M.x,f.y-=M.y,m.x-=M.x,m.y-=M.y,v.x-=M.x,v.y-=M.y,S.x-=M.x,S.y-=M.y},u.prototype.safeHCoordinateIntersection=function(f,m,v,S){var M=null;try{M=H.intersection(f,m,v,S)}catch(B){if(!(B instanceof je))throw B;M=u.nearestEndpoint(f,m,v,S)}return M},u.prototype.intersection=function(f,m,v,S){var M=this.intersectionWithNormalization(f,m,v,S);return this.isInSegmentEnvelopes(M)||(M=new N(u.nearestEndpoint(f,m,v,S))),this._precisionModel!==null&&this._precisionModel.makePrecise(M),M},u.prototype.smallestInAbsValue=function(f,m,v,S){var M=f,B=Math.abs(M);return Math.abs(m)<B&&(M=m,B=Math.abs(m)),Math.abs(v)<B&&(M=v,B=Math.abs(v)),Math.abs(S)<B&&(M=S),M},u.prototype.checkDD=function(f,m,v,S,M){var B=Ke.intersection(f,m,v,S),z=this.isInSegmentEnvelopes(B);Se.out.println("DD in env = "+z+" --------------------- "+B),M.distance(B)>1e-4&&Se.out.println("Distance = "+M.distance(B))},u.prototype.intersectionWithNormalization=function(f,m,v,S){var M=new N(f),B=new N(m),z=new N(v),te=new N(S),pe=new N;this.normalizeToEnvCentre(M,B,z,te,pe);var ye=this.safeHCoordinateIntersection(M,B,z,te);return ye.x+=pe.x,ye.y+=pe.y,ye},u.prototype.computeCollinearIntersection=function(f,m,v,S){var M=ie.intersects(f,m,v),B=ie.intersects(f,m,S),z=ie.intersects(v,S,f),te=ie.intersects(v,S,m);return M&&B?(this._intPt[0]=v,this._intPt[1]=S,a.COLLINEAR_INTERSECTION):z&&te?(this._intPt[0]=f,this._intPt[1]=m,a.COLLINEAR_INTERSECTION):M&&z?(this._intPt[0]=v,this._intPt[1]=f,!v.equals(f)||B||te?a.COLLINEAR_INTERSECTION:a.POINT_INTERSECTION):M&&te?(this._intPt[0]=v,this._intPt[1]=m,!v.equals(m)||B||z?a.COLLINEAR_INTERSECTION:a.POINT_INTERSECTION):B&&z?(this._intPt[0]=S,this._intPt[1]=f,!S.equals(f)||M||te?a.COLLINEAR_INTERSECTION:a.POINT_INTERSECTION):B&&te?(this._intPt[0]=S,this._intPt[1]=m,!S.equals(m)||M||z?a.COLLINEAR_INTERSECTION:a.POINT_INTERSECTION):a.NO_INTERSECTION},u.prototype.normalizeToEnvCentre=function(f,m,v,S,M){var B=f.x<m.x?f.x:m.x,z=f.y<m.y?f.y:m.y,te=f.x>m.x?f.x:m.x,pe=f.y>m.y?f.y:m.y,ye=v.x<S.x?v.x:S.x,Xe=v.y<S.y?v.y:S.y,Ze=v.x>S.x?v.x:S.x,nt=v.y>S.y?v.y:S.y,mt=((B>ye?B:ye)+(te<Ze?te:Ze))/2,Zr=((z>Xe?z:Xe)+(pe<nt?pe:nt))/2;M.x=mt,M.y=Zr,f.x-=M.x,f.y-=M.y,m.x-=M.x,m.y-=M.y,v.x-=M.x,v.y-=M.y,S.x-=M.x,S.y-=M.y},u.prototype.computeIntersect=function(f,m,v,S){if(this._isProper=!1,!ie.intersects(f,m,v,S))return a.NO_INTERSECTION;var M=ze.orientationIndex(f,m,v),B=ze.orientationIndex(f,m,S);if(M>0&&B>0||M<0&&B<0)return a.NO_INTERSECTION;var z=ze.orientationIndex(v,S,f),te=ze.orientationIndex(v,S,m);return z>0&&te>0||z<0&&te<0?a.NO_INTERSECTION:M===0&&B===0&&z===0&&te===0?this.computeCollinearIntersection(f,m,v,S):(M===0||B===0||z===0||te===0?(this._isProper=!1,f.equals2D(v)||f.equals2D(S)?this._intPt[0]=f:m.equals2D(v)||m.equals2D(S)?this._intPt[0]=m:M===0?this._intPt[0]=new N(v):B===0?this._intPt[0]=new N(S):z===0?this._intPt[0]=new N(f):te===0&&(this._intPt[0]=new N(m))):(this._isProper=!0,this._intPt[0]=this.intersection(f,m,v,S)),a.POINT_INTERSECTION)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u.nearestEndpoint=function(f,m,v,S){var M=f,B=ze.distancePointLine(f,v,S),z=ze.distancePointLine(m,v,S);return z<B&&(B=z,M=m),(z=ze.distancePointLine(v,f,m))<B&&(B=z,M=v),(z=ze.distancePointLine(S,f,m))<B&&(B=z,M=S),M},u}(zt),Ks=o(function(){},"ot");Ks.prototype.interfaces_=function(){return[]},Ks.prototype.getClass=function(){return Ks},Ks.orientationIndex=function(a,u,f){var m=u.x-a.x,v=u.y-a.y,S=f.x-u.x,M=f.y-u.y;return Ks.signOfDet2x2(m,v,S,M)},Ks.signOfDet2x2=function(a,u,f,m){var v=null,S=null,M=null;if(v=1,a===0||m===0)return u===0||f===0?0:u>0?f>0?-v:v:f>0?v:-v;if(u===0||f===0)return m>0?a>0?v:-v:a>0?-v:v;if(u>0?m>0?u<=m||(v=-v,S=a,a=f,f=S,S=u,u=m,m=S):u<=-m?(v=-v,f=-f,m=-m):(S=a,a=-f,f=S,S=u,u=-m,m=S):m>0?-u<=m?(v=-v,a=-a,u=-u):(S=-a,a=f,f=S,S=-u,u=m,m=S):u>=m?(a=-a,u=-u,f=-f,m=-m):(v=-v,S=-a,a=-f,f=S,S=-u,u=-m,m=S),a>0){if(!(f>0)||!(a<=f))return v}else{if(f>0||!(a>=f))return-v;v=-v,a=-a,f=-f}for(;;){if(M=Math.floor(f/a),f-=M*a,(m-=M*u)<0)return-v;if(m>u)return v;if(a>f+f){if(u<m+m)return v}else{if(u>m+m)return-v;f=a-f,m=u-m,v=-v}if(m===0)return f===0?0:-v;if(f===0||(M=Math.floor(a/f),a-=M*f,(u-=M*m)<0))return v;if(u>m)return-v;if(f>a+a){if(m<u+u)return-v}else{if(m>u+u)return v;a=f-a,u=m-u,v=-v}if(u===0)return a===0?0:v;if(a===0)return-v}};var Ri=o(function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var a=arguments[0];this._p=a},"st");Ri.prototype.countSegment=function(a,u){if(a.x<this._p.x&&u.x<this._p.x)return null;if(this._p.x===u.x&&this._p.y===u.y)return this._isPointOnSegment=!0,null;if(a.y===this._p.y&&u.y===this._p.y){var f=a.x,m=u.x;return f>m&&(f=u.x,m=a.x),this._p.x>=f&&this._p.x<=m&&(this._isPointOnSegment=!0),null}if(a.y>this._p.y&&u.y<=this._p.y||u.y>this._p.y&&a.y<=this._p.y){var v=a.x-this._p.x,S=a.y-this._p.y,M=u.x-this._p.x,B=u.y-this._p.y,z=Ks.signOfDet2x2(v,S,M,B);if(z===0)return this._isPointOnSegment=!0,null;B<S&&(z=-z),z>0&&this._crossingCount++}},Ri.prototype.isPointInPolygon=function(){return this.getLocation()!==U.EXTERIOR},Ri.prototype.getLocation=function(){return this._isPointOnSegment?U.BOUNDARY:this._crossingCount%2==1?U.INTERIOR:U.EXTERIOR},Ri.prototype.isOnSegment=function(){return this._isPointOnSegment},Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri},Ri.locatePointInRing=function(){if(arguments[0]instanceof N&&ne(arguments[1],Ae)){for(var a=arguments[0],u=arguments[1],f=new Ri(a),m=new N,v=new N,S=1;S<u.size();S++)if(u.getCoordinate(S,m),u.getCoordinate(S-1,v),f.countSegment(m,v),f.isOnSegment())return f.getLocation();return f.getLocation()}if(arguments[0]instanceof N&&arguments[1]instanceof Array){for(var M=arguments[0],B=arguments[1],z=new Ri(M),te=1;te<B.length;te++){var pe=B[te],ye=B[te-1];if(z.countSegment(pe,ye),z.isOnSegment())return z.getLocation()}return z.getLocation()}};var ze=o(function(){},"at"),fu={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};ze.prototype.interfaces_=function(){return[]},ze.prototype.getClass=function(){return ze},ze.orientationIndex=function(a,u,f){return Ke.orientationIndex(a,u,f)},ze.signedArea=function(){if(arguments[0]instanceof Array){var a=arguments[0];if(a.length<3)return 0;for(var u=0,f=a[0].x,m=1;m<a.length-1;m++){var v=a[m].x-f,S=a[m+1].y;u+=v*(a[m-1].y-S)}return u/2}if(ne(arguments[0],Ae)){var M=arguments[0],B=M.size();if(B<3)return 0;var z=new N,te=new N,pe=new N;M.getCoordinate(0,te),M.getCoordinate(1,pe);var ye=te.x;pe.x-=ye;for(var Xe=0,Ze=1;Ze<B-1;Ze++)z.y=te.y,te.x=pe.x,te.y=pe.y,M.getCoordinate(Ze+1,pe),pe.x-=ye,Xe+=te.x*(z.y-pe.y);return Xe/2}},ze.distanceLineLine=function(a,u,f,m){if(a.equals(u))return ze.distancePointLine(a,f,m);if(f.equals(m))return ze.distancePointLine(m,a,u);var v=!1;if(ie.intersects(a,u,f,m)){var S=(u.x-a.x)*(m.y-f.y)-(u.y-a.y)*(m.x-f.x);if(S===0)v=!0;else{var M=(a.y-f.y)*(m.x-f.x)-(a.x-f.x)*(m.y-f.y),B=((a.y-f.y)*(u.x-a.x)-(a.x-f.x)*(u.y-a.y))/S,z=M/S;(z<0||z>1||B<0||B>1)&&(v=!0)}}else v=!0;return v?Pe.min(ze.distancePointLine(a,f,m),ze.distancePointLine(u,f,m),ze.distancePointLine(f,a,u),ze.distancePointLine(m,a,u)):0},ze.isPointInRing=function(a,u){return ze.locatePointInRing(a,u)!==U.EXTERIOR},ze.computeLength=function(a){var u=a.size();if(u<=1)return 0;var f=0,m=new N;a.getCoordinate(0,m);for(var v=m.x,S=m.y,M=1;M<u;M++){a.getCoordinate(M,m);var B=m.x,z=m.y,te=B-v,pe=z-S;f+=Math.sqrt(te*te+pe*pe),v=B,S=z}return f},ze.isCCW=function(a){var u=a.length-1;if(u<3)throw new D("Ring has fewer than 4 points, so orientation cannot be determined");for(var f=a[0],m=0,v=1;v<=u;v++){var S=a[v];S.y>f.y&&(f=S,m=v)}var M=m;do(M-=1)<0&&(M=u);while(a[M].equals2D(f)&&M!==m);var B=m;do B=(B+1)%u;while(a[B].equals2D(f)&&B!==m);var z=a[M],te=a[B];if(z.equals2D(f)||te.equals2D(f)||z.equals2D(te))return!1;var pe=ze.computeOrientation(z,f,te),ye=!1;return ye=pe===0?z.x>te.x:pe>0,ye},ze.locatePointInRing=function(a,u){return Ri.locatePointInRing(a,u)},ze.distancePointLinePerpendicular=function(a,u,f){var m=(f.x-u.x)*(f.x-u.x)+(f.y-u.y)*(f.y-u.y),v=((u.y-a.y)*(f.x-u.x)-(u.x-a.x)*(f.y-u.y))/m;return Math.abs(v)*Math.sqrt(m)},ze.computeOrientation=function(a,u,f){return ze.orientationIndex(a,u,f)},ze.distancePointLine=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1];if(u.length===0)throw new D("Line array must contain at least one vertex");for(var f=a.distance(u[0]),m=0;m<u.length-1;m++){var v=ze.distancePointLine(a,u[m],u[m+1]);v<f&&(f=v)}return f}if(arguments.length===3){var S=arguments[0],M=arguments[1],B=arguments[2];if(M.x===B.x&&M.y===B.y)return S.distance(M);var z=(B.x-M.x)*(B.x-M.x)+(B.y-M.y)*(B.y-M.y),te=((S.x-M.x)*(B.x-M.x)+(S.y-M.y)*(B.y-M.y))/z;if(te<=0)return S.distance(M);if(te>=1)return S.distance(B);var pe=((M.y-S.y)*(B.x-M.x)-(M.x-S.x)*(B.y-M.y))/z;return Math.abs(pe)*Math.sqrt(z)}},ze.isOnLine=function(a,u){for(var f=new Ro,m=1;m<u.length;m++){var v=u[m-1],S=u[m];if(f.computeIntersection(a,v,S),f.hasIntersection())return!0}return!1},fu.CLOCKWISE.get=function(){return-1},fu.RIGHT.get=function(){return ze.CLOCKWISE},fu.COUNTERCLOCKWISE.get=function(){return 1},fu.LEFT.get=function(){return ze.COUNTERCLOCKWISE},fu.COLLINEAR.get=function(){return 0},fu.STRAIGHT.get=function(){return ze.COLLINEAR},Object.defineProperties(ze,fu);var Ya=o(function(){},"lt");Ya.prototype.filter=function(a){},Ya.prototype.interfaces_=function(){return[]},Ya.prototype.getClass=function(){return Ya};var vt=o(function(){var a=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=a,this._SRID=a.getSRID()},"ct"),Js={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};vt.prototype.isGeometryCollection=function(){return this.getSortIndex()===vt.SORTINDEX_GEOMETRYCOLLECTION},vt.prototype.getFactory=function(){return this._factory},vt.prototype.getGeometryN=function(a){return this},vt.prototype.getArea=function(){return 0},vt.prototype.isRectangle=function(){return!1},vt.prototype.equals=function(){if(arguments[0]instanceof vt){var a=arguments[0];return a!==null&&this.equalsTopo(a)}if(arguments[0]instanceof Object){var u=arguments[0];if(!(u instanceof vt))return!1;var f=u;return this.equalsExact(f)}},vt.prototype.equalsExact=function(a){return this===a||this.equalsExact(a,0)},vt.prototype.geometryChanged=function(){this.apply(vt.geometryChangedFilter)},vt.prototype.geometryChangedAction=function(){this._envelope=null},vt.prototype.equalsNorm=function(a){return a!==null&&this.norm().equalsExact(a.norm())},vt.prototype.getLength=function(){return 0},vt.prototype.getNumGeometries=function(){return 1},vt.prototype.compareTo=function(){if(arguments.length===1){var a=arguments[0],u=a;return this.getSortIndex()!==u.getSortIndex()?this.getSortIndex()-u.getSortIndex():this.isEmpty()&&u.isEmpty()?0:this.isEmpty()?-1:u.isEmpty()?1:this.compareToSameClass(a)}if(arguments.length===2){var f=arguments[0],m=arguments[1];return this.getSortIndex()!==f.getSortIndex()?this.getSortIndex()-f.getSortIndex():this.isEmpty()&&f.isEmpty()?0:this.isEmpty()?-1:f.isEmpty()?1:this.compareToSameClass(f,m)}},vt.prototype.getUserData=function(){return this._userData},vt.prototype.getSRID=function(){return this._SRID},vt.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},vt.prototype.checkNotGeometryCollection=function(a){if(a.getSortIndex()===vt.SORTINDEX_GEOMETRYCOLLECTION)throw new D("This method does not support GeometryCollection arguments")},vt.prototype.equal=function(a,u,f){return f===0?a.equals(u):a.distance(u)<=f},vt.prototype.norm=function(){var a=this.copy();return a.normalize(),a},vt.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},vt.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new ie(this._envelope)},vt.prototype.setSRID=function(a){this._SRID=a},vt.prototype.setUserData=function(a){this._userData=a},vt.prototype.compare=function(a,u){for(var f=a.iterator(),m=u.iterator();f.hasNext()&&m.hasNext();){var v=f.next(),S=m.next(),M=v.compareTo(S);if(M!==0)return M}return f.hasNext()?1:m.hasNext()?-1:0},vt.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},vt.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===vt.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===vt.SORTINDEX_MULTIPOINT||this.getSortIndex()===vt.SORTINDEX_MULTILINESTRING||this.getSortIndex()===vt.SORTINDEX_MULTIPOLYGON},vt.prototype.interfaces_=function(){return[X,j,t]},vt.prototype.getClass=function(){return vt},vt.hasNonEmptyElements=function(a){for(var u=0;u<a.length;u++)if(!a[u].isEmpty())return!0;return!1},vt.hasNullElements=function(a){for(var u=0;u<a.length;u++)if(a[u]===null)return!0;return!1},Js.serialVersionUID.get=function(){return 8763622679187377e3},Js.SORTINDEX_POINT.get=function(){return 0},Js.SORTINDEX_MULTIPOINT.get=function(){return 1},Js.SORTINDEX_LINESTRING.get=function(){return 2},Js.SORTINDEX_LINEARRING.get=function(){return 3},Js.SORTINDEX_MULTILINESTRING.get=function(){return 4},Js.SORTINDEX_POLYGON.get=function(){return 5},Js.SORTINDEX_MULTIPOLYGON.get=function(){return 6},Js.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},Js.geometryChangedFilter.get=function(){return dc},Object.defineProperties(vt,Js);var dc=o(function(){},"ht");dc.interfaces_=function(){return[Ya]},dc.filter=function(a){a.geometryChangedAction()};var Qo=o(function(){},"ft");Qo.prototype.filter=function(a){},Qo.prototype.interfaces_=function(){return[]},Qo.prototype.getClass=function(){return Qo};var ro=o(function(){},"gt"),es={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};ro.prototype.isInBoundary=function(a){},ro.prototype.interfaces_=function(){return[]},ro.prototype.getClass=function(){return ro},es.Mod2BoundaryNodeRule.get=function(){return Za},es.EndPointBoundaryNodeRule.get=function(){return hc},es.MultiValentEndPointBoundaryNodeRule.get=function(){return mc},es.MonoValentEndPointBoundaryNodeRule.get=function(){return gc},es.MOD2_BOUNDARY_RULE.get=function(){return new Za},es.ENDPOINT_BOUNDARY_RULE.get=function(){return new hc},es.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new mc},es.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new gc},es.OGC_SFS_BOUNDARY_RULE.get=function(){return ro.MOD2_BOUNDARY_RULE},Object.defineProperties(ro,es);var Za=o(function(){},"yt");Za.prototype.isInBoundary=function(a){return a%2==1},Za.prototype.interfaces_=function(){return[ro]},Za.prototype.getClass=function(){return Za};var hc=o(function(){},"_t");hc.prototype.isInBoundary=function(a){return a>0},hc.prototype.interfaces_=function(){return[ro]},hc.prototype.getClass=function(){return hc};var mc=o(function(){},"mt");mc.prototype.isInBoundary=function(a){return a>1},mc.prototype.interfaces_=function(){return[ro]},mc.prototype.getClass=function(){return mc};var gc=o(function(){},"vt");gc.prototype.isInBoundary=function(a){return a===1},gc.prototype.interfaces_=function(){return[ro]},gc.prototype.getClass=function(){return gc};var On=o(function(){},"It");On.prototype.add=function(){},On.prototype.addAll=function(){},On.prototype.isEmpty=function(){},On.prototype.iterator=function(){},On.prototype.size=function(){},On.prototype.toArray=function(){},On.prototype.remove=function(){},(r.prototype=new Error).name="IndexOutOfBoundsException";var yc=o(function(){},"Et");yc.prototype.hasNext=function(){},yc.prototype.next=function(){},yc.prototype.remove=function(){};var ts=function(a){function u(){a.apply(this,arguments)}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.get=function(){},u.prototype.set=function(){},u.prototype.isEmpty=function(){},u}(On);(n.prototype=new Error).name="NoSuchElementException";var He=function(a){function u(){a.call(this),this.array_=[],arguments[0]instanceof On&&this.addAll(arguments[0])}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.ensureCapacity=function(){},u.prototype.interfaces_=function(){return[a,On]},u.prototype.add=function(f){return arguments.length===1?this.array_.push(f):this.array_.splice(arguments[0],arguments[1]),!0},u.prototype.clear=function(){this.array_=[]},u.prototype.addAll=function(f){for(var m=f.iterator();m.hasNext();)this.add(m.next());return!0},u.prototype.set=function(f,m){var v=this.array_[f];return this.array_[f]=m,v},u.prototype.iterator=function(){return new db(this)},u.prototype.get=function(f){if(f<0||f>=this.size())throw new r;return this.array_[f]},u.prototype.isEmpty=function(){return this.array_.length===0},u.prototype.size=function(){return this.array_.length},u.prototype.toArray=function(){for(var f=[],m=0,v=this.array_.length;m<v;m++)f.push(this.array_[m]);return f},u.prototype.remove=function(f){for(var m=!1,v=0,S=this.array_.length;v<S;v++)if(this.array_[v]===f){this.array_.splice(v,1),m=!0;break}return m},u}(ts),db=function(a){function u(f){a.call(this),this.arrayList_=f,this.position_=0}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new n;return this.arrayList_.get(this.position_++)},u.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},u.prototype.set=function(f){return this.arrayList_.set(this.position_-1,f)},u.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},u}(yc),ue=function(a){function u(){if(a.call(this),arguments.length!==0){if(arguments.length===1){var m=arguments[0];this.ensureCapacity(m.length),this.add(m,!0)}else if(arguments.length===2){var v=arguments[0],S=arguments[1];this.ensureCapacity(v.length),this.add(v,S)}}}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={coordArrayType:{configurable:!0}};return f.coordArrayType.get=function(){return new Array(0).fill(null)},u.prototype.getCoordinate=function(m){return this.get(m)},u.prototype.addAll=function(){if(arguments.length===2){for(var m=arguments[0],v=arguments[1],S=!1,M=m.iterator();M.hasNext();)this.add(M.next(),v),S=!0;return S}return a.prototype.addAll.apply(this,arguments)},u.prototype.clone=function(){for(var m=a.prototype.clone.call(this),v=0;v<this.size();v++)m.add(v,this.get(v).copy());return m},u.prototype.toCoordinateArray=function(){return this.toArray(u.coordArrayType)},u.prototype.add=function(){if(arguments.length===1){var m=arguments[0];a.prototype.add.call(this,m)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var v=arguments[0],S=arguments[1];return this.add(v,S,!0),!0}if(arguments[0]instanceof N&&typeof arguments[1]=="boolean"){var M=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(M))return null;a.prototype.add.call(this,M)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var B=arguments[0],z=arguments[1];return this.add(B,z),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var te=arguments[0],pe=arguments[1];if(arguments[2])for(var ye=0;ye<te.length;ye++)this.add(te[ye],pe);else for(var Xe=te.length-1;Xe>=0;Xe--)this.add(te[Xe],pe);return!0}if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof N){var Ze=arguments[0],nt=arguments[1];if(!arguments[2]){var mt=this.size();if(mt>0&&(Ze>0&&this.get(Ze-1).equals2D(nt)||Ze<mt&&this.get(Ze).equals2D(nt)))return null}a.prototype.add.call(this,Ze,nt)}}else if(arguments.length===4){var Zr=arguments[0],Ii=arguments[1],qo=arguments[2],_u=arguments[3],Hp=1;qo>_u&&(Hp=-1);for(var bE=qo;bE!==_u;bE+=Hp)this.add(Zr[bE],Ii);return!0}},u.prototype.closeRing=function(){this.size()>0&&this.add(new N(this.get(0)),!1)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},Object.defineProperties(u,f),u}(He),F=o(function(){},"Lt"),$={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};$.ForwardComparator.get=function(){return W},$.BidirectionalComparator.get=function(){return J},$.coordArrayType.get=function(){return new Array(0).fill(null)},F.prototype.interfaces_=function(){return[]},F.prototype.getClass=function(){return F},F.isRing=function(a){return!(a.length<4)&&!!a[0].equals2D(a[a.length-1])},F.ptNotInList=function(a,u){for(var f=0;f<a.length;f++){var m=a[f];if(F.indexOf(m,u)<0)return m}return null},F.scroll=function(a,u){var f=F.indexOf(u,a);if(f<0)return null;var m=new Array(a.length).fill(null);Se.arraycopy(a,f,m,0,a.length-f),Se.arraycopy(a,0,m,a.length-f,f),Se.arraycopy(m,0,a,0,a.length)},F.equals=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1];if(a===u)return!0;if(a===null||u===null||a.length!==u.length)return!1;for(var f=0;f<a.length;f++)if(!a[f].equals(u[f]))return!1;return!0}if(arguments.length===3){var m=arguments[0],v=arguments[1],S=arguments[2];if(m===v)return!0;if(m===null||v===null||m.length!==v.length)return!1;for(var M=0;M<m.length;M++)if(S.compare(m[M],v[M])!==0)return!1;return!0}},F.intersection=function(a,u){for(var f=new ue,m=0;m<a.length;m++)u.intersects(a[m])&&f.add(a[m],!0);return f.toCoordinateArray()},F.hasRepeatedPoints=function(a){for(var u=1;u<a.length;u++)if(a[u-1].equals(a[u]))return!0;return!1},F.removeRepeatedPoints=function(a){return F.hasRepeatedPoints(a)?new ue(a,!1).toCoordinateArray():a},F.reverse=function(a){for(var u=a.length-1,f=Math.trunc(u/2),m=0;m<=f;m++){var v=a[m];a[m]=a[u-m],a[u-m]=v}},F.removeNull=function(a){for(var u=0,f=0;f<a.length;f++)a[f]!==null&&u++;var m=new Array(u).fill(null);if(u===0)return m;for(var v=0,S=0;S<a.length;S++)a[S]!==null&&(m[v++]=a[S]);return m},F.copyDeep=function(){if(arguments.length===1){for(var a=arguments[0],u=new Array(a.length).fill(null),f=0;f<a.length;f++)u[f]=new N(a[f]);return u}if(arguments.length===5)for(var m=arguments[0],v=arguments[1],S=arguments[2],M=arguments[3],B=arguments[4],z=0;z<B;z++)S[M+z]=new N(m[v+z])},F.isEqualReversed=function(a,u){for(var f=0;f<a.length;f++){var m=a[f],v=u[a.length-f-1];if(m.compareTo(v)!==0)return!1}return!0},F.envelope=function(a){for(var u=new ie,f=0;f<a.length;f++)u.expandToInclude(a[f]);return u},F.toCoordinateArray=function(a){return a.toArray(F.coordArrayType)},F.atLeastNCoordinatesOrNothing=function(a,u){return u.length>=a?u:[]},F.indexOf=function(a,u){for(var f=0;f<u.length;f++)if(a.equals(u[f]))return f;return-1},F.increasingDirection=function(a){for(var u=0;u<Math.trunc(a.length/2);u++){var f=a.length-1-u,m=a[u].compareTo(a[f]);if(m!==0)return m}return 1},F.compare=function(a,u){for(var f=0;f<a.length&&f<u.length;){var m=a[f].compareTo(u[f]);if(m!==0)return m;f++}return f<u.length?-1:f<a.length?1:0},F.minCoordinate=function(a){for(var u=null,f=0;f<a.length;f++)(u===null||u.compareTo(a[f])>0)&&(u=a[f]);return u},F.extract=function(a,u,f){u=Pe.clamp(u,0,a.length);var m=(f=Pe.clamp(f,-1,a.length))-u+1;f<0&&(m=0),u>=a.length&&(m=0),f<u&&(m=0);var v=new Array(m).fill(null);if(m===0)return v;for(var S=0,M=u;M<=f;M++)v[S++]=a[M];return v},Object.defineProperties(F,$);var W=o(function(){},"wt");W.prototype.compare=function(a,u){return F.compare(a,u)},W.prototype.interfaces_=function(){return[Y]},W.prototype.getClass=function(){return W};var J=o(function(){},"Ot");J.prototype.compare=function(a,u){var f=a,m=u;if(f.length<m.length)return-1;if(f.length>m.length)return 1;if(f.length===0)return 0;var v=F.compare(f,m);return F.isEqualReversed(f,m)?0:v},J.prototype.OLDcompare=function(a,u){var f=a,m=u;if(f.length<m.length)return-1;if(f.length>m.length)return 1;if(f.length===0)return 0;for(var v=F.increasingDirection(f),S=F.increasingDirection(m),M=v>0?0:f.length-1,B=S>0?0:f.length-1,z=0;z<f.length;z++){var te=f[M].compareTo(m[B]);if(te!==0)return te;M+=v,B+=S}return 0},J.prototype.interfaces_=function(){return[Y]},J.prototype.getClass=function(){return J};var K=o(function(){},"Tt");K.prototype.get=function(){},K.prototype.put=function(){},K.prototype.size=function(){},K.prototype.values=function(){},K.prototype.entrySet=function(){};var Ie=function(a){function u(){a.apply(this,arguments)}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u}(K);(i.prototype=new Error).name="OperationNotSupported",(s.prototype=new On).contains=function(){};var ge=function(a){function u(){a.call(this),this.array_=[],arguments[0]instanceof On&&this.addAll(arguments[0])}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.contains=function(f){for(var m=0,v=this.array_.length;m<v;m++)if(this.array_[m]===f)return!0;return!1},u.prototype.add=function(f){return!this.contains(f)&&(this.array_.push(f),!0)},u.prototype.addAll=function(f){for(var m=f.iterator();m.hasNext();)this.add(m.next());return!0},u.prototype.remove=function(f){throw new Error},u.prototype.size=function(){return this.array_.length},u.prototype.isEmpty=function(){return this.array_.length===0},u.prototype.toArray=function(){for(var f=[],m=0,v=this.array_.length;m<v;m++)f.push(this.array_[m]);return f},u.prototype.iterator=function(){return new De(this)},u}(s),De=function(a){function u(f){a.call(this),this.hashSet_=f,this.position_=0}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new n;return this.hashSet_.array_[this.position_++]},u.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},u.prototype.remove=function(){throw new i},u}(yc),we=0;(b.prototype=new Ie).get=function(a){for(var u=this.root_;u!==null;){var f=a.compareTo(u.key);if(f<0)u=u.left;else{if(!(f>0))return u.value;u=u.right}}return null},b.prototype.put=function(a,u){if(this.root_===null)return this.root_={key:a,value:u,left:null,right:null,parent:null,color:we,getValue:o(function(){return this.value},"getValue"),getKey:o(function(){return this.key},"getKey")},this.size_=1,null;var f,m,v=this.root_;do if(f=v,(m=a.compareTo(v.key))<0)v=v.left;else{if(!(m>0)){var S=v.value;return v.value=u,S}v=v.right}while(v!==null);var M={key:a,left:null,right:null,value:u,parent:f,color:we,getValue:o(function(){return this.value},"getValue"),getKey:o(function(){return this.key},"getKey")};return m<0?f.left=M:f.right=M,this.fixAfterInsertion(M),this.size_++,null},b.prototype.fixAfterInsertion=function(a){for(a.color=1;a!=null&&a!==this.root_&&a.parent.color===1;)if(c(a)===h(c(c(a)))){var u=y(c(c(a)));l(u)===1?(p(c(a),we),p(u,we),p(c(c(a)),1),a=c(c(a))):(a===y(c(a))&&(a=c(a),this.rotateLeft(a)),p(c(a),we),p(c(c(a)),1),this.rotateRight(c(c(a))))}else{var f=h(c(c(a)));l(f)===1?(p(c(a),we),p(f,we),p(c(c(a)),1),a=c(c(a))):(a===h(c(a))&&(a=c(a),this.rotateRight(a)),p(c(a),we),p(c(c(a)),1),this.rotateLeft(c(c(a))))}this.root_.color=we},b.prototype.values=function(){var a=new He,u=this.getFirstEntry();if(u!==null)for(a.add(u.value);(u=b.successor(u))!==null;)a.add(u.value);return a},b.prototype.entrySet=function(){var a=new ge,u=this.getFirstEntry();if(u!==null)for(a.add(u);(u=b.successor(u))!==null;)a.add(u);return a},b.prototype.rotateLeft=function(a){if(a!=null){var u=a.right;a.right=u.left,u.left!=null&&(u.left.parent=a),u.parent=a.parent,a.parent===null?this.root_=u:a.parent.left===a?a.parent.left=u:a.parent.right=u,u.left=a,a.parent=u}},b.prototype.rotateRight=function(a){if(a!=null){var u=a.left;a.left=u.right,u.right!=null&&(u.right.parent=a),u.parent=a.parent,a.parent===null?this.root_=u:a.parent.right===a?a.parent.right=u:a.parent.left=u,u.right=a,a.parent=u}},b.prototype.getFirstEntry=function(){var a=this.root_;if(a!=null)for(;a.left!=null;)a=a.left;return a},b.successor=function(a){if(a===null)return null;if(a.right!==null){for(var u=a.right;u.left!==null;)u=u.left;return u}for(var f=a.parent,m=a;f!==null&&m===f.right;)m=f,f=f.parent;return f},b.prototype.size=function(){return this.size_};var Qe=o(function(){},"At");Qe.prototype.interfaces_=function(){return[]},Qe.prototype.getClass=function(){return Qe},_.prototype=new s,(C.prototype=new _).contains=function(a){for(var u=0,f=this.array_.length;u<f;u++)if(this.array_[u].compareTo(a)===0)return!0;return!1},C.prototype.add=function(a){if(this.contains(a))return!1;for(var u=0,f=this.array_.length;u<f;u++)if(this.array_[u].compareTo(a)===1)return this.array_.splice(u,0,a),!0;return this.array_.push(a),!0},C.prototype.addAll=function(a){for(var u=a.iterator();u.hasNext();)this.add(u.next());return!0},C.prototype.remove=function(a){throw new i},C.prototype.size=function(){return this.array_.length},C.prototype.isEmpty=function(){return this.array_.length===0},C.prototype.toArray=function(){for(var a=[],u=0,f=this.array_.length;u<f;u++)a.push(this.array_[u]);return a},C.prototype.iterator=function(){return new de(this)};var de=o(function(a){this.treeSet_=a,this.position_=0},"Ft");de.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new n;return this.treeSet_.array_[this.position_++]},de.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},de.prototype.remove=function(){throw new i};var Fe=o(function(){},"Gt");Fe.sort=function(){var a,u,f,m,v=arguments[0];if(arguments.length===1)m=o(function(M,B){return M.compareTo(B)},"i"),v.sort(m);else if(arguments.length===2)f=arguments[1],m=o(function(M,B){return f.compare(M,B)},"i"),v.sort(m);else if(arguments.length===3){(u=v.slice(arguments[1],arguments[2])).sort();var S=v.slice(0,arguments[1]).concat(u,v.slice(arguments[2],v.length));for(v.splice(0,v.length),a=0;a<S.length;a++)v.push(S[a])}else if(arguments.length===4)for(u=v.slice(arguments[1],arguments[2]),f=arguments[3],m=o(function(M,B){return f.compare(M,B)},"i"),u.sort(m),S=v.slice(0,arguments[1]).concat(u,v.slice(arguments[2],v.length)),v.splice(0,v.length),a=0;a<S.length;a++)v.push(S[a])},Fe.asList=function(a){for(var u=new He,f=0,m=a.length;f<m;f++)u.add(a[f]);return u};var Le=o(function(){},"qt"),bt={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};bt.P.get=function(){return 0},bt.L.get=function(){return 1},bt.A.get=function(){return 2},bt.FALSE.get=function(){return-1},bt.TRUE.get=function(){return-2},bt.DONTCARE.get=function(){return-3},bt.SYM_FALSE.get=function(){return"F"},bt.SYM_TRUE.get=function(){return"T"},bt.SYM_DONTCARE.get=function(){return"*"},bt.SYM_P.get=function(){return"0"},bt.SYM_L.get=function(){return"1"},bt.SYM_A.get=function(){return"2"},Le.prototype.interfaces_=function(){return[]},Le.prototype.getClass=function(){return Le},Le.toDimensionSymbol=function(a){switch(a){case Le.FALSE:return Le.SYM_FALSE;case Le.TRUE:return Le.SYM_TRUE;case Le.DONTCARE:return Le.SYM_DONTCARE;case Le.P:return Le.SYM_P;case Le.L:return Le.SYM_L;case Le.A:return Le.SYM_A}throw new D("Unknown dimension value: "+a)},Le.toDimensionValue=function(a){switch(Me.toUpperCase(a)){case Le.SYM_FALSE:return Le.FALSE;case Le.SYM_TRUE:return Le.TRUE;case Le.SYM_DONTCARE:return Le.DONTCARE;case Le.SYM_P:return Le.P;case Le.SYM_L:return Le.L;case Le.SYM_A:return Le.A}throw new D("Unknown dimension symbol: "+a)},Object.defineProperties(Le,bt);var dt=o(function(){},"Vt");dt.prototype.filter=function(a){},dt.prototype.interfaces_=function(){return[]},dt.prototype.getClass=function(){return dt};var kt=o(function(){},"Ut");kt.prototype.filter=function(a,u){},kt.prototype.isDone=function(){},kt.prototype.isGeometryChanged=function(){},kt.prototype.interfaces_=function(){return[]},kt.prototype.getClass=function(){return kt};var xt=function(a){function u(m,v){if(a.call(this,v),this._geometries=m||[],a.hasNullElements(this._geometries))throw new D("geometries must not contain null elements")}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={serialVersionUID:{configurable:!0}};return u.prototype.computeEnvelopeInternal=function(){for(var m=new ie,v=0;v<this._geometries.length;v++)m.expandToInclude(this._geometries[v].getEnvelopeInternal());return m},u.prototype.getGeometryN=function(m){return this._geometries[m]},u.prototype.getSortIndex=function(){return a.SORTINDEX_GEOMETRYCOLLECTION},u.prototype.getCoordinates=function(){for(var m=new Array(this.getNumPoints()).fill(null),v=-1,S=0;S<this._geometries.length;S++)for(var M=this._geometries[S].getCoordinates(),B=0;B<M.length;B++)m[++v]=M[B];return m},u.prototype.getArea=function(){for(var m=0,v=0;v<this._geometries.length;v++)m+=this._geometries[v].getArea();return m},u.prototype.equalsExact=function(){if(arguments.length===2){var m=arguments[0],v=arguments[1];if(!this.isEquivalentClass(m))return!1;var S=m;if(this._geometries.length!==S._geometries.length)return!1;for(var M=0;M<this._geometries.length;M++)if(!this._geometries[M].equalsExact(S._geometries[M],v))return!1;return!0}return a.prototype.equalsExact.apply(this,arguments)},u.prototype.normalize=function(){for(var m=0;m<this._geometries.length;m++)this._geometries[m].normalize();Fe.sort(this._geometries)},u.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},u.prototype.getBoundaryDimension=function(){for(var m=Le.FALSE,v=0;v<this._geometries.length;v++)m=Math.max(m,this._geometries[v].getBoundaryDimension());return m},u.prototype.getDimension=function(){for(var m=Le.FALSE,v=0;v<this._geometries.length;v++)m=Math.max(m,this._geometries[v].getDimension());return m},u.prototype.getLength=function(){for(var m=0,v=0;v<this._geometries.length;v++)m+=this._geometries[v].getLength();return m},u.prototype.getNumPoints=function(){for(var m=0,v=0;v<this._geometries.length;v++)m+=this._geometries[v].getNumPoints();return m},u.prototype.getNumGeometries=function(){return this._geometries.length},u.prototype.reverse=function(){for(var m=this._geometries.length,v=new Array(m).fill(null),S=0;S<this._geometries.length;S++)v[S]=this._geometries[S].reverse();return this.getFactory().createGeometryCollection(v)},u.prototype.compareToSameClass=function(){if(arguments.length===1){var m=arguments[0],v=new C(Fe.asList(this._geometries)),S=new C(Fe.asList(m._geometries));return this.compare(v,S)}if(arguments.length===2){for(var M=arguments[0],B=arguments[1],z=M,te=this.getNumGeometries(),pe=z.getNumGeometries(),ye=0;ye<te&&ye<pe;){var Xe=this.getGeometryN(ye),Ze=z.getGeometryN(ye),nt=Xe.compareToSameClass(Ze,B);if(nt!==0)return nt;ye++}return ye<te?1:ye<pe?-1:0}},u.prototype.apply=function(){if(ne(arguments[0],Qo))for(var m=arguments[0],v=0;v<this._geometries.length;v++)this._geometries[v].apply(m);else if(ne(arguments[0],kt)){var S=arguments[0];if(this._geometries.length===0)return null;for(var M=0;M<this._geometries.length&&(this._geometries[M].apply(S),!S.isDone());M++);S.isGeometryChanged()&&this.geometryChanged()}else if(ne(arguments[0],dt)){var B=arguments[0];B.filter(this);for(var z=0;z<this._geometries.length;z++)this._geometries[z].apply(B)}else if(ne(arguments[0],Ya)){var te=arguments[0];te.filter(this);for(var pe=0;pe<this._geometries.length;pe++)this._geometries[pe].apply(te)}},u.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),ot.shouldNeverReachHere(),null},u.prototype.clone=function(){var m=a.prototype.clone.call(this);m._geometries=new Array(this._geometries.length).fill(null);for(var v=0;v<this._geometries.length;v++)m._geometries[v]=this._geometries[v].clone();return m},u.prototype.getGeometryType=function(){return"GeometryCollection"},u.prototype.copy=function(){for(var m=new Array(this._geometries.length).fill(null),v=0;v<m.length;v++)m[v]=this._geometries[v].copy();return new u(m,this._factory)},u.prototype.isEmpty=function(){for(var m=0;m<this._geometries.length;m++)if(!this._geometries[m].isEmpty())return!1;return!0},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},f.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(u,f),u}(vt),dn=function(a){function u(){a.apply(this,arguments)}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={serialVersionUID:{configurable:!0}};return u.prototype.getSortIndex=function(){return vt.SORTINDEX_MULTILINESTRING},u.prototype.equalsExact=function(){if(arguments.length===2){var m=arguments[0],v=arguments[1];return!!this.isEquivalentClass(m)&&a.prototype.equalsExact.call(this,m,v)}return a.prototype.equalsExact.apply(this,arguments)},u.prototype.getBoundaryDimension=function(){return this.isClosed()?Le.FALSE:0},u.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var m=0;m<this._geometries.length;m++)if(!this._geometries[m].isClosed())return!1;return!0},u.prototype.getDimension=function(){return 1},u.prototype.reverse=function(){for(var m=this._geometries.length,v=new Array(m).fill(null),S=0;S<this._geometries.length;S++)v[m-1-S]=this._geometries[S].reverse();return this.getFactory().createMultiLineString(v)},u.prototype.getBoundary=function(){return new _n(this).getBoundary()},u.prototype.getGeometryType=function(){return"MultiLineString"},u.prototype.copy=function(){for(var m=new Array(this._geometries.length).fill(null),v=0;v<m.length;v++)m[v]=this._geometries[v].copy();return new u(m,this._factory)},u.prototype.interfaces_=function(){return[Qe]},u.prototype.getClass=function(){return u},f.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(u,f),u}(xt),_n=o(function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var a=arguments[0],u=ro.MOD2_BOUNDARY_RULE;this._geom=a,this._geomFact=a.getFactory(),this._bnRule=u}else if(arguments.length===2){var f=arguments[0],m=arguments[1];this._geom=f,this._geomFact=f.getFactory(),this._bnRule=m}},"Yt");_n.prototype.boundaryMultiLineString=function(a){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var u=this.computeBoundaryCoordinates(a);return u.length===1?this._geomFact.createPoint(u[0]):this._geomFact.createMultiPointFromCoords(u)},_n.prototype.getBoundary=function(){return this._geom instanceof Gt?this.boundaryLineString(this._geom):this._geom instanceof dn?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},_n.prototype.boundaryLineString=function(a){return this._geom.isEmpty()?this.getEmptyMultiPoint():a.isClosed()?this._bnRule.isInBoundary(2)?a.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([a.getStartPoint(),a.getEndPoint()])},_n.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},_n.prototype.computeBoundaryCoordinates=function(a){var u=new He;this._endpointMap=new b;for(var f=0;f<a.getNumGeometries();f++){var m=a.getGeometryN(f);m.getNumPoints()!==0&&(this.addEndpoint(m.getCoordinateN(0)),this.addEndpoint(m.getCoordinateN(m.getNumPoints()-1)))}for(var v=this._endpointMap.entrySet().iterator();v.hasNext();){var S=v.next(),M=S.getValue().count;this._bnRule.isInBoundary(M)&&u.add(S.getKey())}return F.toCoordinateArray(u)},_n.prototype.addEndpoint=function(a){var u=this._endpointMap.get(a);u===null&&(u=new si,this._endpointMap.put(a,u)),u.count++},_n.prototype.interfaces_=function(){return[]},_n.prototype.getClass=function(){return _n},_n.getBoundary=function(){if(arguments.length===1){var a=arguments[0];return new _n(a).getBoundary()}if(arguments.length===2){var u=arguments[0],f=arguments[1];return new _n(u,f).getBoundary()}};var si=o(function(){this.count=null},"kt");si.prototype.interfaces_=function(){return[]},si.prototype.getClass=function(){return si};var Sn=o(function(){},"jt"),no={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Sn.prototype.interfaces_=function(){return[]},Sn.prototype.getClass=function(){return Sn},Sn.chars=function(a,u){for(var f=new Array(u).fill(null),m=0;m<u;m++)f[m]=a;return String(f)},Sn.getStackTrace=function(){if(arguments.length===1){var a=arguments[0],u=new function(){},f=new function(){}(u);return a.printStackTrace(f),u.toString()}if(arguments.length===2){for(var m=arguments[0],v=arguments[1],S="",M=new function(){}(new function(){}(Sn.getStackTrace(m))),B=0;B<v;B++)try{S+=M.readLine()+Sn.NEWLINE}catch(z){if(!(z instanceof P))throw z;ot.shouldNeverReachHere()}return S}},Sn.split=function(a,u){for(var f=u.length,m=new He,v=""+a,S=v.indexOf(u);S>=0;){var M=v.substring(0,S);m.add(M),S=(v=v.substring(S+f)).indexOf(u)}v.length>0&&m.add(v);for(var B=new Array(m.size()).fill(null),z=0;z<B.length;z++)B[z]=m.get(z);return B},Sn.toString=function(){if(arguments.length===1){var a=arguments[0];return Sn.SIMPLE_ORDINATE_FORMAT.format(a)}},Sn.spaces=function(a){return Sn.chars(" ",a)},no.NEWLINE.get=function(){return Se.getProperty("line.separator")},no.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(Sn,no);var Qt=o(function(){},"Wt");Qt.prototype.interfaces_=function(){return[]},Qt.prototype.getClass=function(){return Qt},Qt.copyCoord=function(a,u,f,m){for(var v=Math.min(a.getDimension(),f.getDimension()),S=0;S<v;S++)f.setOrdinate(m,S,a.getOrdinate(u,S))},Qt.isRing=function(a){var u=a.size();return u===0||!(u<=3)&&a.getOrdinate(0,Ae.X)===a.getOrdinate(u-1,Ae.X)&&a.getOrdinate(0,Ae.Y)===a.getOrdinate(u-1,Ae.Y)},Qt.isEqual=function(a,u){var f=a.size();if(f!==u.size())return!1;for(var m=Math.min(a.getDimension(),u.getDimension()),v=0;v<f;v++)for(var S=0;S<m;S++){var M=a.getOrdinate(v,S),B=u.getOrdinate(v,S);if(a.getOrdinate(v,S)!==u.getOrdinate(v,S)&&(!A.isNaN(M)||!A.isNaN(B)))return!1}return!0},Qt.extend=function(a,u,f){var m=a.create(f,u.getDimension()),v=u.size();if(Qt.copy(u,0,m,0,v),v>0)for(var S=v;S<f;S++)Qt.copy(u,v-1,m,S,1);return m},Qt.reverse=function(a){for(var u=a.size()-1,f=Math.trunc(u/2),m=0;m<=f;m++)Qt.swap(a,m,u-m)},Qt.swap=function(a,u,f){if(u===f)return null;for(var m=0;m<a.getDimension();m++){var v=a.getOrdinate(u,m);a.setOrdinate(u,m,a.getOrdinate(f,m)),a.setOrdinate(f,m,v)}},Qt.copy=function(a,u,f,m,v){for(var S=0;S<v;S++)Qt.copyCoord(a,u+S,f,m+S)},Qt.toString=function(){if(arguments.length===1){var a=arguments[0],u=a.size();if(u===0)return"()";var f=a.getDimension(),m=new Ue;m.append("(");for(var v=0;v<u;v++){v>0&&m.append(" ");for(var S=0;S<f;S++)S>0&&m.append(","),m.append(Sn.toString(a.getOrdinate(v,S)))}return m.append(")"),m.toString()}},Qt.ensureValidRing=function(a,u){var f=u.size();return f===0?u:f<=3?Qt.createClosedRing(a,u,4):u.getOrdinate(0,Ae.X)===u.getOrdinate(f-1,Ae.X)&&u.getOrdinate(0,Ae.Y)===u.getOrdinate(f-1,Ae.Y)?u:Qt.createClosedRing(a,u,f+1)},Qt.createClosedRing=function(a,u,f){var m=a.create(f,u.getDimension()),v=u.size();Qt.copy(u,0,m,0,v);for(var S=v;S<f;S++)Qt.copy(u,0,m,S,1);return m};var Gt=function(a){function u(m,v){a.call(this,v),this._points=null,this.init(m)}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={serialVersionUID:{configurable:!0}};return u.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new ie:this._points.expandEnvelope(new ie)},u.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},u.prototype.getSortIndex=function(){return a.SORTINDEX_LINESTRING},u.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},u.prototype.equalsExact=function(){if(arguments.length===2){var m=arguments[0],v=arguments[1];if(!this.isEquivalentClass(m))return!1;var S=m;if(this._points.size()!==S._points.size())return!1;for(var M=0;M<this._points.size();M++)if(!this.equal(this._points.getCoordinate(M),S._points.getCoordinate(M),v))return!1;return!0}return a.prototype.equalsExact.apply(this,arguments)},u.prototype.normalize=function(){for(var m=0;m<Math.trunc(this._points.size()/2);m++){var v=this._points.size()-1-m;if(!this._points.getCoordinate(m).equals(this._points.getCoordinate(v)))return this._points.getCoordinate(m).compareTo(this._points.getCoordinate(v))>0&&Qt.reverse(this._points),null}},u.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},u.prototype.getBoundaryDimension=function(){return this.isClosed()?Le.FALSE:0},u.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},u.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},u.prototype.getDimension=function(){return 1},u.prototype.getLength=function(){return ze.computeLength(this._points)},u.prototype.getNumPoints=function(){return this._points.size()},u.prototype.reverse=function(){var m=this._points.copy();return Qt.reverse(m),this.getFactory().createLineString(m)},u.prototype.compareToSameClass=function(){if(arguments.length===1){for(var m=arguments[0],v=0,S=0;v<this._points.size()&&S<m._points.size();){var M=this._points.getCoordinate(v).compareTo(m._points.getCoordinate(S));if(M!==0)return M;v++,S++}return v<this._points.size()?1:S<m._points.size()?-1:0}if(arguments.length===2){var B=arguments[0];return arguments[1].compare(this._points,B._points)}},u.prototype.apply=function(){if(ne(arguments[0],Qo))for(var m=arguments[0],v=0;v<this._points.size();v++)m.filter(this._points.getCoordinate(v));else if(ne(arguments[0],kt)){var S=arguments[0];if(this._points.size()===0)return null;for(var M=0;M<this._points.size()&&(S.filter(this._points,M),!S.isDone());M++);S.isGeometryChanged()&&this.geometryChanged()}else ne(arguments[0],dt)?arguments[0].filter(this):ne(arguments[0],Ya)&&arguments[0].filter(this)},u.prototype.getBoundary=function(){return new _n(this).getBoundary()},u.prototype.isEquivalentClass=function(m){return m instanceof u},u.prototype.clone=function(){var m=a.prototype.clone.call(this);return m._points=this._points.clone(),m},u.prototype.getCoordinateN=function(m){return this._points.getCoordinate(m)},u.prototype.getGeometryType=function(){return"LineString"},u.prototype.copy=function(){return new u(this._points.copy(),this._factory)},u.prototype.getCoordinateSequence=function(){return this._points},u.prototype.isEmpty=function(){return this._points.size()===0},u.prototype.init=function(m){if(m===null&&(m=this.getFactory().getCoordinateSequenceFactory().create([])),m.size()===1)throw new D("Invalid number of points in LineString (found "+m.size()+" - must be 0 or >= 2)");this._points=m},u.prototype.isCoordinate=function(m){for(var v=0;v<this._points.size();v++)if(this._points.getCoordinate(v).equals(m))return!0;return!1},u.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},u.prototype.getPointN=function(m){return this.getFactory().createPoint(this._points.getCoordinate(m))},u.prototype.interfaces_=function(){return[Qe]},u.prototype.getClass=function(){return u},f.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(u,f),u}(vt),rs=o(function(){},"Jt");rs.prototype.interfaces_=function(){return[]},rs.prototype.getClass=function(){return rs};var jn=function(a){function u(m,v){a.call(this,v),this._coordinates=m||null,this.init(this._coordinates)}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={serialVersionUID:{configurable:!0}};return u.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new ie;var m=new ie;return m.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),m},u.prototype.getSortIndex=function(){return a.SORTINDEX_POINT},u.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},u.prototype.equalsExact=function(){if(arguments.length===2){var m=arguments[0],v=arguments[1];return!!this.isEquivalentClass(m)&&(!(!this.isEmpty()||!m.isEmpty())||this.isEmpty()===m.isEmpty()&&this.equal(m.getCoordinate(),this.getCoordinate(),v))}return a.prototype.equalsExact.apply(this,arguments)},u.prototype.normalize=function(){},u.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},u.prototype.getBoundaryDimension=function(){return Le.FALSE},u.prototype.getDimension=function(){return 0},u.prototype.getNumPoints=function(){return this.isEmpty()?0:1},u.prototype.reverse=function(){return this.copy()},u.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},u.prototype.compareToSameClass=function(){if(arguments.length===1){var m=arguments[0];return this.getCoordinate().compareTo(m.getCoordinate())}if(arguments.length===2){var v=arguments[0];return arguments[1].compare(this._coordinates,v._coordinates)}},u.prototype.apply=function(){if(ne(arguments[0],Qo)){var m=arguments[0];if(this.isEmpty())return null;m.filter(this.getCoordinate())}else if(ne(arguments[0],kt)){var v=arguments[0];if(this.isEmpty())return null;v.filter(this._coordinates,0),v.isGeometryChanged()&&this.geometryChanged()}else ne(arguments[0],dt)?arguments[0].filter(this):ne(arguments[0],Ya)&&arguments[0].filter(this)},u.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},u.prototype.clone=function(){var m=a.prototype.clone.call(this);return m._coordinates=this._coordinates.clone(),m},u.prototype.getGeometryType=function(){return"Point"},u.prototype.copy=function(){return new u(this._coordinates.copy(),this._factory)},u.prototype.getCoordinateSequence=function(){return this._coordinates},u.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},u.prototype.isEmpty=function(){return this._coordinates.size()===0},u.prototype.init=function(m){m===null&&(m=this.getFactory().getCoordinateSequenceFactory().create([])),ot.isTrue(m.size()<=1),this._coordinates=m},u.prototype.isSimple=function(){return!0},u.prototype.interfaces_=function(){return[rs]},u.prototype.getClass=function(){return u},f.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(u,f),u}(vt),Hi=o(function(){},"Zt");Hi.prototype.interfaces_=function(){return[]},Hi.prototype.getClass=function(){return Hi};var Xr=function(a){function u(m,v,S){if(a.call(this,S),this._shell=null,this._holes=null,m===null&&(m=this.getFactory().createLinearRing()),v===null&&(v=[]),a.hasNullElements(v))throw new D("holes must not contain null elements");if(m.isEmpty()&&a.hasNonEmptyElements(v))throw new D("shell is empty but holes are not");this._shell=m,this._holes=v}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={serialVersionUID:{configurable:!0}};return u.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},u.prototype.getSortIndex=function(){return a.SORTINDEX_POLYGON},u.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var m=new Array(this.getNumPoints()).fill(null),v=-1,S=this._shell.getCoordinates(),M=0;M<S.length;M++)m[++v]=S[M];for(var B=0;B<this._holes.length;B++)for(var z=this._holes[B].getCoordinates(),te=0;te<z.length;te++)m[++v]=z[te];return m},u.prototype.getArea=function(){var m=0;m+=Math.abs(ze.signedArea(this._shell.getCoordinateSequence()));for(var v=0;v<this._holes.length;v++)m-=Math.abs(ze.signedArea(this._holes[v].getCoordinateSequence()));return m},u.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var m=this._shell.getCoordinateSequence(),v=this.getEnvelopeInternal(),S=0;S<5;S++){var M=m.getX(S);if(M!==v.getMinX()&&M!==v.getMaxX())return!1;var B=m.getY(S);if(B!==v.getMinY()&&B!==v.getMaxY())return!1}for(var z=m.getX(0),te=m.getY(0),pe=1;pe<=4;pe++){var ye=m.getX(pe),Xe=m.getY(pe);if(ye!==z==(Xe!==te))return!1;z=ye,te=Xe}return!0},u.prototype.equalsExact=function(){if(arguments.length===2){var m=arguments[0],v=arguments[1];if(!this.isEquivalentClass(m))return!1;var S=m,M=this._shell,B=S._shell;if(!M.equalsExact(B,v)||this._holes.length!==S._holes.length)return!1;for(var z=0;z<this._holes.length;z++)if(!this._holes[z].equalsExact(S._holes[z],v))return!1;return!0}return a.prototype.equalsExact.apply(this,arguments)},u.prototype.normalize=function(){if(arguments.length===0){this.normalize(this._shell,!0);for(var m=0;m<this._holes.length;m++)this.normalize(this._holes[m],!1);Fe.sort(this._holes)}else if(arguments.length===2){var v=arguments[0],S=arguments[1];if(v.isEmpty())return null;var M=new Array(v.getCoordinates().length-1).fill(null);Se.arraycopy(v.getCoordinates(),0,M,0,M.length);var B=F.minCoordinate(v.getCoordinates());F.scroll(M,B),Se.arraycopy(M,0,v.getCoordinates(),0,M.length),v.getCoordinates()[M.length]=M[0],ze.isCCW(v.getCoordinates())===S&&F.reverse(v.getCoordinates())}},u.prototype.getCoordinate=function(){return this._shell.getCoordinate()},u.prototype.getNumInteriorRing=function(){return this._holes.length},u.prototype.getBoundaryDimension=function(){return 1},u.prototype.getDimension=function(){return 2},u.prototype.getLength=function(){var m=0;m+=this._shell.getLength();for(var v=0;v<this._holes.length;v++)m+=this._holes[v].getLength();return m},u.prototype.getNumPoints=function(){for(var m=this._shell.getNumPoints(),v=0;v<this._holes.length;v++)m+=this._holes[v].getNumPoints();return m},u.prototype.reverse=function(){var m=this.copy();m._shell=this._shell.copy().reverse(),m._holes=new Array(this._holes.length).fill(null);for(var v=0;v<this._holes.length;v++)m._holes[v]=this._holes[v].copy().reverse();return m},u.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},u.prototype.compareToSameClass=function(){if(arguments.length===1){var m=arguments[0],v=this._shell,S=m._shell;return v.compareToSameClass(S)}if(arguments.length===2){var M=arguments[0],B=arguments[1],z=M,te=this._shell,pe=z._shell,ye=te.compareToSameClass(pe,B);if(ye!==0)return ye;for(var Xe=this.getNumInteriorRing(),Ze=z.getNumInteriorRing(),nt=0;nt<Xe&&nt<Ze;){var mt=this.getInteriorRingN(nt),Zr=z.getInteriorRingN(nt),Ii=mt.compareToSameClass(Zr,B);if(Ii!==0)return Ii;nt++}return nt<Xe?1:nt<Ze?-1:0}},u.prototype.apply=function(m){if(ne(m,Qo)){this._shell.apply(m);for(var v=0;v<this._holes.length;v++)this._holes[v].apply(m)}else if(ne(m,kt)){if(this._shell.apply(m),!m.isDone())for(var S=0;S<this._holes.length&&(this._holes[S].apply(m),!m.isDone());S++);m.isGeometryChanged()&&this.geometryChanged()}else if(ne(m,dt))m.filter(this);else if(ne(m,Ya)){m.filter(this),this._shell.apply(m);for(var M=0;M<this._holes.length;M++)this._holes[M].apply(m)}},u.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var m=new Array(this._holes.length+1).fill(null);m[0]=this._shell;for(var v=0;v<this._holes.length;v++)m[v+1]=this._holes[v];return m.length<=1?this.getFactory().createLinearRing(m[0].getCoordinateSequence()):this.getFactory().createMultiLineString(m)},u.prototype.clone=function(){var m=a.prototype.clone.call(this);m._shell=this._shell.clone(),m._holes=new Array(this._holes.length).fill(null);for(var v=0;v<this._holes.length;v++)m._holes[v]=this._holes[v].clone();return m},u.prototype.getGeometryType=function(){return"Polygon"},u.prototype.copy=function(){for(var m=this._shell.copy(),v=new Array(this._holes.length).fill(null),S=0;S<v.length;S++)v[S]=this._holes[S].copy();return new u(m,v,this._factory)},u.prototype.getExteriorRing=function(){return this._shell},u.prototype.isEmpty=function(){return this._shell.isEmpty()},u.prototype.getInteriorRingN=function(m){return this._holes[m]},u.prototype.interfaces_=function(){return[Hi]},u.prototype.getClass=function(){return u},f.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(u,f),u}(vt),Es=function(a){function u(){a.apply(this,arguments)}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={serialVersionUID:{configurable:!0}};return u.prototype.getSortIndex=function(){return vt.SORTINDEX_MULTIPOINT},u.prototype.isValid=function(){return!0},u.prototype.equalsExact=function(){if(arguments.length===2){var m=arguments[0],v=arguments[1];return!!this.isEquivalentClass(m)&&a.prototype.equalsExact.call(this,m,v)}return a.prototype.equalsExact.apply(this,arguments)},u.prototype.getCoordinate=function(){if(arguments.length===1){var m=arguments[0];return this._geometries[m].getCoordinate()}return a.prototype.getCoordinate.apply(this,arguments)},u.prototype.getBoundaryDimension=function(){return Le.FALSE},u.prototype.getDimension=function(){return 0},u.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},u.prototype.getGeometryType=function(){return"MultiPoint"},u.prototype.copy=function(){for(var m=new Array(this._geometries.length).fill(null),v=0;v<m.length;v++)m[v]=this._geometries[v].copy();return new u(m,this._factory)},u.prototype.interfaces_=function(){return[rs]},u.prototype.getClass=function(){return u},f.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(u,f),u}(xt),ns=function(a){function u(m,v){m instanceof N&&v instanceof $t&&(m=v.getCoordinateSequenceFactory().create(m)),a.call(this,m,v),this.validateConstruction()}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return u.prototype.getSortIndex=function(){return vt.SORTINDEX_LINEARRING},u.prototype.getBoundaryDimension=function(){return Le.FALSE},u.prototype.isClosed=function(){return!!this.isEmpty()||a.prototype.isClosed.call(this)},u.prototype.reverse=function(){var m=this._points.copy();return Qt.reverse(m),this.getFactory().createLinearRing(m)},u.prototype.validateConstruction=function(){if(!this.isEmpty()&&!a.prototype.isClosed.call(this))throw new D("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<u.MINIMUM_VALID_SIZE)throw new D("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},u.prototype.getGeometryType=function(){return"LinearRing"},u.prototype.copy=function(){return new u(this._points.copy(),this._factory)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},f.MINIMUM_VALID_SIZE.get=function(){return 4},f.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(u,f),u}(Gt),Ka=function(a){function u(){a.apply(this,arguments)}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={serialVersionUID:{configurable:!0}};return u.prototype.getSortIndex=function(){return vt.SORTINDEX_MULTIPOLYGON},u.prototype.equalsExact=function(){if(arguments.length===2){var m=arguments[0],v=arguments[1];return!!this.isEquivalentClass(m)&&a.prototype.equalsExact.call(this,m,v)}return a.prototype.equalsExact.apply(this,arguments)},u.prototype.getBoundaryDimension=function(){return 1},u.prototype.getDimension=function(){return 2},u.prototype.reverse=function(){for(var m=this._geometries.length,v=new Array(m).fill(null),S=0;S<this._geometries.length;S++)v[S]=this._geometries[S].reverse();return this.getFactory().createMultiPolygon(v)},u.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var m=new He,v=0;v<this._geometries.length;v++)for(var S=this._geometries[v].getBoundary(),M=0;M<S.getNumGeometries();M++)m.add(S.getGeometryN(M));var B=new Array(m.size()).fill(null);return this.getFactory().createMultiLineString(m.toArray(B))},u.prototype.getGeometryType=function(){return"MultiPolygon"},u.prototype.copy=function(){for(var m=new Array(this._geometries.length).fill(null),v=0;v<m.length;v++)m[v]=this._geometries[v].copy();return new u(m,this._factory)},u.prototype.interfaces_=function(){return[Hi]},u.prototype.getClass=function(){return u},f.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(u,f),u}(xt),Ms=o(function(a){this._factory=a||null,this._isUserDataCopied=!1},"ie"),Uy={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Ms.prototype.setCopyUserData=function(a){this._isUserDataCopied=a},Ms.prototype.edit=function(a,u){if(a===null)return null;var f=this.editInternal(a,u);return this._isUserDataCopied&&f.setUserData(a.getUserData()),f},Ms.prototype.editInternal=function(a,u){return this._factory===null&&(this._factory=a.getFactory()),a instanceof xt?this.editGeometryCollection(a,u):a instanceof Xr?this.editPolygon(a,u):a instanceof jn?u.edit(a,this._factory):a instanceof Gt?u.edit(a,this._factory):(ot.shouldNeverReachHere("Unsupported Geometry class: "+a.getClass().getName()),null)},Ms.prototype.editGeometryCollection=function(a,u){for(var f=u.edit(a,this._factory),m=new He,v=0;v<f.getNumGeometries();v++){var S=this.edit(f.getGeometryN(v),u);S===null||S.isEmpty()||m.add(S)}return f.getClass()===Es?this._factory.createMultiPoint(m.toArray([])):f.getClass()===dn?this._factory.createMultiLineString(m.toArray([])):f.getClass()===Ka?this._factory.createMultiPolygon(m.toArray([])):this._factory.createGeometryCollection(m.toArray([]))},Ms.prototype.editPolygon=function(a,u){var f=u.edit(a,this._factory);if(f===null&&(f=this._factory.createPolygon(null)),f.isEmpty())return f;var m=this.edit(f.getExteriorRing(),u);if(m===null||m.isEmpty())return this._factory.createPolygon();for(var v=new He,S=0;S<f.getNumInteriorRing();S++){var M=this.edit(f.getInteriorRingN(S),u);M===null||M.isEmpty()||v.add(M)}return this._factory.createPolygon(m,v.toArray([]))},Ms.prototype.interfaces_=function(){return[]},Ms.prototype.getClass=function(){return Ms},Ms.GeometryEditorOperation=function(){},Uy.NoOpGeometryOperation.get=function(){return hb},Uy.CoordinateOperation.get=function(){return mb},Uy.CoordinateSequenceOperation.get=function(){return gb},Object.defineProperties(Ms,Uy);var hb=o(function(){},"oe");hb.prototype.edit=function(a,u){return a},hb.prototype.interfaces_=function(){return[Ms.GeometryEditorOperation]},hb.prototype.getClass=function(){return hb};var mb=o(function(){},"se");mb.prototype.edit=function(a,u){var f=this.editCoordinates(a.getCoordinates(),a);return f===null?a:a instanceof ns?u.createLinearRing(f):a instanceof Gt?u.createLineString(f):a instanceof jn?f.length>0?u.createPoint(f[0]):u.createPoint():a},mb.prototype.interfaces_=function(){return[Ms.GeometryEditorOperation]},mb.prototype.getClass=function(){return mb};var gb=o(function(){},"ae");gb.prototype.edit=function(a,u){return a instanceof ns?u.createLinearRing(this.edit(a.getCoordinateSequence(),a)):a instanceof Gt?u.createLineString(this.edit(a.getCoordinateSequence(),a)):a instanceof jn?u.createPoint(this.edit(a.getCoordinateSequence(),a)):a},gb.prototype.interfaces_=function(){return[Ms.GeometryEditorOperation]},gb.prototype.getClass=function(){return gb};var ai=o(function(){if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var a=arguments[0];this._coordinates=new Array(a).fill(null);for(var u=0;u<a;u++)this._coordinates[u]=new N}else if(ne(arguments[0],Ae)){var f=arguments[0];if(f===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=f.getDimension(),this._coordinates=new Array(f.size()).fill(null);for(var m=0;m<this._coordinates.length;m++)this._coordinates[m]=f.getCoordinateCopy(m)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var v=arguments[0],S=arguments[1];this._coordinates=v,this._dimension=S,v===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var M=arguments[0],B=arguments[1];this._coordinates=new Array(M).fill(null),this._dimension=B;for(var z=0;z<M;z++)this._coordinates[z]=new N}}},"ue"),UF={serialVersionUID:{configurable:!0}};ai.prototype.setOrdinate=function(a,u,f){switch(u){case Ae.X:this._coordinates[a].x=f;break;case Ae.Y:this._coordinates[a].y=f;break;case Ae.Z:this._coordinates[a].z=f;break;default:throw new D("invalid ordinateIndex")}},ai.prototype.size=function(){return this._coordinates.length},ai.prototype.getOrdinate=function(a,u){switch(u){case Ae.X:return this._coordinates[a].x;case Ae.Y:return this._coordinates[a].y;case Ae.Z:return this._coordinates[a].z}return A.NaN},ai.prototype.getCoordinate=function(){if(arguments.length===1){var a=arguments[0];return this._coordinates[a]}if(arguments.length===2){var u=arguments[0],f=arguments[1];f.x=this._coordinates[u].x,f.y=this._coordinates[u].y,f.z=this._coordinates[u].z}},ai.prototype.getCoordinateCopy=function(a){return new N(this._coordinates[a])},ai.prototype.getDimension=function(){return this._dimension},ai.prototype.getX=function(a){return this._coordinates[a].x},ai.prototype.clone=function(){for(var a=new Array(this.size()).fill(null),u=0;u<this._coordinates.length;u++)a[u]=this._coordinates[u].clone();return new ai(a,this._dimension)},ai.prototype.expandEnvelope=function(a){for(var u=0;u<this._coordinates.length;u++)a.expandToInclude(this._coordinates[u]);return a},ai.prototype.copy=function(){for(var a=new Array(this.size()).fill(null),u=0;u<this._coordinates.length;u++)a[u]=this._coordinates[u].copy();return new ai(a,this._dimension)},ai.prototype.toString=function(){if(this._coordinates.length>0){var a=new Ue(17*this._coordinates.length);a.append("("),a.append(this._coordinates[0]);for(var u=1;u<this._coordinates.length;u++)a.append(", "),a.append(this._coordinates[u]);return a.append(")"),a.toString()}return"()"},ai.prototype.getY=function(a){return this._coordinates[a].y},ai.prototype.toCoordinateArray=function(){return this._coordinates},ai.prototype.interfaces_=function(){return[Ae,t]},ai.prototype.getClass=function(){return ai},UF.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(ai,UF);var du=o(function(){},"ce"),sE={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};du.prototype.readResolve=function(){return du.instance()},du.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var a=arguments[0];return new ai(a)}if(ne(arguments[0],Ae)){var u=arguments[0];return new ai(u)}}else if(arguments.length===2){var f=arguments[0],m=arguments[1];return m>3&&(m=3),m<2?new ai(f):new ai(f,m)}},du.prototype.interfaces_=function(){return[se,t]},du.prototype.getClass=function(){return du},du.instance=function(){return du.instanceObject},sE.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},sE.instanceObject.get=function(){return new du},Object.defineProperties(du,sE);var VF=function(a){function u(){a.call(this),this.map_=new Map}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.get=function(f){return this.map_.get(f)||null},u.prototype.put=function(f,m){return this.map_.set(f,m),m},u.prototype.values=function(){for(var f=new He,m=this.map_.values(),v=m.next();!v.done;)f.add(v.value),v=m.next();return f},u.prototype.entrySet=function(){var f=new ge;return this.map_.entries().forEach(function(m){return f.add(m)}),f},u.prototype.size=function(){return this.map_.size()},u}(K),Mr=o(function a(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=a.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof xl){var u=arguments[0];this._modelType=u,u===a.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var f=arguments[0];this._modelType=a.FIXED,this.setScale(f)}else if(arguments[0]instanceof a){var m=arguments[0];this._modelType=m._modelType,this._scale=m._scale}}},"t"),aE={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Mr.prototype.equals=function(a){if(!(a instanceof Mr))return!1;var u=a;return this._modelType===u._modelType&&this._scale===u._scale},Mr.prototype.compareTo=function(a){var u=a,f=this.getMaximumSignificantDigits(),m=u.getMaximumSignificantDigits();return new _e(f).compareTo(new _e(m))},Mr.prototype.getScale=function(){return this._scale},Mr.prototype.isFloating=function(){return this._modelType===Mr.FLOATING||this._modelType===Mr.FLOATING_SINGLE},Mr.prototype.getType=function(){return this._modelType},Mr.prototype.toString=function(){var a="UNKNOWN";return this._modelType===Mr.FLOATING?a="Floating":this._modelType===Mr.FLOATING_SINGLE?a="Floating-Single":this._modelType===Mr.FIXED&&(a="Fixed (Scale="+this.getScale()+")"),a},Mr.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var a=arguments[0];return A.isNaN(a)||this._modelType===Mr.FLOATING_SINGLE?a:this._modelType===Mr.FIXED?Math.round(a*this._scale)/this._scale:a}if(arguments[0]instanceof N){var u=arguments[0];if(this._modelType===Mr.FLOATING)return null;u.x=this.makePrecise(u.x),u.y=this.makePrecise(u.y)}},Mr.prototype.getMaximumSignificantDigits=function(){var a=16;return this._modelType===Mr.FLOATING?a=16:this._modelType===Mr.FLOATING_SINGLE?a=6:this._modelType===Mr.FIXED&&(a=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),a},Mr.prototype.setScale=function(a){this._scale=Math.abs(a)},Mr.prototype.interfaces_=function(){return[t,j]},Mr.prototype.getClass=function(){return Mr},Mr.mostPrecise=function(a,u){return a.compareTo(u)>=0?a:u},aE.serialVersionUID.get=function(){return 7777263578777804e3},aE.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Mr,aE);var xl=o(function a(u){this._name=u||null,a.nameToTypeMap.put(u,this)},"t"),lE={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};xl.prototype.readResolve=function(){return xl.nameToTypeMap.get(this._name)},xl.prototype.toString=function(){return this._name},xl.prototype.interfaces_=function(){return[t]},xl.prototype.getClass=function(){return xl},lE.serialVersionUID.get=function(){return-552860263173159e4},lE.nameToTypeMap.get=function(){return new VF},Object.defineProperties(xl,lE),Mr.Type=xl,Mr.FIXED=new xl("FIXED"),Mr.FLOATING=new xl("FLOATING"),Mr.FLOATING_SINGLE=new xl("FLOATING SINGLE");var $t=o(function a(){this._precisionModel=new Mr,this._SRID=0,this._coordinateSequenceFactory=a.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?ne(arguments[0],se)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Mr&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},"t"),zF={serialVersionUID:{configurable:!0}};$t.prototype.toGeometry=function(a){return a.isNull()?this.createPoint(null):a.getMinX()===a.getMaxX()&&a.getMinY()===a.getMaxY()?this.createPoint(new N(a.getMinX(),a.getMinY())):a.getMinX()===a.getMaxX()||a.getMinY()===a.getMaxY()?this.createLineString([new N(a.getMinX(),a.getMinY()),new N(a.getMaxX(),a.getMaxY())]):this.createPolygon(this.createLinearRing([new N(a.getMinX(),a.getMinY()),new N(a.getMinX(),a.getMaxY()),new N(a.getMaxX(),a.getMaxY()),new N(a.getMaxX(),a.getMinY()),new N(a.getMinX(),a.getMinY())]),null)},$t.prototype.createLineString=function(a){return a?a instanceof Array?new Gt(this.getCoordinateSequenceFactory().create(a),this):ne(a,Ae)?new Gt(a,this):void 0:new Gt(this.getCoordinateSequenceFactory().create([]),this)},$t.prototype.createMultiLineString=function(){if(arguments.length===0)return new dn(null,this);if(arguments.length===1){var a=arguments[0];return new dn(a,this)}},$t.prototype.buildGeometry=function(a){for(var u=null,f=!1,m=!1,v=a.iterator();v.hasNext();){var S=v.next(),M=S.getClass();u===null&&(u=M),M!==u&&(f=!0),S.isGeometryCollectionOrDerived()&&(m=!0)}if(u===null)return this.createGeometryCollection();if(f||m)return this.createGeometryCollection($t.toGeometryArray(a));var B=a.iterator().next();if(a.size()>1){if(B instanceof Xr)return this.createMultiPolygon($t.toPolygonArray(a));if(B instanceof Gt)return this.createMultiLineString($t.toLineStringArray(a));if(B instanceof jn)return this.createMultiPoint($t.toPointArray(a));ot.shouldNeverReachHere("Unhandled class: "+B.getClass().getName())}return B},$t.prototype.createMultiPointFromCoords=function(a){return this.createMultiPoint(a!==null?this.getCoordinateSequenceFactory().create(a):null)},$t.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof N){var a=arguments[0];return this.createPoint(a!==null?this.getCoordinateSequenceFactory().create([a]):null)}if(ne(arguments[0],Ae)){var u=arguments[0];return new jn(u,this)}}},$t.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},$t.prototype.createPolygon=function(){if(arguments.length===0)return new Xr(null,null,this);if(arguments.length===1){if(ne(arguments[0],Ae)){var a=arguments[0];return this.createPolygon(this.createLinearRing(a))}if(arguments[0]instanceof Array){var u=arguments[0];return this.createPolygon(this.createLinearRing(u))}if(arguments[0]instanceof ns){var f=arguments[0];return this.createPolygon(f,null)}}else if(arguments.length===2){var m=arguments[0],v=arguments[1];return new Xr(m,v,this)}},$t.prototype.getSRID=function(){return this._SRID},$t.prototype.createGeometryCollection=function(){if(arguments.length===0)return new xt(null,this);if(arguments.length===1){var a=arguments[0];return new xt(a,this)}},$t.prototype.createGeometry=function(a){return new Ms(this).edit(a,{edit:o(function(){if(arguments.length===2){var u=arguments[0];return this._coordinateSequenceFactory.create(u)}},"edit")})},$t.prototype.getPrecisionModel=function(){return this._precisionModel},$t.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var a=arguments[0];return this.createLinearRing(a!==null?this.getCoordinateSequenceFactory().create(a):null)}if(ne(arguments[0],Ae)){var u=arguments[0];return new ns(u,this)}}},$t.prototype.createMultiPolygon=function(){if(arguments.length===0)return new Ka(null,this);if(arguments.length===1){var a=arguments[0];return new Ka(a,this)}},$t.prototype.createMultiPoint=function(){if(arguments.length===0)return new Es(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var a=arguments[0];return new Es(a,this)}if(arguments[0]instanceof Array){var u=arguments[0];return this.createMultiPoint(u!==null?this.getCoordinateSequenceFactory().create(u):null)}if(ne(arguments[0],Ae)){var f=arguments[0];if(f===null)return this.createMultiPoint(new Array(0).fill(null));for(var m=new Array(f.size()).fill(null),v=0;v<f.size();v++){var S=this.getCoordinateSequenceFactory().create(1,f.getDimension());Qt.copy(f,v,S,0,1),m[v]=this.createPoint(S)}return this.createMultiPoint(m)}}},$t.prototype.interfaces_=function(){return[t]},$t.prototype.getClass=function(){return $t},$t.toMultiPolygonArray=function(a){var u=new Array(a.size()).fill(null);return a.toArray(u)},$t.toGeometryArray=function(a){if(a===null)return null;var u=new Array(a.size()).fill(null);return a.toArray(u)},$t.getDefaultCoordinateSequenceFactory=function(){return du.instance()},$t.toMultiLineStringArray=function(a){var u=new Array(a.size()).fill(null);return a.toArray(u)},$t.toLineStringArray=function(a){var u=new Array(a.size()).fill(null);return a.toArray(u)},$t.toMultiPointArray=function(a){var u=new Array(a.size()).fill(null);return a.toArray(u)},$t.toLinearRingArray=function(a){var u=new Array(a.size()).fill(null);return a.toArray(u)},$t.toPointArray=function(a){var u=new Array(a.size()).fill(null);return a.toArray(u)},$t.toPolygonArray=function(a){var u=new Array(a.size()).fill(null);return a.toArray(u)},$t.createPointFromInternalCoord=function(a,u){return u.getPrecisionModel().makePrecise(a),u.getFactory().createPoint(a)},zF.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties($t,zF);var Dse=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],Y_=o(function(a){this.geometryFactory=a||new $t},"Ie");Y_.prototype.read=function(a){var u,f=(u=typeof a=="string"?JSON.parse(a):a).type;if(!Il[f])throw new Error("Unknown GeoJSON type: "+u.type);return Dse.indexOf(f)!==-1?Il[f].apply(this,[u.coordinates]):f==="GeometryCollection"?Il[f].apply(this,[u.geometries]):Il[f].apply(this,[u])},Y_.prototype.write=function(a){var u=a.getGeometryType();if(!vc[u])throw new Error("Geometry is not supported");return vc[u].apply(this,[a])};var Il={Feature:o(function(a){var u={};for(var f in a)u[f]=a[f];if(a.geometry){var m=a.geometry.type;if(!Il[m])throw new Error("Unknown GeoJSON type: "+a.type);u.geometry=this.read(a.geometry)}return a.bbox&&(u.bbox=Il.bbox.apply(this,[a.bbox])),u},"Feature"),FeatureCollection:o(function(a){var u={};if(a.features){u.features=[];for(var f=0;f<a.features.length;++f)u.features.push(this.read(a.features[f]))}return a.bbox&&(u.bbox=this.parse.bbox.apply(this,[a.bbox])),u},"FeatureCollection"),coordinates:o(function(a){for(var u=[],f=0;f<a.length;++f){var m=a[f];u.push(new N(m[0],m[1]))}return u},"coordinates"),bbox:o(function(a){return this.geometryFactory.createLinearRing([new N(a[0],a[1]),new N(a[2],a[1]),new N(a[2],a[3]),new N(a[0],a[3]),new N(a[0],a[1])])},"bbox"),Point:o(function(a){var u=new N(a[0],a[1]);return this.geometryFactory.createPoint(u)},"Point"),MultiPoint:o(function(a){for(var u=[],f=0;f<a.length;++f)u.push(Il.Point.apply(this,[a[f]]));return this.geometryFactory.createMultiPoint(u)},"MultiPoint"),LineString:o(function(a){var u=Il.coordinates.apply(this,[a]);return this.geometryFactory.createLineString(u)},"LineString"),MultiLineString:o(function(a){for(var u=[],f=0;f<a.length;++f)u.push(Il.LineString.apply(this,[a[f]]));return this.geometryFactory.createMultiLineString(u)},"MultiLineString"),Polygon:o(function(a){for(var u=Il.coordinates.apply(this,[a[0]]),f=this.geometryFactory.createLinearRing(u),m=[],v=1;v<a.length;++v){var S=a[v],M=Il.coordinates.apply(this,[S]),B=this.geometryFactory.createLinearRing(M);m.push(B)}return this.geometryFactory.createPolygon(f,m)},"Polygon"),MultiPolygon:o(function(a){for(var u=[],f=0;f<a.length;++f){var m=a[f];u.push(Il.Polygon.apply(this,[m]))}return this.geometryFactory.createMultiPolygon(u)},"MultiPolygon"),GeometryCollection:o(function(a){for(var u=[],f=0;f<a.length;++f){var m=a[f];u.push(this.read(m))}return this.geometryFactory.createGeometryCollection(u)},"GeometryCollection")},vc={coordinate:o(function(a){return[a.x,a.y]},"coordinate"),Point:o(function(a){return{type:"Point",coordinates:vc.coordinate.apply(this,[a.getCoordinate()])}},"Point"),MultiPoint:o(function(a){for(var u=[],f=0;f<a._geometries.length;++f){var m=a._geometries[f],v=vc.Point.apply(this,[m]);u.push(v.coordinates)}return{type:"MultiPoint",coordinates:u}},"MultiPoint"),LineString:o(function(a){for(var u=[],f=a.getCoordinates(),m=0;m<f.length;++m){var v=f[m];u.push(vc.coordinate.apply(this,[v]))}return{type:"LineString",coordinates:u}},"LineString"),MultiLineString:o(function(a){for(var u=[],f=0;f<a._geometries.length;++f){var m=a._geometries[f],v=vc.LineString.apply(this,[m]);u.push(v.coordinates)}return{type:"MultiLineString",coordinates:u}},"MultiLineString"),Polygon:o(function(a){var u=[],f=vc.LineString.apply(this,[a._shell]);u.push(f.coordinates);for(var m=0;m<a._holes.length;++m){var v=a._holes[m],S=vc.LineString.apply(this,[v]);u.push(S.coordinates)}return{type:"Polygon",coordinates:u}},"Polygon"),MultiPolygon:o(function(a){for(var u=[],f=0;f<a._geometries.length;++f){var m=a._geometries[f],v=vc.Polygon.apply(this,[m]);u.push(v.coordinates)}return{type:"MultiPolygon",coordinates:u}},"MultiPolygon"),GeometryCollection:o(function(a){for(var u=[],f=0;f<a._geometries.length;++f){var m=a._geometries[f],v=m.getGeometryType();u.push(vc[v].apply(this,[m]))}return{type:"GeometryCollection",geometries:u}},"GeometryCollection")},uE=o(function(a){this.geometryFactory=a||new $t,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new Y_(this.geometryFactory)},"Ne");uE.prototype.read=function(a){var u=this.parser.read(a);return this.precisionModel.getType()===Mr.FIXED&&this.reducePrecision(u),u},uE.prototype.reducePrecision=function(a){var u,f;if(a.coordinate)this.precisionModel.makePrecise(a.coordinate);else if(a.points)for(u=0,f=a.points.length;u<f;u++)this.precisionModel.makePrecise(a.points[u]);else if(a.geometries)for(u=0,f=a.geometries.length;u<f;u++)this.reducePrecision(a.geometries[u])};var qF=o(function(){this.parser=new Y_(this.geometryFactory)},"Ce");qF.prototype.write=function(a){return this.parser.write(a)};var Ge=o(function(){},"Se"),Z_={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},Ge.opposite=function(a){return a===Ge.LEFT?Ge.RIGHT:a===Ge.RIGHT?Ge.LEFT:a},Z_.ON.get=function(){return 0},Z_.LEFT.get=function(){return 1},Z_.RIGHT.get=function(){return 2},Object.defineProperties(Ge,Z_),(E.prototype=new Error).name="EmptyStackException",(T.prototype=new ts).add=function(a){return this.array_.push(a),!0},T.prototype.get=function(a){if(a<0||a>=this.size())throw new Error;return this.array_[a]},T.prototype.push=function(a){return this.array_.push(a),a},T.prototype.pop=function(a){if(this.array_.length===0)throw new E;return this.array_.pop()},T.prototype.peek=function(){if(this.array_.length===0)throw new E;return this.array_[this.array_.length-1]},T.prototype.empty=function(){return this.array_.length===0},T.prototype.isEmpty=function(){return this.empty()},T.prototype.search=function(a){return this.array_.indexOf(a)},T.prototype.size=function(){return this.array_.length},T.prototype.toArray=function(){for(var a=[],u=0,f=this.array_.length;u<f;u++)a.push(this.array_[u]);return a};var _l=o(function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null},"be");_l.prototype.getCoordinate=function(){return this._minCoord},_l.prototype.getRightmostSide=function(a,u){var f=this.getRightmostSideOfSegment(a,u);return f<0&&(f=this.getRightmostSideOfSegment(a,u-1)),f<0&&(this._minCoord=null,this.checkForRightmostCoordinate(a)),f},_l.prototype.findRightmostEdgeAtVertex=function(){var a=this._minDe.getEdge().getCoordinates();ot.isTrue(this._minIndex>0&&this._minIndex<a.length,"rightmost point expected to be interior vertex of edge");var u=a[this._minIndex-1],f=a[this._minIndex+1],m=ze.computeOrientation(this._minCoord,f,u),v=!1;(u.y<this._minCoord.y&&f.y<this._minCoord.y&&m===ze.COUNTERCLOCKWISE||u.y>this._minCoord.y&&f.y>this._minCoord.y&&m===ze.CLOCKWISE)&&(v=!0),v&&(this._minIndex=this._minIndex-1)},_l.prototype.getRightmostSideOfSegment=function(a,u){var f=a.getEdge().getCoordinates();if(u<0||u+1>=f.length||f[u].y===f[u+1].y)return-1;var m=Ge.LEFT;return f[u].y<f[u+1].y&&(m=Ge.RIGHT),m},_l.prototype.getEdge=function(){return this._orientedDe},_l.prototype.checkForRightmostCoordinate=function(a){for(var u=a.getEdge().getCoordinates(),f=0;f<u.length-1;f++)(this._minCoord===null||u[f].x>this._minCoord.x)&&(this._minDe=a,this._minIndex=f,this._minCoord=u[f])},_l.prototype.findRightmostEdgeAtNode=function(){var a=this._minDe.getNode().getEdges();this._minDe=a.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},_l.prototype.findEdge=function(a){for(var u=a.iterator();u.hasNext();){var f=u.next();f.isForward()&&this.checkForRightmostCoordinate(f)}ot.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===Ge.LEFT&&(this._orientedDe=this._minDe.getSym())},_l.prototype.interfaces_=function(){return[]},_l.prototype.getClass=function(){return _l};var bc=function(a){function u(f,m){a.call(this,u.msgWithCoord(f,m)),this.pt=m?new N(m):null,this.name="TopologyException"}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.getCoordinate=function(){return this.pt},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u.msgWithCoord=function(f,m){return m?f:f+" [ "+m+" ]"},u}(Er),K_=o(function(){this.array_=[]},"Oe");K_.prototype.addLast=function(a){this.array_.push(a)},K_.prototype.removeFirst=function(){return this.array_.shift()},K_.prototype.isEmpty=function(){return this.array_.length===0};var Bo=o(function(){this._finder=null,this._dirEdgeList=new He,this._nodes=new He,this._rightMostCoord=null,this._env=null,this._finder=new _l},"Te");Bo.prototype.clearVisitedEdges=function(){for(var a=this._dirEdgeList.iterator();a.hasNext();)a.next().setVisited(!1)},Bo.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Bo.prototype.computeNodeDepth=function(a){for(var u=null,f=a.getEdges().iterator();f.hasNext();){var m=f.next();if(m.isVisited()||m.getSym().isVisited()){u=m;break}}if(u===null)throw new bc("unable to find edge to compute depths at "+a.getCoordinate());a.getEdges().computeDepths(u);for(var v=a.getEdges().iterator();v.hasNext();){var S=v.next();S.setVisited(!0),this.copySymDepths(S)}},Bo.prototype.computeDepth=function(a){this.clearVisitedEdges();var u=this._finder.getEdge();u.setEdgeDepths(Ge.RIGHT,a),this.copySymDepths(u),this.computeDepths(u)},Bo.prototype.create=function(a){this.addReachable(a),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Bo.prototype.findResultEdges=function(){for(var a=this._dirEdgeList.iterator();a.hasNext();){var u=a.next();u.getDepth(Ge.RIGHT)>=1&&u.getDepth(Ge.LEFT)<=0&&!u.isInteriorAreaEdge()&&u.setInResult(!0)}},Bo.prototype.computeDepths=function(a){var u=new ge,f=new K_,m=a.getNode();for(f.addLast(m),u.add(m),a.setVisited(!0);!f.isEmpty();){var v=f.removeFirst();u.add(v),this.computeNodeDepth(v);for(var S=v.getEdges().iterator();S.hasNext();){var M=S.next().getSym();if(!M.isVisited()){var B=M.getNode();u.contains(B)||(f.addLast(B),u.add(B))}}}},Bo.prototype.compareTo=function(a){var u=a;return this._rightMostCoord.x<u._rightMostCoord.x?-1:this._rightMostCoord.x>u._rightMostCoord.x?1:0},Bo.prototype.getEnvelope=function(){if(this._env===null){for(var a=new ie,u=this._dirEdgeList.iterator();u.hasNext();)for(var f=u.next().getEdge().getCoordinates(),m=0;m<f.length-1;m++)a.expandToInclude(f[m]);this._env=a}return this._env},Bo.prototype.addReachable=function(a){var u=new T;for(u.add(a);!u.empty();){var f=u.pop();this.add(f,u)}},Bo.prototype.copySymDepths=function(a){var u=a.getSym();u.setDepth(Ge.LEFT,a.getDepth(Ge.RIGHT)),u.setDepth(Ge.RIGHT,a.getDepth(Ge.LEFT))},Bo.prototype.add=function(a,u){a.setVisited(!0),this._nodes.add(a);for(var f=a.getEdges().iterator();f.hasNext();){var m=f.next();this._dirEdgeList.add(m);var v=m.getSym().getNode();v.isVisited()||u.push(v)}},Bo.prototype.getNodes=function(){return this._nodes},Bo.prototype.getDirectedEdges=function(){return this._dirEdgeList},Bo.prototype.interfaces_=function(){return[j]},Bo.prototype.getClass=function(){return Bo};var Cn=o(function a(){if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var u=arguments[0];this.init(u.length)}else if(Number.isInteger(arguments[0])){var f=arguments[0];this.init(1),this.location[Ge.ON]=f}else if(arguments[0]instanceof a){var m=arguments[0];if(this.init(m.location.length),m!==null)for(var v=0;v<this.location.length;v++)this.location[v]=m.location[v]}}else if(arguments.length===3){var S=arguments[0],M=arguments[1],B=arguments[2];this.init(3),this.location[Ge.ON]=S,this.location[Ge.LEFT]=M,this.location[Ge.RIGHT]=B}},"t");Cn.prototype.setAllLocations=function(a){for(var u=0;u<this.location.length;u++)this.location[u]=a},Cn.prototype.isNull=function(){for(var a=0;a<this.location.length;a++)if(this.location[a]!==U.NONE)return!1;return!0},Cn.prototype.setAllLocationsIfNull=function(a){for(var u=0;u<this.location.length;u++)this.location[u]===U.NONE&&(this.location[u]=a)},Cn.prototype.isLine=function(){return this.location.length===1},Cn.prototype.merge=function(a){if(a.location.length>this.location.length){var u=new Array(3).fill(null);u[Ge.ON]=this.location[Ge.ON],u[Ge.LEFT]=U.NONE,u[Ge.RIGHT]=U.NONE,this.location=u}for(var f=0;f<this.location.length;f++)this.location[f]===U.NONE&&f<a.location.length&&(this.location[f]=a.location[f])},Cn.prototype.getLocations=function(){return this.location},Cn.prototype.flip=function(){if(this.location.length<=1)return null;var a=this.location[Ge.LEFT];this.location[Ge.LEFT]=this.location[Ge.RIGHT],this.location[Ge.RIGHT]=a},Cn.prototype.toString=function(){var a=new Ue;return this.location.length>1&&a.append(U.toLocationSymbol(this.location[Ge.LEFT])),a.append(U.toLocationSymbol(this.location[Ge.ON])),this.location.length>1&&a.append(U.toLocationSymbol(this.location[Ge.RIGHT])),a.toString()},Cn.prototype.setLocations=function(a,u,f){this.location[Ge.ON]=a,this.location[Ge.LEFT]=u,this.location[Ge.RIGHT]=f},Cn.prototype.get=function(a){return a<this.location.length?this.location[a]:U.NONE},Cn.prototype.isArea=function(){return this.location.length>1},Cn.prototype.isAnyNull=function(){for(var a=0;a<this.location.length;a++)if(this.location[a]===U.NONE)return!0;return!1},Cn.prototype.setLocation=function(){if(arguments.length===1){var a=arguments[0];this.setLocation(Ge.ON,a)}else if(arguments.length===2){var u=arguments[0],f=arguments[1];this.location[u]=f}},Cn.prototype.init=function(a){this.location=new Array(a).fill(null),this.setAllLocations(U.NONE)},Cn.prototype.isEqualOnSide=function(a,u){return this.location[u]===a.location[u]},Cn.prototype.allPositionsEqual=function(a){for(var u=0;u<this.location.length;u++)if(this.location[u]!==a)return!1;return!0},Cn.prototype.interfaces_=function(){return[]},Cn.prototype.getClass=function(){return Cn};var Yr=o(function a(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var u=arguments[0];this.elt[0]=new Cn(u),this.elt[1]=new Cn(u)}else if(arguments[0]instanceof a){var f=arguments[0];this.elt[0]=new Cn(f.elt[0]),this.elt[1]=new Cn(f.elt[1])}}else if(arguments.length===2){var m=arguments[0],v=arguments[1];this.elt[0]=new Cn(U.NONE),this.elt[1]=new Cn(U.NONE),this.elt[m].setLocation(v)}else if(arguments.length===3){var S=arguments[0],M=arguments[1],B=arguments[2];this.elt[0]=new Cn(S,M,B),this.elt[1]=new Cn(S,M,B)}else if(arguments.length===4){var z=arguments[0],te=arguments[1],pe=arguments[2],ye=arguments[3];this.elt[0]=new Cn(U.NONE,U.NONE,U.NONE),this.elt[1]=new Cn(U.NONE,U.NONE,U.NONE),this.elt[z].setLocations(te,pe,ye)}},"t");Yr.prototype.getGeometryCount=function(){var a=0;return this.elt[0].isNull()||a++,this.elt[1].isNull()||a++,a},Yr.prototype.setAllLocations=function(a,u){this.elt[a].setAllLocations(u)},Yr.prototype.isNull=function(a){return this.elt[a].isNull()},Yr.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var a=arguments[0];this.setAllLocationsIfNull(0,a),this.setAllLocationsIfNull(1,a)}else if(arguments.length===2){var u=arguments[0],f=arguments[1];this.elt[u].setAllLocationsIfNull(f)}},Yr.prototype.isLine=function(a){return this.elt[a].isLine()},Yr.prototype.merge=function(a){for(var u=0;u<2;u++)this.elt[u]===null&&a.elt[u]!==null?this.elt[u]=new Cn(a.elt[u]):this.elt[u].merge(a.elt[u])},Yr.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Yr.prototype.getLocation=function(){if(arguments.length===1){var a=arguments[0];return this.elt[a].get(Ge.ON)}if(arguments.length===2){var u=arguments[0],f=arguments[1];return this.elt[u].get(f)}},Yr.prototype.toString=function(){var a=new Ue;return this.elt[0]!==null&&(a.append("A:"),a.append(this.elt[0].toString())),this.elt[1]!==null&&(a.append(" B:"),a.append(this.elt[1].toString())),a.toString()},Yr.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var a=arguments[0];return this.elt[a].isArea()}},Yr.prototype.isAnyNull=function(a){return this.elt[a].isAnyNull()},Yr.prototype.setLocation=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1];this.elt[a].setLocation(Ge.ON,u)}else if(arguments.length===3){var f=arguments[0],m=arguments[1],v=arguments[2];this.elt[f].setLocation(m,v)}},Yr.prototype.isEqualOnSide=function(a,u){return this.elt[0].isEqualOnSide(a.elt[0],u)&&this.elt[1].isEqualOnSide(a.elt[1],u)},Yr.prototype.allPositionsEqual=function(a,u){return this.elt[a].allPositionsEqual(u)},Yr.prototype.toLine=function(a){this.elt[a].isArea()&&(this.elt[a]=new Cn(this.elt[a].location[0]))},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr},Yr.toLineLabel=function(a){for(var u=new Yr(U.NONE),f=0;f<2;f++)u.setLocation(f,a.getLocation(f));return u};var vi=o(function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new He,this._pts=new He,this._label=new Yr(U.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new He,this._geometryFactory=null;var a=arguments[0],u=arguments[1];this._geometryFactory=u,this.computePoints(a),this.computeRing()},"De");vi.prototype.computeRing=function(){if(this._ring!==null)return null;for(var a=new Array(this._pts.size()).fill(null),u=0;u<this._pts.size();u++)a[u]=this._pts.get(u);this._ring=this._geometryFactory.createLinearRing(a),this._isHole=ze.isCCW(this._ring.getCoordinates())},vi.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},vi.prototype.computePoints=function(a){this._startDe=a;var u=a,f=!0;do{if(u===null)throw new bc("Found null DirectedEdge");if(u.getEdgeRing()===this)throw new bc("Directed Edge visited twice during ring-building at "+u.getCoordinate());this._edges.add(u);var m=u.getLabel();ot.isTrue(m.isArea()),this.mergeLabel(m),this.addPoints(u.getEdge(),u.isForward(),f),f=!1,this.setEdgeRing(u,this),u=this.getNext(u)}while(u!==this._startDe)},vi.prototype.getLinearRing=function(){return this._ring},vi.prototype.getCoordinate=function(a){return this._pts.get(a)},vi.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var a=this._startDe;do{var u=a.getNode().getEdges().getOutgoingDegree(this);u>this._maxNodeDegree&&(this._maxNodeDegree=u),a=this.getNext(a)}while(a!==this._startDe);this._maxNodeDegree*=2},vi.prototype.addPoints=function(a,u,f){var m=a.getCoordinates();if(u){var v=1;f&&(v=0);for(var S=v;S<m.length;S++)this._pts.add(m[S])}else{var M=m.length-2;f&&(M=m.length-1);for(var B=M;B>=0;B--)this._pts.add(m[B])}},vi.prototype.isHole=function(){return this._isHole},vi.prototype.setInResult=function(){var a=this._startDe;do a.getEdge().setInResult(!0),a=a.getNext();while(a!==this._startDe)},vi.prototype.containsPoint=function(a){var u=this.getLinearRing();if(!u.getEnvelopeInternal().contains(a)||!ze.isPointInRing(a,u.getCoordinates()))return!1;for(var f=this._holes.iterator();f.hasNext();)if(f.next().containsPoint(a))return!1;return!0},vi.prototype.addHole=function(a){this._holes.add(a)},vi.prototype.isShell=function(){return this._shell===null},vi.prototype.getLabel=function(){return this._label},vi.prototype.getEdges=function(){return this._edges},vi.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},vi.prototype.getShell=function(){return this._shell},vi.prototype.mergeLabel=function(){if(arguments.length===1){var a=arguments[0];this.mergeLabel(a,0),this.mergeLabel(a,1)}else if(arguments.length===2){var u=arguments[0],f=arguments[1],m=u.getLocation(f,Ge.RIGHT);if(m===U.NONE)return null;if(this._label.getLocation(f)===U.NONE)return this._label.setLocation(f,m),null}},vi.prototype.setShell=function(a){this._shell=a,a!==null&&a.addHole(this)},vi.prototype.toPolygon=function(a){for(var u=new Array(this._holes.size()).fill(null),f=0;f<this._holes.size();f++)u[f]=this._holes.get(f).getLinearRing();return a.createPolygon(this.getLinearRing(),u)},vi.prototype.interfaces_=function(){return[]},vi.prototype.getClass=function(){return vi};var Fse=function(a){function u(){var f=arguments[0],m=arguments[1];a.call(this,f,m)}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.setEdgeRing=function(f,m){f.setMinEdgeRing(m)},u.prototype.getNext=function(f){return f.getNextMin()},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(vi),Nse=function(a){function u(){var f=arguments[0],m=arguments[1];a.call(this,f,m)}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.buildMinimalRings=function(){var f=new He,m=this._startDe;do{if(m.getMinEdgeRing()===null){var v=new Fse(m,this._geometryFactory);f.add(v)}m=m.getNext()}while(m!==this._startDe);return f},u.prototype.setEdgeRing=function(f,m){f.setEdgeRing(m)},u.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var f=this._startDe;do f.getNode().getEdges().linkMinimalDirectedEdges(this),f=f.getNext();while(f!==this._startDe)},u.prototype.getNext=function(f){return f.getNext()},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(vi),Qs=o(function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,arguments.length!==0){if(arguments.length===1){var a=arguments[0];this._label=a}}},"Fe");Qs.prototype.setVisited=function(a){this._isVisited=a},Qs.prototype.setInResult=function(a){this._isInResult=a},Qs.prototype.isCovered=function(){return this._isCovered},Qs.prototype.isCoveredSet=function(){return this._isCoveredSet},Qs.prototype.setLabel=function(a){this._label=a},Qs.prototype.getLabel=function(){return this._label},Qs.prototype.setCovered=function(a){this._isCovered=a,this._isCoveredSet=!0},Qs.prototype.updateIM=function(a){ot.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(a)},Qs.prototype.isInResult=function(){return this._isInResult},Qs.prototype.isVisited=function(){return this._isVisited},Qs.prototype.interfaces_=function(){return[]},Qs.prototype.getClass=function(){return Qs};var J_=function(a){function u(){a.call(this),this._coord=null,this._edges=null;var f=arguments[0],m=arguments[1];this._coord=f,this._edges=m,this._label=new Yr(0,U.NONE)}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.isIncidentEdgeInResult=function(){for(var f=this.getEdges().getEdges().iterator();f.hasNext();)if(f.next().getEdge().isInResult())return!0;return!1},u.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},u.prototype.getCoordinate=function(){return this._coord},u.prototype.print=function(f){f.println("node "+this._coord+" lbl: "+this._label)},u.prototype.computeIM=function(f){},u.prototype.computeMergedLocation=function(f,m){var v=U.NONE;if(v=this._label.getLocation(m),!f.isNull(m)){var S=f.getLocation(m);v!==U.BOUNDARY&&(v=S)}return v},u.prototype.setLabel=function(){if(arguments.length!==2)return a.prototype.setLabel.apply(this,arguments);var f=arguments[0],m=arguments[1];this._label===null?this._label=new Yr(f,m):this._label.setLocation(f,m)},u.prototype.getEdges=function(){return this._edges},u.prototype.mergeLabel=function(){if(arguments[0]instanceof u){var f=arguments[0];this.mergeLabel(f._label)}else if(arguments[0]instanceof Yr)for(var m=arguments[0],v=0;v<2;v++){var S=this.computeMergedLocation(m,v);this._label.getLocation(v)===U.NONE&&this._label.setLocation(v,S)}},u.prototype.add=function(f){this._edges.insert(f),f.setNode(this)},u.prototype.setLabelBoundary=function(f){if(this._label===null)return null;var m=U.NONE;this._label!==null&&(m=this._label.getLocation(f));var v=null;switch(m){case U.BOUNDARY:v=U.INTERIOR;break;case U.INTERIOR:default:v=U.BOUNDARY}this._label.setLocation(f,v)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(Qs),Sl=o(function(){this.nodeMap=new b,this.nodeFact=null;var a=arguments[0];this.nodeFact=a},"qe");Sl.prototype.find=function(a){return this.nodeMap.get(a)},Sl.prototype.addNode=function(){if(arguments[0]instanceof N){var a=arguments[0],u=this.nodeMap.get(a);return u===null&&(u=this.nodeFact.createNode(a),this.nodeMap.put(a,u)),u}if(arguments[0]instanceof J_){var f=arguments[0],m=this.nodeMap.get(f.getCoordinate());return m===null?(this.nodeMap.put(f.getCoordinate(),f),f):(m.mergeLabel(f),m)}},Sl.prototype.print=function(a){for(var u=this.iterator();u.hasNext();)u.next().print(a)},Sl.prototype.iterator=function(){return this.nodeMap.values().iterator()},Sl.prototype.values=function(){return this.nodeMap.values()},Sl.prototype.getBoundaryNodes=function(a){for(var u=new He,f=this.iterator();f.hasNext();){var m=f.next();m.getLabel().getLocation(a)===U.BOUNDARY&&u.add(m)}return u},Sl.prototype.add=function(a){var u=a.getCoordinate();this.addNode(u).add(a)},Sl.prototype.interfaces_=function(){return[]},Sl.prototype.getClass=function(){return Sl};var hn=o(function(){},"Be"),yb={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};hn.prototype.interfaces_=function(){return[]},hn.prototype.getClass=function(){return hn},hn.isNorthern=function(a){return a===hn.NE||a===hn.NW},hn.isOpposite=function(a,u){return a===u?!1:(a-u+4)%4===2},hn.commonHalfPlane=function(a,u){if(a===u)return a;if((a-u+4)%4===2)return-1;var f=a<u?a:u;return f===0&&(a>u?a:u)===3?3:f},hn.isInHalfPlane=function(a,u){return u===hn.SE?a===hn.SE||a===hn.SW:a===u||a===u+1},hn.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var a=arguments[0],u=arguments[1];if(a===0&&u===0)throw new D("Cannot compute the quadrant for point ( "+a+", "+u+" )");return a>=0?u>=0?hn.NE:hn.SE:u>=0?hn.NW:hn.SW}if(arguments[0]instanceof N&&arguments[1]instanceof N){var f=arguments[0],m=arguments[1];if(m.x===f.x&&m.y===f.y)throw new D("Cannot compute the quadrant for two identical points "+f);return m.x>=f.x?m.y>=f.y?hn.NE:hn.SE:m.y>=f.y?hn.NW:hn.SW}},yb.NE.get=function(){return 0},yb.NW.get=function(){return 1},yb.SW.get=function(){return 2},yb.SE.get=function(){return 3},Object.defineProperties(hn,yb);var bo=o(function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var a=arguments[0];this._edge=a}else if(arguments.length===3){var u=arguments[0],f=arguments[1],m=arguments[2];this._edge=u,this.init(f,m),this._label=null}else if(arguments.length===4){var v=arguments[0],S=arguments[1],M=arguments[2],B=arguments[3];this._edge=v,this.init(S,M),this._label=B}},"Ue");bo.prototype.compareDirection=function(a){return this._dx===a._dx&&this._dy===a._dy?0:this._quadrant>a._quadrant?1:this._quadrant<a._quadrant?-1:ze.computeOrientation(a._p0,a._p1,this._p1)},bo.prototype.getDy=function(){return this._dy},bo.prototype.getCoordinate=function(){return this._p0},bo.prototype.setNode=function(a){this._node=a},bo.prototype.print=function(a){var u=Math.atan2(this._dy,this._dx),f=this.getClass().getName(),m=f.lastIndexOf("."),v=f.substring(m+1);a.print(" "+v+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+u+" "+this._label)},bo.prototype.compareTo=function(a){var u=a;return this.compareDirection(u)},bo.prototype.getDirectedCoordinate=function(){return this._p1},bo.prototype.getDx=function(){return this._dx},bo.prototype.getLabel=function(){return this._label},bo.prototype.getEdge=function(){return this._edge},bo.prototype.getQuadrant=function(){return this._quadrant},bo.prototype.getNode=function(){return this._node},bo.prototype.toString=function(){var a=Math.atan2(this._dy,this._dx),u=this.getClass().getName(),f=u.lastIndexOf(".");return" "+u.substring(f+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+a+" "+this._label},bo.prototype.computeLabel=function(a){},bo.prototype.init=function(a,u){this._p0=a,this._p1=u,this._dx=u.x-a.x,this._dy=u.y-a.y,this._quadrant=hn.quadrant(this._dx,this._dy),ot.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},bo.prototype.interfaces_=function(){return[j]},bo.prototype.getClass=function(){return bo};var cE=function(a){function u(){var f=arguments[0],m=arguments[1];if(a.call(this,f),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=m,m)this.init(f.getCoordinate(0),f.getCoordinate(1));else{var v=f.getNumPoints()-1;this.init(f.getCoordinate(v),f.getCoordinate(v-1))}this.computeDirectedLabel()}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.getNextMin=function(){return this._nextMin},u.prototype.getDepth=function(f){return this._depth[f]},u.prototype.setVisited=function(f){this._isVisited=f},u.prototype.computeDirectedLabel=function(){this._label=new Yr(this._edge.getLabel()),this._isForward||this._label.flip()},u.prototype.getNext=function(){return this._next},u.prototype.setDepth=function(f,m){if(this._depth[f]!==-999&&this._depth[f]!==m)throw new bc("assigned depths do not match",this.getCoordinate());this._depth[f]=m},u.prototype.isInteriorAreaEdge=function(){for(var f=!0,m=0;m<2;m++)this._label.isArea(m)&&this._label.getLocation(m,Ge.LEFT)===U.INTERIOR&&this._label.getLocation(m,Ge.RIGHT)===U.INTERIOR||(f=!1);return f},u.prototype.setNextMin=function(f){this._nextMin=f},u.prototype.print=function(f){a.prototype.print.call(this,f),f.print(" "+this._depth[Ge.LEFT]+"/"+this._depth[Ge.RIGHT]),f.print(" ("+this.getDepthDelta()+")"),this._isInResult&&f.print(" inResult")},u.prototype.setMinEdgeRing=function(f){this._minEdgeRing=f},u.prototype.isLineEdge=function(){var f=this._label.isLine(0)||this._label.isLine(1),m=!this._label.isArea(0)||this._label.allPositionsEqual(0,U.EXTERIOR),v=!this._label.isArea(1)||this._label.allPositionsEqual(1,U.EXTERIOR);return f&&m&&v},u.prototype.setEdgeRing=function(f){this._edgeRing=f},u.prototype.getMinEdgeRing=function(){return this._minEdgeRing},u.prototype.getDepthDelta=function(){var f=this._edge.getDepthDelta();return this._isForward||(f=-f),f},u.prototype.setInResult=function(f){this._isInResult=f},u.prototype.getSym=function(){return this._sym},u.prototype.isForward=function(){return this._isForward},u.prototype.getEdge=function(){return this._edge},u.prototype.printEdge=function(f){this.print(f),f.print(" "),this._isForward?this._edge.print(f):this._edge.printReverse(f)},u.prototype.setSym=function(f){this._sym=f},u.prototype.setVisitedEdge=function(f){this.setVisited(f),this._sym.setVisited(f)},u.prototype.setEdgeDepths=function(f,m){var v=this.getEdge().getDepthDelta();this._isForward||(v=-v);var S=1;f===Ge.LEFT&&(S=-1);var M=Ge.opposite(f),B=m+v*S;this.setDepth(f,m),this.setDepth(M,B)},u.prototype.getEdgeRing=function(){return this._edgeRing},u.prototype.isInResult=function(){return this._isInResult},u.prototype.setNext=function(f){this._next=f},u.prototype.isVisited=function(){return this._isVisited},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u.depthFactor=function(f,m){return f===U.EXTERIOR&&m===U.INTERIOR?1:f===U.INTERIOR&&m===U.EXTERIOR?-1:0},u}(bo),Vy=o(function(){},"Xe");Vy.prototype.createNode=function(a){return new J_(a,null)},Vy.prototype.interfaces_=function(){return[]},Vy.prototype.getClass=function(){return Vy};var Zn=o(function(){if(this._edges=new He,this._nodes=null,this._edgeEndList=new He,arguments.length===0)this._nodes=new Sl(new Vy);else if(arguments.length===1){var a=arguments[0];this._nodes=new Sl(a)}},"Ye");Zn.prototype.printEdges=function(a){a.println("Edges:");for(var u=0;u<this._edges.size();u++){a.println("edge "+u+":");var f=this._edges.get(u);f.print(a),f.eiList.print(a)}},Zn.prototype.find=function(a){return this._nodes.find(a)},Zn.prototype.addNode=function(){if(arguments[0]instanceof J_){var a=arguments[0];return this._nodes.addNode(a)}if(arguments[0]instanceof N){var u=arguments[0];return this._nodes.addNode(u)}},Zn.prototype.getNodeIterator=function(){return this._nodes.iterator()},Zn.prototype.linkResultDirectedEdges=function(){for(var a=this._nodes.iterator();a.hasNext();)a.next().getEdges().linkResultDirectedEdges()},Zn.prototype.debugPrintln=function(a){Se.out.println(a)},Zn.prototype.isBoundaryNode=function(a,u){var f=this._nodes.find(u);if(f===null)return!1;var m=f.getLabel();return m!==null&&m.getLocation(a)===U.BOUNDARY},Zn.prototype.linkAllDirectedEdges=function(){for(var a=this._nodes.iterator();a.hasNext();)a.next().getEdges().linkAllDirectedEdges()},Zn.prototype.matchInSameDirection=function(a,u,f,m){return!!a.equals(f)&&ze.computeOrientation(a,u,m)===ze.COLLINEAR&&hn.quadrant(a,u)===hn.quadrant(f,m)},Zn.prototype.getEdgeEnds=function(){return this._edgeEndList},Zn.prototype.debugPrint=function(a){Se.out.print(a)},Zn.prototype.getEdgeIterator=function(){return this._edges.iterator()},Zn.prototype.findEdgeInSameDirection=function(a,u){for(var f=0;f<this._edges.size();f++){var m=this._edges.get(f),v=m.getCoordinates();if(this.matchInSameDirection(a,u,v[0],v[1])||this.matchInSameDirection(a,u,v[v.length-1],v[v.length-2]))return m}return null},Zn.prototype.insertEdge=function(a){this._edges.add(a)},Zn.prototype.findEdgeEnd=function(a){for(var u=this.getEdgeEnds().iterator();u.hasNext();){var f=u.next();if(f.getEdge()===a)return f}return null},Zn.prototype.addEdges=function(a){for(var u=a.iterator();u.hasNext();){var f=u.next();this._edges.add(f);var m=new cE(f,!0),v=new cE(f,!1);m.setSym(v),v.setSym(m),this.add(m),this.add(v)}},Zn.prototype.add=function(a){this._nodes.add(a),this._edgeEndList.add(a)},Zn.prototype.getNodes=function(){return this._nodes.values()},Zn.prototype.findEdge=function(a,u){for(var f=0;f<this._edges.size();f++){var m=this._edges.get(f),v=m.getCoordinates();if(a.equals(v[0])&&u.equals(v[1]))return m}return null},Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn},Zn.linkResultDirectedEdges=function(a){for(var u=a.iterator();u.hasNext();)u.next().getEdges().linkResultDirectedEdges()};var Os=o(function(){this._geometryFactory=null,this._shellList=new He;var a=arguments[0];this._geometryFactory=a},"ke");Os.prototype.sortShellsAndHoles=function(a,u,f){for(var m=a.iterator();m.hasNext();){var v=m.next();v.isHole()?f.add(v):u.add(v)}},Os.prototype.computePolygons=function(a){for(var u=new He,f=a.iterator();f.hasNext();){var m=f.next().toPolygon(this._geometryFactory);u.add(m)}return u},Os.prototype.placeFreeHoles=function(a,u){for(var f=u.iterator();f.hasNext();){var m=f.next();if(m.getShell()===null){var v=this.findEdgeRingContaining(m,a);if(v===null)throw new bc("unable to assign hole to a shell",m.getCoordinate(0));m.setShell(v)}}},Os.prototype.buildMinimalEdgeRings=function(a,u,f){for(var m=new He,v=a.iterator();v.hasNext();){var S=v.next();if(S.getMaxNodeDegree()>2){S.linkDirectedEdgesForMinimalEdgeRings();var M=S.buildMinimalRings(),B=this.findShell(M);B!==null?(this.placePolygonHoles(B,M),u.add(B)):f.addAll(M)}else m.add(S)}return m},Os.prototype.containsPoint=function(a){for(var u=this._shellList.iterator();u.hasNext();)if(u.next().containsPoint(a))return!0;return!1},Os.prototype.buildMaximalEdgeRings=function(a){for(var u=new He,f=a.iterator();f.hasNext();){var m=f.next();if(m.isInResult()&&m.getLabel().isArea()&&m.getEdgeRing()===null){var v=new Nse(m,this._geometryFactory);u.add(v),v.setInResult()}}return u},Os.prototype.placePolygonHoles=function(a,u){for(var f=u.iterator();f.hasNext();){var m=f.next();m.isHole()&&m.setShell(a)}},Os.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Os.prototype.findEdgeRingContaining=function(a,u){for(var f=a.getLinearRing(),m=f.getEnvelopeInternal(),v=f.getCoordinateN(0),S=null,M=null,B=u.iterator();B.hasNext();){var z=B.next(),te=z.getLinearRing(),pe=te.getEnvelopeInternal();S!==null&&(M=S.getLinearRing().getEnvelopeInternal());var ye=!1;pe.contains(m)&&ze.isPointInRing(v,te.getCoordinates())&&(ye=!0),ye&&(S===null||M.contains(pe))&&(S=z)}return S},Os.prototype.findShell=function(a){for(var u=0,f=null,m=a.iterator();m.hasNext();){var v=m.next();v.isHole()||(f=v,u++)}return ot.isTrue(u<=1,"found two shells in MinimalEdgeRing list"),f},Os.prototype.add=function(){if(arguments.length===1){var a=arguments[0];this.add(a.getEdgeEnds(),a.getNodes())}else if(arguments.length===2){var u=arguments[0],f=arguments[1];Zn.linkResultDirectedEdges(f);var m=this.buildMaximalEdgeRings(u),v=new He,S=this.buildMinimalEdgeRings(m,this._shellList,v);this.sortShellsAndHoles(S,this._shellList,v),this.placeFreeHoles(this._shellList,v)}},Os.prototype.interfaces_=function(){return[]},Os.prototype.getClass=function(){return Os};var zy=o(function(){},"je");zy.prototype.getBounds=function(){},zy.prototype.interfaces_=function(){return[]},zy.prototype.getClass=function(){return zy};var Ja=o(function(){this._bounds=null,this._item=null;var a=arguments[0],u=arguments[1];this._bounds=a,this._item=u},"He");Ja.prototype.getItem=function(){return this._item},Ja.prototype.getBounds=function(){return this._bounds},Ja.prototype.interfaces_=function(){return[zy,t]},Ja.prototype.getClass=function(){return Ja};var xc=o(function(){this._size=null,this._items=null,this._size=0,this._items=new He,this._items.add(null)},"We");xc.prototype.poll=function(){if(this.isEmpty())return null;var a=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),a},xc.prototype.size=function(){return this._size},xc.prototype.reorder=function(a){for(var u=null,f=this._items.get(a);2*a<=this._size&&((u=2*a)!==this._size&&this._items.get(u+1).compareTo(this._items.get(u))<0&&u++,this._items.get(u).compareTo(f)<0);a=u)this._items.set(a,this._items.get(u));this._items.set(a,f)},xc.prototype.clear=function(){this._size=0,this._items.clear()},xc.prototype.isEmpty=function(){return this._size===0},xc.prototype.add=function(a){this._items.add(null),this._size+=1;var u=this._size;for(this._items.set(0,a);a.compareTo(this._items.get(Math.trunc(u/2)))<0;u/=2)this._items.set(u,this._items.get(Math.trunc(u/2)));this._items.set(u,a)},xc.prototype.interfaces_=function(){return[]},xc.prototype.getClass=function(){return xc};var kp=o(function(){},"Ke");kp.prototype.visitItem=function(a){},kp.prototype.interfaces_=function(){return[]},kp.prototype.getClass=function(){return kp};var Wh=o(function(){},"Je");Wh.prototype.insert=function(a,u){},Wh.prototype.remove=function(a,u){},Wh.prototype.query=function(){},Wh.prototype.interfaces_=function(){return[]},Wh.prototype.getClass=function(){return Wh};var Ei=o(function(){if(this._childBoundables=new He,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var a=arguments[0];this._level=a}}},"Qe"),HF={serialVersionUID:{configurable:!0}};Ei.prototype.getLevel=function(){return this._level},Ei.prototype.size=function(){return this._childBoundables.size()},Ei.prototype.getChildBoundables=function(){return this._childBoundables},Ei.prototype.addChildBoundable=function(a){ot.isTrue(this._bounds===null),this._childBoundables.add(a)},Ei.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Ei.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},Ei.prototype.interfaces_=function(){return[zy,t]},Ei.prototype.getClass=function(){return Ei},HF.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(Ei,HF);var Qa=o(function(){},"$e");Qa.reverseOrder=function(){return{compare:o(function(a,u){return u.compareTo(a)},"compare")}},Qa.min=function(a){return Qa.sort(a),a.get(0)},Qa.sort=function(a,u){var f=a.toArray();u?Fe.sort(f,u):Fe.sort(f);for(var m=a.iterator(),v=0,S=f.length;v<S;v++)m.next(),m.set(f[v])},Qa.singletonList=function(a){var u=new He;return u.add(a),u};var bi=o(function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var a=arguments[0],u=arguments[1],f=arguments[2];this._boundable1=a,this._boundable2=u,this._itemDistance=f,this._distance=this.distance()},"tn");bi.prototype.expandToQueue=function(a,u){var f=bi.isComposite(this._boundable1),m=bi.isComposite(this._boundable2);if(f&&m)return bi.area(this._boundable1)>bi.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,a,u),null):(this.expand(this._boundable2,this._boundable1,a,u),null);if(f)return this.expand(this._boundable1,this._boundable2,a,u),null;if(m)return this.expand(this._boundable2,this._boundable1,a,u),null;throw new D("neither boundable is composite")},bi.prototype.isLeaves=function(){return!(bi.isComposite(this._boundable1)||bi.isComposite(this._boundable2))},bi.prototype.compareTo=function(a){var u=a;return this._distance<u._distance?-1:this._distance>u._distance?1:0},bi.prototype.expand=function(a,u,f,m){for(var v=a.getChildBoundables().iterator();v.hasNext();){var S=v.next(),M=new bi(S,u,this._itemDistance);M.getDistance()<m&&f.add(M)}},bi.prototype.getBoundable=function(a){return a===0?this._boundable1:this._boundable2},bi.prototype.getDistance=function(){return this._distance},bi.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},bi.prototype.interfaces_=function(){return[j]},bi.prototype.getClass=function(){return bi},bi.area=function(a){return a.getBounds().getArea()},bi.isComposite=function(a){return a instanceof Ei};var Wi=o(function a(){if(this._root=null,this._built=!1,this._itemBoundables=new He,this._nodeCapacity=null,arguments.length===0){var u=a.DEFAULT_NODE_CAPACITY;this._nodeCapacity=u}else if(arguments.length===1){var f=arguments[0];ot.isTrue(f>1,"Node capacity must be greater than 1"),this._nodeCapacity=f}},"t"),Q_={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Wi.prototype.getNodeCapacity=function(){return this._nodeCapacity},Wi.prototype.lastNode=function(a){return a.get(a.size()-1)},Wi.prototype.size=function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var a=0,u=arguments[0].getChildBoundables().iterator();u.hasNext();){var f=u.next();f instanceof Ei?a+=this.size(f):f instanceof Ja&&(a+=1)}return a}},Wi.prototype.removeItem=function(a,u){for(var f=null,m=a.getChildBoundables().iterator();m.hasNext();){var v=m.next();v instanceof Ja&&v.getItem()===u&&(f=v)}return f!==null&&(a.getChildBoundables().remove(f),!0)},Wi.prototype.itemsTree=function(){if(arguments.length===0){this.build();var a=this.itemsTree(this._root);return a===null?new He:a}if(arguments.length===1){for(var u=arguments[0],f=new He,m=u.getChildBoundables().iterator();m.hasNext();){var v=m.next();if(v instanceof Ei){var S=this.itemsTree(v);S!==null&&f.add(S)}else v instanceof Ja?f.add(v.getItem()):ot.shouldNeverReachHere()}return f.size()<=0?null:f}},Wi.prototype.insert=function(a,u){ot.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Ja(a,u))},Wi.prototype.boundablesAtLevel=function(){if(arguments.length===1){var a=arguments[0],u=new He;return this.boundablesAtLevel(a,this._root,u),u}if(arguments.length===3){var f=arguments[0],m=arguments[1],v=arguments[2];if(ot.isTrue(f>-2),m.getLevel()===f)return v.add(m),null;for(var S=m.getChildBoundables().iterator();S.hasNext();){var M=S.next();M instanceof Ei?this.boundablesAtLevel(f,M,v):(ot.isTrue(M instanceof Ja),f===-1&&v.add(M))}return null}},Wi.prototype.query=function(){if(arguments.length===1){var a=arguments[0];this.build();var u=new He;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),a)&&this.query(a,this._root,u),u}if(arguments.length===2){var f=arguments[0],m=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),f)&&this.query(f,this._root,m)}else if(arguments.length===3){if(ne(arguments[2],kp)&&arguments[0]instanceof Object&&arguments[1]instanceof Ei)for(var v=arguments[0],S=arguments[1],M=arguments[2],B=S.getChildBoundables(),z=0;z<B.size();z++){var te=B.get(z);this.getIntersectsOp().intersects(te.getBounds(),v)&&(te instanceof Ei?this.query(v,te,M):te instanceof Ja?M.visitItem(te.getItem()):ot.shouldNeverReachHere())}else if(ne(arguments[2],ts)&&arguments[0]instanceof Object&&arguments[1]instanceof Ei)for(var pe=arguments[0],ye=arguments[1],Xe=arguments[2],Ze=ye.getChildBoundables(),nt=0;nt<Ze.size();nt++){var mt=Ze.get(nt);this.getIntersectsOp().intersects(mt.getBounds(),pe)&&(mt instanceof Ei?this.query(pe,mt,Xe):mt instanceof Ja?Xe.add(mt.getItem()):ot.shouldNeverReachHere())}}},Wi.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},Wi.prototype.getRoot=function(){return this.build(),this._root},Wi.prototype.remove=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),a)&&this.remove(a,this._root,u)}if(arguments.length===3){var f=arguments[0],m=arguments[1],v=arguments[2],S=this.removeItem(m,v);if(S)return!0;for(var M=null,B=m.getChildBoundables().iterator();B.hasNext();){var z=B.next();if(this.getIntersectsOp().intersects(z.getBounds(),f)&&z instanceof Ei&&(S=this.remove(f,z,v))){M=z;break}}return M!==null&&M.getChildBoundables().isEmpty()&&m.getChildBoundables().remove(M),S}},Wi.prototype.createHigherLevels=function(a,u){ot.isTrue(!a.isEmpty());var f=this.createParentBoundables(a,u+1);return f.size()===1?f.get(0):this.createHigherLevels(f,u+1)},Wi.prototype.depth=function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var a=0,u=arguments[0].getChildBoundables().iterator();u.hasNext();){var f=u.next();if(f instanceof Ei){var m=this.depth(f);m>a&&(a=m)}}return a+1}},Wi.prototype.createParentBoundables=function(a,u){ot.isTrue(!a.isEmpty());var f=new He;f.add(this.createNode(u));var m=new He(a);Qa.sort(m,this.getComparator());for(var v=m.iterator();v.hasNext();){var S=v.next();this.lastNode(f).getChildBoundables().size()===this.getNodeCapacity()&&f.add(this.createNode(u)),this.lastNode(f).addChildBoundable(S)}return f},Wi.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Wi.prototype.interfaces_=function(){return[t]},Wi.prototype.getClass=function(){return Wi},Wi.compareDoubles=function(a,u){return a>u?1:a<u?-1:0},Q_.IntersectsOp.get=function(){return kse},Q_.serialVersionUID.get=function(){return-3886435814360241e3},Q_.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Wi,Q_);var kse=o(function(){},"rn"),qy=o(function(){},"on");qy.prototype.distance=function(a,u){},qy.prototype.interfaces_=function(){return[]},qy.prototype.getClass=function(){return qy};var WF=function(a){function u(m){m=m||u.DEFAULT_NODE_CAPACITY,a.call(this,m)}o(u,"n"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return u.prototype.createParentBoundablesFromVerticalSlices=function(m,v){ot.isTrue(m.length>0);for(var S=new He,M=0;M<m.length;M++)S.addAll(this.createParentBoundablesFromVerticalSlice(m[M],v));return S},u.prototype.createNode=function(m){return new XF(m)},u.prototype.size=function(){return arguments.length===0?a.prototype.size.call(this):a.prototype.size.apply(this,arguments)},u.prototype.insert=function(){if(arguments.length!==2)return a.prototype.insert.apply(this,arguments);var m=arguments[0],v=arguments[1];if(m.isNull())return null;a.prototype.insert.call(this,m,v)},u.prototype.getIntersectsOp=function(){return u.intersectsOp},u.prototype.verticalSlices=function(m,v){for(var S=Math.trunc(Math.ceil(m.size()/v)),M=new Array(v).fill(null),B=m.iterator(),z=0;z<v;z++){M[z]=new He;for(var te=0;B.hasNext()&&te<S;){var pe=B.next();M[z].add(pe),te++}}return M},u.prototype.query=function(){if(arguments.length===1){var m=arguments[0];return a.prototype.query.call(this,m)}if(arguments.length===2){var v=arguments[0],S=arguments[1];a.prototype.query.call(this,v,S)}else if(arguments.length===3){if(ne(arguments[2],kp)&&arguments[0]instanceof Object&&arguments[1]instanceof Ei){var M=arguments[0],B=arguments[1],z=arguments[2];a.prototype.query.call(this,M,B,z)}else if(ne(arguments[2],ts)&&arguments[0]instanceof Object&&arguments[1]instanceof Ei){var te=arguments[0],pe=arguments[1],ye=arguments[2];a.prototype.query.call(this,te,pe,ye)}}},u.prototype.getComparator=function(){return u.yComparator},u.prototype.createParentBoundablesFromVerticalSlice=function(m,v){return a.prototype.createParentBoundables.call(this,m,v)},u.prototype.remove=function(){if(arguments.length===2){var m=arguments[0],v=arguments[1];return a.prototype.remove.call(this,m,v)}return a.prototype.remove.apply(this,arguments)},u.prototype.depth=function(){return arguments.length===0?a.prototype.depth.call(this):a.prototype.depth.apply(this,arguments)},u.prototype.createParentBoundables=function(m,v){ot.isTrue(!m.isEmpty());var S=Math.trunc(Math.ceil(m.size()/this.getNodeCapacity())),M=new He(m);Qa.sort(M,u.xComparator);var B=this.verticalSlices(M,Math.trunc(Math.ceil(Math.sqrt(S))));return this.createParentBoundablesFromVerticalSlices(B,v)},u.prototype.nearestNeighbour=function(){if(arguments.length===1){if(ne(arguments[0],qy)){var m=arguments[0],v=new bi(this.getRoot(),this.getRoot(),m);return this.nearestNeighbour(v)}if(arguments[0]instanceof bi){var S=arguments[0];return this.nearestNeighbour(S,A.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof u&&ne(arguments[1],qy)){var M=arguments[0],B=arguments[1],z=new bi(this.getRoot(),M.getRoot(),B);return this.nearestNeighbour(z)}if(arguments[0]instanceof bi&&typeof arguments[1]=="number"){var te=arguments[0],pe=arguments[1],ye=null,Xe=new xc;for(Xe.add(te);!Xe.isEmpty()&&pe>0;){var Ze=Xe.poll(),nt=Ze.getDistance();if(nt>=pe)break;Ze.isLeaves()?(pe=nt,ye=Ze):Ze.expandToQueue(Xe,pe)}return[ye.getBoundable(0).getItem(),ye.getBoundable(1).getItem()]}}else if(arguments.length===3){var mt=arguments[0],Zr=arguments[1],Ii=arguments[2],qo=new Ja(mt,Zr),_u=new bi(this.getRoot(),qo,Ii);return this.nearestNeighbour(_u)[0]}},u.prototype.interfaces_=function(){return[Wh,t]},u.prototype.getClass=function(){return u},u.centreX=function(m){return u.avg(m.getMinX(),m.getMaxX())},u.avg=function(m,v){return(m+v)/2},u.centreY=function(m){return u.avg(m.getMinY(),m.getMaxY())},f.STRtreeNode.get=function(){return XF},f.serialVersionUID.get=function(){return 0x39920f7d5f261e0},f.xComparator.get=function(){return{interfaces_:o(function(){return[Y]},"interfaces_"),compare:o(function(m,v){return a.compareDoubles(u.centreX(m.getBounds()),u.centreX(v.getBounds()))},"compare")}},f.yComparator.get=function(){return{interfaces_:o(function(){return[Y]},"interfaces_"),compare:o(function(m,v){return a.compareDoubles(u.centreY(m.getBounds()),u.centreY(v.getBounds()))},"compare")}},f.intersectsOp.get=function(){return{interfaces_:o(function(){return[a.IntersectsOp]},"interfaces_"),intersects:o(function(m,v){return m.intersects(v)},"intersects")}},f.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(u,f),u}(Wi),XF=function(a){function u(){var f=arguments[0];a.call(this,f)}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.computeBounds=function(){for(var f=null,m=this.getChildBoundables().iterator();m.hasNext();){var v=m.next();f===null?f=new ie(v.getBounds()):f.expandToInclude(v.getBounds())}return f},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(Ei),is=o(function(){},"un");is.prototype.interfaces_=function(){return[]},is.prototype.getClass=function(){return is},is.relativeSign=function(a,u){return a<u?-1:a>u?1:0},is.compare=function(a,u,f){if(u.equals2D(f))return 0;var m=is.relativeSign(u.x,f.x),v=is.relativeSign(u.y,f.y);switch(a){case 0:return is.compareValue(m,v);case 1:return is.compareValue(v,m);case 2:return is.compareValue(v,-m);case 3:return is.compareValue(-m,v);case 4:return is.compareValue(-m,-v);case 5:return is.compareValue(-v,-m);case 6:return is.compareValue(-v,m);case 7:return is.compareValue(m,-v)}return ot.shouldNeverReachHere("invalid octant value"),0},is.compareValue=function(a,u){return a<0?-1:a>0?1:u<0?-1:u>0?1:0};var Rp=o(function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var a=arguments[0],u=arguments[1],f=arguments[2],m=arguments[3];this._segString=a,this.coord=new N(u),this.segmentIndex=f,this._segmentOctant=m,this._isInterior=!u.equals2D(a.getCoordinate(f))},"ln");Rp.prototype.getCoordinate=function(){return this.coord},Rp.prototype.print=function(a){a.print(this.coord),a.print(" seg # = "+this.segmentIndex)},Rp.prototype.compareTo=function(a){var u=a;return this.segmentIndex<u.segmentIndex?-1:this.segmentIndex>u.segmentIndex?1:this.coord.equals2D(u.coord)?0:is.compare(this._segmentOctant,this.coord,u.coord)},Rp.prototype.isEndPoint=function(a){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===a},Rp.prototype.isInterior=function(){return this._isInterior},Rp.prototype.interfaces_=function(){return[j]},Rp.prototype.getClass=function(){return Rp};var $o=o(function(){this._nodeMap=new b,this._edge=null;var a=arguments[0];this._edge=a},"cn");$o.prototype.getSplitCoordinates=function(){var a=new ue;this.addEndpoints();for(var u=this.iterator(),f=u.next();u.hasNext();){var m=u.next();this.addEdgeCoordinates(f,m,a),f=m}return a.toCoordinateArray()},$o.prototype.addCollapsedNodes=function(){var a=new He;this.findCollapsesFromInsertedNodes(a),this.findCollapsesFromExistingVertices(a);for(var u=a.iterator();u.hasNext();){var f=u.next().intValue();this.add(this._edge.getCoordinate(f),f)}},$o.prototype.print=function(a){a.println("Intersections:");for(var u=this.iterator();u.hasNext();)u.next().print(a)},$o.prototype.findCollapsesFromExistingVertices=function(a){for(var u=0;u<this._edge.size()-2;u++){var f=this._edge.getCoordinate(u),m=this._edge.getCoordinate(u+2);f.equals2D(m)&&a.add(new _e(u+1))}},$o.prototype.addEdgeCoordinates=function(a,u,f){var m=this._edge.getCoordinate(u.segmentIndex),v=u.isInterior()||!u.coord.equals2D(m);f.add(new N(a.coord),!1);for(var S=a.segmentIndex+1;S<=u.segmentIndex;S++)f.add(this._edge.getCoordinate(S));v&&f.add(new N(u.coord))},$o.prototype.iterator=function(){return this._nodeMap.values().iterator()},$o.prototype.addSplitEdges=function(a){this.addEndpoints(),this.addCollapsedNodes();for(var u=this.iterator(),f=u.next();u.hasNext();){var m=u.next(),v=this.createSplitEdge(f,m);a.add(v),f=m}},$o.prototype.findCollapseIndex=function(a,u,f){if(!a.coord.equals2D(u.coord))return!1;var m=u.segmentIndex-a.segmentIndex;return u.isInterior()||m--,m===1&&(f[0]=a.segmentIndex+1,!0)},$o.prototype.findCollapsesFromInsertedNodes=function(a){for(var u=new Array(1).fill(null),f=this.iterator(),m=f.next();f.hasNext();){var v=f.next();this.findCollapseIndex(m,v,u)&&a.add(new _e(u[0])),m=v}},$o.prototype.getEdge=function(){return this._edge},$o.prototype.addEndpoints=function(){var a=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(a),a)},$o.prototype.createSplitEdge=function(a,u){var f=u.segmentIndex-a.segmentIndex+2,m=this._edge.getCoordinate(u.segmentIndex),v=u.isInterior()||!u.coord.equals2D(m);v||f--;var S=new Array(f).fill(null),M=0;S[M++]=new N(a.coord);for(var B=a.segmentIndex+1;B<=u.segmentIndex;B++)S[M++]=this._edge.getCoordinate(B);return v&&(S[M]=new N(u.coord)),new li(S,this._edge.getData())},$o.prototype.add=function(a,u){var f=new Rp(this._edge,a,u,this._edge.getSegmentOctant(u)),m=this._nodeMap.get(f);return m!==null?(ot.isTrue(m.coord.equals2D(a),"Found equal nodes with different coordinates"),m):(this._nodeMap.put(f,f),f)},$o.prototype.checkSplitEdgesCorrectness=function(a){var u=this._edge.getCoordinates(),f=a.get(0).getCoordinate(0);if(!f.equals2D(u[0]))throw new Er("bad split edge start point at "+f);var m=a.get(a.size()-1).getCoordinates(),v=m[m.length-1];if(!v.equals2D(u[u.length-1]))throw new Er("bad split edge end point at "+v)},$o.prototype.interfaces_=function(){return[]},$o.prototype.getClass=function(){return $o};var Xh=o(function(){},"pn");Xh.prototype.interfaces_=function(){return[]},Xh.prototype.getClass=function(){return Xh},Xh.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var a=arguments[0],u=arguments[1];if(a===0&&u===0)throw new D("Cannot compute the octant for point ( "+a+", "+u+" )");var f=Math.abs(a),m=Math.abs(u);return a>=0?u>=0?f>=m?0:1:f>=m?7:6:u>=0?f>=m?3:2:f>=m?4:5}if(arguments[0]instanceof N&&arguments[1]instanceof N){var v=arguments[0],S=arguments[1],M=S.x-v.x,B=S.y-v.y;if(M===0&&B===0)throw new D("Cannot compute the octant for two identical points "+v);return Xh.octant(M,B)}};var hu=o(function(){},"hn");hu.prototype.getCoordinates=function(){},hu.prototype.size=function(){},hu.prototype.getCoordinate=function(a){},hu.prototype.isClosed=function(){},hu.prototype.setData=function(a){},hu.prototype.getData=function(){},hu.prototype.interfaces_=function(){return[]},hu.prototype.getClass=function(){return hu};var vb=o(function(){},"fn");vb.prototype.addIntersection=function(a,u){},vb.prototype.interfaces_=function(){return[hu]},vb.prototype.getClass=function(){return vb};var li=o(function(){this._nodeList=new $o(this),this._pts=null,this._data=null;var a=arguments[0],u=arguments[1];this._pts=a,this._data=u},"gn");li.prototype.getCoordinates=function(){return this._pts},li.prototype.size=function(){return this._pts.length},li.prototype.getCoordinate=function(a){return this._pts[a]},li.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},li.prototype.getSegmentOctant=function(a){return a===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(a),this.getCoordinate(a+1))},li.prototype.setData=function(a){this._data=a},li.prototype.safeOctant=function(a,u){return a.equals2D(u)?0:Xh.octant(a,u)},li.prototype.getData=function(){return this._data},li.prototype.addIntersection=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1];this.addIntersectionNode(a,u)}else if(arguments.length===4){var f=arguments[0],m=arguments[1],v=arguments[3],S=new N(f.getIntersection(v));this.addIntersection(S,m)}},li.prototype.toString=function(){return Pt.toLineString(new ai(this._pts))},li.prototype.getNodeList=function(){return this._nodeList},li.prototype.addIntersectionNode=function(a,u){var f=u,m=f+1;if(m<this._pts.length){var v=this._pts[m];a.equals2D(v)&&(f=m)}return this._nodeList.add(a,f)},li.prototype.addIntersections=function(a,u,f){for(var m=0;m<a.getIntersectionNum();m++)this.addIntersection(a,u,f,m)},li.prototype.interfaces_=function(){return[vb]},li.prototype.getClass=function(){return li},li.getNodedSubstrings=function(){if(arguments.length===1){var a=arguments[0],u=new He;return li.getNodedSubstrings(a,u),u}if(arguments.length===2)for(var f=arguments[0],m=arguments[1],v=f.iterator();v.hasNext();)v.next().getNodeList().addSplitEdges(m)};var ct=o(function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new N,this.p1=new N;else if(arguments.length===1){var a=arguments[0];this.p0=new N(a.p0),this.p1=new N(a.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var u=arguments[0],f=arguments[1],m=arguments[2],v=arguments[3];this.p0=new N(u,f),this.p1=new N(m,v)}},"dn"),YF={serialVersionUID:{configurable:!0}};ct.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},ct.prototype.orientationIndex=function(){if(arguments[0]instanceof ct){var a=arguments[0],u=ze.orientationIndex(this.p0,this.p1,a.p0),f=ze.orientationIndex(this.p0,this.p1,a.p1);return u>=0&&f>=0||u<=0&&f<=0?Math.max(u,f):0}if(arguments[0]instanceof N){var m=arguments[0];return ze.orientationIndex(this.p0,this.p1,m)}},ct.prototype.toGeometry=function(a){return a.createLineString([this.p0,this.p1])},ct.prototype.isVertical=function(){return this.p0.x===this.p1.x},ct.prototype.equals=function(a){if(!(a instanceof ct))return!1;var u=a;return this.p0.equals(u.p0)&&this.p1.equals(u.p1)},ct.prototype.intersection=function(a){var u=new Ro;return u.computeIntersection(this.p0,this.p1,a.p0,a.p1),u.hasIntersection()?u.getIntersection(0):null},ct.prototype.project=function(){if(arguments[0]instanceof N){var a=arguments[0];if(a.equals(this.p0)||a.equals(this.p1))return new N(a);var u=this.projectionFactor(a),f=new N;return f.x=this.p0.x+u*(this.p1.x-this.p0.x),f.y=this.p0.y+u*(this.p1.y-this.p0.y),f}if(arguments[0]instanceof ct){var m=arguments[0],v=this.projectionFactor(m.p0),S=this.projectionFactor(m.p1);if(v>=1&&S>=1||v<=0&&S<=0)return null;var M=this.project(m.p0);v<0&&(M=this.p0),v>1&&(M=this.p1);var B=this.project(m.p1);return S<0&&(B=this.p0),S>1&&(B=this.p1),new ct(M,B)}},ct.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},ct.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},ct.prototype.getCoordinate=function(a){return a===0?this.p0:this.p1},ct.prototype.distancePerpendicular=function(a){return ze.distancePointLinePerpendicular(a,this.p0,this.p1)},ct.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},ct.prototype.midPoint=function(){return ct.midPoint(this.p0,this.p1)},ct.prototype.projectionFactor=function(a){if(a.equals(this.p0))return 0;if(a.equals(this.p1))return 1;var u=this.p1.x-this.p0.x,f=this.p1.y-this.p0.y,m=u*u+f*f;return m<=0?A.NaN:((a.x-this.p0.x)*u+(a.y-this.p0.y)*f)/m},ct.prototype.closestPoints=function(a){var u=this.intersection(a);if(u!==null)return[u,u];var f=new Array(2).fill(null),m=A.MAX_VALUE,v=null,S=this.closestPoint(a.p0);m=S.distance(a.p0),f[0]=S,f[1]=a.p0;var M=this.closestPoint(a.p1);(v=M.distance(a.p1))<m&&(m=v,f[0]=M,f[1]=a.p1);var B=a.closestPoint(this.p0);(v=B.distance(this.p0))<m&&(m=v,f[0]=this.p0,f[1]=B);var z=a.closestPoint(this.p1);return(v=z.distance(this.p1))<m&&(m=v,f[0]=this.p1,f[1]=z),f},ct.prototype.closestPoint=function(a){var u=this.projectionFactor(a);return u>0&&u<1?this.project(a):this.p0.distance(a)<this.p1.distance(a)?this.p0:this.p1},ct.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},ct.prototype.getLength=function(){return this.p0.distance(this.p1)},ct.prototype.compareTo=function(a){var u=a,f=this.p0.compareTo(u.p0);return f!==0?f:this.p1.compareTo(u.p1)},ct.prototype.reverse=function(){var a=this.p0;this.p0=this.p1,this.p1=a},ct.prototype.equalsTopo=function(a){return this.p0.equals(a.p0)&&(this.p1.equals(a.p1)||this.p0.equals(a.p1))&&this.p1.equals(a.p0)},ct.prototype.lineIntersection=function(a){try{return H.intersection(this.p0,this.p1,a.p0,a.p1)}catch(u){if(!(u instanceof je))throw u}return null},ct.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},ct.prototype.pointAlongOffset=function(a,u){var f=this.p0.x+a*(this.p1.x-this.p0.x),m=this.p0.y+a*(this.p1.y-this.p0.y),v=this.p1.x-this.p0.x,S=this.p1.y-this.p0.y,M=Math.sqrt(v*v+S*S),B=0,z=0;if(u!==0){if(M<=0)throw new Error("Cannot compute offset from zero-length line segment");B=u*v/M,z=u*S/M}return new N(f-z,m+B)},ct.prototype.setCoordinates=function(){if(arguments.length===1){var a=arguments[0];this.setCoordinates(a.p0,a.p1)}else if(arguments.length===2){var u=arguments[0],f=arguments[1];this.p0.x=u.x,this.p0.y=u.y,this.p1.x=f.x,this.p1.y=f.y}},ct.prototype.segmentFraction=function(a){var u=this.projectionFactor(a);return u<0?u=0:(u>1||A.isNaN(u))&&(u=1),u},ct.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},ct.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},ct.prototype.distance=function(){if(arguments[0]instanceof ct){var a=arguments[0];return ze.distanceLineLine(this.p0,this.p1,a.p0,a.p1)}if(arguments[0]instanceof N){var u=arguments[0];return ze.distancePointLine(u,this.p0,this.p1)}},ct.prototype.pointAlong=function(a){var u=new N;return u.x=this.p0.x+a*(this.p1.x-this.p0.x),u.y=this.p0.y+a*(this.p1.y-this.p0.y),u},ct.prototype.hashCode=function(){var a=A.doubleToLongBits(this.p0.x);a^=31*A.doubleToLongBits(this.p0.y);var u=Math.trunc(a)^Math.trunc(a>>32),f=A.doubleToLongBits(this.p1.x);return f^=31*A.doubleToLongBits(this.p1.y),u^(Math.trunc(f)^Math.trunc(f>>32))},ct.prototype.interfaces_=function(){return[j,t]},ct.prototype.getClass=function(){return ct},ct.midPoint=function(a,u){return new N((a.x+u.x)/2,(a.y+u.y)/2)},YF.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(ct,YF);var bb=o(function(){this.tempEnv1=new ie,this.tempEnv2=new ie,this._overlapSeg1=new ct,this._overlapSeg2=new ct},"_n");bb.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var a=arguments[0],u=arguments[1],f=arguments[2],m=arguments[3];a.getLineSegment(u,this._overlapSeg1),f.getLineSegment(m,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},bb.prototype.interfaces_=function(){return[]},bb.prototype.getClass=function(){return bb};var Ls=o(function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var a=arguments[0],u=arguments[1],f=arguments[2],m=arguments[3];this._pts=a,this._start=u,this._end=f,this._context=m},"mn");Ls.prototype.getLineSegment=function(a,u){u.p0=this._pts[a],u.p1=this._pts[a+1]},Ls.prototype.computeSelect=function(a,u,f,m){var v=this._pts[u],S=this._pts[f];if(m.tempEnv1.init(v,S),f-u==1)return m.select(this,u),null;if(!a.intersects(m.tempEnv1))return null;var M=Math.trunc((u+f)/2);u<M&&this.computeSelect(a,u,M,m),M<f&&this.computeSelect(a,M,f,m)},Ls.prototype.getCoordinates=function(){for(var a=new Array(this._end-this._start+1).fill(null),u=0,f=this._start;f<=this._end;f++)a[u++]=this._pts[f];return a},Ls.prototype.computeOverlaps=function(a,u){this.computeOverlapsInternal(this._start,this._end,a,a._start,a._end,u)},Ls.prototype.setId=function(a){this._id=a},Ls.prototype.select=function(a,u){this.computeSelect(a,this._start,this._end,u)},Ls.prototype.getEnvelope=function(){if(this._env===null){var a=this._pts[this._start],u=this._pts[this._end];this._env=new ie(a,u)}return this._env},Ls.prototype.getEndIndex=function(){return this._end},Ls.prototype.getStartIndex=function(){return this._start},Ls.prototype.getContext=function(){return this._context},Ls.prototype.getId=function(){return this._id},Ls.prototype.computeOverlapsInternal=function(a,u,f,m,v,S){var M=this._pts[a],B=this._pts[u],z=f._pts[m],te=f._pts[v];if(u-a==1&&v-m==1)return S.overlap(this,a,f,m),null;if(S.tempEnv1.init(M,B),S.tempEnv2.init(z,te),!S.tempEnv1.intersects(S.tempEnv2))return null;var pe=Math.trunc((a+u)/2),ye=Math.trunc((m+v)/2);a<pe&&(m<ye&&this.computeOverlapsInternal(a,pe,f,m,ye,S),ye<v&&this.computeOverlapsInternal(a,pe,f,ye,v,S)),pe<u&&(m<ye&&this.computeOverlapsInternal(pe,u,f,m,ye,S),ye<v&&this.computeOverlapsInternal(pe,u,f,ye,v,S))},Ls.prototype.interfaces_=function(){return[]},Ls.prototype.getClass=function(){return Ls};var Cl=o(function(){},"vn");Cl.prototype.interfaces_=function(){return[]},Cl.prototype.getClass=function(){return Cl},Cl.getChainStartIndices=function(a){var u=0,f=new He;f.add(new _e(u));do{var m=Cl.findChainEnd(a,u);f.add(new _e(m)),u=m}while(u<a.length-1);return Cl.toIntArray(f)},Cl.findChainEnd=function(a,u){for(var f=u;f<a.length-1&&a[f].equals2D(a[f+1]);)f++;if(f>=a.length-1)return a.length-1;for(var m=hn.quadrant(a[f],a[f+1]),v=u+1;v<a.length&&!(!a[v-1].equals2D(a[v])&&hn.quadrant(a[v-1],a[v])!==m);)v++;return v-1},Cl.getChains=function(){if(arguments.length===1){var a=arguments[0];return Cl.getChains(a,null)}if(arguments.length===2){for(var u=arguments[0],f=arguments[1],m=new He,v=Cl.getChainStartIndices(u),S=0;S<v.length-1;S++){var M=new Ls(u,v[S],v[S+1],f);m.add(M)}return m}},Cl.toIntArray=function(a){for(var u=new Array(a.size()).fill(null),f=0;f<u.length;f++)u[f]=a.get(f).intValue();return u};var vd=o(function(){},"In");vd.prototype.computeNodes=function(a){},vd.prototype.getNodedSubstrings=function(){},vd.prototype.interfaces_=function(){return[]},vd.prototype.getClass=function(){return vd};var xb=o(function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var a=arguments[0];this.setSegmentIntersector(a)}}},"En");xb.prototype.setSegmentIntersector=function(a){this._segInt=a},xb.prototype.interfaces_=function(){return[vd]},xb.prototype.getClass=function(){return xb};var pE=function(a){function u(m){m?a.call(this,m):a.call(this),this._monoChains=new He,this._index=new WF,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}o(u,"e"),a&&(u.__proto__=a),(u.prototype=Object.create(a&&a.prototype)).constructor=u;var f={SegmentOverlapAction:{configurable:!0}};return u.prototype.getMonotoneChains=function(){return this._monoChains},u.prototype.getNodedSubstrings=function(){return li.getNodedSubstrings(this._nodedSegStrings)},u.prototype.getIndex=function(){return this._index},u.prototype.add=function(m){for(var v=Cl.getChains(m.getCoordinates(),m).iterator();v.hasNext();){var S=v.next();S.setId(this._idCounter++),this._index.insert(S.getEnvelope(),S),this._monoChains.add(S)}},u.prototype.computeNodes=function(m){this._nodedSegStrings=m;for(var v=m.iterator();v.hasNext();)this.add(v.next());this.intersectChains()},u.prototype.intersectChains=function(){for(var m=new ZF(this._segInt),v=this._monoChains.iterator();v.hasNext();)for(var S=v.next(),M=this._index.query(S.getEnvelope()).iterator();M.hasNext();){var B=M.next();if(B.getId()>S.getId()&&(S.computeOverlaps(B,m),this._nOverlaps++),this._segInt.isDone())return null}},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},f.SegmentOverlapAction.get=function(){return ZF},Object.defineProperties(u,f),u}(xb),ZF=function(a){function u(){a.call(this),this._si=null;var f=arguments[0];this._si=f}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.overlap=function(){if(arguments.length!==4)return a.prototype.overlap.apply(this,arguments);var f=arguments[0],m=arguments[1],v=arguments[2],S=arguments[3],M=f.getContext(),B=v.getContext();this._si.processIntersections(M,m,B,S)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(bb),Or=o(function a(){if(this._quadrantSegments=a.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=a.CAP_ROUND,this._joinStyle=a.JOIN_ROUND,this._mitreLimit=a.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=a.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var u=arguments[0];this.setQuadrantSegments(u)}else if(arguments.length===2){var f=arguments[0],m=arguments[1];this.setQuadrantSegments(f),this.setEndCapStyle(m)}else if(arguments.length===4){var v=arguments[0],S=arguments[1],M=arguments[2],B=arguments[3];this.setQuadrantSegments(v),this.setEndCapStyle(S),this.setJoinStyle(M),this.setMitreLimit(B)}}},"t"),Ic={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};Or.prototype.getEndCapStyle=function(){return this._endCapStyle},Or.prototype.isSingleSided=function(){return this._isSingleSided},Or.prototype.setQuadrantSegments=function(a){this._quadrantSegments=a,this._quadrantSegments===0&&(this._joinStyle=Or.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Or.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),a<=0&&(this._quadrantSegments=1),this._joinStyle!==Or.JOIN_ROUND&&(this._quadrantSegments=Or.DEFAULT_QUADRANT_SEGMENTS)},Or.prototype.getJoinStyle=function(){return this._joinStyle},Or.prototype.setJoinStyle=function(a){this._joinStyle=a},Or.prototype.setSimplifyFactor=function(a){this._simplifyFactor=a<0?0:a},Or.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Or.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Or.prototype.setEndCapStyle=function(a){this._endCapStyle=a},Or.prototype.getMitreLimit=function(){return this._mitreLimit},Or.prototype.setMitreLimit=function(a){this._mitreLimit=a},Or.prototype.setSingleSided=function(a){this._isSingleSided=a},Or.prototype.interfaces_=function(){return[]},Or.prototype.getClass=function(){return Or},Or.bufferDistanceError=function(a){var u=Math.PI/2/a;return 1-Math.cos(u/2)},Ic.CAP_ROUND.get=function(){return 1},Ic.CAP_FLAT.get=function(){return 2},Ic.CAP_SQUARE.get=function(){return 3},Ic.JOIN_ROUND.get=function(){return 1},Ic.JOIN_MITRE.get=function(){return 2},Ic.JOIN_BEVEL.get=function(){return 3},Ic.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Ic.DEFAULT_MITRE_LIMIT.get=function(){return 5},Ic.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(Or,Ic);var ei=o(function(a){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=ze.COUNTERCLOCKWISE,this._inputLine=a||null},"Ln"),Ib={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};ei.prototype.isDeletable=function(a,u,f,m){var v=this._inputLine[a],S=this._inputLine[u],M=this._inputLine[f];return!!this.isConcave(v,S,M)&&!!this.isShallow(v,S,M,m)&&this.isShallowSampled(v,S,a,f,m)},ei.prototype.deleteShallowConcavities=function(){for(var a=1,u=this.findNextNonDeletedIndex(a),f=this.findNextNonDeletedIndex(u),m=!1;f<this._inputLine.length;){var v=!1;this.isDeletable(a,u,f,this._distanceTol)&&(this._isDeleted[u]=ei.DELETE,v=!0,m=!0),a=v?f:u,u=this.findNextNonDeletedIndex(a),f=this.findNextNonDeletedIndex(u)}return m},ei.prototype.isShallowConcavity=function(a,u,f,m){return ze.computeOrientation(a,u,f)!==this._angleOrientation?!1:ze.distancePointLine(u,a,f)<m},ei.prototype.isShallowSampled=function(a,u,f,m,v){var S=Math.trunc((m-f)/ei.NUM_PTS_TO_CHECK);S<=0&&(S=1);for(var M=f;M<m;M+=S)if(!this.isShallow(a,u,this._inputLine[M],v))return!1;return!0},ei.prototype.isConcave=function(a,u,f){var m=ze.computeOrientation(a,u,f)===this._angleOrientation;return m},ei.prototype.simplify=function(a){this._distanceTol=Math.abs(a),a<0&&(this._angleOrientation=ze.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var u=!1;do u=this.deleteShallowConcavities();while(u);return this.collapseLine()},ei.prototype.findNextNonDeletedIndex=function(a){for(var u=a+1;u<this._inputLine.length&&this._isDeleted[u]===ei.DELETE;)u++;return u},ei.prototype.isShallow=function(a,u,f,m){return ze.distancePointLine(u,a,f)<m},ei.prototype.collapseLine=function(){for(var a=new ue,u=0;u<this._inputLine.length;u++)this._isDeleted[u]!==ei.DELETE&&a.add(this._inputLine[u]);return a.toCoordinateArray()},ei.prototype.interfaces_=function(){return[]},ei.prototype.getClass=function(){return ei},ei.simplify=function(a,u){return new ei(a).simplify(u)},Ib.INIT.get=function(){return 0},Ib.DELETE.get=function(){return 1},Ib.KEEP.get=function(){return 1},Ib.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(ei,Ib);var ea=o(function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new He},"wn"),KF={COORDINATE_ARRAY_TYPE:{configurable:!0}};ea.prototype.getCoordinates=function(){return this._ptList.toArray(ea.COORDINATE_ARRAY_TYPE)},ea.prototype.setPrecisionModel=function(a){this._precisionModel=a},ea.prototype.addPt=function(a){var u=new N(a);if(this._precisionModel.makePrecise(u),this.isRedundant(u))return null;this._ptList.add(u)},ea.prototype.revere=function(){},ea.prototype.addPts=function(a,u){if(u)for(var f=0;f<a.length;f++)this.addPt(a[f]);else for(var m=a.length-1;m>=0;m--)this.addPt(a[m])},ea.prototype.isRedundant=function(a){if(this._ptList.size()<1)return!1;var u=this._ptList.get(this._ptList.size()-1);return a.distance(u)<this._minimimVertexDistance},ea.prototype.toString=function(){return new $t().createLineString(this.getCoordinates()).toString()},ea.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var a=new N(this._ptList.get(0)),u=this._ptList.get(this._ptList.size()-1);if(a.equals(u))return null;this._ptList.add(a)},ea.prototype.setMinimumVertexDistance=function(a){this._minimimVertexDistance=a},ea.prototype.interfaces_=function(){return[]},ea.prototype.getClass=function(){return ea},KF.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(ea,KF);var qt=o(function(){},"Tn"),Yh={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt},qt.toDegrees=function(a){return 180*a/Math.PI},qt.normalize=function(a){for(;a>Math.PI;)a-=qt.PI_TIMES_2;for(;a<=-Math.PI;)a+=qt.PI_TIMES_2;return a},qt.angle=function(){if(arguments.length===1){var a=arguments[0];return Math.atan2(a.y,a.x)}if(arguments.length===2){var u=arguments[0],f=arguments[1],m=f.x-u.x,v=f.y-u.y;return Math.atan2(v,m)}},qt.isAcute=function(a,u,f){var m=a.x-u.x,v=a.y-u.y;return m*(f.x-u.x)+v*(f.y-u.y)>0},qt.isObtuse=function(a,u,f){var m=a.x-u.x,v=a.y-u.y;return m*(f.x-u.x)+v*(f.y-u.y)<0},qt.interiorAngle=function(a,u,f){var m=qt.angle(u,a),v=qt.angle(u,f);return Math.abs(v-m)},qt.normalizePositive=function(a){if(a<0){for(;a<0;)a+=qt.PI_TIMES_2;a>=qt.PI_TIMES_2&&(a=0)}else{for(;a>=qt.PI_TIMES_2;)a-=qt.PI_TIMES_2;a<0&&(a=0)}return a},qt.angleBetween=function(a,u,f){var m=qt.angle(u,a),v=qt.angle(u,f);return qt.diff(m,v)},qt.diff=function(a,u){var f=null;return(f=a<u?u-a:a-u)>Math.PI&&(f=2*Math.PI-f),f},qt.toRadians=function(a){return a*Math.PI/180},qt.getTurn=function(a,u){var f=Math.sin(u-a);return f>0?qt.COUNTERCLOCKWISE:f<0?qt.CLOCKWISE:qt.NONE},qt.angleBetweenOriented=function(a,u,f){var m=qt.angle(u,a),v=qt.angle(u,f)-m;return v<=-Math.PI?v+qt.PI_TIMES_2:v>Math.PI?v-qt.PI_TIMES_2:v},Yh.PI_TIMES_2.get=function(){return 2*Math.PI},Yh.PI_OVER_2.get=function(){return Math.PI/2},Yh.PI_OVER_4.get=function(){return Math.PI/4},Yh.COUNTERCLOCKWISE.get=function(){return ze.COUNTERCLOCKWISE},Yh.CLOCKWISE.get=function(){return ze.CLOCKWISE},Yh.NONE.get=function(){return ze.COLLINEAR},Object.defineProperties(qt,Yh);var Ln=o(function a(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new ct,this._seg1=new ct,this._offset0=new ct,this._offset1=new ct,this._side=0,this._hasNarrowConcaveAngle=!1;var u=arguments[0],f=arguments[1],m=arguments[2];this._precisionModel=u,this._bufParams=f,this._li=new Ro,this._filletAngleQuantum=Math.PI/2/f.getQuadrantSegments(),f.getQuadrantSegments()>=8&&f.getJoinStyle()===Or.JOIN_ROUND&&(this._closingSegLengthFactor=a.MAX_CLOSING_SEG_LEN_FACTOR),this.init(m)},"t"),_b={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};Ln.prototype.addNextSegment=function(a,u){if(this._s0=this._s1,this._s1=this._s2,this._s2=a,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var f=ze.computeOrientation(this._s0,this._s1,this._s2),m=f===ze.CLOCKWISE&&this._side===Ge.LEFT||f===ze.COUNTERCLOCKWISE&&this._side===Ge.RIGHT;f===0?this.addCollinear(u):m?this.addOutsideTurn(f,u):this.addInsideTurn(f,u)},Ln.prototype.addLineEndCap=function(a,u){var f=new ct(a,u),m=new ct;this.computeOffsetSegment(f,Ge.LEFT,this._distance,m);var v=new ct;this.computeOffsetSegment(f,Ge.RIGHT,this._distance,v);var S=u.x-a.x,M=u.y-a.y,B=Math.atan2(M,S);switch(this._bufParams.getEndCapStyle()){case Or.CAP_ROUND:this._segList.addPt(m.p1),this.addFilletArc(u,B+Math.PI/2,B-Math.PI/2,ze.CLOCKWISE,this._distance),this._segList.addPt(v.p1);break;case Or.CAP_FLAT:this._segList.addPt(m.p1),this._segList.addPt(v.p1);break;case Or.CAP_SQUARE:var z=new N;z.x=Math.abs(this._distance)*Math.cos(B),z.y=Math.abs(this._distance)*Math.sin(B);var te=new N(m.p1.x+z.x,m.p1.y+z.y),pe=new N(v.p1.x+z.x,v.p1.y+z.y);this._segList.addPt(te),this._segList.addPt(pe)}},Ln.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Ln.prototype.addMitreJoin=function(a,u,f,m){var v=!0,S=null;try{S=H.intersection(u.p0,u.p1,f.p0,f.p1),(m<=0?1:S.distance(a)/Math.abs(m))>this._bufParams.getMitreLimit()&&(v=!1)}catch(M){if(!(M instanceof je))throw M;S=new N(0,0),v=!1}v?this._segList.addPt(S):this.addLimitedMitreJoin(u,f,m,this._bufParams.getMitreLimit())},Ln.prototype.addFilletCorner=function(a,u,f,m,v){var S=u.x-a.x,M=u.y-a.y,B=Math.atan2(M,S),z=f.x-a.x,te=f.y-a.y,pe=Math.atan2(te,z);m===ze.CLOCKWISE?B<=pe&&(B+=2*Math.PI):B>=pe&&(B-=2*Math.PI),this._segList.addPt(u),this.addFilletArc(a,B,pe,m,v),this._segList.addPt(f)},Ln.prototype.addOutsideTurn=function(a,u){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*Ln.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Or.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Or.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(u&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,a,this._distance),this._segList.addPt(this._offset1.p0))},Ln.prototype.createSquare=function(a){this._segList.addPt(new N(a.x+this._distance,a.y+this._distance)),this._segList.addPt(new N(a.x+this._distance,a.y-this._distance)),this._segList.addPt(new N(a.x-this._distance,a.y-this._distance)),this._segList.addPt(new N(a.x-this._distance,a.y+this._distance)),this._segList.closeRing()},Ln.prototype.addSegments=function(a,u){this._segList.addPts(a,u)},Ln.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},Ln.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},Ln.prototype.initSideSegments=function(a,u,f){this._s1=a,this._s2=u,this._side=f,this._seg1.setCoordinates(a,u),this.computeOffsetSegment(this._seg1,f,this._distance,this._offset1)},Ln.prototype.addLimitedMitreJoin=function(a,u,f,m){var v=this._seg0.p1,S=qt.angle(v,this._seg0.p0),M=qt.angleBetweenOriented(this._seg0.p0,v,this._seg1.p1)/2,B=qt.normalize(S+M),z=qt.normalize(B+Math.PI),te=m*f,pe=f-te*Math.abs(Math.sin(M)),ye=v.x+te*Math.cos(z),Xe=v.y+te*Math.sin(z),Ze=new N(ye,Xe),nt=new ct(v,Ze),mt=nt.pointAlongOffset(1,pe),Zr=nt.pointAlongOffset(1,-pe);this._side===Ge.LEFT?(this._segList.addPt(mt),this._segList.addPt(Zr)):(this._segList.addPt(Zr),this._segList.addPt(mt))},Ln.prototype.computeOffsetSegment=function(a,u,f,m){var v=u===Ge.LEFT?1:-1,S=a.p1.x-a.p0.x,M=a.p1.y-a.p0.y,B=Math.sqrt(S*S+M*M),z=v*f*S/B,te=v*f*M/B;m.p0.x=a.p0.x-te,m.p0.y=a.p0.y+z,m.p1.x=a.p1.x-te,m.p1.y=a.p1.y+z},Ln.prototype.addFilletArc=function(a,u,f,m,v){var S=m===ze.CLOCKWISE?-1:1,M=Math.abs(u-f),B=Math.trunc(M/this._filletAngleQuantum+.5);if(B<1)return null;for(var z=M/B,te=0,pe=new N;te<M;){var ye=u+S*te;pe.x=a.x+v*Math.cos(ye),pe.y=a.y+v*Math.sin(ye),this._segList.addPt(pe),te+=z}},Ln.prototype.addInsideTurn=function(a,u){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*Ln.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var f=new N((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(f);var m=new N((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(m)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},Ln.prototype.createCircle=function(a){var u=new N(a.x+this._distance,a.y);this._segList.addPt(u),this.addFilletArc(a,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Ln.prototype.addBevelJoin=function(a,u){this._segList.addPt(a.p1),this._segList.addPt(u.p0)},Ln.prototype.init=function(a){this._distance=a,this._maxCurveSegmentError=a*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new ea,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(a*Ln.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Ln.prototype.addCollinear=function(a){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===Or.JOIN_BEVEL||this._bufParams.getJoinStyle()===Or.JOIN_MITRE?(a&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,ze.CLOCKWISE,this._distance))},Ln.prototype.closeRing=function(){this._segList.closeRing()},Ln.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Ln.prototype.interfaces_=function(){return[]},Ln.prototype.getClass=function(){return Ln},_b.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},_b.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},_b.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},_b.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Ln,_b);var os=o(function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var a=arguments[0],u=arguments[1];this._precisionModel=a,this._bufParams=u},"Mn");os.prototype.getOffsetCurve=function(a,u){if(this._distance=u,u===0)return null;var f=u<0,m=Math.abs(u),v=this.getSegGen(m);a.length<=1?this.computePointCurve(a[0],v):this.computeOffsetCurve(a,f,v);var S=v.getCoordinates();return f&&F.reverse(S),S},os.prototype.computeSingleSidedBufferCurve=function(a,u,f){var m=this.simplifyTolerance(this._distance);if(u){f.addSegments(a,!0);var v=ei.simplify(a,-m),S=v.length-1;f.initSideSegments(v[S],v[S-1],Ge.LEFT),f.addFirstSegment();for(var M=S-2;M>=0;M--)f.addNextSegment(v[M],!0)}else{f.addSegments(a,!1);var B=ei.simplify(a,m),z=B.length-1;f.initSideSegments(B[0],B[1],Ge.LEFT),f.addFirstSegment();for(var te=2;te<=z;te++)f.addNextSegment(B[te],!0)}f.addLastSegment(),f.closeRing()},os.prototype.computeRingBufferCurve=function(a,u,f){var m=this.simplifyTolerance(this._distance);u===Ge.RIGHT&&(m=-m);var v=ei.simplify(a,m),S=v.length-1;f.initSideSegments(v[S-1],v[0],u);for(var M=1;M<=S;M++){var B=M!==1;f.addNextSegment(v[M],B)}f.closeRing()},os.prototype.computeLineBufferCurve=function(a,u){var f=this.simplifyTolerance(this._distance),m=ei.simplify(a,f),v=m.length-1;u.initSideSegments(m[0],m[1],Ge.LEFT);for(var S=2;S<=v;S++)u.addNextSegment(m[S],!0);u.addLastSegment(),u.addLineEndCap(m[v-1],m[v]);var M=ei.simplify(a,-f),B=M.length-1;u.initSideSegments(M[B],M[B-1],Ge.LEFT);for(var z=B-2;z>=0;z--)u.addNextSegment(M[z],!0);u.addLastSegment(),u.addLineEndCap(M[1],M[0]),u.closeRing()},os.prototype.computePointCurve=function(a,u){switch(this._bufParams.getEndCapStyle()){case Or.CAP_ROUND:u.createCircle(a);break;case Or.CAP_SQUARE:u.createSquare(a)}},os.prototype.getLineCurve=function(a,u){if(this._distance=u,u<0&&!this._bufParams.isSingleSided()||u===0)return null;var f=Math.abs(u),m=this.getSegGen(f);if(a.length<=1)this.computePointCurve(a[0],m);else if(this._bufParams.isSingleSided()){var v=u<0;this.computeSingleSidedBufferCurve(a,v,m)}else this.computeLineBufferCurve(a,m);return m.getCoordinates()},os.prototype.getBufferParameters=function(){return this._bufParams},os.prototype.simplifyTolerance=function(a){return a*this._bufParams.getSimplifyFactor()},os.prototype.getRingCurve=function(a,u,f){if(this._distance=f,a.length<=2)return this.getLineCurve(a,f);if(f===0)return os.copyCoordinates(a);var m=this.getSegGen(f);return this.computeRingBufferCurve(a,u,m),m.getCoordinates()},os.prototype.computeOffsetCurve=function(a,u,f){var m=this.simplifyTolerance(this._distance);if(u){var v=ei.simplify(a,-m),S=v.length-1;f.initSideSegments(v[S],v[S-1],Ge.LEFT),f.addFirstSegment();for(var M=S-2;M>=0;M--)f.addNextSegment(v[M],!0)}else{var B=ei.simplify(a,m),z=B.length-1;f.initSideSegments(B[0],B[1],Ge.LEFT),f.addFirstSegment();for(var te=2;te<=z;te++)f.addNextSegment(B[te],!0)}f.addLastSegment()},os.prototype.getSegGen=function(a){return new Ln(this._precisionModel,this._bufParams,a)},os.prototype.interfaces_=function(){return[]},os.prototype.getClass=function(){return os},os.copyCoordinates=function(a){for(var u=new Array(a.length).fill(null),f=0;f<u.length;f++)u[f]=new N(a[f]);return u};var Zh=o(function(){this._subgraphs=null,this._seg=new ct,this._cga=new ze;var a=arguments[0];this._subgraphs=a},"An"),JF={DepthSegment:{configurable:!0}};Zh.prototype.findStabbedSegments=function(){if(arguments.length===1){for(var a=arguments[0],u=new He,f=this._subgraphs.iterator();f.hasNext();){var m=f.next(),v=m.getEnvelope();a.y<v.getMinY()||a.y>v.getMaxY()||this.findStabbedSegments(a,m.getDirectedEdges(),u)}return u}if(arguments.length===3){if(ne(arguments[2],ts)&&arguments[0]instanceof N&&arguments[1]instanceof cE){for(var S=arguments[0],M=arguments[1],B=arguments[2],z=M.getEdge().getCoordinates(),te=0;te<z.length-1;te++)if(this._seg.p0=z[te],this._seg.p1=z[te+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<S.x)&&!(this._seg.isHorizontal()||S.y<this._seg.p0.y||S.y>this._seg.p1.y||ze.computeOrientation(this._seg.p0,this._seg.p1,S)===ze.RIGHT)){var pe=M.getDepth(Ge.LEFT);this._seg.p0.equals(z[te])||(pe=M.getDepth(Ge.RIGHT));var ye=new bd(this._seg,pe);B.add(ye)}}else if(ne(arguments[2],ts)&&arguments[0]instanceof N&&ne(arguments[1],ts))for(var Xe=arguments[0],Ze=arguments[1],nt=arguments[2],mt=Ze.iterator();mt.hasNext();){var Zr=mt.next();Zr.isForward()&&this.findStabbedSegments(Xe,Zr,nt)}}},Zh.prototype.getDepth=function(a){var u=this.findStabbedSegments(a);return u.size()===0?0:Qa.min(u)._leftDepth},Zh.prototype.interfaces_=function(){return[]},Zh.prototype.getClass=function(){return Zh},JF.DepthSegment.get=function(){return bd},Object.defineProperties(Zh,JF);var bd=o(function(){this._upwardSeg=null,this._leftDepth=null;var a=arguments[0],u=arguments[1];this._upwardSeg=new ct(a),this._leftDepth=u},"Gn");bd.prototype.compareTo=function(a){var u=a;if(this._upwardSeg.minX()>=u._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=u._upwardSeg.minX())return-1;var f=this._upwardSeg.orientationIndex(u._upwardSeg);return f!==0||(f=-1*u._upwardSeg.orientationIndex(this._upwardSeg))!=0?f:this._upwardSeg.compareTo(u._upwardSeg)},bd.prototype.compareX=function(a,u){var f=a.p0.compareTo(u.p0);return f!==0?f:a.p1.compareTo(u.p1)},bd.prototype.toString=function(){return this._upwardSeg.toString()},bd.prototype.interfaces_=function(){return[j]},bd.prototype.getClass=function(){return bd};var Lr=o(function(a,u,f){this.p0=a||null,this.p1=u||null,this.p2=f||null},"qn");Lr.prototype.area=function(){return Lr.area(this.p0,this.p1,this.p2)},Lr.prototype.signedArea=function(){return Lr.signedArea(this.p0,this.p1,this.p2)},Lr.prototype.interpolateZ=function(a){if(a===null)throw new D("Supplied point is null.");return Lr.interpolateZ(a,this.p0,this.p1,this.p2)},Lr.prototype.longestSideLength=function(){return Lr.longestSideLength(this.p0,this.p1,this.p2)},Lr.prototype.isAcute=function(){return Lr.isAcute(this.p0,this.p1,this.p2)},Lr.prototype.circumcentre=function(){return Lr.circumcentre(this.p0,this.p1,this.p2)},Lr.prototype.area3D=function(){return Lr.area3D(this.p0,this.p1,this.p2)},Lr.prototype.centroid=function(){return Lr.centroid(this.p0,this.p1,this.p2)},Lr.prototype.inCentre=function(){return Lr.inCentre(this.p0,this.p1,this.p2)},Lr.prototype.interfaces_=function(){return[]},Lr.prototype.getClass=function(){return Lr},Lr.area=function(a,u,f){return Math.abs(((f.x-a.x)*(u.y-a.y)-(u.x-a.x)*(f.y-a.y))/2)},Lr.signedArea=function(a,u,f){return((f.x-a.x)*(u.y-a.y)-(u.x-a.x)*(f.y-a.y))/2},Lr.det=function(a,u,f,m){return a*m-u*f},Lr.interpolateZ=function(a,u,f,m){var v=u.x,S=u.y,M=f.x-v,B=m.x-v,z=f.y-S,te=m.y-S,pe=M*te-B*z,ye=a.x-v,Xe=a.y-S,Ze=(te*ye-B*Xe)/pe,nt=(-z*ye+M*Xe)/pe;return u.z+Ze*(f.z-u.z)+nt*(m.z-u.z)},Lr.longestSideLength=function(a,u,f){var m=a.distance(u),v=u.distance(f),S=f.distance(a),M=m;return v>M&&(M=v),S>M&&(M=S),M},Lr.isAcute=function(a,u,f){return!!qt.isAcute(a,u,f)&&!!qt.isAcute(u,f,a)&&!!qt.isAcute(f,a,u)},Lr.circumcentre=function(a,u,f){var m=f.x,v=f.y,S=a.x-m,M=a.y-v,B=u.x-m,z=u.y-v,te=2*Lr.det(S,M,B,z),pe=Lr.det(M,S*S+M*M,z,B*B+z*z),ye=Lr.det(S,S*S+M*M,B,B*B+z*z);return new N(m-pe/te,v+ye/te)},Lr.perpendicularBisector=function(a,u){var f=u.x-a.x,m=u.y-a.y,v=new H(a.x+f/2,a.y+m/2,1),S=new H(a.x-m+f/2,a.y+f+m/2,1);return new H(v,S)},Lr.angleBisector=function(a,u,f){var m=u.distance(a),v=m/(m+u.distance(f)),S=f.x-a.x,M=f.y-a.y;return new N(a.x+v*S,a.y+v*M)},Lr.area3D=function(a,u,f){var m=u.x-a.x,v=u.y-a.y,S=u.z-a.z,M=f.x-a.x,B=f.y-a.y,z=f.z-a.z,te=v*z-S*B,pe=S*M-m*z,ye=m*B-v*M,Xe=te*te+pe*pe+ye*ye,Ze=Math.sqrt(Xe)/2;return Ze},Lr.centroid=function(a,u,f){var m=(a.x+u.x+f.x)/3,v=(a.y+u.y+f.y)/3;return new N(m,v)},Lr.inCentre=function(a,u,f){var m=u.distance(f),v=a.distance(f),S=a.distance(u),M=m+v+S,B=(m*a.x+v*u.x+S*f.x)/M,z=(m*a.y+v*u.y+S*f.y)/M;return new N(B,z)};var Pa=o(function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new He;var a=arguments[0],u=arguments[1],f=arguments[2];this._inputGeom=a,this._distance=u,this._curveBuilder=f},"Bn");Pa.prototype.addPoint=function(a){if(this._distance<=0)return null;var u=a.getCoordinates(),f=this._curveBuilder.getLineCurve(u,this._distance);this.addCurve(f,U.EXTERIOR,U.INTERIOR)},Pa.prototype.addPolygon=function(a){var u=this._distance,f=Ge.LEFT;this._distance<0&&(u=-this._distance,f=Ge.RIGHT);var m=a.getExteriorRing(),v=F.removeRepeatedPoints(m.getCoordinates());if(this._distance<0&&this.isErodedCompletely(m,this._distance)||this._distance<=0&&v.length<3)return null;this.addPolygonRing(v,u,f,U.EXTERIOR,U.INTERIOR);for(var S=0;S<a.getNumInteriorRing();S++){var M=a.getInteriorRingN(S),B=F.removeRepeatedPoints(M.getCoordinates());this._distance>0&&this.isErodedCompletely(M,-this._distance)||this.addPolygonRing(B,u,Ge.opposite(f),U.INTERIOR,U.EXTERIOR)}},Pa.prototype.isTriangleErodedCompletely=function(a,u){var f=new Lr(a[0],a[1],a[2]),m=f.inCentre();return ze.distancePointLine(m,f.p0,f.p1)<Math.abs(u)},Pa.prototype.addLineString=function(a){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var u=F.removeRepeatedPoints(a.getCoordinates()),f=this._curveBuilder.getLineCurve(u,this._distance);this.addCurve(f,U.EXTERIOR,U.INTERIOR)},Pa.prototype.addCurve=function(a,u,f){if(a===null||a.length<2)return null;var m=new li(a,new Yr(0,U.BOUNDARY,u,f));this._curveList.add(m)},Pa.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Pa.prototype.addPolygonRing=function(a,u,f,m,v){if(u===0&&a.length<ns.MINIMUM_VALID_SIZE)return null;var S=m,M=v;a.length>=ns.MINIMUM_VALID_SIZE&&ze.isCCW(a)&&(S=v,M=m,f=Ge.opposite(f));var B=this._curveBuilder.getRingCurve(a,f,u);this.addCurve(B,S,M)},Pa.prototype.add=function(a){if(a.isEmpty())return null;a instanceof Xr?this.addPolygon(a):a instanceof Gt?this.addLineString(a):a instanceof jn?this.addPoint(a):a instanceof Es?this.addCollection(a):a instanceof dn?this.addCollection(a):a instanceof Ka?this.addCollection(a):a instanceof xt&&this.addCollection(a)},Pa.prototype.isErodedCompletely=function(a,u){var f=a.getCoordinates();if(f.length<4)return u<0;if(f.length===4)return this.isTriangleErodedCompletely(f,u);var m=a.getEnvelopeInternal(),v=Math.min(m.getHeight(),m.getWidth());return u<0&&2*Math.abs(u)>v},Pa.prototype.addCollection=function(a){for(var u=0;u<a.getNumGeometries();u++){var f=a.getGeometryN(u);this.add(f)}},Pa.prototype.interfaces_=function(){return[]},Pa.prototype.getClass=function(){return Pa};var Hy=o(function(){},"Vn");Hy.prototype.locate=function(a){},Hy.prototype.interfaces_=function(){return[]},Hy.prototype.getClass=function(){return Hy};var mu=o(function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var a=arguments[0];this._parent=a,this._atStart=!0,this._index=0,this._max=a.getNumGeometries()},"Un");mu.prototype.next=function(){if(this._atStart)return this._atStart=!1,mu.isAtomic(this._parent)&&this._index++,this._parent;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new n;var a=this._parent.getGeometryN(this._index++);return a instanceof xt?(this._subcollectionIterator=new mu(a),this._subcollectionIterator.next()):a},mu.prototype.remove=function(){throw new Error(this.getClass().getName())},mu.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},mu.prototype.interfaces_=function(){return[yc]},mu.prototype.getClass=function(){return mu},mu.isAtomic=function(a){return!(a instanceof xt)};var ta=o(function(){this._geom=null;var a=arguments[0];this._geom=a},"zn");ta.prototype.locate=function(a){return ta.locate(a,this._geom)},ta.prototype.interfaces_=function(){return[Hy]},ta.prototype.getClass=function(){return ta},ta.isPointInRing=function(a,u){return!!u.getEnvelopeInternal().intersects(a)&&ze.isPointInRing(a,u.getCoordinates())},ta.containsPointInPolygon=function(a,u){if(u.isEmpty())return!1;var f=u.getExteriorRing();if(!ta.isPointInRing(a,f))return!1;for(var m=0;m<u.getNumInteriorRing();m++){var v=u.getInteriorRingN(m);if(ta.isPointInRing(a,v))return!1}return!0},ta.containsPoint=function(a,u){if(u instanceof Xr)return ta.containsPointInPolygon(a,u);if(u instanceof xt)for(var f=new mu(u);f.hasNext();){var m=f.next();if(m!==u&&ta.containsPoint(a,m))return!0}return!1},ta.locate=function(a,u){return u.isEmpty()?U.EXTERIOR:ta.containsPoint(a,u)?U.INTERIOR:U.EXTERIOR};var xo=o(function(){this._edgeMap=new b,this._edgeList=null,this._ptInAreaLocation=[U.NONE,U.NONE]},"Xn");xo.prototype.getNextCW=function(a){this.getEdges();var u=this._edgeList.indexOf(a),f=u-1;return u===0&&(f=this._edgeList.size()-1),this._edgeList.get(f)},xo.prototype.propagateSideLabels=function(a){for(var u=U.NONE,f=this.iterator();f.hasNext();){var m=f.next().getLabel();m.isArea(a)&&m.getLocation(a,Ge.LEFT)!==U.NONE&&(u=m.getLocation(a,Ge.LEFT))}if(u===U.NONE)return null;for(var v=u,S=this.iterator();S.hasNext();){var M=S.next(),B=M.getLabel();if(B.getLocation(a,Ge.ON)===U.NONE&&B.setLocation(a,Ge.ON,v),B.isArea(a)){var z=B.getLocation(a,Ge.LEFT),te=B.getLocation(a,Ge.RIGHT);if(te!==U.NONE){if(te!==v)throw new bc("side location conflict",M.getCoordinate());z===U.NONE&&ot.shouldNeverReachHere("found single null side (at "+M.getCoordinate()+")"),v=z}else ot.isTrue(B.getLocation(a,Ge.LEFT)===U.NONE,"found single null side"),B.setLocation(a,Ge.RIGHT,v),B.setLocation(a,Ge.LEFT,v)}}},xo.prototype.getCoordinate=function(){var a=this.iterator();return a.hasNext()?a.next().getCoordinate():null},xo.prototype.print=function(a){Se.out.println("EdgeEndStar: "+this.getCoordinate());for(var u=this.iterator();u.hasNext();)u.next().print(a)},xo.prototype.isAreaLabelsConsistent=function(a){return this.computeEdgeEndLabels(a.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},xo.prototype.checkAreaLabelsConsistent=function(a){var u=this.getEdges();if(u.size()<=0)return!0;var f=u.size()-1,m=u.get(f).getLabel().getLocation(a,Ge.LEFT);ot.isTrue(m!==U.NONE,"Found unlabelled area edge");for(var v=m,S=this.iterator();S.hasNext();){var M=S.next().getLabel();ot.isTrue(M.isArea(a),"Found non-area edge");var B=M.getLocation(a,Ge.LEFT),z=M.getLocation(a,Ge.RIGHT);if(B===z||z!==v)return!1;v=B}return!0},xo.prototype.findIndex=function(a){this.iterator();for(var u=0;u<this._edgeList.size();u++)if(this._edgeList.get(u)===a)return u;return-1},xo.prototype.iterator=function(){return this.getEdges().iterator()},xo.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new He(this._edgeMap.values())),this._edgeList},xo.prototype.getLocation=function(a,u,f){return this._ptInAreaLocation[a]===U.NONE&&(this._ptInAreaLocation[a]=ta.locate(u,f[a].getGeometry())),this._ptInAreaLocation[a]},xo.prototype.toString=function(){var a=new Ue;a.append("EdgeEndStar: "+this.getCoordinate()),a.append("\n");for(var u=this.iterator();u.hasNext();){var f=u.next();a.append(f),a.append("\n")}return a.toString()},xo.prototype.computeEdgeEndLabels=function(a){for(var u=this.iterator();u.hasNext();)u.next().computeLabel(a)},xo.prototype.computeLabelling=function(a){this.computeEdgeEndLabels(a[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var u=[!1,!1],f=this.iterator();f.hasNext();)for(var m=f.next().getLabel(),v=0;v<2;v++)m.isLine(v)&&m.getLocation(v)===U.BOUNDARY&&(u[v]=!0);for(var S=this.iterator();S.hasNext();)for(var M=S.next(),B=M.getLabel(),z=0;z<2;z++)if(B.isAnyNull(z)){var te=U.NONE;if(u[z])te=U.EXTERIOR;else{var pe=M.getCoordinate();te=this.getLocation(z,pe,a)}B.setAllLocationsIfNull(z,te)}},xo.prototype.getDegree=function(){return this._edgeMap.size()},xo.prototype.insertEdgeEnd=function(a,u){this._edgeMap.put(a,u),this._edgeList=null},xo.prototype.interfaces_=function(){return[]},xo.prototype.getClass=function(){return xo};var Rse=function(a){function u(){a.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var f=null,m=null,v=this._SCANNING_FOR_INCOMING,S=0;S<this._resultAreaEdgeList.size();S++){var M=this._resultAreaEdgeList.get(S),B=M.getSym();if(M.getLabel().isArea())switch(f===null&&M.isInResult()&&(f=M),v){case this._SCANNING_FOR_INCOMING:if(!B.isInResult())continue;m=B,v=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!M.isInResult())continue;m.setNext(M),v=this._SCANNING_FOR_INCOMING}}if(v===this._LINKING_TO_OUTGOING){if(f===null)throw new bc("no outgoing dirEdge found",this.getCoordinate());ot.isTrue(f.isInResult(),"unable to link last incoming dirEdge"),m.setNext(f)}},u.prototype.insert=function(f){var m=f;this.insertEdgeEnd(m,m)},u.prototype.getRightmostEdge=function(){var f=this.getEdges(),m=f.size();if(m<1)return null;var v=f.get(0);if(m===1)return v;var S=f.get(m-1),M=v.getQuadrant(),B=S.getQuadrant();return hn.isNorthern(M)&&hn.isNorthern(B)?v:hn.isNorthern(M)||hn.isNorthern(B)?v.getDy()!==0?v:S.getDy()!==0?S:(ot.shouldNeverReachHere("found two horizontal edges incident on node"),null):S},u.prototype.print=function(f){Se.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var m=this.iterator();m.hasNext();){var v=m.next();f.print("out "),v.print(f),f.println(),f.print("in "),v.getSym().print(f),f.println()}},u.prototype.getResultAreaEdges=function(){if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new He;for(var f=this.iterator();f.hasNext();){var m=f.next();(m.isInResult()||m.getSym().isInResult())&&this._resultAreaEdgeList.add(m)}return this._resultAreaEdgeList},u.prototype.updateLabelling=function(f){for(var m=this.iterator();m.hasNext();){var v=m.next().getLabel();v.setAllLocationsIfNull(0,f.getLocation(0)),v.setAllLocationsIfNull(1,f.getLocation(1))}},u.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var f=null,m=null,v=this._edgeList.size()-1;v>=0;v--){var S=this._edgeList.get(v),M=S.getSym();m===null&&(m=M),f!==null&&M.setNext(f),f=S}m.setNext(f)},u.prototype.computeDepths=function(){if(arguments.length===1){var f=arguments[0],m=this.findIndex(f),v=f.getDepth(Ge.LEFT),S=f.getDepth(Ge.RIGHT),M=this.computeDepths(m+1,this._edgeList.size(),v);if(this.computeDepths(0,m,M)!==S)throw new bc("depth mismatch at "+f.getCoordinate())}else if(arguments.length===3){for(var B=arguments[0],z=arguments[1],te=arguments[2],pe=B;pe<z;pe++){var ye=this._edgeList.get(pe);ye.setEdgeDepths(Ge.RIGHT,te),te=ye.getDepth(Ge.LEFT)}return te}},u.prototype.mergeSymLabels=function(){for(var f=this.iterator();f.hasNext();){var m=f.next();m.getLabel().merge(m.getSym().getLabel())}},u.prototype.linkMinimalDirectedEdges=function(f){for(var m=null,v=null,S=this._SCANNING_FOR_INCOMING,M=this._resultAreaEdgeList.size()-1;M>=0;M--){var B=this._resultAreaEdgeList.get(M),z=B.getSym();switch(m===null&&B.getEdgeRing()===f&&(m=B),S){case this._SCANNING_FOR_INCOMING:if(z.getEdgeRing()!==f)continue;v=z,S=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(B.getEdgeRing()!==f)continue;v.setNextMin(B),S=this._SCANNING_FOR_INCOMING}}S===this._LINKING_TO_OUTGOING&&(ot.isTrue(m!==null,"found null for first outgoing dirEdge"),ot.isTrue(m.getEdgeRing()===f,"unable to link last incoming dirEdge"),v.setNextMin(m))},u.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var f=0,m=this.iterator();m.hasNext();)m.next().isInResult()&&f++;return f}if(arguments.length===1){for(var v=arguments[0],S=0,M=this.iterator();M.hasNext();)M.next().getEdgeRing()===v&&S++;return S}},u.prototype.getLabel=function(){return this._label},u.prototype.findCoveredLineEdges=function(){for(var f=U.NONE,m=this.iterator();m.hasNext();){var v=m.next(),S=v.getSym();if(!v.isLineEdge()){if(v.isInResult()){f=U.INTERIOR;break}if(S.isInResult()){f=U.EXTERIOR;break}}}if(f===U.NONE)return null;for(var M=f,B=this.iterator();B.hasNext();){var z=B.next(),te=z.getSym();z.isLineEdge()?z.getEdge().setCovered(M===U.INTERIOR):(z.isInResult()&&(M=U.EXTERIOR),te.isInResult()&&(M=U.INTERIOR))}},u.prototype.computeLabelling=function(f){a.prototype.computeLabelling.call(this,f),this._label=new Yr(U.NONE);for(var m=this.iterator();m.hasNext();)for(var v=m.next().getEdge().getLabel(),S=0;S<2;S++){var M=v.getLocation(S);M!==U.INTERIOR&&M!==U.BOUNDARY||this._label.setLocation(S,U.INTERIOR)}},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(xo),QF=function(a){function u(){a.apply(this,arguments)}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.createNode=function(f){return new J_(f,new Rse)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(Vy),Bp=o(function a(){this._pts=null,this._orientation=null;var u=arguments[0];this._pts=u,this._orientation=a.orientation(u)},"t");Bp.prototype.compareTo=function(a){var u=a;return Bp.compareOriented(this._pts,this._orientation,u._pts,u._orientation)},Bp.prototype.interfaces_=function(){return[j]},Bp.prototype.getClass=function(){return Bp},Bp.orientation=function(a){return F.increasingDirection(a)===1},Bp.compareOriented=function(a,u,f,m){for(var v=u?1:-1,S=m?1:-1,M=u?a.length:-1,B=m?f.length:-1,z=u?0:a.length-1,te=m?0:f.length-1;;){var pe=a[z].compareTo(f[te]);if(pe!==0)return pe;var ye=(z+=v)===M,Xe=(te+=S)===B;if(ye&&!Xe)return-1;if(!ye&&Xe)return 1;if(ye&&Xe)return 0}};var el=o(function(){this._edges=new He,this._ocaMap=new b},"Hn");el.prototype.print=function(a){a.print("MULTILINESTRING ( ");for(var u=0;u<this._edges.size();u++){var f=this._edges.get(u);u>0&&a.print(","),a.print("(");for(var m=f.getCoordinates(),v=0;v<m.length;v++)v>0&&a.print(","),a.print(m[v].x+" "+m[v].y);a.println(")")}a.print(") ")},el.prototype.addAll=function(a){for(var u=a.iterator();u.hasNext();)this.add(u.next())},el.prototype.findEdgeIndex=function(a){for(var u=0;u<this._edges.size();u++)if(this._edges.get(u).equals(a))return u;return-1},el.prototype.iterator=function(){return this._edges.iterator()},el.prototype.getEdges=function(){return this._edges},el.prototype.get=function(a){return this._edges.get(a)},el.prototype.findEqualEdge=function(a){var u=new Bp(a.getCoordinates());return this._ocaMap.get(u)},el.prototype.add=function(a){this._edges.add(a);var u=new Bp(a.getCoordinates());this._ocaMap.put(u,a)},el.prototype.interfaces_=function(){return[]},el.prototype.getClass=function(){return el};var xd=o(function(){},"Wn");xd.prototype.processIntersections=function(a,u,f,m){},xd.prototype.isDone=function(){},xd.prototype.interfaces_=function(){return[]},xd.prototype.getClass=function(){return xd};var ra=o(function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var a=arguments[0];this._li=a},"Kn");ra.prototype.isTrivialIntersection=function(a,u,f,m){if(a===f&&this._li.getIntersectionNum()===1){if(ra.isAdjacentSegments(u,m))return!0;if(a.isClosed()){var v=a.size()-1;if(u===0&&m===v||m===0&&u===v)return!0}}return!1},ra.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},ra.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},ra.prototype.getLineIntersector=function(){return this._li},ra.prototype.hasProperIntersection=function(){return this._hasProper},ra.prototype.processIntersections=function(a,u,f,m){if(a===f&&u===m)return null;this.numTests++;var v=a.getCoordinates()[u],S=a.getCoordinates()[u+1],M=f.getCoordinates()[m],B=f.getCoordinates()[m+1];this._li.computeIntersection(v,S,M,B),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(a,u,f,m)||(this._hasIntersection=!0,a.addIntersections(this._li,u,0),f.addIntersections(this._li,m,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},ra.prototype.hasIntersection=function(){return this._hasIntersection},ra.prototype.isDone=function(){return!1},ra.prototype.hasInteriorIntersection=function(){return this._hasInterior},ra.prototype.interfaces_=function(){return[xd]},ra.prototype.getClass=function(){return ra},ra.isAdjacentSegments=function(a,u){return Math.abs(a-u)===1};var wl=o(function(){this.coord=null,this.segmentIndex=null,this.dist=null;var a=arguments[0],u=arguments[1],f=arguments[2];this.coord=new N(a),this.segmentIndex=u,this.dist=f},"Jn");wl.prototype.getSegmentIndex=function(){return this.segmentIndex},wl.prototype.getCoordinate=function(){return this.coord},wl.prototype.print=function(a){a.print(this.coord),a.print(" seg # = "+this.segmentIndex),a.println(" dist = "+this.dist)},wl.prototype.compareTo=function(a){var u=a;return this.compare(u.segmentIndex,u.dist)},wl.prototype.isEndPoint=function(a){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===a},wl.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},wl.prototype.getDistance=function(){return this.dist},wl.prototype.compare=function(a,u){return this.segmentIndex<a?-1:this.segmentIndex>a?1:this.dist<u?-1:this.dist>u?1:0},wl.prototype.interfaces_=function(){return[j]},wl.prototype.getClass=function(){return wl};var gu=o(function(){this._nodeMap=new b,this.edge=null;var a=arguments[0];this.edge=a},"Qn");gu.prototype.print=function(a){a.println("Intersections:");for(var u=this.iterator();u.hasNext();)u.next().print(a)},gu.prototype.iterator=function(){return this._nodeMap.values().iterator()},gu.prototype.addSplitEdges=function(a){this.addEndpoints();for(var u=this.iterator(),f=u.next();u.hasNext();){var m=u.next(),v=this.createSplitEdge(f,m);a.add(v),f=m}},gu.prototype.addEndpoints=function(){var a=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[a],a,0)},gu.prototype.createSplitEdge=function(a,u){var f=u.segmentIndex-a.segmentIndex+2,m=this.edge.pts[u.segmentIndex],v=u.dist>0||!u.coord.equals2D(m);v||f--;var S=new Array(f).fill(null),M=0;S[M++]=new N(a.coord);for(var B=a.segmentIndex+1;B<=u.segmentIndex;B++)S[M++]=this.edge.pts[B];return v&&(S[M]=u.coord),new eS(S,new Yr(this.edge._label))},gu.prototype.add=function(a,u,f){var m=new wl(a,u,f),v=this._nodeMap.get(m);return v!==null?v:(this._nodeMap.put(m,m),m)},gu.prototype.isIntersection=function(a){for(var u=this.iterator();u.hasNext();)if(u.next().coord.equals(a))return!0;return!1},gu.prototype.interfaces_=function(){return[]},gu.prototype.getClass=function(){return gu};var Id=o(function(){},"Zn");Id.prototype.getChainStartIndices=function(a){var u=0,f=new He;f.add(new _e(u));do{var m=this.findChainEnd(a,u);f.add(new _e(m)),u=m}while(u<a.length-1);return Id.toIntArray(f)},Id.prototype.findChainEnd=function(a,u){for(var f=hn.quadrant(a[u],a[u+1]),m=u+1;m<a.length&&hn.quadrant(a[m-1],a[m])===f;)m++;return m-1},Id.prototype.interfaces_=function(){return[]},Id.prototype.getClass=function(){return Id},Id.toIntArray=function(a){for(var u=new Array(a.size()).fill(null),f=0;f<u.length;f++)u[f]=a.get(f).intValue();return u};var _c=o(function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new ie,this.env2=new ie;var a=arguments[0];this.e=a,this.pts=a.getCoordinates();var u=new Id;this.startIndex=u.getChainStartIndices(this.pts)},"$n");_c.prototype.getCoordinates=function(){return this.pts},_c.prototype.getMaxX=function(a){var u=this.pts[this.startIndex[a]].x,f=this.pts[this.startIndex[a+1]].x;return u>f?u:f},_c.prototype.getMinX=function(a){var u=this.pts[this.startIndex[a]].x,f=this.pts[this.startIndex[a+1]].x;return u<f?u:f},_c.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var a=arguments[0],u=arguments[1],f=arguments[2],m=arguments[3];this.computeIntersectsForChain(this.startIndex[a],this.startIndex[a+1],u,u.startIndex[f],u.startIndex[f+1],m)}else if(arguments.length===6){var v=arguments[0],S=arguments[1],M=arguments[2],B=arguments[3],z=arguments[4],te=arguments[5],pe=this.pts[v],ye=this.pts[S],Xe=M.pts[B],Ze=M.pts[z];if(S-v==1&&z-B==1)return te.addIntersections(this.e,v,M.e,B),null;if(this.env1.init(pe,ye),this.env2.init(Xe,Ze),!this.env1.intersects(this.env2))return null;var nt=Math.trunc((v+S)/2),mt=Math.trunc((B+z)/2);v<nt&&(B<mt&&this.computeIntersectsForChain(v,nt,M,B,mt,te),mt<z&&this.computeIntersectsForChain(v,nt,M,mt,z,te)),nt<S&&(B<mt&&this.computeIntersectsForChain(nt,S,M,B,mt,te),mt<z&&this.computeIntersectsForChain(nt,S,M,mt,z,te))}},_c.prototype.getStartIndexes=function(){return this.startIndex},_c.prototype.computeIntersects=function(a,u){for(var f=0;f<this.startIndex.length-1;f++)for(var m=0;m<a.startIndex.length-1;m++)this.computeIntersectsForChain(f,a,m,u)},_c.prototype.interfaces_=function(){return[]},_c.prototype.getClass=function(){return _c};var io=o(function a(){this._depth=Array(2).fill().map(function(){return Array(3)});for(var u=0;u<2;u++)for(var f=0;f<3;f++)this._depth[u][f]=a.NULL_VALUE},"t"),eN={NULL_VALUE:{configurable:!0}};io.prototype.getDepth=function(a,u){return this._depth[a][u]},io.prototype.setDepth=function(a,u,f){this._depth[a][u]=f},io.prototype.isNull=function(){if(arguments.length===0){for(var a=0;a<2;a++)for(var u=0;u<3;u++)if(this._depth[a][u]!==io.NULL_VALUE)return!1;return!0}if(arguments.length===1){var f=arguments[0];return this._depth[f][1]===io.NULL_VALUE}if(arguments.length===2){var m=arguments[0],v=arguments[1];return this._depth[m][v]===io.NULL_VALUE}},io.prototype.normalize=function(){for(var a=0;a<2;a++)if(!this.isNull(a)){var u=this._depth[a][1];this._depth[a][2]<u&&(u=this._depth[a][2]),u<0&&(u=0);for(var f=1;f<3;f++){var m=0;this._depth[a][f]>u&&(m=1),this._depth[a][f]=m}}},io.prototype.getDelta=function(a){return this._depth[a][Ge.RIGHT]-this._depth[a][Ge.LEFT]},io.prototype.getLocation=function(a,u){return this._depth[a][u]<=0?U.EXTERIOR:U.INTERIOR},io.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},io.prototype.add=function(){if(arguments.length===1)for(var a=arguments[0],u=0;u<2;u++)for(var f=1;f<3;f++){var m=a.getLocation(u,f);m!==U.EXTERIOR&&m!==U.INTERIOR||(this.isNull(u,f)?this._depth[u][f]=io.depthAtLocation(m):this._depth[u][f]+=io.depthAtLocation(m))}else if(arguments.length===3){var v=arguments[0],S=arguments[1];arguments[2]===U.INTERIOR&&this._depth[v][S]++}},io.prototype.interfaces_=function(){return[]},io.prototype.getClass=function(){return io},io.depthAtLocation=function(a){return a===U.EXTERIOR?0:a===U.INTERIOR?1:io.NULL_VALUE},eN.NULL_VALUE.get=function(){return-1},Object.defineProperties(io,eN);var eS=function(a){function u(){if(a.call(this),this.pts=null,this._env=null,this.eiList=new gu(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new io,this._depthDelta=0,arguments.length===1){var f=arguments[0];u.call(this,f,null)}else if(arguments.length===2){var m=arguments[0],v=arguments[1];this.pts=m,this._label=v}}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.getDepth=function(){return this._depth},u.prototype.getCollapsedEdge=function(){var f=new Array(2).fill(null);return f[0]=this.pts[0],f[1]=this.pts[1],new u(f,Yr.toLineLabel(this._label))},u.prototype.isIsolated=function(){return this._isIsolated},u.prototype.getCoordinates=function(){return this.pts},u.prototype.setIsolated=function(f){this._isIsolated=f},u.prototype.setName=function(f){this._name=f},u.prototype.equals=function(f){if(!(f instanceof u))return!1;var m=f;if(this.pts.length!==m.pts.length)return!1;for(var v=!0,S=!0,M=this.pts.length,B=0;B<this.pts.length;B++)if(this.pts[B].equals2D(m.pts[B])||(v=!1),this.pts[B].equals2D(m.pts[--M])||(S=!1),!v&&!S)return!1;return!0},u.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var f=arguments[0];return this.pts[f]}},u.prototype.print=function(f){f.print("edge "+this._name+": "),f.print("LINESTRING (");for(var m=0;m<this.pts.length;m++)m>0&&f.print(","),f.print(this.pts[m].x+" "+this.pts[m].y);f.print(") "+this._label+" "+this._depthDelta)},u.prototype.computeIM=function(f){u.updateIM(this._label,f)},u.prototype.isCollapsed=function(){return!!this._label.isArea()&&this.pts.length===3&&!!this.pts[0].equals(this.pts[2])},u.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},u.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},u.prototype.getDepthDelta=function(){return this._depthDelta},u.prototype.getNumPoints=function(){return this.pts.length},u.prototype.printReverse=function(f){f.print("edge "+this._name+": ");for(var m=this.pts.length-1;m>=0;m--)f.print(this.pts[m]+" ");f.println("")},u.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new _c(this)),this._mce},u.prototype.getEnvelope=function(){if(this._env===null){this._env=new ie;for(var f=0;f<this.pts.length;f++)this._env.expandToInclude(this.pts[f])}return this._env},u.prototype.addIntersection=function(f,m,v,S){var M=new N(f.getIntersection(S)),B=m,z=f.getEdgeDistance(v,S),te=B+1;if(te<this.pts.length){var pe=this.pts[te];M.equals2D(pe)&&(B=te,z=0)}this.eiList.add(M,B,z)},u.prototype.toString=function(){var f=new Ue;f.append("edge "+this._name+": "),f.append("LINESTRING (");for(var m=0;m<this.pts.length;m++)m>0&&f.append(","),f.append(this.pts[m].x+" "+this.pts[m].y);return f.append(") "+this._label+" "+this._depthDelta),f.toString()},u.prototype.isPointwiseEqual=function(f){if(this.pts.length!==f.pts.length)return!1;for(var m=0;m<this.pts.length;m++)if(!this.pts[m].equals2D(f.pts[m]))return!1;return!0},u.prototype.setDepthDelta=function(f){this._depthDelta=f},u.prototype.getEdgeIntersectionList=function(){return this.eiList},u.prototype.addIntersections=function(f,m,v){for(var S=0;S<f.getIntersectionNum();S++)this.addIntersection(f,m,v,S)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u.updateIM=function(){if(arguments.length!==2)return a.prototype.updateIM.apply(this,arguments);var f=arguments[0],m=arguments[1];m.setAtLeastIfValid(f.getLocation(0,Ge.ON),f.getLocation(1,Ge.ON),1),f.isArea()&&(m.setAtLeastIfValid(f.getLocation(0,Ge.LEFT),f.getLocation(1,Ge.LEFT),2),m.setAtLeastIfValid(f.getLocation(0,Ge.RIGHT),f.getLocation(1,Ge.RIGHT),2))},u}(Qs),jo=o(function(a){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new el,this._bufParams=a||null},"ii");jo.prototype.setWorkingPrecisionModel=function(a){this._workingPrecisionModel=a},jo.prototype.insertUniqueEdge=function(a){var u=this._edgeList.findEqualEdge(a);if(u!==null){var f=u.getLabel(),m=a.getLabel();u.isPointwiseEqual(a)||(m=new Yr(a.getLabel())).flip(),f.merge(m);var v=jo.depthDelta(m),S=u.getDepthDelta()+v;u.setDepthDelta(S)}else this._edgeList.add(a),a.setDepthDelta(jo.depthDelta(a.getLabel()))},jo.prototype.buildSubgraphs=function(a,u){for(var f=new He,m=a.iterator();m.hasNext();){var v=m.next(),S=v.getRightmostCoordinate(),M=new Zh(f).getDepth(S);v.computeDepth(M),v.findResultEdges(),f.add(v),u.add(v.getDirectedEdges(),v.getNodes())}},jo.prototype.createSubgraphs=function(a){for(var u=new He,f=a.getNodes().iterator();f.hasNext();){var m=f.next();if(!m.isVisited()){var v=new Bo;v.create(m),u.add(v)}}return Qa.sort(u,Qa.reverseOrder()),u},jo.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},jo.prototype.getNoder=function(a){if(this._workingNoder!==null)return this._workingNoder;var u=new pE,f=new Ro;return f.setPrecisionModel(a),u.setSegmentIntersector(new ra(f)),u},jo.prototype.buffer=function(a,u){var f=this._workingPrecisionModel;f===null&&(f=a.getPrecisionModel()),this._geomFact=a.getFactory();var m=new os(f,this._bufParams),v=new Pa(a,u,m).getCurves();if(v.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(v,f),this._graph=new Zn(new QF),this._graph.addEdges(this._edgeList.getEdges());var S=this.createSubgraphs(this._graph),M=new Os(this._geomFact);this.buildSubgraphs(S,M);var B=M.getPolygons();return B.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(B)},jo.prototype.computeNodedEdges=function(a,u){var f=this.getNoder(u);f.computeNodes(a);for(var m=f.getNodedSubstrings().iterator();m.hasNext();){var v=m.next(),S=v.getCoordinates();if(S.length!==2||!S[0].equals2D(S[1])){var M=v.getData(),B=new eS(v.getCoordinates(),new Yr(M));this.insertUniqueEdge(B)}}},jo.prototype.setNoder=function(a){this._workingNoder=a},jo.prototype.interfaces_=function(){return[]},jo.prototype.getClass=function(){return jo},jo.depthDelta=function(a){var u=a.getLocation(0,Ge.LEFT),f=a.getLocation(0,Ge.RIGHT);return u===U.INTERIOR&&f===U.EXTERIOR?1:u===U.EXTERIOR&&f===U.INTERIOR?-1:0},jo.convertSegStrings=function(a){for(var u=new $t,f=new He;a.hasNext();){var m=a.next(),v=u.createLineString(m.getCoordinates());f.add(v)}return u.buildGeometry(f)};var $p=o(function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var a=arguments[0],u=arguments[1];this._noder=a,this._scaleFactor=u,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(arguments.length===4){var f=arguments[0],m=arguments[1],v=arguments[2],S=arguments[3];this._noder=f,this._scaleFactor=m,this._offsetX=v,this._offsetY=S,this._isScaled=!this.isIntegerPrecision()}},"ri");$p.prototype.rescale=function(){if(ne(arguments[0],On))for(var a=arguments[0].iterator();a.hasNext();){var u=a.next();this.rescale(u.getCoordinates())}else if(arguments[0]instanceof Array){for(var f=arguments[0],m=0;m<f.length;m++)f[m].x=f[m].x/this._scaleFactor+this._offsetX,f[m].y=f[m].y/this._scaleFactor+this._offsetY;f.length===2&&f[0].equals2D(f[1])&&Se.out.println(f)}},$p.prototype.scale=function(){if(ne(arguments[0],On)){for(var a=arguments[0],u=new He,f=a.iterator();f.hasNext();){var m=f.next();u.add(new li(this.scale(m.getCoordinates()),m.getData()))}return u}if(arguments[0]instanceof Array){for(var v=arguments[0],S=new Array(v.length).fill(null),M=0;M<v.length;M++)S[M]=new N(Math.round((v[M].x-this._offsetX)*this._scaleFactor),Math.round((v[M].y-this._offsetY)*this._scaleFactor),v[M].z);return F.removeRepeatedPoints(S)}},$p.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},$p.prototype.getNodedSubstrings=function(){var a=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(a),a},$p.prototype.computeNodes=function(a){var u=a;this._isScaled&&(u=this.scale(a)),this._noder.computeNodes(u)},$p.prototype.interfaces_=function(){return[vd]},$p.prototype.getClass=function(){return $p};var Pl=o(function(){this._li=new Ro,this._segStrings=null;var a=arguments[0];this._segStrings=a},"oi"),tN={fact:{configurable:!0}};Pl.prototype.checkEndPtVertexIntersections=function(){if(arguments.length===0)for(var a=this._segStrings.iterator();a.hasNext();){var u=a.next().getCoordinates();this.checkEndPtVertexIntersections(u[0],this._segStrings),this.checkEndPtVertexIntersections(u[u.length-1],this._segStrings)}else if(arguments.length===2){for(var f=arguments[0],m=arguments[1].iterator();m.hasNext();)for(var v=m.next().getCoordinates(),S=1;S<v.length-1;S++)if(v[S].equals(f))throw new Er("found endpt/interior pt intersection at index "+S+" :pt "+f)}},Pl.prototype.checkInteriorIntersections=function(){if(arguments.length===0)for(var a=this._segStrings.iterator();a.hasNext();)for(var u=a.next(),f=this._segStrings.iterator();f.hasNext();){var m=f.next();this.checkInteriorIntersections(u,m)}else if(arguments.length===2)for(var v=arguments[0],S=arguments[1],M=v.getCoordinates(),B=S.getCoordinates(),z=0;z<M.length-1;z++)for(var te=0;te<B.length-1;te++)this.checkInteriorIntersections(v,z,S,te);else if(arguments.length===4){var pe=arguments[0],ye=arguments[1],Xe=arguments[2],Ze=arguments[3];if(pe===Xe&&ye===Ze)return null;var nt=pe.getCoordinates()[ye],mt=pe.getCoordinates()[ye+1],Zr=Xe.getCoordinates()[Ze],Ii=Xe.getCoordinates()[Ze+1];if(this._li.computeIntersection(nt,mt,Zr,Ii),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,nt,mt)||this.hasInteriorIntersection(this._li,Zr,Ii)))throw new Er("found non-noded intersection at "+nt+"-"+mt+" and "+Zr+"-"+Ii)}},Pl.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},Pl.prototype.checkCollapses=function(){if(arguments.length===0)for(var a=this._segStrings.iterator();a.hasNext();){var u=a.next();this.checkCollapses(u)}else if(arguments.length===1)for(var f=arguments[0].getCoordinates(),m=0;m<f.length-2;m++)this.checkCollapse(f[m],f[m+1],f[m+2])},Pl.prototype.hasInteriorIntersection=function(a,u,f){for(var m=0;m<a.getIntersectionNum();m++){var v=a.getIntersection(m);if(!v.equals(u)&&!v.equals(f))return!0}return!1},Pl.prototype.checkCollapse=function(a,u,f){if(a.equals(f))throw new Er("found non-noded collapse at "+Pl.fact.createLineString([a,u,f]))},Pl.prototype.interfaces_=function(){return[]},Pl.prototype.getClass=function(){return Pl},tN.fact.get=function(){return new $t},Object.defineProperties(Pl,tN);var ss=o(function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var a=arguments[0],u=arguments[1],f=arguments[2];if(this._originalPt=a,this._pt=a,this._scaleFactor=u,this._li=f,u<=0)throw new D("Scale factor must be non-zero");u!==1&&(this._pt=new N(this.scale(a.x),this.scale(a.y)),this._p0Scaled=new N,this._p1Scaled=new N),this.initCorners(this._pt)},"ai"),rN={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};ss.prototype.intersectsScaled=function(a,u){var f=Math.min(a.x,u.x),m=Math.max(a.x,u.x),v=Math.min(a.y,u.y),S=Math.max(a.y,u.y),M=this._maxx<f||this._minx>m||this._maxy<v||this._miny>S;if(M)return!1;var B=this.intersectsToleranceSquare(a,u);return ot.isTrue(!(M&&B),"Found bad envelope test"),B},ss.prototype.initCorners=function(a){this._minx=a.x-.5,this._maxx=a.x+.5,this._miny=a.y-.5,this._maxy=a.y+.5,this._corner[0]=new N(this._maxx,this._maxy),this._corner[1]=new N(this._minx,this._maxy),this._corner[2]=new N(this._minx,this._miny),this._corner[3]=new N(this._maxx,this._miny)},ss.prototype.intersects=function(a,u){return this._scaleFactor===1?this.intersectsScaled(a,u):(this.copyScaled(a,this._p0Scaled),this.copyScaled(u,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},ss.prototype.scale=function(a){return Math.round(a*this._scaleFactor)},ss.prototype.getCoordinate=function(){return this._originalPt},ss.prototype.copyScaled=function(a,u){u.x=this.scale(a.x),u.y=this.scale(a.y)},ss.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var a=ss.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new ie(this._originalPt.x-a,this._originalPt.x+a,this._originalPt.y-a,this._originalPt.y+a)}return this._safeEnv},ss.prototype.intersectsPixelClosure=function(a,u){return this._li.computeIntersection(a,u,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(a,u,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(a,u,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(a,u,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))},ss.prototype.intersectsToleranceSquare=function(a,u){var f=!1,m=!1;return this._li.computeIntersection(a,u,this._corner[0],this._corner[1]),!!this._li.isProper()||(this._li.computeIntersection(a,u,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(f=!0),this._li.computeIntersection(a,u,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(m=!0),this._li.computeIntersection(a,u,this._corner[3],this._corner[0]),!!this._li.isProper()||!(!f||!m)||!!a.equals(this._pt)||!!u.equals(this._pt))))},ss.prototype.addSnappedNode=function(a,u){var f=a.getCoordinate(u),m=a.getCoordinate(u+1);return!!this.intersects(f,m)&&(a.addIntersection(this.getCoordinate(),u),!0)},ss.prototype.interfaces_=function(){return[]},ss.prototype.getClass=function(){return ss},rN.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(ss,rN);var Sb=o(function(){this.tempEnv1=new ie,this.selectedSegment=new ct},"li");Sb.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var a=arguments[0],u=arguments[1];a.getLineSegment(u,this.selectedSegment),this.select(this.selectedSegment)}}},Sb.prototype.interfaces_=function(){return[]},Sb.prototype.getClass=function(){return Sb};var Wy=o(function(){this._index=null;var a=arguments[0];this._index=a},"ci"),nN={HotPixelSnapAction:{configurable:!0}};Wy.prototype.snap=function(){if(arguments.length===1){var a=arguments[0];return this.snap(a,null,-1)}if(arguments.length===3){var u=arguments[0],f=arguments[1],m=arguments[2],v=u.getSafeEnvelope(),S=new iN(u,f,m);return this._index.query(v,{interfaces_:o(function(){return[kp]},"interfaces_"),visitItem:o(function(M){M.select(v,S)},"visitItem")}),S.isNodeAdded()}},Wy.prototype.interfaces_=function(){return[]},Wy.prototype.getClass=function(){return Wy},nN.HotPixelSnapAction.get=function(){return iN},Object.defineProperties(Wy,nN);var iN=function(a){function u(){a.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var f=arguments[0],m=arguments[1],v=arguments[2];this._hotPixel=f,this._parentEdge=m,this._hotPixelVertexIndex=v}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.isNodeAdded=function(){return this._isNodeAdded},u.prototype.select=function(){if(arguments.length!==2)return a.prototype.select.apply(this,arguments);var f=arguments[0],m=arguments[1],v=f.getContext();if(this._parentEdge!==null&&v===this._parentEdge&&m===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(v,m)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(Sb),Kh=o(function(){this._li=null,this._interiorIntersections=null;var a=arguments[0];this._li=a,this._interiorIntersections=new He},"fi");Kh.prototype.processIntersections=function(a,u,f,m){if(a===f&&u===m)return null;var v=a.getCoordinates()[u],S=a.getCoordinates()[u+1],M=f.getCoordinates()[m],B=f.getCoordinates()[m+1];if(this._li.computeIntersection(v,S,M,B),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var z=0;z<this._li.getIntersectionNum();z++)this._interiorIntersections.add(this._li.getIntersection(z));a.addIntersections(this._li,u,0),f.addIntersections(this._li,m,1)}},Kh.prototype.isDone=function(){return!1},Kh.prototype.getInteriorIntersections=function(){return this._interiorIntersections},Kh.prototype.interfaces_=function(){return[xd]},Kh.prototype.getClass=function(){return Kh};var yu=o(function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var a=arguments[0];this._pm=a,this._li=new Ro,this._li.setPrecisionModel(a),this._scaleFactor=a.getScale()},"gi");yu.prototype.checkCorrectness=function(a){var u=li.getNodedSubstrings(a),f=new Pl(u);try{f.checkValid()}catch(m){if(!(m instanceof We))throw m;m.printStackTrace()}},yu.prototype.getNodedSubstrings=function(){return li.getNodedSubstrings(this._nodedSegStrings)},yu.prototype.snapRound=function(a,u){var f=this.findInteriorIntersections(a,u);this.computeIntersectionSnaps(f),this.computeVertexSnaps(a)},yu.prototype.findInteriorIntersections=function(a,u){var f=new Kh(u);return this._noder.setSegmentIntersector(f),this._noder.computeNodes(a),f.getInteriorIntersections()},yu.prototype.computeVertexSnaps=function(){if(ne(arguments[0],On))for(var a=arguments[0].iterator();a.hasNext();){var u=a.next();this.computeVertexSnaps(u)}else if(arguments[0]instanceof li)for(var f=arguments[0],m=f.getCoordinates(),v=0;v<m.length;v++){var S=new ss(m[v],this._scaleFactor,this._li);this._pointSnapper.snap(S,f,v)&&f.addIntersection(m[v],v)}},yu.prototype.computeNodes=function(a){this._nodedSegStrings=a,this._noder=new pE,this._pointSnapper=new Wy(this._noder.getIndex()),this.snapRound(a,this._li)},yu.prototype.computeIntersectionSnaps=function(a){for(var u=a.iterator();u.hasNext();){var f=u.next(),m=new ss(f,this._scaleFactor,this._li);this._pointSnapper.snap(m)}},yu.prototype.interfaces_=function(){return[vd]},yu.prototype.getClass=function(){return yu};var oo=o(function(){if(this._argGeom=null,this._distance=null,this._bufParams=new Or,this._resultGeometry=null,this._saveException=null,arguments.length===1){var a=arguments[0];this._argGeom=a}else if(arguments.length===2){var u=arguments[0],f=arguments[1];this._argGeom=u,this._bufParams=f}},"di"),Xy={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};oo.prototype.bufferFixedPrecision=function(a){var u=new $p(new yu(new Mr(1)),a.getScale()),f=new jo(this._bufParams);f.setWorkingPrecisionModel(a),f.setNoder(u),this._resultGeometry=f.buffer(this._argGeom,this._distance)},oo.prototype.bufferReducedPrecision=function(){var a=this;if(arguments.length===0){for(var u=oo.MAX_PRECISION_DIGITS;u>=0;u--){try{a.bufferReducedPrecision(u)}catch(S){if(!(S instanceof bc))throw S;a._saveException=S}if(a._resultGeometry!==null)return null}throw this._saveException}if(arguments.length===1){var f=arguments[0],m=oo.precisionScaleFactor(this._argGeom,this._distance,f),v=new Mr(m);this.bufferFixedPrecision(v)}},oo.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var a=this._argGeom.getFactory().getPrecisionModel();a.getType()===Mr.FIXED?this.bufferFixedPrecision(a):this.bufferReducedPrecision()},oo.prototype.setQuadrantSegments=function(a){this._bufParams.setQuadrantSegments(a)},oo.prototype.bufferOriginalPrecision=function(){try{var a=new jo(this._bufParams);this._resultGeometry=a.buffer(this._argGeom,this._distance)}catch(u){if(!(u instanceof Er))throw u;this._saveException=u}},oo.prototype.getResultGeometry=function(a){return this._distance=a,this.computeGeometry(),this._resultGeometry},oo.prototype.setEndCapStyle=function(a){this._bufParams.setEndCapStyle(a)},oo.prototype.interfaces_=function(){return[]},oo.prototype.getClass=function(){return oo},oo.bufferOp=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1];return new oo(a).getResultGeometry(u)}if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof vt&&typeof arguments[1]=="number"){var f=arguments[0],m=arguments[1],v=arguments[2],S=new oo(f);return S.setQuadrantSegments(v),S.getResultGeometry(m)}if(arguments[2]instanceof Or&&arguments[0]instanceof vt&&typeof arguments[1]=="number"){var M=arguments[0],B=arguments[1],z=arguments[2];return new oo(M,z).getResultGeometry(B)}}else if(arguments.length===4){var te=arguments[0],pe=arguments[1],ye=arguments[2],Xe=arguments[3],Ze=new oo(te);return Ze.setQuadrantSegments(ye),Ze.setEndCapStyle(Xe),Ze.getResultGeometry(pe)}},oo.precisionScaleFactor=function(a,u,f){var m=a.getEnvelopeInternal(),v=Pe.max(Math.abs(m.getMaxX()),Math.abs(m.getMaxY()),Math.abs(m.getMinX()),Math.abs(m.getMinY()))+2*(u>0?u:0),S=f-Math.trunc(Math.log(v)/Math.log(10)+1);return Math.pow(10,S)},Xy.CAP_ROUND.get=function(){return Or.CAP_ROUND},Xy.CAP_BUTT.get=function(){return Or.CAP_FLAT},Xy.CAP_FLAT.get=function(){return Or.CAP_FLAT},Xy.CAP_SQUARE.get=function(){return Or.CAP_SQUARE},Xy.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(oo,Xy);var Go=o(function(){this._pt=[new N,new N],this._distance=A.NaN,this._isNull=!0},"_i");Go.prototype.getCoordinates=function(){return this._pt},Go.prototype.getCoordinate=function(a){return this._pt[a]},Go.prototype.setMinimum=function(){if(arguments.length===1){var a=arguments[0];this.setMinimum(a._pt[0],a._pt[1])}else if(arguments.length===2){var u=arguments[0],f=arguments[1];if(this._isNull)return this.initialize(u,f),null;var m=u.distance(f);m<this._distance&&this.initialize(u,f,m)}},Go.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var a=arguments[0],u=arguments[1];this._pt[0].setCoordinate(a),this._pt[1].setCoordinate(u),this._distance=a.distance(u),this._isNull=!1}else if(arguments.length===3){var f=arguments[0],m=arguments[1],v=arguments[2];this._pt[0].setCoordinate(f),this._pt[1].setCoordinate(m),this._distance=v,this._isNull=!1}},Go.prototype.getDistance=function(){return this._distance},Go.prototype.setMaximum=function(){if(arguments.length===1){var a=arguments[0];this.setMaximum(a._pt[0],a._pt[1])}else if(arguments.length===2){var u=arguments[0],f=arguments[1];if(this._isNull)return this.initialize(u,f),null;var m=u.distance(f);m>this._distance&&this.initialize(u,f,m)}},Go.prototype.interfaces_=function(){return[]},Go.prototype.getClass=function(){return Go};var vu=o(function(){},"mi");vu.prototype.interfaces_=function(){return[]},vu.prototype.getClass=function(){return vu},vu.computeDistance=function(){if(arguments[2]instanceof Go&&arguments[0]instanceof Gt&&arguments[1]instanceof N)for(var a=arguments[0],u=arguments[1],f=arguments[2],m=a.getCoordinates(),v=new ct,S=0;S<m.length-1;S++){v.setCoordinates(m[S],m[S+1]);var M=v.closestPoint(u);f.setMinimum(M,u)}else if(arguments[2]instanceof Go&&arguments[0]instanceof Xr&&arguments[1]instanceof N){var B=arguments[0],z=arguments[1],te=arguments[2];vu.computeDistance(B.getExteriorRing(),z,te);for(var pe=0;pe<B.getNumInteriorRing();pe++)vu.computeDistance(B.getInteriorRingN(pe),z,te)}else if(arguments[2]instanceof Go&&arguments[0]instanceof vt&&arguments[1]instanceof N){var ye=arguments[0],Xe=arguments[1],Ze=arguments[2];if(ye instanceof Gt)vu.computeDistance(ye,Xe,Ze);else if(ye instanceof Xr)vu.computeDistance(ye,Xe,Ze);else if(ye instanceof xt)for(var nt=ye,mt=0;mt<nt.getNumGeometries();mt++){var Zr=nt.getGeometryN(mt);vu.computeDistance(Zr,Xe,Ze)}else Ze.setMinimum(ye.getCoordinate(),Xe)}else if(arguments[2]instanceof Go&&arguments[0]instanceof ct&&arguments[1]instanceof N){var Ii=arguments[0],qo=arguments[1],_u=arguments[2],Hp=Ii.closestPoint(qo);_u.setMinimum(Hp,qo)}};var _d=o(function(a){this._maxPtDist=new Go,this._inputGeom=a||null},"vi"),fE={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};_d.prototype.computeMaxMidpointDistance=function(a){var u=new jp(this._inputGeom);a.apply(u),this._maxPtDist.setMaximum(u.getMaxPointDistance())},_d.prototype.computeMaxVertexDistance=function(a){var u=new Jh(this._inputGeom);a.apply(u),this._maxPtDist.setMaximum(u.getMaxPointDistance())},_d.prototype.findDistance=function(a){return this.computeMaxVertexDistance(a),this.computeMaxMidpointDistance(a),this._maxPtDist.getDistance()},_d.prototype.getDistancePoints=function(){return this._maxPtDist},_d.prototype.interfaces_=function(){return[]},_d.prototype.getClass=function(){return _d},fE.MaxPointDistanceFilter.get=function(){return Jh},fE.MaxMidpointDistanceFilter.get=function(){return jp},Object.defineProperties(_d,fE);var Jh=o(function(a){this._maxPtDist=new Go,this._minPtDist=new Go,this._geom=a||null},"Ei");Jh.prototype.filter=function(a){this._minPtDist.initialize(),vu.computeDistance(this._geom,a,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Jh.prototype.getMaxPointDistance=function(){return this._maxPtDist},Jh.prototype.interfaces_=function(){return[Qo]},Jh.prototype.getClass=function(){return Jh};var jp=o(function(a){this._maxPtDist=new Go,this._minPtDist=new Go,this._geom=a||null},"xi");jp.prototype.filter=function(a,u){if(u===0)return null;var f=a.getCoordinate(u-1),m=a.getCoordinate(u),v=new N((f.x+m.x)/2,(f.y+m.y)/2);this._minPtDist.initialize(),vu.computeDistance(this._geom,v,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},jp.prototype.isDone=function(){return!1},jp.prototype.isGeometryChanged=function(){return!1},jp.prototype.getMaxPointDistance=function(){return this._maxPtDist},jp.prototype.interfaces_=function(){return[kt]},jp.prototype.getClass=function(){return jp};var Sc=o(function(a){this._comps=a||null},"Ni");Sc.prototype.filter=function(a){a instanceof Xr&&this._comps.add(a)},Sc.prototype.interfaces_=function(){return[dt]},Sc.prototype.getClass=function(){return Sc},Sc.getPolygons=function(){if(arguments.length===1){var a=arguments[0];return Sc.getPolygons(a,new He)}if(arguments.length===2){var u=arguments[0],f=arguments[1];return u instanceof Xr?f.add(u):u instanceof xt&&u.apply(new Sc(f)),f}};var so=o(function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var a=arguments[0];this._lines=a}else if(arguments.length===2){var u=arguments[0],f=arguments[1];this._lines=u,this._isForcedToLineString=f}},"Ci");so.prototype.filter=function(a){if(this._isForcedToLineString&&a instanceof ns){var u=a.getFactory().createLineString(a.getCoordinateSequence());return this._lines.add(u),null}a instanceof Gt&&this._lines.add(a)},so.prototype.setForceToLineString=function(a){this._isForcedToLineString=a},so.prototype.interfaces_=function(){return[Ya]},so.prototype.getClass=function(){return so},so.getGeometry=function(){if(arguments.length===1){var a=arguments[0];return a.getFactory().buildGeometry(so.getLines(a))}if(arguments.length===2){var u=arguments[0],f=arguments[1];return u.getFactory().buildGeometry(so.getLines(u,f))}},so.getLines=function(){if(arguments.length===1){var a=arguments[0];return so.getLines(a,!1)}if(arguments.length===2){if(ne(arguments[0],On)&&ne(arguments[1],On)){for(var u=arguments[0],f=arguments[1],m=u.iterator();m.hasNext();){var v=m.next();so.getLines(v,f)}return f}if(arguments[0]instanceof vt&&typeof arguments[1]=="boolean"){var S=arguments[0],M=arguments[1],B=new He;return S.apply(new so(B,M)),B}if(arguments[0]instanceof vt&&ne(arguments[1],On)){var z=arguments[0],te=arguments[1];return z instanceof Gt?te.add(z):z.apply(new so(te)),te}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&ne(arguments[0],On)&&ne(arguments[1],On)){for(var pe=arguments[0],ye=arguments[1],Xe=arguments[2],Ze=pe.iterator();Ze.hasNext();){var nt=Ze.next();so.getLines(nt,ye,Xe)}return ye}if(typeof arguments[2]=="boolean"&&arguments[0]instanceof vt&&ne(arguments[1],On)){var mt=arguments[0],Zr=arguments[1],Ii=arguments[2];return mt.apply(new so(Zr,Ii)),Zr}}};var tl=o(function(){if(this._boundaryRule=ro.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0){if(arguments.length===1){var a=arguments[0];if(a===null)throw new D("Rule must be non-null");this._boundaryRule=a}}},"Si");tl.prototype.locateInternal=function(){if(arguments[0]instanceof N&&arguments[1]instanceof Xr){var a=arguments[0],u=arguments[1];if(u.isEmpty())return U.EXTERIOR;var f=u.getExteriorRing(),m=this.locateInPolygonRing(a,f);if(m===U.EXTERIOR)return U.EXTERIOR;if(m===U.BOUNDARY)return U.BOUNDARY;for(var v=0;v<u.getNumInteriorRing();v++){var S=u.getInteriorRingN(v),M=this.locateInPolygonRing(a,S);if(M===U.INTERIOR)return U.EXTERIOR;if(M===U.BOUNDARY)return U.BOUNDARY}return U.INTERIOR}if(arguments[0]instanceof N&&arguments[1]instanceof Gt){var B=arguments[0],z=arguments[1];if(!z.getEnvelopeInternal().intersects(B))return U.EXTERIOR;var te=z.getCoordinates();return z.isClosed()||!B.equals(te[0])&&!B.equals(te[te.length-1])?ze.isOnLine(B,te)?U.INTERIOR:U.EXTERIOR:U.BOUNDARY}if(arguments[0]instanceof N&&arguments[1]instanceof jn){var pe=arguments[0];return arguments[1].getCoordinate().equals2D(pe)?U.INTERIOR:U.EXTERIOR}},tl.prototype.locateInPolygonRing=function(a,u){return u.getEnvelopeInternal().intersects(a)?ze.locatePointInRing(a,u.getCoordinates()):U.EXTERIOR},tl.prototype.intersects=function(a,u){return this.locate(a,u)!==U.EXTERIOR},tl.prototype.updateLocationInfo=function(a){a===U.INTERIOR&&(this._isIn=!0),a===U.BOUNDARY&&this._numBoundaries++},tl.prototype.computeLocation=function(a,u){if(u instanceof jn&&this.updateLocationInfo(this.locateInternal(a,u)),u instanceof Gt)this.updateLocationInfo(this.locateInternal(a,u));else if(u instanceof Xr)this.updateLocationInfo(this.locateInternal(a,u));else if(u instanceof dn)for(var f=u,m=0;m<f.getNumGeometries();m++){var v=f.getGeometryN(m);this.updateLocationInfo(this.locateInternal(a,v))}else if(u instanceof Ka)for(var S=u,M=0;M<S.getNumGeometries();M++){var B=S.getGeometryN(M);this.updateLocationInfo(this.locateInternal(a,B))}else if(u instanceof xt)for(var z=new mu(u);z.hasNext();){var te=z.next();te!==u&&this.computeLocation(a,te)}},tl.prototype.locate=function(a,u){return u.isEmpty()?U.EXTERIOR:u instanceof Gt?this.locateInternal(a,u):u instanceof Xr?this.locateInternal(a,u):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(a,u),this._boundaryRule.isInBoundary(this._numBoundaries)?U.BOUNDARY:this._numBoundaries>0||this._isIn?U.INTERIOR:U.EXTERIOR)},tl.prototype.interfaces_=function(){return[]},tl.prototype.getClass=function(){return tl};var Uo=o(function a(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var u=arguments[0],f=arguments[1];a.call(this,u,a.INSIDE_AREA,f)}else if(arguments.length===3){var m=arguments[0],v=arguments[1],S=arguments[2];this._component=m,this._segIndex=v,this._pt=S}},"t"),oN={INSIDE_AREA:{configurable:!0}};Uo.prototype.isInsideArea=function(){return this._segIndex===Uo.INSIDE_AREA},Uo.prototype.getCoordinate=function(){return this._pt},Uo.prototype.getGeometryComponent=function(){return this._component},Uo.prototype.getSegmentIndex=function(){return this._segIndex},Uo.prototype.interfaces_=function(){return[]},Uo.prototype.getClass=function(){return Uo},oN.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Uo,oN);var Gp=o(function(a){this._pts=a||null},"wi");Gp.prototype.filter=function(a){a instanceof jn&&this._pts.add(a)},Gp.prototype.interfaces_=function(){return[dt]},Gp.prototype.getClass=function(){return Gp},Gp.getPoints=function(){if(arguments.length===1){var a=arguments[0];return a instanceof jn?Qa.singletonList(a):Gp.getPoints(a,new He)}if(arguments.length===2){var u=arguments[0],f=arguments[1];return u instanceof jn?f.add(u):u instanceof xt&&u.apply(new Gp(f)),f}};var Qh=o(function(){this._locations=null;var a=arguments[0];this._locations=a},"Oi");Qh.prototype.filter=function(a){(a instanceof jn||a instanceof Gt||a instanceof Xr)&&this._locations.add(new Uo(a,0,a.getCoordinate()))},Qh.prototype.interfaces_=function(){return[dt]},Qh.prototype.getClass=function(){return Qh},Qh.getLocations=function(a){var u=new He;return a.apply(new Qh(u)),u};var ao=o(function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new tl,this._minDistanceLocation=null,this._minDistance=A.MAX_VALUE,arguments.length===2){var a=arguments[0],u=arguments[1];this._geom=[a,u],this._terminateDistance=0}else if(arguments.length===3){var f=arguments[0],m=arguments[1],v=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=f,this._geom[1]=m,this._terminateDistance=v}},"Ti");ao.prototype.computeContainmentDistance=function(){if(arguments.length===0){var a=new Array(2).fill(null);if(this.computeContainmentDistance(0,a),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,a)}else if(arguments.length===2){var u=arguments[0],f=arguments[1],m=1-u,v=Sc.getPolygons(this._geom[u]);if(v.size()>0){var S=Qh.getLocations(this._geom[m]);if(this.computeContainmentDistance(S,v,f),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[m]=f[0],this._minDistanceLocation[u]=f[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&ne(arguments[0],ts)&&ne(arguments[1],ts)){for(var M=arguments[0],B=arguments[1],z=arguments[2],te=0;te<M.size();te++)for(var pe=M.get(te),ye=0;ye<B.size();ye++)if(this.computeContainmentDistance(pe,B.get(ye),z),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Uo&&arguments[1]instanceof Xr){var Xe=arguments[0],Ze=arguments[1],nt=arguments[2],mt=Xe.getCoordinate();if(U.EXTERIOR!==this._ptLocator.locate(mt,Ze))return this._minDistance=0,nt[0]=Xe,nt[1]=new Uo(Ze,mt),null}}},ao.prototype.computeMinDistanceLinesPoints=function(a,u,f){for(var m=0;m<a.size();m++)for(var v=a.get(m),S=0;S<u.size();S++){var M=u.get(S);if(this.computeMinDistance(v,M,f),this._minDistance<=this._terminateDistance)return null}},ao.prototype.computeFacetDistance=function(){var a=new Array(2).fill(null),u=so.getLines(this._geom[0]),f=so.getLines(this._geom[1]),m=Gp.getPoints(this._geom[0]),v=Gp.getPoints(this._geom[1]);return this.computeMinDistanceLines(u,f,a),this.updateMinDistance(a,!1),this._minDistance<=this._terminateDistance?null:(a[0]=null,a[1]=null,this.computeMinDistanceLinesPoints(u,v,a),this.updateMinDistance(a,!1),this._minDistance<=this._terminateDistance?null:(a[0]=null,a[1]=null,this.computeMinDistanceLinesPoints(f,m,a),this.updateMinDistance(a,!0),this._minDistance<=this._terminateDistance?null:(a[0]=null,a[1]=null,this.computeMinDistancePoints(m,v,a),void this.updateMinDistance(a,!1))))},ao.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},ao.prototype.updateMinDistance=function(a,u){if(a[0]===null)return null;u?(this._minDistanceLocation[0]=a[1],this._minDistanceLocation[1]=a[0]):(this._minDistanceLocation[0]=a[0],this._minDistanceLocation[1]=a[1])},ao.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},ao.prototype.computeMinDistance=function(){if(arguments.length===0){if(this._minDistanceLocation!==null||(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance))return null;this.computeFacetDistance()}else if(arguments.length===3){if(arguments[2]instanceof Array&&arguments[0]instanceof Gt&&arguments[1]instanceof jn){var a=arguments[0],u=arguments[1],f=arguments[2];if(a.getEnvelopeInternal().distance(u.getEnvelopeInternal())>this._minDistance)return null;for(var m=a.getCoordinates(),v=u.getCoordinate(),S=0;S<m.length-1;S++){var M=ze.distancePointLine(v,m[S],m[S+1]);if(M<this._minDistance){this._minDistance=M;var B=new ct(m[S],m[S+1]).closestPoint(v);f[0]=new Uo(a,S,B),f[1]=new Uo(u,0,v)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Gt&&arguments[1]instanceof Gt){var z=arguments[0],te=arguments[1],pe=arguments[2];if(z.getEnvelopeInternal().distance(te.getEnvelopeInternal())>this._minDistance)return null;for(var ye=z.getCoordinates(),Xe=te.getCoordinates(),Ze=0;Ze<ye.length-1;Ze++)for(var nt=0;nt<Xe.length-1;nt++){var mt=ze.distanceLineLine(ye[Ze],ye[Ze+1],Xe[nt],Xe[nt+1]);if(mt<this._minDistance){this._minDistance=mt;var Zr=new ct(ye[Ze],ye[Ze+1]),Ii=new ct(Xe[nt],Xe[nt+1]),qo=Zr.closestPoints(Ii);pe[0]=new Uo(z,Ze,qo[0]),pe[1]=new Uo(te,nt,qo[1])}if(this._minDistance<=this._terminateDistance)return null}}}},ao.prototype.computeMinDistancePoints=function(a,u,f){for(var m=0;m<a.size();m++)for(var v=a.get(m),S=0;S<u.size();S++){var M=u.get(S),B=v.getCoordinate().distance(M.getCoordinate());if(B<this._minDistance&&(this._minDistance=B,f[0]=new Uo(v,0,v.getCoordinate()),f[1]=new Uo(M,0,M.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},ao.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new D("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},ao.prototype.computeMinDistanceLines=function(a,u,f){for(var m=0;m<a.size();m++)for(var v=a.get(m),S=0;S<u.size();S++){var M=u.get(S);if(this.computeMinDistance(v,M,f),this._minDistance<=this._terminateDistance)return null}},ao.prototype.interfaces_=function(){return[]},ao.prototype.getClass=function(){return ao},ao.distance=function(a,u){return new ao(a,u).distance()},ao.isWithinDistance=function(a,u,f){return new ao(a,u,f).distance()<=f},ao.nearestPoints=function(a,u){return new ao(a,u).nearestPoints()};var Io=o(function(){this._pt=[new N,new N],this._distance=A.NaN,this._isNull=!0},"Ri");Io.prototype.getCoordinates=function(){return this._pt},Io.prototype.getCoordinate=function(a){return this._pt[a]},Io.prototype.setMinimum=function(){if(arguments.length===1){var a=arguments[0];this.setMinimum(a._pt[0],a._pt[1])}else if(arguments.length===2){var u=arguments[0],f=arguments[1];if(this._isNull)return this.initialize(u,f),null;var m=u.distance(f);m<this._distance&&this.initialize(u,f,m)}},Io.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var a=arguments[0],u=arguments[1];this._pt[0].setCoordinate(a),this._pt[1].setCoordinate(u),this._distance=a.distance(u),this._isNull=!1}else if(arguments.length===3){var f=arguments[0],m=arguments[1],v=arguments[2];this._pt[0].setCoordinate(f),this._pt[1].setCoordinate(m),this._distance=v,this._isNull=!1}},Io.prototype.toString=function(){return Pt.toLineString(this._pt[0],this._pt[1])},Io.prototype.getDistance=function(){return this._distance},Io.prototype.setMaximum=function(){if(arguments.length===1){var a=arguments[0];this.setMaximum(a._pt[0],a._pt[1])}else if(arguments.length===2){var u=arguments[0],f=arguments[1];if(this._isNull)return this.initialize(u,f),null;var m=u.distance(f);m>this._distance&&this.initialize(u,f,m)}},Io.prototype.interfaces_=function(){return[]},Io.prototype.getClass=function(){return Io};var Tl=o(function(){},"Pi");Tl.prototype.interfaces_=function(){return[]},Tl.prototype.getClass=function(){return Tl},Tl.computeDistance=function(){if(arguments[2]instanceof Io&&arguments[0]instanceof Gt&&arguments[1]instanceof N)for(var a=arguments[0],u=arguments[1],f=arguments[2],m=new ct,v=a.getCoordinates(),S=0;S<v.length-1;S++){m.setCoordinates(v[S],v[S+1]);var M=m.closestPoint(u);f.setMinimum(M,u)}else if(arguments[2]instanceof Io&&arguments[0]instanceof Xr&&arguments[1]instanceof N){var B=arguments[0],z=arguments[1],te=arguments[2];Tl.computeDistance(B.getExteriorRing(),z,te);for(var pe=0;pe<B.getNumInteriorRing();pe++)Tl.computeDistance(B.getInteriorRingN(pe),z,te)}else if(arguments[2]instanceof Io&&arguments[0]instanceof vt&&arguments[1]instanceof N){var ye=arguments[0],Xe=arguments[1],Ze=arguments[2];if(ye instanceof Gt)Tl.computeDistance(ye,Xe,Ze);else if(ye instanceof Xr)Tl.computeDistance(ye,Xe,Ze);else if(ye instanceof xt)for(var nt=ye,mt=0;mt<nt.getNumGeometries();mt++){var Zr=nt.getGeometryN(mt);Tl.computeDistance(Zr,Xe,Ze)}else Ze.setMinimum(ye.getCoordinate(),Xe)}else if(arguments[2]instanceof Io&&arguments[0]instanceof ct&&arguments[1]instanceof N){var Ii=arguments[0],qo=arguments[1],_u=arguments[2],Hp=Ii.closestPoint(qo);_u.setMinimum(Hp,qo)}};var Ta=o(function(){this._g0=null,this._g1=null,this._ptDist=new Io,this._densifyFrac=0;var a=arguments[0],u=arguments[1];this._g0=a,this._g1=u},"Di"),dE={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Ta.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Ta.prototype.setDensifyFraction=function(a){if(a>1||a<=0)throw new D("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=a},Ta.prototype.compute=function(a,u){this.computeOrientedDistance(a,u,this._ptDist),this.computeOrientedDistance(u,a,this._ptDist)},Ta.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Ta.prototype.computeOrientedDistance=function(a,u,f){var m=new em(u);if(a.apply(m),f.setMaximum(m.getMaxPointDistance()),this._densifyFrac>0){var v=new Up(u,this._densifyFrac);a.apply(v),f.setMaximum(v.getMaxPointDistance())}},Ta.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Ta.prototype.interfaces_=function(){return[]},Ta.prototype.getClass=function(){return Ta},Ta.distance=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1];return new Ta(a,u).distance()}if(arguments.length===3){var f=arguments[0],m=arguments[1],v=arguments[2],S=new Ta(f,m);return S.setDensifyFraction(v),S.distance()}},dE.MaxPointDistanceFilter.get=function(){return em},dE.MaxDensifiedByFractionDistanceFilter.get=function(){return Up},Object.defineProperties(Ta,dE);var em=o(function(){this._maxPtDist=new Io,this._minPtDist=new Io,this._euclideanDist=new Tl,this._geom=null;var a=arguments[0];this._geom=a},"Ai");em.prototype.filter=function(a){this._minPtDist.initialize(),Tl.computeDistance(this._geom,a,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},em.prototype.getMaxPointDistance=function(){return this._maxPtDist},em.prototype.interfaces_=function(){return[Qo]},em.prototype.getClass=function(){return em};var Up=o(function(){this._maxPtDist=new Io,this._minPtDist=new Io,this._geom=null,this._numSubSegs=0;var a=arguments[0],u=arguments[1];this._geom=a,this._numSubSegs=Math.trunc(Math.round(1/u))},"Fi");Up.prototype.filter=function(a,u){if(u===0)return null;for(var f=a.getCoordinate(u-1),m=a.getCoordinate(u),v=(m.x-f.x)/this._numSubSegs,S=(m.y-f.y)/this._numSubSegs,M=0;M<this._numSubSegs;M++){var B=f.x+M*v,z=f.y+M*S,te=new N(B,z);this._minPtDist.initialize(),Tl.computeDistance(this._geom,te,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},Up.prototype.isDone=function(){return!1},Up.prototype.isGeometryChanged=function(){return!1},Up.prototype.getMaxPointDistance=function(){return this._maxPtDist},Up.prototype.interfaces_=function(){return[kt]},Up.prototype.getClass=function(){return Up};var As=o(function(a,u,f){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=a||null,this._bufDistance=u||null,this._result=f||null},"Gi"),hE={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};As.prototype.checkMaximumDistance=function(a,u,f){var m=new Ta(u,a);if(m.setDensifyFraction(.25),this._maxDistanceFound=m.orientedDistance(),this._maxDistanceFound>f){this._isValid=!1;var v=m.getCoordinates();this._errorLocation=v[1],this._errorIndicator=a.getFactory().createLineString(v),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Pt.toLineString(v[0],v[1])+")"}},As.prototype.isValid=function(){var a=Math.abs(this._bufDistance),u=As.MAX_DISTANCE_DIFF_FRAC*a;return this._minValidDistance=a-u,this._maxValidDistance=a+u,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),As.VERBOSE&&Se.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},As.prototype.checkNegativeValid=function(){if(!(this._input instanceof Xr||this._input instanceof Ka||this._input instanceof xt))return null;var a=this.getPolygonLines(this._input);if(this.checkMinimumDistance(a,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(a,this._result,this._maxValidDistance)},As.prototype.getErrorIndicator=function(){return this._errorIndicator},As.prototype.checkMinimumDistance=function(a,u,f){var m=new ao(a,u,f);if(this._minDistanceFound=m.distance(),this._minDistanceFound<f){this._isValid=!1;var v=m.nearestPoints();this._errorLocation=m.nearestPoints()[1],this._errorIndicator=a.getFactory().createLineString(v),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+Pt.toLineString(v[0],v[1])+" )"}},As.prototype.checkPositiveValid=function(){var a=this._result.getBoundary();if(this.checkMinimumDistance(this._input,a,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,a,this._maxValidDistance)},As.prototype.getErrorLocation=function(){return this._errorLocation},As.prototype.getPolygonLines=function(a){for(var u=new He,f=new so(u),m=Sc.getPolygons(a).iterator();m.hasNext();)m.next().apply(f);return a.getFactory().buildGeometry(u)},As.prototype.getErrorMessage=function(){return this._errMsg},As.prototype.interfaces_=function(){return[]},As.prototype.getClass=function(){return As},hE.VERBOSE.get=function(){return!1},hE.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(As,hE);var lo=o(function(a,u,f){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=a||null,this._distance=u||null,this._result=f||null},"Bi"),mE={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};lo.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},lo.prototype.checkEnvelope=function(){if(this._distance<0)return null;var a=this._distance*lo.MAX_ENV_DIFF_FRAC;a===0&&(a=.001);var u=new ie(this._input.getEnvelopeInternal());u.expandBy(this._distance);var f=new ie(this._result.getEnvelopeInternal());f.expandBy(a),f.contains(u)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(f)),this.report("Envelope")},lo.prototype.checkDistance=function(){var a=new As(this._input,this._distance,this._result);a.isValid()||(this._isValid=!1,this._errorMsg=a.getErrorMessage(),this._errorLocation=a.getErrorLocation(),this._errorIndicator=a.getErrorIndicator()),this.report("Distance")},lo.prototype.checkArea=function(){var a=this._input.getArea(),u=this._result.getArea();this._distance>0&&a>u&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&a<u&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},lo.prototype.checkPolygonal=function(){this._result instanceof Xr||this._result instanceof Ka||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},lo.prototype.getErrorIndicator=function(){return this._errorIndicator},lo.prototype.getErrorLocation=function(){return this._errorLocation},lo.prototype.checkExpectedEmpty=function(){return this._input.getDimension()>=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},lo.prototype.report=function(a){if(!lo.VERBOSE)return null;Se.out.println("Check "+a+": "+(this._isValid?"passed":"FAILED"))},lo.prototype.getErrorMessage=function(){return this._errorMsg},lo.prototype.interfaces_=function(){return[]},lo.prototype.getClass=function(){return lo},lo.isValidMsg=function(a,u,f){var m=new lo(a,u,f);return m.isValid()?null:m.getErrorMessage()},lo.isValid=function(a,u,f){return!!new lo(a,u,f).isValid()},mE.VERBOSE.get=function(){return!1},mE.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(lo,mE);var El=o(function(){this._pts=null,this._data=null;var a=arguments[0],u=arguments[1];this._pts=a,this._data=u},"Ui");El.prototype.getCoordinates=function(){return this._pts},El.prototype.size=function(){return this._pts.length},El.prototype.getCoordinate=function(a){return this._pts[a]},El.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},El.prototype.getSegmentOctant=function(a){return a===this._pts.length-1?-1:Xh.octant(this.getCoordinate(a),this.getCoordinate(a+1))},El.prototype.setData=function(a){this._data=a},El.prototype.getData=function(){return this._data},El.prototype.toString=function(){return Pt.toLineString(new ai(this._pts))},El.prototype.interfaces_=function(){return[hu]},El.prototype.getClass=function(){return El};var Xi=o(function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new He,this._intersectionCount=0,this._keepIntersections=!0;var a=arguments[0];this._li=a,this._interiorIntersection=null},"zi");Xi.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Xi.prototype.setCheckEndSegmentsOnly=function(a){this._isCheckEndSegmentsOnly=a},Xi.prototype.getIntersectionSegments=function(){return this._intSegments},Xi.prototype.count=function(){return this._intersectionCount},Xi.prototype.getIntersections=function(){return this._intersections},Xi.prototype.setFindAllIntersections=function(a){this._findAllIntersections=a},Xi.prototype.setKeepIntersections=function(a){this._keepIntersections=a},Xi.prototype.processIntersections=function(a,u,f,m){if(!this._findAllIntersections&&this.hasIntersection()||a===f&&u===m||this._isCheckEndSegmentsOnly&&!(this.isEndSegment(a,u)||this.isEndSegment(f,m)))return null;var v=a.getCoordinates()[u],S=a.getCoordinates()[u+1],M=f.getCoordinates()[m],B=f.getCoordinates()[m+1];this._li.computeIntersection(v,S,M,B),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=v,this._intSegments[1]=S,this._intSegments[2]=M,this._intSegments[3]=B,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Xi.prototype.isEndSegment=function(a,u){return u===0||u>=a.size()-2},Xi.prototype.hasIntersection=function(){return this._interiorIntersection!==null},Xi.prototype.isDone=function(){return!this._findAllIntersections&&this._interiorIntersection!==null},Xi.prototype.interfaces_=function(){return[xd]},Xi.prototype.getClass=function(){return Xi},Xi.createAllIntersectionsFinder=function(a){var u=new Xi(a);return u.setFindAllIntersections(!0),u},Xi.createAnyIntersectionFinder=function(a){return new Xi(a)},Xi.createIntersectionCounter=function(a){var u=new Xi(a);return u.setFindAllIntersections(!0),u.setKeepIntersections(!1),u};var rl=o(function(){this._li=new Ro,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var a=arguments[0];this._segStrings=a},"Xi");rl.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},rl.prototype.getIntersections=function(){return this._segInt.getIntersections()},rl.prototype.isValid=function(){return this.execute(),this._isValid},rl.prototype.setFindAllIntersections=function(a){this._findAllIntersections=a},rl.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Xi(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var a=new pE;if(a.setSegmentIntersector(this._segInt),a.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},rl.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new bc(this.getErrorMessage(),this._segInt.getInteriorIntersection())},rl.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var a=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Pt.toLineString(a[0],a[1])+" and "+Pt.toLineString(a[2],a[3])},rl.prototype.interfaces_=function(){return[]},rl.prototype.getClass=function(){return rl},rl.computeIntersections=function(a){var u=new rl(a);return u.setFindAllIntersections(!0),u.isValid(),u.getIntersections()};var Sd=o(function a(){this._nv=null;var u=arguments[0];this._nv=new rl(a.toSegmentStrings(u))},"t");Sd.prototype.checkValid=function(){this._nv.checkValid()},Sd.prototype.interfaces_=function(){return[]},Sd.prototype.getClass=function(){return Sd},Sd.toSegmentStrings=function(a){for(var u=new He,f=a.iterator();f.hasNext();){var m=f.next();u.add(new El(m.getCoordinates(),m))}return u},Sd.checkValid=function(a){new Sd(a).checkValid()};var tm=o(function(a){this._mapOp=a},"ki");tm.prototype.map=function(a){for(var u=new He,f=0;f<a.getNumGeometries();f++){var m=this._mapOp.map(a.getGeometryN(f));m.isEmpty()||u.add(m)}return a.getFactory().createGeometryCollection($t.toGeometryArray(u))},tm.prototype.interfaces_=function(){return[]},tm.prototype.getClass=function(){return tm},tm.map=function(a,u){return new tm(u).map(a)};var Ml=o(function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new He,this._resultLineList=new He;var a=arguments[0],u=arguments[1],f=arguments[2];this._op=a,this._geometryFactory=u,this._ptLocator=f},"ji");Ml.prototype.collectLines=function(a){for(var u=this._op.getGraph().getEdgeEnds().iterator();u.hasNext();){var f=u.next();this.collectLineEdge(f,a,this._lineEdgesList),this.collectBoundaryTouchEdge(f,a,this._lineEdgesList)}},Ml.prototype.labelIsolatedLine=function(a,u){var f=this._ptLocator.locate(a.getCoordinate(),this._op.getArgGeometry(u));a.getLabel().setLocation(u,f)},Ml.prototype.build=function(a){return this.findCoveredLineEdges(),this.collectLines(a),this.buildLines(a),this._resultLineList},Ml.prototype.collectLineEdge=function(a,u,f){var m=a.getLabel(),v=a.getEdge();a.isLineEdge()&&(a.isVisited()||!Tt.isResultOfOp(m,u)||v.isCovered()||(f.add(v),a.setVisitedEdge(!0)))},Ml.prototype.findCoveredLineEdges=function(){for(var a=this._op.getGraph().getNodes().iterator();a.hasNext();)a.next().getEdges().findCoveredLineEdges();for(var u=this._op.getGraph().getEdgeEnds().iterator();u.hasNext();){var f=u.next(),m=f.getEdge();if(f.isLineEdge()&&!m.isCoveredSet()){var v=this._op.isCoveredByA(f.getCoordinate());m.setCovered(v)}}},Ml.prototype.labelIsolatedLines=function(a){for(var u=a.iterator();u.hasNext();){var f=u.next(),m=f.getLabel();f.isIsolated()&&(m.isNull(0)?this.labelIsolatedLine(f,0):this.labelIsolatedLine(f,1))}},Ml.prototype.buildLines=function(a){for(var u=this._lineEdgesList.iterator();u.hasNext();){var f=u.next(),m=this._geometryFactory.createLineString(f.getCoordinates());this._resultLineList.add(m),f.setInResult(!0)}},Ml.prototype.collectBoundaryTouchEdge=function(a,u,f){var m=a.getLabel();return a.isLineEdge()||a.isVisited()||a.isInteriorAreaEdge()||a.getEdge().isInResult()?null:(ot.isTrue(!(a.isInResult()||a.getSym().isInResult())||!a.getEdge().isInResult()),void(Tt.isResultOfOp(m,u)&&u===Tt.INTERSECTION&&(f.add(a.getEdge()),a.setVisitedEdge(!0))))},Ml.prototype.interfaces_=function(){return[]},Ml.prototype.getClass=function(){return Ml};var rm=o(function(){this._op=null,this._geometryFactory=null,this._resultPointList=new He;var a=arguments[0],u=arguments[1];this._op=a,this._geometryFactory=u},"Hi");rm.prototype.filterCoveredNodeToPoint=function(a){var u=a.getCoordinate();if(!this._op.isCoveredByLA(u)){var f=this._geometryFactory.createPoint(u);this._resultPointList.add(f)}},rm.prototype.extractNonCoveredResultNodes=function(a){for(var u=this._op.getGraph().getNodes().iterator();u.hasNext();){var f=u.next();if(!f.isInResult()&&!f.isIncidentEdgeInResult()&&(f.getEdges().getDegree()===0||a===Tt.INTERSECTION)){var m=f.getLabel();Tt.isResultOfOp(m,a)&&this.filterCoveredNodeToPoint(f)}}},rm.prototype.build=function(a){return this.extractNonCoveredResultNodes(a),this._resultPointList},rm.prototype.interfaces_=function(){return[]},rm.prototype.getClass=function(){return rm};var as=o(function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1},"Wi");as.prototype.transformPoint=function(a,u){return this._factory.createPoint(this.transformCoordinates(a.getCoordinateSequence(),a))},as.prototype.transformPolygon=function(a,u){var f=!0,m=this.transformLinearRing(a.getExteriorRing(),a);m!==null&&m instanceof ns&&!m.isEmpty()||(f=!1);for(var v=new He,S=0;S<a.getNumInteriorRing();S++){var M=this.transformLinearRing(a.getInteriorRingN(S),a);M===null||M.isEmpty()||(M instanceof ns||(f=!1),v.add(M))}if(f)return this._factory.createPolygon(m,v.toArray([]));var B=new He;return m!==null&&B.add(m),B.addAll(v),this._factory.buildGeometry(B)},as.prototype.createCoordinateSequence=function(a){return this._factory.getCoordinateSequenceFactory().create(a)},as.prototype.getInputGeometry=function(){return this._inputGeom},as.prototype.transformMultiLineString=function(a,u){for(var f=new He,m=0;m<a.getNumGeometries();m++){var v=this.transformLineString(a.getGeometryN(m),a);v!==null&&(v.isEmpty()||f.add(v))}return this._factory.buildGeometry(f)},as.prototype.transformCoordinates=function(a,u){return this.copy(a)},as.prototype.transformLineString=function(a,u){return this._factory.createLineString(this.transformCoordinates(a.getCoordinateSequence(),a))},as.prototype.transformMultiPoint=function(a,u){for(var f=new He,m=0;m<a.getNumGeometries();m++){var v=this.transformPoint(a.getGeometryN(m),a);v!==null&&(v.isEmpty()||f.add(v))}return this._factory.buildGeometry(f)},as.prototype.transformMultiPolygon=function(a,u){for(var f=new He,m=0;m<a.getNumGeometries();m++){var v=this.transformPolygon(a.getGeometryN(m),a);v!==null&&(v.isEmpty()||f.add(v))}return this._factory.buildGeometry(f)},as.prototype.copy=function(a){return a.copy()},as.prototype.transformGeometryCollection=function(a,u){for(var f=new He,m=0;m<a.getNumGeometries();m++){var v=this.transform(a.getGeometryN(m));v!==null&&(this._pruneEmptyGeometry&&v.isEmpty()||f.add(v))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection($t.toGeometryArray(f)):this._factory.buildGeometry(f)},as.prototype.transform=function(a){if(this._inputGeom=a,this._factory=a.getFactory(),a instanceof jn)return this.transformPoint(a,null);if(a instanceof Es)return this.transformMultiPoint(a,null);if(a instanceof ns)return this.transformLinearRing(a,null);if(a instanceof Gt)return this.transformLineString(a,null);if(a instanceof dn)return this.transformMultiLineString(a,null);if(a instanceof Xr)return this.transformPolygon(a,null);if(a instanceof Ka)return this.transformMultiPolygon(a,null);if(a instanceof xt)return this.transformGeometryCollection(a,null);throw new D("Unknown Geometry subtype: "+a.getClass().getName())},as.prototype.transformLinearRing=function(a,u){var f=this.transformCoordinates(a.getCoordinateSequence(),a);if(f===null)return this._factory.createLinearRing(null);var m=f.size();return m>0&&m<4&&!this._preserveType?this._factory.createLineString(f):this._factory.createLinearRing(f)},as.prototype.interfaces_=function(){return[]},as.prototype.getClass=function(){return as};var bu=o(function a(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new ct,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Gt&&typeof arguments[1]=="number"){var u=arguments[0],f=arguments[1];a.call(this,u.getCoordinates(),f)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var m=arguments[0],v=arguments[1];this._srcPts=m,this._isClosed=a.isClosed(m),this._snapTolerance=v}},"t");bu.prototype.snapVertices=function(a,u){for(var f=this._isClosed?a.size()-1:a.size(),m=0;m<f;m++){var v=a.get(m),S=this.findSnapForVertex(v,u);S!==null&&(a.set(m,new N(S)),m===0&&this._isClosed&&a.set(a.size()-1,new N(S)))}},bu.prototype.findSnapForVertex=function(a,u){for(var f=0;f<u.length;f++){if(a.equals2D(u[f]))return null;if(a.distance(u[f])<this._snapTolerance)return u[f]}return null},bu.prototype.snapTo=function(a){var u=new ue(this._srcPts);return this.snapVertices(u,a),this.snapSegments(u,a),u.toCoordinateArray()},bu.prototype.snapSegments=function(a,u){if(u.length===0)return null;var f=u.length;u[0].equals2D(u[u.length-1])&&(f=u.length-1);for(var m=0;m<f;m++){var v=u[m],S=this.findSegmentIndexToSnap(v,a);S>=0&&a.add(S+1,new N(v),!1)}},bu.prototype.findSegmentIndexToSnap=function(a,u){for(var f=A.MAX_VALUE,m=-1,v=0;v<u.size()-1;v++){if(this._seg.p0=u.get(v),this._seg.p1=u.get(v+1),this._seg.p0.equals2D(a)||this._seg.p1.equals2D(a)){if(this._allowSnappingToSourceVertices)continue;return-1}var S=this._seg.distance(a);S<this._snapTolerance&&S<f&&(f=S,m=v)}return m},bu.prototype.setAllowSnappingToSourceVertices=function(a){this._allowSnappingToSourceVertices=a},bu.prototype.interfaces_=function(){return[]},bu.prototype.getClass=function(){return bu},bu.isClosed=function(a){return!(a.length<=1)&&a[0].equals2D(a[a.length-1])};var ui=o(function(a){this._srcGeom=a||null},"Ji"),sN={SNAP_PRECISION_FACTOR:{configurable:!0}};ui.prototype.snapTo=function(a,u){var f=this.extractTargetCoordinates(a);return new aN(u,f).transform(this._srcGeom)},ui.prototype.snapToSelf=function(a,u){var f=this.extractTargetCoordinates(this._srcGeom),m=new aN(a,f,!0).transform(this._srcGeom),v=m;return u&&ne(v,Hi)&&(v=m.buffer(0)),v},ui.prototype.computeSnapTolerance=function(a){return this.computeMinimumSegmentLength(a)/10},ui.prototype.extractTargetCoordinates=function(a){for(var u=new C,f=a.getCoordinates(),m=0;m<f.length;m++)u.add(f[m]);return u.toArray(new Array(0).fill(null))},ui.prototype.computeMinimumSegmentLength=function(a){for(var u=A.MAX_VALUE,f=0;f<a.length-1;f++){var m=a[f].distance(a[f+1]);m<u&&(u=m)}return u},ui.prototype.interfaces_=function(){return[]},ui.prototype.getClass=function(){return ui},ui.snap=function(a,u,f){var m=new Array(2).fill(null),v=new ui(a);m[0]=v.snapTo(u,f);var S=new ui(u);return m[1]=S.snapTo(m[0],f),m},ui.computeOverlaySnapTolerance=function(){if(arguments.length===1){var a=arguments[0],u=ui.computeSizeBasedSnapTolerance(a),f=a.getPrecisionModel();if(f.getType()===Mr.FIXED){var m=1/f.getScale()*2/1.415;m>u&&(u=m)}return u}if(arguments.length===2){var v=arguments[0],S=arguments[1];return Math.min(ui.computeOverlaySnapTolerance(v),ui.computeOverlaySnapTolerance(S))}},ui.computeSizeBasedSnapTolerance=function(a){var u=a.getEnvelopeInternal();return Math.min(u.getHeight(),u.getWidth())*ui.SNAP_PRECISION_FACTOR},ui.snapToSelf=function(a,u,f){return new ui(a).snapToSelf(u,f)},sN.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(ui,sN);var aN=function(a){function u(f,m,v){a.call(this),this._snapTolerance=f||null,this._snapPts=m||null,this._isSelfSnap=v!==void 0&&v}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.snapLine=function(f,m){var v=new bu(f,this._snapTolerance);return v.setAllowSnappingToSourceVertices(this._isSelfSnap),v.snapTo(m)},u.prototype.transformCoordinates=function(f,m){var v=f.toCoordinateArray(),S=this.snapLine(v,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(S)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(as),Vo=o(function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null},"$i");Vo.prototype.getCommon=function(){return A.longBitsToDouble(this._commonBits)},Vo.prototype.add=function(a){var u=A.doubleToLongBits(a);if(this._isFirst)return this._commonBits=u,this._commonSignExp=Vo.signExpBits(this._commonBits),this._isFirst=!1,null;if(Vo.signExpBits(u)!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=Vo.numCommonMostSigMantissaBits(this._commonBits,u),this._commonBits=Vo.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},Vo.prototype.toString=function(){if(arguments.length===1){var a=arguments[0],u=A.longBitsToDouble(a),f="0000000000000000000000000000000000000000000000000000000000000000"+A.toBinaryString(a),m=f.substring(f.length-64);return m.substring(0,1)+" "+m.substring(1,12)+"(exp) "+m.substring(12)+" [ "+u+" ]"}},Vo.prototype.interfaces_=function(){return[]},Vo.prototype.getClass=function(){return Vo},Vo.getBit=function(a,u){return(a&1<<u)!=0?1:0},Vo.signExpBits=function(a){return a>>52},Vo.zeroLowerBits=function(a,u){return a&~((1<<u)-1)},Vo.numCommonMostSigMantissaBits=function(a,u){for(var f=0,m=52;m>=0;m--){if(Vo.getBit(a,m)!==Vo.getBit(u,m))return f;f++}return 52};var Vp=o(function(){this._commonCoord=null,this._ccFilter=new nm},"tr"),gE={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};Vp.prototype.addCommonBits=function(a){var u=new zp(this._commonCoord);a.apply(u),a.geometryChanged()},Vp.prototype.removeCommonBits=function(a){if(this._commonCoord.x===0&&this._commonCoord.y===0)return a;var u=new N(this._commonCoord);u.x=-u.x,u.y=-u.y;var f=new zp(u);return a.apply(f),a.geometryChanged(),a},Vp.prototype.getCommonCoordinate=function(){return this._commonCoord},Vp.prototype.add=function(a){a.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},Vp.prototype.interfaces_=function(){return[]},Vp.prototype.getClass=function(){return Vp},gE.CommonCoordinateFilter.get=function(){return nm},gE.Translater.get=function(){return zp},Object.defineProperties(Vp,gE);var nm=o(function(){this._commonBitsX=new Vo,this._commonBitsY=new Vo},"nr");nm.prototype.filter=function(a){this._commonBitsX.add(a.x),this._commonBitsY.add(a.y)},nm.prototype.getCommonCoordinate=function(){return new N(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},nm.prototype.interfaces_=function(){return[Qo]},nm.prototype.getClass=function(){return nm};var zp=o(function(){this.trans=null;var a=arguments[0];this.trans=a},"ir");zp.prototype.filter=function(a,u){var f=a.getOrdinate(u,0)+this.trans.x,m=a.getOrdinate(u,1)+this.trans.y;a.setOrdinate(u,0,f),a.setOrdinate(u,1,m)},zp.prototype.isDone=function(){return!1},zp.prototype.isGeometryChanged=function(){return!0},zp.prototype.interfaces_=function(){return[kt]},zp.prototype.getClass=function(){return zp};var Yi=o(function(a,u){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=a,this._geom[1]=u,this.computeSnapTolerance()},"rr");Yi.prototype.selfSnap=function(a){return new ui(a).snapTo(a,this._snapTolerance)},Yi.prototype.removeCommonBits=function(a){this._cbr=new Vp,this._cbr.add(a[0]),this._cbr.add(a[1]);var u=new Array(2).fill(null);return u[0]=this._cbr.removeCommonBits(a[0].copy()),u[1]=this._cbr.removeCommonBits(a[1].copy()),u},Yi.prototype.prepareResult=function(a){return this._cbr.addCommonBits(a),a},Yi.prototype.getResultGeometry=function(a){var u=this.snap(this._geom),f=Tt.overlayOp(u[0],u[1],a);return this.prepareResult(f)},Yi.prototype.checkValid=function(a){a.isValid()||Se.out.println("Snapped geometry is invalid")},Yi.prototype.computeSnapTolerance=function(){this._snapTolerance=ui.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},Yi.prototype.snap=function(a){var u=this.removeCommonBits(a);return ui.snap(u[0],u[1],this._snapTolerance)},Yi.prototype.interfaces_=function(){return[]},Yi.prototype.getClass=function(){return Yi},Yi.overlayOp=function(a,u,f){return new Yi(a,u).getResultGeometry(f)},Yi.union=function(a,u){return Yi.overlayOp(a,u,Tt.UNION)},Yi.intersection=function(a,u){return Yi.overlayOp(a,u,Tt.INTERSECTION)},Yi.symDifference=function(a,u){return Yi.overlayOp(a,u,Tt.SYMDIFFERENCE)},Yi.difference=function(a,u){return Yi.overlayOp(a,u,Tt.DIFFERENCE)};var zo=o(function(a,u){this._geom=new Array(2).fill(null),this._geom[0]=a,this._geom[1]=u},"or");zo.prototype.getResultGeometry=function(a){var u=null,f=!1,m=null;try{u=Tt.overlayOp(this._geom[0],this._geom[1],a),f=!0}catch(v){if(!(v instanceof Er))throw v;m=v}if(!f)try{u=Yi.overlayOp(this._geom[0],this._geom[1],a)}catch(v){throw v instanceof Er?m:v}return u},zo.prototype.interfaces_=function(){return[]},zo.prototype.getClass=function(){return zo},zo.overlayOp=function(a,u,f){return new zo(a,u).getResultGeometry(f)},zo.union=function(a,u){return zo.overlayOp(a,u,Tt.UNION)},zo.intersection=function(a,u){return zo.overlayOp(a,u,Tt.INTERSECTION)},zo.symDifference=function(a,u){return zo.overlayOp(a,u,Tt.SYMDIFFERENCE)},zo.difference=function(a,u){return zo.overlayOp(a,u,Tt.DIFFERENCE)};var Cb=o(function(){this.mce=null,this.chainIndex=null;var a=arguments[0],u=arguments[1];this.mce=a,this.chainIndex=u},"sr");Cb.prototype.computeIntersections=function(a,u){this.mce.computeIntersectsForChain(this.chainIndex,a.mce,a.chainIndex,u)},Cb.prototype.interfaces_=function(){return[]},Cb.prototype.getClass=function(){return Cb};var Ds=o(function a(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var u=arguments[0],f=arguments[1];this._eventType=a.DELETE,this._xValue=u,this._insertEvent=f}else if(arguments.length===3){var m=arguments[0],v=arguments[1],S=arguments[2];this._eventType=a.INSERT,this._label=m,this._xValue=v,this._obj=S}},"t"),yE={INSERT:{configurable:!0},DELETE:{configurable:!0}};Ds.prototype.isDelete=function(){return this._eventType===Ds.DELETE},Ds.prototype.setDeleteEventIndex=function(a){this._deleteEventIndex=a},Ds.prototype.getObject=function(){return this._obj},Ds.prototype.compareTo=function(a){var u=a;return this._xValue<u._xValue?-1:this._xValue>u._xValue?1:this._eventType<u._eventType?-1:this._eventType>u._eventType?1:0},Ds.prototype.getInsertEvent=function(){return this._insertEvent},Ds.prototype.isInsert=function(){return this._eventType===Ds.INSERT},Ds.prototype.isSameLabel=function(a){return this._label!==null&&this._label===a._label},Ds.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},Ds.prototype.interfaces_=function(){return[j]},Ds.prototype.getClass=function(){return Ds},yE.INSERT.get=function(){return 1},yE.DELETE.get=function(){return 2},Object.defineProperties(Ds,yE);var tS=o(function(){},"lr");tS.prototype.interfaces_=function(){return[]},tS.prototype.getClass=function(){return tS};var uo=o(function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var a=arguments[0],u=arguments[1],f=arguments[2];this._li=a,this._includeProper=u,this._recordIsolated=f},"cr");uo.prototype.isTrivialIntersection=function(a,u,f,m){if(a===f&&this._li.getIntersectionNum()===1){if(uo.isAdjacentSegments(u,m))return!0;if(a.isClosed()){var v=a.getNumPoints()-1;if(u===0&&m===v||m===0&&u===v)return!0}}return!1},uo.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},uo.prototype.setIsDoneIfProperInt=function(a){this._isDoneWhenProperInt=a},uo.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},uo.prototype.isBoundaryPointInternal=function(a,u){for(var f=u.iterator();f.hasNext();){var m=f.next().getCoordinate();if(a.isIntersection(m))return!0}return!1},uo.prototype.hasProperIntersection=function(){return this._hasProper},uo.prototype.hasIntersection=function(){return this._hasIntersection},uo.prototype.isDone=function(){return this._isDone},uo.prototype.isBoundaryPoint=function(a,u){return u!==null&&(!!this.isBoundaryPointInternal(a,u[0])||!!this.isBoundaryPointInternal(a,u[1]))},uo.prototype.setBoundaryNodes=function(a,u){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=a,this._bdyNodes[1]=u},uo.prototype.addIntersections=function(a,u,f,m){if(a===f&&u===m)return null;this.numTests++;var v=a.getCoordinates()[u],S=a.getCoordinates()[u+1],M=f.getCoordinates()[m],B=f.getCoordinates()[m+1];this._li.computeIntersection(v,S,M,B),this._li.hasIntersection()&&(this._recordIsolated&&(a.setIsolated(!1),f.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(a,u,f,m)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(a.addIntersections(this._li,u,0),f.addIntersections(this._li,m,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},uo.prototype.interfaces_=function(){return[]},uo.prototype.getClass=function(){return uo},uo.isAdjacentSegments=function(a,u){return Math.abs(a-u)===1};var Bse=function(a){function u(){a.call(this),this.events=new He,this.nOverlaps=null}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.prepareEvents=function(){Qa.sort(this.events);for(var f=0;f<this.events.size();f++){var m=this.events.get(f);m.isDelete()&&m.getInsertEvent().setDeleteEventIndex(f)}},u.prototype.computeIntersections=function(){if(arguments.length===1){var f=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var m=0;m<this.events.size();m++){var v=this.events.get(m);if(v.isInsert()&&this.processOverlaps(m,v.getDeleteEventIndex(),v,f),f.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof uo&&ne(arguments[0],ts)&&ne(arguments[1],ts)){var S=arguments[0],M=arguments[1],B=arguments[2];this.addEdges(S,S),this.addEdges(M,M),this.computeIntersections(B)}else if(typeof arguments[2]=="boolean"&&ne(arguments[0],ts)&&arguments[1]instanceof uo){var z=arguments[0],te=arguments[1];arguments[2]?this.addEdges(z,null):this.addEdges(z),this.computeIntersections(te)}}},u.prototype.addEdge=function(f,m){for(var v=f.getMonotoneChainEdge(),S=v.getStartIndexes(),M=0;M<S.length-1;M++){var B=new Cb(v,M),z=new Ds(m,v.getMinX(M),B);this.events.add(z),this.events.add(new Ds(v.getMaxX(M),z))}},u.prototype.processOverlaps=function(f,m,v,S){for(var M=v.getObject(),B=f;B<m;B++){var z=this.events.get(B);if(z.isInsert()){var te=z.getObject();v.isSameLabel(z)||(M.computeIntersections(te,S),this.nOverlaps++)}}},u.prototype.addEdges=function(){if(arguments.length===1)for(var f=arguments[0].iterator();f.hasNext();){var m=f.next();this.addEdge(m,m)}else if(arguments.length===2)for(var v=arguments[0],S=arguments[1],M=v.iterator();M.hasNext();){var B=M.next();this.addEdge(B,S)}},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(tS),xu=o(function(){this._min=A.POSITIVE_INFINITY,this._max=A.NEGATIVE_INFINITY},"hr"),lN={NodeComparator:{configurable:!0}};xu.prototype.getMin=function(){return this._min},xu.prototype.intersects=function(a,u){return!(this._min>u||this._max<a)},xu.prototype.getMax=function(){return this._max},xu.prototype.toString=function(){return Pt.toLineString(new N(this._min,0),new N(this._max,0))},xu.prototype.interfaces_=function(){return[]},xu.prototype.getClass=function(){return xu},lN.NodeComparator.get=function(){return wb},Object.defineProperties(xu,lN);var wb=o(function(){},"gr");wb.prototype.compare=function(a,u){var f=a,m=u,v=(f._min+f._max)/2,S=(m._min+m._max)/2;return v<S?-1:v>S?1:0},wb.prototype.interfaces_=function(){return[Y]},wb.prototype.getClass=function(){return wb};var $se=function(a){function u(){a.call(this),this._item=null;var f=arguments[0],m=arguments[1],v=arguments[2];this._min=f,this._max=m,this._item=v}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.query=function(f,m,v){if(!this.intersects(f,m))return null;v.visitItem(this._item)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(xu),jse=function(a){function u(){a.call(this),this._node1=null,this._node2=null;var f=arguments[0],m=arguments[1];this._node1=f,this._node2=m,this.buildExtent(this._node1,this._node2)}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.buildExtent=function(f,m){this._min=Math.min(f._min,m._min),this._max=Math.max(f._max,m._max)},u.prototype.query=function(f,m,v){if(!this.intersects(f,m))return null;this._node1!==null&&this._node1.query(f,m,v),this._node2!==null&&this._node2.query(f,m,v)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(xu),Iu=o(function(){this._leaves=new He,this._root=null,this._level=0},"_r");Iu.prototype.buildTree=function(){Qa.sort(this._leaves,new xu.NodeComparator);for(var a=this._leaves,u=null,f=new He;;){if(this.buildLevel(a,f),f.size()===1)return f.get(0);u=a,a=f,f=u}},Iu.prototype.insert=function(a,u,f){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new $se(a,u,f))},Iu.prototype.query=function(a,u,f){this.init(),this._root.query(a,u,f)},Iu.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},Iu.prototype.printNode=function(a){Se.out.println(Pt.toLineString(new N(a._min,this._level),new N(a._max,this._level)))},Iu.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},Iu.prototype.buildLevel=function(a,u){this._level++,u.clear();for(var f=0;f<a.size();f+=2){var m=a.get(f);if((f+1<a.size()?a.get(f):null)===null)u.add(m);else{var v=new jse(a.get(f),a.get(f+1));u.add(v)}}},Iu.prototype.interfaces_=function(){return[]},Iu.prototype.getClass=function(){return Iu};var Yy=o(function(){this._items=new He},"mr");Yy.prototype.visitItem=function(a){this._items.add(a)},Yy.prototype.getItems=function(){return this._items},Yy.prototype.interfaces_=function(){return[kp]},Yy.prototype.getClass=function(){return Yy};var Zy=o(function(){this._index=null;var a=arguments[0];if(!ne(a,Hi))throw new D("Argument must be Polygonal");this._index=new Cd(a)},"vr"),vE={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};Zy.prototype.locate=function(a){var u=new Ri(a),f=new Ky(u);return this._index.query(a.y,a.y,f),u.getLocation()},Zy.prototype.interfaces_=function(){return[Hy]},Zy.prototype.getClass=function(){return Zy},vE.SegmentVisitor.get=function(){return Ky},vE.IntervalIndexedGeometry.get=function(){return Cd},Object.defineProperties(Zy,vE);var Ky=o(function(){this._counter=null;var a=arguments[0];this._counter=a},"Er");Ky.prototype.visitItem=function(a){var u=a;this._counter.countSegment(u.getCoordinate(0),u.getCoordinate(1))},Ky.prototype.interfaces_=function(){return[kp]},Ky.prototype.getClass=function(){return Ky};var Cd=o(function(){this._index=new Iu;var a=arguments[0];this.init(a)},"xr");Cd.prototype.init=function(a){for(var u=so.getLines(a).iterator();u.hasNext();){var f=u.next().getCoordinates();this.addLine(f)}},Cd.prototype.addLine=function(a){for(var u=1;u<a.length;u++){var f=new ct(a[u-1],a[u]),m=Math.min(f.p0.y,f.p1.y),v=Math.max(f.p0.y,f.p1.y);this._index.insert(m,v,f)}},Cd.prototype.query=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1],f=new Yy;return this._index.query(a,u,f),f.getItems()}if(arguments.length===3){var m=arguments[0],v=arguments[1],S=arguments[2];this._index.query(m,v,S)}},Cd.prototype.interfaces_=function(){return[]},Cd.prototype.getClass=function(){return Cd};var Pb=function(a){function u(){if(a.call(this),this._parentGeom=null,this._lineEdgeMap=new VF,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new tl,arguments.length===2){var f=arguments[0],m=arguments[1],v=ro.OGC_SFS_BOUNDARY_RULE;this._argIndex=f,this._parentGeom=m,this._boundaryNodeRule=v,m!==null&&this.add(m)}else if(arguments.length===3){var S=arguments[0],M=arguments[1],B=arguments[2];this._argIndex=S,this._parentGeom=M,this._boundaryNodeRule=B,M!==null&&this.add(M)}}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.insertBoundaryPoint=function(f,m){var v=this._nodes.addNode(m).getLabel(),S=1;U.NONE,v.getLocation(f,Ge.ON)===U.BOUNDARY&&S++;var M=u.determineBoundary(this._boundaryNodeRule,S);v.setLocation(f,M)},u.prototype.computeSelfNodes=function(){if(arguments.length===2){var f=arguments[0],m=arguments[1];return this.computeSelfNodes(f,m,!1)}if(arguments.length===3){var v=arguments[0],S=arguments[1],M=arguments[2],B=new uo(v,!0,!1);B.setIsDoneIfProperInt(M);var z=this.createEdgeSetIntersector(),te=this._parentGeom instanceof ns||this._parentGeom instanceof Xr||this._parentGeom instanceof Ka,pe=S||!te;return z.computeIntersections(this._edges,B,pe),this.addSelfIntersectionNodes(this._argIndex),B}},u.prototype.computeSplitEdges=function(f){for(var m=this._edges.iterator();m.hasNext();)m.next().eiList.addSplitEdges(f)},u.prototype.computeEdgeIntersections=function(f,m,v){var S=new uo(m,v,!0);return S.setBoundaryNodes(this.getBoundaryNodes(),f.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,f._edges,S),S},u.prototype.getGeometry=function(){return this._parentGeom},u.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},u.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},u.prototype.addPoint=function(){if(arguments[0]instanceof jn){var f=arguments[0].getCoordinate();this.insertPoint(this._argIndex,f,U.INTERIOR)}else if(arguments[0]instanceof N){var m=arguments[0];this.insertPoint(this._argIndex,m,U.INTERIOR)}},u.prototype.addPolygon=function(f){this.addPolygonRing(f.getExteriorRing(),U.EXTERIOR,U.INTERIOR);for(var m=0;m<f.getNumInteriorRing();m++){var v=f.getInteriorRingN(m);this.addPolygonRing(v,U.INTERIOR,U.EXTERIOR)}},u.prototype.addEdge=function(f){this.insertEdge(f);var m=f.getCoordinates();this.insertPoint(this._argIndex,m[0],U.BOUNDARY),this.insertPoint(this._argIndex,m[m.length-1],U.BOUNDARY)},u.prototype.addLineString=function(f){var m=F.removeRepeatedPoints(f.getCoordinates());if(m.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=m[0],null;var v=new eS(m,new Yr(this._argIndex,U.INTERIOR));this._lineEdgeMap.put(f,v),this.insertEdge(v),ot.isTrue(m.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,m[0]),this.insertBoundaryPoint(this._argIndex,m[m.length-1])},u.prototype.getInvalidPoint=function(){return this._invalidPoint},u.prototype.getBoundaryPoints=function(){for(var f=this.getBoundaryNodes(),m=new Array(f.size()).fill(null),v=0,S=f.iterator();S.hasNext();){var M=S.next();m[v++]=M.getCoordinate().copy()}return m},u.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},u.prototype.addSelfIntersectionNode=function(f,m,v){if(this.isBoundaryNode(f,m))return null;v===U.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(f,m):this.insertPoint(f,m,v)},u.prototype.addPolygonRing=function(f,m,v){if(f.isEmpty())return null;var S=F.removeRepeatedPoints(f.getCoordinates());if(S.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=S[0],null;var M=m,B=v;ze.isCCW(S)&&(M=v,B=m);var z=new eS(S,new Yr(this._argIndex,U.BOUNDARY,M,B));this._lineEdgeMap.put(f,z),this.insertEdge(z),this.insertPoint(this._argIndex,S[0],U.BOUNDARY)},u.prototype.insertPoint=function(f,m,v){var S=this._nodes.addNode(m),M=S.getLabel();M===null?S._label=new Yr(f,v):M.setLocation(f,v)},u.prototype.createEdgeSetIntersector=function(){return new Bse},u.prototype.addSelfIntersectionNodes=function(f){for(var m=this._edges.iterator();m.hasNext();)for(var v=m.next(),S=v.getLabel().getLocation(f),M=v.eiList.iterator();M.hasNext();){var B=M.next();this.addSelfIntersectionNode(f,B.coord,S)}},u.prototype.add=function(){if(arguments.length!==1)return a.prototype.add.apply(this,arguments);var f=arguments[0];if(f.isEmpty())return null;if(f instanceof Ka&&(this._useBoundaryDeterminationRule=!1),f instanceof Xr)this.addPolygon(f);else if(f instanceof Gt)this.addLineString(f);else if(f instanceof jn)this.addPoint(f);else if(f instanceof Es)this.addCollection(f);else if(f instanceof dn)this.addCollection(f);else if(f instanceof Ka)this.addCollection(f);else{if(!(f instanceof xt))throw new Error(f.getClass().getName());this.addCollection(f)}},u.prototype.addCollection=function(f){for(var m=0;m<f.getNumGeometries();m++){var v=f.getGeometryN(m);this.add(v)}},u.prototype.locate=function(f){return ne(this._parentGeom,Hi)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new Zy(this._parentGeom)),this._areaPtLocator.locate(f)):this._ptLocator.locate(f,this._parentGeom)},u.prototype.findEdge=function(){if(arguments.length===1){var f=arguments[0];return this._lineEdgeMap.get(f)}return a.prototype.findEdge.apply(this,arguments)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u.determineBoundary=function(f,m){return f.isInBoundary(m)?U.BOUNDARY:U.INTERIOR},u}(Zn),Jy=o(function(){if(this._li=new Ro,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var a=arguments[0];this.setComputationPrecision(a.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Pb(0,a)}else if(arguments.length===2){var u=arguments[0],f=arguments[1],m=ro.OGC_SFS_BOUNDARY_RULE;u.getPrecisionModel().compareTo(f.getPrecisionModel())>=0?this.setComputationPrecision(u.getPrecisionModel()):this.setComputationPrecision(f.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Pb(0,u,m),this._arg[1]=new Pb(1,f,m)}else if(arguments.length===3){var v=arguments[0],S=arguments[1],M=arguments[2];v.getPrecisionModel().compareTo(S.getPrecisionModel())>=0?this.setComputationPrecision(v.getPrecisionModel()):this.setComputationPrecision(S.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Pb(0,v,M),this._arg[1]=new Pb(1,S,M)}},"Cr");Jy.prototype.getArgGeometry=function(a){return this._arg[a].getGeometry()},Jy.prototype.setComputationPrecision=function(a){this._resultPrecisionModel=a,this._li.setPrecisionModel(this._resultPrecisionModel)},Jy.prototype.interfaces_=function(){return[]},Jy.prototype.getClass=function(){return Jy};var wd=o(function(){},"Sr");wd.prototype.interfaces_=function(){return[]},wd.prototype.getClass=function(){return wd},wd.map=function(){if(arguments[0]instanceof vt&&ne(arguments[1],wd.MapOp)){for(var a=arguments[0],u=arguments[1],f=new He,m=0;m<a.getNumGeometries();m++){var v=u.map(a.getGeometryN(m));v!==null&&f.add(v)}return a.getFactory().buildGeometry(f)}if(ne(arguments[0],On)&&ne(arguments[1],wd.MapOp)){for(var S=arguments[0],M=arguments[1],B=new He,z=S.iterator();z.hasNext();){var te=z.next(),pe=M.map(te);pe!==null&&B.add(pe)}return B}},wd.MapOp=function(){};var Tt=function(a){function u(){var f=arguments[0],m=arguments[1];a.call(this,f,m),this._ptLocator=new tl,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new el,this._resultPolyList=new He,this._resultLineList=new He,this._resultPointList=new He,this._graph=new Zn(new QF),this._geomFact=f.getFactory()}return o(u,"e"),a&&(u.__proto__=a),u.prototype=Object.create(a&&a.prototype),u.prototype.constructor=u,u.prototype.insertUniqueEdge=function(f){var m=this._edgeList.findEqualEdge(f);if(m!==null){var v=m.getLabel(),S=f.getLabel();m.isPointwiseEqual(f)||(S=new Yr(f.getLabel())).flip();var M=m.getDepth();M.isNull()&&M.add(v),M.add(S),v.merge(S)}else this._edgeList.add(f)},u.prototype.getGraph=function(){return this._graph},u.prototype.cancelDuplicateResultEdges=function(){for(var f=this._graph.getEdgeEnds().iterator();f.hasNext();){var m=f.next(),v=m.getSym();m.isInResult()&&v.isInResult()&&(m.setInResult(!1),v.setInResult(!1))}},u.prototype.isCoveredByLA=function(f){return!!this.isCovered(f,this._resultLineList)||!!this.isCovered(f,this._resultPolyList)},u.prototype.computeGeometry=function(f,m,v,S){var M=new He;return M.addAll(f),M.addAll(m),M.addAll(v),M.isEmpty()?u.createEmptyResult(S,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(M)},u.prototype.mergeSymLabels=function(){for(var f=this._graph.getNodes().iterator();f.hasNext();)f.next().getEdges().mergeSymLabels()},u.prototype.isCovered=function(f,m){for(var v=m.iterator();v.hasNext();){var S=v.next();if(this._ptLocator.locate(f,S)!==U.EXTERIOR)return!0}return!1},u.prototype.replaceCollapsedEdges=function(){for(var f=new He,m=this._edgeList.iterator();m.hasNext();){var v=m.next();v.isCollapsed()&&(m.remove(),f.add(v.getCollapsedEdge()))}this._edgeList.addAll(f)},u.prototype.updateNodeLabelling=function(){for(var f=this._graph.getNodes().iterator();f.hasNext();){var m=f.next(),v=m.getEdges().getLabel();m.getLabel().merge(v)}},u.prototype.getResultGeometry=function(f){return this.computeOverlay(f),this._resultGeom},u.prototype.insertUniqueEdges=function(f){for(var m=f.iterator();m.hasNext();){var v=m.next();this.insertUniqueEdge(v)}},u.prototype.computeOverlay=function(f){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var m=new He;this._arg[0].computeSplitEdges(m),this._arg[1].computeSplitEdges(m),this.insertUniqueEdges(m),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Sd.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(f),this.cancelDuplicateResultEdges();var v=new Os(this._geomFact);v.add(this._graph),this._resultPolyList=v.getPolygons();var S=new Ml(this,this._geomFact,this._ptLocator);this._resultLineList=S.build(f);var M=new rm(this,this._geomFact,this._ptLocator);this._resultPointList=M.build(f),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,f)},u.prototype.labelIncompleteNode=function(f,m){var v=this._ptLocator.locate(f.getCoordinate(),this._arg[m].getGeometry());f.getLabel().setLocation(m,v)},u.prototype.copyPoints=function(f){for(var m=this._arg[f].getNodeIterator();m.hasNext();){var v=m.next();this._graph.addNode(v.getCoordinate()).setLabel(f,v.getLabel().getLocation(f))}},u.prototype.findResultAreaEdges=function(f){for(var m=this._graph.getEdgeEnds().iterator();m.hasNext();){var v=m.next(),S=v.getLabel();S.isArea()&&!v.isInteriorAreaEdge()&&u.isResultOfOp(S.getLocation(0,Ge.RIGHT),S.getLocation(1,Ge.RIGHT),f)&&v.setInResult(!0)}},u.prototype.computeLabelsFromDepths=function(){for(var f=this._edgeList.iterator();f.hasNext();){var m=f.next(),v=m.getLabel(),S=m.getDepth();if(!S.isNull()){S.normalize();for(var M=0;M<2;M++)v.isNull(M)||!v.isArea()||S.isNull(M)||(S.getDelta(M)===0?v.toLine(M):(ot.isTrue(!S.isNull(M,Ge.LEFT),"depth of LEFT side has not been initialized"),v.setLocation(M,Ge.LEFT,S.getLocation(M,Ge.LEFT)),ot.isTrue(!S.isNull(M,Ge.RIGHT),"depth of RIGHT side has not been initialized"),v.setLocation(M,Ge.RIGHT,S.getLocation(M,Ge.RIGHT))))}}},u.prototype.computeLabelling=function(){for(var f=this._graph.getNodes().iterator();f.hasNext();)f.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},u.prototype.labelIncompleteNodes=function(){for(var f=this._graph.getNodes().iterator();f.hasNext();){var m=f.next(),v=m.getLabel();m.isIsolated()&&(v.isNull(0)?this.labelIncompleteNode(m,0):this.labelIncompleteNode(m,1)),m.getEdges().updateLabelling(v)}},u.prototype.isCoveredByA=function(f){return!!this.isCovered(f,this._resultPolyList)},u.prototype.interfaces_=function(){return[]},u.prototype.getClass=function(){return u},u}(Jy);Tt.overlayOp=function(a,u,f){return new Tt(a,u).getResultGeometry(f)},Tt.intersection=function(a,u){if(a.isEmpty()||u.isEmpty())return Tt.createEmptyResult(Tt.INTERSECTION,a,u,a.getFactory());if(a.isGeometryCollection()){var f=u;return tm.map(a,{interfaces_:o(function(){return[wd.MapOp]},"interfaces_"),map:o(function(m){return m.intersection(f)},"map")})}return a.checkNotGeometryCollection(a),a.checkNotGeometryCollection(u),zo.overlayOp(a,u,Tt.INTERSECTION)},Tt.symDifference=function(a,u){if(a.isEmpty()||u.isEmpty()){if(a.isEmpty()&&u.isEmpty())return Tt.createEmptyResult(Tt.SYMDIFFERENCE,a,u,a.getFactory());if(a.isEmpty())return u.copy();if(u.isEmpty())return a.copy()}return a.checkNotGeometryCollection(a),a.checkNotGeometryCollection(u),zo.overlayOp(a,u,Tt.SYMDIFFERENCE)},Tt.resultDimension=function(a,u,f){var m=u.getDimension(),v=f.getDimension(),S=-1;switch(a){case Tt.INTERSECTION:S=Math.min(m,v);break;case Tt.UNION:S=Math.max(m,v);break;case Tt.DIFFERENCE:S=m;break;case Tt.SYMDIFFERENCE:S=Math.max(m,v)}return S},Tt.createEmptyResult=function(a,u,f,m){var v=null;switch(Tt.resultDimension(a,u,f)){case-1:v=m.createGeometryCollection(new Array(0).fill(null));break;case 0:v=m.createPoint();break;case 1:v=m.createLineString();break;case 2:v=m.createPolygon()}return v},Tt.difference=function(a,u){return a.isEmpty()?Tt.createEmptyResult(Tt.DIFFERENCE,a,u,a.getFactory()):u.isEmpty()?a.copy():(a.checkNotGeometryCollection(a),a.checkNotGeometryCollection(u),zo.overlayOp(a,u,Tt.DIFFERENCE))},Tt.isResultOfOp=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1],f=a.getLocation(0),m=a.getLocation(1);return Tt.isResultOfOp(f,m,u)}if(arguments.length===3){var v=arguments[0],S=arguments[1],M=arguments[2];switch(v===U.BOUNDARY&&(v=U.INTERIOR),S===U.BOUNDARY&&(S=U.INTERIOR),M){case Tt.INTERSECTION:return v===U.INTERIOR&&S===U.INTERIOR;case Tt.UNION:return v===U.INTERIOR||S===U.INTERIOR;case Tt.DIFFERENCE:return v===U.INTERIOR&&S!==U.INTERIOR;case Tt.SYMDIFFERENCE:return v===U.INTERIOR&&S!==U.INTERIOR||v!==U.INTERIOR&&S===U.INTERIOR}return!1}},Tt.INTERSECTION=1,Tt.UNION=2,Tt.DIFFERENCE=3,Tt.SYMDIFFERENCE=4;var qp=o(function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new tl,this._seg=new ct;var a=arguments[0],u=arguments[1];this._g=a,this._boundaryDistanceTolerance=u,this._linework=this.extractLinework(a)},"br");qp.prototype.isWithinToleranceOfBoundary=function(a){for(var u=0;u<this._linework.getNumGeometries();u++)for(var f=this._linework.getGeometryN(u).getCoordinateSequence(),m=0;m<f.size()-1;m++)if(f.getCoordinate(m,this._seg.p0),f.getCoordinate(m+1,this._seg.p1),this._seg.distance(a)<=this._boundaryDistanceTolerance)return!0;return!1},qp.prototype.getLocation=function(a){return this.isWithinToleranceOfBoundary(a)?U.BOUNDARY:this._ptLocator.locate(a,this._g)},qp.prototype.extractLinework=function(a){var u=new Qy;a.apply(u);var f=u.getLinework(),m=$t.toLineStringArray(f);return a.getFactory().createMultiLineString(m)},qp.prototype.interfaces_=function(){return[]},qp.prototype.getClass=function(){return qp};var Qy=o(function(){this._linework=null,this._linework=new He},"wr");Qy.prototype.getLinework=function(){return this._linework},Qy.prototype.filter=function(a){if(a instanceof Xr){var u=a;this._linework.add(u.getExteriorRing());for(var f=0;f<u.getNumInteriorRing();f++)this._linework.add(u.getInteriorRingN(f))}},Qy.prototype.interfaces_=function(){return[dt]},Qy.prototype.getClass=function(){return Qy};var Pd=o(function(){this._g=null,this._doLeft=!0,this._doRight=!0;var a=arguments[0];this._g=a},"Or");Pd.prototype.extractPoints=function(a,u,f){for(var m=a.getCoordinates(),v=0;v<m.length-1;v++)this.computeOffsetPoints(m[v],m[v+1],u,f)},Pd.prototype.setSidesToGenerate=function(a,u){this._doLeft=a,this._doRight=u},Pd.prototype.getPoints=function(a){for(var u=new He,f=so.getLines(this._g).iterator();f.hasNext();){var m=f.next();this.extractPoints(m,a,u)}return u},Pd.prototype.computeOffsetPoints=function(a,u,f,m){var v=u.x-a.x,S=u.y-a.y,M=Math.sqrt(v*v+S*S),B=f*v/M,z=f*S/M,te=(u.x+a.x)/2,pe=(u.y+a.y)/2;if(this._doLeft){var ye=new N(te-z,pe+B);m.add(ye)}if(this._doRight){var Xe=new N(te+z,pe-B);m.add(Xe)}},Pd.prototype.interfaces_=function(){return[]},Pd.prototype.getClass=function(){return Pd};var na=o(function a(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=a.TOLERANCE,this._testCoords=new He;var u=arguments[0],f=arguments[1],m=arguments[2];this._boundaryDistanceTolerance=a.computeBoundaryDistanceTolerance(u,f),this._geom=[u,f,m],this._locFinder=[new qp(this._geom[0],this._boundaryDistanceTolerance),new qp(this._geom[1],this._boundaryDistanceTolerance),new qp(this._geom[2],this._boundaryDistanceTolerance)]},"t"),uN={TOLERANCE:{configurable:!0}};na.prototype.reportResult=function(a,u,f){Se.out.println("Overlay result invalid - A:"+U.toLocationSymbol(u[0])+" B:"+U.toLocationSymbol(u[1])+" expected:"+(f?"i":"e")+" actual:"+U.toLocationSymbol(u[2]))},na.prototype.isValid=function(a){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var u=this.checkValid(a);return u},na.prototype.checkValid=function(){if(arguments.length===1){for(var a=arguments[0],u=0;u<this._testCoords.size();u++){var f=this._testCoords.get(u);if(!this.checkValid(a,f))return this._invalidLocation=f,!1}return!0}if(arguments.length===2){var m=arguments[0],v=arguments[1];return this._location[0]=this._locFinder[0].getLocation(v),this._location[1]=this._locFinder[1].getLocation(v),this._location[2]=this._locFinder[2].getLocation(v),!!na.hasLocation(this._location,U.BOUNDARY)||this.isValidResult(m,this._location)}},na.prototype.addTestPts=function(a){var u=new Pd(a);this._testCoords.addAll(u.getPoints(5*this._boundaryDistanceTolerance))},na.prototype.isValidResult=function(a,u){var f=Tt.isResultOfOp(u[0],u[1],a),m=!(f^u[2]===U.INTERIOR);return m||this.reportResult(a,u,f),m},na.prototype.getInvalidLocation=function(){return this._invalidLocation},na.prototype.interfaces_=function(){return[]},na.prototype.getClass=function(){return na},na.hasLocation=function(a,u){for(var f=0;f<3;f++)if(a[f]===u)return!0;return!1},na.computeBoundaryDistanceTolerance=function(a,u){return Math.min(ui.computeSizeBasedSnapTolerance(a),ui.computeSizeBasedSnapTolerance(u))},na.isValid=function(a,u,f,m){return new na(a,u,m).isValid(f)},uN.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(na,uN);var ia=o(function a(u){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=a.extractFactory(u),this._inputGeoms=u},"t");ia.prototype.extractElements=function(a,u){if(a===null)return null;for(var f=0;f<a.getNumGeometries();f++){var m=a.getGeometryN(f);this._skipEmpty&&m.isEmpty()||u.add(m)}},ia.prototype.combine=function(){for(var a=new He,u=this._inputGeoms.iterator();u.hasNext();){var f=u.next();this.extractElements(f,a)}return a.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(a)},ia.prototype.interfaces_=function(){return[]},ia.prototype.getClass=function(){return ia},ia.combine=function(){if(arguments.length===1){var a=arguments[0];return new ia(a).combine()}if(arguments.length===2){var u=arguments[0],f=arguments[1];return new ia(ia.createList(u,f)).combine()}if(arguments.length===3){var m=arguments[0],v=arguments[1],S=arguments[2];return new ia(ia.createList(m,v,S)).combine()}},ia.extractFactory=function(a){return a.isEmpty()?null:a.iterator().next().getFactory()},ia.createList=function(){if(arguments.length===2){var a=arguments[0],u=arguments[1],f=new He;return f.add(a),f.add(u),f}if(arguments.length===3){var m=arguments[0],v=arguments[1],S=arguments[2],M=new He;return M.add(m),M.add(v),M.add(S),M}};var xi=o(function(){this._inputPolys=null,this._geomFactory=null;var a=arguments[0];this._inputPolys=a,this._inputPolys===null&&(this._inputPolys=new He)},"Dr"),cN={STRTREE_NODE_CAPACITY:{configurable:!0}};xi.prototype.reduceToGeometries=function(a){for(var u=new He,f=a.iterator();f.hasNext();){var m=f.next(),v=null;ne(m,ts)?v=this.unionTree(m):m instanceof vt&&(v=m),u.add(v)}return u},xi.prototype.extractByEnvelope=function(a,u,f){for(var m=new He,v=0;v<u.getNumGeometries();v++){var S=u.getGeometryN(v);S.getEnvelopeInternal().intersects(a)?m.add(S):f.add(S)}return this._geomFactory.buildGeometry(m)},xi.prototype.unionOptimized=function(a,u){var f=a.getEnvelopeInternal(),m=u.getEnvelopeInternal();if(!f.intersects(m))return ia.combine(a,u);if(a.getNumGeometries()<=1&&u.getNumGeometries()<=1)return this.unionActual(a,u);var v=f.intersection(m);return this.unionUsingEnvelopeIntersection(a,u,v)},xi.prototype.union=function(){if(this._inputPolys===null)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var a=new WF(xi.STRTREE_NODE_CAPACITY),u=this._inputPolys.iterator();u.hasNext();){var f=u.next();a.insert(f.getEnvelopeInternal(),f)}this._inputPolys=null;var m=a.itemsTree();return this.unionTree(m)},xi.prototype.binaryUnion=function(){if(arguments.length===1){var a=arguments[0];return this.binaryUnion(a,0,a.size())}if(arguments.length===3){var u=arguments[0],f=arguments[1],m=arguments[2];if(m-f<=1){var v=xi.getGeometry(u,f);return this.unionSafe(v,null)}if(m-f==2)return this.unionSafe(xi.getGeometry(u,f),xi.getGeometry(u,f+1));var S=Math.trunc((m+f)/2),M=this.binaryUnion(u,f,S),B=this.binaryUnion(u,S,m);return this.unionSafe(M,B)}},xi.prototype.repeatedUnion=function(a){for(var u=null,f=a.iterator();f.hasNext();){var m=f.next();u=u===null?m.copy():u.union(m)}return u},xi.prototype.unionSafe=function(a,u){return a===null&&u===null?null:a===null?u.copy():u===null?a.copy():this.unionOptimized(a,u)},xi.prototype.unionActual=function(a,u){return xi.restrictToPolygons(a.union(u))},xi.prototype.unionTree=function(a){var u=this.reduceToGeometries(a);return this.binaryUnion(u)},xi.prototype.unionUsingEnvelopeIntersection=function(a,u,f){var m=new He,v=this.extractByEnvelope(f,a,m),S=this.extractByEnvelope(f,u,m),M=this.unionActual(v,S);return m.add(M),ia.combine(m)},xi.prototype.bufferUnion=function(){if(arguments.length===1){var a=arguments[0];return a.get(0).getFactory().buildGeometry(a).buffer(0)}if(arguments.length===2){var u=arguments[0],f=arguments[1];return u.getFactory().createGeometryCollection([u,f]).buffer(0)}},xi.prototype.interfaces_=function(){return[]},xi.prototype.getClass=function(){return xi},xi.restrictToPolygons=function(a){if(ne(a,Hi))return a;var u=Sc.getPolygons(a);return u.size()===1?u.get(0):a.getFactory().createMultiPolygon($t.toPolygonArray(u))},xi.getGeometry=function(a,u){return u>=a.size()?null:a.get(u)},xi.union=function(a){return new xi(a).union()},cN.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(xi,cN);var Tb=o(function(){},"Ar");Tb.prototype.interfaces_=function(){return[]},Tb.prototype.getClass=function(){return Tb},Tb.union=function(a,u){if(a.isEmpty()||u.isEmpty()){if(a.isEmpty()&&u.isEmpty())return Tt.createEmptyResult(Tt.UNION,a,u,a.getFactory());if(a.isEmpty())return u.copy();if(u.isEmpty())return a.copy()}return a.checkNotGeometryCollection(a),a.checkNotGeometryCollection(u),zo.overlayOp(a,u,Tt.UNION)},e.GeoJSONReader=uE,e.GeoJSONWriter=qF,e.OverlayOp=Tt,e.UnionOp=Tb,e.BufferOp=oo,Object.defineProperty(e,"__esModule",{value:!0})})});var Cx=fe(yn=>{"use strict";g();Object.defineProperty(yn,"__esModule",{value:!0});yn.regexpCode=yn.getEsmExportName=yn.getProperty=yn.safeStringify=yn.stringify=yn.strConcat=yn.addCodeArg=yn.str=yn._=yn.nil=yn._Code=yn.Name=yn.IDENTIFIER=yn._CodeOrName=void 0;var VO=class VO{};o(VO,"_CodeOrName");var _x=VO;yn._CodeOrName=_x;yn.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var zO=class zO extends _x{constructor(t){if(super(),!yn.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};o(zO,"Name");var Jm=zO;yn.Name=Jm;var qO=class qO extends _x{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>"".concat(r).concat(n),"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof Jm&&(r[n.str]=(r[n.str]||0)+1),r),{})}};o(qO,"_Code");var Bl=qO;yn._Code=Bl;yn.nil=new Bl("");function wG(e,...t){let r=[e[0]],n=0;for(;n<t.length;)UO(r,t[n]),r.push(e[++n]);return new Bl(r)}o(wG,"_");yn._=wG;var GO=new Bl("+");function PG(e,...t){let r=[Sx(e[0])],n=0;for(;n<t.length;)r.push(GO),UO(r,t[n]),r.push(GO,Sx(e[++n]));return nde(r),new Bl(r)}o(PG,"str");yn.str=PG;function UO(e,t){t instanceof Bl?e.push(...t._items):t instanceof Jm?e.push(t):e.push(sde(t))}o(UO,"addCodeArg");yn.addCodeArg=UO;function nde(e){let t=1;for(;t<e.length-1;){if(e[t]===GO){let r=ide(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}o(nde,"optimize");function ide(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof Jm||e[e.length-1]!=='"'?void 0:typeof t!="string"?"".concat(e.slice(0,-1)).concat(t,'"'):t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof Jm))return'"'.concat(e).concat(t.slice(1))}o(ide,"mergeExprItems");var SG;function ode(e,t){return t.emptyStr()?e:e.emptyStr()?t:PG(SG||(SG=V(["","",""])),e,t)}o(ode,"strConcat");yn.strConcat=ode;function sde(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Sx(Array.isArray(e)?e.join(","):e)}o(sde,"interpolate");function ade(e){return new Bl(Sx(e))}o(ade,"stringify");yn.stringify=ade;function Sx(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}o(Sx,"safeStringify");yn.safeStringify=Sx;var CG;function lde(e){return typeof e=="string"&&yn.IDENTIFIER.test(e)?new Bl(".".concat(e)):wG(CG||(CG=V(["[","]"])),e)}o(lde,"getProperty");yn.getProperty=lde;function ude(e){if(typeof e=="string"&&yn.IDENTIFIER.test(e))return new Bl("".concat(e));throw new Error("CodeGen: invalid export name: ".concat(e,", use explicit $id name mapping"))}o(ude,"getEsmExportName");yn.getEsmExportName=ude;function cde(e){return new Bl(e.toString())}o(cde,"regexpCode");yn.regexpCode=cde});var JO=fe(Da=>{"use strict";g();Object.defineProperty(Da,"__esModule",{value:!0});Da.ValueScope=Da.ValueScopeName=Da.Scope=Da.varKinds=Da.UsedValueState=void 0;var Aa=Cx(),XO=class XO extends Error{constructor(t){super('CodeGen: "code" for '.concat(t," not defined")),this.value=t.value}};o(XO,"ValueError");var HO=XO,EC;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(EC||(Da.UsedValueState=EC={}));Da.varKinds={const:new Aa.Name("const"),let:new Aa.Name("let"),var:new Aa.Name("var")};var YO=class YO{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof Aa.Name?t:this.name(t)}name(t){return new Aa.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return"".concat(t).concat(r.index++)}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error('CodeGen: prefix "'.concat(t,'" is not allowed in this scope'));return this._names[t]={prefix:t,index:0}}};o(YO,"Scope");var MC=YO;Da.Scope=MC;var TG,ZO=class ZO extends Aa.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,Aa._)(TG||(TG=V([".","[","]"])),new Aa.Name(r),n)}};o(ZO,"ValueScopeName");var OC=ZO;Da.ValueScopeName=OC;var EG,pde=(0,Aa._)(EG||(EG=V(["\n"],["\\n"]))),MG,OG,LG,KO=class KO extends MC{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts=re(k({},t),{_n:t.lines?pde:Aa.nil})}get(){return this._scope}name(t){return new OC(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(t),{prefix:s}=i,l=(n=r.key)!==null&&n!==void 0?n:r.ref,c=this._values[s];if(c){let y=c.get(l);if(y)return y}else c=this._values[s]=new Map;c.set(l,i);let p=this._scope[s]||(this._scope[s]=[]),h=p.length;return p[h]=r.ref,i.setValue(r,{property:s,itemIndex:h}),i}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error('CodeGen: name "'.concat(n,'" has no value'));return(0,Aa._)(MG||(MG=V(["","",""])),t,n.scopePath)})}scopeCode(t=this._values,r,n){return this._reduceValues(t,i=>{if(i.value===void 0)throw new Error('CodeGen: name "'.concat(i,'" has no value'));return i.value.code},r,n)}_reduceValues(t,r,n={},i){let s=Aa.nil;for(let l in t){let c=t[l];if(!c)continue;let p=n[l]=n[l]||new Map;c.forEach(h=>{if(p.has(h))return;p.set(h,EC.Started);let y=r(h);if(y){let b=this.opts.es5?Da.varKinds.var:Da.varKinds.const;s=(0,Aa._)(OG||(OG=V(["",""," "," = ",";",""])),s,b,h,y,this.opts._n)}else if(y=i==null?void 0:i(h))s=(0,Aa._)(LG||(LG=V(["","","",""])),s,y,this.opts._n);else throw new HO(h);p.set(h,EC.Completed)})}return s}};o(KO,"ValueScope");var WO=KO;Da.ValueScope=WO});var Wt=fe(Kt=>{"use strict";g();Object.defineProperty(Kt,"__esModule",{value:!0});Kt.or=Kt.and=Kt.not=Kt.CodeGen=Kt.operators=Kt.varKinds=Kt.ValueScopeName=Kt.ValueScope=Kt.Scope=Kt.Name=Kt.regexpCode=Kt.stringify=Kt.getProperty=Kt.nil=Kt.strConcat=Kt.str=Kt._=void 0;var Kr=Cx(),ku=JO(),Wd=Cx();Object.defineProperty(Kt,"_",{enumerable:!0,get:o(function(){return Wd._},"get")});Object.defineProperty(Kt,"str",{enumerable:!0,get:o(function(){return Wd.str},"get")});Object.defineProperty(Kt,"strConcat",{enumerable:!0,get:o(function(){return Wd.strConcat},"get")});Object.defineProperty(Kt,"nil",{enumerable:!0,get:o(function(){return Wd.nil},"get")});Object.defineProperty(Kt,"getProperty",{enumerable:!0,get:o(function(){return Wd.getProperty},"get")});Object.defineProperty(Kt,"stringify",{enumerable:!0,get:o(function(){return Wd.stringify},"get")});Object.defineProperty(Kt,"regexpCode",{enumerable:!0,get:o(function(){return Wd.regexpCode},"get")});Object.defineProperty(Kt,"Name",{enumerable:!0,get:o(function(){return Wd.Name},"get")});var FC=JO();Object.defineProperty(Kt,"Scope",{enumerable:!0,get:o(function(){return FC.Scope},"get")});Object.defineProperty(Kt,"ValueScope",{enumerable:!0,get:o(function(){return FC.ValueScope},"get")});Object.defineProperty(Kt,"ValueScopeName",{enumerable:!0,get:o(function(){return FC.ValueScopeName},"get")});Object.defineProperty(Kt,"varKinds",{enumerable:!0,get:o(function(){return FC.varKinds},"get")});Kt.operators={GT:new Kr._Code(">"),GTE:new Kr._Code(">="),LT:new Kr._Code("<"),LTE:new Kr._Code("<="),EQ:new Kr._Code("==="),NEQ:new Kr._Code("!=="),NOT:new Kr._Code("!"),OR:new Kr._Code("||"),AND:new Kr._Code("&&"),ADD:new Kr._Code("+")};var p4=class p4{optimizeNodes(){return this}optimizeNames(t,r){return this}};o(p4,"Node");var hf=p4,f4=class f4 extends hf{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?ku.varKinds.var:this.varKind,i=this.rhs===void 0?"":" = ".concat(this.rhs);return"".concat(n," ").concat(this.name).concat(i,";")+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=V0(this.rhs,t,r)),this}get names(){return this.rhs instanceof Kr._CodeOrName?this.rhs.names:{}}};o(f4,"Def");var QO=f4,d4=class d4 extends hf{constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return"".concat(this.lhs," = ").concat(this.rhs,";")+t}optimizeNames(t,r){if(!(this.lhs instanceof Kr.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=V0(this.rhs,t,r),this}get names(){let t=this.lhs instanceof Kr.Name?{}:k({},this.lhs.names);return DC(t,this.rhs)}};o(d4,"Assign");var LC=d4,h4=class h4 extends LC{constructor(t,r,n,i){super(t,n,i),this.op=r}render({_n:t}){return"".concat(this.lhs," ").concat(this.op,"= ").concat(this.rhs,";")+t}};o(h4,"AssignOp");var e4=h4,m4=class m4 extends hf{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return"".concat(this.label,":")+t}};o(m4,"Label");var t4=m4,g4=class g4 extends hf{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){let r=this.label?" ".concat(this.label):"";return"break".concat(r,";")+t}};o(g4,"Break");var r4=g4,y4=class y4 extends hf{constructor(t){super(),this.error=t}render({_n:t}){return"throw ".concat(this.error,";")+t}get names(){return this.error.names}};o(y4,"Throw");var n4=y4,v4=class v4 extends hf{constructor(t){super(),this.code=t}render({_n:t}){return"".concat(this.code,";")+t}optimizeNodes(){return"".concat(this.code)?this:void 0}optimizeNames(t,r){return this.code=V0(this.code,t,r),this}get names(){return this.code instanceof Kr._CodeOrName?this.code.names:{}}};o(v4,"AnyCode");var i4=v4,b4=class b4 extends hf{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(t,r)||(fde(t,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>tg(t,r.names),{})}};o(b4,"ParentNode");var wx=b4,x4=class x4 extends wx{render(t){return"{"+t._n+super.render(t)+"}"+t._n}};o(x4,"BlockNode");var mf=x4,I4=class I4 extends wx{};o(I4,"Root");var o4=I4,_4=class _4 extends mf{};o(_4,"Else");var U0=_4;U0.kind="else";var G0=class G0 extends mf{constructor(t,r){super(r),this.condition=t}render(t){let r="if(".concat(this.condition,")")+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new U0(n):n}if(r)return t===!1?r instanceof G0?r:r.nodes:this.nodes.length?this:new G0(BG(t),r instanceof G0?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=V0(this.condition,t,r),this}get names(){let t=super.names;return DC(t,this.condition),this.else&&tg(t,this.else.names),t}};o(G0,"If");var Qm=G0;Qm.kind="if";var S4=class S4 extends mf{};o(S4,"For");var eg=S4;eg.kind="for";var C4=class C4 extends eg{constructor(t){super(),this.iteration=t}render(t){return"for(".concat(this.iteration,")")+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=V0(this.iteration,t,r),this}get names(){return tg(super.names,this.iteration.names)}};o(C4,"ForLoop");var s4=C4,w4=class w4 extends eg{constructor(t,r,n,i){super(),this.varKind=t,this.name=r,this.from=n,this.to=i}render(t){let r=t.es5?ku.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return"for(".concat(r," ").concat(n,"=").concat(i,"; ").concat(n,"<").concat(s,"; ").concat(n,"++)")+super.render(t)}get names(){let t=DC(super.names,this.from);return DC(t,this.to)}};o(w4,"ForRange");var a4=w4,P4=class P4 extends eg{constructor(t,r,n,i){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=i}render(t){return"for(".concat(this.varKind," ").concat(this.name," ").concat(this.loop," ").concat(this.iterable,")")+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=V0(this.iterable,t,r),this}get names(){return tg(super.names,this.iterable.names)}};o(P4,"ForIter");var AC=P4,T4=class T4 extends mf{constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){let r=this.async?"async ":"";return"".concat(r,"function ").concat(this.name,"(").concat(this.args,")")+super.render(t)}};o(T4,"Func");var Px=T4;Px.kind="func";var E4=class E4 extends wx{render(t){return"return "+super.render(t)}};o(E4,"Return");var Tx=E4;Tx.kind="return";var M4=class M4 extends mf{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,i;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(i=this.finally)===null||i===void 0||i.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&tg(t,this.catch.names),this.finally&&tg(t,this.finally.names),t}};o(M4,"Try");var l4=M4,O4=class O4 extends mf{constructor(t){super(),this.error=t}render(t){return"catch(".concat(this.error,")")+super.render(t)}};o(O4,"Catch");var Ex=O4;Ex.kind="catch";var L4=class L4 extends mf{render(t){return"finally"+super.render(t)}};o(L4,"Finally");var Mx=L4;Mx.kind="finally";var AG,DG,FG,A4=class A4{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts=re(k({},r),{_n:r.lines?"\n":""}),this._extScope=t,this._scope=new ku.Scope({parent:t}),this._nodes=[new o4]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,i){let s=this._scope.toName(r);return n!==void 0&&i&&(this._constants[s.str]=n),this._leafNode(new QO(t,s,n)),s}const(t,r,n){return this._def(ku.varKinds.const,t,r,n)}let(t,r,n){return this._def(ku.varKinds.let,t,r,n)}var(t,r,n){return this._def(ku.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new LC(t,r,n))}add(t,r){return this._leafNode(new e4(t,Kt.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==Kr.nil&&this._leafNode(new i4(t)),this}object(...t){let r=["{"];for(let[n,i]of t)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,Kr.addCodeArg)(r,i));return r.push("}"),new Kr._Code(r)}if(t,r,n){if(this._blockNode(new Qm(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new Qm(t))}else(){return this._elseNode(new U0)}endIf(){return this._endBlockNode(Qm,U0)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new s4(t),r)}forRange(t,r,n,i,s=this.opts.es5?ku.varKinds.var:ku.varKinds.let){let l=this._scope.toName(t);return this._for(new a4(s,l,r,n),()=>i(l))}forOf(t,r,n,i=ku.varKinds.const){let s=this._scope.toName(t);if(this.opts.es5){let l=r instanceof Kr.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Kr._)(AG||(AG=V(["",".length"])),l),c=>{this.var(s,(0,Kr._)(DG||(DG=V(["","[","]"])),l,c)),n(s)})}return this._for(new AC("of",i,s,r),()=>n(s))}forIn(t,r,n,i=this.opts.es5?ku.varKinds.var:ku.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,Kr._)(FG||(FG=V(["Object.keys(",")"])),r),n);let s=this._scope.toName(t);return this._for(new AC("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(eg)}label(t){return this._leafNode(new t4(t))}break(t){return this._leafNode(new r4(t))}return(t){let r=new Tx;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Tx)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new l4;if(this._blockNode(i),this.code(t),r){let s=this.name("e");this._currNode=i.catch=new Ex(s),r(s)}return n&&(this._currNode=i.finally=new Mx,this.code(n)),this._endBlockNode(Ex,Mx)}throw(t){return this._leafNode(new n4(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error("CodeGen: wrong number of nodes: ".concat(n," vs ").concat(t," expected"));return this._nodes.length=r,this}func(t,r=Kr.nil,n,i){return this._blockNode(new Px(t,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Px)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error('CodeGen: not in block "'.concat(r?"".concat(t.kind,"/").concat(r.kind):t.kind,'"'))}_elseNode(t){let r=this._currNode;if(!(r instanceof Qm))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};o(A4,"CodeGen");var u4=A4;Kt.CodeGen=u4;function tg(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}o(tg,"addNames");function DC(e,t){return t instanceof Kr._CodeOrName?tg(e,t.names):e}o(DC,"addExprNames");function V0(e,t,r){if(e instanceof Kr.Name)return n(e);if(!i(e))return e;return new Kr._Code(e._items.reduce((s,l)=>(l instanceof Kr.Name&&(l=n(l)),l instanceof Kr._Code?s.push(...l._items):s.push(l),s),[]));function n(s){let l=r[s.str];return l===void 0||t[s.str]!==1?s:(delete t[s.str],l)}function i(s){return s instanceof Kr._Code&&s._items.some(l=>l instanceof Kr.Name&&t[l.str]===1&&r[l.str]!==void 0)}}o(V0,"optimizeExpr");function fde(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}o(fde,"subtractNames");var NG;function BG(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,Kr._)(NG||(NG=V(["!",""])),c4(e))}o(BG,"not");Kt.not=BG;var dde=$G(Kt.operators.AND);function hde(...e){return e.reduce(dde)}o(hde,"and");Kt.and=hde;var mde=$G(Kt.operators.OR);function gde(...e){return e.reduce(mde)}o(gde,"or");Kt.or=gde;var kG;function $G(e){return(t,r)=>t===Kr.nil?r:r===Kr.nil?t:(0,Kr._)(kG||(kG=V([""," "," ",""])),c4(t),e,c4(r))}o($G,"mappend");var RG;function c4(e){return e instanceof Kr.Name?e:(0,Kr._)(RG||(RG=V(["(",")"])),e)}o(c4,"par")});var vn=fe(Pr=>{"use strict";g();Object.defineProperty(Pr,"__esModule",{value:!0});Pr.checkStrictMode=Pr.getErrorPath=Pr.Type=Pr.useFunc=Pr.setEvaluated=Pr.evaluatedPropsToName=Pr.mergeEvaluated=Pr.eachItem=Pr.unescapeJsonPointer=Pr.escapeJsonPointer=Pr.escapeFragment=Pr.unescapeFragment=Pr.schemaRefOrVal=Pr.schemaHasRulesButRef=Pr.schemaHasRules=Pr.checkUnknownRules=Pr.alwaysValidSchema=Pr.toHash=void 0;var Kn=Wt(),yde=Cx();function vde(e){let t={};for(let r of e)t[r]=!0;return t}o(vde,"toHash");Pr.toHash=vde;function bde(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(sU(e,t),!aU(t,e.self.RULES.all))}o(bde,"alwaysValidSchema");Pr.alwaysValidSchema=bde;function sU(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let i=n.RULES.keywords;for(let s in t)i[s]||cU(e,'unknown keyword: "'.concat(s,'"'))}o(sU,"checkUnknownRules");Pr.checkUnknownRules=sU;function aU(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}o(aU,"schemaHasRules");Pr.schemaHasRules=aU;function xde(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}o(xde,"schemaHasRulesButRef");Pr.schemaHasRulesButRef=xde;var UG,VG;function Ide({topSchemaRef:e,schemaPath:t},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Kn._)(UG||(UG=V(["",""])),r)}return(0,Kn._)(VG||(VG=V(["","","",""])),e,t,(0,Kn.getProperty)(n))}o(Ide,"schemaRefOrVal");Pr.schemaRefOrVal=Ide;function _de(e){return lU(decodeURIComponent(e))}o(_de,"unescapeFragment");Pr.unescapeFragment=_de;function Sde(e){return encodeURIComponent(F4(e))}o(Sde,"escapeFragment");Pr.escapeFragment=Sde;function F4(e){return typeof e=="number"?"".concat(e):e.replace(/~/g,"~0").replace(/\//g,"~1")}o(F4,"escapeJsonPointer");Pr.escapeJsonPointer=F4;function lU(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}o(lU,"unescapeJsonPointer");Pr.unescapeJsonPointer=lU;function Cde(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}o(Cde,"eachItem");Pr.eachItem=Cde;function jG({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(i,s,l,c)=>{let p=l===void 0?s:l instanceof Kn.Name?(s instanceof Kn.Name?e(i,s,l):t(i,s,l),l):s instanceof Kn.Name?(t(i,l,s),s):r(s,l);return c===Kn.Name&&!(p instanceof Kn.Name)?n(i,p):p}}o(jG,"makeMergeEvaluated");var zG,qG,HG,WG,XG,YG,ZG,KG,JG,QG;Pr.mergeEvaluated={props:jG({mergeNames:o((e,t,r)=>e.if((0,Kn._)(zG||(zG=V([""," !== true && "," !== undefined"])),r,t),()=>{e.if((0,Kn._)(qG||(qG=V([""," === true"])),t),()=>e.assign(r,!0),()=>e.assign(r,(0,Kn._)(HG||(HG=V([""," || {}"])),r)).code((0,Kn._)(WG||(WG=V(["Object.assign(",", ",")"])),r,t)))}),"mergeNames"),mergeToName:o((e,t,r)=>e.if((0,Kn._)(XG||(XG=V([""," !== true"])),r),()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,Kn._)(YG||(YG=V([""," || {}"])),r)),N4(e,r,t))}),"mergeToName"),mergeValues:o((e,t)=>e===!0?!0:k(k({},e),t),"mergeValues"),resultToName:uU}),items:jG({mergeNames:o((e,t,r)=>e.if((0,Kn._)(ZG||(ZG=V([""," !== true && "," !== undefined"])),r,t),()=>e.assign(r,(0,Kn._)(KG||(KG=V([""," === true ? true : "," > "," ? "," : ",""])),t,r,t,r,t))),"mergeNames"),mergeToName:o((e,t,r)=>e.if((0,Kn._)(JG||(JG=V([""," !== true"])),r),()=>e.assign(r,t===!0?!0:(0,Kn._)(QG||(QG=V([""," > "," ? "," : ",""])),r,t,r,t))),"mergeToName"),mergeValues:o((e,t)=>e===!0?!0:Math.max(e,t),"mergeValues"),resultToName:o((e,t)=>e.var("items",t),"resultToName")})};var eU;function uU(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,Kn._)(eU||(eU=V(["{}"]))));return t!==void 0&&N4(e,r,t),r}o(uU,"evaluatedPropsToName");Pr.evaluatedPropsToName=uU;var tU;function N4(e,t,r){Object.keys(r).forEach(n=>e.assign((0,Kn._)(tU||(tU=V(["","",""])),t,(0,Kn.getProperty)(n)),!0))}o(N4,"setEvaluated");Pr.setEvaluated=N4;var GG={};function wde(e,t){return e.scopeValue("func",{ref:t,code:GG[t.code]||(GG[t.code]=new yde._Code(t.code))})}o(wde,"useFunc");Pr.useFunc=wde;var D4;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(D4||(Pr.Type=D4={}));var rU,nU,iU,oU;function Pde(e,t,r){if(e instanceof Kn.Name){let n=t===D4.Num;return r?n?(0,Kn._)(rU||(rU=V(['"[" + ',' + "]"'])),e):(0,Kn._)(nU||(nU=V(['"[\'" + ',' + "\']"'])),e):n?(0,Kn._)(iU||(iU=V(['"/" + ',""])),e):(0,Kn._)(oU||(oU=V(['"/" + ','.replace(/~/g, "~0").replace(/\\//g, "~1")'],['"/" + ','.replace(/~/g, "~0").replace(/\\\\//g, "~1")'])),e)}return r?(0,Kn.getProperty)(e).toString():"/"+F4(e)}o(Pde,"getErrorPath");Pr.getErrorPath=Pde;function cU(e,t,r=e.opts.strictSchema){if(r){if(t="strict mode: ".concat(t),r===!0)throw new Error(t);e.self.logger.warn(t)}}o(cU,"checkStrictMode");Pr.checkStrictMode=cU});var gf=fe(k4=>{"use strict";g();Object.defineProperty(k4,"__esModule",{value:!0});var Rs=Wt(),Tde={data:new Rs.Name("data"),valCxt:new Rs.Name("valCxt"),instancePath:new Rs.Name("instancePath"),parentData:new Rs.Name("parentData"),parentDataProperty:new Rs.Name("parentDataProperty"),rootData:new Rs.Name("rootData"),dynamicAnchors:new Rs.Name("dynamicAnchors"),vErrors:new Rs.Name("vErrors"),errors:new Rs.Name("errors"),this:new Rs.Name("this"),self:new Rs.Name("self"),scope:new Rs.Name("scope"),json:new Rs.Name("json"),jsonPos:new Rs.Name("jsonPos"),jsonLen:new Rs.Name("jsonLen"),jsonPart:new Rs.Name("jsonPart")};k4.default=Tde});var Ox=fe(Bs=>{"use strict";g();Object.defineProperty(Bs,"__esModule",{value:!0});Bs.extendErrors=Bs.resetErrorsCount=Bs.reportExtraError=Bs.reportError=Bs.keyword$DataError=Bs.keywordError=void 0;var on=Wt(),NC=vn(),pa=gf(),pU;Bs.keywordError={message:o(({keyword:e})=>(0,on.str)(pU||(pU=V(['must pass "','" keyword validation'])),e),"message")};var fU,dU;Bs.keyword$DataError={message:o(({keyword:e,schemaType:t})=>t?(0,on.str)(fU||(fU=V(['"','" keyword must be '," ($data)"])),e,t):(0,on.str)(dU||(dU=V(['"','" keyword is invalid ($data)'])),e),"message")};var hU;function Ede(e,t=Bs.keywordError,r,n){let{it:i}=e,{gen:s,compositeRule:l,allErrors:c}=i,p=BU(e,t,r);(n!=null?n:l||c)?kU(s,p):RU(i,(0,on._)(hU||(hU=V(["[","]"])),p))}o(Ede,"reportError");Bs.reportError=Ede;function Mde(e,t=Bs.keywordError,r){let{it:n}=e,{gen:i,compositeRule:s,allErrors:l}=n,c=BU(e,t,r);kU(i,c),s||l||RU(n,pa.default.vErrors)}o(Mde,"reportExtraError");Bs.reportExtraError=Mde;var mU,gU;function Ode(e,t){e.assign(pa.default.errors,t),e.if((0,on._)(mU||(mU=V([""," !== null"])),pa.default.vErrors),()=>e.if(t,()=>e.assign((0,on._)(gU||(gU=V(["",".length"])),pa.default.vErrors),t),()=>e.assign(pa.default.vErrors,null)))}o(Ode,"resetErrorsCount");Bs.resetErrorsCount=Ode;var yU,vU,bU,xU,IU,_U,SU;function Lde({gen:e,keyword:t,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let l=e.name("err");e.forRange("i",i,pa.default.errors,c=>{e.const(l,(0,on._)(yU||(yU=V(["","[","]"])),pa.default.vErrors,c)),e.if((0,on._)(vU||(vU=V(["",".instancePath === undefined"])),l),()=>e.assign((0,on._)(bU||(bU=V(["",".instancePath"])),l),(0,on.strConcat)(pa.default.instancePath,s.errorPath))),e.assign((0,on._)(xU||(xU=V(["",".schemaPath"])),l),(0,on.str)(IU||(IU=V(["","/",""])),s.errSchemaPath,t)),s.opts.verbose&&(e.assign((0,on._)(_U||(_U=V(["",".schema"])),l),r),e.assign((0,on._)(SU||(SU=V(["",".data"])),l),n))})}o(Lde,"extendErrors");Bs.extendErrors=Lde;var CU,wU,PU,TU;function kU(e,t){let r=e.const("err",t);e.if((0,on._)(CU||(CU=V([""," === null"])),pa.default.vErrors),()=>e.assign(pa.default.vErrors,(0,on._)(wU||(wU=V(["[","]"])),r)),(0,on._)(PU||(PU=V(["",".push(",")"])),pa.default.vErrors,r)),e.code((0,on._)(TU||(TU=V(["","++"])),pa.default.errors))}o(kU,"addError");var EU,MU;function RU(e,t){let{gen:r,validateName:n,schemaEnv:i}=e;i.$async?r.throw((0,on._)(EU||(EU=V(["new ","(",")"])),e.ValidationError,t)):(r.assign((0,on._)(MU||(MU=V(["",".errors"])),n),t),r.return(!1))}o(RU,"returnErrors");var rg={keyword:new on.Name("keyword"),schemaPath:new on.Name("schemaPath"),params:new on.Name("params"),propertyName:new on.Name("propertyName"),message:new on.Name("message"),schema:new on.Name("schema"),parentSchema:new on.Name("parentSchema")},OU;function BU(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,on._)(OU||(OU=V(["{}"]))):Ade(e,t,r)}o(BU,"errorObjectCode");function Ade(e,t,r={}){let{gen:n,it:i}=e,s=[Dde(i,r),Fde(e,r)];return Nde(e,t,s),n.object(...s)}o(Ade,"errorObject");var LU;function Dde({errorPath:e},{instancePath:t}){let r=t?(0,on.str)(LU||(LU=V(["","",""])),e,(0,NC.getErrorPath)(t,NC.Type.Str)):e;return[pa.default.instancePath,(0,on.strConcat)(pa.default.instancePath,r)]}o(Dde,"errorInstancePath");var AU,DU;function Fde({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let i=n?t:(0,on.str)(AU||(AU=V(["","/",""])),t,e);return r&&(i=(0,on.str)(DU||(DU=V(["","",""])),i,(0,NC.getErrorPath)(r,NC.Type.Str))),[rg.schemaPath,i]}o(Fde,"errorSchemaPath");var FU,NU;function Nde(e,{params:t,message:r},n){let{keyword:i,data:s,schemaValue:l,it:c}=e,{opts:p,propertyName:h,topSchemaRef:y,schemaPath:b}=c;n.push([rg.keyword,i],[rg.params,typeof t=="function"?t(e):t||(0,on._)(FU||(FU=V(["{}"])))]),p.messages&&n.push([rg.message,typeof r=="function"?r(e):r]),p.verbose&&n.push([rg.schema,l],[rg.parentSchema,(0,on._)(NU||(NU=V(["","",""])),y,b)],[pa.default.data,s]),h&&n.push([rg.propertyName,h])}o(Nde,"extraErrorProps")});var GU=fe(z0=>{"use strict";g();Object.defineProperty(z0,"__esModule",{value:!0});z0.boolOrEmptySchema=z0.topBoolOrEmptySchema=void 0;var kde=Ox(),Rde=Wt(),Bde=gf(),$de={message:"boolean schema is false"},$U;function jde(e){let{gen:t,schema:r,validateName:n}=e;r===!1?jU(e,!1):typeof r=="object"&&r.$async===!0?t.return(Bde.default.data):(t.assign((0,Rde._)($U||($U=V(["",".errors"])),n),null),t.return(!0))}o(jde,"topBoolOrEmptySchema");z0.topBoolOrEmptySchema=jde;function Gde(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),jU(e)):r.var(t,!0)}o(Gde,"boolOrEmptySchema");z0.boolOrEmptySchema=Gde;function jU(e,t){let{gen:r,data:n}=e,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,kde.reportError)(i,$de,void 0,t)}o(jU,"falseSchemaError")});var R4=fe(q0=>{"use strict";g();Object.defineProperty(q0,"__esModule",{value:!0});q0.getRules=q0.isJSONType=void 0;var Ude=["string","number","integer","boolean","null","object","array"],Vde=new Set(Ude);function zde(e){return typeof e=="string"&&Vde.has(e)}o(zde,"isJSONType");q0.isJSONType=zde;function qde(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:re(k({},e),{integer:!0,boolean:!0,null:!0}),rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}o(qde,"getRules");q0.getRules=qde});var B4=fe(Xd=>{"use strict";g();Object.defineProperty(Xd,"__esModule",{value:!0});Xd.shouldUseRule=Xd.shouldUseGroup=Xd.schemaHasRulesForType=void 0;function Hde({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&UU(e,n)}o(Hde,"schemaHasRulesForType");Xd.schemaHasRulesForType=Hde;function UU(e,t){return t.rules.some(r=>VU(e,r))}o(UU,"shouldUseGroup");Xd.shouldUseGroup=UU;function VU(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}o(VU,"shouldUseRule");Xd.shouldUseRule=VU});var Lx=fe($s=>{"use strict";g();Object.defineProperty($s,"__esModule",{value:!0});$s.reportTypeError=$s.checkDataTypes=$s.checkDataType=$s.coerceAndCheckDataType=$s.getJSONTypes=$s.getSchemaTypes=$s.DataType=void 0;var Wde=R4(),Xde=B4(),Yde=Ox(),Ht=Wt(),SV=vn(),H0;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(H0||($s.DataType=H0={}));function Zde(e){let t=CV(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}o(Zde,"getSchemaTypes");$s.getSchemaTypes=Zde;function CV(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(Wde.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}o(CV,"getJSONTypes");$s.getJSONTypes=CV;function Kde(e,t){let{gen:r,data:n,opts:i}=e,s=Jde(t,i.coerceTypes),l=t.length>0&&!(s.length===0&&t.length===1&&(0,Xde.schemaHasRulesForType)(e,t[0]));if(l){let c=j4(t,n,i.strictNumbers,H0.Wrong);r.if(c,()=>{s.length?Qde(e,t,s):G4(e)})}return l}o(Kde,"coerceAndCheckDataType");$s.coerceAndCheckDataType=Kde;var wV=new Set(["string","number","integer","boolean","null"]);function Jde(e,t){return t?e.filter(r=>wV.has(r)||t==="array"&&r==="array"):[]}o(Jde,"coerceToTypes");var zU,qU,HU,WU,XU,YU,ZU,KU,JU,QU,eV,tV,rV,nV,iV,oV,sV,aV,lV,uV;function Qde(e,t,r){let{gen:n,data:i,opts:s}=e,l=n.let("dataType",(0,Ht._)(zU||(zU=V(["typeof ",""])),i)),c=n.let("coerced",(0,Ht._)(qU||(qU=V(["undefined"]))));s.coerceTypes==="array"&&n.if((0,Ht._)(HU||(HU=V([""," == 'object' && Array.isArray(",") && ",".length == 1"])),l,i,i),()=>n.assign(i,(0,Ht._)(WU||(WU=V(["","[0]"])),i)).assign(l,(0,Ht._)(XU||(XU=V(["typeof ",""])),i)).if(j4(t,i,s.strictNumbers),()=>n.assign(c,i))),n.if((0,Ht._)(YU||(YU=V([""," !== undefined"])),c));for(let h of r)(wV.has(h)||h==="array"&&s.coerceTypes==="array")&&p(h);n.else(),G4(e),n.endIf(),n.if((0,Ht._)(ZU||(ZU=V([""," !== undefined"])),c),()=>{n.assign(i,c),ehe(e,c)});function p(h){switch(h){case"string":n.elseIf((0,Ht._)(KU||(KU=V(["",' == "number" || ',' == "boolean"'])),l,l)).assign(c,(0,Ht._)(JU||(JU=V(['"" + ',""])),i)).elseIf((0,Ht._)(QU||(QU=V([""," === null"])),i)).assign(c,(0,Ht._)(eV||(eV=V(['""']))));return;case"number":n.elseIf((0,Ht._)(tV||(tV=V(["",' == "boolean" || '," === null\n || (",' == "string" && '," && "," == +",")"])),l,i,l,i,i,i)).assign(c,(0,Ht._)(rV||(rV=V(["+",""])),i));return;case"integer":n.elseIf((0,Ht._)(nV||(nV=V(["",' === "boolean" || '," === null\n || (",' === "string" && '," && "," == +"," && !("," % 1))"])),l,i,l,i,i,i,i)).assign(c,(0,Ht._)(iV||(iV=V(["+",""])),i));return;case"boolean":n.elseIf((0,Ht._)(oV||(oV=V(["",' === "false" || '," === 0 || "," === null"])),i,i,i)).assign(c,!1).elseIf((0,Ht._)(sV||(sV=V(["",' === "true" || '," === 1"])),i,i)).assign(c,!0);return;case"null":n.elseIf((0,Ht._)(aV||(aV=V(["",' === "" || '," === 0 || "," === false"])),i,i,i)),n.assign(c,null);return;case"array":n.elseIf((0,Ht._)(lV||(lV=V(["",' === "string" || ',' === "number"\n || ',' === "boolean" || '," === null"])),l,l,l,i)).assign(c,(0,Ht._)(uV||(uV=V(["[","]"])),i))}}o(p,"coerceSpecificType")}o(Qde,"coerceData");var cV,pV;function ehe({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,Ht._)(cV||(cV=V([""," !== undefined"])),t),()=>e.assign((0,Ht._)(pV||(pV=V(["","[","]"])),t,r),n))}o(ehe,"assignParentData");var fV,dV,hV,mV,gV,yV,vV;function $4(e,t,r,n=H0.Correct){let i=n===H0.Correct?Ht.operators.EQ:Ht.operators.NEQ,s;switch(e){case"null":return(0,Ht._)(fV||(fV=V([""," "," null"])),t,i);case"array":s=(0,Ht._)(dV||(dV=V(["Array.isArray(",")"])),t);break;case"object":s=(0,Ht._)(hV||(hV=V([""," && typeof ",' == "object" && !Array.isArray(',")"])),t,t,t);break;case"integer":s=l((0,Ht._)(mV||(mV=V(["!("," % 1) && !isNaN(",")"])),t,t));break;case"number":s=l();break;default:return(0,Ht._)(gV||(gV=V(["typeof "," "," ",""])),t,i,e)}return n===H0.Correct?s:(0,Ht.not)(s);function l(c=Ht.nil){return(0,Ht.and)((0,Ht._)(yV||(yV=V(["typeof ",' == "number"'])),t),c,r?(0,Ht._)(vV||(vV=V(["isFinite(",")"])),t):Ht.nil)}}o($4,"checkDataType");$s.checkDataType=$4;var bV,xV;function j4(e,t,r,n){if(e.length===1)return $4(e[0],t,r,n);let i,s=(0,SV.toHash)(e);if(s.array&&s.object){let l=(0,Ht._)(bV||(bV=V(["typeof ",' != "object"'])),t);i=s.null?l:(0,Ht._)(xV||(xV=V(["!"," || ",""])),t,l),delete s.null,delete s.array,delete s.object}else i=Ht.nil;s.number&&delete s.integer;for(let l in s)i=(0,Ht.and)(i,$4(l,t,r,n));return i}o(j4,"checkDataTypes");$s.checkDataTypes=j4;var IV,_V,the={message:o(({schema:e})=>"must be ".concat(e),"message"),params:o(({schema:e,schemaValue:t})=>typeof e=="string"?(0,Ht._)(IV||(IV=V(["{type: ","}"])),e):(0,Ht._)(_V||(_V=V(["{type: ","}"])),t),"params")};function G4(e){let t=rhe(e);(0,Yde.reportError)(t,the)}o(G4,"reportTypeError");$s.reportTypeError=G4;function rhe(e){let{gen:t,data:r,schema:n}=e,i=(0,SV.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}o(rhe,"getTypeErrorContext")});var LV=fe(kC=>{"use strict";g();Object.defineProperty(kC,"__esModule",{value:!0});kC.assignDefaults=void 0;var W0=Wt(),nhe=vn();function ihe(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let i in r)PV(e,i,r[i].default);else t==="array"&&Array.isArray(n)&&n.forEach((i,s)=>PV(e,s,i.default))}o(ihe,"assignDefaults");kC.assignDefaults=ihe;var TV,EV,MV,OV;function PV(e,t,r){let{gen:n,compositeRule:i,data:s,opts:l}=e;if(r===void 0)return;let c=(0,W0._)(TV||(TV=V(["","",""])),s,(0,W0.getProperty)(t));if(i){(0,nhe.checkStrictMode)(e,"default is ignored for: ".concat(c));return}let p=(0,W0._)(EV||(EV=V([""," === undefined"])),c);l.useDefaults==="empty"&&(p=(0,W0._)(MV||(MV=V([""," || "," === null || ",' === ""'])),p,c,c)),n.if(p,(0,W0._)(OV||(OV=V([""," = ",""])),c,(0,W0.stringify)(r)))}o(PV,"assignDefault")});var $l=fe(zn=>{"use strict";g();Object.defineProperty(zn,"__esModule",{value:!0});zn.validateUnion=zn.validateArray=zn.usePattern=zn.callValidateCode=zn.schemaProperties=zn.allSchemaProperties=zn.noPropertyInData=zn.propertyInData=zn.isOwnProperty=zn.hasPropFunc=zn.reportMissingProp=zn.checkMissingProp=zn.checkReportMissingProp=void 0;var pi=Wt(),U4=vn(),Yd=gf(),ohe=vn(),AV;function she(e,t){let{gen:r,data:n,it:i}=e;r.if(z4(r,n,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,pi._)(AV||(AV=V(["",""])),t)},!0),e.error()})}o(she,"checkReportMissingProp");zn.checkReportMissingProp=she;var DV;function ahe({gen:e,data:t,it:{opts:r}},n,i){return(0,pi.or)(...n.map(s=>(0,pi.and)(z4(e,t,s,r.ownProperties),(0,pi._)(DV||(DV=V([""," = ",""])),i,s))))}o(ahe,"checkMissingProp");zn.checkMissingProp=ahe;function lhe(e,t){e.setParams({missingProperty:t},!0),e.error()}o(lhe,"reportMissingProp");zn.reportMissingProp=lhe;var FV;function WV(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,pi._)(FV||(FV=V(["Object.prototype.hasOwnProperty"])))})}o(WV,"hasPropFunc");zn.hasPropFunc=WV;var NV;function V4(e,t,r){return(0,pi._)(NV||(NV=V(["",".call(",", ",")"])),WV(e),t,r)}o(V4,"isOwnProperty");zn.isOwnProperty=V4;var kV,RV;function uhe(e,t,r,n){let i=(0,pi._)(kV||(kV=V(["",""," !== undefined"])),t,(0,pi.getProperty)(r));return n?(0,pi._)(RV||(RV=V([""," && ",""])),i,V4(e,t,r)):i}o(uhe,"propertyInData");zn.propertyInData=uhe;var BV;function z4(e,t,r,n){let i=(0,pi._)(BV||(BV=V(["",""," === undefined"])),t,(0,pi.getProperty)(r));return n?(0,pi.or)(i,(0,pi.not)(V4(e,t,r))):i}o(z4,"noPropertyInData");zn.noPropertyInData=z4;function XV(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}o(XV,"allSchemaProperties");zn.allSchemaProperties=XV;function che(e,t){return XV(t).filter(r=>!(0,U4.alwaysValidSchema)(e,t[r]))}o(che,"schemaProperties");zn.schemaProperties=che;var $V,jV,GV,UV;function phe({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:l},c,p,h){let y=h?(0,pi._)($V||($V=V(["",", ",", ","",""])),e,t,n,i):t,b=[[Yd.default.instancePath,(0,pi.strConcat)(Yd.default.instancePath,s)],[Yd.default.parentData,l.parentData],[Yd.default.parentDataProperty,l.parentDataProperty],[Yd.default.rootData,Yd.default.rootData]];l.opts.dynamicRef&&b.push([Yd.default.dynamicAnchors,Yd.default.dynamicAnchors]);let _=(0,pi._)(jV||(jV=V(["",", ",""])),y,r.object(...b));return p!==pi.nil?(0,pi._)(GV||(GV=V(["",".call(",", ",")"])),c,p,_):(0,pi._)(UV||(UV=V(["","(",")"])),c,_)}o(phe,"callValidateCode");zn.callValidateCode=phe;var VV,fhe=(0,pi._)(VV||(VV=V(["new RegExp"]))),zV;function dhe({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:i}=t.code,s=i(r,n);return e.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,pi._)(zV||(zV=V(["","(",", ",")"])),i.code==="new RegExp"?fhe:(0,ohe.useFunc)(e,i),r,n)})}o(dhe,"usePattern");zn.usePattern=dhe;var qV;function hhe(e){let{gen:t,data:r,keyword:n,it:i}=e,s=t.name("valid");if(i.allErrors){let c=t.let("valid",!0);return l(()=>t.assign(c,!1)),c}return t.var(s,!0),l(()=>t.break()),s;function l(c){let p=t.const("len",(0,pi._)(qV||(qV=V(["",".length"])),r));t.forRange("i",0,p,h=>{e.subschema({keyword:n,dataProp:h,dataPropType:U4.Type.Num},s),t.if((0,pi.not)(s),c)})}o(l,"validateItems")}o(hhe,"validateArray");zn.validateArray=hhe;var HV;function mhe(e){let{gen:t,schema:r,keyword:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(p=>(0,U4.alwaysValidSchema)(i,p))&&!i.opts.unevaluated)return;let l=t.let("valid",!1),c=t.name("_valid");t.block(()=>r.forEach((p,h)=>{let y=e.subschema({keyword:n,schemaProp:h,compositeRule:!0},c);t.assign(l,(0,pi._)(HV||(HV=V([""," || ",""])),l,c)),e.mergeValidEvaluated(y,c)||t.if((0,pi.not)(l))})),e.result(l,()=>e.reset(),()=>e.error(!0))}o(mhe,"validateUnion");zn.validateUnion=mhe});var az=fe(Wc=>{"use strict";g();Object.defineProperty(Wc,"__esModule",{value:!0});Wc.validateKeywordUsage=Wc.validSchemaType=Wc.funcKeywordCode=Wc.macroKeywordCode=void 0;var fa=Wt(),ng=gf(),ghe=$l(),yhe=Ox();function vhe(e,t){let{gen:r,keyword:n,schema:i,parentSchema:s,it:l}=e,c=t.macro.call(l.self,i,s,l),p=sz(r,n,c);l.opts.validateSchema!==!1&&l.self.validateSchema(c,!0);let h=r.name("valid");e.subschema({schema:c,schemaPath:fa.nil,errSchemaPath:"".concat(l.errSchemaPath,"/").concat(n),topSchemaRef:p,compositeRule:!0},h),e.pass(h,()=>e.error(!0))}o(vhe,"macroKeywordCode");Wc.macroKeywordCode=vhe;var ZV,KV,JV,QV,ez,tz;function bhe(e,t){var r;let{gen:n,keyword:i,schema:s,parentSchema:l,$data:c,it:p}=e;Ihe(p,t);let h=!c&&t.compile?t.compile.call(p.self,s,l,p):t.validate,y=sz(n,i,h),b=n.let("valid");e.block$data(b,_),e.ok((r=t.valid)!==null&&r!==void 0?r:b);function _(){if(t.errors===!1)E(),t.modifying&&YV(e),T(()=>e.error());else{let O=t.async?C():P();t.modifying&&YV(e),T(()=>xhe(e,O))}}o(_,"validateKeyword");function C(){let O=n.let("ruleErrs",null);return n.try(()=>E((0,fa._)(ZV||(ZV=V(["await "])))),D=>n.assign(b,!1).if((0,fa._)(KV||(KV=V([""," instanceof ",""])),D,p.ValidationError),()=>n.assign(O,(0,fa._)(JV||(JV=V(["",".errors"])),D)),()=>n.throw(D))),O}o(C,"validateAsync");function P(){let O=(0,fa._)(QV||(QV=V(["",".errors"])),y);return n.assign(O,null),E(fa.nil),O}o(P,"validateSync");function E(O=t.async?(0,fa._)(ez||(ez=V(["await "]))):fa.nil){let D=p.opts.passContext?ng.default.this:ng.default.self,A=!("compile"in t&&!c||t.schema===!1);n.assign(b,(0,fa._)(tz||(tz=V(["","",""])),O,(0,ghe.callValidateCode)(e,y,D,A)),t.modifying)}o(E,"assignValid");function T(O){var D;n.if((0,fa.not)((D=t.valid)!==null&&D!==void 0?D:b),O)}o(T,"reportErrs")}o(bhe,"funcKeywordCode");Wc.funcKeywordCode=bhe;var rz;function YV(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,fa._)(rz||(rz=V(["","[","]"])),n.parentData,n.parentDataProperty)))}o(YV,"modifyData");var nz,iz,oz;function xhe(e,t){let{gen:r}=e;r.if((0,fa._)(nz||(nz=V(["Array.isArray(",")"])),t),()=>{r.assign(ng.default.vErrors,(0,fa._)(iz||(iz=V([""," === null ? "," : ",".concat(",")"])),ng.default.vErrors,t,ng.default.vErrors,t)).assign(ng.default.errors,(0,fa._)(oz||(oz=V(["",".length"])),ng.default.vErrors)),(0,yhe.extendErrors)(e)},()=>e.error())}o(xhe,"addErrs");function Ihe({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}o(Ihe,"checkAsyncKeyword");function sz(e,t,r){if(r===void 0)throw new Error('keyword "'.concat(t,'" failed to compile'));return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,fa.stringify)(r)})}o(sz,"useKeyword");function _he(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}o(_he,"validSchemaType");Wc.validSchemaType=_he;function She({schema:e,opts:t,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let l=i.dependencies;if(l!=null&&l.some(c=>!Object.prototype.hasOwnProperty.call(e,c)))throw new Error("parent schema must have dependencies of ".concat(s,": ").concat(l.join(",")));if(i.validateSchema&&!i.validateSchema(e[s])){let p='keyword "'.concat(s,'" value is invalid at path "').concat(n,'": ')+r.errorsText(i.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(p);else throw new Error(p)}}o(She,"validateKeywordUsage");Wc.validateKeywordUsage=She});var hz=fe(Zd=>{"use strict";g();Object.defineProperty(Zd,"__esModule",{value:!0});Zd.extendSubschemaMode=Zd.extendSubschemaData=Zd.getSubschema=void 0;var Xc=Wt(),dz=vn(),lz,uz;function Che(e,{keyword:t,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:l}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let c=e.schema[t];return r===void 0?{schema:c,schemaPath:(0,Xc._)(lz||(lz=V(["","",""])),e.schemaPath,(0,Xc.getProperty)(t)),errSchemaPath:"".concat(e.errSchemaPath,"/").concat(t)}:{schema:c[r],schemaPath:(0,Xc._)(uz||(uz=V(["","","",""])),e.schemaPath,(0,Xc.getProperty)(t),(0,Xc.getProperty)(r)),errSchemaPath:"".concat(e.errSchemaPath,"/").concat(t,"/").concat((0,dz.escapeFragment)(r))}}if(n!==void 0){if(i===void 0||s===void 0||l===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:l,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}o(Che,"getSubschema");Zd.getSubschema=Che;var cz,pz,fz;function whe(e,t,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:l}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:c}=t;if(r!==void 0){let{errorPath:h,dataPathArr:y,opts:b}=t,_=c.let("data",(0,Xc._)(cz||(cz=V(["","",""])),t.data,(0,Xc.getProperty)(r)),!0);p(_),e.errorPath=(0,Xc.str)(pz||(pz=V(["","",""])),h,(0,dz.getErrorPath)(r,n,b.jsPropertySyntax)),e.parentDataProperty=(0,Xc._)(fz||(fz=V(["",""])),r),e.dataPathArr=[...y,e.parentDataProperty]}if(i!==void 0){let h=i instanceof Xc.Name?i:c.let("data",i,!0);p(h),l!==void 0&&(e.propertyName=l)}s&&(e.dataTypes=s);function p(h){e.data=h,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,h]}o(p,"dataContextProps")}o(whe,"extendSubschemaData");Zd.extendSubschemaData=whe;function Phe(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(e.compositeRule=n),i!==void 0&&(e.createErrors=i),s!==void 0&&(e.allErrors=s),e.jtdDiscriminator=t,e.jtdMetadata=r}o(Phe,"extendSubschemaMode");Zd.extendSubschemaMode=Phe});var q4=fe((Tht,mz)=>{"use strict";g();mz.exports=o(function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var l=s[i];if(!e(t[l],r[l]))return!1}return!0}return t!==t&&r!==r},"equal")});var yz=fe((Oht,gz)=>{"use strict";g();var Kd=gz.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};RC(t,n,i,e,"",e)};Kd.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Kd.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Kd.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Kd.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function RC(e,t,r,n,i,s,l,c,p,h){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,i,s,l,c,p,h);for(var y in n){var b=n[y];if(Array.isArray(b)){if(y in Kd.arrayKeywords)for(var _=0;_<b.length;_++)RC(e,t,r,b[_],i+"/"+y+"/"+_,s,i,y,n,_)}else if(y in Kd.propsKeywords){if(b&&typeof b=="object")for(var C in b)RC(e,t,r,b[C],i+"/"+y+"/"+The(C),s,i,y,n,C)}else(y in Kd.keywords||e.allKeys&&!(y in Kd.skipKeywords))&&RC(e,t,r,b,i+"/"+y,s,i,y,n)}r(n,i,s,l,c,p,h)}}o(RC,"_traverse");function The(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}o(The,"escapeJsonPtr")});var Ax=fe(Fa=>{"use strict";g();Object.defineProperty(Fa,"__esModule",{value:!0});Fa.getSchemaRefs=Fa.resolveUrl=Fa.normalizeId=Fa._getFullPath=Fa.getFullPath=Fa.inlineRef=void 0;var Ehe=vn(),Mhe=q4(),Ohe=yz(),Lhe=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Ahe(e,t=!0){return typeof e=="boolean"?!0:t===!0?!H4(e):t?vz(e)<=t:!1}o(Ahe,"inlineRef");Fa.inlineRef=Ahe;var Dhe=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function H4(e){for(let t in e){if(Dhe.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(H4)||typeof r=="object"&&H4(r))return!0}return!1}o(H4,"hasRef");function vz(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!Lhe.has(r)&&(typeof e[r]=="object"&&(0,Ehe.eachItem)(e[r],n=>t+=vz(n)),t===1/0))return 1/0}return t}o(vz,"countKeys");function bz(e,t="",r){r!==!1&&(t=X0(t));let n=e.parse(t);return xz(e,n)}o(bz,"getFullPath");Fa.getFullPath=bz;function xz(e,t){return e.serialize(t).split("#")[0]+"#"}o(xz,"_getFullPath");Fa._getFullPath=xz;var Fhe=/#\/?$/;function X0(e){return e?e.replace(Fhe,""):""}o(X0,"normalizeId");Fa.normalizeId=X0;function Nhe(e,t,r){return r=X0(r),e.resolve(t,r)}o(Nhe,"resolveUrl");Fa.resolveUrl=Nhe;var khe=/^[a-z_][-a-z0-9._]*$/i;function Rhe(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=X0(e[r]||t),s={"":i},l=bz(n,i,!1),c={},p=new Set;return Ohe(e,{allKeys:!0},(b,_,C,P)=>{if(P===void 0)return;let E=l+_,T=s[P];typeof b[r]=="string"&&(T=O.call(this,b[r])),D.call(this,b.$anchor),D.call(this,b.$dynamicAnchor),s[_]=T;function O(A){let R=this.opts.uriResolver.resolve;if(A=X0(T?R(T,A):A),p.has(A))throw y(A);p.add(A);let j=this.refs[A];return typeof j=="string"&&(j=this.refs[j]),typeof j=="object"?h(b,j.schema,A):A!==X0(E)&&(A[0]==="#"?(h(b,c[A],A),c[A]=b):this.refs[A]=E),A}o(O,"addRef");function D(A){if(typeof A=="string"){if(!khe.test(A))throw new Error('invalid anchor "'.concat(A,'"'));O.call(this,"#".concat(A))}}o(D,"addAnchor")}),c;function h(b,_,C){if(_!==void 0&&!Mhe(b,_))throw y(C)}o(h,"checkAmbiguosRef");function y(b){return new Error('reference "'.concat(b,'" resolves to more than one schema'))}o(y,"ambiguos")}o(Rhe,"getSchemaRefs");Fa.getSchemaRefs=Rhe});var Nx=fe(Jd=>{"use strict";g();Object.defineProperty(Jd,"__esModule",{value:!0});Jd.getData=Jd.KeywordCxt=Jd.validateFunctionCode=void 0;var cq=GU(),Iz=Lx(),X4=B4(),BC=Lx(),Bhe=LV(),Fx=az(),W4=hz(),It=Wt(),Rt=gf(),$he=Ax(),yf=vn(),Dx=Ox();function jhe(e){if(dq(e)&&(hq(e),fq(e))){Vhe(e);return}pq(e,()=>(0,cq.topBoolOrEmptySchema)(e))}o(jhe,"validateFunctionCode");Jd.validateFunctionCode=jhe;var wz,Pz,Tz;function pq({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},s){i.code.es5?e.func(t,(0,It._)(wz||(wz=V(["",", ",""])),Rt.default.data,Rt.default.valCxt),n.$async,()=>{e.code((0,It._)(Pz||(Pz=V(['"use strict"; ',""])),_z(r,i))),Uhe(e,i),e.code(s)}):e.func(t,(0,It._)(Tz||(Tz=V(["",", ",""])),Rt.default.data,Ghe(i)),n.$async,()=>e.code(_z(r,i)).code(s))}o(pq,"validateFunction");var Ez,Mz;function Ghe(e){return(0,It._)(Mz||(Mz=V(["{",'="", ',", ",", ","=","","}={}"])),Rt.default.instancePath,Rt.default.parentData,Rt.default.parentDataProperty,Rt.default.rootData,Rt.default.data,e.dynamicRef?(0,It._)(Ez||(Ez=V([", ","={}"])),Rt.default.dynamicAnchors):It.nil)}o(Ghe,"destructureValCxt");var Oz,Lz,Az,Dz,Fz,Nz,kz,Rz,Bz;function Uhe(e,t){e.if(Rt.default.valCxt,()=>{e.var(Rt.default.instancePath,(0,It._)(Oz||(Oz=V(["",".",""])),Rt.default.valCxt,Rt.default.instancePath)),e.var(Rt.default.parentData,(0,It._)(Lz||(Lz=V(["",".",""])),Rt.default.valCxt,Rt.default.parentData)),e.var(Rt.default.parentDataProperty,(0,It._)(Az||(Az=V(["",".",""])),Rt.default.valCxt,Rt.default.parentDataProperty)),e.var(Rt.default.rootData,(0,It._)(Dz||(Dz=V(["",".",""])),Rt.default.valCxt,Rt.default.rootData)),t.dynamicRef&&e.var(Rt.default.dynamicAnchors,(0,It._)(Fz||(Fz=V(["",".",""])),Rt.default.valCxt,Rt.default.dynamicAnchors))},()=>{e.var(Rt.default.instancePath,(0,It._)(Nz||(Nz=V(['""'])))),e.var(Rt.default.parentData,(0,It._)(kz||(kz=V(["undefined"])))),e.var(Rt.default.parentDataProperty,(0,It._)(Rz||(Rz=V(["undefined"])))),e.var(Rt.default.rootData,Rt.default.data),t.dynamicRef&&e.var(Rt.default.dynamicAnchors,(0,It._)(Bz||(Bz=V(["{}"]))))})}o(Uhe,"destructureValCxtES5");function Vhe(e){let{schema:t,opts:r,gen:n}=e;pq(e,()=>{r.$comment&&t.$comment&&gq(e),Xhe(e),n.let(Rt.default.vErrors,null),n.let(Rt.default.errors,0),r.unevaluated&&zhe(e),mq(e),Khe(e)})}o(Vhe,"topSchemaObjCode");var $z,jz,Gz,Uz,Vz,zz,qz;function zhe(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,It._)($z||($z=V(["",".evaluated"])),r)),t.if((0,It._)(jz||(jz=V(["",".dynamicProps"])),e.evaluated),()=>t.assign((0,It._)(Gz||(Gz=V(["",".props"])),e.evaluated),(0,It._)(Uz||(Uz=V(["undefined"]))))),t.if((0,It._)(Vz||(Vz=V(["",".dynamicItems"])),e.evaluated),()=>t.assign((0,It._)(zz||(zz=V(["",".items"])),e.evaluated),(0,It._)(qz||(qz=V(["undefined"])))))}o(zhe,"resetEvaluated");var Hz;function _z(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,It._)(Hz||(Hz=V(["/*# sourceURL="," */"])),r):It.nil}o(_z,"funcSourceUrl");function qhe(e,t){if(dq(e)&&(hq(e),fq(e))){Hhe(e,t);return}(0,cq.boolOrEmptySchema)(e,t)}o(qhe,"subschemaCode");function fq({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}o(fq,"schemaCxtHasRules");function dq(e){return typeof e.schema!="boolean"}o(dq,"isSchemaObj");var Wz;function Hhe(e,t){let{schema:r,gen:n,opts:i}=e;i.$comment&&r.$comment&&gq(e),Yhe(e),Zhe(e);let s=n.const("_errs",Rt.default.errors);mq(e,s),n.var(t,(0,It._)(Wz||(Wz=V([""," === ",""])),s,Rt.default.errors))}o(Hhe,"subSchemaObjCode");function hq(e){(0,yf.checkUnknownRules)(e),Whe(e)}o(hq,"checkKeywords");function mq(e,t){if(e.opts.jtd)return Sz(e,[],!1,t);let r=(0,Iz.getSchemaTypes)(e.schema),n=(0,Iz.coerceAndCheckDataType)(e,r);Sz(e,r,!n,t)}o(mq,"typeAndKeywords");function Whe(e){let{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,yf.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn('$ref: keywords ignored in schema at path "'.concat(r,'"'))}o(Whe,"checkRefsAndKeywords");function Xhe(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,yf.checkStrictMode)(e,"default is ignored in the schema root")}o(Xhe,"checkNoDefault");function Yhe(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,$he.resolveUrl)(e.opts.uriResolver,e.baseId,t))}o(Yhe,"updateContext");function Zhe(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}o(Zhe,"checkAsyncSchema");var Xz,Yz,Zz;function gq({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)e.code((0,It._)(Xz||(Xz=V(["",".logger.log(",")"])),Rt.default.self,s));else if(typeof i.$comment=="function"){let l=(0,It.str)(Yz||(Yz=V(["","/$comment"])),n),c=e.scopeValue("root",{ref:t.root});e.code((0,It._)(Zz||(Zz=V(["",".opts.$comment(",", ",", ",".schema)"])),Rt.default.self,s,l,c))}}o(gq,"commentKeyword");var Kz,Jz,Qz,eq;function Khe(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=e;r.$async?t.if((0,It._)(Kz||(Kz=V([""," === 0"])),Rt.default.errors),()=>t.return(Rt.default.data),()=>t.throw((0,It._)(Jz||(Jz=V(["new ","(",")"])),i,Rt.default.vErrors))):(t.assign((0,It._)(Qz||(Qz=V(["",".errors"])),n),Rt.default.vErrors),s.unevaluated&&Jhe(e),t.return((0,It._)(eq||(eq=V([""," === 0"])),Rt.default.errors)))}o(Khe,"returnResults");var tq,rq;function Jhe({gen:e,evaluated:t,props:r,items:n}){r instanceof It.Name&&e.assign((0,It._)(tq||(tq=V(["",".props"])),t),r),n instanceof It.Name&&e.assign((0,It._)(rq||(rq=V(["",".items"])),t),n)}o(Jhe,"assignEvaluated");var nq;function Sz(e,t,r,n){let{gen:i,schema:s,data:l,allErrors:c,opts:p,self:h}=e,{RULES:y}=h;if(s.$ref&&(p.ignoreKeywordsWithRef||!(0,yf.schemaHasRulesButRef)(s,y))){i.block(()=>vq(e,"$ref",y.all.$ref.definition));return}p.jtd||Qhe(e,t),i.block(()=>{for(let _ of y.rules)b(_);b(y.post)});function b(_){(0,X4.shouldUseGroup)(s,_)&&(_.type?(i.if((0,BC.checkDataType)(_.type,l,p.strictNumbers)),Cz(e,_),t.length===1&&t[0]===_.type&&r&&(i.else(),(0,BC.reportTypeError)(e)),i.endIf()):Cz(e,_),c||i.if((0,It._)(nq||(nq=V([""," === ",""])),Rt.default.errors,n||0)))}o(b,"groupKeywords")}o(Sz,"schemaKeywords");function Cz(e,t){let{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,Bhe.assignDefaults)(e,t.type),r.block(()=>{for(let s of t.rules)(0,X4.shouldUseRule)(n,s)&&vq(e,s.keyword,s.definition,t.type)})}o(Cz,"iterateKeywords");function Qhe(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(eme(e,t),e.opts.allowUnionTypes||tme(e,t),rme(e,e.dataTypes))}o(Qhe,"checkStrictTypes");function eme(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{yq(e.dataTypes,r)||Y4(e,'type "'.concat(r,'" not allowed by context "').concat(e.dataTypes.join(","),'"'))}),ime(e,t)}}o(eme,"checkContextTypes");function tme(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&Y4(e,"use allowUnionTypes to allow union type keyword")}o(tme,"checkMultipleTypes");function rme(e,t){let r=e.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,X4.shouldUseRule)(e.schema,i)){let{type:s}=i.definition;s.length&&!s.some(l=>nme(t,l))&&Y4(e,'missing type "'.concat(s.join(","),'" for keyword "').concat(n,'"'))}}}o(rme,"checkKeywordTypes");function nme(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}o(nme,"hasApplicableType");function yq(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}o(yq,"includesType");function ime(e,t){let r=[];for(let n of e.dataTypes)yq(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}o(ime,"narrowSchemaTypes");function Y4(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=' at "'.concat(r,'" (strictTypes)'),(0,yf.checkStrictMode)(e,t,e.opts.strictTypes)}o(Y4,"strictTypesError");var iq,oq,sq,aq,Z4=class Z4{constructor(t,r,n){if((0,Fx.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,yf.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",bq(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Fx.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error("".concat(n," value must be ").concat(JSON.stringify(r.schemaType)));("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",Rt.default.errors))}result(t,r,n){this.failResult((0,It.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,It.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,It._)(iq||(iq=V([""," !== undefined && (",")"])),r,(0,It.or)(this.invalid$data(),t)))}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?Dx.reportExtraError:Dx.reportError)(this,this.def.error,r)}$dataError(){(0,Dx.reportError)(this,this.def.$dataError||Dx.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Dx.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=It.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=It.nil,r=It.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:l}=this;n.if((0,It.or)((0,It._)(oq||(oq=V([""," === undefined"])),i),r)),t!==It.nil&&n.assign(t,!0),(s.length||l.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==It.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,It.or)(l(),c());function l(){if(n.length){if(!(r instanceof It.Name))throw new Error("ajv implementation error");let p=Array.isArray(n)?n:[n];return(0,It._)(sq||(sq=V(["",""])),(0,BC.checkDataTypes)(p,r,s.opts.strictNumbers,BC.DataType.Wrong))}return It.nil}function c(){if(i.validateSchema){let p=t.scopeValue("validate$data",{ref:i.validateSchema});return(0,It._)(aq||(aq=V(["!","(",")"])),p,r)}return It.nil}}subschema(t,r){let n=(0,W4.getSubschema)(this.it,t);(0,W4.extendSubschemaData)(n,this.it,t),(0,W4.extendSubschemaMode)(n,t);let i=re(k(k({},this.it),n),{items:void 0,props:void 0});return qhe(i,r),i}mergeEvaluated(t,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=yf.mergeEvaluated.props(i,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=yf.mergeEvaluated.items(i,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(t,It.Name)),!0}};o(Z4,"KeywordCxt");var $C=Z4;Jd.KeywordCxt=$C;function vq(e,t,r,n){let i=new $C(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Fx.funcKeywordCode)(i,r):"macro"in r?(0,Fx.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Fx.funcKeywordCode)(i,r)}o(vq,"keywordCode");var ome=/^\/(?:[^~]|~0|~1)*$/,sme=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/,lq,uq;function bq(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,s;if(e==="")return Rt.default.rootData;if(e[0]==="/"){if(!ome.test(e))throw new Error("Invalid JSON-pointer: ".concat(e));i=e,s=Rt.default.rootData}else{let h=sme.exec(e);if(!h)throw new Error("Invalid JSON-pointer: ".concat(e));let y=+h[1];if(i=h[2],i==="#"){if(y>=t)throw new Error(p("property/index",y));return n[t-y]}if(y>t)throw new Error(p("data",y));if(s=r[t-y],!i)return s}let l=s,c=i.split("/");for(let h of c)h&&(s=(0,It._)(lq||(lq=V(["","",""])),s,(0,It.getProperty)((0,yf.unescapeJsonPointer)(h))),l=(0,It._)(uq||(uq=V([""," && ",""])),l,s));return l;function p(h,y){return"Cannot access ".concat(h," ").concat(y," levels up, current level is ").concat(t)}}o(bq,"getData");Jd.getData=bq});var jC=fe(J4=>{"use strict";g();Object.defineProperty(J4,"__esModule",{value:!0});var Q4=class Q4 extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};o(Q4,"ValidationError");var K4=Q4;J4.default=K4});var kx=fe(r5=>{"use strict";g();Object.defineProperty(r5,"__esModule",{value:!0});var e5=Ax(),n5=class n5 extends Error{constructor(t,r,n,i){super(i||"can't resolve reference ".concat(n," from id ").concat(r)),this.missingRef=(0,e5.resolveUrl)(t,r,n),this.missingSchema=(0,e5.normalizeId)((0,e5.getFullPath)(t,this.missingRef))}};o(n5,"MissingRefError");var t5=n5;r5.default=t5});var UC=fe(jl=>{"use strict";g();Object.defineProperty(jl,"__esModule",{value:!0});jl.resolveSchema=jl.getCompilingSchema=jl.resolveRef=jl.compileSchema=jl.SchemaEnv=void 0;var Ru=Wt(),ame=jC(),ig=gf(),Bu=Ax(),xq=vn(),lme=Nx(),s5=class s5{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,Bu.normalizeId)(n==null?void 0:n[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n==null?void 0:n.$async,this.refs={}}};o(s5,"SchemaEnv");var Y0=s5;jl.SchemaEnv=Y0;var Iq,_q;function o5(e){let t=Sq.call(this,e);if(t)return t;let r=(0,Bu.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,l=new Ru.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),c;e.$async&&(c=l.scopeValue("Error",{ref:ame.default,code:(0,Ru._)(Iq||(Iq=V(['require("ajv/dist/runtime/validation_error").default'])))}));let p=l.scopeName("validate");e.validateName=p;let h={gen:l,allErrors:this.opts.allErrors,data:ig.default.data,parentData:ig.default.parentData,parentDataProperty:ig.default.parentDataProperty,dataNames:[ig.default.data],dataPathArr:[Ru.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:l.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Ru.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:c,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Ru.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Ru._)(_q||(_q=V(['""']))),opts:this.opts,self:this},y;try{this._compilations.add(e),(0,lme.validateFunctionCode)(h),l.optimize(this.opts.code.optimize);let b=l.toString();y="".concat(l.scopeRefs(ig.default.scope),"return ").concat(b),this.opts.code.process&&(y=this.opts.code.process(y,e));let C=new Function("".concat(ig.default.self),"".concat(ig.default.scope),y)(this,this.scope.get());if(this.scope.value(p,{ref:C}),C.errors=null,C.schema=e.schema,C.schemaEnv=e,e.$async&&(C.$async=!0),this.opts.code.source===!0&&(C.source={validateName:p,validateCode:b,scopeValues:l._values}),this.opts.unevaluated){let{props:P,items:E}=h;C.evaluated={props:P instanceof Ru.Name?void 0:P,items:E instanceof Ru.Name?void 0:E,dynamicProps:P instanceof Ru.Name,dynamicItems:E instanceof Ru.Name},C.source&&(C.source.evaluated=(0,Ru.stringify)(C.evaluated))}return e.validate=C,e}catch(b){throw delete e.validate,delete e.validateName,y&&this.logger.error("Error compiling schema, function code:",y),b}finally{this._compilations.delete(e)}}o(o5,"compileSchema");jl.compileSchema=o5;function ume(e,t,r){var n;r=(0,Bu.resolveUrl)(this.opts.uriResolver,t,r);let i=e.refs[r];if(i)return i;let s=fme.call(this,e,r);if(s===void 0){let l=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:c}=this.opts;l&&(s=new Y0({schema:l,schemaId:c,root:e,baseId:t}))}if(s!==void 0)return e.refs[r]=cme.call(this,s)}o(ume,"resolveRef");jl.resolveRef=ume;function cme(e){return(0,Bu.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:o5.call(this,e)}o(cme,"inlineOrCompile");function Sq(e){for(let t of this._compilations)if(pme(t,e))return t}o(Sq,"getCompilingSchema");jl.getCompilingSchema=Sq;function pme(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}o(pme,"sameSchemaEnv");function fme(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||GC.call(this,e,t)}o(fme,"resolve");function GC(e,t){let r=this.opts.uriResolver.parse(t),n=(0,Bu._getFullPath)(this.opts.uriResolver,r),i=(0,Bu.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return i5.call(this,r,e);let s=(0,Bu.normalizeId)(n),l=this.refs[s]||this.schemas[s];if(typeof l=="string"){let c=GC.call(this,e,l);return typeof(c==null?void 0:c.schema)!="object"?void 0:i5.call(this,r,c)}if(typeof(l==null?void 0:l.schema)=="object"){if(l.validate||o5.call(this,l),s===(0,Bu.normalizeId)(t)){let{schema:c}=l,{schemaId:p}=this.opts,h=c[p];return h&&(i=(0,Bu.resolveUrl)(this.opts.uriResolver,i,h)),new Y0({schema:c,schemaId:p,root:e,baseId:i})}return i5.call(this,r,l)}}o(GC,"resolveSchema");jl.resolveSchema=GC;var dme=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function i5(e,{baseId:t,schema:r,root:n}){var i;if(((i=e.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let c of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let p=r[(0,xq.unescapeFragment)(c)];if(p===void 0)return;r=p;let h=typeof r=="object"&&r[this.opts.schemaId];!dme.has(c)&&h&&(t=(0,Bu.resolveUrl)(this.opts.uriResolver,t,h))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,xq.schemaHasRulesButRef)(r,this.RULES)){let c=(0,Bu.resolveUrl)(this.opts.uriResolver,t,r.$ref);s=GC.call(this,n,c)}let{schemaId:l}=this.opts;if(s=s||new Y0({schema:r,schemaId:l,root:n,baseId:t}),s.schema!==s.root.schema)return s}o(i5,"getJsonPointer")});var Cq=fe((Xht,hme)=>{hme.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Pq=fe((Yht,wq)=>{"use strict";g();var mme={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};wq.exports={HEX:mme}});var Fq=fe((Kht,Dq)=>{"use strict";g();var{HEX:gme}=Pq(),yme=new RegExp("^(?:(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]\\d|\\d)$","u");function Oq(e){if(Aq(e,".")<3)return{host:e,isIPV4:!1};let t=e.match(yme)||[],[r]=t;return r?{host:bme(r,"."),isIPV4:!0}:{host:e,isIPV4:!1}}o(Oq,"normalizeIPv4");function a5(e,t=!1){let r="",n=!0;for(let i of e){if(gme[i]===void 0)return;i!=="0"&&n===!0&&(n=!1),n||(r+=i)}return t&&r.length===0&&(r="0"),r}o(a5,"stringArrayToHexStripped");function vme(e){let t=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,l=!1,c=!1;function p(){if(i.length){if(s===!1){let h=a5(i);if(h!==void 0)n.push(h);else return r.error=!0,!1}i.length=0}return!0}o(p,"consume");for(let h=0;h<e.length;h++){let y=e[h];if(!(y==="["||y==="]"))if(y===":"){if(l===!0&&(c=!0),!p())break;if(t++,n.push(":"),t>7){r.error=!0;break}h-1>=0&&e[h-1]===":"&&(l=!0);continue}else if(y==="%"){if(!p())break;s=!0}else{i.push(y);continue}}return i.length&&(s?r.zone=i.join(""):c?n.push(i.join("")):n.push(a5(i))),r.address=n.join(""),r}o(vme,"getIPV6");function Lq(e){if(Aq(e,":")<2)return{host:e,isIPV6:!1};let t=vme(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,escapedHost:n,isIPV6:!0}}}o(Lq,"normalizeIPv6");function bme(e,t){let r="",n=!0,i=e.length;for(let s=0;s<i;s++){let l=e[s];l==="0"&&n?(s+1<=i&&e[s+1]===t||s+1===i)&&(r+=l,n=!1):(l===t?n=!0:n=!1,r+=l)}return r}o(bme,"stripLeadingZeros");function Aq(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}o(Aq,"findToken");var Tq=new RegExp("^\\.\\.?\\/","u"),Eq=new RegExp("^\\/\\.(?:\\/|$)","u"),Mq=new RegExp("^\\/\\.\\.(?:\\/|$)","u"),xme=new RegExp("^\\/?(?:.|\\n)*?(?=\\/|$)","u");function Ime(e){let t=[];for(;e.length;)if(e.match(Tq))e=e.replace(Tq,"");else if(e.match(Eq))e=e.replace(Eq,"/");else if(e.match(Mq))e=e.replace(Mq,"/"),t.pop();else if(e==="."||e==="..")e="";else{let r=e.match(xme);if(r){let n=r[0];e=e.slice(n.length),t.push(n)}else throw new Error("Unexpected dot segment condition")}return t.join("")}o(Ime,"removeDotSegments");function _me(e,t){let r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}o(_me,"normalizeComponentEncoding");function Sme(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host),n=Oq(r);if(n.isIPV4)r=n.host;else{let i=Lq(n.host);i.isIPV6===!0?r="[".concat(i.escapedHost,"]"):r=e.host}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}o(Sme,"recomposeAuthority");Dq.exports={recomposeAuthority:Sme,normalizeComponentEncoding:_me,removeDotSegments:Ime,normalizeIPv4:Oq,normalizeIPv6:Lq,stringArrayToHexStripped:a5}});var jq=fe((emt,$q)=>{"use strict";g();var Cme=new RegExp("^[\\da-f]{8}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{12}$","iu"),wme=new RegExp("([\\da-z][\\d\\-a-z]{0,31}):((?:[\\w!$'()*+,\\-.:;=@]|%[\\da-f]{2})+)","iu");function Nq(e){return typeof e.secure=="boolean"?e.secure:String(e.scheme).toLowerCase()==="wss"}o(Nq,"isSecure");function kq(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}o(kq,"httpParse");function Rq(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}o(Rq,"httpSerialize");function Pme(e){return e.secure=Nq(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}o(Pme,"wsParse");function Tme(e){if((e.port===(Nq(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}o(Tme,"wsSerialize");function Eme(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(wme);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let i="".concat(n,":").concat(t.nid||e.nid),s=l5[i];e.path=void 0,s&&(e=s.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}o(Eme,"urnParse");function Mme(e,t){let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),i="".concat(r,":").concat(t.nid||n),s=l5[i];s&&(e=s.serialize(e,t));let l=e,c=e.nss;return l.path="".concat(n||t.nid,":").concat(c),t.skipEscape=!0,l}o(Mme,"urnSerialize");function Ome(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!Cme.test(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}o(Ome,"urnuuidParse");function Lme(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}o(Lme,"urnuuidSerialize");var Bq={scheme:"http",domainHost:!0,parse:kq,serialize:Rq},Ame={scheme:"https",domainHost:Bq.domainHost,parse:kq,serialize:Rq},VC={scheme:"ws",domainHost:!0,parse:Pme,serialize:Tme},Dme={scheme:"wss",domainHost:VC.domainHost,parse:VC.parse,serialize:VC.serialize},Fme={scheme:"urn",parse:Eme,serialize:Mme,skipNormalize:!0},Nme={scheme:"urn:uuid",parse:Ome,serialize:Lme,skipNormalize:!0},l5={http:Bq,https:Ame,ws:VC,wss:Dme,urn:Fme,"urn:uuid":Nme};$q.exports=l5});var Uq=fe((nmt,qC)=>{"use strict";g();var{normalizeIPv6:kme,normalizeIPv4:Rme,removeDotSegments:Rx,recomposeAuthority:Bme,normalizeComponentEncoding:zC}=Fq(),u5=jq();function $me(e,t){return typeof e=="string"?e=Yc(vf(e,t),t):typeof e=="object"&&(e=vf(Yc(e,t),t)),e}o($me,"normalize");function jme(e,t,r){let n=Object.assign({scheme:"null"},r),i=Gq(vf(e,n),vf(t,n),n,!0);return Yc(i,re(k({},n),{skipEscape:!0}))}o(jme,"resolve");function Gq(e,t,r,n){let i={};return n||(e=vf(Yc(e,r),r),t=vf(Yc(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=Rx(t.path||""),i.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=Rx(t.path||""),i.query=t.query):(t.path?(t.path.charAt(0)==="/"?i.path=Rx(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?i.path="/"+t.path:e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path,i.path=Rx(i.path)),i.query=t.query):(i.path=e.path,t.query!==void 0?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}o(Gq,"resolveComponents");function Gme(e,t,r){return typeof e=="string"?(e=unescape(e),e=Yc(zC(vf(e,r),!0),re(k({},r),{skipEscape:!0}))):typeof e=="object"&&(e=Yc(zC(e,!0),re(k({},r),{skipEscape:!0}))),typeof t=="string"?(t=unescape(t),t=Yc(zC(vf(t,r),!0),re(k({},r),{skipEscape:!0}))):typeof t=="object"&&(t=Yc(zC(t,!0),re(k({},r),{skipEscape:!0}))),e.toLowerCase()===t.toLowerCase()}o(Gme,"equal");function Yc(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),i=[],s=u5[(n.scheme||r.scheme||"").toLowerCase()];s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let l=Bme(r);if(l!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(l),r.path&&r.path.charAt(0)!=="/"&&i.push("/")),r.path!==void 0){let c=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(c=Rx(c)),l===void 0&&(c=c.replace(new RegExp("^\\/\\/","u"),"/%2F")),i.push(c)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}o(Yc,"serialize");var Ume=Array.from({length:127},(e,t)=>new RegExp("[^!\"$&'()*+,\\-.;=_`a-z{}~]","u").test(String.fromCharCode(t)));function Vme(e){let t=0;for(let r=0,n=e.length;r<n;++r)if(t=e.charCodeAt(r),t>126||Ume[t])return!0;return!1}o(Vme,"nonSimpleDomain");var zme=new RegExp("^(?:([^#/:?]+):)?(?:\\/\\/((?:([^#/?@]*)@)?(\\[[^#/?\\]]+\\]|[^#/:?]*)(?::(\\d*))?))?([^#?]*)(?:\\?([^#]*))?(?:#((?:.|[\\n\\r])*))?","u");function vf(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=e.indexOf("%")!==-1,s=!1;r.reference==="suffix"&&(e=(r.scheme?r.scheme+":":"")+"//"+e);let l=e.match(zme);if(l){if(n.scheme=l[1],n.userinfo=l[3],n.host=l[4],n.port=parseInt(l[5],10),n.path=l[6]||"",n.query=l[7],n.fragment=l[8],isNaN(n.port)&&(n.port=l[5]),n.host){let p=Rme(n.host);if(p.isIPV4===!1){let h=kme(p.host);n.host=h.host.toLowerCase(),s=h.isIPV6}else n.host=p.host,s=!0}n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let c=u5[(r.scheme||n.scheme||"").toLowerCase()];if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(r.domainHost||c&&c.domainHost)&&s===!1&&Vme(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(p){n.error=n.error||"Host's domain name can not be converted to ASCII: "+p}(!c||c&&!c.skipNormalize)&&(i&&n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),i&&n.host!==void 0&&(n.host=unescape(n.host)),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),c&&c.parse&&c.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}o(vf,"parse");var c5={SCHEMES:u5,normalize:$me,resolve:jme,resolveComponents:Gq,equal:Gme,serialize:Yc,parse:vf};qC.exports=c5;qC.exports.default=c5;qC.exports.fastUri=c5});var zq=fe(p5=>{"use strict";g();Object.defineProperty(p5,"__esModule",{value:!0});var Vq=Uq();Vq.code='require("ajv/dist/runtime/uri").default';p5.default=Vq});var Jq=fe(fs=>{"use strict";g();Object.defineProperty(fs,"__esModule",{value:!0});fs.CodeGen=fs.Name=fs.nil=fs.stringify=fs.str=fs._=fs.KeywordCxt=void 0;var qme=Nx();Object.defineProperty(fs,"KeywordCxt",{enumerable:!0,get:o(function(){return qme.KeywordCxt},"get")});var Z0=Wt();Object.defineProperty(fs,"_",{enumerable:!0,get:o(function(){return Z0._},"get")});Object.defineProperty(fs,"str",{enumerable:!0,get:o(function(){return Z0.str},"get")});Object.defineProperty(fs,"stringify",{enumerable:!0,get:o(function(){return Z0.stringify},"get")});Object.defineProperty(fs,"nil",{enumerable:!0,get:o(function(){return Z0.nil},"get")});Object.defineProperty(fs,"Name",{enumerable:!0,get:o(function(){return Z0.Name},"get")});Object.defineProperty(fs,"CodeGen",{enumerable:!0,get:o(function(){return Z0.CodeGen},"get")});var Hme=jC(),Yq=kx(),Wme=R4(),Bx=UC(),Xme=Wt(),$x=Ax(),HC=Lx(),d5=vn(),qq=Cq(),Yme=zq(),Zq=o((e,t)=>new RegExp(e,t),"defaultRegExp");Zq.code="new RegExp";var Zme=["removeAdditional","useDefaults","coerceTypes"],Kme=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Jme={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},Qme={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Hq=200;function ege(e){var t,r,n,i,s,l,c,p,h,y,b,_,C,P,E,T,O,D,A,R,j,X,Y,N,Z;let ae=e.strict,se=(t=e.code)===null||t===void 0?void 0:t.optimize,U=se===!0||se===void 0?1:se||0,xe=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Zq,ne=(i=e.uriResolver)!==null&&i!==void 0?i:Yme.default;return{strictSchema:(l=(s=e.strictSchema)!==null&&s!==void 0?s:ae)!==null&&l!==void 0?l:!0,strictNumbers:(p=(c=e.strictNumbers)!==null&&c!==void 0?c:ae)!==null&&p!==void 0?p:!0,strictTypes:(y=(h=e.strictTypes)!==null&&h!==void 0?h:ae)!==null&&y!==void 0?y:"log",strictTuples:(_=(b=e.strictTuples)!==null&&b!==void 0?b:ae)!==null&&_!==void 0?_:"log",strictRequired:(P=(C=e.strictRequired)!==null&&C!==void 0?C:ae)!==null&&P!==void 0?P:!1,code:e.code?re(k({},e.code),{optimize:U,regExp:xe}):{optimize:U,regExp:xe},loopRequired:(E=e.loopRequired)!==null&&E!==void 0?E:Hq,loopEnum:(T=e.loopEnum)!==null&&T!==void 0?T:Hq,meta:(O=e.meta)!==null&&O!==void 0?O:!0,messages:(D=e.messages)!==null&&D!==void 0?D:!0,inlineRefs:(A=e.inlineRefs)!==null&&A!==void 0?A:!0,schemaId:(R=e.schemaId)!==null&&R!==void 0?R:"$id",addUsedSchema:(j=e.addUsedSchema)!==null&&j!==void 0?j:!0,validateSchema:(X=e.validateSchema)!==null&&X!==void 0?X:!0,validateFormats:(Y=e.validateFormats)!==null&&Y!==void 0?Y:!0,unicodeRegExp:(N=e.unicodeRegExp)!==null&&N!==void 0?N:!0,int32range:(Z=e.int32range)!==null&&Z!==void 0?Z:!0,uriResolver:ne}}o(ege,"requiredOptions");var h5=class h5{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts=k(k({},t),ege(t));let{es5:r,lines:n}=this.opts.code;this.scope=new Xme.ValueScope({scope:{},prefixes:Kme,es5:r,lines:n}),this.logger=sge(t.logger);let i=t.validateFormats;t.validateFormats=!1,this.RULES=(0,Wme.getRules)(),Wq.call(this,Jme,t,"NOT SUPPORTED"),Wq.call(this,Qme,t,"DEPRECATED","warn"),this._metaOpts=ige.call(this),t.formats&&rge.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&nge.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),tge.call(this),t.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,i=qq;n==="id"&&(i=k({},qq),i.id=i.$id,delete i.$id),r&&t&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error('no schema with key or ref "'.concat(t,'"'))}else n=this.compile(t);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,t,r);async function i(y,b){await s.call(this,y.$schema);let _=this._addSchema(y,b);return _.validate||l.call(this,_)}async function s(y){y&&!this.getSchema(y)&&await i.call(this,{$ref:y},!0)}async function l(y){try{return this._compileSchemaEnv(y)}catch(b){if(!(b instanceof Yq.default))throw b;return c.call(this,b),await p.call(this,b.missingSchema),l.call(this,y)}}function c({missingSchema:y,missingRef:b}){if(this.refs[y])throw new Error("AnySchema ".concat(y," is loaded but ").concat(b," cannot be resolved"))}async function p(y){let b=await h.call(this,y);this.refs[y]||await s.call(this,b.$schema),this.refs[y]||this.addSchema(b,y,r)}async function h(y){let b=this._loading[y];if(b)return b;try{return await(this._loading[y]=n(y))}finally{delete this._loading[y]}}}addSchema(t,r,n,i=this.opts.validateSchema){if(Array.isArray(t)){for(let l of t)this.addSchema(l,void 0,n,i);return this}let s;if(typeof t=="object"){let{schemaId:l}=this.opts;if(s=t[l],s!==void 0&&typeof s!="string")throw new Error("schema ".concat(l," must be string"))}return r=(0,$x.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,i,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,t);if(!i&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(t){let r;for(;typeof(r=Xq.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Bx.SchemaEnv({schema:{},schemaId:n});if(r=Bx.resolveSchema.call(this,i,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Xq.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,$x.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(lge.call(this,n,r),!r)return(0,d5.eachItem)(n,s=>f5.call(this,s)),this;cge.call(this,r);let i=re(k({},r),{type:(0,HC.getJSONTypes)(r.type),schemaType:(0,HC.getJSONTypes)(r.schemaType)});return(0,d5.eachItem)(n,i.type.length===0?s=>f5.call(this,s,i):s=>i.type.forEach(l=>f5.call(this,s,i,l))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===t);i>=0&&n.rules.splice(i,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(i=>"".concat(n).concat(i.instancePath," ").concat(i.message)).reduce((i,s)=>i+r+s)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let i of r){let s=i.split("/").slice(1),l=t;for(let c of s)l=l[c];for(let c in n){let p=n[c];if(typeof p!="object")continue;let{$data:h}=p.definition,y=l[c];h&&y&&(l[c]=Kq(y))}}return t}_removeAllSchemas(t,r){for(let n in t){let i=t[n];(!r||r.test(n))&&(typeof i=="string"?delete t[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete t[n]))}}_addSchema(t,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let l,{schemaId:c}=this.opts;if(typeof t=="object")l=t[c];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let p=this._cache.get(t);if(p!==void 0)return p;n=(0,$x.normalizeId)(l||n);let h=$x.getSchemaRefs.call(this,t,n);return p=new Bx.SchemaEnv({schema:t,schemaId:c,meta:r,baseId:n,localRefs:h}),this._cache.set(p.schema,p),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=p),i&&this.validateSchema(t,!0),p}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error('schema with key or id "'.concat(t,'" already exists'))}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):Bx.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{Bx.compileSchema.call(this,t)}finally{this.opts=r}}};o(h5,"Ajv");var jx=h5;jx.ValidationError=Hme.default;jx.MissingRefError=Yq.default;fs.default=jx;function Wq(e,t,r,n="error"){for(let i in e){let s=i;s in t&&this.logger[n]("".concat(r,": option ").concat(i,". ").concat(e[s]))}}o(Wq,"checkOptions");function Xq(e){return e=(0,$x.normalizeId)(e),this.schemas[e]||this.refs[e]}o(Xq,"getSchEnv");function tge(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}o(tge,"addInitialSchemas");function rge(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}o(rge,"addInitialFormats");function nge(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}o(nge,"addInitialKeywords");function ige(){let e=k({},this.opts);for(let t of Zme)delete e[t];return e}o(ige,"getMetaSchemaOptions");var oge={log(){},warn(){},error(){}};function sge(e){if(e===!1)return oge;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}o(sge,"getLogger");var age=/^[a-z_$][a-z0-9_$:-]*$/i;function lge(e,t){let{RULES:r}=this;if((0,d5.eachItem)(e,n=>{if(r.keywords[n])throw new Error("Keyword ".concat(n," is already defined"));if(!age.test(n))throw new Error("Keyword ".concat(n," has invalid name"))}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}o(lge,"checkKeyword");function f5(e,t,r){var n;let i=t==null?void 0:t.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,l=i?s.post:s.rules.find(({type:p})=>p===r);if(l||(l={type:r,rules:[]},s.rules.push(l)),s.keywords[e]=!0,!t)return;let c={keyword:e,definition:re(k({},t),{type:(0,HC.getJSONTypes)(t.type),schemaType:(0,HC.getJSONTypes)(t.schemaType)})};t.before?uge.call(this,l,c,t.before):l.rules.push(c),s.all[e]=c,(n=t.implements)===null||n===void 0||n.forEach(p=>this.addKeyword(p))}o(f5,"addRule");function uge(e,t,r){let n=e.rules.findIndex(i=>i.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn("rule ".concat(r," is not defined")))}o(uge,"addBeforeRule");function cge(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=Kq(t)),e.validateSchema=this.compile(t,!0))}o(cge,"keywordMetaschema");var pge={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Kq(e){return{anyOf:[e,pge]}}o(Kq,"schemaOrData")});var Qq=fe(m5=>{"use strict";g();Object.defineProperty(m5,"__esModule",{value:!0});var fge={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};m5.default=fge});var fH=fe(og=>{"use strict";g();Object.defineProperty(og,"__esModule",{value:!0});og.callRef=og.getValidate=void 0;var dge=kx(),eH=$l(),Na=Wt(),K0=gf(),tH=UC(),WC=vn(),rH,hge={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:i,schemaEnv:s,validateName:l,opts:c,self:p}=n,{root:h}=s;if((r==="#"||r==="#/")&&i===h.baseId)return b();let y=tH.resolveRef.call(p,h,i,r);if(y===void 0)throw new dge.default(n.opts.uriResolver,i,r);if(y instanceof tH.SchemaEnv)return _(y);return C(y);function b(){if(s===h)return XC(e,l,s,s.$async);let P=t.scopeValue("root",{ref:h});return XC(e,(0,Na._)(rH||(rH=V(["",".validate"])),P),h,h.$async)}function _(P){let E=pH(e,P);XC(e,E,P,P.$async)}function C(P){let E=t.scopeValue("schema",c.code.source===!0?{ref:P,code:(0,Na.stringify)(P)}:{ref:P}),T=t.name("valid"),O=e.subschema({schema:P,dataTypes:[],schemaPath:Na.nil,topSchemaRef:E,errSchemaPath:r},T);e.mergeEvaluated(O),e.ok(T)}}},nH;function pH(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,Na._)(nH||(nH=V(["",".validate"])),r.scopeValue("wrapper",{ref:t}))}o(pH,"getValidate");og.getValidate=pH;var iH,oH,sH,aH,lH,uH,cH;function XC(e,t,r,n){let{gen:i,it:s}=e,{allErrors:l,schemaEnv:c,opts:p}=s,h=p.passContext?K0.default.this:Na.nil;n?y():b();function y(){if(!c.$async)throw new Error("async schema referenced by sync schema");let P=i.let("valid");i.try(()=>{i.code((0,Na._)(iH||(iH=V(["await ",""])),(0,eH.callValidateCode)(e,t,h))),C(t),l||i.assign(P,!0)},E=>{i.if((0,Na._)(oH||(oH=V(["!("," instanceof ",")"])),E,s.ValidationError),()=>i.throw(E)),_(E),l||i.assign(P,!1)}),e.ok(P)}o(y,"callAsyncRef");function b(){e.result((0,eH.callValidateCode)(e,t,h),()=>C(t),()=>_(t))}o(b,"callSyncRef");function _(P){let E=(0,Na._)(sH||(sH=V(["",".errors"])),P);i.assign(K0.default.vErrors,(0,Na._)(aH||(aH=V([""," === null ? "," : ",".concat(",")"])),K0.default.vErrors,E,K0.default.vErrors,E)),i.assign(K0.default.errors,(0,Na._)(lH||(lH=V(["",".length"])),K0.default.vErrors))}o(_,"addErrorsFrom");function C(P){var E;if(!s.opts.unevaluated)return;let T=(E=r==null?void 0:r.validate)===null||E===void 0?void 0:E.evaluated;if(s.props!==!0)if(T&&!T.dynamicProps)T.props!==void 0&&(s.props=WC.mergeEvaluated.props(i,T.props,s.props));else{let O=i.var("props",(0,Na._)(uH||(uH=V(["",".evaluated.props"])),P));s.props=WC.mergeEvaluated.props(i,O,s.props,Na.Name)}if(s.items!==!0)if(T&&!T.dynamicItems)T.items!==void 0&&(s.items=WC.mergeEvaluated.items(i,T.items,s.items));else{let O=i.var("items",(0,Na._)(cH||(cH=V(["",".evaluated.items"])),P));s.items=WC.mergeEvaluated.items(i,O,s.items,Na.Name)}}o(C,"addEvaluatedFrom")}o(XC,"callRef");og.callRef=XC;og.default=hge});var dH=fe(g5=>{"use strict";g();Object.defineProperty(g5,"__esModule",{value:!0});var mge=Qq(),gge=fH(),yge=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",mge.default,gge.default];g5.default=yge});var yH=fe(y5=>{"use strict";g();Object.defineProperty(y5,"__esModule",{value:!0});var YC=Wt(),Qd=YC.operators,ZC={maximum:{okStr:"<=",ok:Qd.LTE,fail:Qd.GT},minimum:{okStr:">=",ok:Qd.GTE,fail:Qd.LT},exclusiveMaximum:{okStr:"<",ok:Qd.LT,fail:Qd.GTE},exclusiveMinimum:{okStr:">",ok:Qd.GT,fail:Qd.LTE}},hH,mH,vge={message:o(({keyword:e,schemaCode:t})=>(0,YC.str)(hH||(hH=V(["must be "," ",""])),ZC[e].okStr,t),"message"),params:o(({keyword:e,schemaCode:t})=>(0,YC._)(mH||(mH=V(["{comparison: ",", limit: ","}"])),ZC[e].okStr,t),"params")},gH,bge={keyword:Object.keys(ZC),type:"number",schemaType:"number",$data:!0,error:vge,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,YC._)(gH||(gH=V([""," "," "," || isNaN(",")"])),r,ZC[t].fail,n,r))}};y5.default=bge});var SH=fe(v5=>{"use strict";g();Object.defineProperty(v5,"__esModule",{value:!0});var Gx=Wt(),vH,bH,xge={message:o(({schemaCode:e})=>(0,Gx.str)(vH||(vH=V(["must be multiple of ",""])),e),"message"),params:o(({schemaCode:e})=>(0,Gx._)(bH||(bH=V(["{multipleOf: ","}"])),e),"params")},xH,IH,_H,Ige={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:xge,code(e){let{gen:t,data:r,schemaCode:n,it:i}=e,s=i.opts.multipleOfPrecision,l=t.let("res"),c=s?(0,Gx._)(xH||(xH=V(["Math.abs(Math.round(",") - ",") > 1e-",""])),l,l,s):(0,Gx._)(IH||(IH=V([""," !== parseInt(",")"])),l,l);e.fail$data((0,Gx._)(_H||(_H=V(["("," === 0 || ("," = ","/",", ","))"])),n,l,r,n,c))}};v5.default=Ige});var wH=fe(b5=>{"use strict";g();Object.defineProperty(b5,"__esModule",{value:!0});function CH(e){let t=e.length,r=0,n=0,i;for(;n<t;)r++,i=e.charCodeAt(n++),i>=55296&&i<=56319&&n<t&&(i=e.charCodeAt(n),(i&64512)===56320&&n++);return r}o(CH,"ucs2length");b5.default=CH;CH.code='require("ajv/dist/runtime/ucs2length").default'});var LH=fe(x5=>{"use strict";g();Object.defineProperty(x5,"__esModule",{value:!0});var sg=Wt(),_ge=vn(),Sge=wH(),PH,TH,Cge={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,sg.str)(PH||(PH=V(["must NOT have "," than "," characters"])),r,t)},params:o(({schemaCode:e})=>(0,sg._)(TH||(TH=V(["{limit: ","}"])),e),"params")},EH,MH,OH,wge={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Cge,code(e){let{keyword:t,data:r,schemaCode:n,it:i}=e,s=t==="maxLength"?sg.operators.GT:sg.operators.LT,l=i.opts.unicode===!1?(0,sg._)(EH||(EH=V(["",".length"])),r):(0,sg._)(MH||(MH=V(["","(",")"])),(0,_ge.useFunc)(e.gen,Sge.default),r);e.fail$data((0,sg._)(OH||(OH=V([""," "," ",""])),l,s,n))}};x5.default=wge});var kH=fe(I5=>{"use strict";g();Object.defineProperty(I5,"__esModule",{value:!0});var Pge=$l(),KC=Wt(),AH,DH,Tge={message:o(({schemaCode:e})=>(0,KC.str)(AH||(AH=V(['must match pattern "','"'])),e),"message"),params:o(({schemaCode:e})=>(0,KC._)(DH||(DH=V(["{pattern: ","}"])),e),"params")},FH,NH,Ege={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Tge,code(e){let{data:t,$data:r,schema:n,schemaCode:i,it:s}=e,l=s.opts.unicodeRegExp?"u":"",c=r?(0,KC._)(FH||(FH=V(["(new RegExp(",", ","))"])),i,l):(0,Pge.usePattern)(e,n);e.fail$data((0,KC._)(NH||(NH=V(["!",".test(",")"])),c,t))}};I5.default=Ege});var jH=fe(_5=>{"use strict";g();Object.defineProperty(_5,"__esModule",{value:!0});var Ux=Wt(),RH,BH,Mge={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,Ux.str)(RH||(RH=V(["must NOT have "," than "," properties"])),r,t)},params:o(({schemaCode:e})=>(0,Ux._)(BH||(BH=V(["{limit: ","}"])),e),"params")},$H,Oge={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Mge,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxProperties"?Ux.operators.GT:Ux.operators.LT;e.fail$data((0,Ux._)($H||($H=V(["Object.keys(",").length "," ",""])),r,i,n))}};_5.default=Oge});var VH=fe(S5=>{"use strict";g();Object.defineProperty(S5,"__esModule",{value:!0});var Vx=$l(),zx=Wt(),Lge=vn(),GH,UH,Age={message:o(({params:{missingProperty:e}})=>(0,zx.str)(GH||(GH=V(["must have required property '","'"])),e),"message"),params:o(({params:{missingProperty:e}})=>(0,zx._)(UH||(UH=V(["{missingProperty: ","}"])),e),"params")},Dge={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Age,code(e){let{gen:t,schema:r,schemaCode:n,data:i,$data:s,it:l}=e,{opts:c}=l;if(!s&&r.length===0)return;let p=r.length>=c.loopRequired;if(l.allErrors?h():y(),c.strictRequired){let C=e.parentSchema.properties,{definedProperties:P}=e.it;for(let E of r)if((C==null?void 0:C[E])===void 0&&!P.has(E)){let T=l.schemaEnv.baseId+l.errSchemaPath,O='required property "'.concat(E,'" is not defined at "').concat(T,'" (strictRequired)');(0,Lge.checkStrictMode)(l,O,l.opts.strictRequired)}}function h(){if(p||s)e.block$data(zx.nil,b);else for(let C of r)(0,Vx.checkReportMissingProp)(e,C)}o(h,"allErrorsMode");function y(){let C=t.let("missing");if(p||s){let P=t.let("valid",!0);e.block$data(P,()=>_(C,P)),e.ok(P)}else t.if((0,Vx.checkMissingProp)(e,r,C)),(0,Vx.reportMissingProp)(e,C),t.else()}o(y,"exitOnErrorMode");function b(){t.forOf("prop",n,C=>{e.setParams({missingProperty:C}),t.if((0,Vx.noPropertyInData)(t,i,C,c.ownProperties),()=>e.error())})}o(b,"loopAllRequired");function _(C,P){e.setParams({missingProperty:C}),t.forOf(C,n,()=>{t.assign(P,(0,Vx.propertyInData)(t,i,C,c.ownProperties)),t.if((0,zx.not)(P),()=>{e.error(),t.break()})},zx.nil)}o(_,"loopUntilMissing")}};S5.default=Dge});var WH=fe(C5=>{"use strict";g();Object.defineProperty(C5,"__esModule",{value:!0});var qx=Wt(),zH,qH,Fge={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,qx.str)(zH||(zH=V(["must NOT have "," than "," items"])),r,t)},params:o(({schemaCode:e})=>(0,qx._)(qH||(qH=V(["{limit: ","}"])),e),"params")},HH,Nge={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Fge,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxItems"?qx.operators.GT:qx.operators.LT;e.fail$data((0,qx._)(HH||(HH=V(["",".length "," ",""])),r,i,n))}};C5.default=Nge});var JC=fe(w5=>{"use strict";g();Object.defineProperty(w5,"__esModule",{value:!0});var XH=q4();XH.code='require("ajv/dist/runtime/equal").default';w5.default=XH});var fW=fe(T5=>{"use strict";g();Object.defineProperty(T5,"__esModule",{value:!0});var P5=Lx(),ds=Wt(),kge=vn(),Rge=JC(),YH,ZH,Bge={message:o(({params:{i:e,j:t}})=>(0,ds.str)(YH||(YH=V(["must NOT have duplicate items (items ## "," and "," are identical)"])),t,e),"message"),params:o(({params:{i:e,j:t}})=>(0,ds._)(ZH||(ZH=V(["{i: ",", j: ","}"])),e,t),"params")},KH,JH,QH,eW,tW,rW,nW,iW,oW,sW,aW,lW,uW,cW,pW,$ge={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Bge,code(e){let{gen:t,data:r,$data:n,schema:i,parentSchema:s,schemaCode:l,it:c}=e;if(!n&&!i)return;let p=t.let("valid"),h=s.items?(0,P5.getSchemaTypes)(s.items):[];e.block$data(p,y,(0,ds._)(KH||(KH=V([""," === false"])),l)),e.ok(p);function y(){let P=t.let("i",(0,ds._)(JH||(JH=V(["",".length"])),r)),E=t.let("j");e.setParams({i:P,j:E}),t.assign(p,!0),t.if((0,ds._)(QH||(QH=V([""," > 1"])),P),()=>(b()?_:C)(P,E))}o(y,"validateUniqueItems");function b(){return h.length>0&&!h.some(P=>P==="object"||P==="array")}o(b,"canOptimize");function _(P,E){let T=t.name("item"),O=(0,P5.checkDataTypes)(h,T,c.opts.strictNumbers,P5.DataType.Wrong),D=t.const("indices",(0,ds._)(eW||(eW=V(["{}"]))));t.for((0,ds._)(tW||(tW=V([";","--;"])),P),()=>{t.let(T,(0,ds._)(rW||(rW=V(["","[","]"])),r,P)),t.if(O,(0,ds._)(nW||(nW=V(["continue"])))),h.length>1&&t.if((0,ds._)(iW||(iW=V(["typeof ",' == "string"'])),T),(0,ds._)(oW||(oW=V(["",' += "_"'])),T)),t.if((0,ds._)(sW||(sW=V(["typeof ","[",'] == "number"'])),D,T),()=>{t.assign(E,(0,ds._)(aW||(aW=V(["","[","]"])),D,T)),e.error(),t.assign(p,!1).break()}).code((0,ds._)(lW||(lW=V(["","[","] = ",""])),D,T,P))})}o(_,"loopN");function C(P,E){let T=(0,kge.useFunc)(t,Rge.default),O=t.name("outer");t.label(O).for((0,ds._)(uW||(uW=V([";","--;"])),P),()=>t.for((0,ds._)(cW||(cW=V([""," = ","; ","--;"])),E,P,E),()=>t.if((0,ds._)(pW||(pW=V(["","(","[","], ","[","])"])),T,r,P,r,E),()=>{e.error(),t.assign(p,!1).break(O)})))}o(C,"loopN2")}};T5.default=$ge});var gW=fe(M5=>{"use strict";g();Object.defineProperty(M5,"__esModule",{value:!0});var E5=Wt(),jge=vn(),Gge=JC(),dW,Uge={message:"must be equal to constant",params:o(({schemaCode:e})=>(0,E5._)(dW||(dW=V(["{allowedValue: ","}"])),e),"params")},hW,mW,Vge={keyword:"const",$data:!0,error:Uge,code(e){let{gen:t,data:r,$data:n,schemaCode:i,schema:s}=e;n||s&&typeof s=="object"?e.fail$data((0,E5._)(hW||(hW=V(["!","(",", ",")"])),(0,jge.useFunc)(t,Gge.default),r,i)):e.fail((0,E5._)(mW||(mW=V([""," !== ",""])),s,r))}};M5.default=Vge});var IW=fe(O5=>{"use strict";g();Object.defineProperty(O5,"__esModule",{value:!0});var Hx=Wt(),zge=vn(),qge=JC(),yW,Hge={message:"must be equal to one of the allowed values",params:o(({schemaCode:e})=>(0,Hx._)(yW||(yW=V(["{allowedValues: ","}"])),e),"params")},vW,bW,xW,Wge={keyword:"enum",schemaType:"array",$data:!0,error:Hge,code(e){let{gen:t,data:r,$data:n,schema:i,schemaCode:s,it:l}=e;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let c=i.length>=l.opts.loopEnum,p,h=o(()=>p!=null?p:p=(0,zge.useFunc)(t,qge.default),"getEql"),y;if(c||n)y=t.let("valid"),e.block$data(y,b);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let C=t.const("vSchema",s);y=(0,Hx.or)(...i.map((P,E)=>_(C,E)))}e.pass(y);function b(){t.assign(y,!1),t.forOf("v",s,C=>t.if((0,Hx._)(vW||(vW=V(["","(",", ",")"])),h(),r,C),()=>t.assign(y,!0).break()))}o(b,"loopEnum");function _(C,P){let E=i[P];return typeof E=="object"&&E!==null?(0,Hx._)(bW||(bW=V(["","(",", ","[","])"])),h(),r,C,P):(0,Hx._)(xW||(xW=V([""," === ",""])),r,E)}o(_,"equalCode")}};O5.default=Wge});var _W=fe(L5=>{"use strict";g();Object.defineProperty(L5,"__esModule",{value:!0});var Xge=yH(),Yge=SH(),Zge=LH(),Kge=kH(),Jge=jH(),Qge=VH(),eye=WH(),tye=fW(),rye=gW(),nye=IW(),iye=[Xge.default,Yge.default,Zge.default,Kge.default,Jge.default,Qge.default,eye.default,tye.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},rye.default,nye.default];L5.default=iye});var D5=fe(Wx=>{"use strict";g();Object.defineProperty(Wx,"__esModule",{value:!0});Wx.validateAdditionalItems=void 0;var ag=Wt(),A5=vn(),SW,CW,oye={message:o(({params:{len:e}})=>(0,ag.str)(SW||(SW=V(["must NOT have more than "," items"])),e),"message"),params:o(({params:{len:e}})=>(0,ag._)(CW||(CW=V(["{limit: ","}"])),e),"params")},sye={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:oye,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,A5.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}EW(e,n)}},wW,PW,TW;function EW(e,t){let{gen:r,schema:n,data:i,keyword:s,it:l}=e;l.items=!0;let c=r.const("len",(0,ag._)(wW||(wW=V(["",".length"])),i));if(n===!1)e.setParams({len:t.length}),e.pass((0,ag._)(PW||(PW=V([""," <= ",""])),c,t.length));else if(typeof n=="object"&&!(0,A5.alwaysValidSchema)(l,n)){let h=r.var("valid",(0,ag._)(TW||(TW=V([""," <= ",""])),c,t.length));r.if((0,ag.not)(h),()=>p(h)),e.ok(h)}function p(h){r.forRange("i",t.length,c,y=>{e.subschema({keyword:s,dataProp:y,dataPropType:A5.Type.Num},h),l.allErrors||r.if((0,ag.not)(h),()=>r.break())})}o(p,"validateItems")}o(EW,"validateAdditionalItems");Wx.validateAdditionalItems=EW;Wx.default=sye});var F5=fe(Xx=>{"use strict";g();Object.defineProperty(Xx,"__esModule",{value:!0});Xx.validateTuple=void 0;var MW=Wt(),QC=vn(),aye=$l(),lye={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return AW(e,"additionalItems",t);r.items=!0,!(0,QC.alwaysValidSchema)(r,t)&&e.ok((0,aye.validateArray)(e))}},OW,LW;function AW(e,t,r=e.schema){let{gen:n,parentSchema:i,data:s,keyword:l,it:c}=e;y(i),c.opts.unevaluated&&r.length&&c.items!==!0&&(c.items=QC.mergeEvaluated.items(n,r.length,c.items));let p=n.name("valid"),h=n.const("len",(0,MW._)(OW||(OW=V(["",".length"])),s));r.forEach((b,_)=>{(0,QC.alwaysValidSchema)(c,b)||(n.if((0,MW._)(LW||(LW=V([""," > ",""])),h,_),()=>e.subschema({keyword:l,schemaProp:_,dataProp:_},p)),e.ok(p))});function y(b){let{opts:_,errSchemaPath:C}=c,P=r.length,E=P===b.minItems&&(P===b.maxItems||b[t]===!1);if(_.strictTuples&&!E){let T='"'.concat(l,'" is ').concat(P,"-tuple, but minItems or maxItems/").concat(t,' are not specified or different at path "').concat(C,'"');(0,QC.checkStrictMode)(c,T,_.strictTuples)}}o(y,"checkStrictTuple")}o(AW,"validateTuple");Xx.validateTuple=AW;Xx.default=lye});var DW=fe(N5=>{"use strict";g();Object.defineProperty(N5,"__esModule",{value:!0});var uye=F5(),cye={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:o(e=>(0,uye.validateTuple)(e,"items"),"code")};N5.default=cye});var RW=fe(k5=>{"use strict";g();Object.defineProperty(k5,"__esModule",{value:!0});var FW=Wt(),pye=vn(),fye=$l(),dye=D5(),NW,kW,hye={message:o(({params:{len:e}})=>(0,FW.str)(NW||(NW=V(["must NOT have more than "," items"])),e),"message"),params:o(({params:{len:e}})=>(0,FW._)(kW||(kW=V(["{limit: ","}"])),e),"params")},mye={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:hye,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:i}=r;n.items=!0,!(0,pye.alwaysValidSchema)(n,t)&&(i?(0,dye.validateAdditionalItems)(e,i):e.ok((0,fye.validateArray)(e)))}};k5.default=mye});var ZW=fe(R5=>{"use strict";g();Object.defineProperty(R5,"__esModule",{value:!0});var Gl=Wt(),ew=vn(),BW,$W,jW,GW,gye={message:o(({params:{min:e,max:t}})=>t===void 0?(0,Gl.str)(BW||(BW=V(["must contain at least "," valid item(s)"])),e):(0,Gl.str)($W||($W=V(["must contain at least "," and no more than "," valid item(s)"])),e,t),"message"),params:o(({params:{min:e,max:t}})=>t===void 0?(0,Gl._)(jW||(jW=V(["{minContains: ","}"])),e):(0,Gl._)(GW||(GW=V(["{minContains: ",", maxContains: ","}"])),e,t),"params")},UW,VW,zW,qW,HW,WW,XW,YW,yye={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:gye,code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:s}=e,l,c,{minContains:p,maxContains:h}=n;s.opts.next?(l=p===void 0?1:p,c=h):l=1;let y=t.const("len",(0,Gl._)(UW||(UW=V(["",".length"])),i));if(e.setParams({min:l,max:c}),c===void 0&&l===0){(0,ew.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(c!==void 0&&l>c){(0,ew.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,ew.alwaysValidSchema)(s,r)){let E=(0,Gl._)(VW||(VW=V([""," >= ",""])),y,l);c!==void 0&&(E=(0,Gl._)(zW||(zW=V([""," && "," <= ",""])),E,y,c)),e.pass(E);return}s.items=!0;let b=t.name("valid");c===void 0&&l===1?C(b,()=>t.if(b,()=>t.break())):l===0?(t.let(b,!0),c!==void 0&&t.if((0,Gl._)(qW||(qW=V(["",".length > 0"])),i),_)):(t.let(b,!1),_()),e.result(b,()=>e.reset());function _(){let E=t.name("_valid"),T=t.let("count",0);C(E,()=>t.if(E,()=>P(T)))}o(_,"validateItemsWithCount");function C(E,T){t.forRange("i",0,y,O=>{e.subschema({keyword:"contains",dataProp:O,dataPropType:ew.Type.Num,compositeRule:!0},E),T()})}o(C,"validateItems");function P(E){t.code((0,Gl._)(HW||(HW=V(["","++"])),E)),c===void 0?t.if((0,Gl._)(WW||(WW=V([""," >= ",""])),E,l),()=>t.assign(b,!0).break()):(t.if((0,Gl._)(XW||(XW=V([""," > ",""])),E,c),()=>t.assign(b,!1).break()),l===1?t.assign(b,!0):t.if((0,Gl._)(YW||(YW=V([""," >= ",""])),E,l),()=>t.assign(b,!0)))}o(P,"checkLimits")}};R5.default=yye});var rX=fe(Zc=>{"use strict";g();Object.defineProperty(Zc,"__esModule",{value:!0});Zc.validateSchemaDeps=Zc.validatePropertyDeps=Zc.error=void 0;var B5=Wt(),vye=vn(),Yx=$l(),KW,JW;Zc.error={message:o(({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,B5.str)(KW||(KW=V(["must have "," "," when property "," is present"])),n,r,e)},"message"),params:o(({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,B5._)(JW||(JW=V(["{property: ",",\n missingProperty: ",",\n depsCount: ",",\n deps: ","}"])),e,n,t,r),"params")};var bye={keyword:"dependencies",type:"object",schemaType:"object",error:Zc.error,code(e){let[t,r]=xye(e);eX(e,t),tX(e,r)}};function xye({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let i=Array.isArray(e[n])?t:r;i[n]=e[n]}return[t,r]}o(xye,"splitDependencies");var QW;function eX(e,t=e.schema){let{gen:r,data:n,it:i}=e;if(Object.keys(t).length===0)return;let s=r.let("missing");for(let l in t){let c=t[l];if(c.length===0)continue;let p=(0,Yx.propertyInData)(r,n,l,i.opts.ownProperties);e.setParams({property:l,depsCount:c.length,deps:c.join(", ")}),i.allErrors?r.if(p,()=>{for(let h of c)(0,Yx.checkReportMissingProp)(e,h)}):(r.if((0,B5._)(QW||(QW=V([""," && (",")"])),p,(0,Yx.checkMissingProp)(e,c,s))),(0,Yx.reportMissingProp)(e,s),r.else())}}o(eX,"validatePropertyDeps");Zc.validatePropertyDeps=eX;function tX(e,t=e.schema){let{gen:r,data:n,keyword:i,it:s}=e,l=r.name("valid");for(let c in t)(0,vye.alwaysValidSchema)(s,t[c])||(r.if((0,Yx.propertyInData)(r,n,c,s.opts.ownProperties),()=>{let p=e.subschema({keyword:i,schemaProp:c},l);e.mergeValidEvaluated(p,l)},()=>r.var(l,!0)),e.ok(l))}o(tX,"validateSchemaDeps");Zc.validateSchemaDeps=tX;Zc.default=bye});var oX=fe($5=>{"use strict";g();Object.defineProperty($5,"__esModule",{value:!0});var iX=Wt(),Iye=vn(),nX,_ye={message:"property name must be valid",params:o(({params:e})=>(0,iX._)(nX||(nX=V(["{propertyName: ","}"])),e.propertyName),"params")},Sye={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:_ye,code(e){let{gen:t,schema:r,data:n,it:i}=e;if((0,Iye.alwaysValidSchema)(i,r))return;let s=t.name("valid");t.forIn("key",n,l=>{e.setParams({propertyName:l}),e.subschema({keyword:"propertyNames",data:l,dataTypes:["string"],propertyName:l,compositeRule:!0},s),t.if((0,iX.not)(s),()=>{e.error(!0),i.allErrors||t.break()})}),e.ok(s)}};$5.default=Sye});var G5=fe(j5=>{"use strict";g();Object.defineProperty(j5,"__esModule",{value:!0});var tw=$l(),$u=Wt(),Cye=gf(),rw=vn(),sX,wye={message:"must NOT have additional properties",params:o(({params:e})=>(0,$u._)(sX||(sX=V(["{additionalProperty: ","}"])),e.additionalProperty),"params")},aX,lX,uX,cX,Pye={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:wye,code(e){let{gen:t,schema:r,parentSchema:n,data:i,errsCount:s,it:l}=e;if(!s)throw new Error("ajv implementation error");let{allErrors:c,opts:p}=l;if(l.props=!0,p.removeAdditional!=="all"&&(0,rw.alwaysValidSchema)(l,r))return;let h=(0,tw.allSchemaProperties)(n.properties),y=(0,tw.allSchemaProperties)(n.patternProperties);b(),e.ok((0,$u._)(aX||(aX=V([""," === ",""])),s,Cye.default.errors));function b(){t.forIn("key",i,T=>{!h.length&&!y.length?P(T):t.if(_(T),()=>P(T))})}o(b,"checkAdditionalProperties");function _(T){let O;if(h.length>8){let D=(0,rw.schemaRefOrVal)(l,n.properties,"properties");O=(0,tw.isOwnProperty)(t,D,T)}else h.length?O=(0,$u.or)(...h.map(D=>(0,$u._)(lX||(lX=V([""," === ",""])),T,D))):O=$u.nil;return y.length&&(O=(0,$u.or)(O,...y.map(D=>(0,$u._)(uX||(uX=V(["",".test(",")"])),(0,tw.usePattern)(e,D),T)))),(0,$u.not)(O)}o(_,"isAdditional");function C(T){t.code((0,$u._)(cX||(cX=V(["delete ","[","]"])),i,T))}o(C,"deleteAdditional");function P(T){if(p.removeAdditional==="all"||p.removeAdditional&&r===!1){C(T);return}if(r===!1){e.setParams({additionalProperty:T}),e.error(),c||t.break();return}if(typeof r=="object"&&!(0,rw.alwaysValidSchema)(l,r)){let O=t.name("valid");p.removeAdditional==="failing"?(E(T,O,!1),t.if((0,$u.not)(O),()=>{e.reset(),C(T)})):(E(T,O),c||t.if((0,$u.not)(O),()=>t.break()))}}o(P,"additionalPropertyCode");function E(T,O,D){let A={keyword:"additionalProperties",dataProp:T,dataPropType:rw.Type.Str};D===!1&&Object.assign(A,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(A,O)}o(E,"applyAdditionalSchema")}};j5.default=Pye});var dX=fe(V5=>{"use strict";g();Object.defineProperty(V5,"__esModule",{value:!0});var Tye=Nx(),pX=$l(),U5=vn(),fX=G5(),Eye={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:s}=e;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&fX.default.code(new Tye.KeywordCxt(s,fX.default,"additionalProperties"));let l=(0,pX.allSchemaProperties)(r);for(let b of l)s.definedProperties.add(b);s.opts.unevaluated&&l.length&&s.props!==!0&&(s.props=U5.mergeEvaluated.props(t,(0,U5.toHash)(l),s.props));let c=l.filter(b=>!(0,U5.alwaysValidSchema)(s,r[b]));if(c.length===0)return;let p=t.name("valid");for(let b of c)h(b)?y(b):(t.if((0,pX.propertyInData)(t,i,b,s.opts.ownProperties)),y(b),s.allErrors||t.else().var(p,!0),t.endIf()),e.it.definedProperties.add(b),e.ok(p);function h(b){return s.opts.useDefaults&&!s.compositeRule&&r[b].default!==void 0}o(h,"hasDefault");function y(b){e.subschema({keyword:"properties",schemaProp:b,dataProp:b},p)}o(y,"applyPropertySchema")}};V5.default=Eye});var bX=fe(z5=>{"use strict";g();Object.defineProperty(z5,"__esModule",{value:!0});var hX=$l(),nw=Wt(),mX=vn(),gX=vn(),yX,vX,Mye={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:i,it:s}=e,{opts:l}=s,c=(0,hX.allSchemaProperties)(r),p=c.filter(E=>(0,mX.alwaysValidSchema)(s,r[E]));if(c.length===0||p.length===c.length&&(!s.opts.unevaluated||s.props===!0))return;let h=l.strictSchema&&!l.allowMatchingProperties&&i.properties,y=t.name("valid");s.props!==!0&&!(s.props instanceof nw.Name)&&(s.props=(0,gX.evaluatedPropsToName)(t,s.props));let{props:b}=s;_();function _(){for(let E of c)h&&C(E),s.allErrors?P(E):(t.var(y,!0),P(E),t.if(y))}o(_,"validatePatternProperties");function C(E){for(let T in h)new RegExp(E).test(T)&&(0,mX.checkStrictMode)(s,"property ".concat(T," matches pattern ").concat(E," (use allowMatchingProperties)"))}o(C,"checkMatchingProperties");function P(E){t.forIn("key",n,T=>{t.if((0,nw._)(yX||(yX=V(["",".test(",")"])),(0,hX.usePattern)(e,E),T),()=>{let O=p.includes(E);O||e.subschema({keyword:"patternProperties",schemaProp:E,dataProp:T,dataPropType:gX.Type.Str},y),s.opts.unevaluated&&b!==!0?t.assign((0,nw._)(vX||(vX=V(["","[","]"])),b,T),!0):!O&&!s.allErrors&&t.if((0,nw.not)(y),()=>t.break())})})}o(P,"validateProperties")}};z5.default=Mye});var xX=fe(q5=>{"use strict";g();Object.defineProperty(q5,"__esModule",{value:!0});var Oye=vn(),Lye={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,Oye.alwaysValidSchema)(n,r)){e.fail();return}let i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};q5.default=Lye});var IX=fe(H5=>{"use strict";g();Object.defineProperty(H5,"__esModule",{value:!0});var Aye=$l(),Dye={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Aye.validateUnion,error:{message:"must match a schema in anyOf"}};H5.default=Dye});var wX=fe(W5=>{"use strict";g();Object.defineProperty(W5,"__esModule",{value:!0});var iw=Wt(),Fye=vn(),_X,Nye={message:"must match exactly one schema in oneOf",params:o(({params:e})=>(0,iw._)(_X||(_X=V(["{passingSchemas: ","}"])),e.passing),"params")},SX,CX,kye={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Nye,code(e){let{gen:t,schema:r,parentSchema:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,l=t.let("valid",!1),c=t.let("passing",null),p=t.name("_valid");e.setParams({passing:c}),t.block(h),e.result(l,()=>e.reset(),()=>e.error(!0));function h(){s.forEach((y,b)=>{let _;(0,Fye.alwaysValidSchema)(i,y)?t.var(p,!0):_=e.subschema({keyword:"oneOf",schemaProp:b,compositeRule:!0},p),b>0&&t.if((0,iw._)(SX||(SX=V([""," && ",""])),p,l)).assign(l,!1).assign(c,(0,iw._)(CX||(CX=V(["[",", ","]"])),c,b)).else(),t.if(p,()=>{t.assign(l,!0),t.assign(c,b),_&&e.mergeEvaluated(_,iw.Name)})})}o(h,"validateOneOf")}};W5.default=kye});var PX=fe(X5=>{"use strict";g();Object.defineProperty(X5,"__esModule",{value:!0});var Rye=vn(),Bye={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=t.name("valid");r.forEach((s,l)=>{if((0,Rye.alwaysValidSchema)(n,s))return;let c=e.subschema({keyword:"allOf",schemaProp:l},i);e.ok(i),e.mergeEvaluated(c)})}};X5.default=Bye});var AX=fe(Y5=>{"use strict";g();Object.defineProperty(Y5,"__esModule",{value:!0});var ow=Wt(),LX=vn(),EX,MX,$ye={message:o(({params:e})=>(0,ow.str)(EX||(EX=V(['must match "','" schema'])),e.ifClause),"message"),params:o(({params:e})=>(0,ow._)(MX||(MX=V(["{failingKeyword: ","}"])),e.ifClause),"params")},OX,jye={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:$ye,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,LX.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=TX(n,"then"),s=TX(n,"else");if(!i&&!s)return;let l=t.let("valid",!0),c=t.name("_valid");if(p(),e.reset(),i&&s){let y=t.let("ifClause");e.setParams({ifClause:y}),t.if(c,h("then",y),h("else",y))}else i?t.if(c,h("then")):t.if((0,ow.not)(c),h("else"));e.pass(l,()=>e.error(!0));function p(){let y=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},c);e.mergeEvaluated(y)}o(p,"validateIf");function h(y,b){return()=>{let _=e.subschema({keyword:y},c);t.assign(l,c),e.mergeValidEvaluated(_,l),b?t.assign(b,(0,ow._)(OX||(OX=V(["",""])),y)):e.setParams({ifClause:y})}}o(h,"validateClause")}};function TX(e,t){let r=e.schema[t];return r!==void 0&&!(0,LX.alwaysValidSchema)(e,r)}o(TX,"hasSchema");Y5.default=jye});var DX=fe(Z5=>{"use strict";g();Object.defineProperty(Z5,"__esModule",{value:!0});var Gye=vn(),Uye={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,Gye.checkStrictMode)(r,'"'.concat(e,'" without "if" is ignored'))}};Z5.default=Uye});var FX=fe(K5=>{"use strict";g();Object.defineProperty(K5,"__esModule",{value:!0});var Vye=D5(),zye=DW(),qye=F5(),Hye=RW(),Wye=ZW(),Xye=rX(),Yye=oX(),Zye=G5(),Kye=dX(),Jye=bX(),Qye=xX(),e0e=IX(),t0e=wX(),r0e=PX(),n0e=AX(),i0e=DX();function o0e(e=!1){let t=[Qye.default,e0e.default,t0e.default,r0e.default,n0e.default,i0e.default,Yye.default,Zye.default,Xye.default,Kye.default,Jye.default];return e?t.push(zye.default,Hye.default):t.push(Vye.default,qye.default),t.push(Wye.default),t}o(o0e,"getApplicator");K5.default=o0e});var JX=fe(J5=>{"use strict";g();Object.defineProperty(J5,"__esModule",{value:!0});var Ki=Wt(),NX,kX,s0e={message:o(({schemaCode:e})=>(0,Ki.str)(NX||(NX=V(['must match format "','"'])),e),"message"),params:o(({schemaCode:e})=>(0,Ki._)(kX||(kX=V(["{format: ","}"])),e),"params")},RX,BX,$X,jX,GX,UX,VX,zX,qX,HX,WX,XX,YX,ZX,KX,a0e={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:s0e,code(e,t){let{gen:r,data:n,$data:i,schema:s,schemaCode:l,it:c}=e,{opts:p,errSchemaPath:h,schemaEnv:y,self:b}=c;if(!p.validateFormats)return;i?_():C();function _(){let P=r.scopeValue("formats",{ref:b.formats,code:p.code.formats}),E=r.const("fDef",(0,Ki._)(RX||(RX=V(["","[","]"])),P,l)),T=r.let("fType"),O=r.let("format");r.if((0,Ki._)(BX||(BX=V(["typeof ",' == "object" && !('," instanceof RegExp)"])),E,E),()=>r.assign(T,(0,Ki._)($X||($X=V(["",'.type || "string"'])),E)).assign(O,(0,Ki._)(jX||(jX=V(["",".validate"])),E)),()=>r.assign(T,(0,Ki._)(GX||(GX=V(['"string"'])))).assign(O,E)),e.fail$data((0,Ki.or)(D(),A()));function D(){return p.strictSchema===!1?Ki.nil:(0,Ki._)(UX||(UX=V([""," && !",""])),l,O)}o(D,"unknownFmt");function A(){let R=y.$async?(0,Ki._)(VX||(VX=V(["(",".async ? await ","(",") : ","(","))"])),E,O,n,O,n):(0,Ki._)(zX||(zX=V(["","(",")"])),O,n),j=(0,Ki._)(qX||(qX=V(["(typeof ",' == "function" ? '," : ",".test(","))"])),O,R,O,n);return(0,Ki._)(HX||(HX=V([""," && "," !== true && "," === "," && !",""])),O,O,T,t,j)}o(A,"invalidFmt")}o(_,"validate$DataFormat");function C(){let P=b.formats[s];if(!P){D();return}if(P===!0)return;let[E,T,O]=A(P);E===t&&e.pass(R());function D(){if(p.strictSchema===!1){b.logger.warn(j());return}throw new Error(j());function j(){return'unknown format "'.concat(s,'" ignored in schema at path "').concat(h,'"')}}o(D,"unknownFormat");function A(j){let X=j instanceof RegExp?(0,Ki.regexpCode)(j):p.code.formats?(0,Ki._)(WX||(WX=V(["","",""])),p.code.formats,(0,Ki.getProperty)(s)):void 0,Y=r.scopeValue("formats",{key:s,ref:j,code:X});return typeof j=="object"&&!(j instanceof RegExp)?[j.type||"string",j.validate,(0,Ki._)(XX||(XX=V(["",".validate"])),Y)]:["string",j,Y]}o(A,"getFormat");function R(){if(typeof P=="object"&&!(P instanceof RegExp)&&P.async){if(!y.$async)throw new Error("async format in sync schema");return(0,Ki._)(YX||(YX=V(["await ","(",")"])),O,n)}return typeof T=="function"?(0,Ki._)(ZX||(ZX=V(["","(",")"])),O,n):(0,Ki._)(KX||(KX=V(["",".test(",")"])),O,n)}o(R,"validCondition")}o(C,"validateFormat")}};J5.default=a0e});var QX=fe(Q5=>{"use strict";g();Object.defineProperty(Q5,"__esModule",{value:!0});var l0e=JX(),u0e=[l0e.default];Q5.default=u0e});var eY=fe(J0=>{"use strict";g();Object.defineProperty(J0,"__esModule",{value:!0});J0.contentVocabulary=J0.metadataVocabulary=void 0;J0.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];J0.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var rY=fe(e6=>{"use strict";g();Object.defineProperty(e6,"__esModule",{value:!0});var c0e=dH(),p0e=_W(),f0e=FX(),d0e=QX(),tY=eY(),h0e=[c0e.default,p0e.default,(0,f0e.default)(),d0e.default,tY.metadataVocabulary,tY.contentVocabulary];e6.default=h0e});var iY=fe(sw=>{"use strict";g();Object.defineProperty(sw,"__esModule",{value:!0});sw.DiscrError=void 0;var nY;(function(e){e.Tag="tag",e.Mapping="mapping"})(nY||(sw.DiscrError=nY={}))});var cY=fe(r6=>{"use strict";g();Object.defineProperty(r6,"__esModule",{value:!0});var Q0=Wt(),t6=iY(),oY=UC(),m0e=kx(),g0e=vn(),sY,y0e={message:o(({params:{discrError:e,tagName:t}})=>e===t6.DiscrError.Tag?'tag "'.concat(t,'" must be string'):'value of tag "'.concat(t,'" must be in oneOf'),"message"),params:o(({params:{discrError:e,tag:t,tagName:r}})=>(0,Q0._)(sY||(sY=V(["{error: ",", tag: ",", tagValue: ","}"])),e,r,t),"params")},aY,lY,uY,v0e={keyword:"discriminator",type:"object",schemaType:"object",error:y0e,code(e){let{gen:t,data:r,schema:n,parentSchema:i,it:s}=e,{oneOf:l}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let c=n.propertyName;if(typeof c!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!l)throw new Error("discriminator: requires oneOf keyword");let p=t.let("valid",!1),h=t.const("tag",(0,Q0._)(aY||(aY=V(["","",""])),r,(0,Q0.getProperty)(c)));t.if((0,Q0._)(lY||(lY=V(["typeof ",' == "string"'])),h),()=>y(),()=>e.error(!1,{discrError:t6.DiscrError.Tag,tag:h,tagName:c})),e.ok(p);function y(){let C=_();t.if(!1);for(let P in C)t.elseIf((0,Q0._)(uY||(uY=V([""," === ",""])),h,P)),t.assign(p,b(C[P]));t.else(),e.error(!1,{discrError:t6.DiscrError.Mapping,tag:h,tagName:c}),t.endIf()}o(y,"validateMapping");function b(C){let P=t.name("valid"),E=e.subschema({keyword:"oneOf",schemaProp:C},P);return e.mergeEvaluated(E,Q0.Name),P}o(b,"applyTagSchema");function _(){var C;let P={},E=O(i),T=!0;for(let R=0;R<l.length;R++){let j=l[R];if(j!=null&&j.$ref&&!(0,g0e.schemaHasRulesButRef)(j,s.self.RULES)){let Y=j.$ref;if(j=oY.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,Y),j instanceof oY.SchemaEnv&&(j=j.schema),j===void 0)throw new m0e.default(s.opts.uriResolver,s.baseId,Y)}let X=(C=j==null?void 0:j.properties)===null||C===void 0?void 0:C[c];if(typeof X!="object")throw new Error('discriminator: oneOf subschemas (or referenced schemas) must have "properties/'.concat(c,'"'));T=T&&(E||O(j)),D(X,R)}if(!T)throw new Error('discriminator: "'.concat(c,'" must be required'));return P;function O({required:R}){return Array.isArray(R)&&R.includes(c)}function D(R,j){if(R.const)A(R.const,j);else if(R.enum)for(let X of R.enum)A(X,j);else throw new Error('discriminator: "properties/'.concat(c,'" must have "const" or "enum"'))}function A(R,j){if(typeof R!="string"||R in P)throw new Error('discriminator: "'.concat(c,'" values must be unique strings'));P[R]=j}}o(_,"getMapping")}};r6.default=v0e});var pY=fe((lyt,b0e)=>{b0e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var o6=fe((fi,n6)=>{"use strict";g();Object.defineProperty(fi,"__esModule",{value:!0});fi.MissingRefError=fi.ValidationError=fi.CodeGen=fi.Name=fi.nil=fi.stringify=fi.str=fi._=fi.KeywordCxt=fi.Ajv=void 0;var x0e=Jq(),I0e=rY(),_0e=cY(),fY=pY(),S0e=["/properties"],aw="http://json-schema.org/draft-07/schema",i6=class i6 extends x0e.default{_addVocabularies(){super._addVocabularies(),I0e.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(_0e.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(fY,S0e):fY;this.addMetaSchema(t,aw,!1),this.refs["http://json-schema.org/schema"]=aw}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(aw)?aw:void 0)}};o(i6,"Ajv");var e1=i6;fi.Ajv=e1;n6.exports=fi=e1;n6.exports.Ajv=e1;Object.defineProperty(fi,"__esModule",{value:!0});fi.default=e1;var C0e=Nx();Object.defineProperty(fi,"KeywordCxt",{enumerable:!0,get:o(function(){return C0e.KeywordCxt},"get")});var t1=Wt();Object.defineProperty(fi,"_",{enumerable:!0,get:o(function(){return t1._},"get")});Object.defineProperty(fi,"str",{enumerable:!0,get:o(function(){return t1.str},"get")});Object.defineProperty(fi,"stringify",{enumerable:!0,get:o(function(){return t1.stringify},"get")});Object.defineProperty(fi,"nil",{enumerable:!0,get:o(function(){return t1.nil},"get")});Object.defineProperty(fi,"Name",{enumerable:!0,get:o(function(){return t1.Name},"get")});Object.defineProperty(fi,"CodeGen",{enumerable:!0,get:o(function(){return t1.CodeGen},"get")});var w0e=jC();Object.defineProperty(fi,"ValidationError",{enumerable:!0,get:o(function(){return w0e.default},"get")});var P0e=kx();Object.defineProperty(fi,"MissingRefError",{enumerable:!0,get:o(function(){return P0e.default},"get")})});var vY=fe(Kc=>{"use strict";g();Object.defineProperty(Kc,"__esModule",{value:!0});Kc.formatNames=Kc.fastFormats=Kc.fullFormats=void 0;function r1(e,t){return{validate:e,compare:t}}o(r1,"fmtDef");Kc.fullFormats={date:r1(mY,l6),time:r1(gY,u6),"date-time":r1(O0e,yY),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:D0e,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:new RegExp("^(?:https?|ftp):\\/\\/(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u{00a1}-\\u{ffff}]+-)*[a-z0-9\\u{00a1}-\\u{ffff}]+)(?:\\.(?:[a-z0-9\\u{00a1}-\\u{ffff}]+-)*[a-z0-9\\u{00a1}-\\u{ffff}]+)*(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}]{2,})))(?::\\d{2,5})?(?:\\/[^\\s]*)?$","iu"),email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:j0e,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:F0e,int32:{type:"number",validate:R0e},int64:{type:"number",validate:B0e},float:{type:"number",validate:hY},double:{type:"number",validate:hY},password:!0,binary:!0};Kc.fastFormats=re(k({},Kc.fullFormats),{date:r1(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,l6),time:r1(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u6),"date-time":r1(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,yY),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i});Kc.formatNames=Object.keys(Kc.fullFormats);function T0e(e){return e%4===0&&(e%100!==0||e%400===0)}o(T0e,"isLeapYear");var E0e=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,M0e=[0,31,28,31,30,31,30,31,31,30,31,30,31];function mY(e){let t=E0e.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],i=+t[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&T0e(r)?29:M0e[n])}o(mY,"date");function l6(e,t){if(e&&t)return e>t?1:e<t?-1:0}o(l6,"compareDate");var s6=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function gY(e,t){let r=s6.exec(e);if(!r)return!1;let n=+r[1],i=+r[2],s=+r[3],l=r[5];return(n<=23&&i<=59&&s<=59||n===23&&i===59&&s===60)&&(!t||l!=="")}o(gY,"time");function u6(e,t){if(!(e&&t))return;let r=s6.exec(e),n=s6.exec(t);if(r&&n)return e=r[1]+r[2]+r[3]+(r[4]||""),t=n[1]+n[2]+n[3]+(n[4]||""),e>t?1:e<t?-1:0}o(u6,"compareTime");var a6=/t|\s/i;function O0e(e){let t=e.split(a6);return t.length===2&&mY(t[0])&&gY(t[1],!0)}o(O0e,"date_time");function yY(e,t){if(!(e&&t))return;let[r,n]=e.split(a6),[i,s]=t.split(a6),l=l6(r,i);if(l!==void 0)return l||u6(n,s)}o(yY,"compareDateTime");var L0e=/\/|:/,A0e=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function D0e(e){return L0e.test(e)&&A0e.test(e)}o(D0e,"uri");var dY=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function F0e(e){return dY.lastIndex=0,dY.test(e)}o(F0e,"byte");var N0e=-(2**31),k0e=2**31-1;function R0e(e){return Number.isInteger(e)&&e<=k0e&&e>=N0e}o(R0e,"validateInt32");function B0e(e){return Number.isInteger(e)}o(B0e,"validateInt64");function hY(){return!0}o(hY,"validateNumber");var $0e=/[^\\]\\Z/;function j0e(e){if($0e.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}o(j0e,"regex")});var TY=fe(n1=>{"use strict";g();Object.defineProperty(n1,"__esModule",{value:!0});n1.formatLimitDefinition=void 0;var G0e=o6(),ju=Wt(),eh=ju.operators,lw={formatMaximum:{okStr:"<=",ok:eh.LTE,fail:eh.GT},formatMinimum:{okStr:">=",ok:eh.GTE,fail:eh.LT},formatExclusiveMaximum:{okStr:"<",ok:eh.LT,fail:eh.GTE},formatExclusiveMinimum:{okStr:">",ok:eh.GT,fail:eh.LTE}},bY,xY,U0e={message:o(({keyword:e,schemaCode:t})=>ju.str(bY||(bY=V(["should be "," ",""])),lw[e].okStr,t),"message"),params:o(({keyword:e,schemaCode:t})=>ju._(xY||(xY=V(["{comparison: ",", limit: ","}"])),lw[e].okStr,t),"params")},IY,_Y,SY,CY,wY,PY;n1.formatLimitDefinition={keyword:Object.keys(lw),type:"string",schemaType:"string",$data:!0,error:U0e,code(e){let{gen:t,data:r,schemaCode:n,keyword:i,it:s}=e,{opts:l,self:c}=s;if(!l.validateFormats)return;let p=new G0e.KeywordCxt(s,c.RULES.all.format.definition,"format");p.$data?h():y();function h(){let _=t.scopeValue("formats",{ref:c.formats,code:l.code.formats}),C=t.const("fmt",ju._(IY||(IY=V(["","[","]"])),_,p.schemaCode));e.fail$data(ju.or(ju._(_Y||(_Y=V(["typeof ",' != "object"'])),C),ju._(SY||(SY=V([""," instanceof RegExp"])),C),ju._(CY||(CY=V(["typeof ",'.compare != "function"'])),C),b(C)))}o(h,"validate$DataFormat");function y(){let _=p.schema,C=c.formats[_];if(!C||C===!0)return;if(typeof C!="object"||C instanceof RegExp||typeof C.compare!="function")throw new Error('"'.concat(i,'": format "').concat(_,'" does not define "compare" function'));let P=t.scopeValue("formats",{key:_,ref:C,code:l.code.formats?ju._(wY||(wY=V(["","",""])),l.code.formats,ju.getProperty(_)):void 0});e.fail$data(b(P))}o(y,"validateFormat");function b(_){return ju._(PY||(PY=V(["",".compare(",", ",") "," 0"])),_,r,n,lw[i].fail)}o(b,"compareCode")},dependencies:["format"]};var V0e=o(e=>(e.addKeyword(n1.formatLimitDefinition),e),"formatLimitPlugin");n1.default=V0e});var AY=fe((Zx,LY)=>{"use strict";g();Object.defineProperty(Zx,"__esModule",{value:!0});var i1=vY(),z0e=TY(),c6=Wt(),EY=new c6.Name("fullFormats"),q0e=new c6.Name("fastFormats"),p6=o((e,t={keywords:!0})=>{if(Array.isArray(t))return MY(e,t,i1.fullFormats,EY),e;let[r,n]=t.mode==="fast"?[i1.fastFormats,q0e]:[i1.fullFormats,EY],i=t.formats||i1.formatNames;return MY(e,i,r,n),t.keywords&&z0e.default(e),e},"formatsPlugin");p6.get=(e,t="full")=>{let n=(t==="fast"?i1.fastFormats:i1.fullFormats)[e];if(!n)throw new Error('Unknown format "'.concat(e,'"'));return n};var OY;function MY(e,t,r,n){var i,s;(i=(s=e.opts.code).formats)!==null&&i!==void 0||(s.formats=c6._(OY||(OY=V(['require("ajv-formats/dist/formats").',""])),n));for(let l of t)e.addFormat(l,r[l])}o(MY,"addFormats");LY.exports=Zx=p6;Object.defineProperty(Zx,"__esModule",{value:!0});Zx.default=p6});var yte=fe((LRt,u9)=>{"use strict";g();var qP=qN();qP.default&&(qP=qP.default);u9.exports=gte;u9.exports.default=gte;function gte(e,t,r){t=t||1;for(var n,i,s,l,c=0;c<e[0].length;c++){var p=e[0][c];(!c||p[0]<n)&&(n=p[0]),(!c||p[1]<i)&&(i=p[1]),(!c||p[0]>s)&&(s=p[0]),(!c||p[1]>l)&&(l=p[1])}var h=s-n,y=l-i,b=Math.min(h,y),_=b/2;if(b===0){var C=[n,i];return C.distance=0,C}for(var P=new qP(void 0,GPe),E=n;E<s;E+=b)for(var T=i;T<l;T+=b)P.push(new ph(E+_,T+_,_,e));var O=VPe(e),D=new ph(n+h/2,i+y/2,0,e);D.d>O.d&&(O=D);for(var A=P.length;P.length;){var R=P.pop();R.d>O.d&&(O=R,r&&console.log("found best %d after %d probes",Math.round(1e4*R.d)/1e4,A)),!(R.max-O.d<=t)&&(_=R.h/2,P.push(new ph(R.x-_,R.y-_,_,e)),P.push(new ph(R.x+_,R.y-_,_,e)),P.push(new ph(R.x-_,R.y+_,_,e)),P.push(new ph(R.x+_,R.y+_,_,e)),A+=4)}r&&(console.log("num probes: "+A),console.log("best distance: "+O.d));var j=[O.x,O.y];return j.distance=O.d,j}o(gte,"polylabel");function GPe(e,t){return t.max-e.max}o(GPe,"compareMax");function ph(e,t,r,n){this.x=e,this.y=t,this.h=r,this.d=UPe(e,t,n),this.max=this.d+this.h*Math.SQRT2}o(ph,"Cell");function UPe(e,t,r){for(var n=!1,i=1/0,s=0;s<r.length;s++)for(var l=r[s],c=0,p=l.length,h=p-1;c<p;h=c++){var y=l[c],b=l[h];y[1]>t!=b[1]>t&&e<(b[0]-y[0])*(t-y[1])/(b[1]-y[1])+y[0]&&(n=!n),i=Math.min(i,zPe(e,t,y,b))}return i===0?0:(n?1:-1)*Math.sqrt(i)}o(UPe,"pointToPolygonDist");function VPe(e){for(var t=0,r=0,n=0,i=e[0],s=0,l=i.length,c=l-1;s<l;c=s++){var p=i[s],h=i[c],y=p[0]*h[1]-h[0]*p[1];r+=(p[0]+h[0])*y,n+=(p[1]+h[1])*y,t+=y*3}return t===0?new ph(i[0][0],i[0][1],0,e):new ph(r/t,n/t,0,e)}o(VPe,"getCentroidCell");function zPe(e,t,r,n){var i=r[0],s=r[1],l=n[0]-i,c=n[1]-s;if(l!==0||c!==0){var p=((e-i)*l+(t-s)*c)/(l*l+c*c);p>1?(i=n[0],s=n[1]):p>0&&(i+=l*p,s+=c*p)}return l=e-i,c=t-s,l*l+c*c}o(zPe,"getSegDistSq")});var S7=fe((XI,av)=>{g();var VTe=200,Ore="__lodash_hash_undefined__",zTe=800,qTe=16,Lre=9007199254740991,Are="[object Arguments]",HTe="[object Array]",WTe="[object AsyncFunction]",XTe="[object Boolean]",YTe="[object Date]",ZTe="[object Error]",Dre="[object Function]",KTe="[object GeneratorFunction]",JTe="[object Map]",QTe="[object Number]",eEe="[object Null]",Fre="[object Object]",tEe="[object Proxy]",rEe="[object RegExp]",nEe="[object Set]",iEe="[object String]",oEe="[object Undefined]",sEe="[object WeakMap]",aEe="[object ArrayBuffer]",lEe="[object DataView]",uEe="[object Float32Array]",cEe="[object Float64Array]",pEe="[object Int8Array]",fEe="[object Int16Array]",dEe="[object Int32Array]",hEe="[object Uint8Array]",mEe="[object Uint8ClampedArray]",gEe="[object Uint16Array]",yEe="[object Uint32Array]",vEe=/[\\^$.*+?()[\]{}|]/g,bEe=/^\[object .+?Constructor\]$/,xEe=/^(?:0|[1-9]\d*)$/,gi={};gi[uEe]=gi[cEe]=gi[pEe]=gi[fEe]=gi[dEe]=gi[hEe]=gi[mEe]=gi[gEe]=gi[yEe]=!0;gi[Are]=gi[HTe]=gi[aEe]=gi[XTe]=gi[lEe]=gi[YTe]=gi[ZTe]=gi[Dre]=gi[JTe]=gi[QTe]=gi[Fre]=gi[rEe]=gi[nEe]=gi[iEe]=gi[sEe]=!1;var Nre=typeof global=="object"&&global&&global.Object===Object&&global,IEe=typeof self=="object"&&self&&self.Object===Object&&self,KI=Nre||IEe||Function("return this")(),kre=typeof XI=="object"&&XI&&!XI.nodeType&&XI,YI=kre&&typeof av=="object"&&av&&!av.nodeType&&av,Rre=YI&&YI.exports===kre,d7=Rre&&Nre.process,Ire=function(){try{var e=YI&&YI.require&&YI.require("util").types;return e||d7&&d7.binding&&d7.binding("util")}catch(t){}}(),_re=Ire&&Ire.isTypedArray;function _Ee(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}o(_Ee,"apply");function SEe(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}o(SEe,"baseTimes");function CEe(e){return function(t){return e(t)}}o(CEe,"baseUnary");function wEe(e,t){return e==null?void 0:e[t]}o(wEe,"getValue");function PEe(e,t){return function(r){return e(t(r))}}o(PEe,"overArg");var TEe=Array.prototype,EEe=Function.prototype,v3=Object.prototype,h7=KI["__core-js_shared__"],b3=EEe.toString,qf=v3.hasOwnProperty,Sre=function(){var e=/[^.]+$/.exec(h7&&h7.keys&&h7.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Bre=v3.toString,MEe=b3.call(Object),OEe=RegExp("^"+b3.call(qf).replace(vEe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),g3=Rre?KI.Buffer:void 0,Cre=KI.Symbol,wre=KI.Uint8Array,Pre=g3?g3.allocUnsafe:void 0,$re=PEe(Object.getPrototypeOf,Object),Tre=Object.create,LEe=v3.propertyIsEnumerable,AEe=TEe.splice,Kg=Cre?Cre.toStringTag:void 0,y3=function(){try{var e=x7(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),DEe=g3?g3.isBuffer:void 0,Ere=Math.max,FEe=Date.now,jre=x7(KI,"Map"),ZI=x7(Object,"create"),NEe=function(){function e(){}return o(e,"object"),function(t){if(!Qg(t))return{};if(Tre)return Tre(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function Jg(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}o(Jg,"Hash");function kEe(){this.__data__=ZI?ZI(null):{},this.size=0}o(kEe,"hashClear");function REe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}o(REe,"hashDelete");function BEe(e){var t=this.__data__;if(ZI){var r=t[e];return r===Ore?void 0:r}return qf.call(t,e)?t[e]:void 0}o(BEe,"hashGet");function $Ee(e){var t=this.__data__;return ZI?t[e]!==void 0:qf.call(t,e)}o($Ee,"hashHas");function jEe(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=ZI&&t===void 0?Ore:t,this}o(jEe,"hashSet");Jg.prototype.clear=kEe;Jg.prototype.delete=REe;Jg.prototype.get=BEe;Jg.prototype.has=$Ee;Jg.prototype.set=jEe;function Hf(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}o(Hf,"ListCache");function GEe(){this.__data__=[],this.size=0}o(GEe,"listCacheClear");function UEe(e){var t=this.__data__,r=x3(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():AEe.call(t,r,1),--this.size,!0}o(UEe,"listCacheDelete");function VEe(e){var t=this.__data__,r=x3(t,e);return r<0?void 0:t[r][1]}o(VEe,"listCacheGet");function zEe(e){return x3(this.__data__,e)>-1}o(zEe,"listCacheHas");function qEe(e,t){var r=this.__data__,n=x3(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}o(qEe,"listCacheSet");Hf.prototype.clear=GEe;Hf.prototype.delete=UEe;Hf.prototype.get=VEe;Hf.prototype.has=zEe;Hf.prototype.set=qEe;function lv(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}o(lv,"MapCache");function HEe(){this.size=0,this.__data__={hash:new Jg,map:new(jre||Hf),string:new Jg}}o(HEe,"mapCacheClear");function WEe(e){var t=_3(this,e).delete(e);return this.size-=t?1:0,t}o(WEe,"mapCacheDelete");function XEe(e){return _3(this,e).get(e)}o(XEe,"mapCacheGet");function YEe(e){return _3(this,e).has(e)}o(YEe,"mapCacheHas");function ZEe(e,t){var r=_3(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}o(ZEe,"mapCacheSet");lv.prototype.clear=HEe;lv.prototype.delete=WEe;lv.prototype.get=XEe;lv.prototype.has=YEe;lv.prototype.set=ZEe;function uv(e){var t=this.__data__=new Hf(e);this.size=t.size}o(uv,"Stack");function KEe(){this.__data__=new Hf,this.size=0}o(KEe,"stackClear");function JEe(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}o(JEe,"stackDelete");function QEe(e){return this.__data__.get(e)}o(QEe,"stackGet");function eMe(e){return this.__data__.has(e)}o(eMe,"stackHas");function tMe(e,t){var r=this.__data__;if(r instanceof Hf){var n=r.__data__;if(!jre||n.length<VTe-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new lv(n)}return r.set(e,t),this.size=r.size,this}o(tMe,"stackSet");uv.prototype.clear=KEe;uv.prototype.delete=JEe;uv.prototype.get=QEe;uv.prototype.has=eMe;uv.prototype.set=tMe;function rMe(e,t){var r=v7(e),n=!r&&y7(e),i=!r&&!n&&zre(e),s=!r&&!n&&!i&&Hre(e),l=r||n||i||s,c=l?SEe(e.length,String):[],p=c.length;for(var h in e)(t||qf.call(e,h))&&!(l&&(h=="length"||i&&(h=="offset"||h=="parent")||s&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||Ure(h,p)))&&c.push(h);return c}o(rMe,"arrayLikeKeys");function m7(e,t,r){(r!==void 0&&!S3(e[t],r)||r===void 0&&!(t in e))&&b7(e,t,r)}o(m7,"assignMergeValue");function nMe(e,t,r){var n=e[t];(!(qf.call(e,t)&&S3(n,r))||r===void 0&&!(t in e))&&b7(e,t,r)}o(nMe,"assignValue");function x3(e,t){for(var r=e.length;r--;)if(S3(e[r][0],t))return r;return-1}o(x3,"assocIndexOf");function b7(e,t,r){t=="__proto__"&&y3?y3(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}o(b7,"baseAssignValue");var iMe=yMe();function I3(e){return e==null?e===void 0?oEe:eEe:Kg&&Kg in Object(e)?vMe(e):CMe(e)}o(I3,"baseGetTag");function Mre(e){return JI(e)&&I3(e)==Are}o(Mre,"baseIsArguments");function oMe(e){if(!Qg(e)||_Me(e))return!1;var t=_7(e)?OEe:bEe;return t.test(EMe(e))}o(oMe,"baseIsNative");function sMe(e){return JI(e)&&qre(e.length)&&!!gi[I3(e)]}o(sMe,"baseIsTypedArray");function aMe(e){if(!Qg(e))return SMe(e);var t=Vre(e),r=[];for(var n in e)n=="constructor"&&(t||!qf.call(e,n))||r.push(n);return r}o(aMe,"baseKeysIn");function Gre(e,t,r,n,i){e!==t&&iMe(t,function(s,l){if(i||(i=new uv),Qg(s))lMe(e,t,l,r,Gre,n,i);else{var c=n?n(g7(e,l),s,l+"",e,t,i):void 0;c===void 0&&(c=s),m7(e,l,c)}},Wre)}o(Gre,"baseMerge");function lMe(e,t,r,n,i,s,l){var c=g7(e,r),p=g7(t,r),h=l.get(p);if(h){m7(e,r,h);return}var y=s?s(c,p,r+"",e,t,l):void 0,b=y===void 0;if(b){var _=v7(p),C=!_&&zre(p),P=!_&&!C&&Hre(p);y=p,_||C||P?v7(c)?y=c:MMe(c)?y=hMe(c):C?(b=!1,y=pMe(p,!0)):P?(b=!1,y=dMe(p,!0)):y=[]:OMe(p)||y7(p)?(y=c,y7(c)?y=LMe(c):(!Qg(c)||_7(c))&&(y=bMe(p))):b=!1}b&&(l.set(p,y),i(y,p,n,s,l),l.delete(p)),m7(e,r,y)}o(lMe,"baseMergeDeep");function uMe(e,t){return PMe(wMe(e,t,Xre),e+"")}o(uMe,"baseRest");var cMe=y3?function(e,t){return y3(e,"toString",{configurable:!0,enumerable:!1,value:DMe(t),writable:!0})}:Xre;function pMe(e,t){if(t)return e.slice();var r=e.length,n=Pre?Pre(r):new e.constructor(r);return e.copy(n),n}o(pMe,"cloneBuffer");function fMe(e){var t=new e.constructor(e.byteLength);return new wre(t).set(new wre(e)),t}o(fMe,"cloneArrayBuffer");function dMe(e,t){var r=t?fMe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}o(dMe,"cloneTypedArray");function hMe(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}o(hMe,"copyArray");function mMe(e,t,r,n){var i=!r;r||(r={});for(var s=-1,l=t.length;++s<l;){var c=t[s],p=n?n(r[c],e[c],c,r,e):void 0;p===void 0&&(p=e[c]),i?b7(r,c,p):nMe(r,c,p)}return r}o(mMe,"copyObject");function gMe(e){return uMe(function(t,r){var n=-1,i=r.length,s=i>1?r[i-1]:void 0,l=i>2?r[2]:void 0;for(s=e.length>3&&typeof s=="function"?(i--,s):void 0,l&&xMe(r[0],r[1],l)&&(s=i<3?void 0:s,i=1),t=Object(t);++n<i;){var c=r[n];c&&e(t,c,n,s)}return t})}o(gMe,"createAssigner");function yMe(e){return function(t,r,n){for(var i=-1,s=Object(t),l=n(t),c=l.length;c--;){var p=l[e?c:++i];if(r(s[p],p,s)===!1)break}return t}}o(yMe,"createBaseFor");function _3(e,t){var r=e.__data__;return IMe(t)?r[typeof t=="string"?"string":"hash"]:r.map}o(_3,"getMapData");function x7(e,t){var r=wEe(e,t);return oMe(r)?r:void 0}o(x7,"getNative");function vMe(e){var t=qf.call(e,Kg),r=e[Kg];try{e[Kg]=void 0;var n=!0}catch(s){}var i=Bre.call(e);return n&&(t?e[Kg]=r:delete e[Kg]),i}o(vMe,"getRawTag");function bMe(e){return typeof e.constructor=="function"&&!Vre(e)?NEe($re(e)):{}}o(bMe,"initCloneObject");function Ure(e,t){var r=typeof e;return t=t==null?Lre:t,!!t&&(r=="number"||r!="symbol"&&xEe.test(e))&&e>-1&&e%1==0&&e<t}o(Ure,"isIndex");function xMe(e,t,r){if(!Qg(r))return!1;var n=typeof t;return(n=="number"?I7(r)&&Ure(t,r.length):n=="string"&&t in r)?S3(r[t],e):!1}o(xMe,"isIterateeCall");function IMe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}o(IMe,"isKeyable");function _Me(e){return!!Sre&&Sre in e}o(_Me,"isMasked");function Vre(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||v3;return e===r}o(Vre,"isPrototype");function SMe(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}o(SMe,"nativeKeysIn");function CMe(e){return Bre.call(e)}o(CMe,"objectToString");function wMe(e,t,r){return t=Ere(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,s=Ere(n.length-t,0),l=Array(s);++i<s;)l[i]=n[t+i];i=-1;for(var c=Array(t+1);++i<t;)c[i]=n[i];return c[t]=r(l),_Ee(e,this,c)}}o(wMe,"overRest");function g7(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}o(g7,"safeGet");var PMe=TMe(cMe);function TMe(e){var t=0,r=0;return function(){var n=FEe(),i=qTe-(n-r);if(r=n,i>0){if(++t>=zTe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}o(TMe,"shortOut");function EMe(e){if(e!=null){try{return b3.call(e)}catch(t){}try{return e+""}catch(t){}}return""}o(EMe,"toSource");function S3(e,t){return e===t||e!==e&&t!==t}o(S3,"eq");var y7=Mre(function(){return arguments}())?Mre:function(e){return JI(e)&&qf.call(e,"callee")&&!LEe.call(e,"callee")},v7=Array.isArray;function I7(e){return e!=null&&qre(e.length)&&!_7(e)}o(I7,"isArrayLike");function MMe(e){return JI(e)&&I7(e)}o(MMe,"isArrayLikeObject");var zre=DEe||FMe;function _7(e){if(!Qg(e))return!1;var t=I3(e);return t==Dre||t==KTe||t==WTe||t==tEe}o(_7,"isFunction");function qre(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Lre}o(qre,"isLength");function Qg(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}o(Qg,"isObject");function JI(e){return e!=null&&typeof e=="object"}o(JI,"isObjectLike");function OMe(e){if(!JI(e)||I3(e)!=Fre)return!1;var t=$re(e);if(t===null)return!0;var r=qf.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&b3.call(r)==MEe}o(OMe,"isPlainObject");var Hre=_re?CEe(_re):sMe;function LMe(e){return mMe(e,Wre(e))}o(LMe,"toPlainObject");function Wre(e){return I7(e)?rMe(e,!0):aMe(e)}o(Wre,"keysIn");var AMe=gMe(function(e,t,r){Gre(e,t,r)});function DMe(e){return function(){return e}}o(DMe,"constant");function Xre(e){return e}o(Xre,"identity");function FMe(){return!1}o(FMe,"stubFalse");av.exports=AMe});var B7=fe((t2,pv)=>{g();var lOe=200,mne="__lodash_hash_undefined__",uOe=800,cOe=16,gne=9007199254740991,yne="[object Arguments]",pOe="[object Array]",fOe="[object AsyncFunction]",dOe="[object Boolean]",hOe="[object Date]",mOe="[object Error]",vne="[object Function]",gOe="[object GeneratorFunction]",yOe="[object Map]",vOe="[object Number]",bOe="[object Null]",bne="[object Object]",xOe="[object Proxy]",IOe="[object RegExp]",_Oe="[object Set]",SOe="[object String]",COe="[object Undefined]",wOe="[object WeakMap]",POe="[object ArrayBuffer]",TOe="[object DataView]",EOe="[object Float32Array]",MOe="[object Float64Array]",OOe="[object Int8Array]",LOe="[object Int16Array]",AOe="[object Int32Array]",DOe="[object Uint8Array]",FOe="[object Uint8ClampedArray]",NOe="[object Uint16Array]",kOe="[object Uint32Array]",ROe=/[\\^$.*+?()[\]{}|]/g,BOe=/^\[object .+?Constructor\]$/,$Oe=/^(?:0|[1-9]\d*)$/,yi={};yi[EOe]=yi[MOe]=yi[OOe]=yi[LOe]=yi[AOe]=yi[DOe]=yi[FOe]=yi[NOe]=yi[kOe]=!0;yi[yne]=yi[pOe]=yi[POe]=yi[dOe]=yi[TOe]=yi[hOe]=yi[mOe]=yi[vne]=yi[yOe]=yi[vOe]=yi[bne]=yi[IOe]=yi[_Oe]=yi[SOe]=yi[wOe]=!1;var xne=typeof global=="object"&&global&&global.Object===Object&&global,jOe=typeof self=="object"&&self&&self.Object===Object&&self,i2=xne||jOe||Function("return this")(),Ine=typeof t2=="object"&&t2&&!t2.nodeType&&t2,r2=Ine&&typeof pv=="object"&&pv&&!pv.nodeType&&pv,_ne=r2&&r2.exports===Ine,T7=_ne&&xne.process,sne=function(){try{var e=r2&&r2.require&&r2.require("util").types;return e||T7&&T7.binding&&T7.binding("util")}catch(t){}}(),ane=sne&&sne.isTypedArray;function Sne(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}o(Sne,"apply");function GOe(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}o(GOe,"baseTimes");function UOe(e){return function(t){return e(t)}}o(UOe,"baseUnary");function VOe(e,t){return e==null?void 0:e[t]}o(VOe,"getValue");function zOe(e,t){return function(r){return e(t(r))}}o(zOe,"overArg");var qOe=Array.prototype,HOe=Function.prototype,E3=Object.prototype,E7=i2["__core-js_shared__"],M3=HOe.toString,Yf=E3.hasOwnProperty,lne=function(){var e=/[^.]+$/.exec(E7&&E7.keys&&E7.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Cne=E3.toString,WOe=M3.call(Object),XOe=RegExp("^"+M3.call(Yf).replace(ROe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P3=_ne?i2.Buffer:void 0,une=i2.Symbol,cne=i2.Uint8Array,pne=P3?P3.allocUnsafe:void 0,wne=zOe(Object.getPrototypeOf,Object),fne=Object.create,YOe=E3.propertyIsEnumerable,ZOe=qOe.splice,ty=une?une.toStringTag:void 0,T3=function(){try{var e=N7(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),KOe=P3?P3.isBuffer:void 0,dne=Math.max,JOe=Date.now,Pne=N7(i2,"Map"),n2=N7(Object,"create"),QOe=function(){function e(){}return o(e,"object"),function(t){if(!Xf(t))return{};if(fne)return fne(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function ry(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}o(ry,"Hash");function e4e(){this.__data__=n2?n2(null):{},this.size=0}o(e4e,"hashClear");function t4e(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}o(t4e,"hashDelete");function r4e(e){var t=this.__data__;if(n2){var r=t[e];return r===mne?void 0:r}return Yf.call(t,e)?t[e]:void 0}o(r4e,"hashGet");function n4e(e){var t=this.__data__;return n2?t[e]!==void 0:Yf.call(t,e)}o(n4e,"hashHas");function i4e(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n2&&t===void 0?mne:t,this}o(i4e,"hashSet");ry.prototype.clear=e4e;ry.prototype.delete=t4e;ry.prototype.get=r4e;ry.prototype.has=n4e;ry.prototype.set=i4e;function Zf(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}o(Zf,"ListCache");function o4e(){this.__data__=[],this.size=0}o(o4e,"listCacheClear");function s4e(e){var t=this.__data__,r=O3(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():ZOe.call(t,r,1),--this.size,!0}o(s4e,"listCacheDelete");function a4e(e){var t=this.__data__,r=O3(t,e);return r<0?void 0:t[r][1]}o(a4e,"listCacheGet");function l4e(e){return O3(this.__data__,e)>-1}o(l4e,"listCacheHas");function u4e(e,t){var r=this.__data__,n=O3(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}o(u4e,"listCacheSet");Zf.prototype.clear=o4e;Zf.prototype.delete=s4e;Zf.prototype.get=a4e;Zf.prototype.has=l4e;Zf.prototype.set=u4e;function fv(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}o(fv,"MapCache");function c4e(){this.size=0,this.__data__={hash:new ry,map:new(Pne||Zf),string:new ry}}o(c4e,"mapCacheClear");function p4e(e){var t=A3(this,e).delete(e);return this.size-=t?1:0,t}o(p4e,"mapCacheDelete");function f4e(e){return A3(this,e).get(e)}o(f4e,"mapCacheGet");function d4e(e){return A3(this,e).has(e)}o(d4e,"mapCacheHas");function h4e(e,t){var r=A3(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}o(h4e,"mapCacheSet");fv.prototype.clear=c4e;fv.prototype.delete=p4e;fv.prototype.get=f4e;fv.prototype.has=d4e;fv.prototype.set=h4e;function dv(e){var t=this.__data__=new Zf(e);this.size=t.size}o(dv,"Stack");function m4e(){this.__data__=new Zf,this.size=0}o(m4e,"stackClear");function g4e(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}o(g4e,"stackDelete");function y4e(e){return this.__data__.get(e)}o(y4e,"stackGet");function v4e(e){return this.__data__.has(e)}o(v4e,"stackHas");function b4e(e,t){var r=this.__data__;if(r instanceof Zf){var n=r.__data__;if(!Pne||n.length<lOe-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new fv(n)}return r.set(e,t),this.size=r.size,this}o(b4e,"stackSet");dv.prototype.clear=m4e;dv.prototype.delete=g4e;dv.prototype.get=y4e;dv.prototype.has=v4e;dv.prototype.set=b4e;function x4e(e,t){var r=A7(e),n=!r&&L7(e),i=!r&&!n&&Lne(e),s=!r&&!n&&!i&&Dne(e),l=r||n||i||s,c=l?GOe(e.length,String):[],p=c.length;for(var h in e)(t||Yf.call(e,h))&&!(l&&(h=="length"||i&&(h=="offset"||h=="parent")||s&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||Mne(h,p)))&&c.push(h);return c}o(x4e,"arrayLikeKeys");function M7(e,t,r){(r!==void 0&&!D3(e[t],r)||r===void 0&&!(t in e))&&D7(e,t,r)}o(M7,"assignMergeValue");function I4e(e,t,r){var n=e[t];(!(Yf.call(e,t)&&D3(n,r))||r===void 0&&!(t in e))&&D7(e,t,r)}o(I4e,"assignValue");function O3(e,t){for(var r=e.length;r--;)if(D3(e[r][0],t))return r;return-1}o(O3,"assocIndexOf");function D7(e,t,r){t=="__proto__"&&T3?T3(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}o(D7,"baseAssignValue");var _4e=F4e();function L3(e){return e==null?e===void 0?COe:bOe:ty&&ty in Object(e)?N4e(e):G4e(e)}o(L3,"baseGetTag");function hne(e){return o2(e)&&L3(e)==yne}o(hne,"baseIsArguments");function S4e(e){if(!Xf(e)||$4e(e))return!1;var t=R7(e)?XOe:BOe;return t.test(q4e(e))}o(S4e,"baseIsNative");function C4e(e){return o2(e)&&Ane(e.length)&&!!yi[L3(e)]}o(C4e,"baseIsTypedArray");function w4e(e){if(!Xf(e))return j4e(e);var t=One(e),r=[];for(var n in e)n=="constructor"&&(t||!Yf.call(e,n))||r.push(n);return r}o(w4e,"baseKeysIn");function F7(e,t,r,n,i){e!==t&&_4e(t,function(s,l){if(i||(i=new dv),Xf(s))P4e(e,t,l,r,F7,n,i);else{var c=n?n(O7(e,l),s,l+"",e,t,i):void 0;c===void 0&&(c=s),M7(e,l,c)}},Fne)}o(F7,"baseMerge");function P4e(e,t,r,n,i,s,l){var c=O7(e,r),p=O7(t,r),h=l.get(p);if(h){M7(e,r,h);return}var y=s?s(c,p,r+"",e,t,l):void 0,b=y===void 0;if(b){var _=A7(p),C=!_&&Lne(p),P=!_&&!C&&Dne(p);y=p,_||C||P?A7(c)?y=c:H4e(c)?y=L4e(c):C?(b=!1,y=E4e(p,!0)):P?(b=!1,y=O4e(p,!0)):y=[]:W4e(p)||L7(p)?(y=c,L7(c)?y=X4e(c):(!Xf(c)||R7(c))&&(y=k4e(p))):b=!1}b&&(l.set(p,y),i(y,p,n,s,l),l.delete(p)),M7(e,r,y)}o(P4e,"baseMergeDeep");function Tne(e,t){return V4e(U4e(e,t,Nne),e+"")}o(Tne,"baseRest");var T4e=T3?function(e,t){return T3(e,"toString",{configurable:!0,enumerable:!1,value:K4e(t),writable:!0})}:Nne;function E4e(e,t){if(t)return e.slice();var r=e.length,n=pne?pne(r):new e.constructor(r);return e.copy(n),n}o(E4e,"cloneBuffer");function M4e(e){var t=new e.constructor(e.byteLength);return new cne(t).set(new cne(e)),t}o(M4e,"cloneArrayBuffer");function O4e(e,t){var r=t?M4e(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}o(O4e,"cloneTypedArray");function L4e(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}o(L4e,"copyArray");function A4e(e,t,r,n){var i=!r;r||(r={});for(var s=-1,l=t.length;++s<l;){var c=t[s],p=n?n(r[c],e[c],c,r,e):void 0;p===void 0&&(p=e[c]),i?D7(r,c,p):I4e(r,c,p)}return r}o(A4e,"copyObject");function D4e(e){return Tne(function(t,r){var n=-1,i=r.length,s=i>1?r[i-1]:void 0,l=i>2?r[2]:void 0;for(s=e.length>3&&typeof s=="function"?(i--,s):void 0,l&&R4e(r[0],r[1],l)&&(s=i<3?void 0:s,i=1),t=Object(t);++n<i;){var c=r[n];c&&e(t,c,n,s)}return t})}o(D4e,"createAssigner");function F4e(e){return function(t,r,n){for(var i=-1,s=Object(t),l=n(t),c=l.length;c--;){var p=l[e?c:++i];if(r(s[p],p,s)===!1)break}return t}}o(F4e,"createBaseFor");function Ene(e,t,r,n,i,s){return Xf(e)&&Xf(t)&&(s.set(t,e),F7(e,t,void 0,Ene,s),s.delete(t)),e}o(Ene,"customDefaultsMerge");function A3(e,t){var r=e.__data__;return B4e(t)?r[typeof t=="string"?"string":"hash"]:r.map}o(A3,"getMapData");function N7(e,t){var r=VOe(e,t);return S4e(r)?r:void 0}o(N7,"getNative");function N4e(e){var t=Yf.call(e,ty),r=e[ty];try{e[ty]=void 0;var n=!0}catch(s){}var i=Cne.call(e);return n&&(t?e[ty]=r:delete e[ty]),i}o(N4e,"getRawTag");function k4e(e){return typeof e.constructor=="function"&&!One(e)?QOe(wne(e)):{}}o(k4e,"initCloneObject");function Mne(e,t){var r=typeof e;return t=t==null?gne:t,!!t&&(r=="number"||r!="symbol"&&$Oe.test(e))&&e>-1&&e%1==0&&e<t}o(Mne,"isIndex");function R4e(e,t,r){if(!Xf(r))return!1;var n=typeof t;return(n=="number"?k7(r)&&Mne(t,r.length):n=="string"&&t in r)?D3(r[t],e):!1}o(R4e,"isIterateeCall");function B4e(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}o(B4e,"isKeyable");function $4e(e){return!!lne&&lne in e}o($4e,"isMasked");function One(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||E3;return e===r}o(One,"isPrototype");function j4e(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}o(j4e,"nativeKeysIn");function G4e(e){return Cne.call(e)}o(G4e,"objectToString");function U4e(e,t,r){return t=dne(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,s=dne(n.length-t,0),l=Array(s);++i<s;)l[i]=n[t+i];i=-1;for(var c=Array(t+1);++i<t;)c[i]=n[i];return c[t]=r(l),Sne(e,this,c)}}o(U4e,"overRest");function O7(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}o(O7,"safeGet");var V4e=z4e(T4e);function z4e(e){var t=0,r=0;return function(){var n=JOe(),i=cOe-(n-r);if(r=n,i>0){if(++t>=uOe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}o(z4e,"shortOut");function q4e(e){if(e!=null){try{return M3.call(e)}catch(t){}try{return e+""}catch(t){}}return""}o(q4e,"toSource");function D3(e,t){return e===t||e!==e&&t!==t}o(D3,"eq");var L7=hne(function(){return arguments}())?hne:function(e){return o2(e)&&Yf.call(e,"callee")&&!YOe.call(e,"callee")},A7=Array.isArray;function k7(e){return e!=null&&Ane(e.length)&&!R7(e)}o(k7,"isArrayLike");function H4e(e){return o2(e)&&k7(e)}o(H4e,"isArrayLikeObject");var Lne=KOe||J4e;function R7(e){if(!Xf(e))return!1;var t=L3(e);return t==vne||t==gOe||t==fOe||t==xOe}o(R7,"isFunction");function Ane(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=gne}o(Ane,"isLength");function Xf(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}o(Xf,"isObject");function o2(e){return e!=null&&typeof e=="object"}o(o2,"isObjectLike");function W4e(e){if(!o2(e)||L3(e)!=bne)return!1;var t=wne(e);if(t===null)return!0;var r=Yf.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&M3.call(r)==WOe}o(W4e,"isPlainObject");var Dne=ane?UOe(ane):C4e;function X4e(e){return A4e(e,Fne(e))}o(X4e,"toPlainObject");var Y4e=Tne(function(e){return e.push(void 0,Ene),Sne(Z4e,void 0,e)});function Fne(e){return k7(e)?x4e(e,!0):w4e(e)}o(Fne,"keysIn");var Z4e=D4e(function(e,t,r,n){F7(e,t,r,n)});function K4e(e){return function(){return e}}o(K4e,"constant");function Nne(e){return e}o(Nne,"identity");function J4e(){return!1}o(J4e,"stubFalse");pv.exports=Y4e});var Pie=fe((Qqt,h2)=>{"use strict";g();var h5e=!1,sy=!1,bie=!0,xie=!1,w={},Iie=!1;typeof h2<"u"&&h2.exports?(h2.exports=w,Iie=!0):typeof document<"u"?window.ClipperLib=w:self.ClipperLib=w;var q3;Iie?(Ao="chrome",q3="Netscape"):(Ao=navigator.userAgent.toString().toLowerCase(),q3=navigator.appName);var Ao,qr={};Ao.indexOf("chrome")!=-1&&Ao.indexOf("chromium")==-1?qr.chrome=1:qr.chrome=0;Ao.indexOf("chromium")!=-1?qr.chromium=1:qr.chromium=0;Ao.indexOf("safari")!=-1&&Ao.indexOf("chrome")==-1&&Ao.indexOf("chromium")==-1?qr.safari=1:qr.safari=0;Ao.indexOf("firefox")!=-1?qr.firefox=1:qr.firefox=0;Ao.indexOf("firefox/17")!=-1?qr.firefox17=1:qr.firefox17=0;Ao.indexOf("firefox/15")!=-1?qr.firefox15=1:qr.firefox15=0;Ao.indexOf("firefox/3")!=-1?qr.firefox3=1:qr.firefox3=0;Ao.indexOf("opera")!=-1?qr.opera=1:qr.opera=0;Ao.indexOf("msie 10")!=-1?qr.msie10=1:qr.msie10=0;Ao.indexOf("msie 9")!=-1?qr.msie9=1:qr.msie9=0;Ao.indexOf("msie 8")!=-1?qr.msie8=1:qr.msie8=0;Ao.indexOf("msie 7")!=-1?qr.msie7=1:qr.msie7=0;Ao.indexOf("msie ")!=-1?qr.msie=1:qr.msie=0;w.biginteger_used=null;var xh,m5e=0xdeadbeefcafe,yie=(m5e&16777215)==15715070;function $e(e,t,r){w.biginteger_used=1,e!=null&&(typeof e=="number"&&typeof t>"u"?this.fromInt(e):typeof e=="number"?this.fromNumber(e,t,r):t==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,t))}o($e,"BigInteger");function nn(){return new $e(null)}o(nn,"nbi");function g5e(e,t,r,n,i,s){for(;--s>=0;){var l=t*this[e++]+r[n]+i;i=Math.floor(l/67108864),r[n++]=l&67108863}return i}o(g5e,"am1");function y5e(e,t,r,n,i,s){for(var l=t&32767,c=t>>15;--s>=0;){var p=this[e]&32767,h=this[e++]>>15,y=c*p+h*l;p=l*p+((y&32767)<<15)+r[n]+(i&1073741823),i=(p>>>30)+(y>>>15)+c*h+(i>>>30),r[n++]=p&1073741823}return i}o(y5e,"am2");function v5e(e,t,r,n,i,s){for(var l=t&16383,c=t>>14;--s>=0;){var p=this[e]&16383,h=this[e++]>>14,y=c*p+h*l;p=l*p+((y&16383)<<14)+r[n]+i,i=(p>>28)+(y>>14)+c*h,r[n++]=p&268435455}return i}o(v5e,"am3");yie&&q3=="Microsoft Internet Explorer"?($e.prototype.am=y5e,xh=30):yie&&q3!="Netscape"?($e.prototype.am=g5e,xh=26):($e.prototype.am=v5e,xh=28);$e.prototype.DB=xh;$e.prototype.DM=(1<<xh)-1;$e.prototype.DV=1<<xh;var uD=52;$e.prototype.FV=Math.pow(2,uD);$e.prototype.F1=uD-xh;$e.prototype.F2=2*xh-uD;var b5e="0123456789abcdefghijklmnopqrstuvwxyz",W3=new Array,vv,su;vv=48;for(su=0;su<=9;++su)W3[vv++]=su;vv=97;for(su=10;su<36;++su)W3[vv++]=su;vv=65;for(su=10;su<36;++su)W3[vv++]=su;function vie(e){return b5e.charAt(e)}o(vie,"int2char");function _ie(e,t){var r=W3[e.charCodeAt(t)];return r==null?-1:r}o(_ie,"intAt");function x5e(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}o(x5e,"bnpCopyTo");function I5e(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0}o(I5e,"bnpFromInt");function bh(e){var t=nn();return t.fromInt(e),t}o(bh,"nbv");function _5e(e,t){var r;if(t==16)r=4;else if(t==8)r=3;else if(t==256)r=8;else if(t==2)r=1;else if(t==32)r=5;else if(t==4)r=2;else{this.fromRadix(e,t);return}this.t=0,this.s=0;for(var n=e.length,i=!1,s=0;--n>=0;){var l=r==8?e[n]&255:_ie(e,n);if(l<0){e.charAt(n)=="-"&&(i=!0);continue}i=!1,s==0?this[this.t++]=l:s+r>this.DB?(this[this.t-1]|=(l&(1<<this.DB-s)-1)<<s,this[this.t++]=l>>this.DB-s):this[this.t-1]|=l<<s,s+=r,s>=this.DB&&(s-=this.DB)}r==8&&(e[0]&128)!=0&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),i&&$e.ZERO.subTo(this,this)}o(_5e,"bnpFromString");function S5e(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t}o(S5e,"bnpClamp");function C5e(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var r=(1<<t)-1,n,i=!1,s="",l=this.t,c=this.DB-l*this.DB%t;if(l-- >0)for(c<this.DB&&(n=this[l]>>c)>0&&(i=!0,s=vie(n));l>=0;)c<t?(n=(this[l]&(1<<c)-1)<<t-c,n|=this[--l]>>(c+=this.DB-t)):(n=this[l]>>(c-=t)&r,c<=0&&(c+=this.DB,--l)),n>0&&(i=!0),i&&(s+=vie(n));return i?s:"0"}o(C5e,"bnToString");function w5e(){var e=nn();return $e.ZERO.subTo(this,e),e}o(w5e,"bnNegate");function P5e(){return this.s<0?this.negate():this}o(P5e,"bnAbs");function T5e(e){var t=this.s-e.s;if(t!=0)return t;var r=this.t;if(t=r-e.t,t!=0)return this.s<0?-t:t;for(;--r>=0;)if((t=this[r]-e[r])!=0)return t;return 0}o(T5e,"bnCompareTo");function X3(e){var t=1,r;return(r=e>>>16)!=0&&(e=r,t+=16),(r=e>>8)!=0&&(e=r,t+=8),(r=e>>4)!=0&&(e=r,t+=4),(r=e>>2)!=0&&(e=r,t+=2),(r=e>>1)!=0&&(e=r,t+=1),t}o(X3,"nbits");function E5e(){return this.t<=0?0:this.DB*(this.t-1)+X3(this[this.t-1]^this.s&this.DM)}o(E5e,"bnBitLength");function M5e(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s}o(M5e,"bnpDLShiftTo");function O5e(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s}o(O5e,"bnpDRShiftTo");function L5e(e,t){var r=e%this.DB,n=this.DB-r,i=(1<<n)-1,s=Math.floor(e/this.DB),l=this.s<<r&this.DM,c;for(c=this.t-1;c>=0;--c)t[c+s+1]=this[c]>>n|l,l=(this[c]&i)<<r;for(c=s-1;c>=0;--c)t[c]=0;t[s]=l,t.t=this.t+s+1,t.s=this.s,t.clamp()}o(L5e,"bnpLShiftTo");function A5e(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t){t.t=0;return}var n=e%this.DB,i=this.DB-n,s=(1<<n)-1;t[0]=this[r]>>n;for(var l=r+1;l<this.t;++l)t[l-r-1]|=(this[l]&s)<<i,t[l-r]=this[l]>>n;n>0&&(t[this.t-r-1]|=(this.s&s)<<i),t.t=this.t-r,t.clamp()}o(A5e,"bnpRShiftTo");function D5e(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()}o(D5e,"bnpSubTo");function F5e(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t[i]=0;for(i=0;i<n.t;++i)t[i+r.t]=r.am(0,n[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&$e.ZERO.subTo(t,t)}o(F5e,"bnpMultiplyTo");function N5e(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()}o(N5e,"bnpSquareTo");function k5e(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t){t!=null&&t.fromInt(0),r!=null&&this.copyTo(r);return}r==null&&(r=nn());var s=nn(),l=this.s,c=e.s,p=this.DB-X3(n[n.t-1]);p>0?(n.lShiftTo(p,s),i.lShiftTo(p,r)):(n.copyTo(s),i.copyTo(r));var h=s.t,y=s[h-1];if(y!=0){var b=y*(1<<this.F1)+(h>1?s[h-2]>>this.F2:0),_=this.FV/b,C=(1<<this.F1)/b,P=1<<this.F2,E=r.t,T=E-h,O=t==null?nn():t;for(s.dlShiftTo(T,O),r.compareTo(O)>=0&&(r[r.t++]=1,r.subTo(O,r)),$e.ONE.dlShiftTo(h,O),O.subTo(s,s);s.t<h;)s[s.t++]=0;for(;--T>=0;){var D=r[--E]==y?this.DM:Math.floor(r[E]*_+(r[E-1]+P)*C);if((r[E]+=s.am(0,D,r,T,0,h))<D)for(s.dlShiftTo(T,O),r.subTo(O,r);r[E]<--D;)r.subTo(O,r)}t!=null&&(r.drShiftTo(h,t),l!=c&&$e.ZERO.subTo(t,t)),r.t=h,r.clamp(),p>0&&r.rShiftTo(p,r),l<0&&$e.ZERO.subTo(r,r)}}}o(k5e,"bnpDivRemTo");function R5e(e){var t=nn();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo($e.ZERO)>0&&e.subTo(t,t),t}o(R5e,"bnMod");function ay(e){this.m=e}o(ay,"Classic");function B5e(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}o(B5e,"cConvert");function $5e(e){return e}o($5e,"cRevert");function j5e(e){e.divRemTo(this.m,null,e)}o(j5e,"cReduce");function G5e(e,t,r){e.multiplyTo(t,r),this.reduce(r)}o(G5e,"cMulTo");function U5e(e,t){e.squareTo(t),this.reduce(t)}o(U5e,"cSqrTo");ay.prototype.convert=B5e;ay.prototype.revert=$5e;ay.prototype.reduce=j5e;ay.prototype.mulTo=G5e;ay.prototype.sqrTo=U5e;function V5e(){if(this.t<1)return 0;var e=this[0];if((e&1)==0)return 0;var t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}o(V5e,"bnpInvDigit");function ly(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}o(ly,"Montgomery");function z5e(e){var t=nn();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo($e.ZERO)>0&&this.m.subTo(t,t),t}o(z5e,"montConvert");function q5e(e){var t=nn();return e.copyTo(t),this.reduce(t),t}o(q5e,"montRevert");function H5e(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=e[t]&32767,n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e[r]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}o(H5e,"montReduce");function W5e(e,t){e.squareTo(t),this.reduce(t)}o(W5e,"montSqrTo");function X5e(e,t,r){e.multiplyTo(t,r),this.reduce(r)}o(X5e,"montMulTo");ly.prototype.convert=z5e;ly.prototype.revert=q5e;ly.prototype.reduce=H5e;ly.prototype.mulTo=X5e;ly.prototype.sqrTo=W5e;function Y5e(){return(this.t>0?this[0]&1:this.s)==0}o(Y5e,"bnpIsEven");function Z5e(e,t){if(e>4294967295||e<1)return $e.ONE;var r=nn(),n=nn(),i=t.convert(this),s=X3(e)-1;for(i.copyTo(r);--s>=0;)if(t.sqrTo(r,n),(e&1<<s)>0)t.mulTo(n,i,r);else{var l=r;r=n,n=l}return t.revert(r)}o(Z5e,"bnpExp");function K5e(e,t){var r;return e<256||t.isEven()?r=new ay(t):r=new ly(t),this.exp(e,r)}o(K5e,"bnModPowInt");$e.prototype.copyTo=x5e;$e.prototype.fromInt=I5e;$e.prototype.fromString=_5e;$e.prototype.clamp=S5e;$e.prototype.dlShiftTo=M5e;$e.prototype.drShiftTo=O5e;$e.prototype.lShiftTo=L5e;$e.prototype.rShiftTo=A5e;$e.prototype.subTo=D5e;$e.prototype.multiplyTo=F5e;$e.prototype.squareTo=N5e;$e.prototype.divRemTo=k5e;$e.prototype.invDigit=V5e;$e.prototype.isEven=Y5e;$e.prototype.exp=Z5e;$e.prototype.toString=C5e;$e.prototype.negate=w5e;$e.prototype.abs=P5e;$e.prototype.compareTo=T5e;$e.prototype.bitLength=E5e;$e.prototype.mod=R5e;$e.prototype.modPowInt=K5e;$e.ZERO=bh(0);$e.ONE=bh(1);function J5e(){var e=nn();return this.copyTo(e),e}o(J5e,"bnClone");function Q5e(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}o(Q5e,"bnIntValue");function e6e(){return this.t==0?this.s:this[0]<<24>>24}o(e6e,"bnByteValue");function t6e(){return this.t==0?this.s:this[0]<<16>>16}o(t6e,"bnShortValue");function r6e(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}o(r6e,"bnpChunkSize");function n6e(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}o(n6e,"bnSigNum");function i6e(e){if(e==null&&(e=10),this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=bh(r),i=nn(),s=nn(),l="";for(this.divRemTo(n,i,s);i.signum()>0;)l=(r+s.intValue()).toString(e).substr(1)+l,i.divRemTo(n,i,s);return s.intValue().toString(e)+l}o(i6e,"bnpToRadix");function o6e(e,t){this.fromInt(0),t==null&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,s=0,l=0,c=0;c<e.length;++c){var p=_ie(e,c);if(p<0){e.charAt(c)=="-"&&this.signum()==0&&(i=!0);continue}l=t*l+p,++s>=r&&(this.dMultiply(n),this.dAddOffset(l,0),s=0,l=0)}s>0&&(this.dMultiply(Math.pow(t,s)),this.dAddOffset(l,0)),i&&$e.ZERO.subTo(this,this)}o(o6e,"bnpFromRadix");function s6e(e,t,r){if(typeof t=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo($e.ONE.shiftLeft(e-1),cD,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo($e.ONE.shiftLeft(e-1),this);else{var n=new Array,i=e&7;n.length=(e>>3)+1,t.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}}o(s6e,"bnpFromNumber");function a6e(){var e=this.t,t=new Array;t[0]=this.s;var r=this.DB-e*this.DB%8,n,i=0;if(e-- >0)for(r<this.DB&&(n=this[e]>>r)!=(this.s&this.DM)>>r&&(t[i++]=n|this.s<<this.DB-r);e>=0;)r<8?(n=(this[e]&(1<<r)-1)<<8-r,n|=this[--e]>>(r+=this.DB-8)):(n=this[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),(n&128)!=0&&(n|=-256),i==0&&(this.s&128)!=(n&128)&&++i,(i>0||n!=this.s)&&(t[i++]=n);return t}o(a6e,"bnToByteArray");function l6e(e){return this.compareTo(e)==0}o(l6e,"bnEquals");function u6e(e){return this.compareTo(e)<0?this:e}o(u6e,"bnMin");function c6e(e){return this.compareTo(e)>0?this:e}o(c6e,"bnMax");function p6e(e,t,r){var n,i,s=Math.min(e.t,this.t);for(n=0;n<s;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(i=e.s&this.DM,n=s;n<this.t;++n)r[n]=t(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=s;n<e.t;++n)r[n]=t(i,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()}o(p6e,"bnpBitwiseTo");function f6e(e,t){return e&t}o(f6e,"op_and");function d6e(e){var t=nn();return this.bitwiseTo(e,f6e,t),t}o(d6e,"bnAnd");function cD(e,t){return e|t}o(cD,"op_or");function h6e(e){var t=nn();return this.bitwiseTo(e,cD,t),t}o(h6e,"bnOr");function Sie(e,t){return e^t}o(Sie,"op_xor");function m6e(e){var t=nn();return this.bitwiseTo(e,Sie,t),t}o(m6e,"bnXor");function Cie(e,t){return e&~t}o(Cie,"op_andnot");function g6e(e){var t=nn();return this.bitwiseTo(e,Cie,t),t}o(g6e,"bnAndNot");function y6e(){for(var e=nn(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e}o(y6e,"bnNot");function v6e(e){var t=nn();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}o(v6e,"bnShiftLeft");function b6e(e){var t=nn();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}o(b6e,"bnShiftRight");function x6e(e){if(e==0)return-1;var t=0;return(e&65535)==0&&(e>>=16,t+=16),(e&255)==0&&(e>>=8,t+=8),(e&15)==0&&(e>>=4,t+=4),(e&3)==0&&(e>>=2,t+=2),(e&1)==0&&++t,t}o(x6e,"lbit");function I6e(){for(var e=0;e<this.t;++e)if(this[e]!=0)return e*this.DB+x6e(this[e]);return this.s<0?this.t*this.DB:-1}o(I6e,"bnGetLowestSetBit");function _6e(e){for(var t=0;e!=0;)e&=e-1,++t;return t}o(_6e,"cbit");function S6e(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=_6e(this[r]^t);return e}o(S6e,"bnBitCount");function C6e(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this[t]&1<<e%this.DB)!=0}o(C6e,"bnTestBit");function w6e(e,t){var r=$e.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r}o(w6e,"bnpChangeBit");function P6e(e){return this.changeBit(e,cD)}o(P6e,"bnSetBit");function T6e(e){return this.changeBit(e,Cie)}o(T6e,"bnClearBit");function E6e(e){return this.changeBit(e,Sie)}o(E6e,"bnFlipBit");function M6e(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]+e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e[r],t[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()}o(M6e,"bnpAddTo");function O6e(e){var t=nn();return this.addTo(e,t),t}o(O6e,"bnAdd");function L6e(e){var t=nn();return this.subTo(e,t),t}o(L6e,"bnSubtract");function A6e(e){var t=nn();return this.multiplyTo(e,t),t}o(A6e,"bnMultiply");function D6e(){var e=nn();return this.squareTo(e),e}o(D6e,"bnSquare");function F6e(e){var t=nn();return this.divRemTo(e,t,null),t}o(F6e,"bnDivide");function N6e(e){var t=nn();return this.divRemTo(e,null,t),t}o(N6e,"bnRemainder");function k6e(e){var t=nn(),r=nn();return this.divRemTo(e,t,r),new Array(t,r)}o(k6e,"bnDivideAndRemainder");function R6e(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}o(R6e,"bnpDMultiply");function B6e(e,t){if(e!=0){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}}o(B6e,"bnpDAddOffset");function m2(){}o(m2,"NullExp");function wie(e){return e}o(wie,"nNop");function $6e(e,t,r){e.multiplyTo(t,r)}o($6e,"nMulTo");function j6e(e,t){e.squareTo(t)}o(j6e,"nSqrTo");m2.prototype.convert=wie;m2.prototype.revert=wie;m2.prototype.mulTo=$6e;m2.prototype.sqrTo=j6e;function G6e(e){return this.exp(e,new m2)}o(G6e,"bnPow");function U6e(e,t,r){var n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;n>0;)r[--n]=0;var i;for(i=r.t-this.t;n<i;++n)r[n+this.t]=this.am(0,e[n],r,n,0,this.t);for(i=Math.min(e.t,t);n<i;++n)this.am(0,e[n],r,n,0,t-n);r.clamp()}o(U6e,"bnpMultiplyLowerTo");function V6e(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)}o(V6e,"bnpMultiplyUpperTo");function bv(e){this.r2=nn(),this.q3=nn(),$e.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}o(bv,"Barrett");function z6e(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=nn();return e.copyTo(t),this.reduce(t),t}o(z6e,"barrettConvert");function q6e(e){return e}o(q6e,"barrettRevert");function H6e(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}o(H6e,"barrettReduce");function W6e(e,t){e.squareTo(t),this.reduce(t)}o(W6e,"barrettSqrTo");function X6e(e,t,r){e.multiplyTo(t,r),this.reduce(r)}o(X6e,"barrettMulTo");bv.prototype.convert=z6e;bv.prototype.revert=q6e;bv.prototype.reduce=H6e;bv.prototype.mulTo=X6e;bv.prototype.sqrTo=W6e;function Y6e(e,t){var r=e.bitLength(),n,i=bh(1),s;if(r<=0)return i;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?s=new ay(t):t.isEven()?s=new bv(t):s=new ly(t);var l=new Array,c=3,p=n-1,h=(1<<n)-1;if(l[1]=s.convert(this),n>1){var y=nn();for(s.sqrTo(l[1],y);c<=h;)l[c]=nn(),s.mulTo(y,l[c-2],l[c]),c+=2}var b=e.t-1,_,C=!0,P=nn(),E;for(r=X3(e[b])-1;b>=0;){for(r>=p?_=e[b]>>r-p&h:(_=(e[b]&(1<<r+1)-1)<<p-r,b>0&&(_|=e[b-1]>>this.DB+r-p)),c=n;(_&1)==0;)_>>=1,--c;if((r-=c)<0&&(r+=this.DB,--b),C)l[_].copyTo(i),C=!1;else{for(;c>1;)s.sqrTo(i,P),s.sqrTo(P,i),c-=2;c>0?s.sqrTo(i,P):(E=i,i=P,P=E),s.mulTo(P,l[_],i)}for(;b>=0&&(e[b]&1<<r)==0;)s.sqrTo(i,P),E=i,i=P,P=E,--r<0&&(r=this.DB-1,--b)}return s.revert(i)}o(Y6e,"bnModPow");function Z6e(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),s=r.getLowestSetBit();if(s<0)return t;for(i<s&&(s=i),s>0&&(t.rShiftTo(s,t),r.rShiftTo(s,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r}o(Z6e,"bnGCD");function K6e(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(t==0)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r}o(K6e,"bnpModInt");function J6e(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return $e.ZERO;for(var r=e.clone(),n=this.clone(),i=bh(1),s=bh(0),l=bh(0),c=bh(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),t?((!i.isEven()||!s.isEven())&&(i.addTo(this,i),s.subTo(e,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),t?((!l.isEven()||!c.isEven())&&(l.addTo(this,l),c.subTo(e,c)),l.rShiftTo(1,l)):c.isEven()||c.subTo(e,c),c.rShiftTo(1,c);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(l,i),s.subTo(c,s)):(n.subTo(r,n),t&&l.subTo(i,l),c.subTo(s,c))}if(n.compareTo($e.ONE)!=0)return $e.ZERO;if(c.compareTo(e)>=0)return c.subtract(e);if(c.signum()<0)c.addTo(e,c);else return c;return c.signum()<0?c.add(e):c}o(J6e,"bnModInverse");var va=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],Q6e=(1<<26)/va[va.length-1];function eLe(e){var t,r=this.abs();if(r.t==1&&r[0]<=va[va.length-1]){for(t=0;t<va.length;++t)if(r[0]==va[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<va.length;){for(var n=va[t],i=t+1;i<va.length&&n<Q6e;)n*=va[i++];for(n=r.modInt(n);t<i;)if(n%va[t++]==0)return!1}return r.millerRabin(e)}o(eLe,"bnIsProbablePrime");function tLe(e){var t=this.subtract($e.ONE),r=t.getLowestSetBit();if(r<=0)return!1;var n=t.shiftRight(r);e=e+1>>1,e>va.length&&(e=va.length);for(var i=nn(),s=0;s<e;++s){i.fromInt(va[Math.floor(Math.random()*va.length)]);var l=i.modPow(n,this);if(l.compareTo($e.ONE)!=0&&l.compareTo(t)!=0){for(var c=1;c++<r&&l.compareTo(t)!=0;)if(l=l.modPowInt(2,this),l.compareTo($e.ONE)==0)return!1;if(l.compareTo(t)!=0)return!1}}return!0}o(tLe,"bnpMillerRabin");$e.prototype.chunkSize=r6e;$e.prototype.toRadix=i6e;$e.prototype.fromRadix=o6e;$e.prototype.fromNumber=s6e;$e.prototype.bitwiseTo=p6e;$e.prototype.changeBit=w6e;$e.prototype.addTo=M6e;$e.prototype.dMultiply=R6e;$e.prototype.dAddOffset=B6e;$e.prototype.multiplyLowerTo=U6e;$e.prototype.multiplyUpperTo=V6e;$e.prototype.modInt=K6e;$e.prototype.millerRabin=tLe;$e.prototype.clone=J5e;$e.prototype.intValue=Q5e;$e.prototype.byteValue=e6e;$e.prototype.shortValue=t6e;$e.prototype.signum=n6e;$e.prototype.toByteArray=a6e;$e.prototype.equals=l6e;$e.prototype.min=u6e;$e.prototype.max=c6e;$e.prototype.and=d6e;$e.prototype.or=h6e;$e.prototype.xor=m6e;$e.prototype.andNot=g6e;$e.prototype.not=y6e;$e.prototype.shiftLeft=v6e;$e.prototype.shiftRight=b6e;$e.prototype.getLowestSetBit=I6e;$e.prototype.bitCount=S6e;$e.prototype.testBit=C6e;$e.prototype.setBit=P6e;$e.prototype.clearBit=T6e;$e.prototype.flipBit=E6e;$e.prototype.add=O6e;$e.prototype.subtract=L6e;$e.prototype.multiply=A6e;$e.prototype.divide=F6e;$e.prototype.remainder=N6e;$e.prototype.divideAndRemainder=k6e;$e.prototype.modPow=Y6e;$e.prototype.modInverse=J6e;$e.prototype.pow=G6e;$e.prototype.gcd=Z6e;$e.prototype.isProbablePrime=eLe;$e.prototype.square=D6e;var Tr=$e;Tr.prototype.IsNegative=function(){return this.compareTo(Tr.ZERO)==-1};Tr.op_Equality=function(e,t){return e.compareTo(t)==0};Tr.op_Inequality=function(e,t){return e.compareTo(t)!=0};Tr.op_GreaterThan=function(e,t){return e.compareTo(t)>0};Tr.op_LessThan=function(e,t){return e.compareTo(t)<0};Tr.op_Addition=function(e,t){return new Tr(e).add(new Tr(t))};Tr.op_Subtraction=function(e,t){return new Tr(e).subtract(new Tr(t))};Tr.Int128Mul=function(e,t){return new Tr(e).multiply(new Tr(t))};Tr.op_Division=function(e,t){return e.divide(t)};Tr.prototype.ToDouble=function(){return parseFloat(this.toString())};typeof H3>"u"&&(H3=o(function(e,t){var r;if(typeof Object.getOwnPropertyNames>"u"){for(r in t.prototype)(typeof e.prototype[r]>"u"||e.prototype[r]==Object.prototype[r])&&(e.prototype[r]=t.prototype[r]);for(r in t)typeof e[r]>"u"&&(e[r]=t[r]);e.$baseCtor=t}else{for(var n=Object.getOwnPropertyNames(t.prototype),i=0;i<n.length;i++)typeof Object.getOwnPropertyDescriptor(e.prototype,n[i])>"u"&&Object.defineProperty(e.prototype,n[i],Object.getOwnPropertyDescriptor(t.prototype,n[i]));for(r in t)typeof e[r]>"u"&&(e[r]=t[r]);e.$baseCtor=t}},"Inherit"));var H3;w.Path=function(){return[]};w.Paths=function(){return[]};w.DoublePoint=function(){var e=arguments;this.X=0,this.Y=0,e.length==1?(this.X=e[0].X,this.Y=e[0].Y):e.length==2&&(this.X=e[0],this.Y=e[1])};w.DoublePoint0=function(){this.X=0,this.Y=0};w.DoublePoint1=function(e){this.X=e.X,this.Y=e.Y};w.DoublePoint2=function(e,t){this.X=e,this.Y=t};w.PolyNode=function(){this.m_Parent=null,this.m_polygon=new w.Path,this.m_Index=0,this.m_jointype=0,this.m_endtype=0,this.m_Childs=[],this.IsOpen=!1};w.PolyNode.prototype.IsHoleNode=function(){for(var e=!0,t=this.m_Parent;t!==null;)e=!e,t=t.m_Parent;return e};w.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length};w.PolyNode.prototype.Contour=function(){return this.m_polygon};w.PolyNode.prototype.AddChild=function(e){var t=this.m_Childs.length;this.m_Childs.push(e),e.m_Parent=this,e.m_Index=t};w.PolyNode.prototype.GetNext=function(){return this.m_Childs.length>0?this.m_Childs[0]:this.GetNextSiblingUp()};w.PolyNode.prototype.GetNextSiblingUp=function(){return this.m_Parent===null?null:this.m_Index==this.m_Parent.m_Childs.length-1?this.m_Parent.GetNextSiblingUp():this.m_Parent.m_Childs[this.m_Index+1]};w.PolyNode.prototype.Childs=function(){return this.m_Childs};w.PolyNode.prototype.Parent=function(){return this.m_Parent};w.PolyNode.prototype.IsHole=function(){return this.IsHoleNode()};w.PolyTree=function(){this.m_AllPolys=[],w.PolyNode.call(this)};w.PolyTree.prototype.Clear=function(){for(var e=0,t=this.m_AllPolys.length;e<t;e++)this.m_AllPolys[e]=null;this.m_AllPolys.length=0,this.m_Childs.length=0};w.PolyTree.prototype.GetFirst=function(){return this.m_Childs.length>0?this.m_Childs[0]:null};w.PolyTree.prototype.Total=function(){return this.m_AllPolys.length};H3(w.PolyTree,w.PolyNode);w.Math_Abs_Int64=w.Math_Abs_Int32=w.Math_Abs_Double=function(e){return Math.abs(e)};w.Math_Max_Int32_Int32=function(e,t){return Math.max(e,t)};qr.msie||qr.opera||qr.safari?w.Cast_Int32=function(e){return e|0}:w.Cast_Int32=function(e){return~~e};qr.chrome?w.Cast_Int64=function(e){return e<-2147483648||e>2147483647?e<0?Math.ceil(e):Math.floor(e):~~e}:qr.firefox&&typeof Number.toInteger=="function"?w.Cast_Int64=function(e){return Number.toInteger(e)}:qr.msie7||qr.msie8?w.Cast_Int64=function(e){return parseInt(e,10)}:qr.msie?w.Cast_Int64=function(e){return e<-2147483648||e>2147483647?e<0?Math.ceil(e):Math.floor(e):e|0}:w.Cast_Int64=function(e){return e<0?Math.ceil(e):Math.floor(e)};w.Clear=function(e){e.length=0};w.PI=3.141592653589793;w.PI2=2*3.141592653589793;w.IntPoint=function(){var e=arguments,t=e.length;if(this.X=0,this.Y=0,sy)if(this.Z=0,t==3)this.X=e[0],this.Y=e[1],this.Z=e[2];else if(t==2)this.X=e[0],this.Y=e[1],this.Z=0;else if(t==1)if(e[0]instanceof w.DoublePoint){var r=e[0];this.X=w.Clipper.Round(r.X),this.Y=w.Clipper.Round(r.Y),this.Z=0}else{var n=e[0];typeof n.Z>"u"&&(n.Z=0),this.X=n.X,this.Y=n.Y,this.Z=n.Z}else this.X=0,this.Y=0,this.Z=0;else if(t==2)this.X=e[0],this.Y=e[1];else if(t==1)if(e[0]instanceof w.DoublePoint){var r=e[0];this.X=w.Clipper.Round(r.X),this.Y=w.Clipper.Round(r.Y)}else{var n=e[0];this.X=n.X,this.Y=n.Y}else this.X=0,this.Y=0};w.IntPoint.op_Equality=function(e,t){return e.X==t.X&&e.Y==t.Y};w.IntPoint.op_Inequality=function(e,t){return e.X!=t.X||e.Y!=t.Y};sy?(w.IntPoint0=function(){this.X=0,this.Y=0,this.Z=0},w.IntPoint1=function(e){this.X=e.X,this.Y=e.Y,this.Z=e.Z},w.IntPoint1dp=function(e){this.X=w.Clipper.Round(e.X),this.Y=w.Clipper.Round(e.Y),this.Z=0},w.IntPoint2=function(e,t){this.X=e,this.Y=t,this.Z=0},w.IntPoint3=function(e,t,r){this.X=e,this.Y=t,this.Z=r}):(w.IntPoint0=function(){this.X=0,this.Y=0},w.IntPoint1=function(e){this.X=e.X,this.Y=e.Y},w.IntPoint1dp=function(e){this.X=w.Clipper.Round(e.X),this.Y=w.Clipper.Round(e.Y)},w.IntPoint2=function(e,t){this.X=e,this.Y=t});w.IntRect=function(){var e=arguments,t=e.length;t==4?(this.left=e[0],this.top=e[1],this.right=e[2],this.bottom=e[3]):t==1?(this.left=ir.left,this.top=ir.top,this.right=ir.right,this.bottom=ir.bottom):(this.left=0,this.top=0,this.right=0,this.bottom=0)};w.IntRect0=function(){this.left=0,this.top=0,this.right=0,this.bottom=0};w.IntRect1=function(e){this.left=e.left,this.top=e.top,this.right=e.right,this.bottom=e.bottom};w.IntRect4=function(e,t,r,n){this.left=e,this.top=t,this.right=r,this.bottom=n};w.ClipType={ctIntersection:0,ctUnion:1,ctDifference:2,ctXor:3};w.PolyType={ptSubject:0,ptClip:1};w.PolyFillType={pftEvenOdd:0,pftNonZero:1,pftPositive:2,pftNegative:3};w.JoinType={jtSquare:0,jtRound:1,jtMiter:2};w.EndType={etOpenSquare:0,etOpenRound:1,etOpenButt:2,etClosedLine:3,etClosedPolygon:4};xie&&(w.EndType_={etSquare:0,etRound:1,etButt:2,etClosed:3});w.EdgeSide={esLeft:0,esRight:1};w.Direction={dRightToLeft:0,dLeftToRight:1};w.TEdge=function(){this.Bot=new w.IntPoint,this.Curr=new w.IntPoint,this.Top=new w.IntPoint,this.Delta=new w.IntPoint,this.Dx=0,this.PolyTyp=w.PolyType.ptSubject,this.Side=w.EdgeSide.esLeft,this.WindDelta=0,this.WindCnt=0,this.WindCnt2=0,this.OutIdx=0,this.Next=null,this.Prev=null,this.NextInLML=null,this.NextInAEL=null,this.PrevInAEL=null,this.NextInSEL=null,this.PrevInSEL=null};w.IntersectNode=function(){this.Edge1=null,this.Edge2=null,this.Pt=new w.IntPoint};w.MyIntersectNodeSort=function(){};w.MyIntersectNodeSort.Compare=function(e,t){return t.Pt.Y-e.Pt.Y};w.LocalMinima=function(){this.Y=0,this.LeftBound=null,this.RightBound=null,this.Next=null};w.Scanbeam=function(){this.Y=0,this.Next=null};w.OutRec=function(){this.Idx=0,this.IsHole=!1,this.IsOpen=!1,this.FirstLeft=null,this.Pts=null,this.BottomPt=null,this.PolyNode=null};w.OutPt=function(){this.Idx=0,this.Pt=new w.IntPoint,this.Next=null,this.Prev=null};w.Join=function(){this.OutPt1=null,this.OutPt2=null,this.OffPt=new w.IntPoint};w.ClipperBase=function(){this.m_MinimaList=null,this.m_CurrentLM=null,this.m_edges=new Array,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1,this.PreserveCollinear=!1,this.m_MinimaList=null,this.m_CurrentLM=null,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};w.ClipperBase.horizontal=-9007199254740992;w.ClipperBase.Skip=-2;w.ClipperBase.Unassigned=-1;w.ClipperBase.tolerance=1e-20;h5e?(w.ClipperBase.loRange=46340,w.ClipperBase.hiRange=46340):(w.ClipperBase.loRange=47453132,w.ClipperBase.hiRange=0xfffffffffffff);w.ClipperBase.near_zero=function(e){return e>-w.ClipperBase.tolerance&&e<w.ClipperBase.tolerance};w.ClipperBase.IsHorizontal=function(e){return e.Delta.Y===0};w.ClipperBase.prototype.PointIsVertex=function(e,t){var r=t;do{if(w.IntPoint.op_Equality(r.Pt,e))return!0;r=r.Next}while(r!=t);return!1};w.ClipperBase.prototype.PointOnLineSegment=function(e,t,r,n){return n?e.X==t.X&&e.Y==t.Y||e.X==r.X&&e.Y==r.Y||e.X>t.X==e.X<r.X&&e.Y>t.Y==e.Y<r.Y&&Tr.op_Equality(Tr.Int128Mul(e.X-t.X,r.Y-t.Y),Tr.Int128Mul(r.X-t.X,e.Y-t.Y)):e.X==t.X&&e.Y==t.Y||e.X==r.X&&e.Y==r.Y||e.X>t.X==e.X<r.X&&e.Y>t.Y==e.Y<r.Y&&(e.X-t.X)*(r.Y-t.Y)==(r.X-t.X)*(e.Y-t.Y)};w.ClipperBase.prototype.PointOnPolygon=function(e,t,r){for(var n=t;;){if(this.PointOnLineSegment(e,n.Pt,n.Next.Pt,r))return!0;if(n=n.Next,n==t)break}return!1};w.ClipperBase.prototype.SlopesEqual=w.ClipperBase.SlopesEqual=function(){var e=arguments,t=e.length,r,n,i,s,l,c,p;return t==3?(r=e[0],n=e[1],p=e[2],p?Tr.op_Equality(Tr.Int128Mul(r.Delta.Y,n.Delta.X),Tr.Int128Mul(r.Delta.X,n.Delta.Y)):w.Cast_Int64(r.Delta.Y*n.Delta.X)==w.Cast_Int64(r.Delta.X*n.Delta.Y)):t==4?(i=e[0],s=e[1],l=e[2],p=e[3],p?Tr.op_Equality(Tr.Int128Mul(i.Y-s.Y,s.X-l.X),Tr.Int128Mul(i.X-s.X,s.Y-l.Y)):w.Cast_Int64((i.Y-s.Y)*(s.X-l.X))-w.Cast_Int64((i.X-s.X)*(s.Y-l.Y))===0):(i=e[0],s=e[1],l=e[2],c=e[3],p=e[4],p?Tr.op_Equality(Tr.Int128Mul(i.Y-s.Y,l.X-c.X),Tr.Int128Mul(i.X-s.X,l.Y-c.Y)):w.Cast_Int64((i.Y-s.Y)*(l.X-c.X))-w.Cast_Int64((i.X-s.X)*(l.Y-c.Y))===0)};w.ClipperBase.SlopesEqual3=function(e,t,r){return r?Tr.op_Equality(Tr.Int128Mul(e.Delta.Y,t.Delta.X),Tr.Int128Mul(e.Delta.X,t.Delta.Y)):w.Cast_Int64(e.Delta.Y*t.Delta.X)==w.Cast_Int64(e.Delta.X*t.Delta.Y)};w.ClipperBase.SlopesEqual4=function(e,t,r,n){return n?Tr.op_Equality(Tr.Int128Mul(e.Y-t.Y,t.X-r.X),Tr.Int128Mul(e.X-t.X,t.Y-r.Y)):w.Cast_Int64((e.Y-t.Y)*(t.X-r.X))-w.Cast_Int64((e.X-t.X)*(t.Y-r.Y))===0};w.ClipperBase.SlopesEqual5=function(e,t,r,n,i){return i?Tr.op_Equality(Tr.Int128Mul(e.Y-t.Y,r.X-n.X),Tr.Int128Mul(e.X-t.X,r.Y-n.Y)):w.Cast_Int64((e.Y-t.Y)*(r.X-n.X))-w.Cast_Int64((e.X-t.X)*(r.Y-n.Y))===0};w.ClipperBase.prototype.Clear=function(){this.DisposeLocalMinimaList();for(var e=0,t=this.m_edges.length;e<t;++e){for(var r=0,n=this.m_edges[e].length;r<n;++r)this.m_edges[e][r]=null;w.Clear(this.m_edges[e])}w.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1};w.ClipperBase.prototype.DisposeLocalMinimaList=function(){for(;this.m_MinimaList!==null;){var e=this.m_MinimaList.Next;this.m_MinimaList=null,this.m_MinimaList=e}this.m_CurrentLM=null};w.ClipperBase.prototype.RangeTest=function(e,t){t.Value?(e.X>w.ClipperBase.hiRange||e.Y>w.ClipperBase.hiRange||-e.X>w.ClipperBase.hiRange||-e.Y>w.ClipperBase.hiRange)&&w.Error("Coordinate outside allowed range in RangeTest()."):(e.X>w.ClipperBase.loRange||e.Y>w.ClipperBase.loRange||-e.X>w.ClipperBase.loRange||-e.Y>w.ClipperBase.loRange)&&(t.Value=!0,this.RangeTest(e,t))};w.ClipperBase.prototype.InitEdge=function(e,t,r,n){e.Next=t,e.Prev=r,e.Curr.X=n.X,e.Curr.Y=n.Y,e.OutIdx=-1};w.ClipperBase.prototype.InitEdge2=function(e,t){e.Curr.Y>=e.Next.Curr.Y?(e.Bot.X=e.Curr.X,e.Bot.Y=e.Curr.Y,e.Top.X=e.Next.Curr.X,e.Top.Y=e.Next.Curr.Y):(e.Top.X=e.Curr.X,e.Top.Y=e.Curr.Y,e.Bot.X=e.Next.Curr.X,e.Bot.Y=e.Next.Curr.Y),this.SetDx(e),e.PolyTyp=t};w.ClipperBase.prototype.FindNextLocMin=function(e){for(var t;;){for(;w.IntPoint.op_Inequality(e.Bot,e.Prev.Bot)||w.IntPoint.op_Equality(e.Curr,e.Top);)e=e.Next;if(e.Dx!=w.ClipperBase.horizontal&&e.Prev.Dx!=w.ClipperBase.horizontal)break;for(;e.Prev.Dx==w.ClipperBase.horizontal;)e=e.Prev;for(t=e;e.Dx==w.ClipperBase.horizontal;)e=e.Next;if(e.Top.Y!=e.Prev.Bot.Y){t.Prev.Bot.X<e.Bot.X&&(e=t);break}}return e};w.ClipperBase.prototype.ProcessBound=function(e,t){var r=e,n=e,i,s;if(e.Dx==w.ClipperBase.horizontal&&(t?s=e.Prev.Bot.X:s=e.Next.Bot.X,e.Bot.X!=s&&this.ReverseHorizontal(e)),n.OutIdx!=w.ClipperBase.Skip)if(t){for(;n.Top.Y==n.Next.Bot.Y&&n.Next.OutIdx!=w.ClipperBase.Skip;)n=n.Next;if(n.Dx==w.ClipperBase.horizontal&&n.Next.OutIdx!=w.ClipperBase.Skip){for(i=n;i.Prev.Dx==w.ClipperBase.horizontal;)i=i.Prev;i.Prev.Top.X==n.Next.Top.X?t||(n=i.Prev):i.Prev.Top.X>n.Next.Top.X&&(n=i.Prev)}for(;e!=n;)e.NextInLML=e.Next,e.Dx==w.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Prev.Top.X&&this.ReverseHorizontal(e),e=e.Next;e.Dx==w.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Prev.Top.X&&this.ReverseHorizontal(e),n=n.Next}else{for(;n.Top.Y==n.Prev.Bot.Y&&n.Prev.OutIdx!=w.ClipperBase.Skip;)n=n.Prev;if(n.Dx==w.ClipperBase.horizontal&&n.Prev.OutIdx!=w.ClipperBase.Skip){for(i=n;i.Next.Dx==w.ClipperBase.horizontal;)i=i.Next;i.Next.Top.X==n.Prev.Top.X?t||(n=i.Next):i.Next.Top.X>n.Prev.Top.X&&(n=i.Next)}for(;e!=n;)e.NextInLML=e.Prev,e.Dx==w.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Next.Top.X&&this.ReverseHorizontal(e),e=e.Prev;e.Dx==w.ClipperBase.horizontal&&e!=r&&e.Bot.X!=e.Next.Top.X&&this.ReverseHorizontal(e),n=n.Prev}if(n.OutIdx==w.ClipperBase.Skip){if(e=n,t){for(;e.Top.Y==e.Next.Bot.Y;)e=e.Next;for(;e!=n&&e.Dx==w.ClipperBase.horizontal;)e=e.Prev}else{for(;e.Top.Y==e.Prev.Bot.Y;)e=e.Prev;for(;e!=n&&e.Dx==w.ClipperBase.horizontal;)e=e.Next}if(e==n)t?n=e.Next:n=e.Prev;else{t?e=n.Next:e=n.Prev;var l=new w.LocalMinima;l.Next=null,l.Y=e.Bot.Y,l.LeftBound=null,l.RightBound=e,l.RightBound.WindDelta=0,n=this.ProcessBound(l.RightBound,t),this.InsertLocalMinima(l)}}return n};w.ClipperBase.prototype.AddPath=function(e,t,r){bie?!r&&t==w.PolyType.ptClip&&w.Error("AddPath: Open paths must be subject."):r||w.Error("AddPath: Open paths have been disabled.");var n=e.length-1;if(r)for(;n>0&&w.IntPoint.op_Equality(e[n],e[0]);)--n;for(;n>0&&w.IntPoint.op_Equality(e[n],e[n-1]);)--n;if(r&&n<2||!r&&n<1)return!1;for(var i=new Array,s=0;s<=n;s++)i.push(new w.TEdge);var l=!0;i[1].Curr.X=e[1].X,i[1].Curr.Y=e[1].Y;var c={Value:this.m_UseFullRange};this.RangeTest(e[0],c),this.m_UseFullRange=c.Value,c.Value=this.m_UseFullRange,this.RangeTest(e[n],c),this.m_UseFullRange=c.Value,this.InitEdge(i[0],i[1],i[n],e[0]),this.InitEdge(i[n],i[0],i[n-1],e[n]);for(var s=n-1;s>=1;--s)c.Value=this.m_UseFullRange,this.RangeTest(e[s],c),this.m_UseFullRange=c.Value,this.InitEdge(i[s],i[s+1],i[s-1],e[s]);for(var p=i[0],h=p,y=p;;){if(w.IntPoint.op_Equality(h.Curr,h.Next.Curr)){if(h==h.Next)break;h==p&&(p=h.Next),h=this.RemoveEdge(h),y=h;continue}if(h.Prev==h.Next)break;if(r&&w.ClipperBase.SlopesEqual(h.Prev.Curr,h.Curr,h.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(h.Prev.Curr,h.Curr,h.Next.Curr))){h==p&&(p=h.Next),h=this.RemoveEdge(h),h=h.Prev,y=h;continue}if(h=h.Next,h==y)break}if(!r&&h==h.Next||r&&h.Prev==h.Next)return!1;r||(this.m_HasOpenPaths=!0,p.Prev.OutIdx=w.ClipperBase.Skip);var b=p;h=p;do this.InitEdge2(h,t),h=h.Next,l&&h.Curr.Y!=p.Curr.Y&&(l=!1);while(h!=p);if(l){if(r)return!1;h.Prev.OutIdx=w.ClipperBase.Skip,h.Prev.Bot.X<h.Prev.Top.X&&this.ReverseHorizontal(h.Prev);var _=new w.LocalMinima;for(_.Next=null,_.Y=h.Bot.Y,_.LeftBound=null,_.RightBound=h,_.RightBound.Side=w.EdgeSide.esRight,_.RightBound.WindDelta=0;h.Next.OutIdx!=w.ClipperBase.Skip;)h.NextInLML=h.Next,h.Bot.X!=h.Prev.Top.X&&this.ReverseHorizontal(h),h=h.Next;return this.InsertLocalMinima(_),this.m_edges.push(i),!0}this.m_edges.push(i);for(var C,P=null;h=this.FindNextLocMin(h),h!=P;){P==null&&(P=h);var _=new w.LocalMinima;_.Next=null,_.Y=h.Bot.Y,h.Dx<h.Prev.Dx?(_.LeftBound=h.Prev,_.RightBound=h,C=!1):(_.LeftBound=h,_.RightBound=h.Prev,C=!0),_.LeftBound.Side=w.EdgeSide.esLeft,_.RightBound.Side=w.EdgeSide.esRight,r?_.LeftBound.Next==_.RightBound?_.LeftBound.WindDelta=-1:_.LeftBound.WindDelta=1:_.LeftBound.WindDelta=0,_.RightBound.WindDelta=-_.LeftBound.WindDelta,h=this.ProcessBound(_.LeftBound,C);var E=this.ProcessBound(_.RightBound,!C);_.LeftBound.OutIdx==w.ClipperBase.Skip?_.LeftBound=null:_.RightBound.OutIdx==w.ClipperBase.Skip&&(_.RightBound=null),this.InsertLocalMinima(_),C||(h=E)}return!0};w.ClipperBase.prototype.AddPaths=function(e,t,r){for(var n=!1,i=0,s=e.length;i<s;++i)this.AddPath(e[i],t,r)&&(n=!0);return n};w.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(e,t,r){return w.IntPoint.op_Equality(e,r)||w.IntPoint.op_Equality(e,t)||w.IntPoint.op_Equality(r,t)?!1:e.X!=r.X?t.X>e.X==t.X<r.X:t.Y>e.Y==t.Y<r.Y};w.ClipperBase.prototype.RemoveEdge=function(e){e.Prev.Next=e.Next,e.Next.Prev=e.Prev;var t=e.Next;return e.Prev=null,t};w.ClipperBase.prototype.SetDx=function(e){e.Delta.X=e.Top.X-e.Bot.X,e.Delta.Y=e.Top.Y-e.Bot.Y,e.Delta.Y===0?e.Dx=w.ClipperBase.horizontal:e.Dx=e.Delta.X/e.Delta.Y};w.ClipperBase.prototype.InsertLocalMinima=function(e){if(this.m_MinimaList===null)this.m_MinimaList=e;else if(e.Y>=this.m_MinimaList.Y)e.Next=this.m_MinimaList,this.m_MinimaList=e;else{for(var t=this.m_MinimaList;t.Next!==null&&e.Y<t.Next.Y;)t=t.Next;e.Next=t.Next,t.Next=e}};w.ClipperBase.prototype.PopLocalMinima=function(){this.m_CurrentLM!==null&&(this.m_CurrentLM=this.m_CurrentLM.Next)};w.ClipperBase.prototype.ReverseHorizontal=function(e){var t=e.Top.X;e.Top.X=e.Bot.X,e.Bot.X=t,sy&&(t=e.Top.Z,e.Top.Z=e.Bot.Z,e.Bot.Z=t)};w.ClipperBase.prototype.Reset=function(){if(this.m_CurrentLM=this.m_MinimaList,this.m_CurrentLM!=null)for(var e=this.m_MinimaList;e!=null;){var t=e.LeftBound;t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=w.EdgeSide.esLeft,t.OutIdx=w.ClipperBase.Unassigned),t=e.RightBound,t!=null&&(t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.Side=w.EdgeSide.esRight,t.OutIdx=w.ClipperBase.Unassigned),e=e.Next}};w.Clipper=function(e){typeof e>"u"&&(e=0),this.m_PolyOuts=null,this.m_ClipType=w.ClipType.ctIntersection,this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=null,this.m_IntersectNodeComparer=null,this.m_ExecuteLocked=!1,this.m_ClipFillType=w.PolyFillType.pftEvenOdd,this.m_SubjFillType=w.PolyFillType.pftEvenOdd,this.m_Joins=null,this.m_GhostJoins=null,this.m_UsingPolyTree=!1,this.ReverseSolution=!1,this.StrictlySimple=!1,w.ClipperBase.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=new Array,this.m_IntersectNodeComparer=w.MyIntersectNodeSort.Compare,this.m_ExecuteLocked=!1,this.m_UsingPolyTree=!1,this.m_PolyOuts=new Array,this.m_Joins=new Array,this.m_GhostJoins=new Array,this.ReverseSolution=(1&e)!==0,this.StrictlySimple=(2&e)!==0,this.PreserveCollinear=(4&e)!==0,sy&&(this.ZFillFunction=null)};w.Clipper.ioReverseSolution=1;w.Clipper.ioStrictlySimple=2;w.Clipper.ioPreserveCollinear=4;w.Clipper.prototype.Clear=function(){this.m_edges.length!==0&&(this.DisposeAllPolyPts(),w.ClipperBase.prototype.Clear.call(this))};w.Clipper.prototype.DisposeScanbeamList=function(){for(;this.m_Scanbeam!==null;){var e=this.m_Scanbeam.Next;this.m_Scanbeam=null,this.m_Scanbeam=e}};w.Clipper.prototype.Reset=function(){w.ClipperBase.prototype.Reset.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null;for(var e=this.m_MinimaList;e!==null;)this.InsertScanbeam(e.Y),e=e.Next};w.Clipper.prototype.InsertScanbeam=function(e){if(this.m_Scanbeam===null)this.m_Scanbeam=new w.Scanbeam,this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=e;else if(e>this.m_Scanbeam.Y){var t=new w.Scanbeam;t.Y=e,t.Next=this.m_Scanbeam,this.m_Scanbeam=t}else{for(var r=this.m_Scanbeam;r.Next!==null&&e<=r.Next.Y;)r=r.Next;if(e==r.Y)return;var t=new w.Scanbeam;t.Y=e,t.Next=r.Next,r.Next=t}};w.Clipper.prototype.Execute=function(){var e=arguments,t=e.length,r=e[1]instanceof w.PolyTree;if(t==4&&!r){var n=e[0],i=e[1],s=e[2],l=e[3];if(this.m_ExecuteLocked)return!1;this.m_HasOpenPaths&&w.Error("Error: PolyTree struct is need for open path clipping."),this.m_ExecuteLocked=!0,w.Clear(i),this.m_SubjFillType=s,this.m_ClipFillType=l,this.m_ClipType=n,this.m_UsingPolyTree=!1;try{var c=this.ExecuteInternal();c&&this.BuildResult(i)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return c}else if(t==4&&r){var n=e[0],p=e[1],s=e[2],l=e[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=s,this.m_ClipFillType=l,this.m_ClipType=n,this.m_UsingPolyTree=!0;try{var c=this.ExecuteInternal();c&&this.BuildResult2(p)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return c}else if(t==2&&!r){var n=e[0],i=e[1];return this.Execute(n,i,w.PolyFillType.pftEvenOdd,w.PolyFillType.pftEvenOdd)}else if(t==2&&r){var n=e[0],p=e[1];return this.Execute(n,p,w.PolyFillType.pftEvenOdd,w.PolyFillType.pftEvenOdd)}};w.Clipper.prototype.FixHoleLinkage=function(e){if(!(e.FirstLeft===null||e.IsHole!=e.FirstLeft.IsHole&&e.FirstLeft.Pts!==null)){for(var t=e.FirstLeft;t!==null&&(t.IsHole==e.IsHole||t.Pts===null);)t=t.FirstLeft;e.FirstLeft=t}};w.Clipper.prototype.ExecuteInternal=function(){try{if(this.Reset(),this.m_CurrentLM===null)return!1;var e=this.PopScanbeam();do{if(this.InsertLocalMinimaIntoAEL(e),w.Clear(this.m_GhostJoins),this.ProcessHorizontals(!1),this.m_Scanbeam===null)break;var t=this.PopScanbeam();if(!this.ProcessIntersections(e,t))return!1;this.ProcessEdgesAtTopOfScanbeam(t),e=t}while(this.m_Scanbeam!==null||this.m_CurrentLM!==null);for(var r=0,n=this.m_PolyOuts.length;r<n;r++){var i=this.m_PolyOuts[r];i.Pts===null||i.IsOpen||(i.IsHole^this.ReverseSolution)==this.Area(i)>0&&this.ReversePolyPtLinks(i.Pts)}this.JoinCommonEdges();for(var r=0,n=this.m_PolyOuts.length;r<n;r++){var i=this.m_PolyOuts[r];i.Pts!==null&&!i.IsOpen&&this.FixupOutPolygon(i)}return this.StrictlySimple&&this.DoSimplePolygons(),!0}finally{w.Clear(this.m_Joins),w.Clear(this.m_GhostJoins)}};w.Clipper.prototype.PopScanbeam=function(){var e=this.m_Scanbeam.Y,t=this.m_Scanbeam;return this.m_Scanbeam=this.m_Scanbeam.Next,t=null,e};w.Clipper.prototype.DisposeAllPolyPts=function(){for(var e=0,t=this.m_PolyOuts.length;e<t;++e)this.DisposeOutRec(e);w.Clear(this.m_PolyOuts)};w.Clipper.prototype.DisposeOutRec=function(e){var t=this.m_PolyOuts[e];t.Pts!==null&&this.DisposeOutPts(t.Pts),t=null,this.m_PolyOuts[e]=null};w.Clipper.prototype.DisposeOutPts=function(e){if(e!==null){var t=null;for(e.Prev.Next=null;e!==null;)t=e,e=e.Next,t=null}};w.Clipper.prototype.AddJoin=function(e,t,r){var n=new w.Join;n.OutPt1=e,n.OutPt2=t,n.OffPt.X=r.X,n.OffPt.Y=r.Y,this.m_Joins.push(n)};w.Clipper.prototype.AddGhostJoin=function(e,t){var r=new w.Join;r.OutPt1=e,r.OffPt.X=t.X,r.OffPt.Y=t.Y,this.m_GhostJoins.push(r)};sy&&(w.Clipper.prototype.SetZ=function(e,t){e.Z=0,this.ZFillFunction!==null&&(t.OutIdx<0?this.ZFillFunction(t.Bot,t.Top,e):this.ZFillFunction(t.Top,t.Bot,e))});w.Clipper.prototype.InsertLocalMinimaIntoAEL=function(e){for(;this.m_CurrentLM!==null&&this.m_CurrentLM.Y==e;){var t=this.m_CurrentLM.LeftBound,r=this.m_CurrentLM.RightBound;this.PopLocalMinima();var n=null;if(t===null?(this.InsertEdgeIntoAEL(r,null),this.SetWindingCount(r),this.IsContributing(r)&&(n=this.AddOutPt(r,r.Bot))):r==null?(this.InsertEdgeIntoAEL(t,null),this.SetWindingCount(t),this.IsContributing(t)&&(n=this.AddOutPt(t,t.Bot)),this.InsertScanbeam(t.Top.Y)):(this.InsertEdgeIntoAEL(t,null),this.InsertEdgeIntoAEL(r,t),this.SetWindingCount(t),r.WindCnt=t.WindCnt,r.WindCnt2=t.WindCnt2,this.IsContributing(t)&&(n=this.AddLocalMinPoly(t,r,t.Bot)),this.InsertScanbeam(t.Top.Y)),r!=null&&(w.ClipperBase.IsHorizontal(r)?this.AddEdgeToSEL(r):this.InsertScanbeam(r.Top.Y)),!(t==null||r==null)){if(n!==null&&w.ClipperBase.IsHorizontal(r)&&this.m_GhostJoins.length>0&&r.WindDelta!==0)for(var i=0,s=this.m_GhostJoins.length;i<s;i++){var l=this.m_GhostJoins[i];this.HorzSegmentsOverlap(l.OutPt1.Pt,l.OffPt,r.Bot,r.Top)&&this.AddJoin(l.OutPt1,n,l.OffPt)}if(t.OutIdx>=0&&t.PrevInAEL!==null&&t.PrevInAEL.Curr.X==t.Bot.X&&t.PrevInAEL.OutIdx>=0&&w.ClipperBase.SlopesEqual(t.PrevInAEL,t,this.m_UseFullRange)&&t.WindDelta!==0&&t.PrevInAEL.WindDelta!==0){var c=this.AddOutPt(t.PrevInAEL,t.Bot);this.AddJoin(n,c,t.Top)}if(t.NextInAEL!=r){if(r.OutIdx>=0&&r.PrevInAEL.OutIdx>=0&&w.ClipperBase.SlopesEqual(r.PrevInAEL,r,this.m_UseFullRange)&&r.WindDelta!==0&&r.PrevInAEL.WindDelta!==0){var c=this.AddOutPt(r.PrevInAEL,r.Bot);this.AddJoin(n,c,r.Top)}var p=t.NextInAEL;if(p!==null)for(;p!=r;)this.IntersectEdges(r,p,t.Curr,!1),p=p.NextInAEL}}}};w.Clipper.prototype.InsertEdgeIntoAEL=function(e,t){if(this.m_ActiveEdges===null)e.PrevInAEL=null,e.NextInAEL=null,this.m_ActiveEdges=e;else if(t===null&&this.E2InsertsBeforeE1(this.m_ActiveEdges,e))e.PrevInAEL=null,e.NextInAEL=this.m_ActiveEdges,this.m_ActiveEdges.PrevInAEL=e,this.m_ActiveEdges=e;else{for(t===null&&(t=this.m_ActiveEdges);t.NextInAEL!==null&&!this.E2InsertsBeforeE1(t.NextInAEL,e);)t=t.NextInAEL;e.NextInAEL=t.NextInAEL,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=e),e.PrevInAEL=t,t.NextInAEL=e}};w.Clipper.prototype.E2InsertsBeforeE1=function(e,t){return t.Curr.X==e.Curr.X?t.Top.Y>e.Top.Y?t.Top.X<w.Clipper.TopX(e,t.Top.Y):e.Top.X>w.Clipper.TopX(t,e.Top.Y):t.Curr.X<e.Curr.X};w.Clipper.prototype.IsEvenOddFillType=function(e){return e.PolyTyp==w.PolyType.ptSubject?this.m_SubjFillType==w.PolyFillType.pftEvenOdd:this.m_ClipFillType==w.PolyFillType.pftEvenOdd};w.Clipper.prototype.IsEvenOddAltFillType=function(e){return e.PolyTyp==w.PolyType.ptSubject?this.m_ClipFillType==w.PolyFillType.pftEvenOdd:this.m_SubjFillType==w.PolyFillType.pftEvenOdd};w.Clipper.prototype.IsContributing=function(e){var t,r;switch(e.PolyTyp==w.PolyType.ptSubject?(t=this.m_SubjFillType,r=this.m_ClipFillType):(t=this.m_ClipFillType,r=this.m_SubjFillType),t){case w.PolyFillType.pftEvenOdd:if(e.WindDelta===0&&e.WindCnt!=1)return!1;break;case w.PolyFillType.pftNonZero:if(Math.abs(e.WindCnt)!=1)return!1;break;case w.PolyFillType.pftPositive:if(e.WindCnt!=1)return!1;break;default:if(e.WindCnt!=-1)return!1;break}switch(this.m_ClipType){case w.ClipType.ctIntersection:switch(r){case w.PolyFillType.pftEvenOdd:case w.PolyFillType.pftNonZero:return e.WindCnt2!==0;case w.PolyFillType.pftPositive:return e.WindCnt2>0;default:return e.WindCnt2<0}case w.ClipType.ctUnion:switch(r){case w.PolyFillType.pftEvenOdd:case w.PolyFillType.pftNonZero:return e.WindCnt2===0;case w.PolyFillType.pftPositive:return e.WindCnt2<=0;default:return e.WindCnt2>=0}case w.ClipType.ctDifference:if(e.PolyTyp==w.PolyType.ptSubject)switch(r){case w.PolyFillType.pftEvenOdd:case w.PolyFillType.pftNonZero:return e.WindCnt2===0;case w.PolyFillType.pftPositive:return e.WindCnt2<=0;default:return e.WindCnt2>=0}else switch(r){case w.PolyFillType.pftEvenOdd:case w.PolyFillType.pftNonZero:return e.WindCnt2!==0;case w.PolyFillType.pftPositive:return e.WindCnt2>0;default:return e.WindCnt2<0}case w.ClipType.ctXor:if(e.WindDelta===0)switch(r){case w.PolyFillType.pftEvenOdd:case w.PolyFillType.pftNonZero:return e.WindCnt2===0;case w.PolyFillType.pftPositive:return e.WindCnt2<=0;default:return e.WindCnt2>=0}else return!0}return!0};w.Clipper.prototype.SetWindingCount=function(e){for(var t=e.PrevInAEL;t!==null&&(t.PolyTyp!=e.PolyTyp||t.WindDelta===0);)t=t.PrevInAEL;if(t===null)e.WindCnt=e.WindDelta===0?1:e.WindDelta,e.WindCnt2=0,t=this.m_ActiveEdges;else if(e.WindDelta===0&&this.m_ClipType!=w.ClipType.ctUnion)e.WindCnt=1,e.WindCnt2=t.WindCnt2,t=t.NextInAEL;else if(this.IsEvenOddFillType(e)){if(e.WindDelta===0){for(var r=!0,n=t.PrevInAEL;n!==null;)n.PolyTyp==t.PolyTyp&&n.WindDelta!==0&&(r=!r),n=n.PrevInAEL;e.WindCnt=r?0:1}else e.WindCnt=e.WindDelta;e.WindCnt2=t.WindCnt2,t=t.NextInAEL}else t.WindCnt*t.WindDelta<0?Math.abs(t.WindCnt)>1?t.WindDelta*e.WindDelta<0?e.WindCnt=t.WindCnt:e.WindCnt=t.WindCnt+e.WindDelta:e.WindCnt=e.WindDelta===0?1:e.WindDelta:e.WindDelta===0?e.WindCnt=t.WindCnt<0?t.WindCnt-1:t.WindCnt+1:t.WindDelta*e.WindDelta<0?e.WindCnt=t.WindCnt:e.WindCnt=t.WindCnt+e.WindDelta,e.WindCnt2=t.WindCnt2,t=t.NextInAEL;if(this.IsEvenOddAltFillType(e))for(;t!=e;)t.WindDelta!==0&&(e.WindCnt2=e.WindCnt2===0?1:0),t=t.NextInAEL;else for(;t!=e;)e.WindCnt2+=t.WindDelta,t=t.NextInAEL};w.Clipper.prototype.AddEdgeToSEL=function(e){this.m_SortedEdges===null?(this.m_SortedEdges=e,e.PrevInSEL=null,e.NextInSEL=null):(e.NextInSEL=this.m_SortedEdges,e.PrevInSEL=null,this.m_SortedEdges.PrevInSEL=e,this.m_SortedEdges=e)};w.Clipper.prototype.CopyAELToSEL=function(){var e=this.m_ActiveEdges;for(this.m_SortedEdges=e;e!==null;)e.PrevInSEL=e.PrevInAEL,e.NextInSEL=e.NextInAEL,e=e.NextInAEL};w.Clipper.prototype.SwapPositionsInAEL=function(e,t){if(!(e.NextInAEL==e.PrevInAEL||t.NextInAEL==t.PrevInAEL)){if(e.NextInAEL==t){var r=t.NextInAEL;r!==null&&(r.PrevInAEL=e);var n=e.PrevInAEL;n!==null&&(n.NextInAEL=t),t.PrevInAEL=n,t.NextInAEL=e,e.PrevInAEL=t,e.NextInAEL=r}else if(t.NextInAEL==e){var r=e.NextInAEL;r!==null&&(r.PrevInAEL=t);var n=t.PrevInAEL;n!==null&&(n.NextInAEL=e),e.PrevInAEL=n,e.NextInAEL=t,t.PrevInAEL=e,t.NextInAEL=r}else{var r=e.NextInAEL,n=e.PrevInAEL;e.NextInAEL=t.NextInAEL,e.NextInAEL!==null&&(e.NextInAEL.PrevInAEL=e),e.PrevInAEL=t.PrevInAEL,e.PrevInAEL!==null&&(e.PrevInAEL.NextInAEL=e),t.NextInAEL=r,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=t),t.PrevInAEL=n,t.PrevInAEL!==null&&(t.PrevInAEL.NextInAEL=t)}e.PrevInAEL===null?this.m_ActiveEdges=e:t.PrevInAEL===null&&(this.m_ActiveEdges=t)}};w.Clipper.prototype.SwapPositionsInSEL=function(e,t){if(!(e.NextInSEL===null&&e.PrevInSEL===null)&&!(t.NextInSEL===null&&t.PrevInSEL===null)){if(e.NextInSEL==t){var r=t.NextInSEL;r!==null&&(r.PrevInSEL=e);var n=e.PrevInSEL;n!==null&&(n.NextInSEL=t),t.PrevInSEL=n,t.NextInSEL=e,e.PrevInSEL=t,e.NextInSEL=r}else if(t.NextInSEL==e){var r=e.NextInSEL;r!==null&&(r.PrevInSEL=t);var n=t.PrevInSEL;n!==null&&(n.NextInSEL=e),e.PrevInSEL=n,e.NextInSEL=t,t.PrevInSEL=e,t.NextInSEL=r}else{var r=e.NextInSEL,n=e.PrevInSEL;e.NextInSEL=t.NextInSEL,e.NextInSEL!==null&&(e.NextInSEL.PrevInSEL=e),e.PrevInSEL=t.PrevInSEL,e.PrevInSEL!==null&&(e.PrevInSEL.NextInSEL=e),t.NextInSEL=r,t.NextInSEL!==null&&(t.NextInSEL.PrevInSEL=t),t.PrevInSEL=n,t.PrevInSEL!==null&&(t.PrevInSEL.NextInSEL=t)}e.PrevInSEL===null?this.m_SortedEdges=e:t.PrevInSEL===null&&(this.m_SortedEdges=t)}};w.Clipper.prototype.AddLocalMaxPoly=function(e,t,r){this.AddOutPt(e,r),t.WindDelta==0&&this.AddOutPt(t,r),e.OutIdx==t.OutIdx?(e.OutIdx=-1,t.OutIdx=-1):e.OutIdx<t.OutIdx?this.AppendPolygon(e,t):this.AppendPolygon(t,e)};w.Clipper.prototype.AddLocalMinPoly=function(e,t,r){var n,i,s;if(w.ClipperBase.IsHorizontal(t)||e.Dx>t.Dx?(n=this.AddOutPt(e,r),t.OutIdx=e.OutIdx,e.Side=w.EdgeSide.esLeft,t.Side=w.EdgeSide.esRight,i=e,i.PrevInAEL==t?s=t.PrevInAEL:s=i.PrevInAEL):(n=this.AddOutPt(t,r),e.OutIdx=t.OutIdx,e.Side=w.EdgeSide.esRight,t.Side=w.EdgeSide.esLeft,i=t,i.PrevInAEL==e?s=e.PrevInAEL:s=i.PrevInAEL),s!==null&&s.OutIdx>=0&&w.Clipper.TopX(s,r.Y)==w.Clipper.TopX(i,r.Y)&&w.ClipperBase.SlopesEqual(i,s,this.m_UseFullRange)&&i.WindDelta!==0&&s.WindDelta!==0){var l=this.AddOutPt(s,r);this.AddJoin(n,l,i.Top)}return n};w.Clipper.prototype.CreateOutRec=function(){var e=new w.OutRec;return e.Idx=-1,e.IsHole=!1,e.IsOpen=!1,e.FirstLeft=null,e.Pts=null,e.BottomPt=null,e.PolyNode=null,this.m_PolyOuts.push(e),e.Idx=this.m_PolyOuts.length-1,e};w.Clipper.prototype.AddOutPt=function(e,t){var r=e.Side==w.EdgeSide.esLeft;if(e.OutIdx<0){var n=this.CreateOutRec();n.IsOpen=e.WindDelta===0;var i=new w.OutPt;return n.Pts=i,i.Idx=n.Idx,i.Pt.X=t.X,i.Pt.Y=t.Y,i.Next=i,i.Prev=i,n.IsOpen||this.SetHoleState(e,n),sy&&(w.IntPoint.op_Equality(t,e.Bot)?(i.Pt.X=e.Bot.X,i.Pt.Y=e.Bot.Y,i.Pt.Z=e.Bot.Z):w.IntPoint.op_Equality(t,e.Top)?(i.Pt.X=e.Top.X,i.Pt.Y=e.Top.Y,i.Pt.Z=e.Top.Z):this.SetZ(i.Pt,e)),e.OutIdx=n.Idx,i}else{var n=this.m_PolyOuts[e.OutIdx],s=n.Pts;if(r&&w.IntPoint.op_Equality(t,s.Pt))return s;if(!r&&w.IntPoint.op_Equality(t,s.Prev.Pt))return s.Prev;var i=new w.OutPt;return i.Idx=n.Idx,i.Pt.X=t.X,i.Pt.Y=t.Y,i.Next=s,i.Prev=s.Prev,i.Prev.Next=i,s.Prev=i,r&&(n.Pts=i),sy&&(w.IntPoint.op_Equality(t,e.Bot)?(i.Pt.X=e.Bot.X,i.Pt.Y=e.Bot.Y,i.Pt.Z=e.Bot.Z):w.IntPoint.op_Equality(t,e.Top)?(i.Pt.X=e.Top.X,i.Pt.Y=e.Top.Y,i.Pt.Z=e.Top.Z):this.SetZ(i.Pt,e)),i}};w.Clipper.prototype.SwapPoints=function(e,t){var r=new w.IntPoint(e.Value);e.Value.X=t.Value.X,e.Value.Y=t.Value.Y,t.Value.X=r.X,t.Value.Y=r.Y};w.Clipper.prototype.HorzSegmentsOverlap=function(e,t,r,n){return e.X>r.X==e.X<n.X||t.X>r.X==t.X<n.X||r.X>e.X==r.X<t.X||n.X>e.X==n.X<t.X||e.X==r.X&&t.X==n.X?!0:e.X==n.X&&t.X==r.X};w.Clipper.prototype.InsertPolyPtBetween=function(e,t,r){var n=new w.OutPt;return n.Pt.X=r.X,n.Pt.Y=r.Y,t==e.Next?(e.Next=n,t.Prev=n,n.Next=t,n.Prev=e):(t.Next=n,e.Prev=n,n.Next=e,n.Prev=t),n};w.Clipper.prototype.SetHoleState=function(e,t){for(var r=!1,n=e.PrevInAEL;n!==null;)n.OutIdx>=0&&n.WindDelta!=0&&(r=!r,t.FirstLeft===null&&(t.FirstLeft=this.m_PolyOuts[n.OutIdx])),n=n.PrevInAEL;r&&(t.IsHole=!0)};w.Clipper.prototype.GetDx=function(e,t){return e.Y==t.Y?w.ClipperBase.horizontal:(t.X-e.X)/(t.Y-e.Y)};w.Clipper.prototype.FirstIsBottomPt=function(e,t){for(var r=e.Prev;w.IntPoint.op_Equality(r.Pt,e.Pt)&&r!=e;)r=r.Prev;var n=Math.abs(this.GetDx(e.Pt,r.Pt));for(r=e.Next;w.IntPoint.op_Equality(r.Pt,e.Pt)&&r!=e;)r=r.Next;var i=Math.abs(this.GetDx(e.Pt,r.Pt));for(r=t.Prev;w.IntPoint.op_Equality(r.Pt,t.Pt)&&r!=t;)r=r.Prev;var s=Math.abs(this.GetDx(t.Pt,r.Pt));for(r=t.Next;w.IntPoint.op_Equality(r.Pt,t.Pt)&&r!=t;)r=r.Next;var l=Math.abs(this.GetDx(t.Pt,r.Pt));return n>=s&&n>=l||i>=s&&i>=l};w.Clipper.prototype.GetBottomPt=function(e){for(var t=null,r=e.Next;r!=e;)r.Pt.Y>e.Pt.Y?(e=r,t=null):r.Pt.Y==e.Pt.Y&&r.Pt.X<=e.Pt.X&&(r.Pt.X<e.Pt.X?(t=null,e=r):r.Next!=e&&r.Prev!=e&&(t=r)),r=r.Next;if(t!==null)for(;t!=r;)for(this.FirstIsBottomPt(r,t)||(e=t),t=t.Next;w.IntPoint.op_Inequality(t.Pt,e.Pt);)t=t.Next;return e};w.Clipper.prototype.GetLowermostRec=function(e,t){e.BottomPt===null&&(e.BottomPt=this.GetBottomPt(e.Pts)),t.BottomPt===null&&(t.BottomPt=this.GetBottomPt(t.Pts));var r=e.BottomPt,n=t.BottomPt;return r.Pt.Y>n.Pt.Y?e:r.Pt.Y<n.Pt.Y?t:r.Pt.X<n.Pt.X?e:r.Pt.X>n.Pt.X||r.Next==r?t:n.Next==n||this.FirstIsBottomPt(r,n)?e:t};w.Clipper.prototype.Param1RightOfParam2=function(e,t){do if(e=e.FirstLeft,e==t)return!0;while(e!==null);return!1};w.Clipper.prototype.GetOutRec=function(e){for(var t=this.m_PolyOuts[e];t!=this.m_PolyOuts[t.Idx];)t=this.m_PolyOuts[t.Idx];return t};w.Clipper.prototype.AppendPolygon=function(e,t){var r=this.m_PolyOuts[e.OutIdx],n=this.m_PolyOuts[t.OutIdx],i;this.Param1RightOfParam2(r,n)?i=n:this.Param1RightOfParam2(n,r)?i=r:i=this.GetLowermostRec(r,n);var s=r.Pts,l=s.Prev,c=n.Pts,p=c.Prev,h;e.Side==w.EdgeSide.esLeft?(t.Side==w.EdgeSide.esLeft?(this.ReversePolyPtLinks(c),c.Next=s,s.Prev=c,l.Next=p,p.Prev=l,r.Pts=p):(p.Next=s,s.Prev=p,c.Prev=l,l.Next=c,r.Pts=c),h=w.EdgeSide.esLeft):(t.Side==w.EdgeSide.esRight?(this.ReversePolyPtLinks(c),l.Next=p,p.Prev=l,c.Next=s,s.Prev=c):(l.Next=c,c.Prev=l,s.Prev=p,p.Next=s),h=w.EdgeSide.esRight),r.BottomPt=null,i==n&&(n.FirstLeft!=r&&(r.FirstLeft=n.FirstLeft),r.IsHole=n.IsHole),n.Pts=null,n.BottomPt=null,n.FirstLeft=r;var y=e.OutIdx,b=t.OutIdx;e.OutIdx=-1,t.OutIdx=-1;for(var _=this.m_ActiveEdges;_!==null;){if(_.OutIdx==b){_.OutIdx=y,_.Side=h;break}_=_.NextInAEL}n.Idx=r.Idx};w.Clipper.prototype.ReversePolyPtLinks=function(e){if(e!==null){var t,r;t=e;do r=t.Next,t.Next=t.Prev,t.Prev=r,t=r;while(t!=e)}};w.Clipper.SwapSides=function(e,t){var r=e.Side;e.Side=t.Side,t.Side=r};w.Clipper.SwapPolyIndexes=function(e,t){var r=e.OutIdx;e.OutIdx=t.OutIdx,t.OutIdx=r};w.Clipper.prototype.IntersectEdges=function(e,t,r,n){var i=!n&&e.NextInLML===null&&e.Top.X==r.X&&e.Top.Y==r.Y,s=!n&&t.NextInLML===null&&t.Top.X==r.X&&t.Top.Y==r.Y,l=e.OutIdx>=0,c=t.OutIdx>=0;if(bie&&(e.WindDelta===0||t.WindDelta===0)){e.WindDelta===0&&t.WindDelta===0?(i||s)&&l&&c&&this.AddLocalMaxPoly(e,t,r):e.PolyTyp==t.PolyTyp&&e.WindDelta!=t.WindDelta&&this.m_ClipType==w.ClipType.ctUnion?e.WindDelta===0?c&&(this.AddOutPt(e,r),l&&(e.OutIdx=-1)):l&&(this.AddOutPt(t,r),c&&(t.OutIdx=-1)):e.PolyTyp!=t.PolyTyp&&(e.WindDelta===0&&Math.abs(t.WindCnt)==1&&(this.m_ClipType!=w.ClipType.ctUnion||t.WindCnt2===0)?(this.AddOutPt(e,r),l&&(e.OutIdx=-1)):t.WindDelta===0&&Math.abs(e.WindCnt)==1&&(this.m_ClipType!=w.ClipType.ctUnion||e.WindCnt2===0)&&(this.AddOutPt(t,r),c&&(t.OutIdx=-1))),i&&(e.OutIdx<0?this.DeleteFromAEL(e):w.Error("Error intersecting polylines")),s&&(t.OutIdx<0?this.DeleteFromAEL(t):w.Error("Error intersecting polylines"));return}if(e.PolyTyp==t.PolyTyp)if(this.IsEvenOddFillType(e)){var p=e.WindCnt;e.WindCnt=t.WindCnt,t.WindCnt=p}else e.WindCnt+t.WindDelta===0?e.WindCnt=-e.WindCnt:e.WindCnt+=t.WindDelta,t.WindCnt-e.WindDelta===0?t.WindCnt=-t.WindCnt:t.WindCnt-=e.WindDelta;else this.IsEvenOddFillType(t)?e.WindCnt2=e.WindCnt2===0?1:0:e.WindCnt2+=t.WindDelta,this.IsEvenOddFillType(e)?t.WindCnt2=t.WindCnt2===0?1:0:t.WindCnt2-=e.WindDelta;var h,y,b,_;e.PolyTyp==w.PolyType.ptSubject?(h=this.m_SubjFillType,b=this.m_ClipFillType):(h=this.m_ClipFillType,b=this.m_SubjFillType),t.PolyTyp==w.PolyType.ptSubject?(y=this.m_SubjFillType,_=this.m_ClipFillType):(y=this.m_ClipFillType,_=this.m_SubjFillType);var C,P;switch(h){case w.PolyFillType.pftPositive:C=e.WindCnt;break;case w.PolyFillType.pftNegative:C=-e.WindCnt;break;default:C=Math.abs(e.WindCnt);break}switch(y){case w.PolyFillType.pftPositive:P=t.WindCnt;break;case w.PolyFillType.pftNegative:P=-t.WindCnt;break;default:P=Math.abs(t.WindCnt);break}if(l&&c)i||s||C!==0&&C!=1||P!==0&&P!=1||e.PolyTyp!=t.PolyTyp&&this.m_ClipType!=w.ClipType.ctXor?this.AddLocalMaxPoly(e,t,r):(this.AddOutPt(e,r),this.AddOutPt(t,r),w.Clipper.SwapSides(e,t),w.Clipper.SwapPolyIndexes(e,t));else if(l)(P===0||P==1)&&(this.AddOutPt(e,r),w.Clipper.SwapSides(e,t),w.Clipper.SwapPolyIndexes(e,t));else if(c)(C===0||C==1)&&(this.AddOutPt(t,r),w.Clipper.SwapSides(e,t),w.Clipper.SwapPolyIndexes(e,t));else if((C===0||C==1)&&(P===0||P==1)&&!i&&!s){var E,T;switch(b){case w.PolyFillType.pftPositive:E=e.WindCnt2;break;case w.PolyFillType.pftNegative:E=-e.WindCnt2;break;default:E=Math.abs(e.WindCnt2);break}switch(_){case w.PolyFillType.pftPositive:T=t.WindCnt2;break;case w.PolyFillType.pftNegative:T=-t.WindCnt2;break;default:T=Math.abs(t.WindCnt2);break}if(e.PolyTyp!=t.PolyTyp)this.AddLocalMinPoly(e,t,r);else if(C==1&&P==1)switch(this.m_ClipType){case w.ClipType.ctIntersection:E>0&&T>0&&this.AddLocalMinPoly(e,t,r);break;case w.ClipType.ctUnion:E<=0&&T<=0&&this.AddLocalMinPoly(e,t,r);break;case w.ClipType.ctDifference:(e.PolyTyp==w.PolyType.ptClip&&E>0&&T>0||e.PolyTyp==w.PolyType.ptSubject&&E<=0&&T<=0)&&this.AddLocalMinPoly(e,t,r);break;case w.ClipType.ctXor:this.AddLocalMinPoly(e,t,r);break}else w.Clipper.SwapSides(e,t)}i!=s&&(i&&e.OutIdx>=0||s&&t.OutIdx>=0)&&(w.Clipper.SwapSides(e,t),w.Clipper.SwapPolyIndexes(e,t)),i&&this.DeleteFromAEL(e),s&&this.DeleteFromAEL(t)};w.Clipper.prototype.DeleteFromAEL=function(e){var t=e.PrevInAEL,r=e.NextInAEL;t===null&&r===null&&e!=this.m_ActiveEdges||(t!==null?t.NextInAEL=r:this.m_ActiveEdges=r,r!==null&&(r.PrevInAEL=t),e.NextInAEL=null,e.PrevInAEL=null)};w.Clipper.prototype.DeleteFromSEL=function(e){var t=e.PrevInSEL,r=e.NextInSEL;t===null&&r===null&&e!=this.m_SortedEdges||(t!==null?t.NextInSEL=r:this.m_SortedEdges=r,r!==null&&(r.PrevInSEL=t),e.NextInSEL=null,e.PrevInSEL=null)};w.Clipper.prototype.UpdateEdgeIntoAEL=function(e){e.NextInLML===null&&w.Error("UpdateEdgeIntoAEL: invalid call");var t=e.PrevInAEL,r=e.NextInAEL;return e.NextInLML.OutIdx=e.OutIdx,t!==null?t.NextInAEL=e.NextInLML:this.m_ActiveEdges=e.NextInLML,r!==null&&(r.PrevInAEL=e.NextInLML),e.NextInLML.Side=e.Side,e.NextInLML.WindDelta=e.WindDelta,e.NextInLML.WindCnt=e.WindCnt,e.NextInLML.WindCnt2=e.WindCnt2,e=e.NextInLML,e.Curr.X=e.Bot.X,e.Curr.Y=e.Bot.Y,e.PrevInAEL=t,e.NextInAEL=r,w.ClipperBase.IsHorizontal(e)||this.InsertScanbeam(e.Top.Y),e};w.Clipper.prototype.ProcessHorizontals=function(e){for(var t=this.m_SortedEdges;t!==null;)this.DeleteFromSEL(t),this.ProcessHorizontal(t,e),t=this.m_SortedEdges};w.Clipper.prototype.GetHorzDirection=function(e,t){e.Bot.X<e.Top.X?(t.Left=e.Bot.X,t.Right=e.Top.X,t.Dir=w.Direction.dLeftToRight):(t.Left=e.Top.X,t.Right=e.Bot.X,t.Dir=w.Direction.dRightToLeft)};w.Clipper.prototype.PrepareHorzJoins=function(e,t){var r=this.m_PolyOuts[e.OutIdx].Pts;e.Side!=w.EdgeSide.esLeft&&(r=r.Prev),t&&(w.IntPoint.op_Equality(r.Pt,e.Top)?this.AddGhostJoin(r,e.Bot):this.AddGhostJoin(r,e.Top))};w.Clipper.prototype.ProcessHorizontal=function(e,t){var r={Dir:null,Left:null,Right:null};this.GetHorzDirection(e,r);for(var n=r.Dir,i=r.Left,s=r.Right,l=e,c=null;l.NextInLML!==null&&w.ClipperBase.IsHorizontal(l.NextInLML);)l=l.NextInLML;for(l.NextInLML===null&&(c=this.GetMaximaPair(l));;){for(var p=e==l,h=this.GetNextInAEL(e,n);h!==null&&!(h.Curr.X==e.Top.X&&e.NextInLML!==null&&h.Dx<e.NextInLML.Dx);){var y=this.GetNextInAEL(h,n);if(n==w.Direction.dLeftToRight&&h.Curr.X<=s||n==w.Direction.dRightToLeft&&h.Curr.X>=i){if(e.OutIdx>=0&&e.WindDelta!=0&&this.PrepareHorzJoins(e,t),h==c&&p){n==w.Direction.dLeftToRight?this.IntersectEdges(e,h,h.Top,!1):this.IntersectEdges(h,e,h.Top,!1),c.OutIdx>=0&&w.Error("ProcessHorizontal error");return}else if(n==w.Direction.dLeftToRight){var b=new w.IntPoint(h.Curr.X,e.Curr.Y);this.IntersectEdges(e,h,b,!0)}else{var b=new w.IntPoint(h.Curr.X,e.Curr.Y);this.IntersectEdges(h,e,b,!0)}this.SwapPositionsInAEL(e,h)}else if(n==w.Direction.dLeftToRight&&h.Curr.X>=s||n==w.Direction.dRightToLeft&&h.Curr.X<=i)break;h=y}if(e.OutIdx>=0&&e.WindDelta!==0&&this.PrepareHorzJoins(e,t),e.NextInLML!==null&&w.ClipperBase.IsHorizontal(e.NextInLML)){e=this.UpdateEdgeIntoAEL(e),e.OutIdx>=0&&this.AddOutPt(e,e.Bot);var r={Dir:n,Left:i,Right:s};this.GetHorzDirection(e,r),n=r.Dir,i=r.Left,s=r.Right}else break}if(e.NextInLML!==null)if(e.OutIdx>=0){var _=this.AddOutPt(e,e.Top);if(e=this.UpdateEdgeIntoAEL(e),e.WindDelta===0)return;var C=e.PrevInAEL,y=e.NextInAEL;if(C!==null&&C.Curr.X==e.Bot.X&&C.Curr.Y==e.Bot.Y&&C.WindDelta!==0&&C.OutIdx>=0&&C.Curr.Y>C.Top.Y&&w.ClipperBase.SlopesEqual(e,C,this.m_UseFullRange)){var P=this.AddOutPt(C,e.Bot);this.AddJoin(_,P,e.Top)}else if(y!==null&&y.Curr.X==e.Bot.X&&y.Curr.Y==e.Bot.Y&&y.WindDelta!==0&&y.OutIdx>=0&&y.Curr.Y>y.Top.Y&&w.ClipperBase.SlopesEqual(e,y,this.m_UseFullRange)){var P=this.AddOutPt(y,e.Bot);this.AddJoin(_,P,e.Top)}}else e=this.UpdateEdgeIntoAEL(e);else c!==null?c.OutIdx>=0?(n==w.Direction.dLeftToRight?this.IntersectEdges(e,c,e.Top,!1):this.IntersectEdges(c,e,e.Top,!1),c.OutIdx>=0&&w.Error("ProcessHorizontal error")):(this.DeleteFromAEL(e),this.DeleteFromAEL(c)):(e.OutIdx>=0&&this.AddOutPt(e,e.Top),this.DeleteFromAEL(e))};w.Clipper.prototype.GetNextInAEL=function(e,t){return t==w.Direction.dLeftToRight?e.NextInAEL:e.PrevInAEL};w.Clipper.prototype.IsMinima=function(e){return e!==null&&e.Prev.NextInLML!=e&&e.Next.NextInLML!=e};w.Clipper.prototype.IsMaxima=function(e,t){return e!==null&&e.Top.Y==t&&e.NextInLML===null};w.Clipper.prototype.IsIntermediate=function(e,t){return e.Top.Y==t&&e.NextInLML!==null};w.Clipper.prototype.GetMaximaPair=function(e){var t=null;return w.IntPoint.op_Equality(e.Next.Top,e.Top)&&e.Next.NextInLML===null?t=e.Next:w.IntPoint.op_Equality(e.Prev.Top,e.Top)&&e.Prev.NextInLML===null&&(t=e.Prev),t!==null&&(t.OutIdx==-2||t.NextInAEL==t.PrevInAEL&&!w.ClipperBase.IsHorizontal(t))?null:t};w.Clipper.prototype.ProcessIntersections=function(e,t){if(this.m_ActiveEdges==null)return!0;try{if(this.BuildIntersectList(e,t),this.m_IntersectList.length==0)return!0;if(this.m_IntersectList.length==1||this.FixupIntersectionOrder())this.ProcessIntersectList();else return!1}catch(r){this.m_SortedEdges=null,this.m_IntersectList.length=0,w.Error("ProcessIntersections error")}return this.m_SortedEdges=null,!0};w.Clipper.prototype.BuildIntersectList=function(e,t){if(this.m_ActiveEdges!==null){var r=this.m_ActiveEdges;for(this.m_SortedEdges=r;r!==null;)r.PrevInSEL=r.PrevInAEL,r.NextInSEL=r.NextInAEL,r.Curr.X=w.Clipper.TopX(r,t),r=r.NextInAEL;for(var n=!0;n&&this.m_SortedEdges!==null;){for(n=!1,r=this.m_SortedEdges;r.NextInSEL!==null;){var i=r.NextInSEL,s=new w.IntPoint;if(r.Curr.X>i.Curr.X){!this.IntersectPoint(r,i,s)&&r.Curr.X>i.Curr.X+1&&w.Error("Intersection error"),s.Y>e&&(s.Y=e,Math.abs(r.Dx)>Math.abs(i.Dx)?s.X=w.Clipper.TopX(i,e):s.X=w.Clipper.TopX(r,e));var l=new w.IntersectNode;l.Edge1=r,l.Edge2=i,l.Pt.X=s.X,l.Pt.Y=s.Y,this.m_IntersectList.push(l),this.SwapPositionsInSEL(r,i),n=!0}else r=i}if(r.PrevInSEL!==null)r.PrevInSEL.NextInSEL=null;else break}this.m_SortedEdges=null}};w.Clipper.prototype.EdgesAdjacent=function(e){return e.Edge1.NextInSEL==e.Edge2||e.Edge1.PrevInSEL==e.Edge2};w.Clipper.IntersectNodeSort=function(e,t){return t.Pt.Y-e.Pt.Y};w.Clipper.prototype.FixupIntersectionOrder=function(){this.m_IntersectList.sort(this.m_IntersectNodeComparer),this.CopyAELToSEL();for(var e=this.m_IntersectList.length,t=0;t<e;t++){if(!this.EdgesAdjacent(this.m_IntersectList[t])){for(var r=t+1;r<e&&!this.EdgesAdjacent(this.m_IntersectList[r]);)r++;if(r==e)return!1;var n=this.m_IntersectList[t];this.m_IntersectList[t]=this.m_IntersectList[r],this.m_IntersectList[r]=n}this.SwapPositionsInSEL(this.m_IntersectList[t].Edge1,this.m_IntersectList[t].Edge2)}return!0};w.Clipper.prototype.ProcessIntersectList=function(){for(var e=0,t=this.m_IntersectList.length;e<t;e++){var r=this.m_IntersectList[e];this.IntersectEdges(r.Edge1,r.Edge2,r.Pt,!0),this.SwapPositionsInAEL(r.Edge1,r.Edge2)}this.m_IntersectList.length=0};var rLe=o(function(e){return e<0?Math.ceil(e-.5):Math.round(e)},"R1"),nLe=o(function(e){return e<0?Math.ceil(e-.5):Math.floor(e+.5)},"R2"),iLe=o(function(e){return e<0?-Math.round(Math.abs(e)):Math.round(e)},"R3"),oLe=o(function(e){return e<0?(e-=.5,e<-2147483648?Math.ceil(e):e|0):(e+=.5,e>2147483647?Math.floor(e):e|0)},"R4");qr.msie?w.Clipper.Round=rLe:qr.chromium?w.Clipper.Round=iLe:qr.safari?w.Clipper.Round=oLe:w.Clipper.Round=nLe;w.Clipper.TopX=function(e,t){return t==e.Top.Y?e.Top.X:e.Bot.X+w.Clipper.Round(e.Dx*(t-e.Bot.Y))};w.Clipper.prototype.IntersectPoint=function(e,t,r){r.X=0,r.Y=0;var n,i;if(w.ClipperBase.SlopesEqual(e,t,this.m_UseFullRange)||e.Dx==t.Dx)return t.Bot.Y>e.Bot.Y?(r.X=t.Bot.X,r.Y=t.Bot.Y):(r.X=e.Bot.X,r.Y=e.Bot.Y),!1;if(e.Delta.X===0)r.X=e.Bot.X,w.ClipperBase.IsHorizontal(t)?r.Y=t.Bot.Y:(i=t.Bot.Y-t.Bot.X/t.Dx,r.Y=w.Clipper.Round(r.X/t.Dx+i));else if(t.Delta.X===0)r.X=t.Bot.X,w.ClipperBase.IsHorizontal(e)?r.Y=e.Bot.Y:(n=e.Bot.Y-e.Bot.X/e.Dx,r.Y=w.Clipper.Round(r.X/e.Dx+n));else{n=e.Bot.X-e.Bot.Y*e.Dx,i=t.Bot.X-t.Bot.Y*t.Dx;var s=(i-n)/(e.Dx-t.Dx);r.Y=w.Clipper.Round(s),Math.abs(e.Dx)<Math.abs(t.Dx)?r.X=w.Clipper.Round(e.Dx*s+n):r.X=w.Clipper.Round(t.Dx*s+i)}if(r.Y<e.Top.Y||r.Y<t.Top.Y){if(e.Top.Y>t.Top.Y)return r.Y=e.Top.Y,r.X=w.Clipper.TopX(t,e.Top.Y),r.X<e.Top.X;r.Y=t.Top.Y,Math.abs(e.Dx)<Math.abs(t.Dx)?r.X=w.Clipper.TopX(e,r.Y):r.X=w.Clipper.TopX(t,r.Y)}return!0};w.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(e){for(var t=this.m_ActiveEdges;t!==null;){var r=this.IsMaxima(t,e);if(r){var n=this.GetMaximaPair(t);r=n===null||!w.ClipperBase.IsHorizontal(n)}if(r){var i=t.PrevInAEL;this.DoMaxima(t),i===null?t=this.m_ActiveEdges:t=i.NextInAEL}else{if(this.IsIntermediate(t,e)&&w.ClipperBase.IsHorizontal(t.NextInLML)?(t=this.UpdateEdgeIntoAEL(t),t.OutIdx>=0&&this.AddOutPt(t,t.Bot),this.AddEdgeToSEL(t)):(t.Curr.X=w.Clipper.TopX(t,e),t.Curr.Y=e),this.StrictlySimple){var i=t.PrevInAEL;if(t.OutIdx>=0&&t.WindDelta!==0&&i!==null&&i.OutIdx>=0&&i.Curr.X==t.Curr.X&&i.WindDelta!==0){var s=this.AddOutPt(i,t.Curr),l=this.AddOutPt(t,t.Curr);this.AddJoin(s,l,t.Curr)}}t=t.NextInAEL}}for(this.ProcessHorizontals(!0),t=this.m_ActiveEdges;t!==null;){if(this.IsIntermediate(t,e)){var s=null;t.OutIdx>=0&&(s=this.AddOutPt(t,t.Top)),t=this.UpdateEdgeIntoAEL(t);var i=t.PrevInAEL,c=t.NextInAEL;if(i!==null&&i.Curr.X==t.Bot.X&&i.Curr.Y==t.Bot.Y&&s!==null&&i.OutIdx>=0&&i.Curr.Y>i.Top.Y&&w.ClipperBase.SlopesEqual(t,i,this.m_UseFullRange)&&t.WindDelta!==0&&i.WindDelta!==0){var l=this.AddOutPt(i,t.Bot);this.AddJoin(s,l,t.Top)}else if(c!==null&&c.Curr.X==t.Bot.X&&c.Curr.Y==t.Bot.Y&&s!==null&&c.OutIdx>=0&&c.Curr.Y>c.Top.Y&&w.ClipperBase.SlopesEqual(t,c,this.m_UseFullRange)&&t.WindDelta!==0&&c.WindDelta!==0){var l=this.AddOutPt(c,t.Bot);this.AddJoin(s,l,t.Top)}}t=t.NextInAEL}};w.Clipper.prototype.DoMaxima=function(e){var t=this.GetMaximaPair(e);if(t===null){e.OutIdx>=0&&this.AddOutPt(e,e.Top),this.DeleteFromAEL(e);return}for(var r=e.NextInAEL,n=!0;r!==null&&r!=t;)this.IntersectEdges(e,r,e.Top,!0),this.SwapPositionsInAEL(e,r),r=e.NextInAEL;e.OutIdx==-1&&t.OutIdx==-1?(this.DeleteFromAEL(e),this.DeleteFromAEL(t)):e.OutIdx>=0&&t.OutIdx>=0?this.IntersectEdges(e,t,e.Top,!1):n&&e.WindDelta===0?(e.OutIdx>=0&&(this.AddOutPt(e,e.Top),e.OutIdx=-1),this.DeleteFromAEL(e),t.OutIdx>=0&&(this.AddOutPt(t,e.Top),t.OutIdx=-1),this.DeleteFromAEL(t)):w.Error("DoMaxima error")};w.Clipper.ReversePaths=function(e){for(var t=0,r=e.length;t<r;t++)e[t].reverse()};w.Clipper.Orientation=function(e){return w.Clipper.Area(e)>=0};w.Clipper.prototype.PointCount=function(e){if(e===null)return 0;var t=0,r=e;do t++,r=r.Next;while(r!=e);return t};w.Clipper.prototype.BuildResult=function(e){w.Clear(e);for(var t=0,r=this.m_PolyOuts.length;t<r;t++){var n=this.m_PolyOuts[t];if(n.Pts!==null){var i=n.Pts.Prev,s=this.PointCount(i);if(!(s<2)){for(var l=new Array(s),c=0;c<s;c++)l[c]=i.Pt,i=i.Prev;e.push(l)}}}};w.Clipper.prototype.BuildResult2=function(e){e.Clear();for(var t=0,r=this.m_PolyOuts.length;t<r;t++){var n=this.m_PolyOuts[t],i=this.PointCount(n.Pts);if(!(n.IsOpen&&i<2||!n.IsOpen&&i<3)){this.FixHoleLinkage(n);var s=new w.PolyNode;e.m_AllPolys.push(s),n.PolyNode=s,s.m_polygon.length=i;for(var l=n.Pts.Prev,c=0;c<i;c++)s.m_polygon[c]=l.Pt,l=l.Prev}}for(var t=0,r=this.m_PolyOuts.length;t<r;t++){var n=this.m_PolyOuts[t];n.PolyNode!==null&&(n.IsOpen?(n.PolyNode.IsOpen=!0,e.AddChild(n.PolyNode)):n.FirstLeft!==null&&n.FirstLeft.PolyNode!=null?n.FirstLeft.PolyNode.AddChild(n.PolyNode):e.AddChild(n.PolyNode))}};w.Clipper.prototype.FixupOutPolygon=function(e){var t=null;e.BottomPt=null;for(var r=e.Pts;;){if(r.Prev==r||r.Prev==r.Next){this.DisposeOutPts(r),e.Pts=null;return}if(w.IntPoint.op_Equality(r.Pt,r.Next.Pt)||w.IntPoint.op_Equality(r.Pt,r.Prev.Pt)||w.ClipperBase.SlopesEqual(r.Prev.Pt,r.Pt,r.Next.Pt,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(r.Prev.Pt,r.Pt,r.Next.Pt))){t=null;var n=r;r.Prev.Next=r.Next,r.Next.Prev=r.Prev,r=r.Prev,n=null}else{if(r==t)break;t===null&&(t=r),r=r.Next}}e.Pts=r};w.Clipper.prototype.DupOutPt=function(e,t){var r=new w.OutPt;return r.Pt.X=e.Pt.X,r.Pt.Y=e.Pt.Y,r.Idx=e.Idx,t?(r.Next=e.Next,r.Prev=e,e.Next.Prev=r,e.Next=r):(r.Prev=e.Prev,r.Next=e,e.Prev.Next=r,e.Prev=r),r};w.Clipper.prototype.GetOverlap=function(e,t,r,n,i){return e<t?r<n?(i.Left=Math.max(e,r),i.Right=Math.min(t,n)):(i.Left=Math.max(e,n),i.Right=Math.min(t,r)):r<n?(i.Left=Math.max(t,r),i.Right=Math.min(e,n)):(i.Left=Math.max(t,n),i.Right=Math.min(e,r)),i.Left<i.Right};w.Clipper.prototype.JoinHorz=function(e,t,r,n,i,s){var l=e.Pt.X>t.Pt.X?w.Direction.dRightToLeft:w.Direction.dLeftToRight,c=r.Pt.X>n.Pt.X?w.Direction.dRightToLeft:w.Direction.dLeftToRight;if(l==c)return!1;if(l==w.Direction.dLeftToRight){for(;e.Next.Pt.X<=i.X&&e.Next.Pt.X>=e.Pt.X&&e.Next.Pt.Y==i.Y;)e=e.Next;s&&e.Pt.X!=i.X&&(e=e.Next),t=this.DupOutPt(e,!s),w.IntPoint.op_Inequality(t.Pt,i)&&(e=t,e.Pt.X=i.X,e.Pt.Y=i.Y,t=this.DupOutPt(e,!s))}else{for(;e.Next.Pt.X>=i.X&&e.Next.Pt.X<=e.Pt.X&&e.Next.Pt.Y==i.Y;)e=e.Next;!s&&e.Pt.X!=i.X&&(e=e.Next),t=this.DupOutPt(e,s),w.IntPoint.op_Inequality(t.Pt,i)&&(e=t,e.Pt.X=i.X,e.Pt.Y=i.Y,t=this.DupOutPt(e,s))}if(c==w.Direction.dLeftToRight){for(;r.Next.Pt.X<=i.X&&r.Next.Pt.X>=r.Pt.X&&r.Next.Pt.Y==i.Y;)r=r.Next;s&&r.Pt.X!=i.X&&(r=r.Next),n=this.DupOutPt(r,!s),w.IntPoint.op_Inequality(n.Pt,i)&&(r=n,r.Pt.X=i.X,r.Pt.Y=i.Y,n=this.DupOutPt(r,!s))}else{for(;r.Next.Pt.X>=i.X&&r.Next.Pt.X<=r.Pt.X&&r.Next.Pt.Y==i.Y;)r=r.Next;!s&&r.Pt.X!=i.X&&(r=r.Next),n=this.DupOutPt(r,s),w.IntPoint.op_Inequality(n.Pt,i)&&(r=n,r.Pt.X=i.X,r.Pt.Y=i.Y,n=this.DupOutPt(r,s))}return l==w.Direction.dLeftToRight==s?(e.Prev=r,r.Next=e,t.Next=n,n.Prev=t):(e.Next=r,r.Prev=e,t.Prev=n,n.Next=t),!0};w.Clipper.prototype.JoinPoints=function(e,t,r){var n=e.OutPt1,i=new w.OutPt,s=e.OutPt2,l=new w.OutPt,c=e.OutPt1.Pt.Y==e.OffPt.Y;if(c&&w.IntPoint.op_Equality(e.OffPt,e.OutPt1.Pt)&&w.IntPoint.op_Equality(e.OffPt,e.OutPt2.Pt)){for(i=e.OutPt1.Next;i!=n&&w.IntPoint.op_Equality(i.Pt,e.OffPt);)i=i.Next;var p=i.Pt.Y>e.OffPt.Y;for(l=e.OutPt2.Next;l!=s&&w.IntPoint.op_Equality(l.Pt,e.OffPt);)l=l.Next;var h=l.Pt.Y>e.OffPt.Y;return p==h?!1:p?(i=this.DupOutPt(n,!1),l=this.DupOutPt(s,!0),n.Prev=s,s.Next=n,i.Next=l,l.Prev=i,e.OutPt1=n,e.OutPt2=i,!0):(i=this.DupOutPt(n,!0),l=this.DupOutPt(s,!1),n.Next=s,s.Prev=n,i.Prev=l,l.Next=i,e.OutPt1=n,e.OutPt2=i,!0)}else if(c){for(i=n;n.Prev.Pt.Y==n.Pt.Y&&n.Prev!=i&&n.Prev!=s;)n=n.Prev;for(;i.Next.Pt.Y==i.Pt.Y&&i.Next!=n&&i.Next!=s;)i=i.Next;if(i.Next==n||i.Next==s)return!1;for(l=s;s.Prev.Pt.Y==s.Pt.Y&&s.Prev!=l&&s.Prev!=i;)s=s.Prev;for(;l.Next.Pt.Y==l.Pt.Y&&l.Next!=s&&l.Next!=n;)l=l.Next;if(l.Next==s||l.Next==n)return!1;var y={Left:null,Right:null};if(!this.GetOverlap(n.Pt.X,i.Pt.X,s.Pt.X,l.Pt.X,y))return!1;var b=y.Left,_=y.Right,C=new w.IntPoint,P;return n.Pt.X>=b&&n.Pt.X<=_?(C.X=n.Pt.X,C.Y=n.Pt.Y,P=n.Pt.X>i.Pt.X):s.Pt.X>=b&&s.Pt.X<=_?(C.X=s.Pt.X,C.Y=s.Pt.Y,P=s.Pt.X>l.Pt.X):i.Pt.X>=b&&i.Pt.X<=_?(C.X=i.Pt.X,C.Y=i.Pt.Y,P=i.Pt.X>n.Pt.X):(C.X=l.Pt.X,C.Y=l.Pt.Y,P=l.Pt.X>s.Pt.X),e.OutPt1=n,e.OutPt2=s,this.JoinHorz(n,i,s,l,C,P)}else{for(i=n.Next;w.IntPoint.op_Equality(i.Pt,n.Pt)&&i!=n;)i=i.Next;var E=i.Pt.Y>n.Pt.Y||!w.ClipperBase.SlopesEqual(n.Pt,i.Pt,e.OffPt,this.m_UseFullRange);if(E){for(i=n.Prev;w.IntPoint.op_Equality(i.Pt,n.Pt)&&i!=n;)i=i.Prev;if(i.Pt.Y>n.Pt.Y||!w.ClipperBase.SlopesEqual(n.Pt,i.Pt,e.OffPt,this.m_UseFullRange))return!1}for(l=s.Next;w.IntPoint.op_Equality(l.Pt,s.Pt)&&l!=s;)l=l.Next;var T=l.Pt.Y>s.Pt.Y||!w.ClipperBase.SlopesEqual(s.Pt,l.Pt,e.OffPt,this.m_UseFullRange);if(T){for(l=s.Prev;w.IntPoint.op_Equality(l.Pt,s.Pt)&&l!=s;)l=l.Prev;if(l.Pt.Y>s.Pt.Y||!w.ClipperBase.SlopesEqual(s.Pt,l.Pt,e.OffPt,this.m_UseFullRange))return!1}return i==n||l==s||i==l||t==r&&E==T?!1:E?(i=this.DupOutPt(n,!1),l=this.DupOutPt(s,!0),n.Prev=s,s.Next=n,i.Next=l,l.Prev=i,e.OutPt1=n,e.OutPt2=i,!0):(i=this.DupOutPt(n,!0),l=this.DupOutPt(s,!1),n.Next=s,s.Prev=n,i.Prev=l,l.Next=i,e.OutPt1=n,e.OutPt2=i,!0)}};w.Clipper.GetBounds=function(e){for(var t=0,r=e.length;t<r&&e[t].length==0;)t++;if(t==r)return new w.IntRect(0,0,0,0);var n=new w.IntRect;for(n.left=e[t][0].X,n.right=n.left,n.top=e[t][0].Y,n.bottom=n.top;t<r;t++)for(var i=0,s=e[t].length;i<s;i++)e[t][i].X<n.left?n.left=e[t][i].X:e[t][i].X>n.right&&(n.right=e[t][i].X),e[t][i].Y<n.top?n.top=e[t][i].Y:e[t][i].Y>n.bottom&&(n.bottom=e[t][i].Y);return n};w.Clipper.prototype.GetBounds2=function(e){var t=e,r=new w.IntRect;for(r.left=e.Pt.X,r.right=e.Pt.X,r.top=e.Pt.Y,r.bottom=e.Pt.Y,e=e.Next;e!=t;)e.Pt.X<r.left&&(r.left=e.Pt.X),e.Pt.X>r.right&&(r.right=e.Pt.X),e.Pt.Y<r.top&&(r.top=e.Pt.Y),e.Pt.Y>r.bottom&&(r.bottom=e.Pt.Y),e=e.Next;return r};w.Clipper.PointInPolygon=function(e,t){var r=0,n=t.length;if(n<3)return 0;for(var i=t[0],s=1;s<=n;++s){var l=s==n?t[0]:t[s];if(l.Y==e.Y&&(l.X==e.X||i.Y==e.Y&&l.X>e.X==i.X<e.X))return-1;if(i.Y<e.Y!=l.Y<e.Y){if(i.X>=e.X)if(l.X>e.X)r=1-r;else{var c=(i.X-e.X)*(l.Y-e.Y)-(l.X-e.X)*(i.Y-e.Y);if(c==0)return-1;c>0==l.Y>i.Y&&(r=1-r)}else if(l.X>e.X){var c=(i.X-e.X)*(l.Y-e.Y)-(l.X-e.X)*(i.Y-e.Y);if(c==0)return-1;c>0==l.Y>i.Y&&(r=1-r)}}i=l}return r};w.Clipper.prototype.PointInPolygon=function(e,t){for(var r=0,n=t;;){var i=t.Pt.X,s=t.Pt.Y,l=t.Next.Pt.X,c=t.Next.Pt.Y;if(c==e.Y&&(l==e.X||s==e.Y&&l>e.X==i<e.X))return-1;if(s<e.Y!=c<e.Y){if(i>=e.X)if(l>e.X)r=1-r;else{var p=(i-e.X)*(c-e.Y)-(l-e.X)*(s-e.Y);if(p==0)return-1;p>0==c>s&&(r=1-r)}else if(l>e.X){var p=(i-e.X)*(c-e.Y)-(l-e.X)*(s-e.Y);if(p==0)return-1;p>0==c>s&&(r=1-r)}}if(t=t.Next,n==t)break}return r};w.Clipper.prototype.Poly2ContainsPoly1=function(e,t){var r=e;do{var n=this.PointInPolygon(r.Pt,t);if(n>=0)return n!=0;r=r.Next}while(r!=e);return!0};w.Clipper.prototype.FixupFirstLefts1=function(e,t){for(var r=0,n=this.m_PolyOuts.length;r<n;r++){var i=this.m_PolyOuts[r];i.Pts!==null&&i.FirstLeft==e&&this.Poly2ContainsPoly1(i.Pts,t.Pts)&&(i.FirstLeft=t)}};w.Clipper.prototype.FixupFirstLefts2=function(e,t){for(var r=0,n=this.m_PolyOuts,i=n.length,s=n[r];r<i;r++,s=n[r])s.FirstLeft==e&&(s.FirstLeft=t)};w.Clipper.ParseFirstLeft=function(e){for(;e!=null&&e.Pts==null;)e=e.FirstLeft;return e};w.Clipper.prototype.JoinCommonEdges=function(){for(var e=0,t=this.m_Joins.length;e<t;e++){var r=this.m_Joins[e],n=this.GetOutRec(r.OutPt1.Idx),i=this.GetOutRec(r.OutPt2.Idx);if(!(n.Pts==null||i.Pts==null)){var s;if(n==i?s=n:this.Param1RightOfParam2(n,i)?s=i:this.Param1RightOfParam2(i,n)?s=n:s=this.GetLowermostRec(n,i),!!this.JoinPoints(r,n,i))if(n==i){if(n.Pts=r.OutPt1,n.BottomPt=null,i=this.CreateOutRec(),i.Pts=r.OutPt2,this.UpdateOutPtIdxs(i),this.m_UsingPolyTree)for(var l=0,c=this.m_PolyOuts.length;l<c-1;l++){var p=this.m_PolyOuts[l];p.Pts==null||w.Clipper.ParseFirstLeft(p.FirstLeft)!=n||p.IsHole==n.IsHole||this.Poly2ContainsPoly1(p.Pts,r.OutPt2)&&(p.FirstLeft=i)}this.Poly2ContainsPoly1(i.Pts,n.Pts)?(i.IsHole=!n.IsHole,i.FirstLeft=n,this.m_UsingPolyTree&&this.FixupFirstLefts2(i,n),(i.IsHole^this.ReverseSolution)==this.Area(i)>0&&this.ReversePolyPtLinks(i.Pts)):this.Poly2ContainsPoly1(n.Pts,i.Pts)?(i.IsHole=n.IsHole,n.IsHole=!i.IsHole,i.FirstLeft=n.FirstLeft,n.FirstLeft=i,this.m_UsingPolyTree&&this.FixupFirstLefts2(n,i),(n.IsHole^this.ReverseSolution)==this.Area(n)>0&&this.ReversePolyPtLinks(n.Pts)):(i.IsHole=n.IsHole,i.FirstLeft=n.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(n,i))}else i.Pts=null,i.BottomPt=null,i.Idx=n.Idx,n.IsHole=s.IsHole,s==i&&(n.FirstLeft=i.FirstLeft),i.FirstLeft=n,this.m_UsingPolyTree&&this.FixupFirstLefts2(i,n)}}};w.Clipper.prototype.UpdateOutPtIdxs=function(e){var t=e.Pts;do t.Idx=e.Idx,t=t.Prev;while(t!=e.Pts)};w.Clipper.prototype.DoSimplePolygons=function(){for(var e=0;e<this.m_PolyOuts.length;){var t=this.m_PolyOuts[e++],r=t.Pts;if(r!==null)do{for(var n=r.Next;n!=t.Pts;){if(w.IntPoint.op_Equality(r.Pt,n.Pt)&&n.Next!=r&&n.Prev!=r){var i=r.Prev,s=n.Prev;r.Prev=s,s.Next=r,n.Prev=i,i.Next=n,t.Pts=r;var l=this.CreateOutRec();l.Pts=n,this.UpdateOutPtIdxs(l),this.Poly2ContainsPoly1(l.Pts,t.Pts)?(l.IsHole=!t.IsHole,l.FirstLeft=t):this.Poly2ContainsPoly1(t.Pts,l.Pts)?(l.IsHole=t.IsHole,t.IsHole=!l.IsHole,l.FirstLeft=t.FirstLeft,t.FirstLeft=l):(l.IsHole=t.IsHole,l.FirstLeft=t.FirstLeft),n=r}n=n.Next}r=r.Next}while(r!=t.Pts)}};w.Clipper.Area=function(e){var t=e.length;if(t<3)return 0;for(var r=0,n=0,i=t-1;n<t;++n)r+=(e[i].X+e[n].X)*(e[i].Y-e[n].Y),i=n;return-r*.5};w.Clipper.prototype.Area=function(e){var t=e.Pts;if(t==null)return 0;var r=0;do r=r+(t.Prev.Pt.X+t.Pt.X)*(t.Prev.Pt.Y-t.Pt.Y),t=t.Next;while(t!=e.Pts);return r*.5};xie&&(w.Clipper.OffsetPaths=function(e,t,r,n,i){var s=new w.Paths,l=new w.ClipperOffset(i,i);return l.AddPaths(e,r,n),l.Execute(s,t),s});w.Clipper.SimplifyPolygon=function(e,t){var r=new Array,n=new w.Clipper(0);return n.StrictlySimple=!0,n.AddPath(e,w.PolyType.ptSubject,!0),n.Execute(w.ClipType.ctUnion,r,t,t),r};w.Clipper.SimplifyPolygons=function(e,t){typeof t>"u"&&(t=w.PolyFillType.pftEvenOdd);var r=new Array,n=new w.Clipper(0);return n.StrictlySimple=!0,n.AddPaths(e,w.PolyType.ptSubject,!0),n.Execute(w.ClipType.ctUnion,r,t,t),r};w.Clipper.DistanceSqrd=function(e,t){var r=e.X-t.X,n=e.Y-t.Y;return r*r+n*n};w.Clipper.DistanceFromLineSqrd=function(e,t,r){var n=t.Y-r.Y,i=r.X-t.X,s=n*t.X+i*t.Y;return s=n*e.X+i*e.Y-s,s*s/(n*n+i*i)};w.Clipper.SlopesNearCollinear=function(e,t,r,n){return w.Clipper.DistanceFromLineSqrd(t,e,r)<n};w.Clipper.PointsAreClose=function(e,t,r){var n=e.X-t.X,i=e.Y-t.Y;return n*n+i*i<=r};w.Clipper.ExcludeOp=function(e){var t=e.Prev;return t.Next=e.Next,e.Next.Prev=t,t.Idx=0,t};w.Clipper.CleanPolygon=function(e,t){typeof t>"u"&&(t=1.415);var r=e.length;if(r==0)return new Array;for(var n=new Array(r),i=0;i<r;++i)n[i]=new w.OutPt;for(var i=0;i<r;++i)n[i].Pt=e[i],n[i].Next=n[(i+1)%r],n[i].Next.Prev=n[i],n[i].Idx=0;for(var s=t*t,l=n[0];l.Idx==0&&l.Next!=l.Prev;)w.Clipper.PointsAreClose(l.Pt,l.Prev.Pt,s)?(l=w.Clipper.ExcludeOp(l),r--):w.Clipper.PointsAreClose(l.Prev.Pt,l.Next.Pt,s)?(w.Clipper.ExcludeOp(l.Next),l=w.Clipper.ExcludeOp(l),r-=2):w.Clipper.SlopesNearCollinear(l.Prev.Pt,l.Pt,l.Next.Pt,s)?(l=w.Clipper.ExcludeOp(l),r--):(l.Idx=1,l=l.Next);r<3&&(r=0);for(var c=new Array(r),i=0;i<r;++i)c[i]=new w.IntPoint(l.Pt),l=l.Next;return n=null,c};w.Clipper.CleanPolygons=function(e,t){for(var r=new Array(e.length),n=0,i=e.length;n<i;n++)r[n]=w.Clipper.CleanPolygon(e[n],t);return r};w.Clipper.Minkowski=function(e,t,r,n){var i=n?1:0,s=e.length,l=t.length,c=new Array;if(r)for(var p=0;p<l;p++){for(var h=new Array(s),y=0,b=e.length,_=e[y];y<b;y++,_=e[y])h[y]=new w.IntPoint(t[p].X+_.X,t[p].Y+_.Y);c.push(h)}else for(var p=0;p<l;p++){for(var h=new Array(s),y=0,b=e.length,_=e[y];y<b;y++,_=e[y])h[y]=new w.IntPoint(t[p].X-_.X,t[p].Y-_.Y);c.push(h)}for(var C=new Array,p=0;p<l-1+i;p++)for(var y=0;y<s;y++){var P=new Array;P.push(c[p%l][y%s]),P.push(c[(p+1)%l][y%s]),P.push(c[(p+1)%l][(y+1)%s]),P.push(c[p%l][(y+1)%s]),w.Clipper.Orientation(P)||P.reverse(),C.push(P)}var E=new w.Clipper(0);return E.AddPaths(C,w.PolyType.ptSubject,!0),E.Execute(w.ClipType.ctUnion,c,w.PolyFillType.pftNonZero,w.PolyFillType.pftNonZero),c};w.Clipper.MinkowskiSum=function(){var e=arguments,t=e.length;if(t==3){var r=e[0],n=e[1],i=e[2];return w.Clipper.Minkowski(r,n,!0,i)}else if(t==4){for(var r=e[0],s=e[1],l=e[2],i=e[3],c=new w.Clipper,p,h=0,y=s.length;h<y;++h){var p=w.Clipper.Minkowski(r,s[h],!0,i);c.AddPaths(p,w.PolyType.ptSubject,!0)}i&&c.AddPaths(s,w.PolyType.ptClip,!0);var b=new w.Paths;return c.Execute(w.ClipType.ctUnion,b,l,l),b}};w.Clipper.MinkowskiDiff=function(e,t,r){return w.Clipper.Minkowski(e,t,!1,r)};w.Clipper.PolyTreeToPaths=function(e){var t=new Array;return w.Clipper.AddPolyNodeToPaths(e,w.Clipper.NodeType.ntAny,t),t};w.Clipper.AddPolyNodeToPaths=function(e,t,r){var n=!0;switch(t){case w.Clipper.NodeType.ntOpen:return;case w.Clipper.NodeType.ntClosed:n=!e.IsOpen;break;default:break}e.m_polygon.length>0&&n&&r.push(e.m_polygon);for(var i=0,s=e.Childs(),l=s.length,c=s[i];i<l;i++,c=s[i])w.Clipper.AddPolyNodeToPaths(c,t,r)};w.Clipper.OpenPathsFromPolyTree=function(e){for(var t=new w.Paths,r=0,n=e.ChildCount();r<n;r++)e.Childs()[r].IsOpen&&t.push(e.Childs()[r].m_polygon);return t};w.Clipper.ClosedPathsFromPolyTree=function(e){var t=new w.Paths;return w.Clipper.AddPolyNodeToPaths(e,w.Clipper.NodeType.ntClosed,t),t};H3(w.Clipper,w.ClipperBase);w.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2};w.ClipperOffset=function(e,t){typeof e>"u"&&(e=2),typeof t>"u"&&(t=w.ClipperOffset.def_arc_tolerance),this.m_destPolys=new w.Paths,this.m_srcPoly=new w.Path,this.m_destPoly=new w.Path,this.m_normals=new Array,this.m_delta=0,this.m_sinA=0,this.m_sin=0,this.m_cos=0,this.m_miterLim=0,this.m_StepsPerRad=0,this.m_lowest=new w.IntPoint,this.m_polyNodes=new w.PolyNode,this.MiterLimit=e,this.ArcTolerance=t,this.m_lowest.X=-1};w.ClipperOffset.two_pi=6.28318530717959;w.ClipperOffset.def_arc_tolerance=.25;w.ClipperOffset.prototype.Clear=function(){w.Clear(this.m_polyNodes.Childs()),this.m_lowest.X=-1};w.ClipperOffset.Round=w.Clipper.Round;w.ClipperOffset.prototype.AddPath=function(e,t,r){var n=e.length-1;if(!(n<0)){var i=new w.PolyNode;if(i.m_jointype=t,i.m_endtype=r,r==w.EndType.etClosedLine||r==w.EndType.etClosedPolygon)for(;n>0&&w.IntPoint.op_Equality(e[0],e[n]);)n--;i.m_polygon.push(e[0]);for(var s=0,l=0,c=1;c<=n;c++)w.IntPoint.op_Inequality(i.m_polygon[s],e[c])&&(s++,i.m_polygon.push(e[c]),(e[c].Y>i.m_polygon[l].Y||e[c].Y==i.m_polygon[l].Y&&e[c].X<i.m_polygon[l].X)&&(l=s));if(!(r==w.EndType.etClosedPolygon&&s<2||r!=w.EndType.etClosedPolygon&&s<0)&&(this.m_polyNodes.AddChild(i),r==w.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new w.IntPoint(0,l);else{var p=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(i.m_polygon[l].Y>p.Y||i.m_polygon[l].Y==p.Y&&i.m_polygon[l].X<p.X)&&(this.m_lowest=new w.IntPoint(this.m_polyNodes.ChildCount()-1,l))}}};w.ClipperOffset.prototype.AddPaths=function(e,t,r){for(var n=0,i=e.length;n<i;n++)this.AddPath(e[n],t,r)};w.ClipperOffset.prototype.FixOrientations=function(){if(this.m_lowest.X>=0&&!w.Clipper.Orientation(this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon))for(var e=0;e<this.m_polyNodes.ChildCount();e++){var t=this.m_polyNodes.Childs()[e];(t.m_endtype==w.EndType.etClosedPolygon||t.m_endtype==w.EndType.etClosedLine&&w.Clipper.Orientation(t.m_polygon))&&t.m_polygon.reverse()}else for(var e=0;e<this.m_polyNodes.ChildCount();e++){var t=this.m_polyNodes.Childs()[e];t.m_endtype==w.EndType.etClosedLine&&!w.Clipper.Orientation(t.m_polygon)&&t.m_polygon.reverse()}};w.ClipperOffset.GetUnitNormal=function(e,t){var r=t.X-e.X,n=t.Y-e.Y;if(r==0&&n==0)return new w.DoublePoint(0,0);var i=1/Math.sqrt(r*r+n*n);return r*=i,n*=i,new w.DoublePoint(n,-r)};w.ClipperOffset.prototype.DoOffset=function(e){if(this.m_destPolys=new Array,this.m_delta=e,w.ClipperBase.near_zero(e)){for(var t=0;t<this.m_polyNodes.ChildCount();t++){var r=this.m_polyNodes.Childs()[t];r.m_endtype==w.EndType.etClosedPolygon&&this.m_destPolys.push(r.m_polygon)}return}this.MiterLimit>2?this.m_miterLim=2/(this.MiterLimit*this.MiterLimit):this.m_miterLim=.5;var n;this.ArcTolerance<=0?n=w.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(e)*w.ClipperOffset.def_arc_tolerance?n=Math.abs(e)*w.ClipperOffset.def_arc_tolerance:n=this.ArcTolerance;var i=3.14159265358979/Math.acos(1-n/Math.abs(e));this.m_sin=Math.sin(w.ClipperOffset.two_pi/i),this.m_cos=Math.cos(w.ClipperOffset.two_pi/i),this.m_StepsPerRad=i/w.ClipperOffset.two_pi,e<0&&(this.m_sin=-this.m_sin);for(var t=0;t<this.m_polyNodes.ChildCount();t++){var r=this.m_polyNodes.Childs()[t];this.m_srcPoly=r.m_polygon;var s=this.m_srcPoly.length;if(!(s==0||e<=0&&(s<3||r.m_endtype!=w.EndType.etClosedPolygon))){if(this.m_destPoly=new Array,s==1){if(r.m_jointype==w.JoinType.jtRound)for(var l=1,c=0,p=1;p<=i;p++){this.m_destPoly.push(new w.IntPoint(w.ClipperOffset.Round(this.m_srcPoly[0].X+l*e),w.ClipperOffset.Round(this.m_srcPoly[0].Y+c*e)));var h=l;l=l*this.m_cos-this.m_sin*c,c=h*this.m_sin+c*this.m_cos}else for(var l=-1,c=-1,p=0;p<4;++p)this.m_destPoly.push(new w.IntPoint(w.ClipperOffset.Round(this.m_srcPoly[0].X+l*e),w.ClipperOffset.Round(this.m_srcPoly[0].Y+c*e))),l<0?l=1:c<0?c=1:l=-1;this.m_destPolys.push(this.m_destPoly);continue}this.m_normals.length=0;for(var p=0;p<s-1;p++)this.m_normals.push(w.ClipperOffset.GetUnitNormal(this.m_srcPoly[p],this.m_srcPoly[p+1]));if(r.m_endtype==w.EndType.etClosedLine||r.m_endtype==w.EndType.etClosedPolygon?this.m_normals.push(w.ClipperOffset.GetUnitNormal(this.m_srcPoly[s-1],this.m_srcPoly[0])):this.m_normals.push(new w.DoublePoint(this.m_normals[s-2])),r.m_endtype==w.EndType.etClosedPolygon){for(var y=s-1,p=0;p<s;p++)y=this.OffsetPoint(p,y,r.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(r.m_endtype==w.EndType.etClosedLine){for(var y=s-1,p=0;p<s;p++)y=this.OffsetPoint(p,y,r.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array;for(var b=this.m_normals[s-1],p=s-1;p>0;p--)this.m_normals[p]=new w.DoublePoint(-this.m_normals[p-1].X,-this.m_normals[p-1].Y);this.m_normals[0]=new w.DoublePoint(-b.X,-b.Y),y=0;for(var p=s-1;p>=0;p--)y=this.OffsetPoint(p,y,r.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(var y=0,p=1;p<s-1;++p)y=this.OffsetPoint(p,y,r.m_jointype);var _;if(r.m_endtype==w.EndType.etOpenButt){var p=s-1;_=new w.IntPoint(w.ClipperOffset.Round(this.m_srcPoly[p].X+this.m_normals[p].X*e),w.ClipperOffset.Round(this.m_srcPoly[p].Y+this.m_normals[p].Y*e)),this.m_destPoly.push(_),_=new w.IntPoint(w.ClipperOffset.Round(this.m_srcPoly[p].X-this.m_normals[p].X*e),w.ClipperOffset.Round(this.m_srcPoly[p].Y-this.m_normals[p].Y*e)),this.m_destPoly.push(_)}else{var p=s-1;y=s-2,this.m_sinA=0,this.m_normals[p]=new w.DoublePoint(-this.m_normals[p].X,-this.m_normals[p].Y),r.m_endtype==w.EndType.etOpenSquare?this.DoSquare(p,y):this.DoRound(p,y)}for(var p=s-1;p>0;p--)this.m_normals[p]=new w.DoublePoint(-this.m_normals[p-1].X,-this.m_normals[p-1].Y);this.m_normals[0]=new w.DoublePoint(-this.m_normals[1].X,-this.m_normals[1].Y),y=s-1;for(var p=y-1;p>0;--p)y=this.OffsetPoint(p,y,r.m_jointype);r.m_endtype==w.EndType.etOpenButt?(_=new w.IntPoint(w.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*e),w.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*e)),this.m_destPoly.push(_),_=new w.IntPoint(w.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*e),w.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*e)),this.m_destPoly.push(_)):(y=1,this.m_sinA=0,r.m_endtype==w.EndType.etOpenSquare?this.DoSquare(0,1):this.DoRound(0,1)),this.m_destPolys.push(this.m_destPoly)}}}};w.ClipperOffset.prototype.Execute=function(){var e=arguments,t=e[0]instanceof w.PolyTree;if(t){var r=e[0],n=e[1];r.Clear(),this.FixOrientations(),this.DoOffset(n);var i=new w.Clipper(0);if(i.AddPaths(this.m_destPolys,w.PolyType.ptSubject,!0),n>0)i.Execute(w.ClipType.ctUnion,r,w.PolyFillType.pftPositive,w.PolyFillType.pftPositive);else{var s=w.Clipper.GetBounds(this.m_destPolys),l=new w.Path;if(l.push(new w.IntPoint(s.left-10,s.bottom+10)),l.push(new w.IntPoint(s.right+10,s.bottom+10)),l.push(new w.IntPoint(s.right+10,s.top-10)),l.push(new w.IntPoint(s.left-10,s.top-10)),i.AddPath(l,w.PolyType.ptSubject,!0),i.ReverseSolution=!0,i.Execute(w.ClipType.ctUnion,r,w.PolyFillType.pftNegative,w.PolyFillType.pftNegative),r.ChildCount()==1&&r.Childs()[0].ChildCount()>0){var c=r.Childs()[0];r.Childs()[0]=c.Childs()[0];for(var p=1;p<c.ChildCount();p++)r.AddChild(c.Childs()[p])}else r.Clear()}}else{var r=e[0],n=e[1];w.Clear(r),this.FixOrientations(),this.DoOffset(n);var i=new w.Clipper(0);if(i.AddPaths(this.m_destPolys,w.PolyType.ptSubject,!0),n>0)i.Execute(w.ClipType.ctUnion,r,w.PolyFillType.pftPositive,w.PolyFillType.pftPositive);else{var s=w.Clipper.GetBounds(this.m_destPolys),l=new w.Path;l.push(new w.IntPoint(s.left-10,s.bottom+10)),l.push(new w.IntPoint(s.right+10,s.bottom+10)),l.push(new w.IntPoint(s.right+10,s.top-10)),l.push(new w.IntPoint(s.left-10,s.top-10)),i.AddPath(l,w.PolyType.ptSubject,!0),i.ReverseSolution=!0,i.Execute(w.ClipType.ctUnion,r,w.PolyFillType.pftNegative,w.PolyFillType.pftNegative),r.length>0&&r.splice(0,1)}}};w.ClipperOffset.prototype.OffsetPoint=function(e,t,r){if(this.m_sinA=this.m_normals[t].X*this.m_normals[e].Y-this.m_normals[e].X*this.m_normals[t].Y,this.m_sinA<5e-5&&this.m_sinA>-5e-5)return t;if(this.m_sinA>1?this.m_sinA=1:this.m_sinA<-1&&(this.m_sinA=-1),this.m_sinA*this.m_delta<0)this.m_destPoly.push(new w.IntPoint(w.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_normals[t].X*this.m_delta),w.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_normals[t].Y*this.m_delta))),this.m_destPoly.push(new w.IntPoint(this.m_srcPoly[e])),this.m_destPoly.push(new w.IntPoint(w.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_normals[e].X*this.m_delta),w.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_normals[e].Y*this.m_delta)));else switch(r){case w.JoinType.jtMiter:{var n=1+(this.m_normals[e].X*this.m_normals[t].X+this.m_normals[e].Y*this.m_normals[t].Y);n>=this.m_miterLim?this.DoMiter(e,t,n):this.DoSquare(e,t);break}case w.JoinType.jtSquare:this.DoSquare(e,t);break;case w.JoinType.jtRound:this.DoRound(e,t);break}return t=e,t};w.ClipperOffset.prototype.DoSquare=function(e,t){var r=Math.tan(Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[e].X+this.m_normals[t].Y*this.m_normals[e].Y)/4);this.m_destPoly.push(new w.IntPoint(w.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_delta*(this.m_normals[t].X-this.m_normals[t].Y*r)),w.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_delta*(this.m_normals[t].Y+this.m_normals[t].X*r)))),this.m_destPoly.push(new w.IntPoint(w.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_delta*(this.m_normals[e].X+this.m_normals[e].Y*r)),w.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_delta*(this.m_normals[e].Y-this.m_normals[e].X*r))))};w.ClipperOffset.prototype.DoMiter=function(e,t,r){var n=this.m_delta/r;this.m_destPoly.push(new w.IntPoint(w.ClipperOffset.Round(this.m_srcPoly[e].X+(this.m_normals[t].X+this.m_normals[e].X)*n),w.ClipperOffset.Round(this.m_srcPoly[e].Y+(this.m_normals[t].Y+this.m_normals[e].Y)*n)))};w.ClipperOffset.prototype.DoRound=function(e,t){for(var r=Math.atan2(this.m_sinA,this.m_normals[t].X*this.m_normals[e].X+this.m_normals[t].Y*this.m_normals[e].Y),n=w.Cast_Int32(w.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(r))),i=this.m_normals[t].X,s=this.m_normals[t].Y,l,c=0;c<n;++c)this.m_destPoly.push(new w.IntPoint(w.ClipperOffset.Round(this.m_srcPoly[e].X+i*this.m_delta),w.ClipperOffset.Round(this.m_srcPoly[e].Y+s*this.m_delta))),l=i,i=i*this.m_cos-this.m_sin*s,s=l*this.m_sin+s*this.m_cos;this.m_destPoly.push(new w.IntPoint(w.ClipperOffset.Round(this.m_srcPoly[e].X+this.m_normals[e].X*this.m_delta),w.ClipperOffset.Round(this.m_srcPoly[e].Y+this.m_normals[e].Y*this.m_delta)))};w.Error=function(e){try{throw new Error(e)}catch(t){alert(t.message)}};w.JS={};w.JS.AreaOfPolygon=function(e,t){return t||(t=1),w.Clipper.Area(e)/(t*t)};w.JS.AreaOfPolygons=function(e,t){t||(t=1);for(var r=0,n=0;n<e.length;n++)r+=w.Clipper.Area(e[n]);return r/(t*t)};w.JS.BoundsOfPath=function(e,t){return w.JS.BoundsOfPaths([e],t)};w.JS.BoundsOfPaths=function(e,t){t||(t=1);var r=w.Clipper.GetBounds(e);return r.left/=t,r.bottom/=t,r.right/=t,r.top/=t,r};w.JS.Clean=function(n,t){if(!(n instanceof Array))return[];var r=n[0]instanceof Array,n=w.JS.Clone(n);if(typeof t!="number"||t===null)return w.Error("Delta is not a number in Clean()."),n;if(n.length===0||n.length==1&&n[0].length===0||t<0)return n;r||(n=[n]);for(var i=n.length,s,l,c,p,h,y,b,_=[],C=0;C<i;C++)if(l=n[C],s=l.length,s!==0){if(s<3){c=l,_.push(c);continue}for(c=l,p=t*t,h=l[0],y=1,b=1;b<s;b++)(l[b].X-h.X)*(l[b].X-h.X)+(l[b].Y-h.Y)*(l[b].Y-h.Y)<=p||(c[y]=l[b],h=l[b],y++);h=l[y-1],(l[0].X-h.X)*(l[0].X-h.X)+(l[0].Y-h.Y)*(l[0].Y-h.Y)<=p&&y--,y<s&&c.splice(y,s-y),c.length&&_.push(c)}return!r&&_.length?_=_[0]:!r&&_.length===0?_=[]:r&&_.length===0&&(_=[[]]),_};w.JS.Clone=function(e){if(!(e instanceof Array))return[];if(e.length===0)return[];if(e.length==1&&e[0].length===0)return[[]];var t=e[0]instanceof Array;t||(e=[e]);var r=e.length,n,i,s,l,c=new Array(r);for(i=0;i<r;i++){for(n=e[i].length,l=new Array(n),s=0;s<n;s++)l[s]={X:e[i][s].X,Y:e[i][s].Y};c[i]=l}return t||(c=c[0]),c};w.JS.Lighten=function(e,t){if(!(e instanceof Array))return[];if(typeof t!="number"||t===null)return w.Error("Tolerance is not a number in Lighten()."),w.JS.Clone(e);if(e.length===0||e.length==1&&e[0].length===0||t<0)return w.JS.Clone(e);e[0]instanceof Array||(e=[e]);var r,n,i,s,l,c,p,h,y,b,_,C,P,E,T,O,D,A=e.length,R=t*t,j=[];for(r=0;r<A;r++)if(i=e[r],c=i.length,c!=0){for(s=0;s<1e6;s++){for(l=[],c=i.length,i[c-1].X!=i[0].X||i[c-1].Y!=i[0].Y?(C=1,i.push({X:i[0].X,Y:i[0].Y}),c=i.length):C=0,_=[],n=0;n<c-2;n++)p=i[n],y=i[n+1],h=i[n+2],O=p.X,D=p.Y,P=h.X-O,E=h.Y-D,(P!==0||E!==0)&&(T=((y.X-O)*P+(y.Y-D)*E)/(P*P+E*E),T>1?(O=h.X,D=h.Y):T>0&&(O+=P*T,D+=E*T)),P=y.X-O,E=y.Y-D,b=P*P+E*E,b<=R&&(_[n+1]=1,n++);for(l.push({X:i[0].X,Y:i[0].Y}),n=1;n<c-1;n++)_[n]||l.push({X:i[n].X,Y:i[n].Y});if(l.push({X:i[c-1].X,Y:i[c-1].Y}),C&&i.pop(),_.length)i=l;else break}c=l.length,l[c-1].X==l[0].X&&l[c-1].Y==l[0].Y&&l.pop(),l.length>2&&j.push(l)}return!e[0]instanceof Array&&(j=j[0]),typeof j>"u"&&(j=[[]]),j};w.JS.PerimeterOfPath=function(e,t,r){if(typeof e>"u")return 0;var n=Math.sqrt,i=0,s,l,c=0,p=0,h=0,y=0,b=e.length;if(b<2)return 0;for(t&&(e[b]=e[0],b++);--b;)s=e[b],c=s.X,p=s.Y,l=e[b-1],h=l.X,y=l.Y,i+=n((c-h)*(c-h)+(p-y)*(p-y));return t&&e.pop(),i/r};w.JS.PerimeterOfPaths=function(e,t,r){r||(r=1);for(var n=0,i=0;i<e.length;i++)n+=w.JS.PerimeterOfPath(e[i],t,r);return n};w.JS.ScaleDownPath=function(e,t){var r,n;for(t||(t=1),r=e.length;r--;)n=e[r],n.X=n.X/t,n.Y=n.Y/t};w.JS.ScaleDownPaths=function(e,t){var r,n,i,s=Math.round;for(t||(t=1),r=e.length;r--;)for(n=e[r].length;n--;)i=e[r][n],i.X=i.X/t,i.Y=i.Y/t};w.JS.ScaleUpPath=function(e,t){var r,n,i=Math.round;for(t||(t=1),r=e.length;r--;)n=e[r],n.X=i(n.X*t),n.Y=i(n.Y*t)};w.JS.ScaleUpPaths=function(e,t){var r,n,i,s=Math.round;for(t||(t=1),r=e.length;r--;)for(n=e[r].length;n--;)i=e[r][n],i.X=s(i.X*t),i.Y=s(i.Y*t)};w.ExPolygons=function(){return[]};w.ExPolygon=function(){this.outer=null,this.holes=null};w.JS.AddOuterPolyNodeToExPolygons=function(e,t){var r=new w.ExPolygon;r.outer=e.Contour();var n=e.Childs(),i=n.length;r.holes=new Array(i);var s,l,c,p,h,y;for(c=0;c<i;c++)for(s=n[c],r.holes[c]=s.Contour(),p=0,h=s.Childs(),y=h.length;p<y;p++)l=h[p],w.JS.AddOuterPolyNodeToExPolygons(l,t);t.push(r)};w.JS.ExPolygonsToPaths=function(e){var t,r,n,i,s=new w.Paths;for(t=0,n=e.length;t<n;t++)for(s.push(e[t].outer),r=0,i=e[t].holes.length;r<i;r++)s.push(e[t].holes[r]);return s};w.JS.PolyTreeToExPolygons=function(e){var t=new w.ExPolygons,r,n,i,s;for(n=0,i=e.Childs(),s=i.length;n<s;n++)r=i[n],w.JS.AddOuterPolyNodeToExPolygons(r,t);return t};h2.exports=w});var qoe=fe((Yrr,qT)=>{g();(function(){"use strict";function e(l,c){var p=l.x-c.x,h=l.y-c.y;return p*p+h*h}o(e,"getSqDist");function t(l,c,p){var h=c.x,y=c.y,b=p.x-h,_=p.y-y;if(b!==0||_!==0){var C=((l.x-h)*b+(l.y-y)*_)/(b*b+_*_);C>1?(h=p.x,y=p.y):C>0&&(h+=b*C,y+=_*C)}return b=l.x-h,_=l.y-y,b*b+_*_}o(t,"getSqSegDist");function r(l,c){for(var p=l[0],h=[p],y,b=1,_=l.length;b<_;b++)y=l[b],e(y,p)>c&&(h.push(y),p=y);return p!==y&&h.push(y),h}o(r,"simplifyRadialDist");function n(l,c,p,h,y){for(var b=h,_,C=c+1;C<p;C++){var P=t(l[C],l[c],l[p]);P>b&&(_=C,b=P)}b>h&&(_-c>1&&n(l,c,_,h,y),y.push(l[_]),p-_>1&&n(l,_,p,h,y))}o(n,"simplifyDPStep");function i(l,c){var p=l.length-1,h=[l[0]];return n(l,0,p,c,h),h.push(l[p]),h}o(i,"simplifyDouglasPeucker");function s(l,c,p){if(l.length<=2)return l;var h=c!==void 0?c*c:1;return l=p?l:r(l,h),l=i(l,h),l}o(s,"simplify"),typeof define=="function"&&define.amd?define(function(){return s}):typeof qT<"u"?(qT.exports=s,qT.exports.default=s):typeof self<"u"?self.simplify=s:window.simplify=s})()});g();g();var lm=class lm{constructor(t,r,n){x(this,"__type",lm.__type);x(this,"id",xn());x(this,"latitude");x(this,"longitude");x(this,"floorId");x(this,"verticalOffset");var i;if(typeof t=="object")this.latitude=t.latitude,this.longitude=t.longitude,this.floorId=t.floorId,this.verticalOffset=(i=t.verticalOffset)!=null?i:0;else{if(r==null)throw new Error("Coordinate longitude is required.");this.latitude=t,this.longitude=r,this.floorId=n,this.verticalOffset=0}}static is(t){return t.__type===lm.__type}get anchorTarget(){return this}get focusTarget(){return this}isEqual(t){return this.latitude===t.latitude&&this.longitude===t.longitude&&this.floorId===t.floorId}toJSON(){return{__type:lm.__type,latitude:this.latitude,longitude:this.longitude,floor:this.floorId,verticalOffset:this.verticalOffset}}destroy(){}};o(lm,"Coordinate"),x(lm,"__type","coordinate");var LE=lm,Ct=LE;g();var AE=class AE{constructor(t){x(this,"id");this.id=t}};o(AE,"BaseMetaData");var Co=AE;var Ac,oa,cm,Ld,um=class um extends Co{constructor(r,n){super(n.mvfData.properties.id);x(this,"__type",um.__type);G(this,Ac);G(this,oa,{});G(this,cm);G(this,Ld);q(this,Ac,r),q(this,cm,n.floorId),q(this,Ld,n.mvfData)}static is(r){return r.__type===um.__type}get locations(){return d(this,oa).locations?d(this,oa).locations:(d(this,oa).locations=(d(this,Ac).locationIdsByNodeId[this.id]||[]).map(r=>d(this,Ac).getById("enterprise-location",r)).filter(Boolean),d(this,oa).locations)}get space(){var r;return d(this,Ac).getById("space",(r=d(this,Ac).spaceIdsByNodeId[this.id])==null?void 0:r[0])}get floor(){let r=d(this,Ac).getById("floor",d(this,cm));if(r==null)throw new Error("Floor ".concat(d(this,cm)," not found!"));return r}get coordinate(){if(d(this,oa).coordinate==null){let[r,n]=d(this,Ld).geometry.coordinates;d(this,oa).coordinate=new Ct(n,r,d(this,cm))}return d(this,oa).coordinate}get externalId(){var r;return(r=d(this,Ld).properties.externalId)!=null?r:""}get neighbors(){if(d(this,oa).neighbours==null){let r=d(this,Ld).properties.neighbors.map(n=>{let i=d(this,Ac).getById("node",n.id);if(i==null)throw new Error("Node ".concat(n.id," not found!"));return i});d(this,oa).neighbours=r}return d(this,oa).neighbours}get geoJSON(){return re(k({},d(this,Ld)),{properties:null})}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{__type:um.__type,id:this.id,floor:this.floor.id,coordinate:this.coordinate.toJSON(),neighbors:this.neighbors.map(r=>r.id)}}destroy(){for(let r of Object.keys(d(this,oa)))delete d(this,oa)[r]}};Ac=new WeakMap,oa=new WeakMap,cm=new WeakMap,Ld=new WeakMap,o(um,"Node"),x(um,"__type","node");var DE=um,Qp=DE;g();g();var pm,FE=class FE{constructor(t,r){x(this,"id");G(this,pm);this.id=t}get geoJSONBoundingBox(){return d(this,pm)?d(this,pm):"bbox"in this.geoJSON.geometry&&this.geoJSON.geometry.bbox?this.geoJSON.geometry.bbox:(q(this,pm,po(this.geoJSON)),d(this,pm))}get geoJSON(){return{properties:null,type:"Feature",geometry:{type:"Polygon",coordinates:[[]]}}}};pm=new WeakMap,o(FE,"BaseMapData");var Mu=FE;var Ad,Al,Ou,u0,Ab,kE,fm=class fm extends Mu{constructor(r,n){super(n.mvfData.id,r);G(this,Ab);x(this,"__type",fm.__type);G(this,Ad);G(this,Al,{});G(this,Ou);G(this,u0);q(this,Ad,r),q(this,Ou,n.mvfData),q(this,u0,n.facadeId)}static is(r){return r.__type===fm.__type}get type(){return d(this,Ou).type}get name(){var r;return(r=ke(this,Ab,kE).call(this,"name"))!=null?r:""}get shortName(){var r;return(r=ke(this,Ab,kE).call(this,"shortName"))!=null?r:""}get externalId(){var r;return(r=d(this,Ou).externalId)!=null?r:""}get floors(){var r,n;if(d(this,Al).floors==null){let i=((n=(r=d(this,Ou).floors)!=null?r:d(this,Ou).maps)!=null?n:[]).reduce((s,l)=>{let c=d(this,Ad).floorsById[l];return c&&s.push(c),s},[]);i.length===0&&ce.error("Floor stack ".concat(this.id," has no floors")),d(this,Al).floors=i}return d(this,Al).floors}get defaultFloor(){if(d(this,Al).defaultFloor!=null)return d(this,Al).defaultFloor;let r=d(this,Ou).defaultFloor?d(this,Ad).getById("floor",d(this,Ou).defaultFloor):void 0;return d(this,Al).defaultFloor=r||this.floors.reduce((n,i)=>Math.abs(i.elevation)<Math.abs(n.elevation)?i:n),d(this,Al).defaultFloor}get facade(){return d(this,u0)?d(this,Ad).facadesById[d(this,u0)]:void 0}toJSON(){return{__type:fm.__type,id:this.id,name:this.name,shortName:this.shortName,type:this.type,floors:this.floors.map(r=>r.id)}}destroy(){for(let r of globalThis.Object.keys(d(this,Al)))delete d(this,Al)[r]}};Ad=new WeakMap,Al=new WeakMap,Ou=new WeakMap,u0=new WeakMap,Ab=new WeakSet,kE=o(function(r){return d(this,Ad).getPropTranslation(this.__type,r,this.id,d(this,Ou)[r])},"#translate"),o(fm,"FloorStack"),x(fm,"__type","floor-stack");var NE=fm,Db=NE;g();g();g();g();g();g();var Fb,ef,dm=class dm extends Co{constructor(r){super(String(xn()));x(this,"__type",dm.__type);G(this,Fb,{});G(this,ef);q(this,ef,r.mvfData)}static is(r){return r.__type===dm.__type}get url(){return d(this,ef).url}get name(){if("displayName"in d(this,ef))return d(this,ef).displayName;if("label"in d(this,ef))return d(this,ef).label}toJSON(){return{__type:dm.__type,id:this.id,url:this.url,name:this.name}}destroy(){for(let r of globalThis.Object.keys(d(this,Fb)))delete d(this,Fb)[r]}};Fb=new WeakMap,ef=new WeakMap,o(dm,"Hyperlink"),x(dm,"__type","hyperlink");var RE=dm,Dd=RE;g();g();function Nb(e){return typeof e=="string"?e:e.id}o(Nb,"getId");function $E(e){return Array.isArray(e)&&Number.isFinite(e[0])&&Number.isFinite(e[1])}o($E,"isPosition");var BE=8,Dc=o(e=>typeof e=="number"?e.toFixed(BE):$E(e)?e[1].toFixed(BE)+"-"+e[0].toFixed(BE):e.map(t=>Dc(t)).join("-"),"serializeCoords"),Use=o(e=>{let t=/^https:\/\/cdn\.mappedin\.com\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/,r=/^https:\/\/cdn-staging\.mappedin\.net\/[^/]+\/[^/]+\.[a-zA-Z0-9]+$/;return t.test(e)||r.test(e)},"isPrivateCdnAsset"),SS=o(e=>{if(!Use(e))return null;let t="";e.startsWith("https://")?(t="https://",e=e.slice(8)):e.startsWith("http://")&&(t="http://",e=e.slice(7));let[r,n,i]=e.split("/");return{origin:t+r,mapId:n,fileName:i}},"parseCdnAssetUrl");var kb,Fd,mm,hm=class hm extends Co{constructor(r){super(String(xn()));x(this,"__type",hm.__type);G(this,kb,{});G(this,Fd);G(this,mm);q(this,Fd,r.mvfData),q(this,mm,r.mapData)}static is(r){return r.__type===hm.__type}get url(){let r=d(this,Fd).url;if(d(this,mm).tokenManager==null)return r;let n=SS(d(this,Fd).url);if(n==null)return r;let i=n.mapId;try{if(d(this,mm).tokenManager.isEnterpriseMode())return r;let s=d(this,mm).tokenManager.getSasToken(i).token;if(s==null||s==="")throw new Error("SAS token empty!");return"".concat(r,"?").concat(s)}catch(s){return ce.error("Error getting SAS token for image",{error:s,url:r}),r}}get name(){return d(this,Fd).altText}get altText(){return d(this,Fd).altText}toJSON(){return{__type:hm.__type,id:this.id,url:this.url,name:this.name}}destroy(){for(let r of globalThis.Object.keys(d(this,kb)))delete d(this,kb)[r]}};kb=new WeakMap,Fd=new WeakMap,mm=new WeakMap,o(hm,"ImageMetaData"),x(hm,"__type","image");var jE=hm,Nd=jE;var c0,Lu,tf,GE=class GE extends Mu{constructor(r,n){super(n.properties.id,r);G(this,c0);G(this,Lu);G(this,tf,{});q(this,c0,r),q(this,Lu,n)}get externalId(){var r;return(r=d(this,Lu).properties.externalId)!=null?r:""}get name(){var n,i,s,l,c;let r="";return"details"in d(this,Lu).properties||(r=(n=d(this,Lu).properties.externalId)!=null?n:""),r===""&&(r=(s=(i=d(this,Lu).properties.details)==null?void 0:i.name)!=null?s:""),r===""&&(r=(c=(l=this.locationProfiles.find(p=>p.name&&p.name.length>0))==null?void 0:l.name)!=null?c:""),r}get description(){var n,i,s,l;let r=(i=(n=d(this,Lu).properties.details)==null?void 0:n.description)!=null?i:"";return r===""&&(r=(l=(s=this.locationProfiles.find(c=>c.description&&c.description.length>0))==null?void 0:s.description)!=null?l:""),r}get images(){var n,i,s,l,c;if(d(this,tf).images!=null)return d(this,tf).images;let r=(s=(i=(n=d(this,Lu).properties.details)==null?void 0:n.images)==null?void 0:i.map(p=>new Nd({mvfData:p,mapData:d(this,c0)})))!=null?s:[];return(r==null||r.length===0)&&(r=(c=(l=this.locationProfiles.find(p=>p.images.length>0))==null?void 0:l.images)!=null?c:[]),d(this,tf).images=r,r}get links(){var n,i,s,l,c;if(d(this,tf).links!=null)return d(this,tf).links;let r=(s=(i=(n=d(this,Lu).properties.details)==null?void 0:n.links)==null?void 0:i.map(p=>new Dd({mvfData:p})))!=null?s:[];return(r==null||r.length===0)&&(r=(c=(l=this.locationProfiles.find(p=>p.links.length>0))==null?void 0:l.links)!=null?c:[]),d(this,tf).links=r,r}get locationProfiles(){var r;return(r=d(this,c0).locationProfilesByAttachedFeatureId[this.id])!=null?r:[]}};c0=new WeakMap,Lu=new WeakMap,tf=new WeakMap,o(GE,"DetailedMapData");var cs=GE;var Rb,ym,p0,f0,gm=class gm extends cs{constructor(r,n){super(r,n.mvfData);x(this,"__type",gm.__type);G(this,Rb);G(this,ym);G(this,p0,{});G(this,f0);q(this,Rb,r),q(this,ym,n.floorId),q(this,f0,n.mvfData)}static is(r){return r.__type===gm.__type}get center(){var r;if(d(this,p0).center==null){let[n,i]=(r=d(this,f0).properties.center)!=null?r:[0,0];d(this,p0).center=new Ct(i,n,d(this,ym))}return d(this,p0).center}get floor(){let r=d(this,Rb).getById("floor",d(this,ym));if(r==null)throw new Error("Floor ".concat(d(this,ym)," not found!"));return r}get geoJSON(){return re(k({},d(this,f0)),{properties:null})}get focusTarget(){return this}get anchorTarget(){return this.center}toJSON(){return{__type:gm.__type,id:this.id,name:this.name,floor:this.floor.id}}destroy(){}};Rb=new WeakMap,ym=new WeakMap,p0=new WeakMap,f0=new WeakMap,o(gm,"Area"),x(gm,"__type","area");var UE=gm,rf=UE;g();var bm,nf,xm,d0,vm=class vm extends cs{constructor(r,n){super(r,n.mvfData);x(this,"__type",vm.__type);G(this,bm);G(this,nf);G(this,xm);G(this,d0);q(this,nf,{}),q(this,d0,n.mvfData),q(this,bm,r),q(this,xm,n.floorId)}static is(r){return r.__type===vm.__type}get floor(){let r=d(this,bm).getById("floor",d(this,xm));if(r==null)throw new Error("Floor ".concat(d(this,xm)," not found!"));return r}get center(){if(d(this,nf).center==null){let[[r,n],[i,s]]=d(this,d0).geometry.coordinates,l=(r+i)/2,c=(n+s)/2;d(this,nf).center=new Ct(c,l,d(this,xm))}return d(this,nf).center}get isExterior(){var i;let r=d(this,bm).obstructionIdByEntranceId[this.id],n=d(this,bm).getMVFFeatureById("obstruction",r);return(i=n==null?void 0:n.properties.footprintComponent)!=null?i:!1}get geoJSON(){return re(k({},d(this,d0)),{properties:null})}get focusTarget(){return this.center}get anchorTarget(){return this.center}toJSON(){return{__type:vm.__type,id:this.id,name:this.name,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let r of Object.keys(d(this,nf)))delete d(this,nf)[r]}};bm=new WeakMap,nf=new WeakMap,xm=new WeakMap,d0=new WeakMap,o(vm,"Door"),x(vm,"__type","door");var VE=vm,Au=VE;g();var kd,_m,il,Fc,Im=class Im extends cs{constructor(r,n){super(r,n.mvfData);x(this,"__type",Im.__type);G(this,kd);G(this,_m);G(this,il,{});G(this,Fc);q(this,kd,r),q(this,_m,n.floorId),q(this,Fc,n.mvfData)}getMvfData(){return d(this,Fc)}static is(r){return r.__type===Im.__type}get type(){return zse(d(this,Fc).properties.kind)}get locations(){if(d(this,il).locations)return d(this,il).locations;d(this,il).locations=[];let r=d(this,kd).mvfLocationsBySpaceId[d(this,Fc).properties.id];if((r==null?void 0:r.length)>0)for(let n of r){let i=d(this,kd).getById("enterprise-location",n.id);i&&d(this,il).locations.push(i)}return d(this,il).locations}get floor(){let r=d(this,kd).getById("floor",d(this,_m));if(r==null)throw new Error("Floor ".concat(d(this,_m)," not found!"));return r}get doors(){return d(this,Fc).properties.destinationNodes.reduce((r,n)=>{let i=d(this,kd).doorsByNodeId[n];return i&&r.push(i),r},[])}get center(){var r;if(d(this,il).center==null){let[n,i]=(r=d(this,Fc).properties.center)!=null?r:[0,0];d(this,il).center=new Ct(i,n,d(this,_m))}return d(this,il).center}get geoJSON(){return re(k({},d(this,Fc)),{properties:null})}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}get anchorTarget(){return this.center}toJSON(){return{__type:Im.__type,id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let r of Object.keys(d(this,il)))delete d(this,il)[r]}};kd=new WeakMap,_m=new WeakMap,il=new WeakMap,Fc=new WeakMap,o(Im,"Space"),x(Im,"__type","space");var zE=Im,Vse=["room","hallway","exterior","void","connection.stairs","connection.elevator","poi"];function zse(e){if(e==null||e==="default")return"room";let t=e.toLowerCase();return Vse.includes(t)?t:"room"}o(zse,"validateSpaceType");var wo=zE;g();g();g();g();function Oi(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if(e.type==="Feature"&&e.geometry!==null&&e.geometry.type==="Point")return e.geometry.coordinates;if(e.type==="Point")return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")}o(Oi,"getCoord");function Un(e){if(Array.isArray(e))return e;if(e.type==="Feature"){if(e.geometry!==null)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}o(Un,"getCoords");function qE(e,t,r){if(!e)throw new Error("No feature passed");if(!r)throw new Error(".featureOf() requires a name");if(!e||e.type!=="Feature"||!e.geometry)throw new Error("Invalid input to "+r+", Feature with geometry required");if(!e.geometry||e.geometry.type!==t)throw new Error("Invalid input to "+r+": must be a "+t+", given "+e.geometry.type)}o(qE,"featureOf");function fo(e){return e.type==="Feature"?e.geometry:e}o(fo,"getGeom");function ol(e,t){return e.type==="FeatureCollection"?"FeatureCollection":e.type==="GeometryCollection"?"GeometryCollection":e.type==="Feature"&&e.geometry!==null?e.geometry.type:e.type}o(ol,"getType");var Zse=Pn(CS(),1);g();var sae=Pn(Tk(),1);g();g();function ci(e,t,r){if(r===void 0&&(r={}),!e)throw new Error("point is required");if(!t)throw new Error("polygon is required");var n=Oi(e),i=fo(t),s=i.type,l=t.bbox,c=i.coordinates;if(l&&aae(n,l)===!1)return!1;s==="Polygon"&&(c=[c]);for(var p=!1,h=0;h<c.length&&!p;h++)if(Ek(n,c[h][0],r.ignoreBoundary)){for(var y=!1,b=1;b<c[h].length&&!y;)Ek(n,c[h][b],!r.ignoreBoundary)&&(y=!0),b++;y||(p=!0)}return p}o(ci,"booleanPointInPolygon");function Ek(e,t,r){var n=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var i=0,s=t.length-1;i<t.length;s=i++){var l=t[i][0],c=t[i][1],p=t[s][0],h=t[s][1],y=e[1]*(l-p)+c*(p-e[0])+h*(e[0]-l)===0&&(l-e[0])*(p-e[0])<=0&&(c-e[1])*(h-e[1])<=0;if(y)return!r;var b=c>e[1]!=h>e[1]&&e[0]<(p-l)*(e[1]-c)/(h-c)+l;b&&(n=!n)}return n}o(Ek,"inRing");function aae(e,t){return t[0]<=e[0]&&t[1]<=e[1]&&t[2]>=e[0]&&t[3]>=e[1]}o(aae,"inBBox");g();g();function lae(e,t,r){r===void 0&&(r={});var n=Oi(e),i=Oi(t),s=Ho(i[1]-n[1]),l=Ho(i[0]-n[0]),c=Ho(n[1]),p=Ho(i[1]),h=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(l/2),2)*Math.cos(c)*Math.cos(p);return mS(2*Math.atan2(Math.sqrt(h),Math.sqrt(1-h)),r.units)}o(lae,"distance");var _i=lae;g();var IDe=function(){function e(t,r,n){this.a=t,this.b=r,this.c=n;var i=r.x-t.x,s=r.y-t.y,l=n.x-t.x,c=n.y-t.y,p=i*(t.x+r.x)+s*(t.y+r.y),h=l*(t.x+n.x)+c*(t.y+n.y),y=2*(i*(n.y-r.y)-s*(n.x-r.x)),b,_;this.x=(c*p-s*h)/y,this.y=(i*h-l*p)/y,b=this.x-t.x,_=this.y-t.y,this.r=b*b+_*_}return o(e,"Triangle"),e}();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();var Ok=new ArrayBuffer(16),uFe=new Float64Array(Ok),cFe=new Uint32Array(Ok);g();g();g();g();g();g();var Sae=Pn(oM(),1);g();g();g();g();g();var bke=function(){function e(t){this.points=t.points||[],this.duration=t.duration||1e4,this.sharpness=t.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=t.stepLength||60,this.length=this.points.length,this.delay=0;for(var r=0;r<this.length;r++)this.points[r].z=this.points[r].z||0;for(var r=0;r<this.length-1;r++){var n=this.points[r],i=this.points[r+1];this.centers.push({x:(n.x+i.x)/2,y:(n.y+i.y)/2,z:(n.z+i.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var r=0;r<this.centers.length-1;r++){var s=this.points[r+1].x-(this.centers[r].x+this.centers[r+1].x)/2,l=this.points[r+1].y-(this.centers[r].y+this.centers[r+1].y)/2,c=this.points[r+1].z-(this.centers[r].y+this.centers[r+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[r+1].x+this.sharpness*(this.centers[r].x+s),y:(1-this.sharpness)*this.points[r+1].y+this.sharpness*(this.centers[r].y+l),z:(1-this.sharpness)*this.points[r+1].z+this.sharpness*(this.centers[r].z+c)},{x:(1-this.sharpness)*this.points[r+1].x+this.sharpness*(this.centers[r+1].x+s),y:(1-this.sharpness)*this.points[r+1].y+this.sharpness*(this.centers[r+1].y+l),z:(1-this.sharpness)*this.points[r+1].z+this.sharpness*(this.centers[r+1].z+c)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}return o(e,"Spline"),e.prototype.cacheSteps=function(t){var r=[],n=this.pos(0);r.push(0);for(var i=0;i<this.duration;i+=10){var s=this.pos(i),l=Math.sqrt((s.x-n.x)*(s.x-n.x)+(s.y-n.y)*(s.y-n.y)+(s.z-n.z)*(s.z-n.z));l>t&&(r.push(i),n=s)}return r},e.prototype.vector=function(t){var r=this.pos(t+10),n=this.pos(t-10);return{angle:180*Math.atan2(r.y-n.y,r.x-n.x)/3.14,speed:Math.sqrt((n.x-r.x)*(n.x-r.x)+(n.y-r.y)*(n.y-r.y)+(n.z-r.z)*(n.z-r.z))}},e.prototype.pos=function(t){var r=t-this.delay;r<0&&(r=0),r>this.duration&&(r=this.duration-1);var n=r/this.duration;if(n>=1)return this.points[this.length-1];var i=Math.floor((this.points.length-1)*n),s=(this.length-1)*n-i;return Cae(s,this.points[i],this.controls[i][1],this.controls[i+1][0],this.points[i+1])},e}();function Cae(e,t,r,n,i){var s=wae(e),l={x:i.x*s[0]+n.x*s[1]+r.x*s[2]+t.x*s[3],y:i.y*s[0]+n.y*s[1]+r.y*s[2]+t.y*s[3],z:i.z*s[0]+n.z*s[1]+r.z*s[2]+t.z*s[3]};return l}o(Cae,"bezier");function wae(e){var t=e*e,r=t*e;return[r,3*t*(1-e),3*e*(1-e)*(1-e),(1-e)*(1-e)*(1-e)]}o(wae,"B");g();g();g();g();function Gb(e,t){t===void 0&&(t={});var r=Number(e[0]),n=Number(e[1]),i=Number(e[2]),s=Number(e[3]);if(e.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var l=[r,n],c=[r,s],p=[i,s],h=[i,n];return Gn([[l,h,p,c,l]],t.properties,{bbox:e,id:t.id})}o(Gb,"bboxPolygon");function Pae(e){return Gb(po(e))}o(Pae,"envelope");var sM=Pae;g();g();g();function sl(e,t,r,n){n===void 0&&(n={});var i=Oi(e),s=Ho(i[0]),l=Ho(i[1]),c=Ho(r),p=gS(t,n.units),h=Math.asin(Math.sin(l)*Math.cos(p)+Math.cos(l)*Math.sin(p)*Math.cos(c)),y=s+Math.atan2(Math.sin(c)*Math.sin(p)*Math.cos(l),Math.cos(p)-Math.sin(l)*Math.sin(h)),b=om(y),_=om(h);return Tn([b,_],n.properties)}o(sl,"destination");g();g();function of(e,t,r){if(r===void 0&&(r={}),r.final===!0)return Tae(e,t);var n=Oi(e),i=Oi(t),s=Ho(n[0]),l=Ho(i[0]),c=Ho(n[1]),p=Ho(i[1]),h=Math.sin(l-s)*Math.cos(p),y=Math.cos(c)*Math.sin(p)-Math.sin(c)*Math.cos(p)*Math.cos(l-s);return om(Math.atan2(h,y))}o(of,"bearing");function Tae(e,t){var r=of(t,e);return r=(r+180)%360,r}o(Tae,"calculateFinalBearing");g();function Eae(e,t){t===void 0&&(t={});var r=po(e),n=(r[0]+r[2])/2,i=(r[1]+r[3])/2;return Tn([n,i],t.properties,t)}o(Eae,"center");var Nc=Eae;g();g();g();g();g();var Oae=Pn(Gse(),1);g();g();g();g();function Lae(e){if(!e)throw new Error("geojson is required");var t=[];return So(e,function(r){Aae(r,t)}),er(t)}o(Lae,"lineSegment");function Aae(e,t){var r=[],n=e.geometry;if(n!==null){switch(n.type){case"Polygon":r=Un(n);break;case"LineString":r=[Un(n)]}r.forEach(function(i){var s=Dae(i,e.properties);s.forEach(function(l){l.id=t.length,t.push(l)})})}}o(Aae,"lineSegmentFeature");function Dae(e,t){var r=[];return e.reduce(function(n,i){var s=Bi([n,i],t);return s.bbox=Fae(n,i),r.push(s),i}),r}o(Dae,"createSegments");function Fae(e,t){var r=e[0],n=e[1],i=t[0],s=t[1],l=r<i?r:i,c=n<s?n:s,p=r>i?r:i,h=n>s?n:s;return[l,c,p,h]}o(Fae,"bbox");var Cm=Lae;var Kk=Pn(kS(),1);function ale(e,t){var r={},n=[];if(e.type==="LineString"&&(e=Oc(e)),t.type==="LineString"&&(t=Oc(t)),e.type==="Feature"&&t.type==="Feature"&&e.geometry!==null&&t.geometry!==null&&e.geometry.type==="LineString"&&t.geometry.type==="LineString"&&e.geometry.coordinates.length===2&&t.geometry.coordinates.length===2){var i=Zk(e,t);return i&&n.push(i),er(n)}var s=(0,Kk.default)();return s.load(Cm(t)),ti(Cm(e),function(l){ti(s.search(l),function(c){var p=Zk(l,c);if(p){var h=Un(p).join(",");r[h]||(r[h]=!0,n.push(p))}})}),er(n)}o(ale,"lineIntersect");function Zk(e,t){var r=Un(e),n=Un(t);if(r.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(n.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var i=r[0][0],s=r[0][1],l=r[1][0],c=r[1][1],p=n[0][0],h=n[0][1],y=n[1][0],b=n[1][1],_=(b-h)*(l-i)-(y-p)*(c-s),C=(y-p)*(s-h)-(b-h)*(i-p),P=(l-i)*(s-h)-(c-s)*(i-p);if(_===0)return null;var E=C/_,T=P/_;if(E>=0&&E<=1&&T>=0&&T<=1){var O=i+E*(l-i),D=s+E*(c-s);return Tn([O,D])}return null}o(Zk,"intersects");var Rc=ale;function lle(e,t,r){r===void 0&&(r={});var n=Tn([1/0,1/0],{dist:1/0}),i=0;return So(e,function(s){for(var l=Un(s),c=0;c<l.length-1;c++){var p=Tn(l[c]);p.properties.dist=_i(t,p,r);var h=Tn(l[c+1]);h.properties.dist=_i(t,h,r);var y=_i(p,h,r),b=Math.max(p.properties.dist,h.properties.dist),_=of(p,h),C=sl(t,b,_+90,r),P=sl(t,b,_-90,r),E=Rc(Bi([C.geometry.coordinates,P.geometry.coordinates]),Bi([p.geometry.coordinates,h.geometry.coordinates])),T=null;E.features.length>0&&(T=E.features[0],T.properties.dist=_i(t,T,r),T.properties.location=i+_i(p,T,r)),p.properties.dist<n.properties.dist&&(n=p,n.properties.index=c,n.properties.location=i),h.properties.dist<n.properties.dist&&(n=h,n.properties.index=c+1,n.properties.location=i+y),T&&T.properties.dist<n.properties.dist&&(n=T,n.properties.index=c),i+=y}}),n}o(lle,"nearestPointOnLine");var sf=lle;g();g();g();var cle=Pn(CS(),1);g();g();g();g();g();g();function wm(e,t){return t===void 0&&(t={}),zN(e,function(r,n){var i=n.geometry.coordinates;return r+_i(i[0],i[1],t)},0)}o(wm,"length");g();function ple(e,t,r){var n=Un(r);if(ol(r)!=="LineString")throw new Error("line must be a LineString");var i=sf(r,e),s=sf(r,t),l;i.properties.index<=s.properties.index?l=[i,s]:l=[s,i];for(var c=[l[0].geometry.coordinates],p=l[0].properties.index+1;p<l[1].properties.index+1;p++)c.push(n[p]);return c.push(l[1].geometry.coordinates),Bi(c,r.properties)}o(ple,"lineSlice");var BS=ple;g();g();g();g();function fle(e,t,r){r===void 0&&(r={});for(var n=Oi(e),i=Un(t),s=0;s<i.length-1;s++){var l=!1;if(r.ignoreEndVertices&&(s===0&&(l="start"),s===i.length-2&&(l="end"),s===0&&s+1===i.length-1&&(l="both")),dle(i[s],i[s+1],n,l,typeof r.epsilon>"u"?null:r.epsilon))return!0}return!1}o(fle,"booleanPointOnLine");function dle(e,t,r,n,i){var s=r[0],l=r[1],c=e[0],p=e[1],h=t[0],y=t[1],b=r[0]-c,_=r[1]-p,C=h-c,P=y-p,E=b*P-_*C;if(i!==null){if(Math.abs(E)>i)return!1}else if(E!==0)return!1;if(n){if(n==="start")return Math.abs(C)>=Math.abs(P)?C>0?c<s&&s<=h:h<=s&&s<c:P>0?p<l&&l<=y:y<=l&&l<p;if(n==="end")return Math.abs(C)>=Math.abs(P)?C>0?c<=s&&s<h:h<s&&s<=c:P>0?p<=l&&l<y:y<l&&l<=p;if(n==="both")return Math.abs(C)>=Math.abs(P)?C>0?c<s&&s<h:h<s&&s<c:P>0?p<l&&l<y:y<l&&l<p}else return Math.abs(C)>=Math.abs(P)?C>0?c<=s&&s<=h:h<=s&&s<=c:P>0?p<=l&&l<=y:y<=l&&l<=p;return!1}o(dle,"isPointOnLineSegment");var x0=fle;g();g();g();g();var gle=Pn(oM(),1);g();var tR=Math.PI/180,rR=180/Math.PI,Vb=o(function(e,t){this.lon=e,this.lat=t,this.x=tR*e,this.y=tR*t},"Coord");Vb.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)};Vb.prototype.antipode=function(){var e=-1*this.lat,t=this.lon<0?180+this.lon:(180-this.lon)*-1;return new Vb(t,e)};var nR=o(function(){this.coords=[],this.length=0},"LineString");nR.prototype.move_to=function(e){this.length++,this.coords.push(e)};var xM=o(function(e){this.properties=e||{},this.geometries=[]},"Arc");xM.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(this.geometries.length===1)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var e=[],t=0;t<this.geometries.length;t++)e.push(this.geometries[t].coords);return{geometry:{type:"MultiLineString",coordinates:e},type:"Feature",properties:this.properties}};xM.prototype.wkt=function(){for(var e="",t="LINESTRING(",r=o(function(s){t+=s[0]+" "+s[1]+","},"collect"),n=0;n<this.geometries.length;n++){if(this.geometries[n].coords.length===0)return"LINESTRING(empty)";var i=this.geometries[n].coords;i.forEach(r),e+=t.substring(0,t.length-1)+")"}return e};var iR=o(function(e,t,r){if(!e||e.x===void 0||e.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!t||t.x===void 0||t.y===void 0)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new Vb(e.x,e.y),this.end=new Vb(t.x,t.y),this.properties=r||{};var n=this.start.x-this.end.x,i=this.start.y-this.end.y,s=Math.pow(Math.sin(i/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(n/2),2);if(this.g=2*Math.asin(Math.sqrt(s)),this.g===Math.PI)throw new Error("it appears "+e.view()+" and "+t.view()+" are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+e+" and "+t)},"GreatCircle");iR.prototype.interpolate=function(e){var t=Math.sin((1-e)*this.g)/Math.sin(this.g),r=Math.sin(e*this.g)/Math.sin(this.g),n=t*Math.cos(this.start.y)*Math.cos(this.start.x)+r*Math.cos(this.end.y)*Math.cos(this.end.x),i=t*Math.cos(this.start.y)*Math.sin(this.start.x)+r*Math.cos(this.end.y)*Math.sin(this.end.x),s=t*Math.sin(this.start.y)+r*Math.sin(this.end.y),l=rR*Math.atan2(s,Math.sqrt(Math.pow(n,2)+Math.pow(i,2))),c=rR*Math.atan2(i,n);return[c,l]};iR.prototype.Arc=function(e,t){var r=[];if(!e||e<=2)r.push([this.start.lon,this.start.lat]),r.push([this.end.lon,this.end.lat]);else for(var n=1/(e-1),i=0;i<e;++i){var s=n*i,l=this.interpolate(s);r.push(l)}for(var c=!1,p=0,h=t&&t.offset?t.offset:10,y=180-h,b=-180+h,_=360-h,C=1;C<r.length;++C){var P=r[C-1][0],E=r[C][0],T=Math.abs(E-P);T>_&&(E>y&&P<b||P>y&&E<b)?c=!0:T>p&&(p=T)}var O=[];if(c&&p<h){var D=[];O.push(D);for(var A=0;A<r.length;++A){var R=parseFloat(r[A][0]);if(A>0&&Math.abs(R-r[A-1][0])>_){var j=parseFloat(r[A-1][0]),X=parseFloat(r[A-1][1]),Y=parseFloat(r[A][0]),N=parseFloat(r[A][1]);if(j>-180&&j<b&&Y===180&&A+1<r.length&&r[A-1][0]>-180&&r[A-1][0]<b){D.push([-180,r[A][1]]),A++,D.push([r[A][0],r[A][1]]);continue}else if(j>y&&j<180&&Y===-180&&A+1<r.length&&r[A-1][0]>y&&r[A-1][0]<180){D.push([180,r[A][1]]),A++,D.push([r[A][0],r[A][1]]);continue}if(j<b&&Y>y){var Z=j;j=Y,Y=Z;var ae=X;X=N,N=ae}if(j>y&&Y<b&&(Y+=360),j<=180&&Y>=180&&j<Y){var se=(180-j)/(Y-j),U=se*N+(1-se)*X;D.push([r[A-1][0]>y?180:-180,U]),D=[],D.push([r[A-1][0]>y?-180:180,U]),O.push(D)}else D=[],O.push(D);D.push([R,r[A][1]])}else D.push([r[A][0],r[A][1]])}}else{var xe=[];O.push(xe);for(var ne=0;ne<r.length;++ne)xe.push([r[ne][0],r[ne][1]])}for(var Pe=new xM(this.properties),Ce=0;Ce<O.length;++Ce){var Ue=new nR;Pe.geometries.push(Ue);for(var _e=O[Ce],Me=0;Me<_e.length;++Me)Ue.move_to(_e[Me])}return Pe};g();var ble=Pn(kS(),1);g();g();function Pm(e,t){t===void 0&&(t={});var r=fo(e);switch(!t.properties&&e.type==="Feature"&&(t.properties=e.properties),r.type){case"Polygon":return sR(r,t);case"MultiPolygon":return xle(r,t);default:throw new Error("invalid poly")}}o(Pm,"default");function sR(e,t){t===void 0&&(t={});var r=fo(e),n=r.coordinates,i=t.properties?t.properties:e.type==="Feature"?e.properties:{};return aR(n,i)}o(sR,"polygonToLine");function xle(e,t){t===void 0&&(t={});var r=fo(e),n=r.coordinates,i=t.properties?t.properties:e.type==="Feature"?e.properties:{},s=[];return n.forEach(function(l){s.push(aR(l,i))}),er(s)}o(xle,"multiPolygonToLine");function aR(e,t){return e.length>1?n0(e,t):Bi(e[0],t)}o(aR,"coordsToLine");g();g();g();g();var bce=Pn(kS(),1);var xce=Pn(XM(),1);g();g();g();g();g();g();g();var Sce=Pn(CS(),1);var tr=[],rr=[],nr=[],or=[],sr=[],ar=[],lr=[],ur=[],cr=[],pr=[],fr=[],dr=[],hr=[],mr=[],gr=[],yr=[],vr=[],br=[],xr=[],Ir=[],_r=[],Sr=[],Cr=[],wr=[];lr[85]=pr[85]=-1;ur[85]=fr[85]=0;cr[85]=dr[85]=1;xr[85]=Sr[85]=1;Ir[85]=Cr[85]=0;_r[85]=wr[85]=1;tr[85]=or[85]=0;rr[85]=sr[85]=-1;nr[85]=gr[85]=0;yr[85]=hr[85]=0;vr[85]=mr[85]=1;ar[85]=br[85]=1;Sr[1]=Sr[169]=0;Cr[1]=Cr[169]=-1;wr[1]=wr[169]=0;hr[1]=hr[169]=-1;mr[1]=mr[169]=0;gr[1]=gr[169]=0;pr[4]=pr[166]=0;fr[4]=fr[166]=-1;dr[4]=dr[166]=1;yr[4]=yr[166]=1;vr[4]=vr[166]=0;br[4]=br[166]=0;lr[16]=lr[154]=0;ur[16]=ur[154]=1;cr[16]=cr[154]=1;or[16]=or[154]=1;sr[16]=sr[154]=0;ar[16]=ar[154]=1;xr[64]=xr[106]=0;Ir[64]=Ir[106]=1;_r[64]=_r[106]=0;tr[64]=tr[106]=-1;rr[64]=rr[106]=0;nr[64]=nr[106]=1;xr[2]=xr[168]=0;Ir[2]=Ir[168]=-1;_r[2]=_r[168]=1;Sr[2]=Sr[168]=0;Cr[2]=Cr[168]=-1;wr[2]=wr[168]=0;hr[2]=hr[168]=-1;mr[2]=mr[168]=0;gr[2]=gr[168]=0;yr[2]=yr[168]=-1;vr[2]=vr[168]=0;br[2]=br[168]=1;lr[8]=lr[162]=0;ur[8]=ur[162]=-1;cr[8]=cr[162]=0;pr[8]=pr[162]=0;fr[8]=fr[162]=-1;dr[8]=dr[162]=1;hr[8]=hr[162]=1;mr[8]=mr[162]=0;gr[8]=gr[162]=1;yr[8]=yr[162]=1;vr[8]=vr[162]=0;br[8]=br[162]=0;lr[32]=lr[138]=0;ur[32]=ur[138]=1;cr[32]=cr[138]=1;pr[32]=pr[138]=0;fr[32]=fr[138]=1;dr[32]=dr[138]=0;tr[32]=tr[138]=1;rr[32]=rr[138]=0;nr[32]=nr[138]=0;or[32]=or[138]=1;sr[32]=sr[138]=0;ar[32]=ar[138]=1;Sr[128]=Sr[42]=0;Cr[128]=Cr[42]=1;wr[128]=wr[42]=1;xr[128]=xr[42]=0;Ir[128]=Ir[42]=1;_r[128]=_r[42]=0;tr[128]=tr[42]=-1;rr[128]=rr[42]=0;nr[128]=nr[42]=1;or[128]=or[42]=-1;sr[128]=sr[42]=0;ar[128]=ar[42]=0;pr[5]=pr[165]=-1;fr[5]=fr[165]=0;dr[5]=dr[165]=0;Sr[5]=Sr[165]=1;Cr[5]=Cr[165]=0;wr[5]=wr[165]=0;yr[20]=yr[150]=0;vr[20]=vr[150]=1;br[20]=br[150]=1;or[20]=or[150]=0;sr[20]=sr[150]=-1;ar[20]=ar[150]=1;lr[80]=lr[90]=-1;ur[80]=ur[90]=0;cr[80]=cr[90]=1;xr[80]=xr[90]=1;Ir[80]=Ir[90]=0;_r[80]=_r[90]=1;hr[65]=hr[105]=0;mr[65]=mr[105]=1;gr[65]=gr[105]=0;tr[65]=tr[105]=0;rr[65]=rr[105]=-1;nr[65]=nr[105]=0;lr[160]=lr[10]=-1;ur[160]=ur[10]=0;cr[160]=cr[10]=1;pr[160]=pr[10]=-1;fr[160]=fr[10]=0;dr[160]=dr[10]=0;Sr[160]=Sr[10]=1;Cr[160]=Cr[10]=0;wr[160]=wr[10]=0;xr[160]=xr[10]=1;Ir[160]=Ir[10]=0;_r[160]=_r[10]=1;yr[130]=yr[40]=0;vr[130]=vr[40]=1;br[130]=br[40]=1;hr[130]=hr[40]=0;mr[130]=mr[40]=1;gr[130]=gr[40]=0;tr[130]=tr[40]=0;rr[130]=rr[40]=-1;nr[130]=nr[40]=0;or[130]=or[40]=0;sr[130]=sr[40]=-1;ar[130]=ar[40]=1;pr[37]=pr[133]=0;fr[37]=fr[133]=1;dr[37]=dr[133]=1;Sr[37]=Sr[133]=0;Cr[37]=Cr[133]=1;wr[37]=wr[133]=0;tr[37]=tr[133]=-1;rr[37]=rr[133]=0;nr[37]=nr[133]=0;or[37]=or[133]=1;sr[37]=sr[133]=0;ar[37]=ar[133]=0;yr[148]=yr[22]=-1;vr[148]=vr[22]=0;br[148]=br[22]=0;Sr[148]=Sr[22]=0;Cr[148]=Cr[22]=-1;wr[148]=wr[22]=1;xr[148]=xr[22]=0;Ir[148]=Ir[22]=1;_r[148]=_r[22]=1;or[148]=or[22]=-1;sr[148]=sr[22]=0;ar[148]=ar[22]=1;lr[82]=lr[88]=0;ur[82]=ur[88]=-1;cr[82]=cr[88]=1;yr[82]=yr[88]=1;vr[82]=vr[88]=0;br[82]=br[88]=1;hr[82]=hr[88]=-1;mr[82]=mr[88]=0;gr[82]=gr[88]=1;xr[82]=xr[88]=0;Ir[82]=Ir[88]=-1;_r[82]=_r[88]=0;lr[73]=lr[97]=0;ur[73]=ur[97]=1;cr[73]=cr[97]=0;pr[73]=pr[97]=0;fr[73]=fr[97]=-1;dr[73]=dr[97]=0;hr[73]=hr[97]=1;mr[73]=mr[97]=0;gr[73]=gr[97]=0;tr[73]=tr[97]=1;rr[73]=rr[97]=0;nr[73]=nr[97]=1;lr[145]=lr[25]=0;ur[145]=ur[25]=-1;cr[145]=cr[25]=0;hr[145]=hr[25]=1;mr[145]=mr[25]=0;gr[145]=gr[25]=1;Sr[145]=Sr[25]=0;Cr[145]=Cr[25]=1;wr[145]=wr[25]=1;or[145]=or[25]=-1;sr[145]=sr[25]=0;ar[145]=ar[25]=0;pr[70]=pr[100]=0;fr[70]=fr[100]=1;dr[70]=dr[100]=0;yr[70]=yr[100]=-1;vr[70]=vr[100]=0;br[70]=br[100]=1;xr[70]=xr[100]=0;Ir[70]=Ir[100]=-1;_r[70]=_r[100]=1;tr[70]=tr[100]=1;rr[70]=rr[100]=0;nr[70]=nr[100]=0;pr[101]=pr[69]=0;fr[101]=fr[69]=1;dr[101]=dr[69]=0;tr[101]=tr[69]=1;rr[101]=rr[69]=0;nr[101]=nr[69]=0;Sr[149]=Sr[21]=0;Cr[149]=Cr[21]=1;wr[149]=wr[21]=1;or[149]=or[21]=-1;sr[149]=sr[21]=0;ar[149]=ar[21]=0;yr[86]=yr[84]=-1;vr[86]=vr[84]=0;br[86]=br[84]=1;xr[86]=xr[84]=0;Ir[86]=Ir[84]=-1;_r[86]=_r[84]=1;lr[89]=lr[81]=0;ur[89]=ur[81]=-1;cr[89]=cr[81]=0;hr[89]=hr[81]=1;mr[89]=mr[81]=0;gr[89]=gr[81]=1;lr[96]=lr[74]=0;ur[96]=ur[74]=1;cr[96]=cr[74]=0;pr[96]=pr[74]=-1;fr[96]=fr[74]=0;dr[96]=dr[74]=1;xr[96]=xr[74]=1;Ir[96]=Ir[74]=0;_r[96]=_r[74]=0;tr[96]=tr[74]=1;rr[96]=rr[74]=0;nr[96]=nr[74]=1;lr[24]=lr[146]=0;ur[24]=ur[146]=-1;cr[24]=cr[146]=1;yr[24]=yr[146]=1;vr[24]=vr[146]=0;br[24]=br[146]=1;hr[24]=hr[146]=0;mr[24]=mr[146]=1;gr[24]=gr[146]=1;or[24]=or[146]=0;sr[24]=sr[146]=-1;ar[24]=ar[146]=0;pr[6]=pr[164]=-1;fr[6]=fr[164]=0;dr[6]=dr[164]=1;yr[6]=yr[164]=-1;vr[6]=vr[164]=0;br[6]=br[164]=0;Sr[6]=Sr[164]=0;Cr[6]=Cr[164]=-1;wr[6]=wr[164]=1;xr[6]=xr[164]=1;Ir[6]=Ir[164]=0;_r[6]=_r[164]=0;hr[129]=hr[41]=0;mr[129]=mr[41]=1;gr[129]=gr[41]=1;Sr[129]=Sr[41]=0;Cr[129]=Cr[41]=1;wr[129]=wr[41]=0;tr[129]=tr[41]=-1;rr[129]=rr[41]=0;nr[129]=nr[41]=0;or[129]=or[41]=0;sr[129]=sr[41]=-1;ar[129]=ar[41]=0;yr[66]=yr[104]=0;vr[66]=vr[104]=1;br[66]=br[104]=0;hr[66]=hr[104]=-1;mr[66]=mr[104]=0;gr[66]=gr[104]=1;xr[66]=xr[104]=0;Ir[66]=Ir[104]=-1;_r[66]=_r[104]=0;tr[66]=tr[104]=0;rr[66]=rr[104]=-1;nr[66]=nr[104]=1;lr[144]=lr[26]=-1;ur[144]=ur[26]=0;cr[144]=cr[26]=0;Sr[144]=Sr[26]=1;Cr[144]=Cr[26]=0;wr[144]=wr[26]=1;xr[144]=xr[26]=0;Ir[144]=Ir[26]=1;_r[144]=_r[26]=1;or[144]=or[26]=-1;sr[144]=sr[26]=0;ar[144]=ar[26]=1;pr[36]=pr[134]=0;fr[36]=fr[134]=1;dr[36]=dr[134]=1;yr[36]=yr[134]=0;vr[36]=vr[134]=1;br[36]=br[134]=0;tr[36]=tr[134]=0;rr[36]=rr[134]=-1;nr[36]=nr[134]=1;or[36]=or[134]=1;sr[36]=sr[134]=0;ar[36]=ar[134]=0;lr[9]=lr[161]=-1;ur[9]=ur[161]=0;cr[9]=cr[161]=0;pr[9]=pr[161]=0;fr[9]=fr[161]=-1;dr[9]=dr[161]=0;hr[9]=hr[161]=1;mr[9]=mr[161]=0;gr[9]=gr[161]=0;Sr[9]=Sr[161]=1;Cr[9]=Cr[161]=0;wr[9]=wr[161]=1;lr[136]=0;ur[136]=1;cr[136]=1;pr[136]=0;fr[136]=1;dr[136]=0;yr[136]=-1;vr[136]=0;br[136]=1;hr[136]=-1;mr[136]=0;gr[136]=0;Sr[136]=0;Cr[136]=-1;wr[136]=0;xr[136]=0;Ir[136]=-1;_r[136]=1;tr[136]=1;rr[136]=0;nr[136]=0;or[136]=1;sr[136]=0;ar[136]=1;lr[34]=0;ur[34]=-1;cr[34]=0;pr[34]=0;fr[34]=-1;dr[34]=1;yr[34]=1;vr[34]=0;br[34]=0;hr[34]=1;mr[34]=0;gr[34]=1;Sr[34]=0;Cr[34]=1;wr[34]=1;xr[34]=0;Ir[34]=1;_r[34]=0;tr[34]=-1;rr[34]=0;nr[34]=1;or[34]=-1;sr[34]=0;ar[34]=0;lr[35]=0;ur[35]=1;cr[35]=1;pr[35]=0;fr[35]=-1;dr[35]=1;yr[35]=1;vr[35]=0;br[35]=0;hr[35]=-1;mr[35]=0;gr[35]=0;Sr[35]=0;Cr[35]=-1;wr[35]=0;xr[35]=0;Ir[35]=1;_r[35]=0;tr[35]=-1;rr[35]=0;nr[35]=1;or[35]=1;sr[35]=0;ar[35]=1;lr[153]=0;ur[153]=1;cr[153]=1;hr[153]=-1;mr[153]=0;gr[153]=0;Sr[153]=0;Cr[153]=-1;wr[153]=0;or[153]=1;sr[153]=0;ar[153]=1;pr[102]=0;fr[102]=-1;dr[102]=1;yr[102]=1;vr[102]=0;br[102]=0;xr[102]=0;Ir[102]=1;_r[102]=0;tr[102]=-1;rr[102]=0;nr[102]=1;lr[155]=0;ur[155]=-1;cr[155]=0;hr[155]=1;mr[155]=0;gr[155]=1;Sr[155]=0;Cr[155]=1;wr[155]=1;or[155]=-1;sr[155]=0;ar[155]=0;pr[103]=0;fr[103]=1;dr[103]=0;yr[103]=-1;vr[103]=0;br[103]=1;xr[103]=0;Ir[103]=-1;_r[103]=1;tr[103]=1;rr[103]=0;nr[103]=0;lr[152]=0;ur[152]=1;cr[152]=1;yr[152]=-1;vr[152]=0;br[152]=1;hr[152]=-1;mr[152]=0;gr[152]=0;Sr[152]=0;Cr[152]=-1;wr[152]=0;xr[152]=0;Ir[152]=-1;_r[152]=1;or[152]=1;sr[152]=0;ar[152]=1;lr[156]=0;ur[156]=-1;cr[156]=1;yr[156]=1;vr[156]=0;br[156]=1;hr[156]=-1;mr[156]=0;gr[156]=0;Sr[156]=0;Cr[156]=-1;wr[156]=0;xr[156]=0;Ir[156]=1;_r[156]=1;or[156]=-1;sr[156]=0;ar[156]=1;lr[137]=0;ur[137]=1;cr[137]=1;pr[137]=0;fr[137]=1;dr[137]=0;hr[137]=-1;mr[137]=0;gr[137]=0;Sr[137]=0;Cr[137]=-1;wr[137]=0;tr[137]=1;rr[137]=0;nr[137]=0;or[137]=1;sr[137]=0;ar[137]=1;lr[139]=0;ur[139]=1;cr[139]=1;pr[139]=0;fr[139]=-1;dr[139]=0;hr[139]=1;mr[139]=0;gr[139]=0;Sr[139]=0;Cr[139]=1;wr[139]=0;tr[139]=-1;rr[139]=0;nr[139]=0;or[139]=1;sr[139]=0;ar[139]=1;lr[98]=0;ur[98]=-1;cr[98]=0;pr[98]=0;fr[98]=-1;dr[98]=1;yr[98]=1;vr[98]=0;br[98]=0;hr[98]=1;mr[98]=0;gr[98]=1;xr[98]=0;Ir[98]=1;_r[98]=0;tr[98]=-1;rr[98]=0;nr[98]=1;lr[99]=0;ur[99]=1;cr[99]=0;pr[99]=0;fr[99]=-1;dr[99]=1;yr[99]=1;vr[99]=0;br[99]=0;hr[99]=-1;mr[99]=0;gr[99]=1;xr[99]=0;Ir[99]=-1;_r[99]=0;tr[99]=1;rr[99]=0;nr[99]=1;pr[38]=0;fr[38]=-1;dr[38]=1;yr[38]=1;vr[38]=0;br[38]=0;Sr[38]=0;Cr[38]=1;wr[38]=1;xr[38]=0;Ir[38]=1;_r[38]=0;tr[38]=-1;rr[38]=0;nr[38]=1;or[38]=-1;sr[38]=0;ar[38]=0;pr[39]=0;fr[39]=1;dr[39]=1;yr[39]=-1;vr[39]=0;br[39]=0;Sr[39]=0;Cr[39]=-1;wr[39]=1;xr[39]=0;Ir[39]=1;_r[39]=0;tr[39]=-1;rr[39]=0;nr[39]=1;or[39]=1;sr[39]=0;ar[39]=0;var YM=o(function(e){return[[e.bottomleft,0],[0,0],[0,e.leftbottom]]},"p00"),ZM=o(function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0]]},"p01"),KM=o(function(e){return[[e.topright,1],[1,1],[1,e.righttop]]},"p02"),JM=o(function(e){return[[0,e.lefttop],[0,1],[e.topleft,1]]},"p03"),QM=o(function(e){return[[e.bottomright,0],[e.bottomleft,0],[0,e.leftbottom],[0,e.lefttop]]},"p04"),eO=o(function(e){return[[e.bottomright,0],[e.bottomleft,0],[1,e.righttop],[1,e.rightbottom]]},"p05"),tO=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[e.topleft,1],[e.topright,1]]},"p06"),rO=o(function(e){return[[0,e.leftbottom],[0,e.lefttop],[e.topleft,1],[e.topright,1]]},"p07"),Cce=o(function(e){return[[0,0],[0,e.leftbottom],[1,e.rightbottom],[1,0]]},"p08"),wce=o(function(e){return[[1,0],[e.bottomright,0],[e.topright,1],[1,1]]},"p09"),Pce=o(function(e){return[[1,1],[1,e.righttop],[0,e.lefttop],[0,1]]},"p10"),Tce=o(function(e){return[[e.bottomleft,0],[0,0],[0,1],[e.topleft,1]]},"p11"),Ece=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[0,e.leftbottom],[0,e.lefttop]]},"p12"),Mce=o(function(e){return[[e.topleft,1],[e.topright,1],[e.bottomright,0],[e.bottomleft,0]]},"p13"),Oce=o(function(){return[[0,0],[0,1],[1,1],[1,0]]},"p14"),Lce=o(function(e){return[[1,e.rightbottom],[1,0],[0,0],[0,1],[e.topleft,1]]},"p15"),Ace=o(function(e){return[[e.topright,1],[1,1],[1,0],[0,0],[0,e.leftbottom]]},"p16"),Dce=o(function(e){return[[1,0],[e.bottomright,0],[0,e.lefttop],[0,1],[1,1]]},"p17"),Fce=o(function(e){return[[1,1],[1,e.righttop],[e.bottomleft,0],[0,0],[0,1]]},"p18"),Nce=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[0,e.lefttop],[0,1],[e.topleft,1]]},"p19"),kce=o(function(e){return[[1,1],[1,e.righttop],[e.bottomright,0],[e.bottomleft,0],[e.topright,1]]},"p20"),Rce=o(function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[0,e.leftbottom],[0,e.lefttop]]},"p21"),Bce=o(function(e){return[[e.topright,1],[e.bottomleft,0],[0,0],[0,e.leftbottom],[e.topleft,1]]},"p22"),$ce=o(function(e){return[[e.bottomright,0],[e.bottomleft,0],[0,e.lefttop],[0,1],[e.topleft,1]]},"p23"),jce=o(function(e){return[[1,1],[1,e.righttop],[0,e.leftbottom],[0,e.lefttop],[e.topright,1]]},"p24"),Gce=o(function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[e.topleft,1],[e.topright,1]]},"p25"),Uce=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[e.bottomleft,0],[0,0],[0,e.leftbottom]]},"p26"),Vce=o(function(e){return[[1,e.rightbottom],[1,0],[0,0],[0,e.leftbottom],[e.topleft,1],[e.topright,1]]},"p27"),zce=o(function(e){return[[1,1],[1,0],[e.bottomright,0],[0,e.leftbottom],[0,e.lefttop],[e.topright,1]]},"p28"),qce=o(function(e){return[[1,1],[1,e.righttop],[e.bottomright,0],[e.bottomleft,0],[0,e.lefttop],[0,1]]},"p29"),Hce=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[e.bottomleft,0],[0,0],[0,1],[e.topleft,1]]},"p30"),Wce=o(function(e){return[[1,1],[1,e.righttop],[e.bottomleft,0],[0,0],[0,e.leftbottom],[e.topright,1]]},"p31"),Xce=o(function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[0,e.lefttop],[0,1],[e.topleft,1]]},"p32"),Yce=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[e.bottomright,0],[e.bottomleft,0],[0,e.leftbottom],[0,e.lefttop],[e.topleft,1],[e.topright,1]]},"p33"),Zce=o(function(e){return[[1,1],[1,e.righttop],[e.bottomleft,0],[0,0],[0,e.leftbottom],[e.topright,1]]},"p34"),Kce=o(function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[0,e.lefttop],[0,1],[e.topleft,1]]},"p35"),Jce=o(function(e){return[[1,1],[1,e.righttop],[e.bottomright,0],[e.bottomleft,0],[0,e.leftbottom],[0,e.lefttop],[e.topright,1]]},"p36"),Qce=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[e.bottomleft,0],[0,0],[0,e.leftbottom],[e.topleft,1],[e.topright,1]]},"p37"),epe=o(function(e){return[[1,e.righttop],[1,e.rightbottom],[e.bottomright,0],[e.bottomleft,0],[0,e.lefttop],[0,1],[e.topleft,1]]},"p38"),tpe=o(function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[0,e.leftbottom],[0,e.lefttop],[e.topleft,1],[e.topright,1]]},"p39"),Fr=[],Nr=[],kr=[],Rr=[],Br=[],$r=[],jr=[],Gr=[];Rr[1]=Br[1]=18;Rr[169]=Br[169]=18;kr[4]=Nr[4]=12;kr[166]=Nr[166]=12;Fr[16]=Gr[16]=4;Fr[154]=Gr[154]=4;$r[64]=jr[64]=22;$r[106]=jr[106]=22;kr[2]=$r[2]=17;Rr[2]=Br[2]=18;kr[168]=$r[168]=17;Rr[168]=Br[168]=18;Fr[8]=Rr[8]=9;Nr[8]=kr[8]=12;Fr[162]=Rr[162]=9;Nr[162]=kr[162]=12;Fr[32]=Gr[32]=4;Nr[32]=jr[32]=1;Fr[138]=Gr[138]=4;Nr[138]=jr[138]=1;Br[128]=Gr[128]=21;$r[128]=jr[128]=22;Br[42]=Gr[42]=21;$r[42]=jr[42]=22;Nr[5]=Br[5]=14;Nr[165]=Br[165]=14;kr[20]=Gr[20]=6;kr[150]=Gr[150]=6;Fr[80]=$r[80]=11;Fr[90]=$r[90]=11;Rr[65]=jr[65]=3;Rr[105]=jr[105]=3;Fr[160]=$r[160]=11;Nr[160]=Br[160]=14;Fr[10]=$r[10]=11;Nr[10]=Br[10]=14;kr[130]=Gr[130]=6;Rr[130]=jr[130]=3;kr[40]=Gr[40]=6;Rr[40]=jr[40]=3;Nr[101]=jr[101]=1;Nr[69]=jr[69]=1;Br[149]=Gr[149]=21;Br[21]=Gr[21]=21;kr[86]=$r[86]=17;kr[84]=$r[84]=17;Fr[89]=Rr[89]=9;Fr[81]=Rr[81]=9;Fr[96]=jr[96]=0;Nr[96]=$r[96]=15;Fr[74]=jr[74]=0;Nr[74]=$r[74]=15;Fr[24]=kr[24]=8;Rr[24]=Gr[24]=7;Fr[146]=kr[146]=8;Rr[146]=Gr[146]=7;Nr[6]=$r[6]=15;kr[6]=Br[6]=16;Nr[164]=$r[164]=15;kr[164]=Br[164]=16;Rr[129]=Gr[129]=7;Br[129]=jr[129]=20;Rr[41]=Gr[41]=7;Br[41]=jr[41]=20;kr[66]=jr[66]=2;Rr[66]=$r[66]=19;kr[104]=jr[104]=2;Rr[104]=$r[104]=19;Fr[144]=Br[144]=10;$r[144]=Gr[144]=23;Fr[26]=Br[26]=10;$r[26]=Gr[26]=23;Nr[36]=Gr[36]=5;kr[36]=jr[36]=2;Nr[134]=Gr[134]=5;kr[134]=jr[134]=2;Fr[9]=Br[9]=10;Nr[9]=Rr[9]=13;Fr[161]=Br[161]=10;Nr[161]=Rr[161]=13;Nr[37]=Gr[37]=5;Br[37]=jr[37]=20;Nr[133]=Gr[133]=5;Br[133]=jr[133]=20;kr[148]=Br[148]=16;$r[148]=Gr[148]=23;kr[22]=Br[22]=16;$r[22]=Gr[22]=23;Fr[82]=kr[82]=8;Rr[82]=$r[82]=19;Fr[88]=kr[88]=8;Rr[88]=$r[88]=19;Fr[73]=jr[73]=0;Nr[73]=Rr[73]=13;Fr[97]=jr[97]=0;Nr[97]=Rr[97]=13;Fr[145]=Rr[145]=9;Br[145]=Gr[145]=21;Fr[25]=Rr[25]=9;Br[25]=Gr[25]=21;Nr[70]=jr[70]=1;kr[70]=$r[70]=17;Nr[100]=jr[100]=1;kr[100]=$r[100]=17;Fr[34]=Rr[34]=9;Nr[34]=kr[34]=12;Br[34]=Gr[34]=21;$r[34]=jr[34]=22;Fr[136]=Gr[136]=4;Nr[136]=jr[136]=1;kr[136]=$r[136]=17;Rr[136]=Br[136]=18;Fr[35]=Gr[35]=4;Nr[35]=kr[35]=12;Rr[35]=Br[35]=18;$r[35]=jr[35]=22;Fr[153]=Gr[153]=4;Rr[153]=Br[153]=18;Nr[102]=kr[102]=12;$r[102]=jr[102]=22;Fr[155]=Rr[155]=9;Br[155]=Gr[155]=23;Nr[103]=jr[103]=1;kr[103]=$r[103]=17;Fr[152]=Gr[152]=4;kr[152]=$r[152]=17;Rr[152]=Br[152]=18;Fr[156]=kr[156]=8;Rr[156]=Br[156]=18;$r[156]=Gr[156]=23;Fr[137]=Gr[137]=4;Nr[137]=jr[137]=1;Rr[137]=Br[137]=18;Fr[139]=Gr[139]=4;Nr[139]=Rr[139]=13;Br[139]=jr[139]=20;Fr[98]=Rr[98]=9;Nr[98]=kr[98]=12;$r[98]=jr[98]=22;Fr[99]=jr[99]=0;Nr[99]=kr[99]=12;Rr[99]=$r[99]=19;Nr[38]=kr[38]=12;Br[38]=Gr[38]=21;$r[38]=jr[38]=22;Nr[39]=Gr[39]=5;kr[39]=Br[39]=16;$r[39]=jr[39]=22;var Je=[];Je[1]=Je[169]=YM;Je[4]=Je[166]=ZM;Je[16]=Je[154]=KM;Je[64]=Je[106]=JM;Je[168]=Je[2]=QM;Je[162]=Je[8]=eO;Je[138]=Je[32]=tO;Je[42]=Je[128]=rO;Je[5]=Je[165]=Cce;Je[20]=Je[150]=wce;Je[80]=Je[90]=Pce;Je[65]=Je[105]=Tce;Je[160]=Je[10]=Ece;Je[130]=Je[40]=Mce;Je[85]=Oce;Je[101]=Je[69]=Lce;Je[149]=Je[21]=Ace;Je[86]=Je[84]=Dce;Je[89]=Je[81]=Fce;Je[96]=Je[74]=Nce;Je[24]=Je[146]=kce;Je[6]=Je[164]=Rce;Je[129]=Je[41]=Bce;Je[66]=Je[104]=$ce;Je[144]=Je[26]=jce;Je[36]=Je[134]=Gce;Je[9]=Je[161]=Uce;Je[37]=Je[133]=Vce;Je[148]=Je[22]=zce;Je[82]=Je[88]=qce;Je[73]=Je[97]=Hce;Je[145]=Je[25]=Wce;Je[70]=Je[100]=Xce;Je[34]=function(e){return[rO(e),eO(e)]};Je[35]=Yce;Je[136]=function(e){return[tO(e),QM(e)]};Je[153]=function(e){return[KM(e),YM(e)]};Je[102]=function(e){return[ZM(e),JM(e)]};Je[155]=Zce;Je[103]=Kce;Je[152]=function(e){return[KM(e),QM(e)]};Je[156]=Jce;Je[137]=function(e){return[tO(e),YM(e)]};Je[139]=Qce;Je[98]=function(e){return[eO(e),JM(e)]};Je[99]=epe;Je[38]=function(e){return[ZM(e),rO(e)]};Je[39]=tpe;g();g();g();g();g();g();g();g();function npe(e){return(e>0)-(e<0)||+e}o(npe,"mathSign");function E0(e,t,r){var n=t[0]-e[0],i=t[1]-e[1],s=r[0]-t[0],l=r[1]-t[1];return npe(n*l-s*i)}o(E0,"orientationIndex");function W$(e,t){var r=e.geometry.coordinates[0].map(function(l){return l[0]}),n=e.geometry.coordinates[0].map(function(l){return l[1]}),i=t.geometry.coordinates[0].map(function(l){return l[0]}),s=t.geometry.coordinates[0].map(function(l){return l[1]});return Math.max.apply(null,r)===Math.max.apply(null,i)&&Math.max.apply(null,n)===Math.max.apply(null,s)&&Math.min.apply(null,r)===Math.min.apply(null,i)&&Math.min.apply(null,n)===Math.min.apply(null,s)}o(W$,"envelopeIsEqual");function nO(e,t){return t.geometry.coordinates[0].every(function(r){return ci(Tn(r),e)})}o(nO,"envelopeContains");function X$(e,t){return e[0]===t[0]&&e[1]===t[1]}o(X$,"coordinatesEqual");var ipe=function(){function e(t){this.id=e.buildId(t),this.coordinates=t,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return o(e,"Node"),e.buildId=function(t){return t.join(",")},e.prototype.removeInnerEdge=function(t){this.innerEdges=this.innerEdges.filter(function(r){return r.from.id!==t.from.id})},e.prototype.removeOuterEdge=function(t){this.outerEdges=this.outerEdges.filter(function(r){return r.to.id!==t.to.id})},e.prototype.addOuterEdge=function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1},e.prototype.sortOuterEdges=function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort(function(r,n){var i=r.to,s=n.to;if(i.coordinates[0]-t.coordinates[0]>=0&&s.coordinates[0]-t.coordinates[0]<0)return 1;if(i.coordinates[0]-t.coordinates[0]<0&&s.coordinates[0]-t.coordinates[0]>=0)return-1;if(i.coordinates[0]-t.coordinates[0]===0&&s.coordinates[0]-t.coordinates[0]===0)return i.coordinates[1]-t.coordinates[1]>=0||s.coordinates[1]-t.coordinates[1]>=0?i.coordinates[1]-s.coordinates[1]:s.coordinates[1]-i.coordinates[1];var l=E0(t.coordinates,i.coordinates,s.coordinates);if(l<0)return 1;if(l>0)return-1;var c=Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2),p=Math.pow(s.coordinates[0]-t.coordinates[0],2)+Math.pow(s.coordinates[1]-t.coordinates[1],2);return c-p}),this.outerEdgesSorted=!0)},e.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},e.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},e.prototype.addInnerEdge=function(t){this.innerEdges.push(t)},e}(),iO=ipe;g();var ope=function(){function e(t,r){this.from=t,this.to=r,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return o(e,"Edge"),e.prototype.getSymetric=function(){return this.symetric||(this.symetric=new e(this.to,this.from),this.symetric.symetric=this),this.symetric},e.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},e.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},e.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},e.prototype.toLineString=function(){return Bi([this.from.coordinates,this.to.coordinates])},e.prototype.compareTo=function(t){return E0(t.from.coordinates,t.to.coordinates,this.to.coordinates)},e}(),Y$=ope;g();var spe=function(){function e(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return o(e,"EdgeRing"),e.prototype.push=function(t){this.edges.push(t),this.polygon=this.envelope=void 0},e.prototype.get=function(t){return this.edges[t]},Object.defineProperty(e.prototype,"length",{get:o(function(){return this.edges.length},"get"),enumerable:!0,configurable:!0}),e.prototype.forEach=function(t){this.edges.forEach(t)},e.prototype.map=function(t){return this.edges.map(t)},e.prototype.some=function(t){return this.edges.some(t)},e.prototype.isValid=function(){return!0},e.prototype.isHole=function(){var t=this,r=this.edges.reduce(function(l,c,p){return c.from.coordinates[1]>t.edges[l].from.coordinates[1]&&(l=p),l},0),n=(r===0?this.length:r)-1,i=(r+1)%this.length,s=E0(this.edges[n].from.coordinates,this.edges[r].from.coordinates,this.edges[i].from.coordinates);return s===0?this.edges[n].from.coordinates[0]>this.edges[i].from.coordinates[0]:s>0},e.prototype.toMultiPoint=function(){return wE(this.edges.map(function(t){return t.from.coordinates}))},e.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map(function(r){return r.from.coordinates});return t.push(this.edges[0].from.coordinates),this.polygon=Gn([t])},e.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=sM(this.toPolygon())},e.findEdgeRingContaining=function(t,r){var n=t.getEnvelope(),i,s;return r.forEach(function(l){var c=l.getEnvelope();if(s&&(i=s.getEnvelope()),!W$(c,n)&&nO(c,n)){for(var p=t.map(function(P){return P.from.coordinates}),h=void 0,y=o(function(P){l.some(function(E){return X$(P,E.from.coordinates)})||(h=P)},"_loop_1"),b=0,_=p;b<_.length;b++){var C=_[b];y(C)}h&&l.inside(Tn(h))&&(!s||nO(i,c))&&(s=l)}}),s},e.prototype.inside=function(t){return ci(t,this.toPolygon())},e}(),oO=spe;function ape(e){if(!e)throw new Error("No geojson passed");if(e.type!=="FeatureCollection"&&e.type!=="GeometryCollection"&&e.type!=="MultiLineString"&&e.type!=="LineString"&&e.type!=="Feature")throw new Error("Invalid input type '"+e.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}o(ape,"validateGeoJson");var AHe=function(){function e(){this.edges=[],this.nodes={}}return o(e,"Graph"),e.fromGeoJson=function(t){ape(t);var r=new e;return So(t,function(n){qE(n,"LineString","Graph::fromGeoJson"),VN(n,function(i,s){if(i){var l=r.getNode(i),c=r.getNode(s);r.addEdge(l,c)}return s})}),r},e.prototype.getNode=function(t){var r=iO.buildId(t),n=this.nodes[r];return n||(n=this.nodes[r]=new iO(t)),n},e.prototype.addEdge=function(t,r){var n=new Y$(t,r),i=n.getSymetric();this.edges.push(n),this.edges.push(i)},e.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map(function(r){return t.nodes[r]}).forEach(function(r){return t._removeIfDangle(r)})},e.prototype._removeIfDangle=function(t){var r=this;if(t.innerEdges.length<=1){var n=t.getOuterEdges().map(function(i){return i.to});this.removeNode(t),n.forEach(function(i){return r._removeIfDangle(i)})}},e.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(r){r.label===r.symetric.label&&(t.removeEdge(r.symetric),t.removeEdge(r))})},e.prototype._computeNextCWEdges=function(t){var r=this;typeof t>"u"?Object.keys(this.nodes).forEach(function(n){return r._computeNextCWEdges(r.nodes[n])}):t.getOuterEdges().forEach(function(n,i){t.getOuterEdge((i===0?t.getOuterEdges().length:i)-1).symetric.next=n})},e.prototype._computeNextCCWEdges=function(t,r){for(var n=t.getOuterEdges(),i,s,l=n.length-1;l>=0;--l){var c=n[l],p=c.symetric,h=void 0,y=void 0;c.label===r&&(h=c),p.label===r&&(y=p),!(!h||!y)&&(y&&(s=y),h&&(s&&(s.next=h,s=void 0),i||(i=h)))}s&&(s.next=i)},e.prototype._findLabeledEdgeRings=function(){var t=[],r=0;return this.edges.forEach(function(n){if(!(n.label>=0)){t.push(n);var i=n;do i.label=r,i=i.next;while(!n.isEqual(i));r++}}),t},e.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach(function(n){n.label=void 0}),this._findLabeledEdgeRings().forEach(function(n){t._findIntersectionNodes(n).forEach(function(i){t._computeNextCCWEdges(i,n.label)})});var r=[];return this.edges.forEach(function(n){n.ring||r.push(t._findEdgeRing(n))}),r},e.prototype._findIntersectionNodes=function(t){var r=[],n=t,i=o(function(){var s=0;n.from.getOuterEdges().forEach(function(l){l.label===t.label&&++s}),s>1&&r.push(n.from),n=n.next},"_loop_1");do i();while(!t.isEqual(n));return r},e.prototype._findEdgeRing=function(t){var r=t,n=new oO;do n.push(r),r.ring=n,r=r.next;while(!t.isEqual(r));return n},e.prototype.removeNode=function(t){var r=this;t.getOuterEdges().forEach(function(n){return r.removeEdge(n)}),t.innerEdges.forEach(function(n){return r.removeEdge(n)}),delete this.nodes[t.id]},e.prototype.removeEdge=function(t){this.edges=this.edges.filter(function(r){return!r.isEqual(t)}),t.deleteEdge()},e}();g();function lpe(e,t){var r=!0;return So(e,function(n){So(t,function(i){if(r===!1)return!1;r=upe(n.geometry,i.geometry)})}),r}o(lpe,"booleanDisjoint");function upe(e,t){switch(e.type){case"Point":switch(t.type){case"Point":return!dpe(e.coordinates,t.coordinates);case"LineString":return!Z$(t,e);case"Polygon":return!ci(e,t)}break;case"LineString":switch(t.type){case"Point":return!Z$(e,t);case"LineString":return!cpe(e,t);case"Polygon":return!K$(t,e)}break;case"Polygon":switch(t.type){case"Point":return!ci(t,e);case"LineString":return!K$(e,t);case"Polygon":return!ppe(t,e)}}return!1}o(upe,"disjoint");function Z$(e,t){for(var r=0;r<e.coordinates.length-1;r++)if(fpe(e.coordinates[r],e.coordinates[r+1],t.coordinates))return!0;return!1}o(Z$,"isPointOnLine");function cpe(e,t){var r=Rc(e,t);return r.features.length>0}o(cpe,"isLineOnLine");function K$(e,t){for(var r=0,n=t.coordinates;r<n.length;r++){var i=n[r];if(ci(i,e))return!0}var s=Rc(t,Pm(e));return s.features.length>0}o(K$,"isLineInPoly");function ppe(e,t){for(var r=0,n=e.coordinates[0];r<n.length;r++){var i=n[r];if(ci(i,t))return!0}for(var s=0,l=t.coordinates[0];s<l.length;s++){var c=l[s];if(ci(c,e))return!0}var p=Rc(Pm(e),Pm(t));return p.features.length>0}o(ppe,"isPolyInPoly");function fpe(e,t,r){var n=r[0]-e[0],i=r[1]-e[1],s=t[0]-e[0],l=t[1]-e[1],c=n*l-i*s;return c!==0?!1:Math.abs(s)>=Math.abs(l)?s>0?e[0]<=r[0]&&r[0]<=t[0]:t[0]<=r[0]&&r[0]<=e[0]:l>0?e[1]<=r[1]&&r[1]<=t[1]:t[1]<=r[1]&&r[1]<=e[1]}o(fpe,"isPointOnLineSegment");function dpe(e,t){return e[0]===t[0]&&e[1]===t[1]}o(dpe,"compareCoords");var sO=lpe;g();g();g();var ype=Pn(aO(),1);g();var vpe=Pn(aO(),1);g();function Jb(e,t){var r=!1;return So(e,function(n){So(t,function(i){if(r===!0)return!0;r=!sO(n.geometry,i.geometry)})}),r}o(Jb,"booleanIntersects");g();var bpe=Pn(oj(),1);g();var Ppe=Pn(mj(),1);g();g();function yj(e){for(var t=e,r=[];t.parent;)r.unshift(t),t=t.parent;return r}o(yj,"pathTo");function Epe(){return new vj(function(e){return e.f})}o(Epe,"getHeap");var pO={search:o(function(e,t,r,n){e.cleanDirty(),n=n||{};var i=n.heuristic||pO.heuristics.manhattan,s=n.closest||!1,l=Epe(),c=t;for(t.h=i(t,r),l.push(t);l.size()>0;){var p=l.pop();if(p===r)return yj(p);p.closed=!0;for(var h=e.neighbors(p),y=0,b=h.length;y<b;++y){var _=h[y];if(!(_.closed||_.isWall())){var C=p.g+_.getCost(p),P=_.visited;(!P||C<_.g)&&(_.visited=!0,_.parent=p,_.h=_.h||i(_,r),_.g=C,_.f=_.g+_.h,e.markDirty(_),s&&(_.h<c.h||_.h===c.h&&_.g<c.g)&&(c=_),P?l.rescoreElement(_):l.push(_))}}}return s?yj(c):[]},"search"),heuristics:{manhattan:o(function(e,t){var r=Math.abs(t.x-e.x),n=Math.abs(t.y-e.y);return r+n},"manhattan"),diagonal:o(function(e,t){var r=1,n=Math.sqrt(2),i=Math.abs(t.x-e.x),s=Math.abs(t.y-e.y);return r*(i+s)+(n-2*r)*Math.min(i,s)},"diagonal")},cleanNode:o(function(e){e.f=0,e.g=0,e.h=0,e.visited=!1,e.closed=!1,e.parent=null},"cleanNode")};function Qb(e,t){t=t||{},this.nodes=[],this.diagonal=!!t.diagonal,this.grid=[];for(var r=0;r<e.length;r++){this.grid[r]=[];for(var n=0,i=e[r];n<i.length;n++){var s=new aC(r,n,i[n]);this.grid[r][n]=s,this.nodes.push(s)}}this.init()}o(Qb,"Graph");Qb.prototype.init=function(){this.dirtyNodes=[];for(var e=0;e<this.nodes.length;e++)pO.cleanNode(this.nodes[e])};Qb.prototype.cleanDirty=function(){for(var e=0;e<this.dirtyNodes.length;e++)pO.cleanNode(this.dirtyNodes[e]);this.dirtyNodes=[]};Qb.prototype.markDirty=function(e){this.dirtyNodes.push(e)};Qb.prototype.neighbors=function(e){var t=[],r=e.x,n=e.y,i=this.grid;return i[r-1]&&i[r-1][n]&&t.push(i[r-1][n]),i[r+1]&&i[r+1][n]&&t.push(i[r+1][n]),i[r]&&i[r][n-1]&&t.push(i[r][n-1]),i[r]&&i[r][n+1]&&t.push(i[r][n+1]),this.diagonal&&(i[r-1]&&i[r-1][n-1]&&t.push(i[r-1][n-1]),i[r+1]&&i[r+1][n-1]&&t.push(i[r+1][n-1]),i[r-1]&&i[r-1][n+1]&&t.push(i[r-1][n+1]),i[r+1]&&i[r+1][n+1]&&t.push(i[r+1][n+1])),t};Qb.prototype.toString=function(){for(var e=[],t=this.grid,r,n,i,s,l=0,c=t.length;l<c;l++){for(r=[],n=t[l],i=0,s=n.length;i<s;i++)r.push(n[i].weight);e.push(r.join(" "))}return e.join("\n")};function aC(e,t,r){this.x=e,this.y=t,this.weight=r}o(aC,"GridNode");aC.prototype.toString=function(){return"["+this.x+" "+this.y+"]"};aC.prototype.getCost=function(e){return e&&e.x!==this.x&&e.y!==this.y?this.weight*1.41421:this.weight};aC.prototype.isWall=function(){return this.weight===0};function vj(e){this.content=[],this.scoreFunction=e}o(vj,"BinaryHeap");vj.prototype={push:o(function(e){this.content.push(e),this.sinkDown(this.content.length-1)},"push"),pop:o(function(){var e=this.content[0],t=this.content.pop();return this.content.length>0&&(this.content[0]=t,this.bubbleUp(0)),e},"pop"),remove:o(function(e){var t=this.content.indexOf(e),r=this.content.pop();t!==this.content.length-1&&(this.content[t]=r,this.scoreFunction(r)<this.scoreFunction(e)?this.sinkDown(t):this.bubbleUp(t))},"remove"),size:o(function(){return this.content.length},"size"),rescoreElement:o(function(e){this.sinkDown(this.content.indexOf(e))},"rescoreElement"),sinkDown:o(function(e){for(var t=this.content[e];e>0;){var r=(e+1>>1)-1,n=this.content[r];if(this.scoreFunction(t)<this.scoreFunction(n))this.content[r]=t,this.content[e]=n,e=r;else break}},"sinkDown"),bubbleUp:o(function(e){for(var t=this.content.length,r=this.content[e],n=this.scoreFunction(r);;){var i=e+1<<1,s=i-1,l=null,c;if(s<t){var p=this.content[s];c=this.scoreFunction(p),c<n&&(l=s)}if(i<t){var h=this.content[i],y=this.scoreFunction(h);y<(l===null?n:c)&&(l=i)}if(l!==null)this.content[e]=this.content[l],this.content[l]=r,e=l;else break}},"bubbleUp")};g();g();g();g();g();g();g();g();function fO(){this._=null}o(fO,"RedBlackTree");function O0(e){e.U=e.C=e.L=e.R=e.P=e.N=null}o(O0,"RedBlackNode");fO.prototype={constructor:fO,insert:o(function(e,t){var r,n,i;if(e){if(t.P=e,t.N=e.N,e.N&&(e.N.P=t),e.N=t,e.R){for(e=e.R;e.L;)e=e.L;e.L=t}else e.R=t;r=e}else this._?(e=bj(this._),t.P=null,t.N=e,e.P=e.L=t,r=e):(t.P=t.N=null,this._=t,r=null);for(t.L=t.R=null,t.U=r,t.C=!0,e=t;r&&r.C;)n=r.U,r===n.L?(i=n.R,i&&i.C?(r.C=i.C=!1,n.C=!0,e=n):(e===r.R&&(ex(this,r),e=r,r=e.U),r.C=!1,n.C=!0,tx(this,n))):(i=n.L,i&&i.C?(r.C=i.C=!1,n.C=!0,e=n):(e===r.L&&(tx(this,r),e=r,r=e.U),r.C=!1,n.C=!0,ex(this,n))),r=e.U;this._.C=!1},"insert"),remove:o(function(e){e.N&&(e.N.P=e.P),e.P&&(e.P.N=e.N),e.N=e.P=null;var t=e.U,r,n=e.L,i=e.R,s,l;if(n?i?s=bj(i):s=n:s=i,t?t.L===e?t.L=s:t.R=s:this._=s,n&&i?(l=s.C,s.C=e.C,s.L=n,n.U=s,s!==i?(t=s.U,s.U=e.U,e=s.R,t.L=e,s.R=i,i.U=s):(s.U=t,t=s,e=s.R)):(l=e.C,e=s),e&&(e.U=t),!l){if(e&&e.C){e.C=!1;return}do{if(e===this._)break;if(e===t.L){if(r=t.R,r.C&&(r.C=!1,t.C=!0,ex(this,t),r=t.R),r.L&&r.L.C||r.R&&r.R.C){(!r.R||!r.R.C)&&(r.L.C=!1,r.C=!0,tx(this,r),r=t.R),r.C=t.C,t.C=r.R.C=!1,ex(this,t),e=this._;break}}else if(r=t.L,r.C&&(r.C=!1,t.C=!0,tx(this,t),r=t.L),r.L&&r.L.C||r.R&&r.R.C){(!r.L||!r.L.C)&&(r.R.C=!1,r.C=!0,ex(this,r),r=t.L),r.C=t.C,t.C=r.L.C=!1,tx(this,t),e=this._;break}r.C=!0,e=t,t=t.U}while(!e.C);e&&(e.C=!1)}},"remove")};function ex(e,t){var r=t,n=t.R,i=r.U;i?i.L===r?i.L=n:i.R=n:e._=n,n.U=i,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}o(ex,"RedBlackRotateLeft");function tx(e,t){var r=t,n=t.L,i=r.U;i?i.L===r?i.L=n:i.R=n:e._=n,n.U=i,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}o(tx,"RedBlackRotateRight");function bj(e){for(;e.L;)e=e.L;return e}o(bj,"RedBlackFirst");var dO=fO;g();g();function L0(e,t,r,n){var i=[null,null],s=Xo.push(i)-1;return i.left=e,i.right=t,r&&rx(i,e,t,r),n&&rx(i,t,e,n),sa[e.index].halfedges.push(s),sa[t.index].halfedges.push(s),i}o(L0,"createEdge");function A0(e,t,r){var n=[t,r];return n.left=e,n}o(A0,"createBorderEdge");function rx(e,t,r,n){!e[0]&&!e[1]?(e[0]=n,e.left=t,e.right=r):e.left===r?e[1]=n:e[0]=n}o(rx,"setEdgeEnd");function Mpe(e,t,r,n,i){var s=e[0],l=e[1],c=s[0],p=s[1],h=l[0],y=l[1],b=0,_=1,C=h-c,P=y-p,E;if(E=t-c,!(!C&&E>0)){if(E/=C,C<0){if(E<b)return;E<_&&(_=E)}else if(C>0){if(E>_)return;E>b&&(b=E)}if(E=n-c,!(!C&&E<0)){if(E/=C,C<0){if(E>_)return;E>b&&(b=E)}else if(C>0){if(E<b)return;E<_&&(_=E)}if(E=r-p,!(!P&&E>0)){if(E/=P,P<0){if(E<b)return;E<_&&(_=E)}else if(P>0){if(E>_)return;E>b&&(b=E)}if(E=i-p,!(!P&&E<0)){if(E/=P,P<0){if(E>_)return;E>b&&(b=E)}else if(P>0){if(E<b)return;E<_&&(_=E)}return!(b>0)&&!(_<1)||(b>0&&(e[0]=[c+b*C,p+b*P]),_<1&&(e[1]=[c+_*C,p+_*P])),!0}}}}}o(Mpe,"clipEdge");function Ope(e,t,r,n,i){var s=e[1];if(s)return!0;var l=e[0],c=e.left,p=e.right,h=c[0],y=c[1],b=p[0],_=p[1],C=(h+b)/2,P=(y+_)/2,E,T;if(_===y){if(C<t||C>=n)return;if(h>b){if(!l)l=[C,r];else if(l[1]>=i)return;s=[C,i]}else{if(!l)l=[C,i];else if(l[1]<r)return;s=[C,r]}}else if(E=(h-b)/(_-y),T=P-E*C,E<-1||E>1)if(h>b){if(!l)l=[(r-T)/E,r];else if(l[1]>=i)return;s=[(i-T)/E,i]}else{if(!l)l=[(i-T)/E,i];else if(l[1]<r)return;s=[(r-T)/E,r]}else if(y<_){if(!l)l=[t,E*t+T];else if(l[0]>=n)return;s=[n,E*n+T]}else{if(!l)l=[n,E*n+T];else if(l[0]<t)return;s=[t,E*t+T]}return e[0]=l,e[1]=s,!0}o(Ope,"connectEdge");function xj(e,t,r,n){for(var i=Xo.length,s;i--;)(!Ope(s=Xo[i],e,t,r,n)||!Mpe(s,e,t,r,n)||!(Math.abs(s[0][0]-s[1][0])>Vn||Math.abs(s[0][1]-s[1][1])>Vn))&&delete Xo[i]}o(xj,"clipEdges");function Ij(e){return sa[e.index]={site:e,halfedges:[]}}o(Ij,"createCell");function Lpe(e,t){var r=e.site,n=t.left,i=t.right;return r===i&&(i=n,n=r),i?Math.atan2(i[1]-n[1],i[0]-n[0]):(r===n?(n=t[1],i=t[0]):(n=t[0],i=t[1]),Math.atan2(n[0]-i[0],i[1]-n[1]))}o(Lpe,"cellHalfedgeAngle");function hO(e,t){return t[+(t.left!==e.site)]}o(hO,"cellHalfedgeStart");function Ape(e,t){return t[+(t.left===e.site)]}o(Ape,"cellHalfedgeEnd");function _j(){for(var e=0,t=sa.length,r,n,i,s;e<t;++e)if((r=sa[e])&&(s=(n=r.halfedges).length)){var l=new Array(s),c=new Array(s);for(i=0;i<s;++i)l[i]=i,c[i]=Lpe(r,Xo[n[i]]);for(l.sort(function(p,h){return c[h]-c[p]}),i=0;i<s;++i)c[i]=n[l[i]];for(i=0;i<s;++i)n[i]=c[i]}}o(_j,"sortCellHalfedges");function Sj(e,t,r,n){var i=sa.length,s,l,c,p,h,y,b,_,C,P,E,T,O=!0;for(s=0;s<i;++s)if(l=sa[s]){for(c=l.site,h=l.halfedges,p=h.length;p--;)Xo[h[p]]||h.splice(p,1);for(p=0,y=h.length;p<y;)P=Ape(l,Xo[h[p]]),E=P[0],T=P[1],b=hO(l,Xo[h[++p%y]]),_=b[0],C=b[1],(Math.abs(E-_)>Vn||Math.abs(T-C)>Vn)&&(h.splice(p,0,Xo.push(A0(c,P,Math.abs(E-e)<Vn&&n-T>Vn?[e,Math.abs(_-e)<Vn?C:n]:Math.abs(T-n)<Vn&&r-E>Vn?[Math.abs(C-n)<Vn?_:r,n]:Math.abs(E-r)<Vn&&T-t>Vn?[r,Math.abs(_-r)<Vn?C:t]:Math.abs(T-t)<Vn&&E-e>Vn?[Math.abs(C-t)<Vn?_:e,t]:null))-1),++y);y&&(O=!1)}if(O){var D,A,R,j=1/0;for(s=0,O=null;s<i;++s)(l=sa[s])&&(c=l.site,D=c[0]-e,A=c[1]-t,R=D*D+A*A,R<j&&(j=R,O=l));if(O){var X=[e,t],Y=[e,n],N=[r,n],Z=[r,t];O.halfedges.push(Xo.push(A0(c=O.site,X,Y))-1,Xo.push(A0(c,Y,N))-1,Xo.push(A0(c,N,Z))-1,Xo.push(A0(c,Z,X))-1)}}for(s=0;s<i;++s)(l=sa[s])&&(l.halfedges.length||delete sa[s])}o(Sj,"clipCells");g();var Cj=[],lC;function Dpe(){O0(this),this.x=this.y=this.arc=this.site=this.cy=null}o(Dpe,"Circle");function Om(e){var t=e.P,r=e.N;if(!(!t||!r)){var n=t.site,i=e.site,s=r.site;if(n!==s){var l=i[0],c=i[1],p=n[0]-l,h=n[1]-c,y=s[0]-l,b=s[1]-c,_=2*(p*b-h*y);if(!(_>=-wj)){var C=p*p+h*h,P=y*y+b*b,E=(b*C-h*P)/_,T=(p*P-y*C)/_,O=Cj.pop()||new Dpe;O.arc=e,O.site=i,O.x=E+l,O.y=(O.cy=T+c)+Math.sqrt(E*E+T*T),e.circle=O;for(var D=null,A=D0._;A;)if(O.y<A.y||O.y===A.y&&O.x<=A.x)if(A.L)A=A.L;else{D=A.P;break}else if(A.R)A=A.R;else{D=A;break}D0.insert(D,O),D||(lC=O)}}}}o(Om,"attachCircle");function Lm(e){var t=e.circle;t&&(t.P||(lC=t.N),D0.remove(t),Cj.push(t),O0(t),e.circle=null)}o(Lm,"detachCircle");var Tj=[];function Fpe(){O0(this),this.edge=this.site=this.circle=null}o(Fpe,"Beach");function Pj(e){var t=Tj.pop()||new Fpe;return t.site=e,t}o(Pj,"createBeach");function mO(e){Lm(e),Am.remove(e),Tj.push(e),O0(e)}o(mO,"detachBeach");function Ej(e){var t=e.circle,r=t.x,n=t.cy,i=[r,n],s=e.P,l=e.N,c=[e];mO(e);for(var p=s;p.circle&&Math.abs(r-p.circle.x)<Vn&&Math.abs(n-p.circle.cy)<Vn;)s=p.P,c.unshift(p),mO(p),p=s;c.unshift(p),Lm(p);for(var h=l;h.circle&&Math.abs(r-h.circle.x)<Vn&&Math.abs(n-h.circle.cy)<Vn;)l=h.N,c.push(h),mO(h),h=l;c.push(h),Lm(h);var y=c.length,b;for(b=1;b<y;++b)h=c[b],p=c[b-1],rx(h.edge,p.site,h.site,i);p=c[0],h=c[y-1],h.edge=L0(p.site,h.site,null,i),Om(p),Om(h)}o(Ej,"removeBeach");function Mj(e){for(var t=e[0],r=e[1],n,i,s,l,c=Am._;c;)if(s=Oj(c,r)-t,s>Vn)c=c.L;else if(l=t-Npe(c,r),l>Vn){if(!c.R){n=c;break}c=c.R}else{s>-Vn?(n=c.P,i=c):l>-Vn?(n=c,i=c.N):n=i=c;break}Ij(e);var p=Pj(e);if(Am.insert(n,p),!(!n&&!i)){if(n===i){Lm(n),i=Pj(n.site),Am.insert(p,i),p.edge=i.edge=L0(n.site,p.site),Om(n),Om(i);return}if(!i){p.edge=L0(n.site,p.site);return}Lm(n),Lm(i);var h=n.site,y=h[0],b=h[1],_=e[0]-y,C=e[1]-b,P=i.site,E=P[0]-y,T=P[1]-b,O=2*(_*T-C*E),D=_*_+C*C,A=E*E+T*T,R=[(T*D-C*A)/O+y,(_*A-E*D)/O+b];rx(i.edge,h,P,R),p.edge=L0(h,e,null,R),i.edge=L0(e,P,null,R),Om(n),Om(i)}}o(Mj,"addBeach");function Oj(e,t){var r=e.site,n=r[0],i=r[1],s=i-t;if(!s)return n;var l=e.P;if(!l)return-1/0;r=l.site;var c=r[0],p=r[1],h=p-t;if(!h)return c;var y=c-n,b=1/s-1/h,_=y/h;return b?(-_+Math.sqrt(_*_-2*b*(y*y/(-2*h)-p+h/2+i-s/2)))/b+n:(n+c)/2}o(Oj,"leftBreakPoint");function Npe(e,t){var r=e.N;if(r)return Oj(r,t);var n=e.site;return n[1]===t?n[0]:1/0}o(Npe,"rightBreakPoint");var Vn=1e-6,wj=1e-12,Am,sa,D0,Xo;function kpe(e,t,r){return(e[0]-r[0])*(t[1]-e[1])-(e[0]-t[0])*(r[1]-e[1])}o(kpe,"triangleArea");function Rpe(e,t){return t[1]-e[1]||t[0]-e[0]}o(Rpe,"lexicographic");function uC(e,t){var r=e.sort(Rpe).pop(),n,i,s;for(Xo=[],sa=new Array(e.length),Am=new dO,D0=new dO;;)if(s=lC,r&&(!s||r[1]<s.y||r[1]===s.y&&r[0]<s.x))(r[0]!==n||r[1]!==i)&&(Mj(r),n=r[0],i=r[1]),r=e.pop();else if(s)Ej(s.arc);else break;if(_j(),t){var l=+t[0][0],c=+t[0][1],p=+t[1][0],h=+t[1][1];xj(l,c,p,h),Sj(l,c,p,h)}this.edges=Xo,this.cells=sa,Am=D0=Xo=sa=null}o(uC,"Diagram");uC.prototype={constructor:uC,polygons:o(function(){var e=this.edges;return this.cells.map(function(t){var r=t.halfedges.map(function(n){return hO(t,e[n])});return r.data=t.site.data,r})},"polygons"),triangles:o(function(){var e=[],t=this.edges;return this.cells.forEach(function(r,n){if(c=(s=r.halfedges).length)for(var i=r.site,s,l=-1,c,p,h=t[s[c-1]],y=h.left===i?h.right:h.left;++l<c;)p=y,h=t[s[l]],y=h.left===i?h.right:h.left,p&&y&&n<p.index&&n<y.index&&kpe(i,p,y)<0&&e.push([i.data,p.data,y.data])}),e},"triangles"),links:o(function(){return this.edges.filter(function(e){return e.right}).map(function(e){return{source:e.left.data,target:e.right.data}})},"links"),find:o(function(e,t,r){for(var n=this,i,s=n._found||0,l=n.cells.length,c;!(c=n.cells[s]);)if(++s>=l)return null;var p=e-c.site[0],h=t-c.site[1],y=p*p+h*h;do c=n.cells[i=s],s=null,c.halfedges.forEach(function(b){var _=n.edges[b],C=_.left;if(!((C===c.site||!C)&&!(C=_.right))){var P=e-C[0],E=t-C[1],T=P*P+E*E;T<y&&(y=T,s=C.index)}});while(s!==null);return n._found=i,r==null||y<=r*r?c.site:null},"find")};g();g();g();g();g();g();g();g();g();g();g();g();var qpe=Pn(F0(),1);g();var CO=Pn(Fj(),1);g();g();g();function aa(){return new fC}o(aa,"default");function fC(){this.reset()}o(fC,"Adder");fC.prototype={constructor:fC,reset:o(function(){this.s=this.t=0},"reset"),add:o(function(e){Nj(pC,e,this.t),Nj(this,pC.s,this.s),this.s?this.t+=pC.t:this.s=pC.t},"add"),valueOf:o(function(){return this.s},"valueOf")};var pC=new fC;function Nj(e,t,r){var n=e.s=t+r,i=n-t,s=n-i;e.t=t-s+(r-i)}o(Nj,"add");g();var gn=1e-6;var Dn=Math.PI,To=Dn/2,dC=Dn/4,jc=Dn*2,Dm=180/Dn,Ea=Dn/180,ji=Math.abs,Du=Math.atan,Ma=Math.atan2,Hr=Math.cos;var hC=Math.exp;var nx=Math.log;var Zt=Math.sin;var ps=Math.sqrt,ix=Math.tan;function vO(e){return e>1?0:e<-1?Dn:Math.acos(e)}o(vO,"acos");function la(e){return e>1?To:e<-1?-To:Math.asin(e)}o(la,"asin");g();function Fu(){}o(Fu,"noop");g();var Hpe=aa(),mKe=aa();g();g();function Fm(e){var t=e[0],r=e[1],n=Hr(r);return[n*Hr(t),n*Zt(t),Zt(r)]}o(Fm,"cartesian");function ox(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}o(ox,"cartesianCross");function sx(e){var t=ps(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}o(sx,"cartesianNormalizeInPlace");var MKe=aa();g();g();g();g();g();function Rj(e,t){return[e>Dn?e-jc:e<-Dn?e+jc:e,t]}o(Rj,"rotationIdentity");Rj.invert=Rj;g();g();function mC(){var e=[],t;return{point:o(function(r,n){t.push([r,n])},"point"),lineStart:o(function(){e.push(t=[])},"lineStart"),lineEnd:Fu,rejoin:o(function(){e.length>1&&e.push(e.pop().concat(e.shift()))},"rejoin"),result:o(function(){var r=e;return e=[],t=null,r},"result")}}o(mC,"default");g();g();g();function gC(e,t){return ji(e[0]-t[0])<gn&&ji(e[1]-t[1])<gn}o(gC,"default");function yC(e,t,r,n){this.x=e,this.z=t,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}o(yC,"Intersection");function vC(e,t,r,n,i){var s=[],l=[],c,p;if(e.forEach(function(P){if(!((E=P.length-1)<=0)){var E,T=P[0],O=P[E],D;if(gC(T,O)){for(i.lineStart(),c=0;c<E;++c)i.point((T=P[c])[0],T[1]);i.lineEnd();return}s.push(D=new yC(T,P,null,!0)),l.push(D.o=new yC(T,null,D,!1)),s.push(D=new yC(O,P,null,!1)),l.push(D.o=new yC(O,null,D,!0))}}),!!s.length){for(l.sort(t),Bj(s),Bj(l),c=0,p=l.length;c<p;++c)l[c].e=r=!r;for(var h=s[0],y,b;;){for(var _=h,C=!0;_.v;)if((_=_.n)===h)return;y=_.z,i.lineStart();do{if(_.v=_.o.v=!0,_.e){if(C)for(c=0,p=y.length;c<p;++c)i.point((b=y[c])[0],b[1]);else n(_.x,_.n.x,1,i);_=_.n}else{if(C)for(y=_.p.z,c=y.length-1;c>=0;--c)i.point((b=y[c])[0],b[1]);else n(_.x,_.p.x,-1,i);_=_.p}_=_.o,y=_.z,C=!C}while(!_.v);i.lineEnd()}}}o(vC,"default");function Bj(e){if(t=e.length){for(var t,r=0,n=e[0],i;++r<t;)n.n=i=e[r],i.p=n,n=i;n.n=i=e[0],i.p=n}}o(Bj,"link");g();g();g();function lf(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}o(lf,"default");g();function bC(e){return e.length===1&&(e=Ype(e)),{left:o(function(t,r,n,i){for(n==null&&(n=0),i==null&&(i=t.length);n<i;){var s=n+i>>>1;e(t[s],r)<0?n=s+1:i=s}return n},"left"),right:o(function(t,r,n,i){for(n==null&&(n=0),i==null&&(i=t.length);n<i;){var s=n+i>>>1;e(t[s],r)>0?i=s:n=s+1}return n},"right")}}o(bC,"default");function Ype(e){return function(t,r){return lf(e(t),r)}}o(Ype,"ascendingComparator");var $j=bC(lf),Zpe=$j.right,Kpe=$j.left;g();g();g();g();g();g();g();g();g();var jj=Array.prototype,Qpe=jj.slice,efe=jj.map;g();g();g();g();var dQe=Math.sqrt(50),hQe=Math.sqrt(10),mQe=Math.sqrt(2);g();g();g();g();g();g();g();g();function ax(e){for(var t=e.length,r,n=-1,i=0,s,l;++n<t;)i+=e[n].length;for(s=new Array(i);--t>=0;)for(l=e[t],r=l.length;--r>=0;)s[--i]=l[r];return s}o(ax,"default");g();g();g();g();g();g();g();var lfe=1e9,Ntt=-lfe;g();g();var bO=aa();function IC(e,t){var r=t[0],n=t[1],i=[Zt(r),-Hr(r),0],s=0,l=0;bO.reset();for(var c=0,p=e.length;c<p;++c)if(y=(h=e[c]).length)for(var h,y,b=h[y-1],_=b[0],C=b[1]/2+dC,P=Zt(C),E=Hr(C),T=0;T<y;++T,_=D,P=R,E=j,b=O){var O=h[T],D=O[0],A=O[1]/2+dC,R=Zt(A),j=Hr(A),X=D-_,Y=X>=0?1:-1,N=Y*X,Z=N>Dn,ae=P*R;if(bO.add(Ma(ae*Y*Zt(N),E*j+ae*Hr(N))),s+=Z?X+Y*jc:X,Z^_>=r^D>=r){var se=ox(Fm(b),Fm(O));sx(se);var U=ox(i,se);sx(U);var xe=(Z^X>=0?-1:1)*la(U[2]);(n>xe||n===xe&&(se[0]||se[1]))&&(l+=Z^X>=0?1:-1)}}return(s<-gn||s<gn&&bO<-gn)^l&1}o(IC,"default");g();g();var Ytt=aa();g();g();g();g();g();var Prt=aa(),Trt=aa();g();var pfe=1/0;var Art=-pfe;g();g();function xO(e){this._context=e}o(xO,"PathContext");xO.prototype={_radius:4.5,pointRadius:o(function(e){return this._radius=e,this},"pointRadius"),polygonStart:o(function(){this._line=0},"polygonStart"),polygonEnd:o(function(){this._line=NaN},"polygonEnd"),lineStart:o(function(){this._point=0},"lineStart"),lineEnd:o(function(){this._line===0&&this._context.closePath(),this._point=NaN},"lineEnd"),point:o(function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,jc);break}}},"point"),result:Fu};g();var Xrt=aa();g();function IO(){this._string=[]}o(IO,"PathString");IO.prototype={_radius:4.5,_circle:Vj(4.5),pointRadius:o(function(e){return(e=+e)!==this._radius&&(this._radius=e,this._circle=null),this},"pointRadius"),polygonStart:o(function(){this._line=0},"polygonStart"),polygonEnd:o(function(){this._line=NaN},"polygonEnd"),lineStart:o(function(){this._point=0},"lineStart"),lineEnd:o(function(){this._line===0&&this._string.push("Z"),this._point=NaN},"lineEnd"),point:o(function(e,t){switch(this._point){case 0:{this._string.push("M",e,",",t),this._point=1;break}case 1:{this._string.push("L",e,",",t);break}default:{this._circle==null&&(this._circle=Vj(this._radius)),this._string.push("M",e,",",t,this._circle);break}}},"point"),result:o(function(){if(this._string.length){var e=this._string.join("");return this._string=[],e}else return null},"result")};function Vj(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}o(Vj,"circle");g();g();g();g();g();g();function _C(e,t,r,n){return function(i,s){var l=t(s),c=i.invert(n[0],n[1]),p=mC(),h=t(p),y=!1,b,_,C,P={point:E,lineStart:O,lineEnd:D,polygonStart:o(function(){P.point=A,P.lineStart=R,P.lineEnd=j,_=[],b=[]},"polygonStart"),polygonEnd:o(function(){P.point=E,P.lineStart=O,P.lineEnd=D,_=ax(_);var X=IC(b,c);_.length?(y||(s.polygonStart(),y=!0),vC(_,hfe,X,r,s)):X&&(y||(s.polygonStart(),y=!0),s.lineStart(),r(null,null,1,s),s.lineEnd()),y&&(s.polygonEnd(),y=!1),_=b=null},"polygonEnd"),sphere:o(function(){s.polygonStart(),s.lineStart(),r(null,null,1,s),s.lineEnd(),s.polygonEnd()},"sphere")};function E(X,Y){var N=i(X,Y);e(X=N[0],Y=N[1])&&s.point(X,Y)}o(E,"point");function T(X,Y){var N=i(X,Y);l.point(N[0],N[1])}o(T,"pointLine");function O(){P.point=T,l.lineStart()}o(O,"lineStart");function D(){P.point=E,l.lineEnd()}o(D,"lineEnd");function A(X,Y){C.push([X,Y]);var N=i(X,Y);h.point(N[0],N[1])}o(A,"pointRing");function R(){h.lineStart(),C=[]}o(R,"ringStart");function j(){A(C[0][0],C[0][1]),h.lineEnd();var X=h.clean(),Y=p.result(),N,Z=Y.length,ae,se,U;if(C.pop(),b.push(C),C=null,!!Z){if(X&1){if(se=Y[0],(ae=se.length-1)>0){for(y||(s.polygonStart(),y=!0),s.lineStart(),N=0;N<ae;++N)s.point((U=se[N])[0],U[1]);s.lineEnd()}return}Z>1&&X&2&&Y.push(Y.pop().concat(Y.shift())),_.push(Y.filter(dfe))}}return o(j,"ringEnd"),P}}o(_C,"default");function dfe(e){return e.length>1}o(dfe,"validSegment");function hfe(e,t){return((e=e.x)[0]<0?e[1]-To-gn:To-e[1])-((t=t.x)[0]<0?t[1]-To-gn:To-t[1])}o(hfe,"compareIntersection");var mfe=_C(function(){return!0},gfe,vfe,[-Dn,-To]);function gfe(e){var t=NaN,r=NaN,n=NaN,i;return{lineStart:o(function(){e.lineStart(),i=1},"lineStart"),point:o(function(s,l){var c=s>0?Dn:-Dn,p=ji(s-t);ji(p-Dn)<gn?(e.point(t,r=(r+l)/2>0?To:-To),e.point(n,r),e.lineEnd(),e.lineStart(),e.point(c,r),e.point(s,r),i=0):n!==c&&p>=Dn&&(ji(t-n)<gn&&(t-=n*gn),ji(s-c)<gn&&(s-=c*gn),r=yfe(t,r,s,l),e.point(n,r),e.lineEnd(),e.lineStart(),e.point(c,r),i=0),e.point(t=s,r=l),n=c},"point"),lineEnd:o(function(){e.lineEnd(),t=r=NaN},"lineEnd"),clean:o(function(){return 2-i},"clean")}}o(gfe,"clipAntimeridianLine");function yfe(e,t,r,n){var i,s,l=Zt(e-r);return ji(l)>gn?Du((Zt(t)*(s=Hr(n))*Zt(r)-Zt(n)*(i=Hr(t))*Zt(e))/(i*s*l)):(t+n)/2}o(yfe,"clipAntimeridianIntersect");function vfe(e,t,r,n){var i;if(e==null)i=r*To,n.point(-Dn,i),n.point(0,i),n.point(Dn,i),n.point(Dn,0),n.point(Dn,-i),n.point(0,-i),n.point(-Dn,-i),n.point(-Dn,0),n.point(-Dn,i);else if(ji(e[0]-t[0])>gn){var s=e[0]<t[0]?Dn:-Dn;i=r*s/2,n.point(-s,i),n.point(0,i),n.point(s,i)}else n.point(t[0],t[1])}o(vfe,"clipAntimeridianInterpolate");g();g();function SC(e){return function(t){var r=new _O;for(var n in e)r[n]=e[n];return r.stream=t,r}}o(SC,"transformer");function _O(){}o(_O,"TransformStream");_O.prototype={constructor:_O,point:o(function(e,t){this.stream.point(e,t)},"point"),sphere:o(function(){this.stream.sphere()},"sphere"),lineStart:o(function(){this.stream.lineStart()},"lineStart"),lineEnd:o(function(){this.stream.lineEnd()},"lineEnd"),polygonStart:o(function(){this.stream.polygonStart()},"polygonStart"),polygonEnd:o(function(){this.stream.polygonEnd()},"polygonEnd")};g();g();var Knt=Hr(30*Ea);var dit=SC({point:o(function(e,t){this.stream.point(e*Ea,t*Ea)},"point")});g();g();g();g();function CC(e){return function(t,r){var n=Hr(t),i=Hr(r),s=e(n*i);return[s*i*Zt(t),s*Zt(r)]}}o(CC,"azimuthalRaw");function Gc(e){return function(t,r){var n=ps(t*t+r*r),i=e(n),s=Zt(i),l=Hr(i);return[Ma(t*s,n*l),la(n&&r*s/n)]}}o(Gc,"azimuthalInvert");var Zj=CC(function(e){return ps(2/(1+e))});Zj.invert=Gc(function(e){return 2*la(e/2)});g();var Kj=CC(function(e){return(e=vO(e))&&e/Zt(e)});Kj.invert=Gc(function(e){return e});g();g();function SO(e,t){return[e,nx(ix((To+t)/2))]}o(SO,"mercatorRaw");SO.invert=function(e,t){return[e,2*Du(hC(t))-To]};g();g();function wC(e,t){return[e,t]}o(wC,"equirectangularRaw");wC.invert=wC;g();function Jj(e,t){var r=Hr(t),n=Hr(e)*r;return[r*Zt(e)/n,Zt(t)/n]}o(Jj,"gnomonicRaw");Jj.invert=Gc(Du);g();g();function Qj(e,t){var r=t*t,n=r*r;return[e*(.8707-.131979*r+n*(-.013791+n*(.003971*r-.001529*n))),t*(1.007226+r*(.015085+n*(-.044475+.028874*r-.005916*n)))]}o(Qj,"naturalEarth1Raw");Qj.invert=function(e,t){var r=t,n=25,i;do{var s=r*r,l=s*s;r-=i=(r*(1.007226+s*(.015085+l*(-.044475+.028874*s-.005916*l)))-t)/(1.007226+s*(.015085*3+l*(-.044475*7+.028874*9*s-.005916*11*l)))}while(ji(i)>gn&&--n>0);return[e/(.8707+(s=r*r)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),r]};g();function eG(e,t){return[Hr(t)*Zt(e),Zt(t)]}o(eG,"orthographicRaw");eG.invert=Gc(la);g();function tG(e,t){var r=Hr(t),n=1+Hr(e)*r;return[r*Zt(e)/n,Zt(t)/n]}o(tG,"stereographicRaw");tG.invert=Gc(function(e){return 2*Du(e)});g();function rG(e,t){return[nx(ix((To+t)/2)),-e]}o(rG,"transverseMercatorRaw");rG.invert=function(e,t){return[-t,2*Du(hC(e))-To]};g();var Cfe=Pn(F0(),1);g();var wfe=Pn(F0(),1);g();var Tfe=Pn(F0(),1);g();g();var Efe=Pn(F0(),1);g();g();g();g();var Dl,En,al,lx,PO,Nm=class Nm extends Mu{constructor(r,n){super(n.mvfData.properties.id,r);G(this,lx);x(this,"__type",Nm.__type);G(this,Dl);G(this,En,{});G(this,al);q(this,Dl,r),q(this,al,n.mvfData)}static is(r){return r.__type===Nm.__type}get focusTarget(){return this}get name(){var r,n;return"name"in d(this,al).properties?(n=ke(this,lx,PO).call(this,"name"))!=null?n:"":(r=d(this,al).properties.externalId)!=null?r:""}get shortName(){var r,n;return"shortName"in d(this,al).properties?(n=ke(this,lx,PO).call(this,"shortName"))!=null?n:"":(r=d(this,al).properties.externalId)!=null?r:""}get externalId(){var r;return(r=d(this,al).properties.externalId)!=null?r:""}get elevation(){return d(this,al).properties.elevation}get spaces(){if(d(this,En).spaces==null){let r=d(this,Dl).spaces.filter(n=>n.floor.id===this.id);d(this,En).spaces=r}return d(this,En).spaces}get geoJSON(){var r;return{type:"Feature",properties:null,geometry:(r=d(this,al).geometry)!=null?r:{type:"Polygon",coordinates:[]}}}get objects(){if(d(this,En).objects==null){let r=d(this,Dl).objects.filter(n=>n.floor.id===this.id);d(this,En).objects=r}return d(this,En).objects}get connections(){if(d(this,En).connections==null){let r=d(this,Dl).connections.filter(n=>n.floors.includes(this));d(this,En).connections=r}return d(this,En).connections}get doors(){if(d(this,En).doors==null){let r=d(this,Dl).doors.filter(n=>n.floor.id===this.id);d(this,En).doors=r}return d(this,En).doors}get annotations(){if(d(this,En).annotations==null){let r=d(this,Dl).annotations.filter(n=>n.floor.id===this.id);d(this,En).annotations=r}return d(this,En).annotations}get pois(){if(d(this,En).pois==null){let r=d(this,Dl).pointsOfInterest.filter(n=>n.floor.id===this.id);d(this,En).pois=r}return d(this,En).pois}get floorStack(){if(d(this,En).floorStack==null){let r=d(this,Dl).floorStacks.find(n=>n.floors.includes(this));d(this,En).floorStack=r}return d(this,En).floorStack}get center(){if(d(this,En).center==null){let r=d(this,al).geometry;if(r==null)d(this,En).center=new Ct({latitude:0,longitude:0,floorId:this.id});else{let n=Nc(r);d(this,En).center=new Ct({latitude:n.geometry.coordinates[1],longitude:n.geometry.coordinates[0],floorId:this.id})}}return d(this,En).center}toJSON(){return{__type:Nm.__type,id:this.id,name:this.name,shortName:this.shortName,elevation:this.elevation,spaces:this.spaces.map(r=>r.id),objects:this.objects.map(r=>r.id),connections:this.connections.map(r=>r.id),doors:this.doors.map(r=>r.id),annotations:this.annotations.map(r=>r.id),pois:this.pois.map(r=>r.id)}}destroy(){for(let r of globalThis.Object.keys(d(this,En)))delete d(this,En)[r]}};Dl=new WeakMap,En=new WeakMap,al=new WeakMap,lx=new WeakSet,PO=o(function(r){let n=d(this,al).properties[r];return d(this,Dl).getPropTranslation(this.__type,r,this.id,n)},"#translate"),o(Nm,"Floor"),x(Nm,"__type","floor");var wO=Nm,ua=wO;g();g();g();var ux=o(e=>e!=null,"notNull");g();function cx(e){let t;if(wo.is(e)||Au.is(e)||Oa.is(e)||rf.is(e)||Fl.is(e))t=e.center;else if(uf.is(e)||cf.is(e))t=e.coordinate;else if(Ct.is(e))t=e;else if(Qp.is(e))t=e.coordinate;else if(Uc.is(e))t=e.coordinates[0];else return;return t}o(cx,"getCoordinateFromStuffs");g();g();var km={auto:!0,debug:!1,pitch:45,bearing:0,antialiasing:{enabled:!0},shadingAndOutlines:!0,outdoorView:{layersHiddenByGeometry:["building","building-top"]},imagePlacementOptions:{mode:"default"},flipImagesToFaceCamera:!0,multiFloorView:{enabled:!1,floorHeight:10}},Vc="ExteriorWalls",Gd="Walls",iG=0,k0="InteriorDoors",R0="ExteriorDoors",Zi="GeometryLayer",pf="LabelsLayer",zc="MarkersLayer",px="FootprintLayer",B0="OcclusionLayer",oG="ImagesLayer",Rm="FacadesLayer";var sG=["https://mappedin.auth0.com","https://mappedin-staging.auth0.com"],aG={orange:"#F26336",teal:"#057685",lightTeal:"#5DC7D0"};function TO(e){var t,r;(t=e.outdoorView)!=null&&t.enabled&&!((r=e.outdoorView)!=null&&r.token)&&ce.error("Enable outdoor view requires a token. Provide token in `options.outdoorView.token`")}o(TO,"validateOptions");function EO(e,t){var i,s,l,c,p,h;let r=((i=e==null?void 0:e.outdoorView)==null?void 0:i.token)||t.outdoorViewToken,n=re(k(k({},km),e),{outdoorView:k({enabled:((s=e==null?void 0:e.outdoorView)==null?void 0:s.enabled)===void 0?!!r:(l=e==null?void 0:e.outdoorView)==null?void 0:l.enabled,layersHiddenByGeometry:(c=km.outdoorView)==null?void 0:c.layersHiddenByGeometry},e==null?void 0:e.outdoorView),bearing:(h=(p=e==null?void 0:e.bearing)!=null?p:t.naturalBearing)!=null?h:0,imagePlacementOptions:k(k({},km.imagePlacementOptions),e==null?void 0:e.imagePlacementOptions),multiFloorView:k(k({},km.multiFloorView),e==null?void 0:e.multiFloorView)});return r&&n.outdoorView&&(n.outdoorView.token=r),n}o(EO,"handleShow3DMapOptionDefault");function lG(e){let t={remove_watermark:!1};if(e)try{let r=fS(e);Object.assign(t,r.capabilities)}catch(r){ce.error("Error decoding capabilities from token",r)}return t}o(lG,"handleTokenCapabilities");var Ud,Nl,ff,Bm=class Bm extends cs{constructor(r,n){let i=Object.values(n.mvfDataByFloorId)[0];super(r,i);x(this,"__type",Bm.__type);G(this,Ud);G(this,Nl);G(this,ff);q(this,Nl,{}),q(this,Ud,r),q(this,ff,n.mvfDataByFloorId)}static is(r){return r.__type===Bm.__type}get accessible(){var r;return(r=Object.values(d(this,ff))[0].properties.accessible)!=null?r:!1}get type(){var r,n;return(n=(r=Object.values(d(this,ff))[0].properties.kind)==null?void 0:r.split(".")[1])!=null?n:"unknown"}get extra(){return Object.values(d(this,ff))[0].properties.extra}get coordinates(){return d(this,Nl).coordinates==null&&(d(this,Nl).coordinates=Object.entries(d(this,ff)).map(([r,n])=>new Ct(n.geometry.coordinates[1],n.geometry.coordinates[0],r))),d(this,Nl).coordinates}get nodes(){return Object.values(d(this,ff))[0].properties.nodes.map(r=>d(this,Ud).getById("node",r))}get floors(){return this.coordinates.map(r=>r.floorId?d(this,Ud).getById("floor",r.floorId):void 0).filter(ux)}get locationProfiles(){var n,i,s,l,c;if(d(this,Nl).locationProfiles!=null)return d(this,Nl).locationProfiles;let r=super.locationProfiles;if(r==null||r.length===0){let p=[(i=(n=this.coordinates[0])==null?void 0:n.longitude)!=null?i:0,(l=(s=this.coordinates[0])==null?void 0:s.latitude)!=null?l:0],h=Dc(p),y=(c=d(this,Ud).mvfConnectionIdsByLatLon[h])!=null?c:[];for(let b of y){let _=d(this,Ud).locationProfilesByAttachedFeatureId[b];if(_!=null){r=_;break}}}return d(this,Nl).locationProfiles=r!=null?r:[],r}get focusTarget(){return this.coordinates}toJSON(){return{__type:Bm.__type,id:this.id,name:this.name,type:this.type,externalId:this.externalId,coordinates:this.coordinates.map(r=>r.toJSON()),floors:this.floors.map(r=>r.id),extra:this.extra}}destroy(){for(let r of Object.keys(d(this,Nl)))delete d(this,Nl)[r]}};Ud=new WeakMap,Nl=new WeakMap,ff=new WeakMap,o(Bm,"Connection"),x(Bm,"__type","connection");var MO=Bm,Vd=MO;g();var fx,jm,zd,Gm,$m=class $m extends cs{constructor(r,n){super(r,n.mvfData);x(this,"__type",$m.__type);G(this,fx);G(this,jm);G(this,zd,{});G(this,Gm);q(this,fx,r),q(this,jm,n.floorId),q(this,Gm,n.mvfData)}static is(r){return r.__type===$m.__type}get type(){let r=d(this,Gm).properties.kind;return r==null&&(r="object"),r==="Desks"&&(r="desk"),r.toLowerCase()}get floor(){let r=d(this,fx).getById("floor",d(this,jm));if(r==null)throw new Error("Floor ".concat(d(this,jm)," not found!"));return r}get center(){var r;if(d(this,zd).center==null){let[n,i]=(r=d(this,Gm).properties.center)!=null?r:[0,0];d(this,zd).center=new Ct(i,n,d(this,jm))}return d(this,zd).center}get geoJSON(){return re(k({},d(this,Gm)),{properties:null})}get anchorTarget(){return this.center}get focusTarget(){return this.geoJSON.geometry.type==="Polygon"?this:this.center}toJSON(){return{__type:$m.__type,id:this.id,name:this.name,type:this.type,floor:this.floor.id,center:this.center.toJSON()}}destroy(){for(let r of globalThis.Object.keys(d(this,zd)))d(this,zd)[r]=null}};fx=new WeakMap,jm=new WeakMap,zd=new WeakMap,Gm=new WeakMap,o($m,"MapObject"),x($m,"__type","object");var OO=$m,Oa=OO;g();var dx,Vm,qd,$0,Um=class Um extends cs{constructor(r,n){super(r,n.mvfData);x(this,"__type",Um.__type);G(this,dx);G(this,Vm);G(this,qd,{});G(this,$0);q(this,dx,r),q(this,$0,n.mvfData),q(this,Vm,n.floorId)}static is(r){return r.__type===Um.__type}get floor(){let r=d(this,dx).getById("floor",d(this,Vm));if(r==null)throw new Error("Floor ".concat(d(this,Vm)," not found!"));return r}get coordinate(){var r;if(d(this,qd).coordinate==null){let[n,i]=(r=d(this,$0).geometry.coordinates)!=null?r:[0,0];d(this,qd).coordinate=new Ct(i,n,d(this,Vm))}return d(this,qd).coordinate}get geoJSON(){return re(k({},d(this,$0)),{properties:null})}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{__type:Um.__type,id:this.id,name:this.name,floor:this.floor.id,coordinate:this.coordinate.toJSON()}}destroy(){for(let r in d(this,qd))d(this,qd)[r]=null}};dx=new WeakMap,Vm=new WeakMap,qd=new WeakMap,$0=new WeakMap,o(Um,"PointOfInterest"),x(Um,"__type","point-of-interest");var LO=Um,uf=LO;g();var hx,qm,Hd,Hm,mx,DO,zm=class zm extends cs{constructor(r,n){super(r,n.mvfData);G(this,mx);x(this,"__type",zm.__type);G(this,hx);G(this,qm);G(this,Hd,{});G(this,Hm);q(this,hx,r),q(this,qm,n.floorId),q(this,Hm,n.mvfData)}static is(r){return r.__type===zm.__type}get group(){return ke(this,mx,DO).call(this).group}get type(){return ke(this,mx,DO).call(this).type}get coordinate(){if(d(this,Hd).coordinate==null){let[r,n]=d(this,Hm).geometry.coordinates;d(this,Hd).coordinate=new Ct(n,r,d(this,qm))}return d(this,Hd).coordinate}get floor(){let r=d(this,hx).getById("floor",d(this,qm));if(r==null)throw new Error("Floor ".concat(d(this,qm)," not found!"));return r}get geoJSON(){return re(k({},d(this,Hm)),{properties:null})}get focusTarget(){return this.coordinate}get anchorTarget(){return this.coordinate}toJSON(){return{__type:zm.__type,id:this.id,group:this.group,type:this.type,coordinate:this.coordinate.toJSON()}}destroy(){for(let r of Object.keys(d(this,Hd)))delete d(this,Hd)[r]}};hx=new WeakMap,qm=new WeakMap,Hd=new WeakMap,Hm=new WeakMap,mx=new WeakSet,DO=o(function(){let[r,n]=d(this,Hm).properties.symbolId.split("--");return{group:r,type:n}},"#getGroupAndTypeFromSymbolId"),o(zm,"Annotation"),x(zm,"__type","annotation");var AO=zm,cf=AO;g();var kfe=o((e,t)=>{var p,h,y,b,_,C,P,E,T,O,D;let r={},n={},i={},s={},l={},c={};for(let A of e["location.json"]||[]){let R=new Wm(t,{mvfData:A});if(r[A.id]=R,A.externalId&&(s[A.externalId]==null&&(s[A.externalId]=[]),s[A.externalId].push(R)),A.categories)for(let X of A.categories)l[X]==null&&(l[X]=[]),l[X].push(R);let j=[...(h=(p=A.obstructions)==null?void 0:p.map(X=>X.id))!=null?h:[],...(b=(y=A.spaces)==null?void 0:y.map(X=>X.id))!=null?b:[],...(C=(_=A.annotations)==null?void 0:_.map(X=>X.id))!=null?C:[],...(P=A.connections)!=null?P:[],...(T=(E=A.entrances)==null?void 0:E.map(X=>X.id))!=null?T:[],...(D=(O=A.areas)==null?void 0:O.map(X=>X.id))!=null?D:[]];for(let X of j)X&&(c[X]==null&&(c[X]=[]),c[X].push(R))}for(let A of e["category.json"]||[]){let R=new yx(t,{mvfData:A});n[A.id]=R,A.parent&&(i[A.parent]==null&&(i[A.parent]=[]),i[A.parent].push(R))}return{locationCategoriesByParentId:i,locationProfilesById:r,locationCategoriesById:n,locationProfilesByExternalId:s,locationProfilesByCategoryId:l,locationProfilesByAttachedFeatureId:c}},"processMVFLocationProfilesAndCategories"),Rfe=o((e,t,r)=>{var T,O;let n={},i={},s={},l={},c={},p={},h={},y={},b={},_={},C={},P={},E=globalThis.Object.keys(e.space);for(let D of E){let A=e.space[D];if(A!=null)for(let R of A.features){P[R.properties.id]=D,h[R.properties.id]=R;for(let j of R.properties.destinationNodes)c[j]==null&&(c[j]=[]),c[j].push(R.properties.id);if(R.properties.kind==="desk-entrance"&&(p[R.properties.externalId]==null&&(p[R.properties.externalId]=[]),p[R.properties.externalId].push(...R.properties.destinationNodes)),!["void","desk-entrance"].includes((T=R.properties.kind)!=null?T:"")){if((O=R.properties.kind)!=null&&O.includes("connection")){let j=Dc(R.geometry.coordinates);_[j]==null&&(_[j]=[]),_[j].push(R.properties.id);continue}if(R.properties.kind==="poi"){let j=new uf(r,{floorId:D,mvfData:R});s[R.properties.id]=j,b[D]||(b[D]=[]),b[D].push(R),R.properties.externalId&&(l[R.properties.externalId]==null&&(l[R.properties.externalId]=[]),l[R.properties.externalId].push(j))}else{let j=new wo(r,{floorId:D,mvfData:R});n[R.properties.id]=j,R.properties.externalId&&(i[R.properties.externalId]==null&&(i[R.properties.externalId]=[]),i[R.properties.externalId].push(j)),y[D]||(y[D]=[]),y[D].push(R)}}}}for(let D in _){let A=_[D],R={};for(let X of A){let Y=P[X],N=h[X],Z=t==null?void 0:t["n_"+N.properties.id.split("s_")[1]];R[Y]=re(k({},N),{properties:re(k({},N.properties),{accessible:(Z==null?void 0:Z.accessible)===!0})})}let j=new Vd(r,{mvfDataByFloorId:R});C[j.id]=j}return{spacesById:n,spacesByExternalId:i,poisById:s,poisByExternalId:l,connectionsById:C,spaceIdsByDestinationNodeId:c,objectEntranceNodeIdsByObstructionId:p,mvfSpacesById:h,connectionIdsByLatLon:_,mvfSpacesByFloorId:y,mvfPoisByFloorId:b}},"processMVFSpaces"),Bfe=o((e,t)=>{var l,c;let r={},n={},i={},s={};for(let p of e["node.geojson"].features){i[p.properties.id]=p;let h=new Qp(t,{mvfData:p,floorId:(l=p.properties.floor)!=null?l:p.properties.map});r[p.properties.id]=h,p.properties.externalId&&(n[p.properties.externalId]==null&&(n[p.properties.externalId]=[]),n[p.properties.externalId].push(h));let y=(c=p.properties.floor)!=null?c:p.properties.map;s[y]||(s[y]=[]),s[y].push(p)}return{nodesById:r,nodesByExternalId:n,mvfNodesById:i,mvfNodesByFloorId:s}},"processMVFNodes"),$fe=o((e,t)=>{let r={},n={},i={},s={},l=globalThis.Object.keys(e.obstruction);for(let c of l){let p=e.obstruction[c];if(p!=null)for(let h of p.features){i[h.properties.id]=h;for(let b of h.properties.entrances)s[b]=h.properties.id;if(h.properties.kind==="Wall")continue;let y=new Oa(t,{floorId:c,mvfData:h});r[h.properties.id]=y,h.properties.externalId&&(n[h.properties.externalId]==null&&(n[h.properties.externalId]=[]),n[h.properties.externalId].push(y))}}return{objectsById:r,objectsByExternalId:n,mvfObstructionById:i,obstructionIdByEntranceId:s}},"processMVFObstructions"),jfe=o((e,t)=>{let r={},n={},i={};if("floor.geojson"in e&&e["floor.geojson"]!=null)for(let s of e["floor.geojson"].features){i[s.properties.id]=s.properties;let l=new ua(t,{mvfData:s});r[s.properties.id]=l,s.properties.externalId&&(n[s.properties.externalId]==null&&(n[s.properties.externalId]=[]),n[s.properties.externalId].push(l))}else for(let s of e["map.geojson"]){i[s.id]=s;let l=new ua(t,{mvfData:{properties:s}});r[s.id]=l}return{floorsById:r,floorsByExternalId:n,mvfFloorsById:i}},"processMVFFloors"),Gfe=o((e,t)=>{var p;let r={},n={},i={},s={},l={},c=e["floorstack.json"]||e["mapstack.json"]||e["mapstack.geojson"];if(c!=null)for(let h of c){let y=(p=e.facade)==null?void 0:p[h.id],b=new Db(t,{mvfData:h,facadeId:y==null?void 0:y.id});if(r[h.id]=b,h.externalId&&(n[h.externalId]==null&&(n[h.externalId]=[]),n[h.externalId].push(b)),i[h.id]=h,y){let _=new Fl(t,{mvfData:y,floorStackId:h.id});s[y.id]=_;for(let C of y.spaces)l[C.spaceId]=_}}return{floorStacksById:r,floorStacksByExternalId:n,mvfFloorStacksById:i,facadesById:s,facadesBySpaceId:l}},"processMVFFloorStacks"),Ufe=o((e,t)=>{let r={},n={},i=e["connection.json"].reduce((s,l)=>{l.nodes.forEach(p=>s[p]=l),r[l.id]=l;let c=t==null?void 0:t[l.nodes[0]];if(c!=null){let p=Dc(c.geometry.coordinates);n[p]==null&&(n[p]=[]),n[p].push(l.id)}return s},{});return{mvfConnectionsById:r,mvfConnectionsByNodeId:i,mvfConnectionIdsByLatLon:n}},"processMVFConnections"),Vfe=o((e,t)=>{let r={},n={},i={},s={},l={},c=globalThis.Object.keys(e.entrance);for(let p of c){let h=e.entrance[p];if(h!=null)for(let y of h.features){s[y.properties.id]=y;let b=new Au(t,{floorId:p,mvfData:y});y.properties.node&&(i[y.properties.node]=b),r[y.properties.id]=b,y.properties.externalId&&(n[y.properties.externalId]==null&&(n[y.properties.externalId]=[]),n[y.properties.externalId].push(b)),l[p]||(l[p]=[]),l[p].push(y)}}return{doorsById:r,doorsByExternalId:n,doorsByNodeId:i,mvfEntrancesById:s,mvfEntrancesByFloorId:l}},"processMVFEntrances"),zfe=o((e,t,r)=>{var n;if(e.textAreas!=null)for(let i in e.textAreas){let s=(n=e.textAreas[i])==null?void 0:n.features;if(s!=null){for(let l of s)if("anchorId"in l.properties){let c=l==null?void 0:l.properties,p=t[c.anchorId]||r[c.anchorId];if(p!=null&&c!=null){let h=p.properties;h.textArea=c,h.textArea&&(h.textArea.position=l.geometry.coordinates)}}}}},"processMVFTextAreas"),qfe=o((e,t,r)=>{var n;if(e.floorImages!=null)for(let i in e.floorImages){let s=(n=e.floorImages[i])==null?void 0:n.features;if(s!=null){for(let l of s)if("anchorId"in l.properties){let c=l==null?void 0:l.properties,p=t[c.anchorId]||r[c.anchorId];if(p!=null&&c!=null){let h=p.properties;h.image=c,h.image&&(h.image.position=l.geometry.coordinates)}}}}},"processMVFPolygonImages"),Hfe=o((e,t)=>{var n,i;if(((n=e.enterprise)==null?void 0:n.enterpriseStyles)==null)return;let r=(i=e.enterprise)==null?void 0:i.enterpriseStyles;for(let s in r){let l=r[s];l.geometryAnchors.forEach(c=>{let p=t[c.geometryId];if(p!=null){let h=p.properties;h.style={styleId:s,edgeOffset:l.edgeOffset}}})}},"processMVFEnterprisePolygonStyles"),Wfe=o((e,t,r)=>{if(!(e.enterprise==null||e.enterprise.textures==null))for(let n of e.enterprise.textures)for(let i of n.geometryAnchors){let s=t[i.geometryId]||r[i.geometryId];if(s!=null){let l=s.properties;l.textures==null&&(l.textures=[]),l.textures.push(n)}}},"processMVFEnterpriseTextures"),Xfe=o((e,t)=>{let r={},n={},i={};if(e.annotation==null)return{annotationsById:r,mvfAnnotationsById:n,mvfAnnotationsByFloorId:i};let s=globalThis.Object.keys(e.annotation);for(let l of s){let c=e.annotation[l];if(c!=null)for(let p of c.features){n[p.properties.id]=p;let h=new cf(t,{floorId:l,mvfData:p});r[p.properties.id]=h,i[l]||(i[l]=[]),i[l].push(p)}}return{annotationsById:r,mvfAnnotationsById:n,mvfAnnotationsByFloorId:i}},"processMVFAnnotations"),Yfe=o((e,t)=>{let r={},n={},i={};if(e.area==null)return{areasById:r,areasByExternalId:n,mvfAreasById:i};let s=globalThis.Object.keys(e.area);for(let l of s){let c=e.area[l];if(c!=null)for(let p of c.features){i[p.properties.id]=p;let h=new rf(t,{floorId:l,mvfData:p});r[p.properties.id]=h,p.properties.externalId&&(n[p.properties.externalId]==null&&(n[p.properties.externalId]=[]),n[p.properties.externalId].push(h))}}return{areasById:r,areasByExternalId:n,mvfAreasById:i}},"processMVFAreas"),uG=o((e,t)=>{var O,D,A,R,j,X,Y,N,Z,ae,se,U,xe;let r={},n={},i={},s={},l=((D=(O=e.enterprise)==null?void 0:O.locations)!=null?D:[]).reduce((ne,Pe)=>(ne[Pe.id]=Pe,ne),{}),c={},p={},h={},y={},b={},_={},C=((A=e.enterprise)==null?void 0:A.venue)||{},P={},E={};for(let ne of(j=(R=e.enterprise)==null?void 0:R.categories)!=null?j:[]){let Pe=new gx(t,{mvfData:ne});c[ne.id]=Pe,ne.externalId&&(p[ne.externalId]==null&&(p[ne.externalId]=[]),p[ne.externalId].push(Pe)),h[ne.id]=ne,ne.locations.forEach(Ce=>{b[Ce]==null&&(b[Ce]=[]),b[Ce].push(ne.id)})}let T={};for(let ne of(Y=(X=e.enterprise)==null?void 0:X.locationInstances)!=null?Y:[]){let Pe=l[ne.parent],Ce=Object.keys(Pe),Ue={};for(let Me of Ce)Ue[Me]=void 0;let _e=k(re(k({},Ue),{polygons:[],nodes:[]}),ne);T[_e.parent]==null&&(T[_e.parent]=[]),T[_e.parent].push(new Uc(t,{mvfData:_e,categoryIds:((Z=(N=e.enterprise)==null?void 0:N.categoryPriorities)==null?void 0:Z[_e.id])||b[_e.id],parentId:ne.parent})),P[_e.id]=ne}for(let ne in e.space){let Pe=e.space[ne];if(Pe!=null)for(let Ce of Pe.features)for(let Ue of Ce.properties.destinationNodes)E[Ue]==null&&(E[Ue]=[]),E[Ue].push(Ce.properties.id)}for(let ne of(se=(ae=e.enterprise)==null?void 0:ae.locations)!=null?se:[]){let Pe=new Uc(t,{mvfData:ne,categoryIds:((xe=(U=e.enterprise)==null?void 0:U.categoryPriorities)==null?void 0:xe[ne.id])||b[ne.id],locationInstances:T[ne.id]});i[ne.id]=Pe,ne.externalId&&(s[ne.externalId]==null&&(s[ne.externalId]=[]),s[ne.externalId].push(Pe)),ne.nodes.forEach(Ce=>{_[Ce.id]==null&&(_[Ce.id]=[]),_[Ce.id].push(ne.id)});for(let Ce of ne.polygons)y[Ce.id]==null&&(y[Ce.id]=[]),y[Ce.id].push(ne)}if(t.enterpriseMode===!0){for(let ne in t.mvfConnectionsById){let Pe={},Ce=t.mvfConnectionsById[ne];for(let Ue of t.mvfConnectionsById[ne].nodes){let _e=t.nodesById[Ue];_e!=null&&(Pe[_e.floor.id]={type:"Feature",geometry:{type:"Point",coordinates:[_e.coordinate.longitude,_e.coordinate.latitude]},properties:{id:ne,externalId:Ce.externalId,kind:"enterprise."+Ce.type,destinationNodes:[],flags:"",type:Ce.type,nodes:Ce.nodes,accessible:Ce.accessible,extra:Ce.extra,details:Ce.details}})}Object.keys(Pe).length>0&&(r[ne]=new Vd(t,{mvfDataByFloorId:Pe}),Ce.externalId&&(n[Ce.externalId]==null&&(n[Ce.externalId]=[]),n[Ce.externalId].push(r[ne])))}t.connectionsById=r}return{spaceIdsByNodeId:E,connectionsByExternalId:n,locationIdsByNodeId:_,mvfLocationsBySpaceId:y,mvfLocationsById:l,mvfCategoriesById:h,locationsById:i,locationsByExternalId:s,locationInstancesById:P,categoriesById:c,categoriesByExternalId:p,venue:C}},"createEnterpriseDataFromMVF"),cG=o((e,t)=>{let{nodesById:r,nodesByExternalId:n,mvfNodesById:i,mvfNodesByFloorId:s}=Bfe(e,t),{mvfConnectionsById:l,mvfConnectionsByNodeId:c,mvfConnectionIdsByLatLon:p}=Ufe(e,i),{spacesById:h,spacesByExternalId:y,spaceIdsByDestinationNodeId:b,poisById:_,poisByExternalId:C,mvfSpacesById:P,objectEntranceNodeIdsByObstructionId:E,connectionsById:T,connectionIdsByLatLon:O,mvfSpacesByFloorId:D,mvfPoisByFloorId:A}=Rfe(e,c,t),{objectsById:R,objectsByExternalId:j,mvfObstructionById:X,obstructionIdByEntranceId:Y}=$fe(e,t),{floorsById:N,floorsByExternalId:Z,mvfFloorsById:ae}=jfe(e,t),{floorStacksById:se,floorStacksByExternalId:U,mvfFloorStacksById:xe,facadesById:ne,facadesBySpaceId:Pe}=Gfe(e,t),{doorsById:Ce,doorsByExternalId:Ue,doorsByNodeId:_e,mvfEntrancesById:Me,mvfEntrancesByFloorId:Q}=Vfe(e,t),{annotationsById:it,mvfAnnotationsById:Ke,mvfAnnotationsByFloorId:rt}=Xfe(e,t),{areasById:Ae,areasByExternalId:Be,mvfAreasById:We}=Yfe(e,t);qfe(e,P,X),zfe(e,P,X),Hfe(e,P),Wfe(e,P,X);let{locationCategoriesByParentId:je,locationProfilesById:Se,locationCategoriesById:H,locationProfilesByExternalId:ie,locationProfilesByCategoryId:ee,locationProfilesByAttachedFeatureId:Ee}=kfe(e,t);return{spacesById:h,spacesByExternalId:y,nodesById:r,nodesByExternalId:n,objectsById:R,objectsByExternalId:j,floorsById:N,floorsByExternalId:Z,floorStacksById:se,floorStacksByExternalId:U,facadesById:ne,facadesBySpaceId:Pe,connectionsById:T,doorsById:Ce,doorsByExternalId:Ue,doorsByNodeId:_e,poisById:_,poisByExternalId:C,annotationsById:it,areasById:Ae,areasByExternalId:Be,spaceIdsByDestinationNodeId:b,objectEntranceNodeIdsByObstructionId:E,obstructionIdByEntranceId:Y,connectionIdsByLatLon:O,locationProfilesById:Se,locationCategoriesById:H,locationProfilesByExternalId:ie,locationProfilesByCategoryId:ee,locationCategoriesByParentId:je,mvfSpacesById:P,mvfNodesById:i,mvfObstructionById:X,mvfFloorsById:ae,mvfFloorStacksById:xe,mvfConnectionsById:l,mvfConnectionsByNodeId:c,mvfEntrancesById:Me,mvfAnnotationsById:Ke,mvfNodesByFloorId:s,mvfSpacesByFloorId:D,mvfPoisByFloorId:A,mvfAreasById:We,mvfEntrancesByFloorId:Q,mvfAnnotationsByFloorId:rt,locationProfilesByAttachedFeatureId:Ee,mvfConnectionIdsByLatLon:p}},"createDataFromMVF");g();g();g();var Zfe=o(function(){let t=globalThis.fetch;return{fetch(...r){if(!ux(t))throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return t==null?void 0:t(...r)},setFetch(r){t=r}}},"createFetchControl")(),pG=Zfe.fetch;var gG=["websdk","web","webv2","kiosk-v2","mobile","iossdk","androidsdk","reactnativesdk","gen7","bespoke"],fG=gG[0],yG="https://api-gateway.mappedin.com/track-analytics/a/",vG="deny-watchposition",bG="load-mapview",xG="load-mapdata",IG="change-language",_G="query-directions";var qc,kl,df,NO,PC,kO=class kO{constructor(){G(this,df);G(this,qc,Object.freeze({}));G(this,kl);x(this,"oneTimeEventsSent",new Set);x(this,"sendGetDirectionsEvent",UN((t,r)=>this.sendAnalyticEvent(_G,{start:t,end:r,type:"location_to_location"}),2500));q(this,kl,ke(this,df,PC).call(this,d(this,qc)))}init(t){this.reset(),this.updateStateWithOptions(t)}reset(){q(this,qc,{}),q(this,kl,ke(this,df,PC).call(this,{})),this.oneTimeEventsSent.clear()}updateStateWithOptions(t){return q(this,qc,Object.freeze(Object.assign({},d(this,qc),t))),q(this,kl,ke(this,df,PC).call(this,t)),ke(this,df,NO).call(this,d(this,kl)),d(this,kl)}updateState(t){let r=k({},t);r.mapId&&(r.analyticsBaseUrl=FO(re(k({},d(this,kl)),{mapId:r.mapId}))),r.context&&(r.context=mG(r.context)),r.baseUri&&(r.analyticsBaseUrl=FO({baseUri:r.baseUri,mapId:d(this,kl).mapId})),Object.assign(d(this,kl),r),this.handleStateUpdate(t),ke(this,df,NO).call(this,r)}handleStateUpdate(t){var r;(r=t.userPosition)!=null&&r.floorLevel?this.sendBlueDotEvents("found-floor"):t.userPosition&&this.sendBlueDotEvents("found-position")}get authReady(){let{key:t,secret:r,accessToken:n}=this.getState();return!!(t&&r)||!!n}getState(){return d(this,kl)}getContext(){return this.getState().context||d(this,qc).context||fG}getSessionId(){return this.getState().sessionId||d(this,qc).sessionId||hG()}getDeviceId(){return this.getState().deviceId||d(this,qc).deviceId||dG()}sendAnalyticEvent(t,r={}){let n=this.getState(),i=Kfe(n.analyticsBaseUrl,t),s={"mi-context":this.getContext(),"mi-session":this.getSessionId(),"mi-device":this.getDeviceId()};if(n.logEvents&&ce.log("Analytics.track",i,s),!n.sendEvents)return Promise.resolve();if(!this.authReady)return ce.warn("Auth needs to be ready to send analytics.");let l=re(k({},r),{g:n.geolocationMode,sdk_version:n.version});return n.userPosition&&Object.assign(l,n.userPosition),s["Content-Type"]="application/json",n.accessToken?s.Authorization="Bearer ".concat(n.accessToken):n.noAuth||n.secret&&n.key&&(s["x-mappedin-key"]=btoa(n.key),s["x-mappedin-secret"]=btoa(n.secret)),pG(i,{method:"POST",mode:"cors",headers:s,body:JSON.stringify(l)})}capture(t,r){if(Qfe.includes(t))return ce.warn("".concat(t," event is sent internally.")),Promise.resolve();let n=Jfe.includes(t)?t.slice(1):t;return this.sendAnalyticEvent(n,r)}sendGetMapDataEvent(t){return this.sendAnalyticEvent(xG,t)}sendChangeLanguageEvent(t){return this.sendAnalyticEvent(IG,t)}sendWatchPositionDenied(){return this.sendAnalyticEvent(vG)}sendMapViewLoadedEvent({firstRenderDuration:t,dimension:r}){return this.sendAnalyticEvent(bG,{type:"3d",firstRenderDuration:t,width:r.width,height:r.height,devicePixelRatio:globalThis.devicePixelRatio||1})}sendBlueDotEvents(t){if(!((t==="found-floor"||t==="found-position")&&this.oneTimeEventsSent.has(t)))return this.oneTimeEventsSent.add(t),this.sendAnalyticEvent(t)}};qc=new WeakMap,kl=new WeakMap,df=new WeakSet,NO=o(function(t){t.sessionId&&Jp.getInstance().saveSessionData("id",t.sessionId),t.deviceId&&Jp.getInstance().saveLocalData("deviceId",t.deviceId)},"#saveStateToStorage"),PC=o(function(t){var n,i,s,l;let r=(n=t.baseUri)!=null?n:yG;return{baseUri:r,analyticsBaseUrl:FO(re(k({},t),{baseUri:r})),version:((i=I==null?void 0:I.env)==null?void 0:i.npm_package_version)||"v6",deviceId:t.deviceId||dG(),accessToken:t.accessToken,mapId:t.mapId,sessionId:t.sessionId||hG(),platformString:t.platformString||"",context:mG(t.context)||fG,geolocationMode:!1,sendEvents:(s=t.sendEvents)!=null?s:!0,logEvents:(l=t.logEvents)!=null?l:!1,noAuth:t.noAuth||!1,key:t.key,secret:t.secret}},"#getStateWithOption"),o(kO,"AnalyticsInternal");var j0=kO;function FO({mapId:e,baseUri:t=yG}){return"".concat(t).concat(e,"/")}o(FO,"getBaseUrl");function dG(){return Jp.getInstance().loadLocalData("deviceId")}o(dG,"getDeviceIDFromStorage");function hG(){return Jp.getInstance().loadSessionData("id")}o(hG,"getSessionIDFromStorage");function Kfe(e,t){return e+t}o(Kfe,"buildUrl");function mG(e){return gG.find(t=>t===e)}o(mG,"getValidContext");var Jfe=["$select-location","$select-category","$query-suggest","$query-search"],Qfe=[bG,xG,_G,vG,IG],Tft=new j0,Rl,RO=class RO{constructor(t){G(this,Rl);x(this,"capture");x(this,"updateState");q(this,Rl,t),this.capture=d(this,Rl).capture.bind(d(this,Rl)),this.updateState=d(this,Rl).updateState.bind(d(this,Rl))}getState(){let i=d(this,Rl).getState(),{sessionId:t,deviceId:r}=i;return ls(i,["sessionId","deviceId"])}getContext(){return d(this,Rl).getContext()}getSessionId(){return d(this,Rl).getSessionId()}getDeviceId(){return d(this,Rl).getDeviceId()}};Rl=new WeakMap,o(RO,"Analytics");var vx=RO;g();var ede=new Set(["polygons"]),Nu,Si,La,bx,Xm=class Xm extends Co{constructor(r,n){super(n.mvfData.externalId);x(this,"__type",Xm.__type);x(this,"description");x(this,"name","");x(this,"amenity");x(this,"externalId","");x(this,"extra");x(this,"gallery");x(this,"instances");x(this,"logo");x(this,"operationHours");x(this,"phone");x(this,"picture");x(this,"shortName");x(this,"showFloatingLabelWhenImagePresent");x(this,"showLogo");x(this,"siblingGroups");x(this,"social");x(this,"sortOrder",-1);x(this,"states");x(this,"tags");x(this,"type","");x(this,"hidden",!1);G(this,Nu);G(this,Si,{});G(this,La);G(this,bx);q(this,Nu,r),q(this,La,n.mvfData),q(this,bx,n.categoryIds||[]),this.instances=n.locationInstances||[];for(let i in n.mvfData)!ede.has(i)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)&&Object.defineProperty(this,i,{enumerable:!0,get(){if(n.parentId){let s=d(this,Nu).locationsById[n.parentId];return d(this,La)[i]!=null?d(this,Nu).getPropTranslation(this.__type,i,d(this,La).id,d(this,La)[i]):d(this,Nu).getPropTranslation(this.__type,i,d(this,La).id,s[i])}return d(this,Nu).getPropTranslation(this.__type,i,d(this,La).id,d(this,La)[i])}})}static is(r){return r.__type===Xm.__type}get focusTarget(){return this.spaces}get categories(){return d(this,Si).categories?d(this,Si).categories:(d(this,Si).categories=(d(this,bx).map(r=>d(this,Nu).getById("enterprise-category",r))||[]).filter(Boolean),d(this,Si).categories)}get coordinates(){if(d(this,Si).coordinates)return d(this,Si).coordinates;d(this,Si).coordinates=[];for(let r=0;r<this.nodes.length;r++)d(this,Si).coordinates.push(this.nodes[r].coordinate);return d(this,Si).coordinates}get nodes(){if(d(this,Si).nodes)return d(this,Si).nodes;d(this,Si).nodes=[];for(let r=0;r<d(this,La).nodes.length;r++){let n=d(this,Nu).getById("node",d(this,La).nodes[r].id);n&&d(this,Si).nodes.push(n)}return d(this,Si).nodes}get spaces(){if(d(this,Si).spaces)return d(this,Si).spaces;d(this,Si).spaces=[];for(let r=0;r<d(this,La).polygons.length;r++){let n=d(this,Nu).getById("space",d(this,La).polygons[r].id);n&&d(this,Si).spaces.push(n)}return d(this,Si).spaces}toJSON(){return{__type:Xm.__type,id:this.id,name:this.name}}destroy(){for(let r of Object.keys(d(this,Si)))delete d(this,Si)[r]}};Nu=new WeakMap,Si=new WeakMap,La=new WeakMap,bx=new WeakMap,o(Xm,"EnterpriseLocation"),x(Xm,"__type","enterprise-location");var BO=Xm,Uc=BO;g();var tde=new Set,Zm,ca,Hc,Ym=class Ym extends Co{constructor(r,n){super(n.mvfData.externalId);x(this,"__type",Ym.__type);x(this,"name","");x(this,"color");x(this,"externalId","");x(this,"extra");x(this,"icon");x(this,"iconFromDefaultList");x(this,"sortOrder",-1);x(this,"picture");G(this,Zm);G(this,ca,{});G(this,Hc);q(this,Zm,r),q(this,Hc,n.mvfData);for(let i in n.mvfData)!tde.has(i)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)&&Object.defineProperty(this,i,{get(){return d(this,Zm).getPropTranslation(this.__type,i,d(this,Hc).id,d(this,Hc)[i])}})}static is(r){return r.__type===Ym.__type}get children(){if(d(this,ca).children)return d(this,ca).children;d(this,ca).children=[];for(let r=0;r<d(this,Hc).children.length;r++){let n=d(this,Zm).getById("enterprise-category",d(this,Hc).children[r]);n&&d(this,ca).children.push(n)}return d(this,ca).children}get locations(){if(d(this,ca).locations)return d(this,ca).locations;d(this,ca).locations=[];for(let r=0;r<d(this,Hc).locations.length;r++){let n=d(this,Zm).getById("enterprise-location",d(this,Hc).locations[r]);n&&d(this,ca).locations.push(n)}return d(this,ca).locations}toJSON(){return{__type:Ym.__type,id:this.id,name:this.name}}destroy(){for(let r of Object.keys(d(this,ca)))delete d(this,ca)[r]}};Zm=new WeakMap,ca=new WeakMap,Hc=new WeakMap,o(Ym,"EnterpriseCategory"),x(Ym,"__type","enterprise-category");var $O=Ym,gx=$O;g();var rde=new Set,xx,Ix,Km=class Km extends Co{constructor(r,n){super(n.mvfData.externalId);x(this,"__type",Km.__type);x(this,"countrycode");x(this,"externalId","");x(this,"defaultLanguage",{code:"en",name:"English"});x(this,"defaultMap");x(this,"extra");x(this,"icon");x(this,"languages",[]);x(this,"links",[]);x(this,"logo");x(this,"mappedinWebUrl");x(this,"slug","");x(this,"topLocations");x(this,"tzid");G(this,xx,{});G(this,Ix);q(this,Ix,n.mvfData);for(let i in n.mvfData)!rde.has(i)&&!Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)&&(this[i]=n.mvfData[i])}static is(r){return r.__type===Km.__type}get name(){var r;return(r=d(this,Ix).name)!=null?r:""}toJSON(){return{__type:Km.__type,id:this.id,name:this.name}}destroy(){for(let r of Object.keys(d(this,xx)))delete d(this,xx)[r]}};xx=new WeakMap,Ix=new WeakMap,o(Km,"EnterpriseVenue"),x(Km,"__type","enterprise-venue");var jO=Km,TC=jO;g();g();g();g();g();g();var FY=Pn(o6(),1),NY=Pn(AY(),1);g();var H0e=o(e=>{var r;let t=e;return((r=t==null?void 0:t.allOf)==null?void 0:r.length)===2},"isPotentiallyBadSchema");function uw(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map(uw);let t=k({},e);for(let[r,n]of Object.entries(t))if(typeof n=="object"&&n!==null){let i=uw(n);if(H0e(i)){let s=i.allOf.findIndex(c=>c.type==="array"),l=i.allOf.findIndex(c=>c.type==="object");if(s!==-1&&l!==-1){t[r]=re(k({},i),{allOf:[i.allOf[s]]});continue}}t[r]=i}return t}o(uw,"cleanupInvalidArrayAllOf");var DY={$ref:"#/definitions/ParsedMVF",$schema:"http://json-schema.org/draft-07/schema#",definitions:{AnchoredFloorTextProperties:{additionalProperties:!1,properties:{align:{default:"center",description:"Horizontal alignment of multi-line text.",enum:["left","center","right"],type:"string"},color:{default:"black",description:"The color of the text in CSS format (e.g. `#000000`, `rgb(0, 0, 0)`, `black`).",type:"string"},fontFamily:{default:"Droid Sans",description:"The font family of the text.",type:"string"},fontSize:{default:12,description:"The em-height (multiplier of the font's height) at which to render the font, in meters. The font height is the distance between the ascender (highest point, height of an A) and descender (lowest point, bottom of a g) of the font. For example, if the font-size is 12, the space for a single character will be 12 meters high.",type:"number"},geometryId:{anyOf:[{$ref:"#/definitions/SpaceId"},{$ref:"#/definitions/ObstructionId"}],description:"The geometry to which this text belongs. It will be displayed on top of it."},rotation:{description:"Rotation in degrees, about the center of the text. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},text:{description:"The text to display. Newline characters are supported.",type:"string"},visible:{default:!0,description:"Whether the text is visible.",type:"boolean"}},required:["align","color","fontFamily","fontSize","geometryId","rotation","text","visible"],type:"object"},AnchoredImageProperties:{additionalProperties:!1,properties:{anchorId:{anyOf:[{$ref:"#/definitions/SpaceId"},{$ref:"#/definitions/ObstructionId"}],description:"The geometry to which this image belongs. It will be displayed on top of it."},height:{description:"The height of the image when represented on the map, in meters.",minimum:0,type:"number"},path:{description:"The path to the image. This will be a remote URL.",type:"string"},rotation:{description:"Rotation in degrees, about the center of the image. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},width:{description:"The width of the image when represented on the map, in meters.",minimum:0,type:"number"}},required:["anchorId","height","path","rotation","width"],type:"object"},AnchoredTextAreaProperties:{additionalProperties:!1,properties:{align:{$ref:"#/definitions/TextAreaAlignment",description:"The alignment of the text within the label. 'Near' means the text will be aligned up against the position. Typically in the SDK the text will be rotated to always be upright, so either the start or end of the text will be up against the position. 'Center' means it will be centered in the middle of the area."},anchorId:{anyOf:[{$ref:"#/definitions/SpaceId"},{$ref:"#/definitions/ObstructionId"}],description:"The geometry to which this text area belongs. It will be displayed on top of it."},maxHeight:{description:"The maximum height of the label, in meters. Half the height will be above the feature's position, half below.",exclusiveMinimum:0,type:"number"},maxWidth:{description:"The maximum width of the label, in meters. The left edge will start at the feature's position and extend in the rotation direction.",exclusiveMinimum:0,type:"number"},rotation:{description:"Rotation in degrees relative to north, about the position of the label. North is 0, east is 90.",maximum:360,minimum:0,type:"number"}},required:["align","anchorId","maxHeight","maxWidth","rotation"],type:"object"},AnnotationCollection:{additionalProperties:!1,properties:{features:{items:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/AnnotationProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},AnnotationId:{pattern:"^a_[A-Za-z0-9_-]{8,}$",type:"string"},AnnotationProperties:{additionalProperties:!1,properties:{externalId:{type:"string"},id:{$ref:"#/definitions/AnnotationId"},symbolId:{type:"string"}},required:["id","symbolId"],type:"object"},Area:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Polygon"},properties:{$ref:"#/definitions/AreaProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},AreaCollection:{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Area"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},AreaId:{pattern:"^ar_[A-Za-z0-9_-]{8,}$",type:"string"},AreaProperties:{additionalProperties:!1,properties:{center:{$ref:"#/definitions/Position",description:"The center of mass of this area."},destinationNodes:{description:"A list of node IDs which can be used to navigate to this area.",items:{$ref:"#/definitions/NodeId"},type:"array"},details:{$ref:"#/definitions/Details"},externalId:{type:"string"},id:{$ref:"#/definitions/AreaId"}},required:["id"],type:"object"},Category:{additionalProperties:!1,properties:{icon:{description:"The category's icon",format:"uri",type:"string"},id:{$ref:"#/definitions/CategoryId"},name:{type:"string"},parent:{$ref:"#/definitions/CategoryId"}},required:["id","name","icon"],type:"object"},CategoryId:{description:"A category ID",pattern:"^cat_[A-Za-z0-9_-]{8,}$",type:"string"},Connection:{additionalProperties:!1,properties:{accessible:{type:"boolean"},details:{additionalProperties:!1,properties:{name:{type:"string"}},type:"object"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},id:{$ref:"#/definitions/ConnectionId"},metadata:{$ref:"#/definitions/Metadata"},nodes:{description:"A list of node IDs corresponding to nodes that are a part of this connection.",items:{$ref:"#/definitions/NodeId"},type:"array"},type:{type:"string"}},required:["id","type","nodes","externalId"],type:"object"},ConnectionId:{pattern:"^c_[A-Za-z0-9_-]{8,}$",type:"string"},Connections:{items:{$ref:"#/definitions/Connection"},type:"array"},Day:{enum:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],type:"string"},DayOrPublicHoliday:{anyOf:[{$ref:"#/definitions/Day"},{const:"PublicHolidays",type:"string"}]},Details:{additionalProperties:!1,description:"Additional information about a given entity.",properties:{description:{type:"string"},images:{items:{$ref:"#/definitions/Image"},type:"array"},links:{items:{$ref:"#/definitions/Hyperlink"},type:"array"},name:{type:"string"}},type:"object"},EnterpriseCategory:{additionalProperties:!1,properties:{children:{items:{$ref:"#/definitions/EnterpriseCategoryId"},type:"array"},color:{type:"string"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},icon:{description:"The category's icon",format:"uri",type:"string"},iconFromDefaultList:{type:["string","null"]},id:{$ref:"#/definitions/EnterpriseCategoryId"},locations:{items:{$ref:"#/definitions/EnterpriseLocationId"},type:"array"},name:{type:"string"},picture:{description:"The category's picture",format:"uri",type:"string"},sortOrder:{type:"number"}},required:["children","externalId","id","locations","name","sortOrder"],type:"object"},EnterpriseCategoryId:{description:"An ID for an enterprise category",pattern:"^ec_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseCategoryPriority:{additionalProperties:{items:{$ref:"#/definitions/EnterpriseCategoryId"},type:"array"},description:"The ordered list of category ids that this location belongs to The order here determines the priority of the categories, with the first category being the highest priority for determining application logic like icon and color preference.",propertyNames:{description:"An ID for an enterprise location",pattern:"^el_[A-Za-z0-9_-]{8,}$"},type:"object"},EnterpriseCollection:{additionalProperties:!1,properties:{categories:{items:{$ref:"#/definitions/EnterpriseCategory"},type:"array"},categoryPriorities:{$ref:"#/definitions/EnterpriseCategoryPriority"},enterpriseStyles:{$ref:"#/definitions/EnterpriseStyles"},floorText:{$ref:"#/definitions/EnterpriseFloorText"},layers:{items:{$ref:"#/definitions/EnterpriseLayer"},type:"array"},locationInstances:{items:{$ref:"#/definitions/EnterpriseLocationInstance"},type:"array"},locations:{items:{$ref:"#/definitions/EnterpriseLocation"},type:"array"},textures:{items:{$ref:"#/definitions/EnterpriseTexture"},type:"array"},venue:{$ref:"#/definitions/EnterpriseVenue"}},required:["locations","categories","venue","locationInstances","layers"],type:"object"},EnterpriseFloorText:{additionalProperties:{anyOf:[{$ref:"#/definitions/FloorTextFeatureCollection"},{not:{}}]},description:"The text to display on a map, split into feature collection per floor.",type:"object"},EnterpriseLayer:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/EnterpriseLayerId"},name:{type:"string"},spaces:{items:{$ref:"#/definitions/EnterpriseLayerSpace"},minItems:1,type:"array"}},required:["id","name","spaces"],type:"object"},EnterpriseLayerId:{pattern:"^ely_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseLayerSpace:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},spaceId:{$ref:"#/definitions/SpaceId"}},required:["floorId","spaceId"],type:"object"},EnterpriseLocation:{additionalProperties:!1,properties:{amenity:{description:"The location's amenity type. Only set if the location is an amenity",type:"string"},description:{type:"string"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},gallery:{description:"The location's image gallery",items:{additionalProperties:!1,properties:{caption:{type:["string","null"]},embeddedUrl:{description:"The URL to link from the image",format:"uri",type:["string","null"]},image:{type:"string"}},required:["image"],type:"object"},type:"array"},hidden:{description:"Whether to show the location in applications",type:"boolean"},id:{$ref:"#/definitions/EnterpriseLocationId"},links:{description:"Web links for the location",items:{additionalProperties:!1,properties:{label:{type:"string"},url:{description:"The URL of the link",format:"uri",type:"string"}},required:["label","url"],type:"object"},type:"array"},logo:{description:"The location's logo",format:"uri",type:"string"},name:{type:"string"},nodes:{deprecated:"Use `spaces` instead. A location's nodes that are not attached to a polygon will be in the spaces array as a point space. Nodes that are attached to one of it's polygons will be destinationNodes on that polygon's space",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/NodeId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},operationHours:{items:{$ref:"#/definitions/OperationHours"},type:"array"},phone:{additionalProperties:!1,properties:{extension:{type:"string"},number:{type:"string"}},required:["number"],type:"object"},picture:{description:"The picture of the location",format:"uri",type:"string"},polygons:{deprecated:"Use `spaces` instead. All of a location's polygons will be in the spaces array.",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/SpaceId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},shortName:{type:"string"},showFloatingLabelWhenImagePresent:{description:"Whether to show the flat label when an image is present",type:"boolean"},showLogo:{description:"Whether to show the logo of the location",type:"boolean"},siblingGroups:{description:"Locations that are related to this location in some manner (described by the label)",items:{$ref:"#/definitions/SiblingGroup"},type:"array"},social:{additionalProperties:!1,description:"The location's social media links",properties:{facebook:{type:"string"},instagram:{type:"string"},twitter:{type:"string"},website:{type:"string"}},type:"object"},sortOrder:{type:"number"},spaces:{description:"The places that this location is anchored to in the physical world. These are either Polygon or Point spaces. A location can be attached to many spaces, and a space can be attached to many locations.\n\nIf there are different properties for the location on those spaces, they will show up in the location's {@link EnterpriseLocation.instances instances } property",items:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/SpaceId"}},required:["floor","id"],type:"object"},type:"array"},states:{description:"The location's state. No more than one state should be active at a time, and all but at most one should have dates set",items:{$ref:"#/definitions/LocationState"},type:"array"},tags:{items:{type:"string"},type:"array"},type:{type:"string"}},required:["externalId","id","name","nodes","polygons","sortOrder","spaces","type"],type:"object"},EnterpriseLocationId:{description:"An ID for an enterprise location",pattern:"^el_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseLocationInstance:{additionalProperties:!1,description:"A locationInstance is a particular instace of an Enterprise Location that has some properties different from the parent. Eg, it may have different hours, or a slightly different name.\n\nA LocationInstance:\n- MUST have a parent, referring to an Enterprise Location.\n- MUST have a unique ID, for localization to work.\n- SHOULD have AT LEAST ONE polygon or node to anchor it in space.\n- SHOULD have AT LEAST ONE other Enterprise Location property set.\n\nIt is otherwise a Partial<EnterpriseLocation>\n\nUsage examples:\n- A locationInstance for a location with a different externalId so a customer can identify them individually.\n- A locationInstance with different operationHours, that might indicate different hours for that particular entrace.",properties:{amenity:{description:"The location's amenity type. Only set if the location is an amenity",type:"string"},description:{type:"string"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},gallery:{description:"The location's image gallery",items:{additionalProperties:!1,properties:{caption:{type:["string","null"]},embeddedUrl:{description:"The URL to link from the image",format:"uri",type:["string","null"]},image:{type:"string"}},required:["image"],type:"object"},type:"array"},hidden:{description:"Whether to show the location in applications",type:"boolean"},id:{$ref:"#/definitions/EnterpriseLocationInstanceId"},links:{description:"Web links for the location",items:{additionalProperties:!1,properties:{label:{type:"string"},url:{description:"The URL of the link",format:"uri",type:"string"}},required:["label","url"],type:"object"},type:"array"},logo:{description:"The location's logo",format:"uri",type:"string"},name:{type:"string"},nodes:{deprecated:"Use `spaces` instead. A location's nodes that are not attached to a polygon will be in the spaces array as a point space. Nodes that are attached to one of it's polygons will be destinationNodes on that polygon's space",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/NodeId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},operationHours:{items:{$ref:"#/definitions/OperationHours"},type:"array"},parent:{$ref:"#/definitions/EnterpriseLocationId"},phone:{additionalProperties:!1,properties:{extension:{type:"string"},number:{type:"string"}},required:["number"],type:"object"},picture:{description:"The picture of the location",format:"uri",type:"string"},polygons:{deprecated:"Use `spaces` instead. All of a location's polygons will be in the spaces array.",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/SpaceId"},map:{$ref:"#/definitions/FloorId"}},required:["map","id"],type:"object"},type:"array"},shortName:{type:"string"},showFloatingLabelWhenImagePresent:{description:"Whether to show the flat label when an image is present",type:"boolean"},showLogo:{description:"Whether to show the logo of the location",type:"boolean"},siblingGroups:{description:"Locations that are related to this location in some manner (described by the label)",items:{$ref:"#/definitions/SiblingGroup"},type:"array"},social:{additionalProperties:!1,description:"The location's social media links",properties:{facebook:{type:"string"},instagram:{type:"string"},twitter:{type:"string"},website:{type:"string"}},type:"object"},sortOrder:{type:"number"},spaces:{description:"The places that this location is anchored to in the physical world. These are either Polygon or Point spaces. A location can be attached to many spaces, and a space can be attached to many locations.\n\nIf there are different properties for the location on those spaces, they will show up in the location's {@link EnterpriseLocation.instances instances } property",items:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/SpaceId"}},required:["floor","id"],type:"object"},type:"array"},states:{description:"The location's state. No more than one state should be active at a time, and all but at most one should have dates set",items:{$ref:"#/definitions/LocationState"},type:"array"},tags:{items:{type:"string"},type:"array"},type:{type:"string"}},required:["id","parent"],type:"object"},EnterpriseLocationInstanceId:{description:"An ID for an enterprise location instance",pattern:"^eli_[A-Za-z0-9_-]{8,}$",type:"string"},EnterpriseStyles:{additionalProperties:{additionalProperties:!1,properties:{edgeOffset:{type:"number"},geometryAnchors:{items:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},geometryId:{$ref:"#/definitions/SpaceId"}},required:["geometryId","floorId"],type:"object"},type:"array"}},required:["geometryAnchors"],type:"object"},type:"object"},EnterpriseTexture:{additionalProperties:!1,properties:{bounds:{description:"Coordinates of the texture's bounding box in format: [minLon, minLat, maxLon, maxLat].",items:{type:"number"},maxItems:4,minItems:4,type:"array"},face:{$ref:"#/definitions/EnterpriseTextureFace",description:"Face of the polygon that the texture will be applied to.\n\n'top' means that the texture will be applied to the upward-pointing face of the polygon.\n\n'side' means that the texture will be applied to every side face of the polygon."},geometryAnchors:{description:"Anchors for the texture on the geometry of the polygon.",items:{$ref:"#/definitions/EnterpriseTextureGeometryAnchor"},minItems:1,type:"array"},offset:{$ref:"#/definitions/EnterpriseTextureUV",description:"Controls the starting position of the texture on the surface. The u value shifts the texture horizontally and v shifts vertically."},path:{description:"Path to the texture image. Must be either a PNG or JPG format.",type:"string"},repeat:{$ref:"#/definitions/EnterpriseTextureUV",description:"Controls how many times the texture repeats across the surface. The u value controls horizontal repetition and v controls vertical repetition."},rotation:{description:"Rotation of the texture in degrees clockwise.\n\nFor top textures this is relative to north. North is 0, east is 90.\n\nFor side textures this is relative to the upward direction, with 0 degrees being upright.",maximum:360,minimum:0,type:"number"},surface:{$ref:"#/definitions/EnterpriseTextureSurface",description:"Surface of the polygon that the texture will be applied to.\n\n'inside' means that the texture will only be applied to the interior surface of the polygon.\n\n'outside' means that the texture will only be applied to the exterior surface of the polygon.\n\n'both' means that the texture will be applied to both interior and exterior surfaces of the polygon."}},required:["repeat","offset","rotation","path","face","surface","bounds","geometryAnchors"],type:"object"},EnterpriseTextureFace:{enum:["top","side"],type:"string"},EnterpriseTextureGeometryAnchor:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},geometryId:{$ref:"#/definitions/SpaceId"}},required:["geometryId","floorId"],type:"object"},EnterpriseTextureSurface:{enum:["inside","outside","both"],type:"string"},EnterpriseTextureUV:{additionalProperties:!1,properties:{u:{type:"number"},v:{type:"number"}},required:["u","v"],type:"object"},EnterpriseVenue:{additionalProperties:!1,properties:{countrycode:{description:"The ISO 3166-1 alpha-2 country code of the venue, if known\n\nEg. `US` or `GB`",type:"string"},coverImage:{description:"The venue's cover image",format:"uri",type:"string"},defaultFloor:{$ref:"#/definitions/FloorId",description:"The venue's default floor"},defaultLanguage:{$ref:"#/definitions/Language"},defaultMap:{$ref:"#/definitions/FloorId",deprecated:"Use `defaultFloor` instead"},externalId:{type:"string"},extra:{additionalProperties:{},type:"object"},icon:{description:"The venue's icon",format:"uri",type:"string"},languages:{items:{$ref:"#/definitions/Language"},type:"array"},logo:{description:"The venue's logo",format:"uri",type:"string"},mappedinWebUrl:{description:"The base URL for Mappedin Web for this venue\n\nBetter name?",type:"string"},name:{type:"string"},operationHours:{description:"When this venue is open.",items:{$ref:"#/definitions/OperationHours"},type:"array"},slug:{type:"string"},topLocations:{items:{$ref:"#/definitions/EnterpriseLocationId"},type:"array"},tzid:{description:"The venue's timezone, from the IANA Time Zone Database. Should be in the format of `America/New_York`",pattern:"^[A-Za-z0-9\\/_-]+$",type:"string"}},required:["defaultLanguage","externalId","languages","name","slug"],type:"object"},EntranceCollection:{$ref:"#/definitions/FeatureCollection%3CLineString%2CEntranceProperties%3E"},EntranceId:{pattern:"^e_[A-Za-z0-9_-]{8,}$",type:"string"},EntranceProperties:{additionalProperties:!1,properties:{details:{$ref:"#/definitions/Details"},externalId:{type:"string"},id:{$ref:"#/definitions/EntranceId"},isExterior:{type:"boolean"},metadata:{$ref:"#/definitions/Metadata"},node:{$ref:"#/definitions/NodeId"}},required:["id","externalId"],type:"object"},Facade:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/FacadeId"},spaces:{items:{$ref:"#/definitions/FacadeSpace"},minItems:1,type:"array"}},required:["id","spaces"],type:"object"},FacadeId:{pattern:"^fc_[A-Za-z0-9_-]{8,}$",type:"string"},FacadeSpace:{additionalProperties:!1,properties:{floorId:{$ref:"#/definitions/FloorId"},spaceId:{$ref:"#/definitions/SpaceId"}},required:["floorId","spaceId"],type:"object"},"Feature<(Polygon|LineString),ObstructionProperties>":{additionalProperties:!1,properties:{geometry:{anyOf:[{$ref:"#/definitions/Polygon"},{$ref:"#/definitions/LineString"}]},properties:{$ref:"#/definitions/ObstructionProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<(Polygon|LineString|Point),SpaceProperties>":{additionalProperties:!1,properties:{geometry:{anyOf:[{$ref:"#/definitions/Polygon"},{$ref:"#/definitions/LineString"},{$ref:"#/definitions/Point"}]},properties:{$ref:"#/definitions/SpaceProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<(Polygon|MultiPolygon|null),FloorProperties>":{additionalProperties:!1,properties:{geometry:{anyOf:[{$ref:"#/definitions/Polygon"},{$ref:"#/definitions/MultiPolygon"},{type:"null"}]},properties:{$ref:"#/definitions/FloorProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<LineString,EntranceProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/LineString"},properties:{$ref:"#/definitions/EntranceProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,FloorImageProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/FloorImageProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,FloorTextProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/FloorTextProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,NodeProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/NodeProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Point,TextAreaProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/TextAreaProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"Feature<Polygon,FloorStackFootprintProperties>":{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Polygon"},properties:{$ref:"#/definitions/FloorStackFootprintProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},"FeatureCollection<(Polygon|LineString),ObstructionProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3C(Polygon%7CLineString)%2CObstructionProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<(Polygon|LineString|Point),SpaceProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3C(Polygon%7CLineString%7CPoint)%2CSpaceProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<(Polygon|MultiPolygon|null),FloorProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3C(Polygon%7CMultiPolygon%7Cnull)%2CFloorProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<LineString,EntranceProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CLineString%2CEntranceProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,FloorImageProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CFloorImageProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,FloorTextProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CFloorTextProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,NodeProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CNodeProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Point,TextAreaProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPoint%2CTextAreaProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},"FeatureCollection<Polygon,FloorStackFootprintProperties>":{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/Feature%3CPolygon%2CFloorStackFootprintProperties%3E"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},FeatureCollectionType:{const:"FeatureCollection",description:"The type field used for a collection of GeoJSON features.",type:"string"},FeatureType:{const:"Feature",description:"The type field used for individual GeoJSON features.",type:"string"},FloatingFloorTextProperties:{additionalProperties:!1,properties:{align:{default:"center",description:"Horizontal alignment of multi-line text.",enum:["left","center","right"],type:"string"},color:{default:"black",description:"The color of the text in CSS format (e.g. `#000000`, `rgb(0, 0, 0)`, `black`).",type:"string"},fontFamily:{default:"Droid Sans",description:"The font family of the text.",type:"string"},fontSize:{default:12,description:"The em-height (multiplier of the font's height) at which to render the font, in meters. The font height is the distance between the ascender (highest point, height of an A) and descender (lowest point, bottom of a g) of the font. For example, if the font-size is 12, the space for a single character will be 12 meters high.",type:"number"},rotation:{description:"Rotation in degrees, about the center of the text. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},text:{description:"The text to display. Newline characters are supported.",type:"string"},verticalOffset:{description:"The vertical offset of the text, in meters.",type:"number"},visible:{default:!0,description:"Whether the text is visible.",type:"boolean"}},required:["align","color","fontFamily","fontSize","rotation","text","verticalOffset","visible"],type:"object"},FloatingImageProperties:{additionalProperties:!1,properties:{height:{description:"The height of the image when represented on the map, in meters.",minimum:0,type:"number"},path:{description:"The path to the image. This will be a remote URL.",type:"string"},rotation:{description:"Rotation in degrees, about the center of the image. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},verticalOffset:{description:"How high to position the image, in meters, relative to the ground plane.",minimum:0,type:"number"},width:{description:"The width of the image when represented on the map, in meters.",minimum:0,type:"number"}},required:["height","path","rotation","verticalOffset","width"],type:"object"},FloatingTextAreaProperties:{additionalProperties:!1,properties:{align:{$ref:"#/definitions/TextAreaAlignment",description:"The alignment of the text within the label. 'Near' means the text will be aligned up against the position. Typically in the SDK the text will be rotated to always be upright, so either the start or end of the text will be up against the position. 'Center' means it will be centered in the middle of the area."},maxHeight:{description:"The maximum height of the label, in meters. Half the height will be above the feature's position, half below.",exclusiveMinimum:0,type:"number"},maxWidth:{description:"The maximum width of the label, in meters. The left edge will start at the feature's position and extend in the rotation direction.",exclusiveMinimum:0,type:"number"},rotation:{description:"Rotation in degrees relative to north, about the position of the label. North is 0, east is 90.",maximum:360,minimum:0,type:"number"},verticalOffset:{description:"How high to position the text area, in meters, relative to the ground plane.",minimum:0,type:"number"}},required:["align","maxHeight","maxWidth","rotation","verticalOffset"],type:"object"},FloorCollection:{$ref:"#/definitions/FeatureCollection%3C(Polygon%7CMultiPolygon%7Cnull)%2CFloorProperties%3E"},FloorId:{description:"The m_ prefix is deprecated, from when floors were previously called maps. Use f_ as the prefix instead.",pattern:"^[mf]_[A-Za-z0-9_-]{8,}$",type:"string"},FloorImageFeatureCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CFloorImageProperties%3E",description:"A collection of images to be displayed on a map. They are either attached to a polygon or are floating in space."},FloorImageProperties:{anyOf:[{$ref:"#/definitions/AnchoredImageProperties"},{$ref:"#/definitions/FloatingImageProperties"}]},FloorProperties:{additionalProperties:!1,properties:{elevation:{description:"The elevation of this map relative to other maps in the stack. Must be an integer.",type:"integer"},externalId:{description:"Use of this property as the name of the map is deprecated. Use the name property instead.",type:"string"},id:{$ref:"#/definitions/FloorId"},metadata:{$ref:"#/definitions/Metadata"},name:{type:"string"},shortName:{description:"A short name for the map, if it exists. Usually one or two characters (eg, 3, F1, L, etc.) For display in very small spaces, like a floor selector dropdown. Might line up with what is shown on elevator buttons in the physical world.",type:"string"},subtitle:{description:'A subtitle for the map, for display in larger spaces, usually beneath the full name. Provides additional context for what is actually on the map, if the name is not clear. For example, if the full name is "Level 1", the subtitle might be "Arrivals and Baggage Claim".\n\nShould be no more than a few words.',type:"string"}},required:["id","externalId","elevation"],type:"object"},FloorStack:{additionalProperties:!1,properties:{defaultFloor:{$ref:"#/definitions/FloorId",description:"The default floor to use when a floor is not specified."},externalId:{type:"string"},floors:{description:"A list of floor IDs that belong to this floor stack.",items:{$ref:"#/definitions/FloorId"},type:"array"},footprint:{$ref:"#/definitions/FeatureCollection%3CPolygon%2CFloorStackFootprintProperties%3E",description:"Provides a footprint for the map stack based on the geometry of the maps it contains. This is useful for rendering a map stack without loading all of its maps."},id:{$ref:"#/definitions/FloorStackId"},maps:{deprecated:"Use `floors` instead.",description:"A list of floor IDs that belong to this floor stack.",items:{$ref:"#/definitions/FloorId"},type:"array"},metadata:{$ref:"#/definitions/Metadata"},name:{type:"string"},shortName:{description:"A short name for the map stack, if it exists. For display in small spaces, like a floor selector dropdown.",type:"string"},type:{description:"The type of MapStack, e.g. Building, Outdoor. Defaults to Building.",enum:["Building","Outdoor"],type:"string"}},required:["id","externalId","name","maps"],type:"object"},FloorStackFootprintProperties:{additionalProperties:{not:{}},type:"object"},FloorStackId:{description:"The mg_ prefix is deprecated, from when floor stacks were previously called map groups. Use fs_ as the prefix instead.",pattern:"^fs_[A-Za-z0-9_-]{8,}$",type:"string"},FloorStacks:{items:{$ref:"#/definitions/FloorStack"},type:"array"},FloorTextFeatureCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CFloorTextProperties%3E",description:"A collection of text to be displayed on a map. They are either attached to a space or are floating."},FloorTextProperties:{anyOf:[{$ref:"#/definitions/AnchoredFloorTextProperties"},{$ref:"#/definitions/FloatingFloorTextProperties"}]},Hyperlink:{additionalProperties:!1,properties:{displayName:{type:"string"},url:{type:"string"}},required:["url"],type:"object"},Image:{additionalProperties:!1,properties:{altText:{type:"string"},url:{type:"string"}},required:["url"],type:"object"},Language:{additionalProperties:!1,properties:{code:{type:"string"},name:{type:"string"}},required:["name","code"],type:"object"},Latitude:{description:"A WGS 84-compatible latitude coordinate value.",maximum:90,minimum:-90,type:"number"},LineString:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON LineString geometry.",properties:{coordinates:{items:{$ref:"#/definitions/Position"},minItems:2,type:"array"},type:{const:"LineString",type:"string"}},required:["coordinates","type"],type:"object"},LineStringStyle:{additionalProperties:!1,properties:{altitude:{description:'How far off the "ground" the objects belonging to this layer should be drawn, in meters.',minimum:0,type:"number"},color:{description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB",pattern:"^#[0-9a-fA-F]{6}$",type:"string"},height:{description:"The height of the objects belonging to this layer, in meters.",minimum:0,type:"number"},lineStrings:{description:"The line strings which this style applies to.",items:{anyOf:[{$ref:"#/definitions/EntranceId"},{$ref:"#/definitions/ObstructionId"},{$ref:"#/definitions/SpaceId"}]},type:"array"},opacity:{maximum:1,minimum:0,type:"number"},width:{description:"The thickness of the line when rendered, in meters, measured from the center to the edge.",exclusiveMinimum:0,type:"number"}},required:["altitude","color","height","lineStrings","opacity","width"],type:"object"},LocalPosition:{description:"A position for a local coordinate system, measured in metres.",items:{type:"number"},maxItems:2,minItems:2,type:"array"},Location:{additionalProperties:!1,properties:{annotations:{items:{$ref:"#/definitions/LocationAnnotationMapping"},type:"array"},areas:{items:{$ref:"#/definitions/LocationAreaMapping"},type:"array"},categories:{items:{$ref:"#/definitions/CategoryId"},type:"array"},connections:{items:{$ref:"#/definitions/ConnectionId"},type:"array"},description:{type:"string"},entrances:{items:{$ref:"#/definitions/LocationEntranceMapping"},type:"array"},externalId:{type:"string"},icon:{description:"The location's icon, one of picture/category/logo",format:"uri",type:"string"},id:{$ref:"#/definitions/LocationId"},links:{description:"Web links for the location",items:{$ref:"#/definitions/LocationLink"},type:"array"},logo:{description:"The location's logo",format:"uri",type:"string"},name:{type:"string"},obstructions:{items:{$ref:"#/definitions/LocationObstructionMapping"},type:"array"},openingHoursSpecification:{description:"The location's opening hours",items:{$ref:"#/definitions/OpeningHoursSpecification"},type:"array"},phone:{type:"string"},pictures:{description:"The location's pictures",items:{$ref:"#/definitions/LocationPicture"},type:"array"},social:{description:"The location's social media links.",items:{$ref:"#/definitions/LocationSocial"},type:"array"},spaces:{items:{$ref:"#/definitions/LocationSpaceMapping"},type:"array"},website:{$ref:"#/definitions/LocationLink",description:"The location's website"}},required:["id","name","categories","spaces","obstructions","entrances","connections","annotations","areas","social","pictures","links","openingHoursSpecification"],type:"object"},LocationAnnotationMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/AnnotationId"}},required:["floor","id"],type:"object"},LocationAreaMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/AreaId"}},required:["floor","id"],type:"object"},LocationEntranceMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/EntranceId"}},required:["floor","id"],type:"object"},LocationId:{description:"An ID for a location",pattern:"^loc_[A-Za-z0-9_-]{8,}$",type:"string"},LocationLink:{additionalProperties:!1,properties:{label:{type:"string"},url:{description:"The URL of the link",format:"uri",type:"string"}},required:["label","url"],type:"object"},LocationObstructionMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/ObstructionId"}},required:["floor","id"],type:"object"},LocationPicture:{additionalProperties:!1,description:"The location's pictures Single-field object, because it's plausible we might add captions or comments in the future",properties:{url:{format:"uri",type:"string"}},type:"object"},LocationSocial:{additionalProperties:!1,properties:{name:{description:"The name of the social media platform.",type:"string"},url:{description:"The URL of the social media profile",format:"uri",type:"string"}},required:["name","url"],type:"object"},LocationSpaceMapping:{additionalProperties:!1,properties:{floor:{$ref:"#/definitions/FloorId"},id:{$ref:"#/definitions/SpaceId"}},required:["floor","id"],type:"object"},LocationState:{additionalProperties:!1,description:"The state of a location. Start and end dates are optional.",properties:{end:{description:"The start date of the state",format:"date",type:"string"},start:{description:"The start date of the state",format:"date",type:"string"},type:{description:"The type of the location state. Technically not limited, but should be one of the following:\n- closed-temporarily\n- new\n- pop-up\n- coming-soon\n- relocated",type:"string"}},required:["type"],type:"object"},Longitude:{description:"A WGS 84-compatible longitude coordinate value.",maximum:180,minimum:-180,type:"number"},ManifestCollection:{additionalProperties:!1,properties:{features:{items:{$ref:"#/definitions/ManifestFeature"},maxItems:1,minItems:1,type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},ManifestFeature:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/Point"},properties:{$ref:"#/definitions/ManifestProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},ManifestFile:{additionalProperties:!1,properties:{name:{type:"string"},type:{const:"file",type:"string"}},required:["type","name"],type:"object"},ManifestFolder:{additionalProperties:!1,properties:{children:{items:{$ref:"#/definitions/ManifestFile"},minItems:1,type:"array"},name:{type:"string"},type:{const:"folder",type:"string"}},required:["type","name","children"],type:"object"},ManifestProperties:{additionalProperties:!1,properties:{folder_struct:{items:{anyOf:[{$ref:"#/definitions/ManifestFolder"},{$ref:"#/definitions/ManifestFile"}]},type:"array"},language:{description:"The RFC 5646 language tag of the MVF. https://datatracker.ietf.org/doc/html/rfc5646",examples:["en-US"],type:"string"},map:{description:"The identifier of the map that this MVF is for.",type:"string"},name:{type:"string"},naturalBearing:{description:'The angle, in degrees, the map is considered to be "naturally oriented" as, rather than facing directly north. 90 degrees means East is "up"',maximum:360,minimum:0,type:"number"},org_id:{type:"string"},time:{description:"An ISO 8601 date-time string, including timezone offset.",format:"date-time",type:"string"},tzid:{description:"The map's timezone, from the IANA Time Zone Database. Should be in the format of `America/New_York`",examples:["America/New_York"],pattern:"^[A-Za-z0-9_-]+\\/[A-Za-z0-9_-]+$",type:"string"},version:{const:"2.0.0",type:"string"}},required:["name","folder_struct","version","time"],type:"object"},Maps:{deprecated:"This is only present on `map.geojson` which is deprecated. Use\nthe collection on `floor.geojson` instead.",items:{$ref:"#/definitions/FloorProperties"},type:"array"},Material:{additionalProperties:!1,description:"The color and/or texture that should be applied to an instance of a Shape.\n\nIf both a color and a texture are provided, the color will be applied to the texture via a multiply operation. If neither are provided, the shape will be white.",properties:{color:{description:"The color of this mateial as a hex code.",pattern:"^#[0-9a-fA-F]{6}$",type:"string"},texture:{$ref:"#/definitions/Texture"}},type:"object"},Metadata:{additionalProperties:{},description:"Can be any extra metadata that is not part of the main MVF spec. Presence of any key or value is not guaranteed. Values are expected to be JSON-serializable.",type:"object"},ModelInstance:{additionalProperties:!1,description:"An instance of a 3D model.",properties:{altitude:{description:"The distance above ground, in metres, where this Decoration's origin point should be placed.",type:"number"},path:{description:"The path to this asset, relative to the MVF's models folder. Supports GLTF and OBJ.",minLength:1,type:"string"},position:{$ref:"#/definitions/Position",description:"The long/lat point that the Decoration's origin point correponds to."},rotation:{$ref:"#/definitions/Vector3",description:"The rotation, in Euler angles in XYZ order, that will be applied to this Decoration."},scale:{$ref:"#/definitions/Vector3",description:"The X, Y and Z scale that will be applied to this Decoration."}},required:["altitude","path","position","rotation","scale"],type:"object"},ModelInstanceCollection:{additionalProperties:{$ref:"#/definitions/ModelInstance"},description:"A map of model instances, where keys are valid polygon or obstruction IDs. Replaces the specified polygon.",type:"object"},MultiPolygon:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON MultiPolygon geometry.",properties:{coordinates:{items:{items:{items:{$ref:"#/definitions/Position"},type:"array"},type:"array"},type:"array"},type:{const:"MultiPolygon",type:"string"}},required:["coordinates","type"],type:"object"},NodeCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CNodeProperties%3E"},NodeId:{pattern:"^n_[A-Za-z0-9_-]{8,}$",type:"string"},NodeProperties:{additionalProperties:!1,properties:{externalId:{type:"string"},floor:{$ref:"#/definitions/FloorId",description:"The ID of the floor this node is found on."},id:{$ref:"#/definitions/NodeId"},map:{$ref:"#/definitions/FloorId",deprecated:"use `floor` instead.",description:"The ID of the floor this node is found on."},neighbors:{description:"A list of nodes that can be navigated to from this node.",items:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/NodeId"},weight:{description:"The cost of navigating to this node.",minimum:0,type:"number"}},required:["id","weight"],type:"object"},type:"array"},preventSmoothing:{description:"Flag that may optionally indicate that a node is part of a custom path network rather than auto generated and should not be removed during smoothing/simplifcation.",type:"boolean"},space:{description:"The IDs of any spaces this node may be contained within.",items:{$ref:"#/definitions/SpaceId"},type:"array"}},required:["id","externalId","map","space","neighbors"],type:"object"},ObstructionCollection:{$ref:"#/definitions/FeatureCollection%3C(Polygon%7CLineString)%2CObstructionProperties%3E"},ObstructionId:{pattern:"^o_[A-Za-z0-9_-]{8,}$",type:"string"},ObstructionProperties:{additionalProperties:!1,properties:{center:{$ref:"#/definitions/Position",description:"The center of mass of this obstruction, if it is a polygon. This is undefined for line strings as this can be trivially derived."},details:{$ref:"#/definitions/Details"},entrances:{description:"A list of entrance IDs corresponding to entrances that can be used to navigate through this obstruction.",items:{$ref:"#/definitions/EntranceId"},type:"array"},externalId:{type:"string"},footprintComponent:{description:"Indicates whether this obstruction is considered part of the footprint of the building it is a part of. For example, an exterior wall would be considered part of the building footprint.",type:"boolean"},id:{$ref:"#/definitions/ObstructionId"},kind:{type:"string"},metadata:{$ref:"#/definitions/Metadata"}},required:["id","externalId","entrances"],type:"object"},OpeningHoursSpecification:{additionalProperties:!1,description:"We (almost) follow this schema (http://schema.org/OpeningHoursSpecification) The only difference is that we (like Google: https://developers.google.com/search/docs/data-types/local-businesses) accept dayOfWeek as an array as well as an individual day.\n\nBehavioral notes:\n- if the \"opens\" property is not present, the location is closed, and the closes property is ignored (Schema.org style)\n- if opens/closes are both set to 00:00, the location is closed (Google style)\n- If special hours do not specifiy certain weekdays being open, those weekdays are closed.\n- Not specifying dayOfWeek is equivalent to specifying every day of the week.\n- we will omit the '@type' property when producing MVFs. But we won't reject 3rd party MVFs that include it.",properties:{"@type":{const:"OpeningHoursSpecification",default:"OpeningHoursSpecification",description:"The type of opening hours",type:"string"},closes:{$ref:"#/definitions/Time",description:"The time the opening hours end"},dayOfWeek:{anyOf:[{$ref:"#/definitions/DayOrPublicHoliday"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},maxItems:1,minItems:1,type:"array"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},type:"array"}],description:"The days of the week the opening hours apply to"},opens:{$ref:"#/definitions/Time",description:"The time the opening hours start"},validFrom:{description:"The date the opening hours start, in ISO 8601 format",format:"date-time",type:"string"},validThrough:{description:"The date the opening hours end, in ISO 8601 format",format:"date-time",type:"string"}},type:"object"},OperationHours:{additionalProperties:!1,description:"We (almost) follow this schema (http://schema.org/OpeningHoursSpecification) The only difference is that we (like Google: https://developers.google.com/search/docs/data-types/local-businesses) accept dayOfWeek as an array as well as an individual day.",properties:{"@type":{const:"OpeningHoursSpecification",default:"OpeningHoursSpecification",description:"The type of operation hours",type:"string"},closes:{$ref:"#/definitions/Time",description:"The time the operation hours end"},dayOfWeek:{anyOf:[{$ref:"#/definitions/DayOrPublicHoliday"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},maxItems:1,minItems:1,type:"array"},{items:{$ref:"#/definitions/DayOrPublicHoliday"},type:"array"}],description:"The days of the week the operation hours apply to"},opens:{$ref:"#/definitions/Time",description:"The time the operation hours start"},validFrom:{description:"The date the operation hours start, in ISO 8601 format",format:"date-time",type:"string"},validThrough:{description:"The date the operation hours end, in ISO 8601 format",format:"date-time",type:"string"}},type:"object"},ParsedMVF:{additionalProperties:!1,properties:{annotation:{additionalProperties:{anyOf:[{$ref:"#/definitions/AnnotationCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},area:{additionalProperties:{anyOf:[{$ref:"#/definitions/AreaCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"category.json":{items:{$ref:"#/definitions/Category"},type:"array"},"connection.json":{$ref:"#/definitions/Connections"},enterprise:{$ref:"#/definitions/EnterpriseCollection"},entrance:{additionalProperties:{anyOf:[{$ref:"#/definitions/EntranceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},facade:{additionalProperties:{anyOf:[{$ref:"#/definitions/Facade"},{not:{}}]},propertyNames:{pattern:"^fs_[A-Za-z0-9_-]{8,}$"},type:"object"},"floor.geojson":{$ref:"#/definitions/FloorCollection"},floorImages:{additionalProperties:{anyOf:[{$ref:"#/definitions/FloorImageFeatureCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"floorstack.json":{$ref:"#/definitions/FloorStacks"},"location.json":{items:{$ref:"#/definitions/Location"},type:"array"},"manifest.geojson":{$ref:"#/definitions/ManifestCollection"},"map.geojson":{$ref:"#/definitions/Maps",deprecated:"Use `floor.geojson` instead."},"mapstack.geojson":{$ref:"#/definitions/FloorStacks",deprecated:"Use `floorstack.json` instead."},"mapstack.json":{$ref:"#/definitions/FloorStacks",deprecated:"Use `floorstack.json` instead."},modelInstances:{additionalProperties:{anyOf:[{$ref:"#/definitions/ModelInstanceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"node.geojson":{$ref:"#/definitions/NodeCollection"},obstruction:{additionalProperties:{anyOf:[{$ref:"#/definitions/ObstructionCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},shapeInstances:{additionalProperties:{anyOf:[{$ref:"#/definitions/ShapeInstanceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"shapes.json":{$ref:"#/definitions/ShapeCollection"},space:{additionalProperties:{anyOf:[{$ref:"#/definitions/SpaceCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"styles.json":{$ref:"#/definitions/StyleCollection"},textAreas:{additionalProperties:{anyOf:[{$ref:"#/definitions/TextAreaFeatureCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"},"tileset.json":{$ref:"#/definitions/TilesetCollection"},window:{additionalProperties:{anyOf:[{$ref:"#/definitions/WindowCollection"},{not:{}}]},propertyNames:{pattern:"^[mf]_[A-Za-z0-9_-]{8,}$"},type:"object"}},required:["manifest.geojson","mapstack.geojson","map.geojson","space","obstruction","connection.json","node.geojson","entrance"],type:"object"},Point:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON Point geometry.",properties:{coordinates:{$ref:"#/definitions/Position"},type:{const:"Point",type:"string"}},required:["coordinates","type"],type:"object"},PointStyle:{additionalProperties:!1,properties:{points:{description:"The points which this style applies to.",items:{$ref:"#/definitions/SpaceId"},type:"array"},showImage:{description:"Whether or not the first image attached to the space or obstruction should be displayed on the point.",type:"boolean"}},required:["points"],type:"object"},Polygon:{additionalProperties:!1,description:"An RFC-7946 compatible GeoJSON Polygon geometry.",properties:{coordinates:{items:{items:{$ref:"#/definitions/Position"},type:"array"},type:"array"},type:{const:"Polygon",type:"string"}},required:["coordinates","type"],type:"object"},PolygonStyle:{additionalProperties:!1,properties:{altitude:{description:'How far off the "ground" the objects belonging to this layer should be drawn, in meters.',minimum:0,type:"number"},color:{description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB",pattern:"^#[0-9a-fA-F]{6}$",type:"string"},height:{description:"The height of the objects belonging to this layer, in meters.",minimum:0,type:"number"},opacity:{maximum:1,minimum:0,type:"number"},polygons:{description:"The polygons which this style applies to.",items:{anyOf:[{$ref:"#/definitions/ObstructionId"},{$ref:"#/definitions/SpaceId"}]},type:"array"},showImage:{description:"Whether or not the first image attached to the space or obstruction should be displayed on the polygon.",type:"boolean"}},required:["altitude","color","height","opacity","polygons"],type:"object"},Position:{description:"A valid WGS 84 position consisting of a longitude coodinate, followed by a latitude coordinate.",items:[{$ref:"#/definitions/Longitude"},{$ref:"#/definitions/Latitude"}],maxItems:2,minItems:2,type:"array"},Ring:{description:"A simple shape for part of a complex polygon",items:{$ref:"#/definitions/LocalPosition"},minItems:3,type:"array"},Shape:{description:"A 3D object made from extruded 2D polygons, that can be rendered to the map as a ShapeInstance.",items:{$ref:"#/definitions/ShapeComponent"},minItems:1,type:"array"},ShapeCollection:{additionalProperties:{$ref:"#/definitions/Shape"},description:"A group of Shapes, without any information as to how they will be placed in a scene.",propertyNames:{pattern:"^sh_[A-Za-z0-9_-]{8,}$"},type:"object"},ShapeComponent:{additionalProperties:!1,description:"A single extruded 2D polygon.",properties:{altitude:{description:"In metres.",type:"number"},geometry:{description:"Can contain holes, like GeoJSON.",items:{$ref:"#/definitions/Ring"},minItems:1,type:"array"},height:{description:"In metres.",exclusiveMinimum:0,type:"number"}},required:["geometry","altitude","height"],type:"object"},ShapeId:{pattern:"^sh_[A-Za-z0-9_-]{8,}$",type:"string"},ShapeInstance:{additionalProperties:!1,description:"An instance of a Shape.",properties:{altitude:{description:"The distance above ground, in metres, where this Decoration's origin point should be placed.",type:"number"},id:{$ref:"#/definitions/ShapeId",description:"The identifier of the Shape to be placed."},material:{$ref:"#/definitions/Material",description:"The color and/or texture to apply to this shape instance."},position:{$ref:"#/definitions/Position",description:"The long/lat point that the Decoration's origin point correponds to."},rotation:{$ref:"#/definitions/Vector3",description:"The rotation, in Euler angles in XYZ order, that will be applied to this Decoration."},scale:{$ref:"#/definitions/Vector3",description:"The X, Y and Z scale that will be applied to this Decoration."}},required:["altitude","id","material","position","rotation","scale"],type:"object"},ShapeInstanceCollection:{additionalProperties:{$ref:"#/definitions/ShapeInstance"},description:"A map of shape instances, where keys are valid polygon or obstruction IDs. Replaces the specified polygon.",type:"object"},SiblingGroup:{additionalProperties:!1,properties:{label:{type:"string"},siblings:{items:{$ref:"#/definitions/EnterpriseLocationId"},type:"array"}},required:["label","siblings"],type:"object"},SpaceCollection:{$ref:"#/definitions/FeatureCollection%3C(Polygon%7CLineString%7CPoint)%2CSpaceProperties%3E"},SpaceId:{pattern:"^s_[A-Za-z0-9_-]{8,}$",type:"string"},SpaceProperties:{additionalProperties:!1,properties:{center:{$ref:"#/definitions/Position",description:"The center of mass of this space, if it is a polygon. This is undefined for line string and point spaces as these can be trivially derived."},destinationNodes:{description:"A list of node IDs which can be used to navigate to this space.",items:{$ref:"#/definitions/NodeId"},type:"array"},details:{$ref:"#/definitions/Details"},externalId:{type:"string"},id:{$ref:"#/definitions/SpaceId"},kind:{type:"string"},metadata:{$ref:"#/definitions/Metadata"},tags:{description:"A list of tags that may apply to categorize the space, e.g. Void",items:{type:"string"},type:"array"}},required:["id","externalId","destinationNodes"],type:"object"},StyleCollection:{additionalProperties:{anyOf:[{$ref:"#/definitions/PolygonStyle"},{$ref:"#/definitions/LineStringStyle"},{$ref:"#/definitions/PointStyle"},{not:{}}]},description:"A map of layer styles, where keys represent the group IDs of each style.",type:"object"},TextAreaAlignment:{enum:["near","center"],type:"string"},TextAreaFeatureCollection:{$ref:"#/definitions/FeatureCollection%3CPoint%2CTextAreaProperties%3E",description:"A collection of text areas to be displayed on a map. They are either attached to a polygon or are floating in space."},TextAreaProperties:{anyOf:[{$ref:"#/definitions/AnchoredTextAreaProperties"},{$ref:"#/definitions/FloatingTextAreaProperties"}]},Texture:{additionalProperties:!1,description:"A reference to an image texture and how it should be applied to a Component.",properties:{path:{description:"The path to this asset, relative to the MVF's images folder.",minLength:1,type:"string"},repeat:{$ref:"#/definitions/TextureRepeat"}},required:["path"],type:"object"},TextureRepeat:{additionalProperties:!1,description:"How a texture should be placed on a Component.",properties:{u:{type:"number"},v:{type:"number"}},required:["u","v"],type:"object"},TilesetCollection:{additionalProperties:!1,description:"Collection of tileset styles",properties:{default:{$ref:"#/definitions/TilesetStyle",description:"Default tileset style that should be used"},others:{description:"Additional tileset styles that can be used",items:{$ref:"#/definitions/TilesetStyle"},type:"array"}},required:["default"],type:"object"},TilesetStyle:{additionalProperties:!1,description:"A tileset style definition",properties:{key:{description:"Unique identifier for this tileset style",minLength:1,type:"string"},name:{description:"Display name for this tileset style",minLength:1,type:"string"},url:{description:"URL to the tileset style definition. This should be a JSON file matching the MapLibre style specification.",format:"uri",type:"string"}},required:["key","name","url"],type:"object"},Time:{description:"A time in the format of HH:MM:SS",pattern:"^[0-2][0-9]:[0-6][0-9](:[0-6][0-9])?$",type:"string"},Vector3:{description:"A three-number tuple.",items:{type:"number"},maxItems:3,minItems:3,type:"array"},WindowCollection:{additionalProperties:!1,properties:{features:{items:{additionalProperties:!1,properties:{geometry:{$ref:"#/definitions/LineString"},properties:{$ref:"#/definitions/WindowProperties"},type:{$ref:"#/definitions/FeatureType"}},required:["type","geometry","properties"],type:"object"},type:"array"},type:{$ref:"#/definitions/FeatureCollectionType"}},required:["type","features"],type:"object"},WindowId:{pattern:"^w_[A-Za-z0-9_-]{8,}$",type:"string"},WindowProperties:{additionalProperties:!1,properties:{id:{$ref:"#/definitions/WindowId"}},required:["id"],type:"object"}}};var wyt=NY.default.default(new FY.default.default).compile(uw(DY));g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();g();var Jr={};Cc(Jr,{HasPropertyKey:()=>X0e,IsArray:()=>js,IsAsyncIterator:()=>f6,IsBigInt:()=>Kx,IsBoolean:()=>th,IsDate:()=>lg,IsFunction:()=>d6,IsIterator:()=>h6,IsNull:()=>m6,IsNumber:()=>Gu,IsObject:()=>qn,IsRegExp:()=>Jx,IsString:()=>ri,IsSymbol:()=>g6,IsUint8Array:()=>bf,IsUndefined:()=>Li});g();function X0e(e,t){return t in e}o(X0e,"HasPropertyKey");function f6(e){return qn(e)&&!js(e)&&!bf(e)&&Symbol.asyncIterator in e}o(f6,"IsAsyncIterator");function js(e){return Array.isArray(e)}o(js,"IsArray");function Kx(e){return typeof e=="bigint"}o(Kx,"IsBigInt");function th(e){return typeof e=="boolean"}o(th,"IsBoolean");function lg(e){return e instanceof globalThis.Date}o(lg,"IsDate");function d6(e){return typeof e=="function"}o(d6,"IsFunction");function h6(e){return qn(e)&&!js(e)&&!bf(e)&&Symbol.iterator in e}o(h6,"IsIterator");function m6(e){return e===null}o(m6,"IsNull");function Gu(e){return typeof e=="number"}o(Gu,"IsNumber");function qn(e){return typeof e=="object"&&e!==null}o(qn,"IsObject");function Jx(e){return e instanceof globalThis.RegExp}o(Jx,"IsRegExp");function ri(e){return typeof e=="string"}o(ri,"IsString");function g6(e){return typeof e=="symbol"}o(g6,"IsSymbol");function bf(e){return e instanceof globalThis.Uint8Array}o(bf,"IsUint8Array");function Li(e){return e===void 0}o(Li,"IsUndefined");function Y0e(e){return e.map(t=>cw(t))}o(Y0e,"ArrayType");function Z0e(e){return new Date(e.getTime())}o(Z0e,"DateType");function K0e(e){return new Uint8Array(e)}o(K0e,"Uint8ArrayType");function J0e(e){return new RegExp(e.source,e.flags)}o(J0e,"RegExpType");function Q0e(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=cw(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=cw(e[r]);return t}o(Q0e,"ObjectType");function cw(e){return js(e)?Y0e(e):lg(e)?Z0e(e):bf(e)?K0e(e):Jx(e)?J0e(e):qn(e)?Q0e(e):e}o(cw,"Visit");function di(e){return cw(e)}o(di,"Clone");function kY(e){return e.map(t=>Qx(t))}o(kY,"CloneRest");function Qx(e,t){return t===void 0?di(e):di(k(k({},t),e))}o(Qx,"CloneType");g();g();g();function pw(e){return Ut(e)&&Symbol.asyncIterator in e}o(pw,"IsAsyncIterator");function fw(e){return Ut(e)&&Symbol.iterator in e}o(fw,"IsIterator");function y6(e){return Ut(e)&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)}o(y6,"IsStandardObject");function dw(e){return e instanceof Promise}o(dw,"IsPromise");function da(e){return e instanceof Date&&Number.isFinite(e.getTime())}o(da,"IsDate");function RY(e){return e instanceof globalThis.Map}o(RY,"IsMap");function BY(e){return e instanceof globalThis.Set}o(BY,"IsSet");function Ul(e){return ArrayBuffer.isView(e)}o(Ul,"IsTypedArray");function o1(e){return e instanceof globalThis.Uint8Array}o(o1,"IsUint8Array");function At(e,t){return t in e}o(At,"HasPropertyKey");function Ut(e){return e!==null&&typeof e=="object"}o(Ut,"IsObject");function Bt(e){return Array.isArray(e)&&!ArrayBuffer.isView(e)}o(Bt,"IsArray");function Ai(e){return e===void 0}o(Ai,"IsUndefined");function xf(e){return e===null}o(xf,"IsNull");function Jc(e){return typeof e=="boolean"}o(Jc,"IsBoolean");function _t(e){return typeof e=="number"}o(_t,"IsNumber");function hw(e){return Number.isInteger(e)}o(hw,"IsInteger");function hs(e){return typeof e=="bigint"}o(hs,"IsBigInt");function Qr(e){return typeof e=="string"}o(Qr,"IsString");function rh(e){return typeof e=="function"}o(rh,"IsFunction");function If(e){return typeof e=="symbol"}o(If,"IsSymbol");function ms(e){return hs(e)||Jc(e)||xf(e)||_t(e)||Qr(e)||If(e)||Ai(e)}o(ms,"IsValueType");var Mn;(function(e){e.InstanceMode="default",e.ExactOptionalPropertyTypes=!1,e.AllowArrayObject=!1,e.AllowNaN=!1,e.AllowNullVoid=!1;function t(l,c){return e.ExactOptionalPropertyTypes?c in l:l[c]!==void 0}o(t,"IsExactOptionalProperty"),e.IsExactOptionalProperty=t;function r(l){let c=Ut(l);return e.AllowArrayObject?c:c&&!Bt(l)}o(r,"IsObjectLike"),e.IsObjectLike=r;function n(l){return r(l)&&!(l instanceof Date)&&!(l instanceof Uint8Array)}o(n,"IsRecordLike"),e.IsRecordLike=n;function i(l){return e.AllowNaN?_t(l):Number.isFinite(l)}o(i,"IsNumberLike"),e.IsNumberLike=i;function s(l){let c=Ai(l);return e.AllowNullVoid?c||l===null:c}o(s,"IsVoidLike"),e.IsVoidLike=s})(Mn||(Mn={}));g();function e1e(e){return globalThis.Object.freeze(e).map(t=>eI(t))}o(e1e,"ImmutableArray");function t1e(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=eI(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=eI(e[r]);return globalThis.Object.freeze(t)}o(t1e,"ImmutableObject");function eI(e){return js(e)?e1e(e):lg(e)?e:bf(e)?e:Jx(e)?e:qn(e)?t1e(e):e}o(eI,"Immutable");function Re(e,t){let r=t!==void 0?k(k({},t),e):e;switch(Mn.InstanceMode){case"freeze":return eI(r);case"clone":return di(r);default:return r}}o(Re,"CreateType");g();var v6=class v6 extends Error{constructor(t){super(t)}};o(v6,"TypeBoxError");var Mt=v6;g();g();g();var hi=Symbol.for("TypeBox.Transform"),_f=Symbol.for("TypeBox.Readonly"),ha=Symbol.for("TypeBox.Optional"),Vl=Symbol.for("TypeBox.Hint"),ve=Symbol.for("TypeBox.Kind");function $Y(e){return qn(e)&&e[_f]==="Readonly"}o($Y,"IsReadonly");function Qc(e){return qn(e)&&e[ha]==="Optional"}o(Qc,"IsOptional");function b6(e){return sn(e,"Any")}o(b6,"IsAny");function Sf(e){return sn(e,"Array")}o(Sf,"IsArray");function tI(e){return sn(e,"AsyncIterator")}o(tI,"IsAsyncIterator");function x6(e){return sn(e,"BigInt")}o(x6,"IsBigInt");function I6(e){return sn(e,"Boolean")}o(I6,"IsBoolean");function rI(e){return sn(e,"Constructor")}o(rI,"IsConstructor");function r1e(e){return sn(e,"Date")}o(r1e,"IsDate");function nI(e){return sn(e,"Function")}o(nI,"IsFunction");function ug(e){return sn(e,"Integer")}o(ug,"IsInteger");function Ji(e){return sn(e,"Intersect")}o(Ji,"IsIntersect");function iI(e){return sn(e,"Iterator")}o(iI,"IsIterator");function sn(e,t){return qn(e)&&ve in e&&e[ve]===t}o(sn,"IsKindOf");function Cf(e){return sn(e,"Literal")}o(Cf,"IsLiteral");function ll(e){return sn(e,"MappedKey")}o(ll,"IsMappedKey");function mi(e){return sn(e,"MappedResult")}o(mi,"IsMappedResult");function nh(e){return sn(e,"Never")}o(nh,"IsNever");function n1e(e){return sn(e,"Not")}o(n1e,"IsNot");function i1e(e){return sn(e,"Null")}o(i1e,"IsNull");function cg(e){return sn(e,"Number")}o(cg,"IsNumber");function Eo(e){return sn(e,"Object")}o(Eo,"IsObject");function pg(e){return sn(e,"Promise")}o(pg,"IsPromise");function _6(e){return sn(e,"Record")}o(_6,"IsRecord");function S6(e){return sn(e,"Ref")}o(S6,"IsRef");function C6(e){return sn(e,"RegExp")}o(C6,"IsRegExp");function oI(e){return sn(e,"String")}o(oI,"IsString");function o1e(e){return sn(e,"Symbol")}o(o1e,"IsSymbol");function ul(e){return sn(e,"TemplateLiteral")}o(ul,"IsTemplateLiteral");function s1e(e){return sn(e,"This")}o(s1e,"IsThis");function s1(e){return qn(e)&&hi in e}o(s1,"IsTransform");function Uu(e){return sn(e,"Tuple")}o(Uu,"IsTuple");function a1e(e){return sn(e,"Undefined")}o(a1e,"IsUndefined");function bn(e){return sn(e,"Union")}o(bn,"IsUnion");function l1e(e){return sn(e,"Uint8Array")}o(l1e,"IsUint8Array");function u1e(e){return sn(e,"Unknown")}o(u1e,"IsUnknown");function c1e(e){return sn(e,"Unsafe")}o(c1e,"IsUnsafe");function p1e(e){return sn(e,"Void")}o(p1e,"IsVoid");function ih(e){return qn(e)&&ve in e&&ri(e[ve])}o(ih,"IsKind");function Vu(e){return b6(e)||Sf(e)||I6(e)||x6(e)||tI(e)||rI(e)||r1e(e)||nI(e)||ug(e)||Ji(e)||iI(e)||Cf(e)||ll(e)||mi(e)||nh(e)||n1e(e)||i1e(e)||cg(e)||Eo(e)||pg(e)||_6(e)||S6(e)||C6(e)||oI(e)||o1e(e)||ul(e)||s1e(e)||Uu(e)||a1e(e)||bn(e)||l1e(e)||u1e(e)||c1e(e)||p1e(e)||ih(e)}o(Vu,"IsSchema");var oe={};Cc(oe,{IsAny:()=>VY,IsArray:()=>zY,IsAsyncIterator:()=>qY,IsBigInt:()=>HY,IsBoolean:()=>WY,IsConstructor:()=>XY,IsDate:()=>YY,IsFunction:()=>ZY,IsInteger:()=>KY,IsIntersect:()=>JY,IsIterator:()=>QY,IsKind:()=>SZ,IsKindOf:()=>tn,IsLiteral:()=>aI,IsLiteralBoolean:()=>y1e,IsLiteralNumber:()=>tZ,IsLiteralString:()=>eZ,IsLiteralValue:()=>rZ,IsMappedKey:()=>nZ,IsMappedResult:()=>iZ,IsNever:()=>oZ,IsNot:()=>sZ,IsNull:()=>aZ,IsNumber:()=>lZ,IsObject:()=>uZ,IsOptional:()=>g1e,IsPromise:()=>cZ,IsProperties:()=>E6,IsReadonly:()=>m1e,IsRecord:()=>pZ,IsRecursive:()=>v1e,IsRef:()=>fZ,IsRegExp:()=>dZ,IsSchema:()=>en,IsString:()=>hZ,IsSymbol:()=>mZ,IsTemplateLiteral:()=>gZ,IsThis:()=>yZ,IsTransform:()=>ni,IsTuple:()=>vZ,IsUint8Array:()=>bZ,IsUndefined:()=>a1,IsUnion:()=>M6,IsUnionLiteral:()=>b1e,IsUnknown:()=>xZ,IsUnsafe:()=>IZ,IsVoid:()=>_Z,TypeGuardUnknownTypeError:()=>w6});g();var O6=class O6 extends Mt{};o(O6,"TypeGuardUnknownTypeError");var w6=O6,f1e=["Any","Array","AsyncIterator","BigInt","Boolean","Constructor","Date","Enum","Function","Integer","Intersect","Iterator","Literal","MappedKey","MappedResult","Not","Null","Number","Object","Promise","Record","Ref","RegExp","String","Symbol","TemplateLiteral","This","Tuple","Undefined","Union","Uint8Array","Unknown","Void"];function jY(e){try{return new RegExp(e),!0}catch(t){return!1}}o(jY,"IsPattern");function P6(e){if(!ri(e))return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>=7&&r<=13||r===27||r===127)return!1}return!0}o(P6,"IsControlCharacterFree");function GY(e){return T6(e)||en(e)}o(GY,"IsAdditionalProperties");function sI(e){return Li(e)||Kx(e)}o(sI,"IsOptionalBigInt");function Jn(e){return Li(e)||Gu(e)}o(Jn,"IsOptionalNumber");function T6(e){return Li(e)||th(e)}o(T6,"IsOptionalBoolean");function Fn(e){return Li(e)||ri(e)}o(Fn,"IsOptionalString");function d1e(e){return Li(e)||ri(e)&&P6(e)&&jY(e)}o(d1e,"IsOptionalPattern");function h1e(e){return Li(e)||ri(e)&&P6(e)}o(h1e,"IsOptionalFormat");function UY(e){return Li(e)||en(e)}o(UY,"IsOptionalSchema");function m1e(e){return qn(e)&&e[_f]==="Readonly"}o(m1e,"IsReadonly");function g1e(e){return qn(e)&&e[ha]==="Optional"}o(g1e,"IsOptional");function VY(e){return tn(e,"Any")&&Fn(e.$id)}o(VY,"IsAny");function zY(e){return tn(e,"Array")&&e.type==="array"&&Fn(e.$id)&&en(e.items)&&Jn(e.minItems)&&Jn(e.maxItems)&&T6(e.uniqueItems)&&UY(e.contains)&&Jn(e.minContains)&&Jn(e.maxContains)}o(zY,"IsArray");function qY(e){return tn(e,"AsyncIterator")&&e.type==="AsyncIterator"&&Fn(e.$id)&&en(e.items)}o(qY,"IsAsyncIterator");function HY(e){return tn(e,"BigInt")&&e.type==="bigint"&&Fn(e.$id)&&sI(e.exclusiveMaximum)&&sI(e.exclusiveMinimum)&&sI(e.maximum)&&sI(e.minimum)&&sI(e.multipleOf)}o(HY,"IsBigInt");function WY(e){return tn(e,"Boolean")&&e.type==="boolean"&&Fn(e.$id)}o(WY,"IsBoolean");function XY(e){return tn(e,"Constructor")&&e.type==="Constructor"&&Fn(e.$id)&&js(e.parameters)&&e.parameters.every(t=>en(t))&&en(e.returns)}o(XY,"IsConstructor");function YY(e){return tn(e,"Date")&&e.type==="Date"&&Fn(e.$id)&&Jn(e.exclusiveMaximumTimestamp)&&Jn(e.exclusiveMinimumTimestamp)&&Jn(e.maximumTimestamp)&&Jn(e.minimumTimestamp)&&Jn(e.multipleOfTimestamp)}o(YY,"IsDate");function ZY(e){return tn(e,"Function")&&e.type==="Function"&&Fn(e.$id)&&js(e.parameters)&&e.parameters.every(t=>en(t))&&en(e.returns)}o(ZY,"IsFunction");function KY(e){return tn(e,"Integer")&&e.type==="integer"&&Fn(e.$id)&&Jn(e.exclusiveMaximum)&&Jn(e.exclusiveMinimum)&&Jn(e.maximum)&&Jn(e.minimum)&&Jn(e.multipleOf)}o(KY,"IsInteger");function E6(e){return qn(e)&&Object.entries(e).every(([t,r])=>P6(t)&&en(r))}o(E6,"IsProperties");function JY(e){return tn(e,"Intersect")&&!(ri(e.type)&&e.type!=="object")&&js(e.allOf)&&e.allOf.every(t=>en(t)&&!ni(t))&&Fn(e.type)&&(T6(e.unevaluatedProperties)||UY(e.unevaluatedProperties))&&Fn(e.$id)}o(JY,"IsIntersect");function QY(e){return tn(e,"Iterator")&&e.type==="Iterator"&&Fn(e.$id)&&en(e.items)}o(QY,"IsIterator");function tn(e,t){return qn(e)&&ve in e&&e[ve]===t}o(tn,"IsKindOf");function eZ(e){return aI(e)&&ri(e.const)}o(eZ,"IsLiteralString");function tZ(e){return aI(e)&&Gu(e.const)}o(tZ,"IsLiteralNumber");function y1e(e){return aI(e)&&th(e.const)}o(y1e,"IsLiteralBoolean");function aI(e){return tn(e,"Literal")&&Fn(e.$id)&&rZ(e.const)}o(aI,"IsLiteral");function rZ(e){return th(e)||Gu(e)||ri(e)}o(rZ,"IsLiteralValue");function nZ(e){return tn(e,"MappedKey")&&js(e.keys)&&e.keys.every(t=>Gu(t)||ri(t))}o(nZ,"IsMappedKey");function iZ(e){return tn(e,"MappedResult")&&E6(e.properties)}o(iZ,"IsMappedResult");function oZ(e){return tn(e,"Never")&&qn(e.not)&&Object.getOwnPropertyNames(e.not).length===0}o(oZ,"IsNever");function sZ(e){return tn(e,"Not")&&en(e.not)}o(sZ,"IsNot");function aZ(e){return tn(e,"Null")&&e.type==="null"&&Fn(e.$id)}o(aZ,"IsNull");function lZ(e){return tn(e,"Number")&&e.type==="number"&&Fn(e.$id)&&Jn(e.exclusiveMaximum)&&Jn(e.exclusiveMinimum)&&Jn(e.maximum)&&Jn(e.minimum)&&Jn(e.multipleOf)}o(lZ,"IsNumber");function uZ(e){return tn(e,"Object")&&e.type==="object"&&Fn(e.$id)&&E6(e.properties)&&GY(e.additionalProperties)&&Jn(e.minProperties)&&Jn(e.maxProperties)}o(uZ,"IsObject");function cZ(e){return tn(e,"Promise")&&e.type==="Promise"&&Fn(e.$id)&&en(e.item)}o(cZ,"IsPromise");function pZ(e){return tn(e,"Record")&&e.type==="object"&&Fn(e.$id)&&GY(e.additionalProperties)&&qn(e.patternProperties)&&(t=>{let r=Object.getOwnPropertyNames(t.patternProperties);return r.length===1&&jY(r[0])&&qn(t.patternProperties)&&en(t.patternProperties[r[0]])})(e)}o(pZ,"IsRecord");function v1e(e){return qn(e)&&Vl in e&&e[Vl]==="Recursive"}o(v1e,"IsRecursive");function fZ(e){return tn(e,"Ref")&&Fn(e.$id)&&ri(e.$ref)}o(fZ,"IsRef");function dZ(e){return tn(e,"RegExp")&&Fn(e.$id)&&ri(e.source)&&ri(e.flags)&&Jn(e.maxLength)&&Jn(e.minLength)}o(dZ,"IsRegExp");function hZ(e){return tn(e,"String")&&e.type==="string"&&Fn(e.$id)&&Jn(e.minLength)&&Jn(e.maxLength)&&d1e(e.pattern)&&h1e(e.format)}o(hZ,"IsString");function mZ(e){return tn(e,"Symbol")&&e.type==="symbol"&&Fn(e.$id)}o(mZ,"IsSymbol");function gZ(e){return tn(e,"TemplateLiteral")&&e.type==="string"&&ri(e.pattern)&&e.pattern[0]==="^"&&e.pattern[e.pattern.length-1]==="$"}o(gZ,"IsTemplateLiteral");function yZ(e){return tn(e,"This")&&Fn(e.$id)&&ri(e.$ref)}o(yZ,"IsThis");function ni(e){return qn(e)&&hi in e}o(ni,"IsTransform");function vZ(e){return tn(e,"Tuple")&&e.type==="array"&&Fn(e.$id)&&Gu(e.minItems)&&Gu(e.maxItems)&&e.minItems===e.maxItems&&(Li(e.items)&&Li(e.additionalItems)&&e.minItems===0||js(e.items)&&e.items.every(t=>en(t)))}o(vZ,"IsTuple");function a1(e){return tn(e,"Undefined")&&e.type==="undefined"&&Fn(e.$id)}o(a1,"IsUndefined");function b1e(e){return M6(e)&&e.anyOf.every(t=>eZ(t)||tZ(t))}o(b1e,"IsUnionLiteral");function M6(e){return tn(e,"Union")&&Fn(e.$id)&&qn(e)&&js(e.anyOf)&&e.anyOf.every(t=>en(t))}o(M6,"IsUnion");function bZ(e){return tn(e,"Uint8Array")&&e.type==="Uint8Array"&&Fn(e.$id)&&Jn(e.minByteLength)&&Jn(e.maxByteLength)}o(bZ,"IsUint8Array");function xZ(e){return tn(e,"Unknown")&&Fn(e.$id)}o(xZ,"IsUnknown");function IZ(e){return tn(e,"Unsafe")}o(IZ,"IsUnsafe");function _Z(e){return tn(e,"Void")&&e.type==="void"&&Fn(e.$id)}o(_Z,"IsVoid");function SZ(e){return qn(e)&&ve in e&&ri(e[ve])&&!f1e.includes(e[ve])}o(SZ,"IsKind");function en(e){return qn(e)&&(VY(e)||zY(e)||WY(e)||HY(e)||qY(e)||XY(e)||YY(e)||ZY(e)||KY(e)||JY(e)||QY(e)||aI(e)||nZ(e)||iZ(e)||oZ(e)||sZ(e)||aZ(e)||lZ(e)||uZ(e)||cZ(e)||pZ(e)||fZ(e)||dZ(e)||hZ(e)||mZ(e)||gZ(e)||yZ(e)||vZ(e)||a1(e)||M6(e)||bZ(e)||xZ(e)||IZ(e)||_Z(e)||SZ(e))}o(en,"IsSchema");g();var L6="(true|false)",lI="(0|[1-9][0-9]*)",A6="(.*)",x1e="(?!.*)",X0t="^".concat(L6,"$"),wf="^".concat(lI,"$"),Pf="^".concat(A6,"$"),CZ="^".concat(x1e,"$");g();var ma={};Cc(ma,{Clear:()=>_1e,Delete:()=>S1e,Entries:()=>I1e,Get:()=>P1e,Has:()=>C1e,Set:()=>w1e});g();var l1=new Map;function I1e(){return new Map(l1)}o(I1e,"Entries");function _1e(){return l1.clear()}o(_1e,"Clear");function S1e(e){return l1.delete(e)}o(S1e,"Delete");function C1e(e){return l1.has(e)}o(C1e,"Has");function w1e(e,t){l1.set(e,t)}o(w1e,"Set");function P1e(e){return l1.get(e)}o(P1e,"Get");var Mo={};Cc(Mo,{Clear:()=>E1e,Delete:()=>M1e,Entries:()=>T1e,Get:()=>A1e,Has:()=>O1e,Set:()=>L1e});g();var u1=new Map;function T1e(){return new Map(u1)}o(T1e,"Entries");function E1e(){return u1.clear()}o(E1e,"Clear");function M1e(e){return u1.delete(e)}o(M1e,"Delete");function O1e(e){return u1.has(e)}o(O1e,"Has");function L1e(e,t){u1.set(e,t)}o(L1e,"Set");function A1e(e){return u1.get(e)}o(A1e,"Get");g();function wZ(e,t){return e.includes(t)}o(wZ,"SetIncludes");function PZ(e){return[...new Set(e)]}o(PZ,"SetDistinct");function D1e(e,t){return e.filter(r=>t.includes(r))}o(D1e,"SetIntersect");function F1e(e,t){return e.reduce((r,n)=>D1e(r,n),t)}o(F1e,"SetIntersectManyResolve");function TZ(e){return e.length===1?e[0]:e.length>1?F1e(e.slice(1),e[0]):[]}o(TZ,"SetIntersectMany");function EZ(e){let t=[];for(let r of e)t.push(...r);return t}o(EZ,"SetUnionMany");g();function oh(e){return Re({[ve]:"Any"},e)}o(oh,"Any");g();function mw(e,t){return Re({[ve]:"Array",type:"array",items:e},t)}o(mw,"Array");g();function gw(e,t){return Re({[ve]:"AsyncIterator",type:"AsyncIterator",items:e},t)}o(gw,"AsyncIterator");g();g();g();function N1e(e,t){let i=e,{[t]:r}=i;return ls(i,[rS(t)])}o(N1e,"DiscardKey");function Gi(e,t){return t.reduce((r,n)=>N1e(r,n),e)}o(Gi,"Discard");g();function Nn(e){return Re({[ve]:"Never",not:{}},e)}o(Nn,"Never");g();g();function an(e){return Re({[ve]:"MappedResult",properties:e})}o(an,"MappedResult");g();g();function yw(e,t,r){return Re({[ve]:"Constructor",type:"Constructor",parameters:e,returns:t},r)}o(yw,"Constructor");g();function sh(e,t,r){return Re({[ve]:"Function",type:"Function",parameters:e,returns:t},r)}o(sh,"Function");g();g();g();g();function uI(e,t){return Re({[ve]:"Union",anyOf:e},t)}o(uI,"UnionCreate");function k1e(e){return e.some(t=>Qc(t))}o(k1e,"IsUnionOptional");function MZ(e){return e.map(t=>Qc(t)?R1e(t):t)}o(MZ,"RemoveOptionalFromRest");function R1e(e){return Gi(e,[ha])}o(R1e,"RemoveOptionalFromType");function B1e(e,t){return k1e(e)?ka(uI(MZ(e),t)):uI(MZ(e),t)}o(B1e,"ResolveUnion");function ep(e,t){return e.length===0?Nn(t):e.length===1?Re(e[0],t):B1e(e,t)}o(ep,"UnionEvaluated");g();function kn(e,t){return e.length===0?Nn(t):e.length===1?Re(e[0],t):uI(e,t)}o(kn,"Union");g();g();g();var F6=class F6 extends Mt{};o(F6,"TemplateLiteralParserError");var vw=F6;function $1e(e){return e.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}o($1e,"Unescape");function D6(e,t,r){return e[t]===r&&e.charCodeAt(t-1)!==92}o(D6,"IsNonEscaped");function Tf(e,t){return D6(e,t,"(")}o(Tf,"IsOpenParen");function cI(e,t){return D6(e,t,")")}o(cI,"IsCloseParen");function OZ(e,t){return D6(e,t,"|")}o(OZ,"IsSeparator");function j1e(e){if(!(Tf(e,0)&&cI(e,e.length-1)))return!1;let t=0;for(let r=0;r<e.length;r++)if(Tf(e,r)&&(t+=1),cI(e,r)&&(t-=1),t===0&&r!==e.length-1)return!1;return!0}o(j1e,"IsGroup");function G1e(e){return e.slice(1,e.length-1)}o(G1e,"InGroup");function U1e(e){let t=0;for(let r=0;r<e.length;r++)if(Tf(e,r)&&(t+=1),cI(e,r)&&(t-=1),OZ(e,r)&&t===0)return!0;return!1}o(U1e,"IsPrecedenceOr");function V1e(e){for(let t=0;t<e.length;t++)if(Tf(e,t))return!0;return!1}o(V1e,"IsPrecedenceAnd");function z1e(e){let[t,r]=[0,0],n=[];for(let s=0;s<e.length;s++)if(Tf(e,s)&&(t+=1),cI(e,s)&&(t-=1),OZ(e,s)&&t===0){let l=e.slice(r,s);l.length>0&&n.push(c1(l)),r=s+1}let i=e.slice(r);return i.length>0&&n.push(c1(i)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}o(z1e,"Or");function q1e(e){function t(i,s){if(!Tf(i,s))throw new vw("TemplateLiteralParser: Index must point to open parens");let l=0;for(let c=s;c<i.length;c++)if(Tf(i,c)&&(l+=1),cI(i,c)&&(l-=1),l===0)return[s,c];throw new vw("TemplateLiteralParser: Unclosed group parens in expression")}o(t,"Group");function r(i,s){for(let l=s;l<i.length;l++)if(Tf(i,l))return[s,l];return[s,i.length]}o(r,"Range");let n=[];for(let i=0;i<e.length;i++)if(Tf(e,i)){let[s,l]=t(e,i),c=e.slice(s,l+1);n.push(c1(c)),i=l}else{let[s,l]=r(e,i),c=e.slice(s,l);c.length>0&&n.push(c1(c)),i=l-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}o(q1e,"And");function c1(e){return j1e(e)?c1(G1e(e)):U1e(e)?z1e(e):V1e(e)?q1e(e):{type:"const",const:$1e(e)}}o(c1,"TemplateLiteralParse");function p1(e){return c1(e.slice(1,e.length-1))}o(p1,"TemplateLiteralParseExact");var k6=class k6 extends Mt{};o(k6,"TemplateLiteralFiniteError");var N6=k6;function H1e(e){return e.type==="or"&&e.expr.length===2&&e.expr[0].type==="const"&&e.expr[0].const==="0"&&e.expr[1].type==="const"&&e.expr[1].const==="[1-9][0-9]*"}o(H1e,"IsNumberExpression");function W1e(e){return e.type==="or"&&e.expr.length===2&&e.expr[0].type==="const"&&e.expr[0].const==="true"&&e.expr[1].type==="const"&&e.expr[1].const==="false"}o(W1e,"IsBooleanExpression");function X1e(e){return e.type==="const"&&e.const===".*"}o(X1e,"IsStringExpression");function fg(e){return H1e(e)||X1e(e)?!1:W1e(e)?!0:e.type==="and"?e.expr.every(t=>fg(t)):e.type==="or"?e.expr.every(t=>fg(t)):e.type==="const"?!0:(()=>{throw new N6("Unknown expression type")})()}o(fg,"IsTemplateLiteralExpressionFinite");function bw(e){let t=p1(e.pattern);return fg(t)}o(bw,"IsTemplateLiteralFinite");g();var B6=class B6 extends Mt{};o(B6,"TemplateLiteralGenerateError");var R6=B6;function*LZ(e){if(e.length===1)return yield*Ve(e[0]);for(let t of e[0])for(let r of LZ(e.slice(1)))yield"".concat(t).concat(r)}o(LZ,"GenerateReduce");function*Y1e(e){return yield*Ve(LZ(e.expr.map(t=>[...pI(t)])))}o(Y1e,"GenerateAnd");function*Z1e(e){for(let t of e.expr)yield*Ve(pI(t))}o(Z1e,"GenerateOr");function*K1e(e){return yield e.const}o(K1e,"GenerateConst");function*pI(e){return e.type==="and"?yield*Ve(Y1e(e)):e.type==="or"?yield*Ve(Z1e(e)):e.type==="const"?yield*Ve(K1e(e)):(()=>{throw new R6("Unknown expression")})()}o(pI,"TemplateLiteralExpressionGenerate");function f1(e){let t=p1(e.pattern);return fg(t)?[...pI(t)]:[]}o(f1,"TemplateLiteralGenerate");g();g();function In(e,t){return Re({[ve]:"Literal",const:e,type:typeof e},t)}o(In,"Literal");g();function xw(e){return Re({[ve]:"Boolean",type:"boolean"},e)}o(xw,"Boolean");g();function d1(e){return Re({[ve]:"BigInt",type:"bigint"},e)}o(d1,"BigInt");g();function tp(e){return Re({[ve]:"Number",type:"number"},e)}o(tp,"Number");g();function zl(e){return Re({[ve]:"String",type:"string"},e)}o(zl,"String");function*J1e(e){let t=e.trim().replace(/"|'/g,"");return t==="boolean"?yield xw():t==="number"?yield tp():t==="bigint"?yield d1():t==="string"?yield zl():yield(()=>{let r=t.split("|").map(n=>In(n.trim()));return r.length===0?Nn():r.length===1?r[0]:ep(r)})()}o(J1e,"FromUnion");function*Q1e(e){if(e[1]!=="{"){let t=In("$"),r=$6(e.slice(1));return yield*Ve([t,...r])}for(let t=2;t<e.length;t++)if(e[t]==="}"){let r=J1e(e.slice(2,t)),n=$6(e.slice(t+1));return yield*Ve([...r,...n])}yield In(e)}o(Q1e,"FromTerminal");function*$6(e){for(let t=0;t<e.length;t++)if(e[t]==="$"){let r=In(e.slice(0,t)),n=Q1e(e.slice(t));return yield*Ve([r,...n])}yield In(e)}o($6,"FromSyntax");function AZ(e){return[...$6(e)]}o(AZ,"TemplateLiteralSyntax");g();var U6=class U6 extends Mt{};o(U6,"TemplateLiteralPatternError");var j6=U6;function eve(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(eve,"Escape");function DZ(e,t){return ul(e)?e.pattern.slice(1,e.pattern.length-1):bn(e)?"(".concat(e.anyOf.map(r=>DZ(r,t)).join("|"),")"):cg(e)?"".concat(t).concat(lI):ug(e)?"".concat(t).concat(lI):x6(e)?"".concat(t).concat(lI):oI(e)?"".concat(t).concat(A6):Cf(e)?"".concat(t).concat(eve(e.const.toString())):I6(e)?"".concat(t).concat(L6):(()=>{throw new j6("Unexpected Kind '".concat(e[ve],"'"))})()}o(DZ,"Visit");function G6(e){return"^".concat(e.map(t=>DZ(t,"")).join(""),"$")}o(G6,"TemplateLiteralPattern");g();function dg(e){let r=f1(e).map(n=>In(n));return ep(r)}o(dg,"TemplateLiteralToUnion");g();function Iw(e,t){let r=ri(e)?G6(AZ(e)):G6(e);return Re({[ve]:"TemplateLiteral",type:"string",pattern:r},t)}o(Iw,"TemplateLiteral");function tve(e){return f1(e).map(r=>r.toString())}o(tve,"FromTemplateLiteral");function rve(e){let t=[];for(let r of e)t.push(...Ra(r));return t}o(rve,"FromUnion");function nve(e){return[e.toString()]}o(nve,"FromLiteral");function Ra(e){return[...new Set(ul(e)?tve(e):bn(e)?rve(e.anyOf):Cf(e)?nve(e.const):cg(e)?["[number]"]:ug(e)?["[number]"]:[])]}o(Ra,"IndexPropertyKeys");g();function ive(e,t,r){let n={};for(let i of Object.getOwnPropertyNames(t))n[i]=h1(e,Ra(t[i]),r);return n}o(ive,"FromProperties");function ove(e,t,r){return ive(e,t.properties,r)}o(ove,"FromMappedResult");function FZ(e,t,r){let n=ove(e,t,r);return an(n)}o(FZ,"IndexFromMappedResult");function kZ(e,t){return e.map(r=>RZ(r,t))}o(kZ,"FromRest");function sve(e){return e.filter(t=>!nh(t))}o(sve,"FromIntersectRest");function ave(e,t){return _w(sve(kZ(e,t)))}o(ave,"FromIntersect");function lve(e){return e.some(t=>nh(t))?[]:e}o(lve,"FromUnionRest");function uve(e,t){return ep(lve(kZ(e,t)))}o(uve,"FromUnion");function cve(e,t){return t in e?e[t]:t==="[number]"?ep(e):Nn()}o(cve,"FromTuple");function pve(e,t){return t==="[number]"?e:Nn()}o(pve,"FromArray");function fve(e,t){return t in e?e[t]:Nn()}o(fve,"FromProperty");function RZ(e,t){var r;return Ji(e)?ave(e.allOf,t):bn(e)?uve(e.anyOf,t):Uu(e)?cve((r=e.items)!=null?r:[],t):Sf(e)?pve(e.items,t):Eo(e)?fve(e.properties,t):Nn()}o(RZ,"IndexFromPropertyKey");function fI(e,t){return t.map(r=>RZ(e,r))}o(fI,"IndexFromPropertyKeys");function NZ(e,t){return ep(fI(e,t))}o(NZ,"FromSchema");function h1(e,t,r){return mi(t)?FZ(e,t,r):ll(t)?BZ(e,t,r):Re(Vu(t)?NZ(e,Ra(t)):NZ(e,t),r)}o(h1,"Index");function dve(e,t,r){return{[t]:h1(e,[t],di(r))}}o(dve,"MappedIndexPropertyKey");function hve(e,t,r){return t.reduce((n,i)=>k(k({},n),dve(e,i,r)),{})}o(hve,"MappedIndexPropertyKeys");function mve(e,t,r){return hve(e,t.keys,r)}o(mve,"MappedIndexProperties");function BZ(e,t,r){let n=mve(e,t,r);return an(n)}o(BZ,"IndexFromMappedKey");g();function Sw(e,t){return Re({[ve]:"Iterator",type:"Iterator",items:e},t)}o(Sw,"Iterator");g();function gve(e){let t=[];for(let r in e)Qc(e[r])||t.push(r);return t}o(gve,"RequiredKeys");function yve(e,t){let r=gve(e),n=r.length>0?{[ve]:"Object",type:"object",properties:e,required:r}:{[ve]:"Object",type:"object",properties:e};return Re(n,t)}o(yve,"_Object");var Hn=yve;g();function Cw(e,t){return Re({[ve]:"Promise",type:"Promise",item:e},t)}o(Cw,"Promise");g();g();function vve(e){return Re(Gi(e,[_f]))}o(vve,"RemoveReadonly");function bve(e){return Re(re(k({},e),{[_f]:"Readonly"}))}o(bve,"AddReadonly");function xve(e,t){return t===!1?vve(e):bve(e)}o(xve,"ReadonlyWithFlag");function ql(e,t){let r=t!=null?t:!0;return mi(e)?$Z(e,r):xve(e,r)}o(ql,"Readonly");function Ive(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=ql(e[n],t);return r}o(Ive,"FromProperties");function _ve(e,t){return Ive(e.properties,t)}o(_ve,"FromMappedResult");function $Z(e,t){let r=_ve(e,t);return an(r)}o($Z,"ReadonlyFromMappedResult");g();function rp(e,t){return Re(e.length>0?{[ve]:"Tuple",type:"array",items:e,additionalItems:!1,minItems:e.length,maxItems:e.length}:{[ve]:"Tuple",type:"array",minItems:e.length,maxItems:e.length},t)}o(rp,"Tuple");function jZ(e,t){return e in t?Hl(e,t[e]):an(t)}o(jZ,"FromMappedResult");function Sve(e){return{[e]:In(e)}}o(Sve,"MappedKeyToKnownMappedResultProperties");function Cve(e){let t={};for(let r of e)t[r]=In(r);return t}o(Cve,"MappedKeyToUnknownMappedResultProperties");function wve(e,t){return wZ(t,e)?Sve(e):Cve(t)}o(wve,"MappedKeyToMappedResultProperties");function Pve(e,t){let r=wve(e,t);return jZ(e,r)}o(Pve,"FromMappedKey");function dI(e,t){return t.map(r=>Hl(e,r))}o(dI,"FromRest");function Tve(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Hl(e,t[n]);return r}o(Tve,"FromProperties");function Hl(e,t){var n;let r=k({},t);return Qc(t)?ka(Hl(e,Gi(t,[ha]))):$Y(t)?ql(Hl(e,Gi(t,[_f]))):mi(t)?jZ(e,t.properties):ll(t)?Pve(e,t.keys):rI(t)?yw(dI(e,t.parameters),Hl(e,t.returns),r):nI(t)?sh(dI(e,t.parameters),Hl(e,t.returns),r):tI(t)?gw(Hl(e,t.items),r):iI(t)?Sw(Hl(e,t.items),r):Ji(t)?Ba(dI(e,t.allOf),r):bn(t)?kn(dI(e,t.anyOf),r):Uu(t)?rp(dI(e,(n=t.items)!=null?n:[]),r):Eo(t)?Hn(Tve(e,t.properties),r):Sf(t)?mw(Hl(e,t.items),r):pg(t)?Cw(Hl(e,t.item),r):t}o(Hl,"FromSchemaType");function Eve(e,t){let r={};for(let n of e)r[n]=Hl(n,t);return r}o(Eve,"MappedFunctionReturnType");function GZ(e,t,r){let n=Vu(e)?Ra(e):e,i=t({[ve]:"MappedKey",keys:n}),s=Eve(n,i);return Hn(s,r)}o(GZ,"Mapped");g();function Mve(e){return Re(Gi(e,[ha]))}o(Mve,"RemoveOptional");function Ove(e){return Re(re(k({},e),{[ha]:"Optional"}))}o(Ove,"AddOptional");function Lve(e,t){return t===!1?Mve(e):Ove(e)}o(Lve,"OptionalWithFlag");function ka(e,t){let r=t!=null?t:!0;return mi(e)?UZ(e,r):Lve(e,r)}o(ka,"Optional");function Ave(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=ka(e[n],t);return r}o(Ave,"FromProperties");function Dve(e,t){return Ave(e.properties,t)}o(Dve,"FromMappedResult");function UZ(e,t){let r=Dve(e,t);return an(r)}o(UZ,"OptionalFromMappedResult");g();function hI(e,t={}){let r=e.every(i=>Eo(i)),n=Vu(t.unevaluatedProperties)?{unevaluatedProperties:t.unevaluatedProperties}:{};return Re(t.unevaluatedProperties===!1||Vu(t.unevaluatedProperties)||r?re(k({},n),{[ve]:"Intersect",type:"object",allOf:e}):re(k({},n),{[ve]:"Intersect",allOf:e}),t)}o(hI,"IntersectCreate");function Fve(e){return e.every(t=>Qc(t))}o(Fve,"IsIntersectOptional");function Nve(e){return Gi(e,[ha])}o(Nve,"RemoveOptionalFromType");function VZ(e){return e.map(t=>Qc(t)?Nve(t):t)}o(VZ,"RemoveOptionalFromRest");function kve(e,t){return Fve(e)?ka(hI(VZ(e),t)):hI(VZ(e),t)}o(kve,"ResolveIntersect");function _w(e,t={}){if(e.length===0)return Nn(t);if(e.length===1)return Re(e[0],t);if(e.some(r=>s1(r)))throw new Error("Cannot intersect transform types");return kve(e,t)}o(_w,"IntersectEvaluated");g();function Ba(e,t){if(e.length===0)return Nn(t);if(e.length===1)return Re(e[0],t);if(e.some(r=>s1(r)))throw new Error("Cannot intersect transform types");return hI(e,t)}o(Ba,"Intersect");function zZ(e){return e.map(t=>V6(t))}o(zZ,"FromRest");function Rve(e){return Ba(zZ(e))}o(Rve,"FromIntersect");function Bve(e){return kn(zZ(e))}o(Bve,"FromUnion");function $ve(e){return V6(e)}o($ve,"FromPromise");function V6(e){return Ji(e)?Rve(e.allOf):bn(e)?Bve(e.anyOf):pg(e)?$ve(e.item):e}o(V6,"AwaitedResolve");function qZ(e,t){return Re(V6(e),t)}o(qZ,"Awaited");g();g();g();g();function HZ(e){let t=[];for(let r of e)t.push(Yo(r));return t}o(HZ,"FromRest");function jve(e){let t=HZ(e);return EZ(t)}o(jve,"FromIntersect");function Gve(e){let t=HZ(e);return TZ(t)}o(Gve,"FromUnion");function Uve(e){return e.map((t,r)=>r.toString())}o(Uve,"FromTuple");function Vve(e){return["[number]"]}o(Vve,"FromArray");function zve(e){return globalThis.Object.getOwnPropertyNames(e)}o(zve,"FromProperties");function qve(e){return z6?globalThis.Object.getOwnPropertyNames(e).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}o(qve,"FromPatternProperties");function Yo(e){var t;return Ji(e)?jve(e.allOf):bn(e)?Gve(e.anyOf):Uu(e)?Uve((t=e.items)!=null?t:[]):Sf(e)?Vve(e.items):Eo(e)?zve(e.properties):_6(e)?qve(e.patternProperties):[]}o(Yo,"KeyOfPropertyKeys");var z6=!1;function Ef(e){z6=!0;let t=Yo(e);z6=!1;let r=t.map(n=>"(".concat(n,")"));return"^(".concat(r.join("|"),")$")}o(Ef,"KeyOfPattern");function Hve(e){return e.map(t=>t==="[number]"?tp():In(t))}o(Hve,"KeyOfPropertyKeysToRest");function ww(e,t){if(mi(e))return WZ(e,t);{let r=Yo(e),n=Hve(r),i=ep(n);return Re(i,t)}}o(ww,"KeyOf");function Wve(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=ww(e[n],di(t));return r}o(Wve,"FromProperties");function Xve(e,t){return Wve(e.properties,t)}o(Xve,"FromMappedResult");function WZ(e,t){let r=Xve(e,t);return an(r)}o(WZ,"KeyOfFromMappedResult");g();function ah(e){let t=Yo(e),r=fI(e,t);return t.map((n,i)=>[t[i],r[i]])}o(ah,"KeyOfPropertyEntries");function Yve(e){let t=[];for(let r of e)t.push(...Yo(r));return PZ(t)}o(Yve,"CompositeKeys");function Zve(e){return e.filter(t=>!nh(t))}o(Zve,"FilterNever");function Kve(e,t){let r=[];for(let n of e)r.push(...fI(n,[t]));return Zve(r)}o(Kve,"CompositeProperty");function Jve(e,t){let r={};for(let n of t)r[n]=_w(Kve(e,n));return r}o(Jve,"CompositeProperties");function XZ(e,t){let r=Yve(e),n=Jve(e,r);return Hn(n,t)}o(XZ,"Composite");g();g();function Pw(e){return Re({[ve]:"Date",type:"Date"},e)}o(Pw,"Date");g();function Tw(e){return Re({[ve]:"Null",type:"null"},e)}o(Tw,"Null");g();function Ew(e){return Re({[ve]:"Symbol",type:"symbol"},e)}o(Ew,"Symbol");g();function Mw(e){return Re({[ve]:"Undefined",type:"undefined"},e)}o(Mw,"Undefined");g();function Ow(e){return Re({[ve]:"Uint8Array",type:"Uint8Array"},e)}o(Ow,"Uint8Array");g();function Mf(e){return Re({[ve]:"Unknown"},e)}o(Mf,"Unknown");function Qve(e){return e.map(t=>q6(t,!1))}o(Qve,"FromArray");function ebe(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=ql(q6(e[r],!1));return t}o(ebe,"FromProperties");function Lw(e,t){return t===!0?e:ql(e)}o(Lw,"ConditionalReadonly");function q6(e,t){return f6(e)?Lw(oh(),t):h6(e)?Lw(oh(),t):js(e)?ql(rp(Qve(e))):bf(e)?Ow():lg(e)?Pw():qn(e)?Lw(Hn(ebe(e)),t):d6(e)?Lw(sh([],Mf()),t):Li(e)?Mw():m6(e)?Tw():g6(e)?Ew():Kx(e)?d1():Gu(e)?In(e):th(e)?In(e):ri(e)?In(e):Hn({})}o(q6,"FromValue");function YZ(e,t){return Re(q6(e,!0),t)}o(YZ,"Const");g();function ZZ(e,t){return rp(e.parameters,t)}o(ZZ,"ConstructorParameters");g();function mI(e,t){return e.map(r=>zu(r,t))}o(mI,"FromRest");function tbe(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=zu(e[n],t);return r}o(tbe,"FromProperties");function rbe(e,t){return e.parameters=mI(e.parameters,t),e.returns=zu(e.returns,t),e}o(rbe,"FromConstructor");function nbe(e,t){return e.parameters=mI(e.parameters,t),e.returns=zu(e.returns,t),e}o(nbe,"FromFunction");function ibe(e,t){return e.allOf=mI(e.allOf,t),e}o(ibe,"FromIntersect");function obe(e,t){return e.anyOf=mI(e.anyOf,t),e}o(obe,"FromUnion");function sbe(e,t){return Li(e.items)||(e.items=mI(e.items,t)),e}o(sbe,"FromTuple");function abe(e,t){return e.items=zu(e.items,t),e}o(abe,"FromArray");function lbe(e,t){return e.properties=tbe(e.properties,t),e}o(lbe,"FromObject");function ube(e,t){return e.item=zu(e.item,t),e}o(ube,"FromPromise");function cbe(e,t){return e.items=zu(e.items,t),e}o(cbe,"FromAsyncIterator");function pbe(e,t){return e.items=zu(e.items,t),e}o(pbe,"FromIterator");function fbe(e,t){let r=t.find(i=>i.$id===e.$ref);if(r===void 0)throw Error("Unable to dereference schema with $id ".concat(e.$ref));let n=Gi(r,["$id"]);return zu(n,t)}o(fbe,"FromRef");function dbe(e,t){return rI(e)?rbe(e,t):nI(e)?nbe(e,t):Ji(e)?ibe(e,t):bn(e)?obe(e,t):Uu(e)?sbe(e,t):Sf(e)?abe(e,t):Eo(e)?lbe(e,t):pg(e)?ube(e,t):tI(e)?cbe(e,t):iI(e)?pbe(e,t):S6(e)?fbe(e,t):e}o(dbe,"DerefResolve");function zu(e,t){return dbe(Qx(e),kY(t))}o(zu,"Deref");g();function KZ(e,t){if(Li(e))throw new Error("Enum undefined or empty");let r=globalThis.Object.getOwnPropertyNames(e).filter(s=>isNaN(s)).map(s=>e[s]),i=[...new Set(r)].map(s=>In(s));return kn(i,re(k({},t),{[Vl]:"Enum"}))}o(KZ,"Enum");g();g();g();var J6=class J6 extends Mt{};o(J6,"ExtendsResolverError");var W6=J6,Te;(function(e){e[e.Union=0]="Union",e[e.True=1]="True",e[e.False=2]="False"})(Te||(Te={}));function Wl(e){return e===Te.False?e:Te.True}o(Wl,"IntoBooleanResult");function m1(e){throw new W6(e)}o(m1,"Throw");function ho(e){return oe.IsNever(e)||oe.IsIntersect(e)||oe.IsUnion(e)||oe.IsUnknown(e)||oe.IsAny(e)}o(ho,"IsStructuralRight");function mo(e,t){return oe.IsNever(t)?iK(e,t):oe.IsIntersect(t)?Aw(e,t):oe.IsUnion(t)?K6(e,t):oe.IsUnknown(t)?lK(e,t):oe.IsAny(t)?Z6(e,t):m1("StructuralRight")}o(mo,"StructuralRight");function Z6(e,t){return Te.True}o(Z6,"FromAnyRight");function hbe(e,t){return oe.IsIntersect(t)?Aw(e,t):oe.IsUnion(t)&&t.anyOf.some(r=>oe.IsAny(r)||oe.IsUnknown(r))?Te.True:oe.IsUnion(t)?Te.Union:oe.IsUnknown(t)||oe.IsAny(t)?Te.True:Te.Union}o(hbe,"FromAny");function mbe(e,t){return oe.IsUnknown(e)?Te.False:oe.IsAny(e)?Te.Union:oe.IsNever(e)?Te.True:Te.False}o(mbe,"FromArrayRight");function gbe(e,t){return oe.IsObject(t)&&Dw(t)?Te.True:ho(t)?mo(e,t):oe.IsArray(t)?Wl(Rn(e.items,t.items)):Te.False}o(gbe,"FromArray");function ybe(e,t){return ho(t)?mo(e,t):oe.IsAsyncIterator(t)?Wl(Rn(e.items,t.items)):Te.False}o(ybe,"FromAsyncIterator");function vbe(e,t){return ho(t)?mo(e,t):oe.IsObject(t)?Gs(e,t):oe.IsRecord(t)?Xl(e,t):oe.IsBigInt(t)?Te.True:Te.False}o(vbe,"FromBigInt");function rK(e,t){return oe.IsLiteralBoolean(e)||oe.IsBoolean(e)?Te.True:Te.False}o(rK,"FromBooleanRight");function bbe(e,t){return ho(t)?mo(e,t):oe.IsObject(t)?Gs(e,t):oe.IsRecord(t)?Xl(e,t):oe.IsBoolean(t)?Te.True:Te.False}o(bbe,"FromBoolean");function xbe(e,t){return ho(t)?mo(e,t):oe.IsObject(t)?Gs(e,t):oe.IsConstructor(t)?e.parameters.length>t.parameters.length?Te.False:e.parameters.every((r,n)=>Wl(Rn(t.parameters[n],r))===Te.True)?Wl(Rn(e.returns,t.returns)):Te.False:Te.False}o(xbe,"FromConstructor");function Ibe(e,t){return ho(t)?mo(e,t):oe.IsObject(t)?Gs(e,t):oe.IsRecord(t)?Xl(e,t):oe.IsDate(t)?Te.True:Te.False}o(Ibe,"FromDate");function _be(e,t){return ho(t)?mo(e,t):oe.IsObject(t)?Gs(e,t):oe.IsFunction(t)?e.parameters.length>t.parameters.length?Te.False:e.parameters.every((r,n)=>Wl(Rn(t.parameters[n],r))===Te.True)?Wl(Rn(e.returns,t.returns)):Te.False:Te.False}o(_be,"FromFunction");function nK(e,t){return oe.IsLiteral(e)&&Jr.IsNumber(e.const)||oe.IsNumber(e)||oe.IsInteger(e)?Te.True:Te.False}o(nK,"FromIntegerRight");function Sbe(e,t){return oe.IsInteger(t)||oe.IsNumber(t)?Te.True:ho(t)?mo(e,t):oe.IsObject(t)?Gs(e,t):oe.IsRecord(t)?Xl(e,t):Te.False}o(Sbe,"FromInteger");function Aw(e,t){return t.allOf.every(r=>Rn(e,r)===Te.True)?Te.True:Te.False}o(Aw,"FromIntersectRight");function Cbe(e,t){return e.allOf.some(r=>Rn(r,t)===Te.True)?Te.True:Te.False}o(Cbe,"FromIntersect");function wbe(e,t){return ho(t)?mo(e,t):oe.IsIterator(t)?Wl(Rn(e.items,t.items)):Te.False}o(wbe,"FromIterator");function Pbe(e,t){return oe.IsLiteral(t)&&t.const===e.const?Te.True:ho(t)?mo(e,t):oe.IsObject(t)?Gs(e,t):oe.IsRecord(t)?Xl(e,t):oe.IsString(t)?aK(e,t):oe.IsNumber(t)?oK(e,t):oe.IsInteger(t)?nK(e,t):oe.IsBoolean(t)?rK(e,t):Te.False}o(Pbe,"FromLiteral");function iK(e,t){return Te.False}o(iK,"FromNeverRight");function Tbe(e,t){return Te.True}o(Tbe,"FromNever");function JZ(e){let[t,r]=[e,0];for(;oe.IsNot(t);)t=t.not,r+=1;return r%2===0?t:Mf()}o(JZ,"UnwrapTNot");function Ebe(e,t){return oe.IsNot(e)?Rn(JZ(e),t):oe.IsNot(t)?Rn(e,JZ(t)):m1("Invalid fallthrough for Not")}o(Ebe,"FromNot");function Mbe(e,t){return ho(t)?mo(e,t):oe.IsObject(t)?Gs(e,t):oe.IsRecord(t)?Xl(e,t):oe.IsNull(t)?Te.True:Te.False}o(Mbe,"FromNull");function oK(e,t){return oe.IsLiteralNumber(e)||oe.IsNumber(e)||oe.IsInteger(e)?Te.True:Te.False}o(oK,"FromNumberRight");function Obe(e,t){return ho(t)?mo(e,t):oe.IsObject(t)?Gs(e,t):oe.IsRecord(t)?Xl(e,t):oe.IsInteger(t)||oe.IsNumber(t)?Te.True:Te.False}o(Obe,"FromNumber");function $a(e,t){return Object.getOwnPropertyNames(e.properties).length===t}o($a,"IsObjectPropertyCount");function QZ(e){return Dw(e)}o(QZ,"IsObjectStringLike");function eK(e){return $a(e,0)||$a(e,1)&&"description"in e.properties&&oe.IsUnion(e.properties.description)&&e.properties.description.anyOf.length===2&&(oe.IsString(e.properties.description.anyOf[0])&&oe.IsUndefined(e.properties.description.anyOf[1])||oe.IsString(e.properties.description.anyOf[1])&&oe.IsUndefined(e.properties.description.anyOf[0]))}o(eK,"IsObjectSymbolLike");function H6(e){return $a(e,0)}o(H6,"IsObjectNumberLike");function tK(e){return $a(e,0)}o(tK,"IsObjectBooleanLike");function Lbe(e){return $a(e,0)}o(Lbe,"IsObjectBigIntLike");function Abe(e){return $a(e,0)}o(Abe,"IsObjectDateLike");function Dbe(e){return Dw(e)}o(Dbe,"IsObjectUint8ArrayLike");function Fbe(e){let t=tp();return $a(e,0)||$a(e,1)&&"length"in e.properties&&Wl(Rn(e.properties.length,t))===Te.True}o(Fbe,"IsObjectFunctionLike");function Nbe(e){return $a(e,0)}o(Nbe,"IsObjectConstructorLike");function Dw(e){let t=tp();return $a(e,0)||$a(e,1)&&"length"in e.properties&&Wl(Rn(e.properties.length,t))===Te.True}o(Dw,"IsObjectArrayLike");function kbe(e){let t=sh([oh()],oh());return $a(e,0)||$a(e,1)&&"then"in e.properties&&Wl(Rn(e.properties.then,t))===Te.True}o(kbe,"IsObjectPromiseLike");function sK(e,t){return Rn(e,t)===Te.False||oe.IsOptional(e)&&!oe.IsOptional(t)?Te.False:Te.True}o(sK,"Property");function Gs(e,t){return oe.IsUnknown(e)?Te.False:oe.IsAny(e)?Te.Union:oe.IsNever(e)||oe.IsLiteralString(e)&&QZ(t)||oe.IsLiteralNumber(e)&&H6(t)||oe.IsLiteralBoolean(e)&&tK(t)||oe.IsSymbol(e)&&eK(t)||oe.IsBigInt(e)&&Lbe(t)||oe.IsString(e)&&QZ(t)||oe.IsSymbol(e)&&eK(t)||oe.IsNumber(e)&&H6(t)||oe.IsInteger(e)&&H6(t)||oe.IsBoolean(e)&&tK(t)||oe.IsUint8Array(e)&&Dbe(t)||oe.IsDate(e)&&Abe(t)||oe.IsConstructor(e)&&Nbe(t)||oe.IsFunction(e)&&Fbe(t)?Te.True:oe.IsRecord(e)&&oe.IsString(X6(e))?t[Vl]==="Record"?Te.True:Te.False:oe.IsRecord(e)&&oe.IsNumber(X6(e))?$a(t,0)?Te.True:Te.False:Te.False}o(Gs,"FromObjectRight");function Rbe(e,t){return ho(t)?mo(e,t):oe.IsRecord(t)?Xl(e,t):oe.IsObject(t)?(()=>{for(let r of Object.getOwnPropertyNames(t.properties)){if(!(r in e.properties)&&!oe.IsOptional(t.properties[r]))return Te.False;if(oe.IsOptional(t.properties[r]))return Te.True;if(sK(e.properties[r],t.properties[r])===Te.False)return Te.False}return Te.True})():Te.False}o(Rbe,"FromObject");function Bbe(e,t){return ho(t)?mo(e,t):oe.IsObject(t)&&kbe(t)?Te.True:oe.IsPromise(t)?Wl(Rn(e.item,t.item)):Te.False}o(Bbe,"FromPromise");function X6(e){return wf in e.patternProperties?tp():Pf in e.patternProperties?zl():m1("Unknown record key pattern")}o(X6,"RecordKey");function Y6(e){return wf in e.patternProperties?e.patternProperties[wf]:Pf in e.patternProperties?e.patternProperties[Pf]:m1("Unable to get record value schema")}o(Y6,"RecordValue");function Xl(e,t){let[r,n]=[X6(t),Y6(t)];return oe.IsLiteralString(e)&&oe.IsNumber(r)&&Wl(Rn(e,n))===Te.True?Te.True:oe.IsUint8Array(e)&&oe.IsNumber(r)||oe.IsString(e)&&oe.IsNumber(r)||oe.IsArray(e)&&oe.IsNumber(r)?Rn(e,n):oe.IsObject(e)?(()=>{for(let i of Object.getOwnPropertyNames(e.properties))if(sK(n,e.properties[i])===Te.False)return Te.False;return Te.True})():Te.False}o(Xl,"FromRecordRight");function $be(e,t){return ho(t)?mo(e,t):oe.IsObject(t)?Gs(e,t):oe.IsRecord(t)?Rn(Y6(e),Y6(t)):Te.False}o($be,"FromRecord");function jbe(e,t){let r=oe.IsRegExp(e)?zl():e,n=oe.IsRegExp(t)?zl():t;return Rn(r,n)}o(jbe,"FromRegExp");function aK(e,t){return oe.IsLiteral(e)&&Jr.IsString(e.const)||oe.IsString(e)?Te.True:Te.False}o(aK,"FromStringRight");function Gbe(e,t){return ho(t)?mo(e,t):oe.IsObject(t)?Gs(e,t):oe.IsRecord(t)?Xl(e,t):oe.IsString(t)?Te.True:Te.False}o(Gbe,"FromString");function Ube(e,t){return ho(t)?mo(e,t):oe.IsObject(t)?Gs(e,t):oe.IsRecord(t)?Xl(e,t):oe.IsSymbol(t)?Te.True:Te.False}o(Ube,"FromSymbol");function Vbe(e,t){return oe.IsTemplateLiteral(e)?Rn(dg(e),t):oe.IsTemplateLiteral(t)?Rn(e,dg(t)):m1("Invalid fallthrough for TemplateLiteral")}o(Vbe,"FromTemplateLiteral");function zbe(e,t){return oe.IsArray(t)&&e.items!==void 0&&e.items.every(r=>Rn(r,t.items)===Te.True)}o(zbe,"IsArrayOfTuple");function qbe(e,t){return oe.IsNever(e)?Te.True:oe.IsUnknown(e)?Te.False:oe.IsAny(e)?Te.Union:Te.False}o(qbe,"FromTupleRight");function Hbe(e,t){return ho(t)?mo(e,t):oe.IsObject(t)&&Dw(t)||oe.IsArray(t)&&zbe(e,t)?Te.True:oe.IsTuple(t)?Jr.IsUndefined(e.items)&&!Jr.IsUndefined(t.items)||!Jr.IsUndefined(e.items)&&Jr.IsUndefined(t.items)?Te.False:Jr.IsUndefined(e.items)&&!Jr.IsUndefined(t.items)||e.items.every((r,n)=>Rn(r,t.items[n])===Te.True)?Te.True:Te.False:Te.False}o(Hbe,"FromTuple");function Wbe(e,t){return ho(t)?mo(e,t):oe.IsObject(t)?Gs(e,t):oe.IsRecord(t)?Xl(e,t):oe.IsUint8Array(t)?Te.True:Te.False}o(Wbe,"FromUint8Array");function Xbe(e,t){return ho(t)?mo(e,t):oe.IsObject(t)?Gs(e,t):oe.IsRecord(t)?Xl(e,t):oe.IsVoid(t)?Kbe(e,t):oe.IsUndefined(t)?Te.True:Te.False}o(Xbe,"FromUndefined");function K6(e,t){return t.anyOf.some(r=>Rn(e,r)===Te.True)?Te.True:Te.False}o(K6,"FromUnionRight");function Ybe(e,t){return e.anyOf.every(r=>Rn(r,t)===Te.True)?Te.True:Te.False}o(Ybe,"FromUnion");function lK(e,t){return Te.True}o(lK,"FromUnknownRight");function Zbe(e,t){return oe.IsNever(t)?iK(e,t):oe.IsIntersect(t)?Aw(e,t):oe.IsUnion(t)?K6(e,t):oe.IsAny(t)?Z6(e,t):oe.IsString(t)?aK(e,t):oe.IsNumber(t)?oK(e,t):oe.IsInteger(t)?nK(e,t):oe.IsBoolean(t)?rK(e,t):oe.IsArray(t)?mbe(e,t):oe.IsTuple(t)?qbe(e,t):oe.IsObject(t)?Gs(e,t):oe.IsUnknown(t)?Te.True:Te.False}o(Zbe,"FromUnknown");function Kbe(e,t){return oe.IsUndefined(e)||oe.IsUndefined(e)?Te.True:Te.False}o(Kbe,"FromVoidRight");function Jbe(e,t){return oe.IsIntersect(t)?Aw(e,t):oe.IsUnion(t)?K6(e,t):oe.IsUnknown(t)?lK(e,t):oe.IsAny(t)?Z6(e,t):oe.IsObject(t)?Gs(e,t):oe.IsVoid(t)?Te.True:Te.False}o(Jbe,"FromVoid");function Rn(e,t){return oe.IsTemplateLiteral(e)||oe.IsTemplateLiteral(t)?Vbe(e,t):oe.IsRegExp(e)||oe.IsRegExp(t)?jbe(e,t):oe.IsNot(e)||oe.IsNot(t)?Ebe(e,t):oe.IsAny(e)?hbe(e,t):oe.IsArray(e)?gbe(e,t):oe.IsBigInt(e)?vbe(e,t):oe.IsBoolean(e)?bbe(e,t):oe.IsAsyncIterator(e)?ybe(e,t):oe.IsConstructor(e)?xbe(e,t):oe.IsDate(e)?Ibe(e,t):oe.IsFunction(e)?_be(e,t):oe.IsInteger(e)?Sbe(e,t):oe.IsIntersect(e)?Cbe(e,t):oe.IsIterator(e)?wbe(e,t):oe.IsLiteral(e)?Pbe(e,t):oe.IsNever(e)?Tbe(e,t):oe.IsNull(e)?Mbe(e,t):oe.IsNumber(e)?Obe(e,t):oe.IsObject(e)?Rbe(e,t):oe.IsRecord(e)?$be(e,t):oe.IsString(e)?Gbe(e,t):oe.IsSymbol(e)?Ube(e,t):oe.IsTuple(e)?Hbe(e,t):oe.IsPromise(e)?Bbe(e,t):oe.IsUint8Array(e)?Wbe(e,t):oe.IsUndefined(e)?Xbe(e,t):oe.IsUnion(e)?Ybe(e,t):oe.IsUnknown(e)?Zbe(e,t):oe.IsVoid(e)?Jbe(e,t):m1("Unknown left type operand '".concat(e[ve],"'"))}o(Rn,"Visit");function lh(e,t){return Rn(e,t)}o(lh,"ExtendsCheck");g();g();g();function Qbe(e,t,r,n,i){let s={};for(let l of globalThis.Object.getOwnPropertyNames(e))s[l]=g1(e[l],t,r,n,di(i));return s}o(Qbe,"FromProperties");function exe(e,t,r,n,i){return Qbe(e.properties,t,r,n,i)}o(exe,"FromMappedResult");function uK(e,t,r,n,i){let s=exe(e,t,r,n,i);return an(s)}o(uK,"ExtendsFromMappedResult");function txe(e,t,r,n){let i=lh(e,t);return i===Te.Union?kn([r,n]):i===Te.True?r:n}o(txe,"ExtendsResolve");function g1(e,t,r,n,i){return mi(e)?uK(e,t,r,n,i):ll(e)?Re(cK(e,t,r,n,i)):Re(txe(e,t,r,n),i)}o(g1,"Extends");function rxe(e,t,r,n,i){return{[e]:g1(In(e),t,r,n,di(i))}}o(rxe,"FromPropertyKey");function nxe(e,t,r,n,i){return e.reduce((s,l)=>k(k({},s),rxe(l,t,r,n,i)),{})}o(nxe,"FromPropertyKeys");function ixe(e,t,r,n,i){return nxe(e.keys,t,r,n,i)}o(ixe,"FromMappedKey");function cK(e,t,r,n,i){let s=ixe(e,t,r,n,i);return an(s)}o(cK,"ExtendsFromMappedKey");g();function oxe(e){return e.allOf.every(t=>Of(t))}o(oxe,"Intersect");function sxe(e){return e.anyOf.some(t=>Of(t))}o(sxe,"Union");function axe(e){return!Of(e.not)}o(axe,"Not");function Of(e){return e[ve]==="Intersect"?oxe(e):e[ve]==="Union"?sxe(e):e[ve]==="Not"?axe(e):e[ve]==="Undefined"}o(Of,"ExtendsUndefinedCheck");g();function pK(e,t){return y1(dg(e),t)}o(pK,"ExcludeFromTemplateLiteral");function lxe(e,t){let r=e.filter(n=>lh(n,t)===Te.False);return r.length===1?r[0]:kn(r)}o(lxe,"ExcludeRest");function y1(e,t,r={}){return ul(e)?Re(pK(e,t),r):mi(e)?Re(fK(e,t),r):Re(bn(e)?lxe(e.anyOf,t):lh(e,t)!==Te.False?Nn():e,r)}o(y1,"Exclude");function uxe(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=y1(e[n],t);return r}o(uxe,"FromProperties");function cxe(e,t){return uxe(e.properties,t)}o(cxe,"FromMappedResult");function fK(e,t){let r=cxe(e,t);return an(r)}o(fK,"ExcludeFromMappedResult");g();g();g();function dK(e,t){return v1(dg(e),t)}o(dK,"ExtractFromTemplateLiteral");function pxe(e,t){let r=e.filter(n=>lh(n,t)!==Te.False);return r.length===1?r[0]:kn(r)}o(pxe,"ExtractRest");function v1(e,t,r){return ul(e)?Re(dK(e,t),r):mi(e)?Re(hK(e,t),r):Re(bn(e)?pxe(e.anyOf,t):lh(e,t)!==Te.False?e:Nn(),r)}o(v1,"Extract");function fxe(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=v1(e[n],t);return r}o(fxe,"FromProperties");function dxe(e,t){return fxe(e.properties,t)}o(dxe,"FromMappedResult");function hK(e,t){let r=dxe(e,t);return an(r)}o(hK,"ExtractFromMappedResult");g();function mK(e,t){return Re(e.returns,t)}o(mK,"InstanceType");g();function gK(e){return Re({[ve]:"Integer",type:"integer"},e)}o(gK,"Integer");g();g();g();function hxe(e,t,r){return{[e]:qu(In(e),t,di(r))}}o(hxe,"MappedIntrinsicPropertyKey");function mxe(e,t,r){return e.reduce((i,s)=>k(k({},i),hxe(s,t,r)),{})}o(mxe,"MappedIntrinsicPropertyKeys");function gxe(e,t,r){return mxe(e.keys,t,r)}o(gxe,"MappedIntrinsicProperties");function yK(e,t,r){let n=gxe(e,t,r);return an(n)}o(yK,"IntrinsicFromMappedKey");function yxe(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),r].join("")}o(yxe,"ApplyUncapitalize");function vxe(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),r].join("")}o(vxe,"ApplyCapitalize");function bxe(e){return e.toUpperCase()}o(bxe,"ApplyUppercase");function xxe(e){return e.toLowerCase()}o(xxe,"ApplyLowercase");function Ixe(e,t,r){let n=p1(e.pattern);if(!fg(n))return re(k({},e),{pattern:vK(e.pattern,t)});let l=[...pI(n)].map(h=>In(h)),c=bK(l,t),p=kn(c);return Iw([p],r)}o(Ixe,"FromTemplateLiteral");function vK(e,t){return typeof e=="string"?t==="Uncapitalize"?yxe(e):t==="Capitalize"?vxe(e):t==="Uppercase"?bxe(e):t==="Lowercase"?xxe(e):e:e.toString()}o(vK,"FromLiteralValue");function bK(e,t){return e.map(r=>qu(r,t))}o(bK,"FromRest");function qu(e,t,r={}){return ll(e)?yK(e,t,r):ul(e)?Ixe(e,t,r):bn(e)?kn(bK(e.anyOf,t),r):Cf(e)?In(vK(e.const,t),r):Re(e,r)}o(qu,"Intrinsic");function xK(e,t={}){return qu(e,"Capitalize",t)}o(xK,"Capitalize");g();function IK(e,t={}){return qu(e,"Lowercase",t)}o(IK,"Lowercase");g();function _K(e,t={}){return qu(e,"Uncapitalize",t)}o(_K,"Uncapitalize");g();function SK(e,t={}){return qu(e,"Uppercase",t)}o(SK,"Uppercase");g();function CK(e,t){return Re({[ve]:"Not",not:e},t)}o(CK,"Not");g();g();g();function _xe(e,t,r){let n={};for(let i of globalThis.Object.getOwnPropertyNames(e))n[i]=b1(e[i],t,di(r));return n}o(_xe,"FromProperties");function Sxe(e,t,r){return _xe(e.properties,t,r)}o(Sxe,"FromMappedResult");function wK(e,t,r){let n=Sxe(e,t,r);return an(n)}o(wK,"OmitFromMappedResult");function Cxe(e,t){return e.map(r=>Q6(r,t))}o(Cxe,"FromIntersect");function wxe(e,t){return e.map(r=>Q6(r,t))}o(wxe,"FromUnion");function Pxe(e,t){let i=e,{[t]:r}=i;return ls(i,[rS(t)])}o(Pxe,"FromProperty");function Txe(e,t){return t.reduce((r,n)=>Pxe(r,n),e)}o(Txe,"FromProperties");function Exe(e,t){let r=Gi(e,[hi,"$id","required","properties"]),n=Txe(e.properties,t);return Hn(n,r)}o(Exe,"FromObject");function Q6(e,t){return Ji(e)?Ba(Cxe(e.allOf,t)):bn(e)?kn(wxe(e.anyOf,t)):Eo(e)?Exe(e,t):Hn({})}o(Q6,"OmitResolve");function b1(e,t,r){if(ll(t))return PK(e,t,r);if(mi(e))return wK(e,t,r);let n=Vu(t)?Ra(t):t;return Re(k(k({},Q6(e,n)),r))}o(b1,"Omit");function Mxe(e,t,r){return{[t]:b1(e,[t],di(r))}}o(Mxe,"FromPropertyKey");function Oxe(e,t,r){return t.reduce((n,i)=>k(k({},n),Mxe(e,i,r)),{})}o(Oxe,"FromPropertyKeys");function Lxe(e,t,r){return Oxe(e,t.keys,r)}o(Lxe,"FromMappedKey");function PK(e,t,r){let n=Lxe(e,t,r);return an(n)}o(PK,"OmitFromMappedKey");g();function TK(e,t){return rp(e.parameters,t)}o(TK,"Parameters");g();g();function EK(e){return e.map(t=>MK(t))}o(EK,"FromRest");function Axe(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=ka(e[r]);return t}o(Axe,"FromProperties");function Dxe(e){let t=Gi(e,[hi,"$id","required","properties"]),r=Axe(e.properties);return Hn(r,t)}o(Dxe,"FromObject");function MK(e){return Ji(e)?Ba(EK(e.allOf)):bn(e)?kn(EK(e.anyOf)):Eo(e)?Dxe(e):Hn({})}o(MK,"PartialResolve");function Fw(e,t){return mi(e)?OK(e,t):Re(k(k({},MK(e)),t))}o(Fw,"Partial");function Fxe(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Fw(e[n],di(t));return r}o(Fxe,"FromProperties");function Nxe(e,t){return Fxe(e.properties,t)}o(Nxe,"FromMappedResult");function OK(e,t){let r=Nxe(e,t);return an(r)}o(OK,"PartialFromMappedResult");g();g();g();function kxe(e,t,r){let n={};for(let i of globalThis.Object.getOwnPropertyNames(e))n[i]=x1(e[i],t,di(r));return n}o(kxe,"FromProperties");function Rxe(e,t,r){return kxe(e.properties,t,r)}o(Rxe,"FromMappedResult");function LK(e,t,r){let n=Rxe(e,t,r);return an(n)}o(LK,"PickFromMappedResult");function Bxe(e,t){return e.map(r=>eL(r,t))}o(Bxe,"FromIntersect");function $xe(e,t){return e.map(r=>eL(r,t))}o($xe,"FromUnion");function jxe(e,t){let r={};for(let n of t)n in e&&(r[n]=e[n]);return r}o(jxe,"FromProperties");function Gxe(e,t){let r=Gi(e,[hi,"$id","required","properties"]),n=jxe(e.properties,t);return Hn(n,r)}o(Gxe,"FromObject");function eL(e,t){return Ji(e)?Ba(Bxe(e.allOf,t)):bn(e)?kn($xe(e.anyOf,t)):Eo(e)?Gxe(e,t):Hn({})}o(eL,"PickResolve");function x1(e,t,r){if(ll(t))return AK(e,t,r);if(mi(e))return LK(e,t,r);let n=Vu(t)?Ra(t):t;return Re(k(k({},eL(e,n)),r))}o(x1,"Pick");function Uxe(e,t,r){return{[t]:x1(e,[t],di(r))}}o(Uxe,"FromPropertyKey");function Vxe(e,t,r){return t.reduce((n,i)=>k(k({},n),Uxe(e,i,r)),{})}o(Vxe,"FromPropertyKeys");function zxe(e,t,r){return Vxe(e,t.keys,r)}o(zxe,"FromMappedKey");function AK(e,t,r){let n=zxe(e,t,r);return an(n)}o(AK,"PickFromMappedKey");g();function DK(e){return ql(ka(e))}o(DK,"ReadonlyOptional");g();function hg(e,t,r){return Re({[ve]:"Record",type:"object",patternProperties:{[e]:t}},r)}o(hg,"RecordCreateFromPattern");function tL(e,t,r){let n={};for(let i of e)n[i]=t;return Hn(n,re(k({},r),{[Vl]:"Record"}))}o(tL,"RecordCreateFromKeys");function qxe(e,t,r){return bw(e)?tL(Ra(e),t,r):hg(e.pattern,t,r)}o(qxe,"FromTemplateLiteralKey");function Hxe(e,t,r){return tL(Ra(kn(e)),t,r)}o(Hxe,"FromUnionKey");function Wxe(e,t,r){return tL([e.toString()],t,r)}o(Wxe,"FromLiteralKey");function Xxe(e,t,r){return hg(e.source,t,r)}o(Xxe,"FromRegExpKey");function Yxe(e,t,r){let n=Li(e.pattern)?Pf:e.pattern;return hg(n,t,r)}o(Yxe,"FromStringKey");function Zxe(e,t,r){return hg(Pf,t,r)}o(Zxe,"FromAnyKey");function Kxe(e,t,r){return hg(CZ,t,r)}o(Kxe,"FromNeverKey");function Jxe(e,t,r){return hg(wf,t,r)}o(Jxe,"FromIntegerKey");function Qxe(e,t,r){return hg(wf,t,r)}o(Qxe,"FromNumberKey");function FK(e,t,r={}){return bn(e)?Hxe(e.anyOf,t,r):ul(e)?qxe(e,t,r):Cf(e)?Wxe(e.const,t,r):ug(e)?Jxe(e,t,r):cg(e)?Qxe(e,t,r):C6(e)?Xxe(e,t,r):oI(e)?Yxe(e,t,r):b6(e)?Zxe(e,t,r):nh(e)?Kxe(e,t,r):Nn(r)}o(FK,"Record");g();var eIe=0;function NK(e,t={}){Li(t.$id)&&(t.$id="T".concat(eIe++));let r=Qx(e({[ve]:"This",$ref:"".concat(t.$id)}));return r.$id=t.$id,Re(k({[Vl]:"Recursive"},r),t)}o(NK,"Recursive");g();function kK(e,t){if(ri(e))return Re({[ve]:"Ref",$ref:e},t);if(Li(e.$id))throw new Error("Reference target type must specify an $id");return Re({[ve]:"Ref",$ref:e.$id},t)}o(kK,"Ref");g();function RK(e,t){let r=ri(e)?new globalThis.RegExp(e):e;return Re({[ve]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},t)}o(RK,"RegExp");g();g();function BK(e){return e.map(t=>$K(t))}o(BK,"FromRest");function tIe(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=Gi(e[r],[ha]);return t}o(tIe,"FromProperties");function rIe(e){let t=Gi(e,[hi,"$id","required","properties"]),r=tIe(e.properties);return Hn(r,t)}o(rIe,"FromObject");function $K(e){return Ji(e)?Ba(BK(e.allOf)):bn(e)?kn(BK(e.anyOf)):Eo(e)?rIe(e):Hn({})}o($K,"RequiredResolve");function Nw(e,t){return mi(e)?jK(e,t):Re(k(k({},$K(e)),t))}o(Nw,"Required");function nIe(e,t){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=Nw(e[n],t);return r}o(nIe,"FromProperties");function iIe(e,t){return nIe(e.properties,t)}o(iIe,"FromMappedResult");function jK(e,t){let r=iIe(e,t);return an(r)}o(jK,"RequiredFromMappedResult");g();function oIe(e){var t;return Ji(e)?e.allOf:bn(e)?e.anyOf:Uu(e)?(t=e.items)!=null?t:[]:[]}o(oIe,"RestResolve");function GK(e){return oIe(e)}o(GK,"Rest");g();function UK(e,t){return Re(e.returns,t)}o(UK,"ReturnType");g();function VK(e){return JSON.parse(JSON.stringify(e))}o(VK,"Strict");g();var iL=class iL{constructor(t){this.schema=t}Decode(t){return new nL(this.schema,t)}};o(iL,"TransformDecodeBuilder");var rL=iL,oL=class oL{constructor(t,r){this.schema=t,this.decode=r}EncodeTransform(t,r){let s={Encode:o(l=>r[hi].Encode(t(l)),"Encode"),Decode:o(l=>this.decode(r[hi].Decode(l)),"Decode")};return re(k({},r),{[hi]:s})}EncodeSchema(t,r){let n={Decode:this.decode,Encode:t};return re(k({},r),{[hi]:n})}Encode(t){return s1(this.schema)?this.EncodeTransform(t,this.schema):this.EncodeSchema(t,this.schema)}};o(oL,"TransformEncodeBuilder");var nL=oL;function zK(e){return new rL(e)}o(zK,"Transform");g();function kw(e={}){var t;return Re({[ve]:(t=e[ve])!=null?t:"Unsafe"},e)}o(kw,"Unsafe");g();function qK(e){return Re({[ve]:"Void",type:"void"},e)}o(qK,"Void");g();var sL={};Cc(sL,{Any:()=>oh,Array:()=>mw,AsyncIterator:()=>gw,Awaited:()=>qZ,BigInt:()=>d1,Boolean:()=>xw,Capitalize:()=>xK,Composite:()=>XZ,Const:()=>YZ,Constructor:()=>yw,ConstructorParameters:()=>ZZ,Date:()=>Pw,Deref:()=>zu,Enum:()=>KZ,Exclude:()=>y1,Extends:()=>g1,Extract:()=>v1,Function:()=>sh,Index:()=>h1,InstanceType:()=>mK,Integer:()=>gK,Intersect:()=>Ba,Iterator:()=>Sw,KeyOf:()=>ww,Literal:()=>In,Lowercase:()=>IK,Mapped:()=>GZ,Never:()=>Nn,Not:()=>CK,Null:()=>Tw,Number:()=>tp,Object:()=>Hn,Omit:()=>b1,Optional:()=>ka,Parameters:()=>TK,Partial:()=>Fw,Pick:()=>x1,Promise:()=>Cw,Readonly:()=>ql,ReadonlyOptional:()=>DK,Record:()=>FK,Recursive:()=>NK,Ref:()=>kK,RegExp:()=>RK,Required:()=>Nw,Rest:()=>GK,ReturnType:()=>UK,Strict:()=>VK,String:()=>zl,Symbol:()=>Ew,TemplateLiteral:()=>Iw,Transform:()=>zK,Tuple:()=>rp,Uint8Array:()=>Ow,Uncapitalize:()=>_K,Undefined:()=>Mw,Union:()=>kn,Unknown:()=>Mf,Unsafe:()=>kw,Uppercase:()=>SK,Void:()=>qK});g();var L=sL;var Ci=o((e,t)=>L.Unsafe(L.String({$id:t,pattern:"^".concat(e,"_[A-Za-z0-9-]{8,}$")})),"Ident"),Us=Ci("g","GeometryId"),ln=Ci("f","FloorId"),aL=[Us,ln];g();g();var gI=L.Object({externalId:L.String({description:"An identifier that can be used to link this entity to data outside of the MVF."}),name:L.String({description:"The name of the entity."}),shortName:L.String({description:"A short name for the entity."}),description:L.String({description:"A description of the entity."}),icon:L.String({format:"uri",description:"A URL to an icon for the entity."})},{$id:"BaseDetails",description:"Additional information about a given entity."}),lL=L.Partial(gI,{$id:"Details",description:"Additional information about a given entity."}),Hu=L.Object({details:L.Optional(L.Ref(lL))},{$id:"WithDetails"}),mg=o(e=>{let t=[...e].sort(),r=L.Pick(gI,e),n=L.Omit(gI,e);return L.Object({details:L.Intersect([r,L.Partial(n)])},{$id:"WithRequiredDetails_".concat(t.join("_"))})},"WithRequiredDetails"),uL=[gI,lL];g();g();var cL=L.Record(L.String(),L.Unknown(),{$id:"Extra"}),Wu=L.Object({extra:L.Optional(L.Ref(cL))}),pL=[cL];g();g();var I1=L.Object({geometryId:L.Ref(Us),floorId:L.Ref(ln)},{$id:"GeometryAnchor"}),sIe=L.Object({geometryAnchor:L.Ref(I1)}),gg=o((e,t)=>L.Object({geometryAnchors:L.Array(L.Ref(I1),e)},t),"WithGeometryAnchors"),fL=[I1];g();g();g();g();g();var _1=L.Number({$id:"Longitude",minimum:-180,maximum:180,description:"A WGS 84-compatible longitude coordinate value."}),S1=L.Number({$id:"Latitude",minimum:-90,maximum:90,description:"A WGS 84-compatible latitude coordinate value."}),yg=L.Tuple([L.Ref(_1),L.Ref(S1)],{$id:"Position",minItems:2,maxItems:2,description:"A valid WGS 84 position consisting of a longitude value, followed by a latitude value."}),Vs=L.Object({type:L.Literal("Point"),coordinates:L.Ref(yg)},{$id:"Point",description:"An RFC-7946 compatible GeoJSON Point geometry."}),Rw=L.Object({type:L.Literal("MultiPoint"),coordinates:L.Array(L.Ref(yg))},{$id:"MultiPoint",description:"An RFC-7946 compatible GeoJSON MultiPoint geometry."}),Bw=L.Object({type:L.Literal("LineString"),coordinates:L.Array(L.Ref(yg),{minItems:2,description:"At least two positions are required."})},{$id:"LineString",description:"An RFC-7946 compatible GeoJSON LineString geometry."}),$w=L.Object({type:L.Literal("MultiLineString"),coordinates:L.Array(L.Array(L.Ref(yg),{minItems:2}))},{$id:"MultiLineString",description:"An RFC-7946 compatible GeoJSON MultiLineString geometry."}),HK=L.Array(L.Ref(yg),{$id:"LinearRing",minItems:4,description:"A linear ring is a building block of a polygon or multi-polygon."}),dL=L.Array(L.Ref(HK),{$id:"LinearRings",minItems:1,description:"A collection of linear rings, at least one of which is the exterior ring of a polygon."}),C1=L.Object({type:L.Literal("Polygon"),coordinates:L.Ref(dL)},{$id:"Polygon",description:"An RFC-7946 compatible GeoJSON Polygon geometry."}),w1=L.Object({type:L.Literal("MultiPolygon"),coordinates:L.Array(L.Ref(dL))},{$id:"MultiPolygon",description:"An RFC-7946 compatible GeoJSON MultiPolygon geometry."}),gs=o((e,t,r)=>L.Object({type:L.Literal("Feature"),geometry:e,properties:t},r),"Feature"),ga=o((e,t,r)=>L.Object({type:L.Literal("FeatureCollection"),features:L.Array(e,r)},t),"FeatureCollection"),hL=[_1,S1,yg,Vs,Rw,Bw,$w,HK,dL,C1,w1];var WK=L.Intersect([L.Object({id:L.Ref(ln),elevation:L.Integer({description:"An ordinal representing the elevation of this map relative to other maps in the stack."}),subtitle:L.Optional(L.String({description:"The subtitle of the floor."}))}),Hu],{$id:"FloorProperties"}),XK=gs(L.Union([L.Ref(C1),L.Ref(w1),L.Null()]),L.Ref(WK),{$id:"FloorFeature"}),YK=ga(L.Ref(XK),{$id:"FloorCollection"}),aIe=L.Object({floors:L.Ref(YK)}),ZK={name:"core:floors",intoBundle:o(function*(e){e.floors!=null&&(yield{path:"floors.geojson",contents:e.floors})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e==="floors.geojson")return{floors:r(t)}},"fromBundle"),schema:aIe,references:[WK,XK,YK]};g();g();g();var mL=class mL{constructor(t){x(this,"_value");this._value=t}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let t=this._value;return this._value=null,{done:!1,value:t}}};o(mL,"OptionIterator");var jw=mL,gL=class gL{constructor(t){x(this,"_tag","Some");x(this,"_value");this._value=t}get value(){return this._value}isSome(){return!0}isSomeAnd(t){return t(this.value)}isNone(){return!1}equals(t){return t.isSome()&&t.value===this.value}expect(t){return this.value}unwrap(){return this.value}unwrapOr(t){return this.value}unwrapOrElse(t){return this.value}inspect(t){return t(this.value),this}inspectNone(t){return this}map(t){return KK(t(this.value))}mapAsync(t){return t(this.value).then(r=>KK(r))}mapOr(t,r){return this.map(t).unwrapOr(r)}mapOrAsync(t,r){return this.mapAsync(t).then(n=>n.unwrapOr(r))}mapOrElse(t,r){return this.map(t).unwrapOrElse(r)}mapOrElseAsync(t,r){return this.mapAsync(t).then(n=>n.unwrapOrElse(r))}and(t){return t}andThen(t){return t(this.value)}andThenAsync(t){return t(this.value)}filter(t){return t(this.value)?this:uh()}or(t){return this}orElse(t){return this}xor(t){return t.isSome()?uh():this}toString(){return"Some(".concat(this.value,")")}okOr(t){return st(this.value)}okOrElse(t){return st(this.value)}iter(){return new jw(this.value)}[Symbol.iterator](){return this.iter()}zip(t){return t.isSome()?P1([this.value,t.value]):uh()}zipWith(t,r){return t.isSome()?P1(r(this.value,t.value)):uh()}get[Symbol.toStringTag](){return"Some"}};o(gL,"Some");var Gw=gL,yL=class yL{constructor(){x(this,"_tag","None")}get value(){return null}isSome(){return!1}isSomeAnd(t){return!1}isNone(){return!0}equals(t){return t.isNone()}expect(t){throw new Error(t)}unwrap(){throw new Error("Tried to unwrap a None value!")}unwrapOr(t){return t}unwrapOrElse(t){return t()}inspect(t){return this}inspectNone(t){return t(),this}map(t){return this}mapAsync(t){return Promise.resolve(this)}mapOr(t,r){return r}mapOrAsync(t,r){return Promise.resolve(r)}mapOrElse(t,r){return r()}mapOrElseAsync(t,r){return r()}and(t){return this}andThen(t){return this}andThenAsync(t){return Promise.resolve(this)}filter(t){return this}or(t){return t}orElse(t){return t()}xor(t){return t}toString(){return"None"}okOr(t){return lt(t)}okOrElse(t){return lt(t())}iter(){return new jw(null)}[Symbol.iterator](){return this.iter()}zip(t){return this}zipWith(t,r){return this}get[Symbol.toStringTag](){return"None"}};o(yL,"None");var Uw=yL,P1=o(e=>new Gw(e),"some"),uh=o(()=>new Uw,"none"),KK=o(e=>e instanceof Gw||e instanceof Uw?e:e==null?uh():P1(e),"option");var xL=class xL{constructor(t){x(this,"_value");this._value=t}[Symbol.iterator](){return this}next(){if(this._value==null)return{done:!0,value:void 0};let t=this._value;return this._value=null,{done:!1,value:t}}};o(xL,"ResultIterator");var Vw=xL,IL=class IL{constructor(t){x(this,"_tag","Ok");x(this,"_value");this._value=t}get value(){return this._value}get error(){return null}isOk(){return!0}isOkAnd(t){return t(this.value)}isErr(){return!1}isErrAnd(t){return!1}ok(){return P1(this.value)}err(){return uh()}expect(t){return this.value}expectErr(t){throw new Error(t)}unwrap(){return this.value}unwrapOr(t){return this.value}unwrapOrElse(t){return this.value}inspect(t){return t(this.value),this}inspectErr(){return this}map(t){return st(t(this.value))}async mapAsync(t){return t(this.value).then(st)}mapOr(t,r){return t(this.value)}async mapOrAsync(t,r){return t(this.value)}mapOrElse(t,r){return t(this.value)}async mapOrElseAsync(t,r){return t(this.value)}mapErr(t){return this}iter(){return new Vw(this.value)}[Symbol.iterator](){return this.iter()}and(t){return t}andThen(t){return t(this.value)}or(t){return this}orElse(t){return this}async andThenAsync(t){return t(this.value)}toString(){return"Ok(".concat(this.value,")")}get[Symbol.toStringTag](){return"Ok"}};o(IL,"Ok");var vL=IL,zw=class zw{constructor(t){x(this,"_tag","Err");x(this,"_error");this._error=t}get value(){return null}get error(){return this._error}isOk(){return!1}isOkAnd(t){return!1}isErr(){return!0}isErrAnd(t){return t(this.error)}ok(){return uh()}err(){return P1(this.error)}expect(t){throw new Error(t)}expectErr(t){return this.error}unwrap(){throw this.error}unwrapOr(t){return t}unwrapOrElse(t){return t()}inspect(){return this}inspectErr(t){return t(this.error),this}map(t){return this}iter(){return new Vw(null)}[Symbol.iterator](){return this.iter()}async mapAsync(t){return this}mapOr(t,r){return r}async mapOrAsync(t,r){return r}mapOrElse(t,r){return r()}async mapOrElseAsync(t,r){return r()}mapErr(t){return new zw(t(this.error))}and(t){return this}andThen(t){return this}async andThenAsync(t){return this}or(t){return t}orElse(t){return t(this.error)}toString(){return"Err(".concat(this.error,")")}get[Symbol.toStringTag](){return"Err"}};o(zw,"Err");var bL=zw,st=o(e=>new vL(e),"ok"),lt=o(e=>new bL(e),"err");g();var np;(function(e){e.GeometryMissingError="GeometryMissingError",e.FloorMissingError="FloorMissingError",e.UnknownFloorError="UnknownFloorError",e.UnknownGeometryError="UnknownGeometryError"})(np||(np={}));var lIe=o(e=>{var t,r;return new Map((r=(t=e.floors)==null?void 0:t.features.map(n=>[n.properties.id,n]))!=null?r:[])},"createFloorMap"),Lf=o(e=>{let t=lIe(e);return o(n=>{let i=t.get(n);return i==null?lt({kind:np.UnknownFloorError,properties:{floorId:n}}):st(i)},"floorLookup")},"createFloorLookup");g();g();g();g();var Ui=o(e=>L.Unsafe(e),"PartialRecord");g();var rn=o(e=>Object.keys(e),"typedKeys");g();var JK=o(e=>{if(e.floors==null)return lt({kind:np.FloorMissingError,properties:null});if(e.geometry==null)return lt({kind:np.GeometryMissingError,properties:null});let t=Lf(e);for(let r of rn(e.geometry)){let n=t(r);if(n.isErr())return n}return st(!0)},"validateGeometry");var QK=L.Intersect([L.Object({id:L.Ref(Us)}),Hu],{$id:"GeometryProperties"}),eJ=gs(L.Union([L.Ref(Vs),L.Ref(Rw),L.Ref(Bw),L.Ref($w),L.Ref(C1),L.Ref(w1)]),L.Ref(QK),{$id:"GeometryFeature"}),tJ=ga(L.Ref(eJ),{$id:"GeometryCollection"}),uIe=L.Object({geometry:Ui(L.Record(ln,L.Ref(tJ),{additionalProperties:!1}))},{$id:"GeometrySchema"}),cIe=/^geometry\/(.*)\.geojson$/,rJ={name:"core:geometry",schema:uIe,intoBundle:o(function*(e){if(e.geometry!=null)for(let t of rn(e.geometry))yield{path:"geometry/".concat(t,".geojson"),contents:e.geometry[t]}},"intoBundle"),fromBundle:o((e,t,r)=>{var i;let n=(i=e.match(cIe))==null?void 0:i[1];if(n)return{geometry:{[n]:r(t)}}},"fromBundle"),references:[QK,eJ,tJ],integrityCheck:JK};g();g();var un=o(e=>Object.entries(e),"typedEntries");var pIe=o(e=>{var r;let t=new Map;for(let[n,i]of un((r=e.geometry)!=null?r:{}))t.set(n,new Map(i==null?void 0:i.features.map(s=>[s.properties.id,s])));return t},"createLookupMap"),Oo=o(e=>{let t=pIe(e);return o((n,i)=>{let s=t.get(n);if(s==null)return lt({kind:np.UnknownFloorError,properties:{floorId:n}});let l=s.get(i);return l==null?lt({kind:np.UnknownGeometryError,properties:{floorId:n,geometryId:i}}):st(l)},"geometryLookup")},"createGeometryLookup");g();var _L=L.Object({type:L.Literal("file"),name:L.String({description:"The name of the file."})},{$id:"ManifestFile"}),nJ=L.Recursive(e=>L.Object({type:L.Literal("folder"),name:L.String({description:"The name of the folder."}),children:L.Array(L.Union([e,L.Ref(_L)]),{minItems:1,description:"The children of the folder."})}),{$id:"ManifestFolder"}),iJ=L.Object({name:L.String({description:"The name of the map."}),version:L.Literal("3.0.0",{description:"The version of the manifest."}),orgId:L.Optional(L.String({description:"The identifier of the organization that the map this MVF is for belongs to."})),mapId:L.Optional(L.String({description:"The identifier of the map that this MVF is for."})),contents:L.Array(L.Union([L.Ref(nJ),L.Ref(_L)]),{minItems:1,description:"The contents of the MVF bundle."}),time:L.String({format:"date-time",description:"An ISO 8601 date-time string, including timezone offset."}),tzid:L.Optional(L.Unsafe(L.String({description:"A valid IANA timezone identifier.",pattern:"^[A-Za-z0-9_-]+/[A-Za-z0-9_-]+$"}))),naturalBearing:L.Optional(L.Number({minimum:0,maximum:360,description:'The angle, in degrees, the map is considered to be "naturally oriented" as, rather than facing directly north. 90 degrees means East is "up"'})),defaultFloor:L.Optional(L.Ref(ln,{description:"The default floor ID of the map."})),language:L.Optional(L.String({description:"The language code of the map."}))},{$id:"ManifestProperties"}),oJ=ga(gs(Vs,L.Ref(iJ)),{$id:"ManifestCollection"},{minItems:1,maxItems:1}),fIe=L.Object({manifest:L.Ref(oJ)}),sJ={name:"core:manifest",intoBundle:o(function*(e){e.manifest!=null&&(yield{path:"manifest.geojson",contents:e.manifest})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e==="manifest.geojson")return{manifest:r(t)}},"fromBundle"),schema:fIe,references:[_L,nJ,iJ,oJ]};var Yl=L.Object({geometryId:L.Ref(Us)},{$id:"WithGeometryId"}),qw=L.Object({geometryIds:L.Array(L.Ref(Us))},{$id:"WithGeometryIds"}),SL=[Yl,qw];g();g();var aJ=o((e,t)=>L.Unsafe(L.Transform(L.String(t)).Decode(r=>e.includes(r)?r:"unknown").Encode(r=>r)),"SafeStringEnumSchema"),ja=o((e,t)=>{let r=aJ(e,t),n=[...e,"unknown"],i=Object.freeze(Object.fromEntries([...e,"unknown"].map(s=>[s,s])));return{schema:r,values:n,record:i}},"SafeStringEnum");g();g();g();var yI;(function(e){e.AnnotationNonPointGeometryError="AnnotationNonPointGeometryError",e.AnnotationUnknownSymbolError="AnnotationUnknownSymbolError"})(yI||(yI={}));var lJ=o(e=>{var n;if(e.annotations==null)return st(!0);let t=Oo(e),r=new Set(rn((n=e.annotationSymbols)!=null?n:{}));for(let i of rn(e.annotations)){let s=e.annotations[i];if(s!=null)for(let l of s){if(!r.has(l.symbolKey))return lt({kind:yI.AnnotationUnknownSymbolError,properties:{annotationId:l.id,symbolKey:l.symbolKey}});let c=t(i,l.geometryId);if(c.isErr())return c;if(c.value.geometry.type!=="Point")return lt({kind:yI.AnnotationNonPointGeometryError,properties:{annotationId:l.id,floorId:i,geometryId:l.geometryId}})}}return st(!0)},"validateAnnotations");var uJ=Ci("a","AnnotationId"),CL=L.Intersect([Yl,L.Object({id:L.Ref(uJ,{description:"The unique identifier for the annotation."}),externalId:L.Optional(L.String({description:"The external identifier for the annotation."})),symbolKey:L.String({description:"The symbol identifier for the annotation."})})],{$id:"AnnotationProperties"}),cJ=L.Object({url:L.String({format:"uri",description:"The URL for the symbol."}),name:L.String({description:"The name of the symbol."})},{$id:"AnnotationSymbol"}),dIe=L.Object({annotations:Ui(L.Record(ln,L.Array(L.Ref(CL)),{additionalProperties:!1})),annotationSymbols:Ui(L.Record(L.Index(CL,["symbolKey"]),L.Ref(cJ)))},{$id:"AnnotationsSchema"}),hIe=/^annotations\/(.*)\.json$/,pJ={name:"ext:mvf-annotations",schema:dIe,intoBundle:o(function*(e){if(e.annotations!=null)for(let t of rn(e.annotations))yield{path:"annotations/".concat(t,".json"),contents:e.annotations[t]};e.annotationSymbols!=null&&(yield{path:"annotation-symbols.json",contents:e.annotationSymbols})},"intoBundle"),fromBundle:o((e,t,r)=>{var i;if(e==="annotation-symbols.json")return{annotationSymbols:r(t)};let n=(i=e.match(hIe))==null?void 0:i[1];if(n)return{annotations:{[n]:r(t)}}},"fromBundle"),references:[uJ,CL,cJ],integrityCheck:lJ};g();g();g();g();g();g();g();g();var PL=class PL extends Mt{constructor(t){super("Duplicate type kind '".concat(t,"' detected"))}};o(PL,"TypeSystemDuplicateTypeKind");var wL=PL,TL=class TL extends Mt{constructor(t){super("Duplicate string format '".concat(t,"' detected"))}};o(TL,"TypeSystemDuplicateFormat");var vI=TL,Hw;(function(e){function t(n,i){if(Mo.Has(n))throw new wL(n);return Mo.Set(n,i),(s={})=>kw(re(k({},s),{[ve]:n}))}o(t,"Type"),e.Type=t;function r(n,i){if(ma.Has(n))throw new vI(n);return ma.Set(n,i),n}o(r,"Format"),e.Format=r})(Hw||(Hw={}));g();g();g();function mIe(e){switch(e.errorType){case be.ArrayContains:return"Expected array to contain at least one matching value";case be.ArrayMaxContains:return"Expected array to contain no more than ".concat(e.schema.maxContains," matching values");case be.ArrayMinContains:return"Expected array to contain at least ".concat(e.schema.minContains," matching values");case be.ArrayMaxItems:return"Expected array length to be less or equal to ".concat(e.schema.maxItems);case be.ArrayMinItems:return"Expected array length to be greater or equal to ".concat(e.schema.minItems);case be.ArrayUniqueItems:return"Expected array elements to be unique";case be.Array:return"Expected array";case be.AsyncIterator:return"Expected AsyncIterator";case be.BigIntExclusiveMaximum:return"Expected bigint to be less than ".concat(e.schema.exclusiveMaximum);case be.BigIntExclusiveMinimum:return"Expected bigint to be greater than ".concat(e.schema.exclusiveMinimum);case be.BigIntMaximum:return"Expected bigint to be less or equal to ".concat(e.schema.maximum);case be.BigIntMinimum:return"Expected bigint to be greater or equal to ".concat(e.schema.minimum);case be.BigIntMultipleOf:return"Expected bigint to be a multiple of ".concat(e.schema.multipleOf);case be.BigInt:return"Expected bigint";case be.Boolean:return"Expected boolean";case be.DateExclusiveMinimumTimestamp:return"Expected Date timestamp to be greater than ".concat(e.schema.exclusiveMinimumTimestamp);case be.DateExclusiveMaximumTimestamp:return"Expected Date timestamp to be less than ".concat(e.schema.exclusiveMaximumTimestamp);case be.DateMinimumTimestamp:return"Expected Date timestamp to be greater or equal to ".concat(e.schema.minimumTimestamp);case be.DateMaximumTimestamp:return"Expected Date timestamp to be less or equal to ".concat(e.schema.maximumTimestamp);case be.DateMultipleOfTimestamp:return"Expected Date timestamp to be a multiple of ".concat(e.schema.multipleOfTimestamp);case be.Date:return"Expected Date";case be.Function:return"Expected function";case be.IntegerExclusiveMaximum:return"Expected integer to be less than ".concat(e.schema.exclusiveMaximum);case be.IntegerExclusiveMinimum:return"Expected integer to be greater than ".concat(e.schema.exclusiveMinimum);case be.IntegerMaximum:return"Expected integer to be less or equal to ".concat(e.schema.maximum);case be.IntegerMinimum:return"Expected integer to be greater or equal to ".concat(e.schema.minimum);case be.IntegerMultipleOf:return"Expected integer to be a multiple of ".concat(e.schema.multipleOf);case be.Integer:return"Expected integer";case be.IntersectUnevaluatedProperties:return"Unexpected property";case be.Intersect:return"Expected all values to match";case be.Iterator:return"Expected Iterator";case be.Literal:return"Expected ".concat(typeof e.schema.const=="string"?"'".concat(e.schema.const,"'"):e.schema.const);case be.Never:return"Never";case be.Not:return"Value should not match";case be.Null:return"Expected null";case be.NumberExclusiveMaximum:return"Expected number to be less than ".concat(e.schema.exclusiveMaximum);case be.NumberExclusiveMinimum:return"Expected number to be greater than ".concat(e.schema.exclusiveMinimum);case be.NumberMaximum:return"Expected number to be less or equal to ".concat(e.schema.maximum);case be.NumberMinimum:return"Expected number to be greater or equal to ".concat(e.schema.minimum);case be.NumberMultipleOf:return"Expected number to be a multiple of ".concat(e.schema.multipleOf);case be.Number:return"Expected number";case be.Object:return"Expected object";case be.ObjectAdditionalProperties:return"Unexpected property";case be.ObjectMaxProperties:return"Expected object to have no more than ".concat(e.schema.maxProperties," properties");case be.ObjectMinProperties:return"Expected object to have at least ".concat(e.schema.minProperties," properties");case be.ObjectRequiredProperty:return"Expected required property";case be.Promise:return"Expected Promise";case be.RegExp:return"Expected string to match regular expression";case be.StringFormatUnknown:return"Unknown format '".concat(e.schema.format,"'");case be.StringFormat:return"Expected string to match '".concat(e.schema.format,"' format");case be.StringMaxLength:return"Expected string length less or equal to ".concat(e.schema.maxLength);case be.StringMinLength:return"Expected string length greater or equal to ".concat(e.schema.minLength);case be.StringPattern:return"Expected string to match '".concat(e.schema.pattern,"'");case be.String:return"Expected string";case be.Symbol:return"Expected symbol";case be.TupleLength:return"Expected tuple to have ".concat(e.schema.maxItems||0," elements");case be.Tuple:return"Expected tuple";case be.Uint8ArrayMaxByteLength:return"Expected byte length less or equal to ".concat(e.schema.maxByteLength);case be.Uint8ArrayMinByteLength:return"Expected byte length greater or equal to ".concat(e.schema.minByteLength);case be.Uint8Array:return"Expected Uint8Array";case be.Undefined:return"Expected undefined";case be.Union:return"Expected union value";case be.Void:return"Expected void";case be.Kind:return"Expected kind '".concat(e.schema[ve],"'");default:return"Unknown error type"}}o(mIe,"DefaultErrorFunction");var gIe=mIe;function fJ(){return gIe}o(fJ,"GetErrorFunction");g();var ML=class ML extends Mt{constructor(t){super("Unable to dereference schema with $id '".concat(t.$ref,"'")),this.schema=t}};o(ML,"TypeDereferenceError");var EL=ML;function yIe(e,t){let r=t.find(n=>n.$id===e.$ref);if(r===void 0)throw new EL(e);return cn(r,t)}o(yIe,"Resolve");function Zl(e,t){return!Qr(e.$id)||t.some(r=>r.$id===e.$id)||t.push(e),t}o(Zl,"Pushref");function cn(e,t){return e[ve]==="This"||e[ve]==="Ref"?yIe(e,t):e}o(cn,"Deref");g();var LL=class LL extends Mt{constructor(t){super("Unable to hash value"),this.value=t}};o(LL,"ValueHashError");var OL=LL,cl;(function(e){e[e.Undefined=0]="Undefined",e[e.Null=1]="Null",e[e.Boolean=2]="Boolean",e[e.Number=3]="Number",e[e.String=4]="String",e[e.Object=5]="Object",e[e.Array=6]="Array",e[e.Date=7]="Date",e[e.Uint8Array=8]="Uint8Array",e[e.Symbol=9]="Symbol",e[e.BigInt=10]="BigInt"})(cl||(cl={}));var T1=BigInt("14695981039346656037"),[vIe,bIe]=[BigInt("1099511628211"),BigInt("18446744073709551616")],xIe=Array.from({length:256}).map((e,t)=>BigInt(t)),dJ=new Float64Array(1),hJ=new DataView(dJ.buffer),mJ=new Uint8Array(dJ.buffer);function*IIe(e){let t=e===0?1:Math.ceil(Math.floor(Math.log2(e)+1)/8);for(let r=0;r<t;r++)yield e>>8*(t-1-r)&255}o(IIe,"NumberToBytes");function _Ie(e){zs(cl.Array);for(let t of e)E1(t)}o(_Ie,"ArrayType");function SIe(e){zs(cl.Boolean),zs(e?1:0)}o(SIe,"BooleanType");function CIe(e){zs(cl.BigInt),hJ.setBigInt64(0,e);for(let t of mJ)zs(t)}o(CIe,"BigIntType");function wIe(e){zs(cl.Date),E1(e.getTime())}o(wIe,"DateType");function PIe(e){zs(cl.Null)}o(PIe,"NullType");function TIe(e){zs(cl.Number),hJ.setFloat64(0,e);for(let t of mJ)zs(t)}o(TIe,"NumberType");function EIe(e){zs(cl.Object);for(let t of globalThis.Object.getOwnPropertyNames(e).sort())E1(t),E1(e[t])}o(EIe,"ObjectType");function MIe(e){zs(cl.String);for(let t=0;t<e.length;t++)for(let r of IIe(e.charCodeAt(t)))zs(r)}o(MIe,"StringType");function OIe(e){zs(cl.Symbol),E1(e.description)}o(OIe,"SymbolType");function LIe(e){zs(cl.Uint8Array);for(let t=0;t<e.length;t++)zs(e[t])}o(LIe,"Uint8ArrayType");function AIe(e){return zs(cl.Undefined)}o(AIe,"UndefinedType");function E1(e){if(Bt(e))return _Ie(e);if(Jc(e))return SIe(e);if(hs(e))return CIe(e);if(da(e))return wIe(e);if(xf(e))return PIe(e);if(_t(e))return TIe(e);if(Ut(e))return EIe(e);if(Qr(e))return MIe(e);if(If(e))return OIe(e);if(o1(e))return LIe(e);if(Ai(e))return AIe(e);throw new OL(e)}o(E1,"Visit");function zs(e){T1=T1^xIe[e],T1=T1*vIe%bIe}o(zs,"FNV1A64");function ch(e){return T1=BigInt("14695981039346656037"),E1(e),T1}o(ch,"Hash");g();var DL=class DL extends Mt{constructor(t){super("Unknown type"),this.schema=t}};o(DL,"ValueCheckUnknownTypeError");var AL=DL;function DIe(e){return e[ve]==="Any"||e[ve]==="Unknown"}o(DIe,"IsAnyOrUnknown");function Ur(e){return e!==void 0}o(Ur,"IsDefined");function FIe(e,t,r){return!0}o(FIe,"FromAny");function NIe(e,t,r){if(!Bt(r)||Ur(e.minItems)&&!(r.length>=e.minItems)||Ur(e.maxItems)&&!(r.length<=e.maxItems)||!r.every(s=>ys(e.items,t,s))||e.uniqueItems===!0&&!function(){let s=new Set;for(let l of r){let c=ch(l);if(s.has(c))return!1;s.add(c)}return!0}())return!1;if(!(Ur(e.contains)||_t(e.minContains)||_t(e.maxContains)))return!0;let n=Ur(e.contains)?e.contains:Nn(),i=r.reduce((s,l)=>ys(n,t,l)?s+1:s,0);return!(i===0||_t(e.minContains)&&i<e.minContains||_t(e.maxContains)&&i>e.maxContains)}o(NIe,"FromArray");function kIe(e,t,r){return pw(r)}o(kIe,"FromAsyncIterator");function RIe(e,t,r){return!(!hs(r)||Ur(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||Ur(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||Ur(e.maximum)&&!(r<=e.maximum)||Ur(e.minimum)&&!(r>=e.minimum)||Ur(e.multipleOf)&&r%e.multipleOf!==BigInt(0))}o(RIe,"FromBigInt");function BIe(e,t,r){return Jc(r)}o(BIe,"FromBoolean");function $Ie(e,t,r){return ys(e.returns,t,r.prototype)}o($Ie,"FromConstructor");function jIe(e,t,r){return!(!da(r)||Ur(e.exclusiveMaximumTimestamp)&&!(r.getTime()<e.exclusiveMaximumTimestamp)||Ur(e.exclusiveMinimumTimestamp)&&!(r.getTime()>e.exclusiveMinimumTimestamp)||Ur(e.maximumTimestamp)&&!(r.getTime()<=e.maximumTimestamp)||Ur(e.minimumTimestamp)&&!(r.getTime()>=e.minimumTimestamp)||Ur(e.multipleOfTimestamp)&&r.getTime()%e.multipleOfTimestamp!==0)}o(jIe,"FromDate");function GIe(e,t,r){return rh(r)}o(GIe,"FromFunction");function UIe(e,t,r){return!(!hw(r)||Ur(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||Ur(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||Ur(e.maximum)&&!(r<=e.maximum)||Ur(e.minimum)&&!(r>=e.minimum)||Ur(e.multipleOf)&&r%e.multipleOf!==0)}o(UIe,"FromInteger");function VIe(e,t,r){let n=e.allOf.every(i=>ys(i,t,r));if(e.unevaluatedProperties===!1){let i=new RegExp(Ef(e)),s=Object.getOwnPropertyNames(r).every(l=>i.test(l));return n&&s}else if(en(e.unevaluatedProperties)){let i=new RegExp(Ef(e)),s=Object.getOwnPropertyNames(r).every(l=>i.test(l)||ys(e.unevaluatedProperties,t,r[l]));return n&&s}else return n}o(VIe,"FromIntersect");function zIe(e,t,r){return fw(r)}o(zIe,"FromIterator");function qIe(e,t,r){return r===e.const}o(qIe,"FromLiteral");function HIe(e,t,r){return!1}o(HIe,"FromNever");function WIe(e,t,r){return!ys(e.not,t,r)}o(WIe,"FromNot");function XIe(e,t,r){return xf(r)}o(XIe,"FromNull");function YIe(e,t,r){return!(!Mn.IsNumberLike(r)||Ur(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||Ur(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||Ur(e.minimum)&&!(r>=e.minimum)||Ur(e.maximum)&&!(r<=e.maximum)||Ur(e.multipleOf)&&r%e.multipleOf!==0)}o(YIe,"FromNumber");function ZIe(e,t,r){if(!Mn.IsObjectLike(r)||Ur(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||Ur(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties))return!1;let n=Object.getOwnPropertyNames(e.properties);for(let i of n){let s=e.properties[i];if(e.required&&e.required.includes(i)){if(!ys(s,t,r[i])||(Of(s)||DIe(s))&&!(i in r))return!1}else if(Mn.IsExactOptionalProperty(r,i)&&!ys(s,t,r[i]))return!1}if(e.additionalProperties===!1){let i=Object.getOwnPropertyNames(r);return e.required&&e.required.length===n.length&&i.length===n.length?!0:i.every(s=>n.includes(s))}else return typeof e.additionalProperties=="object"?Object.getOwnPropertyNames(r).every(s=>n.includes(s)||ys(e.additionalProperties,t,r[s])):!0}o(ZIe,"FromObject");function KIe(e,t,r){return dw(r)}o(KIe,"FromPromise");function JIe(e,t,r){if(!Mn.IsRecordLike(r)||Ur(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||Ur(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties))return!1;let[n,i]=Object.entries(e.patternProperties)[0],s=new RegExp(n),l=Object.entries(r).every(([h,y])=>s.test(h)?ys(i,t,y):!0),c=typeof e.additionalProperties=="object"?Object.entries(r).every(([h,y])=>s.test(h)?!0:ys(e.additionalProperties,t,y)):!0,p=e.additionalProperties===!1?Object.getOwnPropertyNames(r).every(h=>s.test(h)):!0;return l&&c&&p}o(JIe,"FromRecord");function QIe(e,t,r){return ys(cn(e,t),t,r)}o(QIe,"FromRef");function e2e(e,t,r){let n=new RegExp(e.source,e.flags);return Ur(e.minLength)&&!(r.length>=e.minLength)||Ur(e.maxLength)&&!(r.length<=e.maxLength)?!1:n.test(r)}o(e2e,"FromRegExp");function t2e(e,t,r){return!Qr(r)||Ur(e.minLength)&&!(r.length>=e.minLength)||Ur(e.maxLength)&&!(r.length<=e.maxLength)||Ur(e.pattern)&&!new RegExp(e.pattern).test(r)?!1:Ur(e.format)?ma.Has(e.format)?ma.Get(e.format)(r):!1:!0}o(t2e,"FromString");function r2e(e,t,r){return If(r)}o(r2e,"FromSymbol");function n2e(e,t,r){return Qr(r)&&new RegExp(e.pattern).test(r)}o(n2e,"FromTemplateLiteral");function i2e(e,t,r){return ys(cn(e,t),t,r)}o(i2e,"FromThis");function o2e(e,t,r){if(!Bt(r)||e.items===void 0&&r.length!==0||r.length!==e.maxItems)return!1;if(!e.items)return!0;for(let n=0;n<e.items.length;n++)if(!ys(e.items[n],t,r[n]))return!1;return!0}o(o2e,"FromTuple");function s2e(e,t,r){return Ai(r)}o(s2e,"FromUndefined");function a2e(e,t,r){return e.anyOf.some(n=>ys(n,t,r))}o(a2e,"FromUnion");function l2e(e,t,r){return!(!o1(r)||Ur(e.maxByteLength)&&!(r.length<=e.maxByteLength)||Ur(e.minByteLength)&&!(r.length>=e.minByteLength))}o(l2e,"FromUint8Array");function u2e(e,t,r){return!0}o(u2e,"FromUnknown");function c2e(e,t,r){return Mn.IsVoidLike(r)}o(c2e,"FromVoid");function p2e(e,t,r){return Mo.Has(e[ve])?Mo.Get(e[ve])(e,r):!1}o(p2e,"FromKind");function ys(e,t,r){let n=Ur(e.$id)?[...t,e]:t,i=e;switch(i[ve]){case"Any":return FIe(i,n,r);case"Array":return NIe(i,n,r);case"AsyncIterator":return kIe(i,n,r);case"BigInt":return RIe(i,n,r);case"Boolean":return BIe(i,n,r);case"Constructor":return $Ie(i,n,r);case"Date":return jIe(i,n,r);case"Function":return GIe(i,n,r);case"Integer":return UIe(i,n,r);case"Intersect":return VIe(i,n,r);case"Iterator":return zIe(i,n,r);case"Literal":return qIe(i,n,r);case"Never":return HIe(i,n,r);case"Not":return WIe(i,n,r);case"Null":return XIe(i,n,r);case"Number":return YIe(i,n,r);case"Object":return ZIe(i,n,r);case"Promise":return KIe(i,n,r);case"Record":return JIe(i,n,r);case"Ref":return QIe(i,n,r);case"RegExp":return e2e(i,n,r);case"String":return t2e(i,n,r);case"Symbol":return r2e(i,n,r);case"TemplateLiteral":return n2e(i,n,r);case"This":return i2e(i,n,r);case"Tuple":return o2e(i,n,r);case"Undefined":return s2e(i,n,r);case"Union":return a2e(i,n,r);case"Uint8Array":return l2e(i,n,r);case"Unknown":return u2e(i,n,r);case"Void":return c2e(i,n,r);default:if(!Mo.Has(i[ve]))throw new AL(i);return p2e(i,n,r)}}o(ys,"Visit");function Jt(...e){return e.length===3?ys(e[0],e[1],e[2]):ys(e[0],[],e[1])}o(Jt,"Check");var be;(function(e){e[e.ArrayContains=0]="ArrayContains",e[e.ArrayMaxContains=1]="ArrayMaxContains",e[e.ArrayMaxItems=2]="ArrayMaxItems",e[e.ArrayMinContains=3]="ArrayMinContains",e[e.ArrayMinItems=4]="ArrayMinItems",e[e.ArrayUniqueItems=5]="ArrayUniqueItems",e[e.Array=6]="Array",e[e.AsyncIterator=7]="AsyncIterator",e[e.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",e[e.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",e[e.BigIntMaximum=10]="BigIntMaximum",e[e.BigIntMinimum=11]="BigIntMinimum",e[e.BigIntMultipleOf=12]="BigIntMultipleOf",e[e.BigInt=13]="BigInt",e[e.Boolean=14]="Boolean",e[e.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",e[e.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",e[e.DateMaximumTimestamp=17]="DateMaximumTimestamp",e[e.DateMinimumTimestamp=18]="DateMinimumTimestamp",e[e.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",e[e.Date=20]="Date",e[e.Function=21]="Function",e[e.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",e[e.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",e[e.IntegerMaximum=24]="IntegerMaximum",e[e.IntegerMinimum=25]="IntegerMinimum",e[e.IntegerMultipleOf=26]="IntegerMultipleOf",e[e.Integer=27]="Integer",e[e.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",e[e.Intersect=29]="Intersect",e[e.Iterator=30]="Iterator",e[e.Kind=31]="Kind",e[e.Literal=32]="Literal",e[e.Never=33]="Never",e[e.Not=34]="Not",e[e.Null=35]="Null",e[e.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",e[e.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",e[e.NumberMaximum=38]="NumberMaximum",e[e.NumberMinimum=39]="NumberMinimum",e[e.NumberMultipleOf=40]="NumberMultipleOf",e[e.Number=41]="Number",e[e.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",e[e.ObjectMaxProperties=43]="ObjectMaxProperties",e[e.ObjectMinProperties=44]="ObjectMinProperties",e[e.ObjectRequiredProperty=45]="ObjectRequiredProperty",e[e.Object=46]="Object",e[e.Promise=47]="Promise",e[e.RegExp=48]="RegExp",e[e.StringFormatUnknown=49]="StringFormatUnknown",e[e.StringFormat=50]="StringFormat",e[e.StringMaxLength=51]="StringMaxLength",e[e.StringMinLength=52]="StringMinLength",e[e.StringPattern=53]="StringPattern",e[e.String=54]="String",e[e.Symbol=55]="Symbol",e[e.TupleLength=56]="TupleLength",e[e.Tuple=57]="Tuple",e[e.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",e[e.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",e[e.Uint8Array=60]="Uint8Array",e[e.Undefined=61]="Undefined",e[e.Union=62]="Union",e[e.Void=63]="Void"})(be||(be={}));var NL=class NL extends Mt{constructor(t){super("Unknown type"),this.schema=t}};o(NL,"ValueErrorsUnknownTypeError");var FL=NL;function Af(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}o(Af,"EscapeKey");function Vr(e){return e!==void 0}o(Vr,"IsDefined");var kL=class kL{constructor(t){this.iterator=t}[Symbol.iterator](){return this.iterator}First(){let t=this.iterator.next();return t.done?void 0:t.value}};o(kL,"ValueErrorIterator");var Kl=kL;function tt(e,t,r,n,i=[]){return{type:e,schema:t,path:r,value:n,message:fJ()({errorType:e,path:r,schema:t,value:n,errors:i}),errors:i}}o(tt,"Create");function*f2e(e,t,r,n){}o(f2e,"FromAny");function*d2e(e,t,r,n){if(!Bt(n))return yield tt(be.Array,e,r,n);Vr(e.minItems)&&!(n.length>=e.minItems)&&(yield tt(be.ArrayMinItems,e,r,n)),Vr(e.maxItems)&&!(n.length<=e.maxItems)&&(yield tt(be.ArrayMaxItems,e,r,n));for(let l=0;l<n.length;l++)yield*Ve(vs(e.items,t,"".concat(r,"/").concat(l),n[l]));if(e.uniqueItems===!0&&!function(){let l=new Set;for(let c of n){let p=ch(c);if(l.has(p))return!1;l.add(p)}return!0}()&&(yield tt(be.ArrayUniqueItems,e,r,n)),!(Vr(e.contains)||Vr(e.minContains)||Vr(e.maxContains)))return;let i=Vr(e.contains)?e.contains:Nn(),s=n.reduce((l,c,p)=>vs(i,t,"".concat(r).concat(p),c).next().done===!0?l+1:l,0);s===0&&(yield tt(be.ArrayContains,e,r,n)),_t(e.minContains)&&s<e.minContains&&(yield tt(be.ArrayMinContains,e,r,n)),_t(e.maxContains)&&s>e.maxContains&&(yield tt(be.ArrayMaxContains,e,r,n))}o(d2e,"FromArray");function*h2e(e,t,r,n){pw(n)||(yield tt(be.AsyncIterator,e,r,n))}o(h2e,"FromAsyncIterator");function*m2e(e,t,r,n){if(!hs(n))return yield tt(be.BigInt,e,r,n);Vr(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield tt(be.BigIntExclusiveMaximum,e,r,n)),Vr(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield tt(be.BigIntExclusiveMinimum,e,r,n)),Vr(e.maximum)&&!(n<=e.maximum)&&(yield tt(be.BigIntMaximum,e,r,n)),Vr(e.minimum)&&!(n>=e.minimum)&&(yield tt(be.BigIntMinimum,e,r,n)),Vr(e.multipleOf)&&n%e.multipleOf!==BigInt(0)&&(yield tt(be.BigIntMultipleOf,e,r,n))}o(m2e,"FromBigInt");function*g2e(e,t,r,n){Jc(n)||(yield tt(be.Boolean,e,r,n))}o(g2e,"FromBoolean");function*y2e(e,t,r,n){yield*Ve(vs(e.returns,t,r,n.prototype))}o(y2e,"FromConstructor");function*v2e(e,t,r,n){if(!da(n))return yield tt(be.Date,e,r,n);Vr(e.exclusiveMaximumTimestamp)&&!(n.getTime()<e.exclusiveMaximumTimestamp)&&(yield tt(be.DateExclusiveMaximumTimestamp,e,r,n)),Vr(e.exclusiveMinimumTimestamp)&&!(n.getTime()>e.exclusiveMinimumTimestamp)&&(yield tt(be.DateExclusiveMinimumTimestamp,e,r,n)),Vr(e.maximumTimestamp)&&!(n.getTime()<=e.maximumTimestamp)&&(yield tt(be.DateMaximumTimestamp,e,r,n)),Vr(e.minimumTimestamp)&&!(n.getTime()>=e.minimumTimestamp)&&(yield tt(be.DateMinimumTimestamp,e,r,n)),Vr(e.multipleOfTimestamp)&&n.getTime()%e.multipleOfTimestamp!==0&&(yield tt(be.DateMultipleOfTimestamp,e,r,n))}o(v2e,"FromDate");function*b2e(e,t,r,n){rh(n)||(yield tt(be.Function,e,r,n))}o(b2e,"FromFunction");function*x2e(e,t,r,n){if(!hw(n))return yield tt(be.Integer,e,r,n);Vr(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield tt(be.IntegerExclusiveMaximum,e,r,n)),Vr(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield tt(be.IntegerExclusiveMinimum,e,r,n)),Vr(e.maximum)&&!(n<=e.maximum)&&(yield tt(be.IntegerMaximum,e,r,n)),Vr(e.minimum)&&!(n>=e.minimum)&&(yield tt(be.IntegerMinimum,e,r,n)),Vr(e.multipleOf)&&n%e.multipleOf!==0&&(yield tt(be.IntegerMultipleOf,e,r,n))}o(x2e,"FromInteger");function*I2e(e,t,r,n){let i=!1;for(let s of e.allOf)for(let l of vs(s,t,r,n))i=!0,yield l;if(i)return yield tt(be.Intersect,e,r,n);if(e.unevaluatedProperties===!1){let s=new RegExp(Ef(e));for(let l of Object.getOwnPropertyNames(n))s.test(l)||(yield tt(be.IntersectUnevaluatedProperties,e,"".concat(r,"/").concat(l),n))}if(typeof e.unevaluatedProperties=="object"){let s=new RegExp(Ef(e));for(let l of Object.getOwnPropertyNames(n))if(!s.test(l)){let c=vs(e.unevaluatedProperties,t,"".concat(r,"/").concat(l),n[l]).next();c.done||(yield c.value)}}}o(I2e,"FromIntersect");function*_2e(e,t,r,n){fw(n)||(yield tt(be.Iterator,e,r,n))}o(_2e,"FromIterator");function*S2e(e,t,r,n){n!==e.const&&(yield tt(be.Literal,e,r,n))}o(S2e,"FromLiteral");function*C2e(e,t,r,n){yield tt(be.Never,e,r,n)}o(C2e,"FromNever");function*w2e(e,t,r,n){vs(e.not,t,r,n).next().done===!0&&(yield tt(be.Not,e,r,n))}o(w2e,"FromNot");function*P2e(e,t,r,n){xf(n)||(yield tt(be.Null,e,r,n))}o(P2e,"FromNull");function*T2e(e,t,r,n){if(!Mn.IsNumberLike(n))return yield tt(be.Number,e,r,n);Vr(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)&&(yield tt(be.NumberExclusiveMaximum,e,r,n)),Vr(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)&&(yield tt(be.NumberExclusiveMinimum,e,r,n)),Vr(e.maximum)&&!(n<=e.maximum)&&(yield tt(be.NumberMaximum,e,r,n)),Vr(e.minimum)&&!(n>=e.minimum)&&(yield tt(be.NumberMinimum,e,r,n)),Vr(e.multipleOf)&&n%e.multipleOf!==0&&(yield tt(be.NumberMultipleOf,e,r,n))}o(T2e,"FromNumber");function*E2e(e,t,r,n){if(!Mn.IsObjectLike(n))return yield tt(be.Object,e,r,n);Vr(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)&&(yield tt(be.ObjectMinProperties,e,r,n)),Vr(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties)&&(yield tt(be.ObjectMaxProperties,e,r,n));let i=Array.isArray(e.required)?e.required:[],s=Object.getOwnPropertyNames(e.properties),l=Object.getOwnPropertyNames(n);for(let c of i)l.includes(c)||(yield tt(be.ObjectRequiredProperty,e.properties[c],"".concat(r,"/").concat(Af(c)),void 0));if(e.additionalProperties===!1)for(let c of l)s.includes(c)||(yield tt(be.ObjectAdditionalProperties,e,"".concat(r,"/").concat(Af(c)),n[c]));if(typeof e.additionalProperties=="object")for(let c of l)s.includes(c)||(yield*Ve(vs(e.additionalProperties,t,"".concat(r,"/").concat(Af(c)),n[c])));for(let c of s){let p=e.properties[c];e.required&&e.required.includes(c)?(yield*Ve(vs(p,t,"".concat(r,"/").concat(Af(c)),n[c])),Of(e)&&!(c in n)&&(yield tt(be.ObjectRequiredProperty,p,"".concat(r,"/").concat(Af(c)),void 0))):Mn.IsExactOptionalProperty(n,c)&&(yield*Ve(vs(p,t,"".concat(r,"/").concat(Af(c)),n[c])))}}o(E2e,"FromObject");function*M2e(e,t,r,n){dw(n)||(yield tt(be.Promise,e,r,n))}o(M2e,"FromPromise");function*O2e(e,t,r,n){if(!Mn.IsRecordLike(n))return yield tt(be.Object,e,r,n);Vr(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)&&(yield tt(be.ObjectMinProperties,e,r,n)),Vr(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties)&&(yield tt(be.ObjectMaxProperties,e,r,n));let[i,s]=Object.entries(e.patternProperties)[0],l=new RegExp(i);for(let[c,p]of Object.entries(n))l.test(c)&&(yield*Ve(vs(s,t,"".concat(r,"/").concat(Af(c)),p)));if(typeof e.additionalProperties=="object")for(let[c,p]of Object.entries(n))l.test(c)||(yield*Ve(vs(e.additionalProperties,t,"".concat(r,"/").concat(Af(c)),p)));if(e.additionalProperties===!1){for(let[c,p]of Object.entries(n))if(!l.test(c))return yield tt(be.ObjectAdditionalProperties,e,"".concat(r,"/").concat(Af(c)),p)}}o(O2e,"FromRecord");function*L2e(e,t,r,n){yield*Ve(vs(cn(e,t),t,r,n))}o(L2e,"FromRef");function*A2e(e,t,r,n){if(!Qr(n))return yield tt(be.String,e,r,n);if(Vr(e.minLength)&&!(n.length>=e.minLength)&&(yield tt(be.StringMinLength,e,r,n)),Vr(e.maxLength)&&!(n.length<=e.maxLength)&&(yield tt(be.StringMaxLength,e,r,n)),!new RegExp(e.source,e.flags).test(n))return yield tt(be.RegExp,e,r,n)}o(A2e,"FromRegExp");function*D2e(e,t,r,n){if(!Qr(n))return yield tt(be.String,e,r,n);Vr(e.minLength)&&!(n.length>=e.minLength)&&(yield tt(be.StringMinLength,e,r,n)),Vr(e.maxLength)&&!(n.length<=e.maxLength)&&(yield tt(be.StringMaxLength,e,r,n)),Qr(e.pattern)&&(new RegExp(e.pattern).test(n)||(yield tt(be.StringPattern,e,r,n))),Qr(e.format)&&(ma.Has(e.format)?ma.Get(e.format)(n)||(yield tt(be.StringFormat,e,r,n)):yield tt(be.StringFormatUnknown,e,r,n))}o(D2e,"FromString");function*F2e(e,t,r,n){If(n)||(yield tt(be.Symbol,e,r,n))}o(F2e,"FromSymbol");function*N2e(e,t,r,n){if(!Qr(n))return yield tt(be.String,e,r,n);new RegExp(e.pattern).test(n)||(yield tt(be.StringPattern,e,r,n))}o(N2e,"FromTemplateLiteral");function*k2e(e,t,r,n){yield*Ve(vs(cn(e,t),t,r,n))}o(k2e,"FromThis");function*R2e(e,t,r,n){if(!Bt(n))return yield tt(be.Tuple,e,r,n);if(e.items===void 0&&n.length!==0)return yield tt(be.TupleLength,e,r,n);if(n.length!==e.maxItems)return yield tt(be.TupleLength,e,r,n);if(e.items)for(let i=0;i<e.items.length;i++)yield*Ve(vs(e.items[i],t,"".concat(r,"/").concat(i),n[i]))}o(R2e,"FromTuple");function*B2e(e,t,r,n){Ai(n)||(yield tt(be.Undefined,e,r,n))}o(B2e,"FromUndefined");function*$2e(e,t,r,n){if(Jt(e,t,n))return;let i=e.anyOf.map(s=>new Kl(vs(s,t,r,n)));yield tt(be.Union,e,r,n,i)}o($2e,"FromUnion");function*j2e(e,t,r,n){if(!o1(n))return yield tt(be.Uint8Array,e,r,n);Vr(e.maxByteLength)&&!(n.length<=e.maxByteLength)&&(yield tt(be.Uint8ArrayMaxByteLength,e,r,n)),Vr(e.minByteLength)&&!(n.length>=e.minByteLength)&&(yield tt(be.Uint8ArrayMinByteLength,e,r,n))}o(j2e,"FromUint8Array");function*G2e(e,t,r,n){}o(G2e,"FromUnknown");function*U2e(e,t,r,n){Mn.IsVoidLike(n)||(yield tt(be.Void,e,r,n))}o(U2e,"FromVoid");function*V2e(e,t,r,n){Mo.Get(e[ve])(e,n)||(yield tt(be.Kind,e,r,n))}o(V2e,"FromKind");function*vs(e,t,r,n){let i=Vr(e.$id)?[...t,e]:t,s=e;switch(s[ve]){case"Any":return yield*Ve(f2e(s,i,r,n));case"Array":return yield*Ve(d2e(s,i,r,n));case"AsyncIterator":return yield*Ve(h2e(s,i,r,n));case"BigInt":return yield*Ve(m2e(s,i,r,n));case"Boolean":return yield*Ve(g2e(s,i,r,n));case"Constructor":return yield*Ve(y2e(s,i,r,n));case"Date":return yield*Ve(v2e(s,i,r,n));case"Function":return yield*Ve(b2e(s,i,r,n));case"Integer":return yield*Ve(x2e(s,i,r,n));case"Intersect":return yield*Ve(I2e(s,i,r,n));case"Iterator":return yield*Ve(_2e(s,i,r,n));case"Literal":return yield*Ve(S2e(s,i,r,n));case"Never":return yield*Ve(C2e(s,i,r,n));case"Not":return yield*Ve(w2e(s,i,r,n));case"Null":return yield*Ve(P2e(s,i,r,n));case"Number":return yield*Ve(T2e(s,i,r,n));case"Object":return yield*Ve(E2e(s,i,r,n));case"Promise":return yield*Ve(M2e(s,i,r,n));case"Record":return yield*Ve(O2e(s,i,r,n));case"Ref":return yield*Ve(L2e(s,i,r,n));case"RegExp":return yield*Ve(A2e(s,i,r,n));case"String":return yield*Ve(D2e(s,i,r,n));case"Symbol":return yield*Ve(F2e(s,i,r,n));case"TemplateLiteral":return yield*Ve(N2e(s,i,r,n));case"This":return yield*Ve(k2e(s,i,r,n));case"Tuple":return yield*Ve(R2e(s,i,r,n));case"Undefined":return yield*Ve(B2e(s,i,r,n));case"Union":return yield*Ve($2e(s,i,r,n));case"Uint8Array":return yield*Ve(j2e(s,i,r,n));case"Unknown":return yield*Ve(G2e(s,i,r,n));case"Void":return yield*Ve(U2e(s,i,r,n));default:if(!Mo.Has(s[ve]))throw new FL(e);return yield*Ve(V2e(s,i,r,n))}}o(vs,"Visit");function ip(...e){let t=e.length===3?vs(e[0],e[1],"",e[2]):vs(e[0],[],"",e[1]);return new Kl(t)}o(ip,"Errors");g();var z2e=function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},yJ=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},RL,Ww,vJ,$L=class $L extends Mt{constructor(t){let r=t.First();super(r===void 0?"Invalid Value":r.message),RL.add(this),Ww.set(this,void 0),z2e(this,Ww,t,"f"),this.error=r}Errors(){return new Kl(yJ(this,RL,"m",vJ).call(this))}};o($L,"AssertError");var BL=$L;Ww=new WeakMap,RL=new WeakSet,vJ=o(function*(){this.error&&(yield this.error),yield*Ve(yJ(this,Ww,"f"))},"_AssertError_Iterator");function gJ(e,t,r){if(!Jt(e,t,r))throw new BL(ip(e,t,r))}o(gJ,"AssertValue");function Xw(...e){return e.length===3?gJ(e[0],e[1],e[2]):gJ(e[0],[],e[1])}o(Xw,"Assert");g();g();g();function q2e(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=pn(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=pn(e[r]);return t}o(q2e,"FromObject");function H2e(e){return e.map(t=>pn(t))}o(H2e,"FromArray");function W2e(e){return e.slice()}o(W2e,"FromTypedArray");function X2e(e){return new Map(pn([...e.entries()]))}o(X2e,"FromMap");function Y2e(e){return new Set(pn([...e.entries()]))}o(Y2e,"FromSet");function Z2e(e){return new Date(e.toISOString())}o(Z2e,"FromDate");function pn(e){if(Bt(e))return H2e(e);if(da(e))return Z2e(e);if(Ul(e))return W2e(e);if(RY(e))return X2e(e);if(BY(e))return Y2e(e);if(Ut(e))return q2e(e);if(ms(e))return e;throw new Error("ValueClone: Unable to clone value")}o(pn,"Clone");var jL=class jL extends Mt{constructor(t,r){super(r),this.schema=t}};o(jL,"ValueCreateError");var pl=jL;function fn(e){return rh(e)?e():pn(e)}o(fn,"FromDefault");function K2e(e,t){return At(e,"default")?fn(e.default):{}}o(K2e,"FromAny");function J2e(e,t){if(e.uniqueItems===!0&&!At(e,"default"))throw new pl(e,"Array with the uniqueItems constraint requires a default value");if("contains"in e&&!At(e,"default"))throw new pl(e,"Array with the contains constraint requires a default value");return"default"in e?fn(e.default):e.minItems!==void 0?Array.from({length:e.minItems}).map(r=>fl(e.items,t)):[]}o(J2e,"FromArray");function Q2e(e,t){return At(e,"default")?fn(e.default):function(){return pN(this,null,function*(){})}()}o(Q2e,"FromAsyncIterator");function e_e(e,t){return At(e,"default")?fn(e.default):BigInt(0)}o(e_e,"FromBigInt");function t_e(e,t){return At(e,"default")?fn(e.default):!1}o(t_e,"FromBoolean");function r_e(e,t){if(At(e,"default"))return fn(e.default);{let r=fl(e.returns,t);return typeof r=="object"&&!Array.isArray(r)?class{constructor(){for(let[n,i]of Object.entries(r)){let s=this;s[n]=i}}}:class{}}}o(r_e,"FromConstructor");function n_e(e,t){return At(e,"default")?fn(e.default):e.minimumTimestamp!==void 0?new Date(e.minimumTimestamp):new Date}o(n_e,"FromDate");function i_e(e,t){return At(e,"default")?fn(e.default):()=>fl(e.returns,t)}o(i_e,"FromFunction");function o_e(e,t){return At(e,"default")?fn(e.default):e.minimum!==void 0?e.minimum:0}o(o_e,"FromInteger");function s_e(e,t){if(At(e,"default"))return fn(e.default);{let r=e.allOf.reduce((n,i)=>{let s=fl(i,t);return typeof s=="object"?k(k({},n),s):s},{});if(!Jt(e,t,r))throw new pl(e,"Intersect produced invalid value. Consider using a default value.");return r}}o(s_e,"FromIntersect");function a_e(e,t){return At(e,"default")?fn(e.default):function*(){}()}o(a_e,"FromIterator");function l_e(e,t){return At(e,"default")?fn(e.default):e.const}o(l_e,"FromLiteral");function u_e(e,t){if(At(e,"default"))return fn(e.default);throw new pl(e,"Never types cannot be created. Consider using a default value.")}o(u_e,"FromNever");function c_e(e,t){if(At(e,"default"))return fn(e.default);throw new pl(e,"Not types must have a default value")}o(c_e,"FromNot");function p_e(e,t){return At(e,"default")?fn(e.default):null}o(p_e,"FromNull");function f_e(e,t){return At(e,"default")?fn(e.default):e.minimum!==void 0?e.minimum:0}o(f_e,"FromNumber");function d_e(e,t){if(At(e,"default"))return fn(e.default);{let r=new Set(e.required),n={};for(let[i,s]of Object.entries(e.properties))r.has(i)&&(n[i]=fl(s,t));return n}}o(d_e,"FromObject");function h_e(e,t){return At(e,"default")?fn(e.default):Promise.resolve(fl(e.item,t))}o(h_e,"FromPromise");function m_e(e,t){let[r,n]=Object.entries(e.patternProperties)[0];if(At(e,"default"))return fn(e.default);if(r===Pf||r===wf)return{};{let i=r.slice(1,r.length-1).split("|"),s={};for(let l of i)s[l]=fl(n,t);return s}}o(m_e,"FromRecord");function g_e(e,t){return At(e,"default")?fn(e.default):fl(cn(e,t),t)}o(g_e,"FromRef");function y_e(e,t){if(At(e,"default"))return fn(e.default);throw new pl(e,"RegExp types cannot be created. Consider using a default value.")}o(y_e,"FromRegExp");function v_e(e,t){if(e.pattern!==void 0){if(At(e,"default"))return fn(e.default);throw new pl(e,"String types with patterns must specify a default value")}else if(e.format!==void 0){if(At(e,"default"))return fn(e.default);throw new pl(e,"String types with formats must specify a default value")}else return At(e,"default")?fn(e.default):e.minLength!==void 0?Array.from({length:e.minLength}).map(()=>" ").join(""):""}o(v_e,"FromString");function b_e(e,t){return At(e,"default")?fn(e.default):"value"in e?Symbol.for(e.value):Symbol()}o(b_e,"FromSymbol");function x_e(e,t){if(At(e,"default"))return fn(e.default);if(!bw(e))throw new pl(e,"Can only create template literals that produce a finite variants. Consider using a default value.");return f1(e)[0]}o(x_e,"FromTemplateLiteral");function I_e(e,t){if(bJ++>M_e)throw new pl(e,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return At(e,"default")?fn(e.default):fl(cn(e,t),t)}o(I_e,"FromThis");function __e(e,t){return At(e,"default")?fn(e.default):e.items===void 0?[]:Array.from({length:e.minItems}).map((r,n)=>fl(e.items[n],t))}o(__e,"FromTuple");function S_e(e,t){if(At(e,"default"))return fn(e.default)}o(S_e,"FromUndefined");function C_e(e,t){if(At(e,"default"))return fn(e.default);if(e.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return fl(e.anyOf[0],t)}o(C_e,"FromUnion");function w_e(e,t){return At(e,"default")?fn(e.default):e.minByteLength!==void 0?new Uint8Array(e.minByteLength):new Uint8Array(0)}o(w_e,"FromUint8Array");function P_e(e,t){return At(e,"default")?fn(e.default):{}}o(P_e,"FromUnknown");function T_e(e,t){if(At(e,"default"))return fn(e.default)}o(T_e,"FromVoid");function E_e(e,t){if(At(e,"default"))return fn(e.default);throw new Error("User defined types must specify a default value")}o(E_e,"FromKind");function fl(e,t){let r=Zl(e,t),n=e;switch(n[ve]){case"Any":return K2e(n,r);case"Array":return J2e(n,r);case"AsyncIterator":return Q2e(n,r);case"BigInt":return e_e(n,r);case"Boolean":return t_e(n,r);case"Constructor":return r_e(n,r);case"Date":return n_e(n,r);case"Function":return i_e(n,r);case"Integer":return o_e(n,r);case"Intersect":return s_e(n,r);case"Iterator":return a_e(n,r);case"Literal":return l_e(n,r);case"Never":return u_e(n,r);case"Not":return c_e(n,r);case"Null":return p_e(n,r);case"Number":return f_e(n,r);case"Object":return d_e(n,r);case"Promise":return h_e(n,r);case"Record":return m_e(n,r);case"Ref":return g_e(n,r);case"RegExp":return y_e(n,r);case"String":return v_e(n,r);case"Symbol":return b_e(n,r);case"TemplateLiteral":return x_e(n,r);case"This":return I_e(n,r);case"Tuple":return __e(n,r);case"Undefined":return S_e(n,r);case"Union":return C_e(n,r);case"Uint8Array":return w_e(n,r);case"Unknown":return P_e(n,r);case"Void":return T_e(n,r);default:if(!Mo.Has(n[ve]))throw new pl(n,"Unknown type");return E_e(n,r)}}o(fl,"Visit");var M_e=512,bJ=0;function Jl(...e){return bJ=0,e.length===2?fl(e[0],e[1]):fl(e[0],[])}o(Jl,"Create");var UL=class UL extends Mt{constructor(t,r){super(r),this.schema=t}};o(UL,"ValueCastError");var Yw=UL;function O_e(e,t,r){if(e[ve]==="Object"&&typeof r=="object"&&!xf(r)){let n=e,i=Object.getOwnPropertyNames(r),s=Object.entries(n.properties),[l,c]=[1/s.length,s.length];return s.reduce((p,[h,y])=>{let b=y[ve]==="Literal"&&y.const===r[h]?c:0,_=Jt(y,t,r[h])?l:0,C=i.includes(h)?l:0;return p+(b+_+C)},0)}else return Jt(e,t,r)?1:0}o(O_e,"ScoreUnion");function L_e(e,t,r){let n=e.anyOf.map(l=>cn(l,t)),[i,s]=[n[0],0];for(let l of n){let c=O_e(l,t,r);c>s&&(i=l,s=c)}return i}o(L_e,"SelectUnion");function A_e(e,t,r){if("default"in e)return typeof r=="function"?e.default:pn(e.default);{let n=L_e(e,t,r);return GL(n,t,r)}}o(A_e,"CastUnion");function D_e(e,t,r){return Jt(e,t,r)?pn(r):Jl(e,t)}o(D_e,"DefaultClone");function F_e(e,t,r){return Jt(e,t,r)?r:Jl(e,t)}o(F_e,"Default");function N_e(e,t,r){if(Jt(e,t,r))return pn(r);let n=Bt(r)?pn(r):Jl(e,t),i=_t(e.minItems)&&n.length<e.minItems?[...n,...Array.from({length:e.minItems-n.length},()=>null)]:n,l=(_t(e.maxItems)&&i.length>e.maxItems?i.slice(0,e.maxItems):i).map(p=>op(e.items,t,p));if(e.uniqueItems!==!0)return l;let c=[...new Set(l)];if(!Jt(e,t,c))throw new Yw(e,"Array cast produced invalid data due to uniqueItems constraint");return c}o(N_e,"FromArray");function k_e(e,t,r){if(Jt(e,t,r))return Jl(e,t);let n=new Set(e.returns.required||[]),i=o(function(){},"result");for(let[s,l]of Object.entries(e.returns.properties))!n.has(s)&&r.prototype[s]===void 0||(i.prototype[s]=op(l,t,r.prototype[s]));return i}o(k_e,"FromConstructor");function R_e(e,t,r){let n=Jl(e,t),i=Ut(n)&&Ut(r)?k(k({},n),r):r;return Jt(e,t,i)?i:Jl(e,t)}o(R_e,"FromIntersect");function B_e(e,t,r){throw new Yw(e,"Never types cannot be cast")}o(B_e,"FromNever");function $_e(e,t,r){if(Jt(e,t,r))return r;if(r===null||typeof r!="object")return Jl(e,t);let n=new Set(e.required||[]),i={};for(let[s,l]of Object.entries(e.properties))!n.has(s)&&r[s]===void 0||(i[s]=op(l,t,r[s]));if(typeof e.additionalProperties=="object"){let s=Object.getOwnPropertyNames(e.properties);for(let l of Object.getOwnPropertyNames(r))s.includes(l)||(i[l]=op(e.additionalProperties,t,r[l]))}return i}o($_e,"FromObject");function j_e(e,t,r){if(Jt(e,t,r))return pn(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return Jl(e,t);let n=Object.getOwnPropertyNames(e.patternProperties)[0],i=e.patternProperties[n],s={};for(let[l,c]of Object.entries(r))s[l]=op(i,t,c);return s}o(j_e,"FromRecord");function G_e(e,t,r){return op(cn(e,t),t,r)}o(G_e,"FromRef");function U_e(e,t,r){return op(cn(e,t),t,r)}o(U_e,"FromThis");function V_e(e,t,r){return Jt(e,t,r)?pn(r):Bt(r)?e.items===void 0?[]:e.items.map((n,i)=>op(n,t,r[i])):Jl(e,t)}o(V_e,"FromTuple");function z_e(e,t,r){return Jt(e,t,r)?pn(r):A_e(e,t,r)}o(z_e,"FromUnion");function op(e,t,r){let n=Qr(e.$id)?[...t,e]:t,i=e;switch(e[ve]){case"Array":return N_e(i,n,r);case"Constructor":return k_e(i,n,r);case"Intersect":return R_e(i,n,r);case"Never":return B_e(i,n,r);case"Object":return $_e(i,n,r);case"Record":return j_e(i,n,r);case"Ref":return G_e(i,n,r);case"This":return U_e(i,n,r);case"Tuple":return V_e(i,n,r);case"Union":return z_e(i,n,r);case"Date":case"Symbol":case"Uint8Array":return D_e(e,t,r);default:return F_e(i,n,r)}}o(op,"Visit");function GL(...e){return e.length===3?op(e[0],e[1],e[2]):op(e[0],[],e[1])}o(GL,"Cast");g();function q_e(e){return ih(e)&&e[ve]!=="Unsafe"}o(q_e,"IsCheckable");function H_e(e,t,r){return Bt(r)?r.map(n=>dl(e.items,t,n)):r}o(H_e,"FromArray");function W_e(e,t,r){let n=e.unevaluatedProperties,s=e.allOf.map(c=>dl(c,t,pn(r))).reduce((c,p)=>Ut(p)?k(k({},c),p):p,{});if(!Ut(r)||!Ut(s)||!ih(n))return s;let l=Yo(e);for(let c of Object.getOwnPropertyNames(r))l.includes(c)||Jt(n,t,r[c])&&(s[c]=dl(n,t,r[c]));return s}o(W_e,"FromIntersect");function X_e(e,t,r){if(!Ut(r)||Bt(r))return r;let n=e.additionalProperties;for(let i of Object.getOwnPropertyNames(r)){if(At(e.properties,i)){r[i]=dl(e.properties[i],t,r[i]);continue}if(ih(n)&&Jt(n,t,r[i])){r[i]=dl(n,t,r[i]);continue}delete r[i]}return r}o(X_e,"FromObject");function Y_e(e,t,r){if(!Ut(r))return r;let n=e.additionalProperties,i=Object.getOwnPropertyNames(r),[s,l]=Object.entries(e.patternProperties)[0],c=new RegExp(s);for(let p of i){if(c.test(p)){r[p]=dl(l,t,r[p]);continue}if(ih(n)&&Jt(n,t,r[p])){r[p]=dl(n,t,r[p]);continue}delete r[p]}return r}o(Y_e,"FromRecord");function Z_e(e,t,r){return dl(cn(e,t),t,r)}o(Z_e,"FromRef");function K_e(e,t,r){return dl(cn(e,t),t,r)}o(K_e,"FromThis");function J_e(e,t,r){if(!Bt(r))return r;if(Ai(e.items))return[];let n=Math.min(r.length,e.items.length);for(let i=0;i<n;i++)r[i]=dl(e.items[i],t,r[i]);return r.length>n?r.slice(0,n):r}o(J_e,"FromTuple");function Q_e(e,t,r){for(let n of e.anyOf)if(q_e(n)&&Jt(n,t,r))return dl(n,t,r);return r}o(Q_e,"FromUnion");function dl(e,t,r){let n=Qr(e.$id)?[...t,e]:t,i=e;switch(i[ve]){case"Array":return H_e(i,n,r);case"Intersect":return W_e(i,n,r);case"Object":return X_e(i,n,r);case"Record":return Y_e(i,n,r);case"Ref":return Z_e(i,n,r);case"This":return K_e(i,n,r);case"Tuple":return J_e(i,n,r);case"Union":return Q_e(i,n,r);default:return r}}o(dl,"Visit");function Zw(...e){return e.length===3?dl(e[0],e[1],e[2]):dl(e[0],[],e[1])}o(Zw,"Clean");g();function Kw(e){return Qr(e)&&!isNaN(e)&&!isNaN(parseFloat(e))}o(Kw,"IsStringNumeric");function eSe(e){return hs(e)||Jc(e)||_t(e)}o(eSe,"IsValueToString");function bI(e){return e===!0||_t(e)&&e===1||hs(e)&&e===BigInt("1")||Qr(e)&&(e.toLowerCase()==="true"||e==="1")}o(bI,"IsValueTrue");function xI(e){return e===!1||_t(e)&&(e===0||Object.is(e,-0))||hs(e)&&e===BigInt("0")||Qr(e)&&(e.toLowerCase()==="false"||e==="0"||e==="-0")}o(xI,"IsValueFalse");function tSe(e){return Qr(e)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(e)}o(tSe,"IsTimeStringWithTimeZone");function rSe(e){return Qr(e)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(e)}o(rSe,"IsTimeStringWithoutTimeZone");function nSe(e){return Qr(e)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(e)}o(nSe,"IsDateTimeStringWithTimeZone");function iSe(e){return Qr(e)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(e)}o(iSe,"IsDateTimeStringWithoutTimeZone");function oSe(e){return Qr(e)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(e)}o(oSe,"IsDateString");function sSe(e,t){let r=IJ(e);return r===t?r:e}o(sSe,"TryConvertLiteralString");function aSe(e,t){let r=_J(e);return r===t?r:e}o(aSe,"TryConvertLiteralNumber");function lSe(e,t){let r=xJ(e);return r===t?r:e}o(lSe,"TryConvertLiteralBoolean");function uSe(e,t){return Qr(e.const)?sSe(t,e.const):_t(e.const)?aSe(t,e.const):Jc(e.const)?lSe(t,e.const):t}o(uSe,"TryConvertLiteral");function xJ(e){return bI(e)?!0:xI(e)?!1:e}o(xJ,"TryConvertBoolean");function cSe(e){let t=o(r=>r.split(".")[0],"truncateInteger");return Kw(e)?BigInt(t(e)):_t(e)?BigInt(Math.trunc(e)):xI(e)?BigInt(0):bI(e)?BigInt(1):e}o(cSe,"TryConvertBigInt");function IJ(e){return eSe(e)?e.toString():If(e)&&e.description!==void 0?e.description.toString():e}o(IJ,"TryConvertString");function _J(e){return Kw(e)?parseFloat(e):bI(e)?1:xI(e)?0:e}o(_J,"TryConvertNumber");function pSe(e){return Kw(e)?parseInt(e):_t(e)?e|0:bI(e)?1:xI(e)?0:e}o(pSe,"TryConvertInteger");function fSe(e){return Qr(e)&&e.toLowerCase()==="null"?null:e}o(fSe,"TryConvertNull");function dSe(e){return Qr(e)&&e==="undefined"?void 0:e}o(dSe,"TryConvertUndefined");function hSe(e){return da(e)?e:_t(e)?new Date(e):bI(e)?new Date(1):xI(e)?new Date(0):Kw(e)?new Date(parseInt(e)):rSe(e)?new Date("1970-01-01T".concat(e,".000Z")):tSe(e)?new Date("1970-01-01T".concat(e)):iSe(e)?new Date("".concat(e,".000Z")):nSe(e)?new Date(e):oSe(e)?new Date("".concat(e,"T00:00:00.000Z")):e}o(hSe,"TryConvertDate");function mSe(e,t,r){return(Bt(r)?r:[r]).map(i=>sp(e.items,t,i))}o(mSe,"FromArray");function gSe(e,t,r){return cSe(r)}o(gSe,"FromBigInt");function ySe(e,t,r){return xJ(r)}o(ySe,"FromBoolean");function vSe(e,t,r){return hSe(r)}o(vSe,"FromDate");function bSe(e,t,r){return pSe(r)}o(bSe,"FromInteger");function xSe(e,t,r){return e.allOf.reduce((n,i)=>sp(i,t,n),r)}o(xSe,"FromIntersect");function ISe(e,t,r){return uSe(e,r)}o(ISe,"FromLiteral");function _Se(e,t,r){return fSe(r)}o(_Se,"FromNull");function SSe(e,t,r){return _J(r)}o(SSe,"FromNumber");function CSe(e,t,r){if(!Ut(r))return r;for(let n of Object.getOwnPropertyNames(e.properties))At(r,n)&&(r[n]=sp(e.properties[n],t,r[n]));return r}o(CSe,"FromObject");function wSe(e,t,r){if(!Ut(r))return r;let i=Object.getOwnPropertyNames(e.patternProperties)[0],s=e.patternProperties[i];for(let[l,c]of Object.entries(r))r[l]=sp(s,t,c);return r}o(wSe,"FromRecord");function PSe(e,t,r){return sp(cn(e,t),t,r)}o(PSe,"FromRef");function TSe(e,t,r){return IJ(r)}o(TSe,"FromString");function ESe(e,t,r){return Qr(r)||_t(r)?Symbol(r):r}o(ESe,"FromSymbol");function MSe(e,t,r){return sp(cn(e,t),t,r)}o(MSe,"FromThis");function OSe(e,t,r){return Bt(r)&&!Ai(e.items)?r.map((i,s)=>s<e.items.length?sp(e.items[s],t,i):i):r}o(OSe,"FromTuple");function LSe(e,t,r){return dSe(r)}o(LSe,"FromUndefined");function ASe(e,t,r){for(let n of e.anyOf){let i=sp(n,t,pn(r));if(Jt(n,t,i))return i}return r}o(ASe,"FromUnion");function sp(e,t,r){let n=Zl(e,t),i=e;switch(e[ve]){case"Array":return mSe(i,n,r);case"BigInt":return gSe(i,n,r);case"Boolean":return ySe(i,n,r);case"Date":return vSe(i,n,r);case"Integer":return bSe(i,n,r);case"Intersect":return xSe(i,n,r);case"Literal":return ISe(i,n,r);case"Null":return _Se(i,n,r);case"Number":return SSe(i,n,r);case"Object":return CSe(i,n,r);case"Record":return wSe(i,n,r);case"Ref":return PSe(i,n,r);case"String":return TSe(i,n,r);case"Symbol":return ESe(i,n,r);case"This":return MSe(i,n,r);case"Tuple":return OSe(i,n,r);case"Undefined":return LSe(i,n,r);case"Union":return ASe(i,n,r);default:return r}}o(sp,"Visit");function Jw(...e){return e.length===3?sp(e[0],e[1],e[2]):sp(e[0],[],e[1])}o(Jw,"Convert");g();g();var VL=class VL extends Mt{constructor(t,r,n){super("Unable to decode value as it does not match the expected schema"),this.schema=t,this.value=r,this.error=n}};o(VL,"TransformDecodeCheckError");var M1=VL,zL=class zL extends Mt{constructor(t,r,n,i){super(i instanceof Error?i.message:"Unknown error"),this.schema=t,this.path=r,this.value=n,this.error=i}};o(zL,"TransformDecodeError");var vg=zL;function Di(e,t,r){try{return ni(e)?e[hi].Decode(r):r}catch(n){throw new vg(e,t,r,n)}}o(Di,"Default");function DSe(e,t,r,n){return Bt(n)?Di(e,r,n.map((i,s)=>ap(e.items,t,"".concat(r,"/").concat(s),i))):Di(e,r,n)}o(DSe,"FromArray");function FSe(e,t,r,n){if(!Ut(n)||ms(n))return Di(e,r,n);let i=ah(e),s=i.map(y=>y[0]),l=k({},n);for(let[y,b]of i)y in l&&(l[y]=ap(b,t,"".concat(r,"/").concat(y),l[y]));if(!ni(e.unevaluatedProperties))return Di(e,r,l);let c=Object.getOwnPropertyNames(l),p=e.unevaluatedProperties,h=k({},l);for(let y of c)s.includes(y)||(h[y]=Di(p,"".concat(r,"/").concat(y),h[y]));return Di(e,r,h)}o(FSe,"FromIntersect");function NSe(e,t,r,n){return Di(e,r,ap(e.not,t,r,n))}o(NSe,"FromNot");function kSe(e,t,r,n){if(!Ut(n))return Di(e,r,n);let i=Yo(e),s=k({},n);for(let h of i)At(s,h)&&(Ai(s[h])&&(!a1(e.properties[h])||Mn.IsExactOptionalProperty(s,h))||(s[h]=ap(e.properties[h],t,"".concat(r,"/").concat(h),s[h])));if(!en(e.additionalProperties))return Di(e,r,s);let l=Object.getOwnPropertyNames(s),c=e.additionalProperties,p=k({},s);for(let h of l)i.includes(h)||(p[h]=Di(c,"".concat(r,"/").concat(h),p[h]));return Di(e,r,p)}o(kSe,"FromObject");function RSe(e,t,r,n){if(!Ut(n))return Di(e,r,n);let i=Object.getOwnPropertyNames(e.patternProperties)[0],s=new RegExp(i),l=k({},n);for(let y of Object.getOwnPropertyNames(n))s.test(y)&&(l[y]=ap(e.patternProperties[i],t,"".concat(r,"/").concat(y),l[y]));if(!en(e.additionalProperties))return Di(e,r,l);let c=Object.getOwnPropertyNames(l),p=e.additionalProperties,h=k({},l);for(let y of c)s.test(y)||(h[y]=Di(p,"".concat(r,"/").concat(y),h[y]));return Di(e,r,h)}o(RSe,"FromRecord");function BSe(e,t,r,n){let i=cn(e,t);return Di(e,r,ap(i,t,r,n))}o(BSe,"FromRef");function $Se(e,t,r,n){let i=cn(e,t);return Di(e,r,ap(i,t,r,n))}o($Se,"FromThis");function jSe(e,t,r,n){return Bt(n)&&Bt(e.items)?Di(e,r,e.items.map((i,s)=>ap(i,t,"".concat(r,"/").concat(s),n[s]))):Di(e,r,n)}o(jSe,"FromTuple");function GSe(e,t,r,n){for(let i of e.anyOf){if(!Jt(i,t,n))continue;let s=ap(i,t,r,n);return Di(e,r,s)}return Di(e,r,n)}o(GSe,"FromUnion");function ap(e,t,r,n){let i=Zl(e,t),s=e;switch(e[ve]){case"Array":return DSe(s,i,r,n);case"Intersect":return FSe(s,i,r,n);case"Not":return NSe(s,i,r,n);case"Object":return kSe(s,i,r,n);case"Record":return RSe(s,i,r,n);case"Ref":return BSe(s,i,r,n);case"Symbol":return Di(s,r,n);case"This":return $Se(s,i,r,n);case"Tuple":return jSe(s,i,r,n);case"Union":return GSe(s,i,r,n);default:return Di(s,r,n)}}o(ap,"Visit");function O1(e,t,r){return ap(e,t,"",r)}o(O1,"TransformDecode");g();var qL=class qL extends Mt{constructor(t,r,n){super("The encoded value does not match the expected schema"),this.schema=t,this.value=r,this.error=n}};o(qL,"TransformEncodeCheckError");var L1=qL,HL=class HL extends Mt{constructor(t,r,n,i){super("".concat(i instanceof Error?i.message:"Unknown error")),this.schema=t,this.path=r,this.value=n,this.error=i}};o(HL,"TransformEncodeError");var bg=HL;function qs(e,t,r){try{return ni(e)?e[hi].Encode(r):r}catch(n){throw new bg(e,t,r,n)}}o(qs,"Default");function USe(e,t,r,n){let i=qs(e,r,n);return Bt(i)?i.map((s,l)=>lp(e.items,t,"".concat(r,"/").concat(l),s)):i}o(USe,"FromArray");function VSe(e,t,r,n){let i=qs(e,r,n);if(!Ut(n)||ms(n))return i;let s=ah(e),l=s.map(b=>b[0]),c=k({},i);for(let[b,_]of s)b in c&&(c[b]=lp(_,t,"".concat(r,"/").concat(b),c[b]));if(!ni(e.unevaluatedProperties))return c;let p=Object.getOwnPropertyNames(c),h=e.unevaluatedProperties,y=k({},c);for(let b of p)l.includes(b)||(y[b]=qs(h,"".concat(r,"/").concat(b),y[b]));return y}o(VSe,"FromIntersect");function zSe(e,t,r,n){return qs(e.not,r,qs(e,r,n))}o(zSe,"FromNot");function qSe(e,t,r,n){let i=qs(e,r,n);if(!Ut(i))return i;let s=Yo(e),l=k({},i);for(let y of s)At(l,y)&&(Ai(l[y])&&(!a1(e.properties[y])||Mn.IsExactOptionalProperty(l,y))||(l[y]=lp(e.properties[y],t,"".concat(r,"/").concat(y),l[y])));if(!en(e.additionalProperties))return l;let c=Object.getOwnPropertyNames(l),p=e.additionalProperties,h=k({},l);for(let y of c)s.includes(y)||(h[y]=qs(p,"".concat(r,"/").concat(y),h[y]));return h}o(qSe,"FromObject");function HSe(e,t,r,n){let i=qs(e,r,n);if(!Ut(n))return i;let s=Object.getOwnPropertyNames(e.patternProperties)[0],l=new RegExp(s),c=k({},i);for(let b of Object.getOwnPropertyNames(n))l.test(b)&&(c[b]=lp(e.patternProperties[s],t,"".concat(r,"/").concat(b),c[b]));if(!en(e.additionalProperties))return c;let p=Object.getOwnPropertyNames(c),h=e.additionalProperties,y=k({},c);for(let b of p)l.test(b)||(y[b]=qs(h,"".concat(r,"/").concat(b),y[b]));return y}o(HSe,"FromRecord");function WSe(e,t,r,n){let i=cn(e,t),s=lp(i,t,r,n);return qs(e,r,s)}o(WSe,"FromRef");function XSe(e,t,r,n){let i=cn(e,t),s=lp(i,t,r,n);return qs(e,r,s)}o(XSe,"FromThis");function YSe(e,t,r,n){let i=qs(e,r,n);return Bt(e.items)?e.items.map((s,l)=>lp(s,t,"".concat(r,"/").concat(l),i[l])):[]}o(YSe,"FromTuple");function ZSe(e,t,r,n){for(let i of e.anyOf){if(!Jt(i,t,n))continue;let s=lp(i,t,r,n);return qs(e,r,s)}for(let i of e.anyOf){let s=lp(i,t,r,n);if(Jt(e,t,s))return qs(e,r,s)}return qs(e,r,n)}o(ZSe,"FromUnion");function lp(e,t,r,n){let i=Zl(e,t),s=e;switch(e[ve]){case"Array":return USe(s,i,r,n);case"Intersect":return VSe(s,i,r,n);case"Not":return zSe(s,i,r,n);case"Object":return qSe(s,i,r,n);case"Record":return HSe(s,i,r,n);case"Ref":return WSe(s,i,r,n);case"This":return XSe(s,i,r,n);case"Tuple":return YSe(s,i,r,n);case"Union":return ZSe(s,i,r,n);default:return qs(s,r,n)}}o(lp,"Visit");function Qw(e,t,r){return lp(e,t,"",r)}o(Qw,"TransformEncode");g();function KSe(e,t){return ni(e)||Zo(e.items,t)}o(KSe,"FromArray");function JSe(e,t){return ni(e)||Zo(e.items,t)}o(JSe,"FromAsyncIterator");function QSe(e,t){return ni(e)||Zo(e.returns,t)||e.parameters.some(r=>Zo(r,t))}o(QSe,"FromConstructor");function eCe(e,t){return ni(e)||Zo(e.returns,t)||e.parameters.some(r=>Zo(r,t))}o(eCe,"FromFunction");function tCe(e,t){return ni(e)||ni(e.unevaluatedProperties)||e.allOf.some(r=>Zo(r,t))}o(tCe,"FromIntersect");function rCe(e,t){return ni(e)||Zo(e.items,t)}o(rCe,"FromIterator");function nCe(e,t){return ni(e)||Zo(e.not,t)}o(nCe,"FromNot");function iCe(e,t){return ni(e)||Object.values(e.properties).some(r=>Zo(r,t))||en(e.additionalProperties)&&Zo(e.additionalProperties,t)}o(iCe,"FromObject");function oCe(e,t){return ni(e)||Zo(e.item,t)}o(oCe,"FromPromise");function sCe(e,t){let r=Object.getOwnPropertyNames(e.patternProperties)[0],n=e.patternProperties[r];return ni(e)||Zo(n,t)||en(e.additionalProperties)&&ni(e.additionalProperties)}o(sCe,"FromRecord");function aCe(e,t){return ni(e)?!0:Zo(cn(e,t),t)}o(aCe,"FromRef");function lCe(e,t){return ni(e)?!0:Zo(cn(e,t),t)}o(lCe,"FromThis");function uCe(e,t){return ni(e)||!Ai(e.items)&&e.items.some(r=>Zo(r,t))}o(uCe,"FromTuple");function cCe(e,t){return ni(e)||e.anyOf.some(r=>Zo(r,t))}o(cCe,"FromUnion");function Zo(e,t){let r=Zl(e,t),n=e;if(e.$id&&WL.has(e.$id))return!1;switch(e.$id&&WL.add(e.$id),e[ve]){case"Array":return KSe(n,r);case"AsyncIterator":return JSe(n,r);case"Constructor":return QSe(n,r);case"Function":return eCe(n,r);case"Intersect":return tCe(n,r);case"Iterator":return rCe(n,r);case"Not":return nCe(n,r);case"Object":return iCe(n,r);case"Promise":return oCe(n,r);case"Record":return sCe(n,r);case"Ref":return aCe(n,r);case"This":return lCe(n,r);case"Tuple":return uCe(n,r);case"Union":return cCe(n,r);default:return ni(e)}}o(Zo,"Visit");var WL=new Set;function up(e,t){return WL.clear(),Zo(e,t)}o(up,"HasTransform");function SJ(...e){let[t,r,n]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]];if(!Jt(t,r,n))throw new M1(t,n,ip(t,r,n).First());return up(t,r)?O1(t,r,n):n}o(SJ,"Decode");g();function Df(e,t){let r=At(e,"default")?e.default:void 0,n=rh(r)?r():pn(r);return Ai(t)?n:Ut(t)&&Ut(n)?Object.assign(n,t):t}o(Df,"ValueOrDefault");function XL(e){return ih(e)&&"default"in e}o(XL,"HasDefaultProperty");function pCe(e,t,r){let n=Df(e,r);if(!Bt(n))return n;for(let i=0;i<n.length;i++)n[i]=hl(e.items,t,n[i]);return n}o(pCe,"FromArray");function fCe(e,t,r){return da(r)?r:Df(e,r)}o(fCe,"FromDate");function dCe(e,t,r){let n=Df(e,r);return e.allOf.reduce((i,s)=>{let l=hl(s,t,n);return Ut(l)?k(k({},i),l):l},{})}o(dCe,"FromIntersect");function hCe(e,t,r){let n=Df(e,r);if(!Ut(n))return n;let i=Object.getOwnPropertyNames(e.properties);for(let s of i){let l=hl(e.properties[s],t,n[s]);Ai(l)||(n[s]=hl(e.properties[s],t,n[s]))}if(!XL(e.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))i.includes(s)||(n[s]=hl(e.additionalProperties,t,n[s]));return n}o(hCe,"FromObject");function mCe(e,t,r){let n=Df(e,r);if(!Ut(n))return n;let i=e.additionalProperties,[s,l]=Object.entries(e.patternProperties)[0],c=new RegExp(s);for(let p of Object.getOwnPropertyNames(n))c.test(p)&&XL(l)&&(n[p]=hl(l,t,n[p]));if(!XL(i))return n;for(let p of Object.getOwnPropertyNames(n))c.test(p)||(n[p]=hl(i,t,n[p]));return n}o(mCe,"FromRecord");function gCe(e,t,r){return hl(cn(e,t),t,Df(e,r))}o(gCe,"FromRef");function yCe(e,t,r){return hl(cn(e,t),t,r)}o(yCe,"FromThis");function vCe(e,t,r){let n=Df(e,r);if(!Bt(n)||Ai(e.items))return n;let[i,s]=[e.items,Math.max(e.items.length,n.length)];for(let l=0;l<s;l++)l<i.length&&(n[l]=hl(i[l],t,n[l]));return n}o(vCe,"FromTuple");function bCe(e,t,r){let n=Df(e,r);for(let i of e.anyOf){let s=hl(i,t,pn(n));if(Jt(i,t,s))return s}return n}o(bCe,"FromUnion");function hl(e,t,r){let n=Zl(e,t),i=e;switch(i[ve]){case"Array":return pCe(i,n,r);case"Date":return fCe(i,n,r);case"Intersect":return dCe(i,n,r);case"Object":return hCe(i,n,r);case"Record":return mCe(i,n,r);case"Ref":return gCe(i,n,r);case"This":return yCe(i,n,r);case"Tuple":return vCe(i,n,r);case"Union":return bCe(i,n,r);default:return Df(i,r)}}o(hl,"Visit");function eP(...e){return e.length===3?hl(e[0],e[1],e[2]):hl(e[0],[],e[1])}o(eP,"Default");g();g();var Ql={};Cc(Ql,{Delete:()=>ICe,Format:()=>II,Get:()=>SCe,Has:()=>_Ce,Set:()=>xCe,ValuePointerRootDeleteError:()=>rP,ValuePointerRootSetError:()=>tP});g();var YL=class YL extends Mt{constructor(t,r,n){super("Cannot set root value"),this.value=t,this.path=r,this.update=n}};o(YL,"ValuePointerRootSetError");var tP=YL,ZL=class ZL extends Mt{constructor(t,r){super("Cannot delete root value"),this.value=t,this.path=r}};o(ZL,"ValuePointerRootDeleteError");var rP=ZL;function CJ(e){return e.indexOf("~")===-1?e:e.replace(/~1/g,"/").replace(/~0/g,"~")}o(CJ,"Escape");function*II(e){if(e==="")return;let[t,r]=[0,0];for(let n=0;n<e.length;n++)e.charAt(n)==="/"?(n===0||(r=n,yield CJ(e.slice(t,r))),t=n+1):r=n;yield CJ(e.slice(t))}o(II,"Format");function xCe(e,t,r){if(t==="")throw new tP(e,t,r);let[n,i,s]=[null,e,""];for(let l of II(t))i[l]===void 0&&(i[l]={}),n=i,i=i[l],s=l;n[s]=r}o(xCe,"Set");function ICe(e,t){if(t==="")throw new rP(e,t);let[r,n,i]=[null,e,""];for(let s of II(t)){if(n[s]===void 0||n[s]===null)return;r=n,n=n[s],i=s}if(Array.isArray(r)){let s=parseInt(i);r.splice(s,1)}else delete r[i]}o(ICe,"Delete");function _Ce(e,t){if(t==="")return!0;let[r,n,i]=[null,e,""];for(let s of II(t)){if(n[s]===void 0)return!1;r=n,n=n[s],i=s}return Object.getOwnPropertyNames(r).includes(i)}o(_Ce,"Has");function SCe(e,t){if(t==="")return e;let r=e;for(let n of II(t)){if(r[n]===void 0)return;r=r[n]}return r}o(SCe,"Get");g();function CCe(e,t){if(!Ut(t))return!1;let r=[...Object.keys(e),...Object.getOwnPropertySymbols(e)],n=[...Object.keys(t),...Object.getOwnPropertySymbols(t)];return r.length!==n.length?!1:r.every(i=>xg(e[i],t[i]))}o(CCe,"ObjectType");function wCe(e,t){return da(t)&&e.getTime()===t.getTime()}o(wCe,"DateType");function PCe(e,t){return!Bt(t)||e.length!==t.length?!1:e.every((r,n)=>xg(r,t[n]))}o(PCe,"ArrayType");function TCe(e,t){return!Ul(t)||e.length!==t.length||Object.getPrototypeOf(e).constructor.name!==Object.getPrototypeOf(t).constructor.name?!1:e.every((r,n)=>xg(r,t[n]))}o(TCe,"TypedArrayType");function ECe(e,t){return e===t}o(ECe,"ValueType");function xg(e,t){if(da(e))return wCe(e,t);if(Ul(e))return TCe(e,t);if(Bt(e))return PCe(e,t);if(Ut(e))return CCe(e,t);if(ms(e))return ECe(e,t);throw new Error("ValueEquals: Unable to compare value")}o(xg,"Equal");var MCe=Hn({type:In("insert"),path:zl(),value:Mf()}),OCe=Hn({type:In("update"),path:zl(),value:Mf()}),LCe=Hn({type:In("delete"),path:zl()}),PJ=kn([MCe,OCe,LCe]),KL=class KL extends Mt{constructor(t,r){super(r),this.value=t}};o(KL,"ValueDiffError");var nP=KL;function iP(e,t){return{type:"update",path:e,value:t}}o(iP,"CreateUpdate");function TJ(e,t){return{type:"insert",path:e,value:t}}o(TJ,"CreateInsert");function EJ(e){return{type:"delete",path:e}}o(EJ,"CreateDelete");function wJ(e){if(globalThis.Object.getOwnPropertySymbols(e).length>0)throw new nP(e,"Cannot diff objects with symbols")}o(wJ,"AssertDiffable");function*ACe(e,t,r){if(wJ(t),wJ(r),!y6(r))return yield iP(e,r);let n=globalThis.Object.getOwnPropertyNames(t),i=globalThis.Object.getOwnPropertyNames(r);for(let s of i)At(t,s)||(yield TJ("".concat(e,"/").concat(s),r[s]));for(let s of n)At(r,s)&&(xg(t,r)||(yield*Ve(oP("".concat(e,"/").concat(s),t[s],r[s]))));for(let s of n)At(r,s)||(yield EJ("".concat(e,"/").concat(s)))}o(ACe,"ObjectType");function*DCe(e,t,r){if(!Bt(r))return yield iP(e,r);for(let n=0;n<Math.min(t.length,r.length);n++)yield*Ve(oP("".concat(e,"/").concat(n),t[n],r[n]));for(let n=0;n<r.length;n++)n<t.length||(yield TJ("".concat(e,"/").concat(n),r[n]));for(let n=t.length-1;n>=0;n--)n<r.length||(yield EJ("".concat(e,"/").concat(n)))}o(DCe,"ArrayType");function*FCe(e,t,r){if(!Ul(r)||t.length!==r.length||globalThis.Object.getPrototypeOf(t).constructor.name!==globalThis.Object.getPrototypeOf(r).constructor.name)return yield iP(e,r);for(let n=0;n<Math.min(t.length,r.length);n++)yield*Ve(oP("".concat(e,"/").concat(n),t[n],r[n]))}o(FCe,"TypedArrayType");function*NCe(e,t,r){t!==r&&(yield iP(e,r))}o(NCe,"ValueType");function*oP(e,t,r){if(y6(t))return yield*Ve(ACe(e,t,r));if(Bt(t))return yield*Ve(DCe(e,t,r));if(Ul(t))return yield*Ve(FCe(e,t,r));if(ms(t))return yield*Ve(NCe(e,t,r));throw new nP(t,"Unable to diff value")}o(oP,"Visit");function MJ(e,t){return[...oP("",e,t)]}o(MJ,"Diff");function kCe(e){return e.length>0&&e[0].path===""&&e[0].type==="update"}o(kCe,"IsRootUpdate");function RCe(e){return e.length===0}o(RCe,"IsIdentity");function OJ(e,t){if(kCe(t))return pn(t[0].value);if(RCe(t))return pn(e);let r=pn(e);for(let n of t)switch(n.type){case"insert":{Ql.Set(r,n.path,n.value);break}case"update":{Ql.Set(r,n.path,n.value);break}case"delete":{Ql.Delete(r,n.path);break}}return r}o(OJ,"Patch");g();function LJ(...e){let[t,r,n]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]],i=up(t,r)?Qw(t,r,n):n;if(!Jt(t,r,i))throw new L1(t,i,ip(t,r,i).First());return i}o(LJ,"Encode");g();var QL=class QL extends Mt{constructor(t){super(t)}};o(QL,"ValueMutateError");var sP=QL;function BCe(e,t,r,n){if(!Ut(r))Ql.Set(e,t,pn(n));else{let i=Object.getOwnPropertyNames(r),s=Object.getOwnPropertyNames(n);for(let l of i)s.includes(l)||delete r[l];for(let l of s)i.includes(l)||(r[l]=null);for(let l of s)JL(e,"".concat(t,"/").concat(l),r[l],n[l])}}o(BCe,"ObjectType");function $Ce(e,t,r,n){if(!Bt(r))Ql.Set(e,t,pn(n));else{for(let i=0;i<n.length;i++)JL(e,"".concat(t,"/").concat(i),r[i],n[i]);r.splice(n.length)}}o($Ce,"ArrayType");function jCe(e,t,r,n){if(Ul(r)&&r.length===n.length)for(let i=0;i<r.length;i++)r[i]=n[i];else Ql.Set(e,t,pn(n))}o(jCe,"TypedArrayType");function GCe(e,t,r,n){r!==n&&Ql.Set(e,t,n)}o(GCe,"ValueType");function JL(e,t,r,n){if(Bt(n))return $Ce(e,t,r,n);if(Ul(n))return jCe(e,t,r,n);if(Ut(n))return BCe(e,t,r,n);if(ms(n))return GCe(e,t,r,n)}o(JL,"Visit");function AJ(e){return Ul(e)||ms(e)}o(AJ,"IsNonMutableValue");function UCe(e,t){return Ut(e)&&Bt(t)||Bt(e)&&Ut(t)}o(UCe,"IsMismatchedValue");function DJ(e,t){if(AJ(e)||AJ(t))throw new sP("Only object and array types can be mutated at the root level");if(UCe(e,t))throw new sP("Cannot assign due type mismatch of assignable values");JL(e,"",e,t)}o(DJ,"Mutate");g();var VCe=[(e,t,r)=>pn(r),(e,t,r)=>eP(e,t,r),(e,t,r)=>Zw(e,t,r),(e,t,r)=>Jw(e,t,r),(e,t,r)=>(Xw(e,t,r),r),(e,t,r)=>up(e,t)?O1(e,t,r):r];function FJ(e,t,r){return VCe.reduce((n,i)=>i(e,t,n),r)}o(FJ,"ParseValue");function NJ(...e){return e.length===3?FJ(e[0],e[1],e[2]):FJ(e[0],[],e[1])}o(NJ,"Parse");g();var Ff={};Cc(Ff,{Assert:()=>Xw,Cast:()=>GL,Check:()=>Jt,Clean:()=>Zw,Clone:()=>pn,Convert:()=>Jw,Create:()=>Jl,Decode:()=>SJ,Default:()=>eP,Diff:()=>MJ,Edit:()=>PJ,Encode:()=>LJ,Equal:()=>xg,Errors:()=>ip,Hash:()=>ch,Mutate:()=>DJ,Parse:()=>NJ,Patch:()=>OJ,ValueErrorIterator:()=>Kl});g();g();var tA=class tA extends Mt{constructor(r){super("Unable to dereference schema with $id '".concat(r.$ref,"'"));x(this,"schema");this.schema=r}};o(tA,"TypeDereferenceError");var eA=tA;function zCe(e,t){let r=t.find(n=>n.$id===e.$ref);if(r===void 0)throw new eA(e);return Ig(r,t)}o(zCe,"Resolve");function aP(e,t){return!Jr.IsString(e.$id)||t.some(r=>r.$id===e.$id)||t.push(e),t}o(aP,"Pushref");function Ig(e,t){return e[ve]==="This"||e[ve]==="Ref"?zCe(e,t):e}o(Ig,"Deref");g();function qCe(e,t,r){let n=e.get(t);if(n!==void 0)return n;let i=up(t,r);return e.set(t,i),i}o(qCe,"HasTransformCached");function lP(){let e=new WeakMap;return{HasTransform:o((t,r)=>qCe(e,t,r),"HasTransform")}}o(lP,"CreateTransformCache");function Fi(e,t,r){try{return oe.IsTransform(e)?e[hi].Decode(r):r}catch(n){throw new vg(e,t,r,n)}}o(Fi,"Default");function HCe(e,t,r,n,i){return Jr.IsArray(n)?Fi(e,r,n.map((s,l)=>cp(e.items,t,"".concat(r,"/").concat(l),s,i))):Fi(e,r,n)}o(HCe,"FromArray");function WCe(e,t,r,n,i){if(!Jr.IsObject(n)||ms(n))return Fi(e,r,n);let s=ah(e),l=s.map(b=>b[0]),c=k({},n);for(let[b,_]of s)b in c&&(c[b]=cp(_,t,"".concat(r,"/").concat(b),c[b],i));if(!oe.IsTransform(e.unevaluatedProperties))return Fi(e,r,c);let p=Object.getOwnPropertyNames(c),h=e.unevaluatedProperties,y=k({},c);for(let b of p)l.includes(b)||(y[b]=Fi(h,"".concat(r,"/").concat(b),y[b]));return Fi(e,r,y)}o(WCe,"FromIntersect");function XCe(e,t,r,n,i){return Fi(e,r,cp(e.not,t,r,n,i))}o(XCe,"FromNot");function YCe(e,t,r,n,i){if(!Jr.IsObject(n))return Fi(e,r,n);let s=Yo(e),l=k({},n);for(let y of s)Jr.HasPropertyKey(l,y)&&(Jr.IsUndefined(l[y])&&(!oe.IsUndefined(e.properties[y])||Mn.IsExactOptionalProperty(l,y))||(l[y]=cp(e.properties[y],t,"".concat(r,"/").concat(y),l[y],i)));if(!oe.IsSchema(e.additionalProperties))return Fi(e,r,l);let c=Object.getOwnPropertyNames(l),p=e.additionalProperties,h=k({},l);for(let y of c)s.includes(y)||(h[y]=Fi(p,"".concat(r,"/").concat(y),h[y]));return Fi(e,r,h)}o(YCe,"FromObject");function ZCe(e,t,r,n,i){if(!Jr.IsObject(n))return Fi(e,r,n);let s=Object.getOwnPropertyNames(e.patternProperties)[0],l=new RegExp(s),c=k({},n);for(let b of Object.getOwnPropertyNames(n))l.test(b)&&(c[b]=cp(e.patternProperties[s],t,"".concat(r,"/").concat(b),c[b],i));if(!oe.IsSchema(e.additionalProperties))return Fi(e,r,c);let p=Object.getOwnPropertyNames(c),h=e.additionalProperties,y=k({},c);for(let b of p)l.test(b)||(y[b]=Fi(h,"".concat(r,"/").concat(b),y[b]));return Fi(e,r,y)}o(ZCe,"FromRecord");function KCe(e,t,r,n,i){let s=Ig(e,t);return Fi(e,r,cp(s,t,r,n,i))}o(KCe,"FromRef");function JCe(e,t,r,n,i){let s=Ig(e,t);return Fi(e,r,cp(s,t,r,n,i))}o(JCe,"FromThis");function QCe(e,t,r,n,i){return Jr.IsArray(n)&&Jr.IsArray(e.items)?Fi(e,r,e.items.map((s,l)=>cp(s,t,"".concat(r,"/").concat(l),n[l],i))):Fi(e,r,n)}o(QCe,"FromTuple");function ewe(e,t,r,n,i){for(let s of e.anyOf){if(!Ff.Check(s,t,n))continue;let l=cp(s,t,r,n,i);return Fi(e,r,l)}return Fi(e,r,n)}o(ewe,"FromUnion");function cp(e,t,r,n,i){if(!i.HasTransform(e,t))return n;let s=aP(e,t),l=e;switch(e[ve]){case"Array":return HCe(l,s,r,n,i);case"Intersect":return WCe(l,s,r,n,i);case"Not":return XCe(l,s,r,n,i);case"Object":return YCe(l,s,r,n,i);case"Record":return ZCe(l,s,r,n,i);case"Ref":return KCe(l,s,r,n,i);case"Symbol":return Fi(l,r,n);case"This":return JCe(l,s,r,n,i);case"Tuple":return QCe(l,s,r,n,i);case"Union":return ewe(l,s,r,n,i);default:return Fi(l,r,n)}}o(cp,"Visit");function kJ(e,t,r){let n=lP();return cp(e,t,"",r,n)}o(kJ,"FastTransformDecode");g();function Hs(e,t,r){try{return oe.IsTransform(e)?e[hi].Encode(r):r}catch(n){throw new bg(e,t,r,n)}}o(Hs,"Default");function twe(e,t,r,n,i){let s=Hs(e,r,n);return Jr.IsArray(s)?s.map((l,c)=>pp(e.items,t,"".concat(r,"/").concat(c),l,i)):s}o(twe,"FromArray");function rwe(e,t,r,n,i){let s=Hs(e,r,n);if(!Jr.IsObject(n)||ms(n))return s;let l=ah(e),c=l.map(_=>_[0]),p=k({},s);for(let[_,C]of l)_ in p&&(p[_]=pp(C,t,"".concat(r,"/").concat(_),p[_],i));if(!oe.IsTransform(e.unevaluatedProperties))return p;let h=Object.getOwnPropertyNames(p),y=e.unevaluatedProperties,b=k({},p);for(let _ of h)c.includes(_)||(b[_]=Hs(y,"".concat(r,"/").concat(_),b[_]));return b}o(rwe,"FromIntersect");function nwe(e,t,r,n){return Hs(e.not,r,Hs(e,r,n))}o(nwe,"FromNot");function iwe(e,t,r,n,i){let s=Hs(e,r,n);if(!Jr.IsObject(s))return s;let l=Yo(e),c=k({},s);for(let b of l)Jr.HasPropertyKey(c,b)&&(Jr.IsUndefined(c[b])&&(!oe.IsUndefined(e.properties[b])||Mn.IsExactOptionalProperty(c,b))||(c[b]=pp(e.properties[b],t,"".concat(r,"/").concat(b),c[b],i)));if(!oe.IsSchema(e.additionalProperties))return c;let p=Object.getOwnPropertyNames(c),h=e.additionalProperties,y=k({},c);for(let b of p)l.includes(b)||(y[b]=Hs(h,"".concat(r,"/").concat(b),y[b]));return y}o(iwe,"FromObject");function owe(e,t,r,n,i){let s=Hs(e,r,n);if(!Jr.IsObject(n))return s;let l=Object.getOwnPropertyNames(e.patternProperties)[0],c=new RegExp(l),p=k({},s);for(let _ of Object.getOwnPropertyNames(n))c.test(_)&&(p[_]=pp(e.patternProperties[l],t,"".concat(r,"/").concat(_),p[_],i));if(!oe.IsSchema(e.additionalProperties))return p;let h=Object.getOwnPropertyNames(p),y=e.additionalProperties,b=k({},p);for(let _ of h)c.test(_)||(b[_]=Hs(y,"".concat(r,"/").concat(_),b[_]));return b}o(owe,"FromRecord");function swe(e,t,r,n,i){let s=Ig(e,t),l=pp(s,t,r,n,i);return Hs(e,r,l)}o(swe,"FromRef");function awe(e,t,r,n,i){let s=Ig(e,t),l=pp(s,t,r,n,i);return Hs(e,r,l)}o(awe,"FromThis");function lwe(e,t,r,n,i){let s=Hs(e,r,n);return Jr.IsArray(e.items)?e.items.map((l,c)=>pp(l,t,"".concat(r,"/").concat(c),s[c],i)):[]}o(lwe,"FromTuple");function uwe(e,t,r,n,i){for(let s of e.anyOf){if(!Ff.Check(s,t,n))continue;let l=pp(s,t,r,n,i);return Hs(e,r,l)}for(let s of e.anyOf){let l=pp(s,t,r,n,i);if(Ff.Check(e,t,l))return Hs(e,r,l)}return Hs(e,r,n)}o(uwe,"FromUnion");function pp(e,t,r,n,i){if(!i.HasTransform(e,t))return n;let s=aP(e,t),l=e;switch(e[ve]){case"Array":return twe(l,s,r,n,i);case"Intersect":return rwe(l,s,r,n,i);case"Not":return nwe(l,s,r,n);case"Object":return iwe(l,s,r,n,i);case"Record":return owe(l,s,r,n,i);case"Ref":return swe(l,s,r,n,i);case"This":return awe(l,s,r,n,i);case"Tuple":return lwe(l,s,r,n,i);case"Union":return uwe(l,s,r,n,i);default:return Hs(l,r,n)}}o(pp,"Visit");function RJ(e,t,r){let n=lP();return pp(e,t,"",r,n)}o(RJ,"FastTransformEncode");g();var sA=class sA{constructor(t,r,n,i){this.schema=t,this.references=r,this.checkFunc=n,this.code=i,this.hasTransform=up(t,r)}Code(){return this.code}Errors(t){return ip(this.schema,this.references,t)}Check(t){return this.checkFunc(t)}Decode(t){if(!this.checkFunc(t))throw new M1(this.schema,t,this.Errors(t).First());return this.hasTransform?O1(this.schema,this.references,t):t}Encode(t){let r=this.hasTransform?Qw(this.schema,this.references,t):t;if(!this.checkFunc(r))throw new L1(this.schema,t,this.Errors(t).First());return r}};o(sA,"TypeCheck");var rA=sA,Nf;(function(e){function t(s){return s===36}o(t,"DollarSign"),e.DollarSign=t;function r(s){return s===95}o(r,"IsUnderscore"),e.IsUnderscore=r;function n(s){return s>=65&&s<=90||s>=97&&s<=122}o(n,"IsAlpha"),e.IsAlpha=n;function i(s){return s>=48&&s<=57}o(i,"IsNumeric"),e.IsNumeric=i})(Nf||(Nf={}));var uP;(function(e){function t(s){return s.length===0?!1:Nf.IsNumeric(s.charCodeAt(0))}o(t,"IsFirstCharacterNumeric");function r(s){if(t(s))return!1;for(let l=0;l<s.length;l++){let c=s.charCodeAt(l);if(!(Nf.IsAlpha(c)||Nf.IsNumeric(c)||Nf.DollarSign(c)||Nf.IsUnderscore(c)))return!1}return!0}o(r,"IsAccessor");function n(s){return s.replace(/'/g,"\\'")}o(n,"EscapeHyphen");function i(s,l){return r(l)?"".concat(s,".").concat(l):"".concat(s,"['").concat(n(l),"']")}o(i,"Encode"),e.Encode=i})(uP||(uP={}));var nA;(function(e){function t(r){let n=[];for(let i=0;i<r.length;i++){let s=r.charCodeAt(i);Nf.IsNumeric(s)||Nf.IsAlpha(s)?n.push(r.charAt(i)):n.push("_".concat(s,"_"))}return n.join("").replace(/__/g,"_")}o(t,"Encode"),e.Encode=t})(nA||(nA={}));var iA;(function(e){function t(r){return r.replace(/'/g,"\\'")}o(t,"Escape"),e.Escape=t})(iA||(iA={}));var aA=class aA extends Mt{constructor(t){super("Unknown type"),this.schema=t}};o(aA,"TypeCompilerUnknownTypeError");var oA=aA,lA=class lA extends Mt{constructor(t){super("Preflight validation check failed to guard for the given schema"),this.schema=t}};o(lA,"TypeCompilerTypeGuardError");var cP=lA,_g;(function(e){function t(l,c,p){return Mn.ExactOptionalPropertyTypes?"('".concat(c,"' in ").concat(l," ? ").concat(p," : true)"):"(".concat(uP.Encode(l,c)," !== undefined ? ").concat(p," : true)")}o(t,"IsExactOptionalProperty"),e.IsExactOptionalProperty=t;function r(l){return Mn.AllowArrayObject?"(typeof ".concat(l," === 'object' && ").concat(l," !== null)"):"(typeof ".concat(l," === 'object' && ").concat(l," !== null && !Array.isArray(").concat(l,"))")}o(r,"IsObjectLike"),e.IsObjectLike=r;function n(l){return Mn.AllowArrayObject?"(typeof ".concat(l," === 'object' && ").concat(l," !== null && !(").concat(l," instanceof Date) && !(").concat(l," instanceof Uint8Array))"):"(typeof ".concat(l," === 'object' && ").concat(l," !== null && !Array.isArray(").concat(l,") && !(").concat(l," instanceof Date) && !(").concat(l," instanceof Uint8Array))")}o(n,"IsRecordLike"),e.IsRecordLike=n;function i(l){return Mn.AllowNaN?"typeof ".concat(l," === 'number'"):"Number.isFinite(".concat(l,")")}o(i,"IsNumberLike"),e.IsNumberLike=i;function s(l){return Mn.AllowNullVoid?"(".concat(l," === undefined || ").concat(l," === null)"):"".concat(l," === undefined")}o(s,"IsVoidLike"),e.IsVoidLike=s})(_g||(_g={}));var pP;(function(e){function t(H){return H[ve]==="Any"||H[ve]==="Unknown"}o(t,"IsAnyOrUnknown");function*r(H,ie,ee){yield"true"}o(r,"FromAny");function*n(H,ie,ee){yield"Array.isArray(".concat(ee,")");let[Ee,Ne]=[Ae("value","any"),Ae("acc","number")];_t(H.maxItems)&&(yield"".concat(ee,".length <= ").concat(H.maxItems)),_t(H.minItems)&&(yield"".concat(ee,".length >= ").concat(H.minItems));let Oe=Q(H.items,ie,"value");if(yield"".concat(ee,".every((").concat(Ee,") => ").concat(Oe,")"),en(H.contains)||_t(H.minContains)||_t(H.maxContains)){let Ye=en(H.contains)?H.contains:Nn(),Pt=Q(Ye,ie,"value"),Er=_t(H.minContains)?["(count >= ".concat(H.minContains,")")]:[],$n=_t(H.maxContains)?["(count <= ".concat(H.maxContains,")")]:[],ot="const count = value.reduce((".concat(Ne,", ").concat(Ee,") => ").concat(Pt," ? acc + 1 : acc, 0)"),zt=["(count > 0)",...Er,...$n].join(" && ");yield"((".concat(Ee,") => { ").concat(ot,"; return ").concat(zt,"})(").concat(ee,")")}if(H.uniqueItems===!0){let Pt="const set = new Set(); for(const element of value) { ".concat("const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true"," }");yield"((".concat(Ee,") => { ").concat(Pt," )(").concat(ee,")")}}o(n,"FromArray");function*i(H,ie,ee){yield"(typeof value === 'object' && Symbol.asyncIterator in ".concat(ee,")")}o(i,"FromAsyncIterator");function*s(H,ie,ee){yield"(typeof ".concat(ee," === 'bigint')"),hs(H.exclusiveMaximum)&&(yield"".concat(ee," < BigInt(").concat(H.exclusiveMaximum,")")),hs(H.exclusiveMinimum)&&(yield"".concat(ee," > BigInt(").concat(H.exclusiveMinimum,")")),hs(H.maximum)&&(yield"".concat(ee," <= BigInt(").concat(H.maximum,")")),hs(H.minimum)&&(yield"".concat(ee," >= BigInt(").concat(H.minimum,")")),hs(H.multipleOf)&&(yield"(".concat(ee," % BigInt(").concat(H.multipleOf,")) === 0"))}o(s,"FromBigInt");function*l(H,ie,ee){yield"(typeof ".concat(ee," === 'boolean')")}o(l,"FromBoolean");function*c(H,ie,ee){yield*Ve(_e(H.returns,ie,"".concat(ee,".prototype")))}o(c,"FromConstructor");function*p(H,ie,ee){yield"(".concat(ee," instanceof Date) && Number.isFinite(").concat(ee,".getTime())"),_t(H.exclusiveMaximumTimestamp)&&(yield"".concat(ee,".getTime() < ").concat(H.exclusiveMaximumTimestamp)),_t(H.exclusiveMinimumTimestamp)&&(yield"".concat(ee,".getTime() > ").concat(H.exclusiveMinimumTimestamp)),_t(H.maximumTimestamp)&&(yield"".concat(ee,".getTime() <= ").concat(H.maximumTimestamp)),_t(H.minimumTimestamp)&&(yield"".concat(ee,".getTime() >= ").concat(H.minimumTimestamp)),_t(H.multipleOfTimestamp)&&(yield"(".concat(ee,".getTime() % ").concat(H.multipleOfTimestamp,") === 0"))}o(p,"FromDate");function*h(H,ie,ee){yield"(typeof ".concat(ee," === 'function')")}o(h,"FromFunction");function*y(H,ie,ee){yield"Number.isInteger(".concat(ee,")"),_t(H.exclusiveMaximum)&&(yield"".concat(ee," < ").concat(H.exclusiveMaximum)),_t(H.exclusiveMinimum)&&(yield"".concat(ee," > ").concat(H.exclusiveMinimum)),_t(H.maximum)&&(yield"".concat(ee," <= ").concat(H.maximum)),_t(H.minimum)&&(yield"".concat(ee," >= ").concat(H.minimum)),_t(H.multipleOf)&&(yield"(".concat(ee," % ").concat(H.multipleOf,") === 0"))}o(y,"FromInteger");function*b(H,ie,ee){let Ee=H.allOf.map(Ne=>Q(Ne,ie,ee)).join(" && ");if(H.unevaluatedProperties===!1){let Ne=Ke("".concat(new RegExp(Ef(H)),";")),Oe="Object.getOwnPropertyNames(".concat(ee,").every(key => ").concat(Ne,".test(key))");yield"(".concat(Ee," && ").concat(Oe,")")}else if(en(H.unevaluatedProperties)){let Ne=Ke("".concat(new RegExp(Ef(H)),";")),Oe="Object.getOwnPropertyNames(".concat(ee,").every(key => ").concat(Ne,".test(key) || ").concat(Q(H.unevaluatedProperties,ie,"".concat(ee,"[key]")),")");yield"(".concat(Ee," && ").concat(Oe,")")}else yield"(".concat(Ee,")")}o(b,"FromIntersect");function*_(H,ie,ee){yield"(typeof value === 'object' && Symbol.iterator in ".concat(ee,")")}o(_,"FromIterator");function*C(H,ie,ee){typeof H.const=="number"||typeof H.const=="boolean"?yield"(".concat(ee," === ").concat(H.const,")"):yield"(".concat(ee," === '").concat(iA.Escape(H.const),"')")}o(C,"FromLiteral");function*P(H,ie,ee){yield"false"}o(P,"FromNever");function*E(H,ie,ee){let Ee=Q(H.not,ie,ee);yield"(!".concat(Ee,")")}o(E,"FromNot");function*T(H,ie,ee){yield"(".concat(ee," === null)")}o(T,"FromNull");function*O(H,ie,ee){yield _g.IsNumberLike(ee),_t(H.exclusiveMaximum)&&(yield"".concat(ee," < ").concat(H.exclusiveMaximum)),_t(H.exclusiveMinimum)&&(yield"".concat(ee," > ").concat(H.exclusiveMinimum)),_t(H.maximum)&&(yield"".concat(ee," <= ").concat(H.maximum)),_t(H.minimum)&&(yield"".concat(ee," >= ").concat(H.minimum)),_t(H.multipleOf)&&(yield"(".concat(ee," % ").concat(H.multipleOf,") === 0"))}o(O,"FromNumber");function*D(H,ie,ee){yield _g.IsObjectLike(ee),_t(H.minProperties)&&(yield"Object.getOwnPropertyNames(".concat(ee,").length >= ").concat(H.minProperties)),_t(H.maxProperties)&&(yield"Object.getOwnPropertyNames(".concat(ee,").length <= ").concat(H.maxProperties));let Ee=Object.getOwnPropertyNames(H.properties);for(let Ne of Ee){let Oe=uP.Encode(ee,Ne),Ye=H.properties[Ne];if(H.required&&H.required.includes(Ne))yield*Ve(_e(Ye,ie,Oe)),(Of(Ye)||t(Ye))&&(yield"('".concat(Ne,"' in ").concat(ee,")"));else{let Pt=Q(Ye,ie,Oe);yield _g.IsExactOptionalProperty(ee,Ne,Pt)}}if(H.additionalProperties===!1)if(H.required&&H.required.length===Ee.length)yield"Object.getOwnPropertyNames(".concat(ee,").length === ").concat(Ee.length);else{let Ne="[".concat(Ee.map(Oe=>"'".concat(Oe,"'")).join(", "),"]");yield"Object.getOwnPropertyNames(".concat(ee,").every(key => ").concat(Ne,".includes(key))")}if(typeof H.additionalProperties=="object"){let Ne=Q(H.additionalProperties,ie,"".concat(ee,"[key]")),Oe="[".concat(Ee.map(Ye=>"'".concat(Ye,"'")).join(", "),"]");yield"(Object.getOwnPropertyNames(".concat(ee,").every(key => ").concat(Oe,".includes(key) || ").concat(Ne,"))")}}o(D,"FromObject");function*A(H,ie,ee){yield"(typeof value === 'object' && typeof ".concat(ee,".then === 'function')")}o(A,"FromPromise");function*R(H,ie,ee){yield _g.IsRecordLike(ee),_t(H.minProperties)&&(yield"Object.getOwnPropertyNames(".concat(ee,").length >= ").concat(H.minProperties)),_t(H.maxProperties)&&(yield"Object.getOwnPropertyNames(".concat(ee,").length <= ").concat(H.maxProperties));let[Ee,Ne]=Object.entries(H.patternProperties)[0],Oe=Ke("".concat(new RegExp(Ee))),Ye=Q(Ne,ie,"value"),Pt=en(H.additionalProperties)?Q(H.additionalProperties,ie,ee):H.additionalProperties===!1?"false":"true",Er="(".concat(Oe,".test(key) ? ").concat(Ye," : ").concat(Pt,")");yield"(Object.entries(".concat(ee,").every(([key, value]) => ").concat(Er,"))")}o(R,"FromRecord");function*j(H,ie,ee){let Ee=cn(H,ie);if(Me.functions.has(H.$ref))return yield"".concat(it(H.$ref),"(").concat(ee,")");yield*Ve(_e(Ee,ie,ee))}o(j,"FromRef");function*X(H,ie,ee){let Ee=Ke("".concat(new RegExp(H.source,H.flags),";"));yield"(typeof ".concat(ee," === 'string')"),_t(H.maxLength)&&(yield"".concat(ee,".length <= ").concat(H.maxLength)),_t(H.minLength)&&(yield"".concat(ee,".length >= ").concat(H.minLength)),yield"".concat(Ee,".test(").concat(ee,")")}o(X,"FromRegExp");function*Y(H,ie,ee){if(yield"(typeof ".concat(ee," === 'string')"),_t(H.maxLength)&&(yield"".concat(ee,".length <= ").concat(H.maxLength)),_t(H.minLength)&&(yield"".concat(ee,".length >= ").concat(H.minLength)),H.pattern!==void 0){let Ee=Ke("".concat(new RegExp(H.pattern),";"));yield"".concat(Ee,".test(").concat(ee,")")}H.format!==void 0&&(yield"format('".concat(H.format,"', ").concat(ee,")"))}o(Y,"FromString");function*N(H,ie,ee){yield"(typeof ".concat(ee," === 'symbol')")}o(N,"FromSymbol");function*Z(H,ie,ee){yield"(typeof ".concat(ee," === 'string')");let Ee=Ke("".concat(new RegExp(H.pattern),";"));yield"".concat(Ee,".test(").concat(ee,")")}o(Z,"FromTemplateLiteral");function*ae(H,ie,ee){yield"".concat(it(H.$ref),"(").concat(ee,")")}o(ae,"FromThis");function*se(H,ie,ee){if(yield"Array.isArray(".concat(ee,")"),H.items===void 0)return yield"".concat(ee,".length === 0");yield"(".concat(ee,".length === ").concat(H.maxItems,")");for(let Ee=0;Ee<H.items.length;Ee++){let Ne=Q(H.items[Ee],ie,"".concat(ee,"[").concat(Ee,"]"));yield"".concat(Ne)}}o(se,"FromTuple");function*U(H,ie,ee){yield"".concat(ee," === undefined")}o(U,"FromUndefined");function*xe(H,ie,ee){let Ee=H.anyOf.map(Ne=>Q(Ne,ie,ee));yield"(".concat(Ee.join(" || "),")")}o(xe,"FromUnion");function*ne(H,ie,ee){yield"".concat(ee," instanceof Uint8Array"),_t(H.maxByteLength)&&(yield"(".concat(ee,".length <= ").concat(H.maxByteLength,")")),_t(H.minByteLength)&&(yield"(".concat(ee,".length >= ").concat(H.minByteLength,")"))}o(ne,"FromUint8Array");function*Pe(H,ie,ee){yield"true"}o(Pe,"FromUnknown");function*Ce(H,ie,ee){yield _g.IsVoidLike(ee)}o(Ce,"FromVoid");function*Ue(H,ie,ee){let Ee=Me.instances.size;Me.instances.set(Ee,H),yield"kind('".concat(H[ve],"', ").concat(Ee,", ").concat(ee,")")}o(Ue,"FromKind");function*_e(H,ie,ee,Ee=!0){let Ne=Qr(H.$id)?[...ie,H]:ie,Oe=H;if(Ee&&Qr(H.$id)){let Ye=it(H.$id);if(Me.functions.has(Ye))return yield"".concat(Ye,"(").concat(ee,")");{let Pt=rt(Ye,H,ie,"value",!1);return Me.functions.set(Ye,Pt),yield"".concat(Ye,"(").concat(ee,")")}}switch(Oe[ve]){case"Any":return yield*Ve(r(Oe,Ne,ee));case"Array":return yield*Ve(n(Oe,Ne,ee));case"AsyncIterator":return yield*Ve(i(Oe,Ne,ee));case"BigInt":return yield*Ve(s(Oe,Ne,ee));case"Boolean":return yield*Ve(l(Oe,Ne,ee));case"Constructor":return yield*Ve(c(Oe,Ne,ee));case"Date":return yield*Ve(p(Oe,Ne,ee));case"Function":return yield*Ve(h(Oe,Ne,ee));case"Integer":return yield*Ve(y(Oe,Ne,ee));case"Intersect":return yield*Ve(b(Oe,Ne,ee));case"Iterator":return yield*Ve(_(Oe,Ne,ee));case"Literal":return yield*Ve(C(Oe,Ne,ee));case"Never":return yield*Ve(P(Oe,Ne,ee));case"Not":return yield*Ve(E(Oe,Ne,ee));case"Null":return yield*Ve(T(Oe,Ne,ee));case"Number":return yield*Ve(O(Oe,Ne,ee));case"Object":return yield*Ve(D(Oe,Ne,ee));case"Promise":return yield*Ve(A(Oe,Ne,ee));case"Record":return yield*Ve(R(Oe,Ne,ee));case"Ref":return yield*Ve(j(Oe,Ne,ee));case"RegExp":return yield*Ve(X(Oe,Ne,ee));case"String":return yield*Ve(Y(Oe,Ne,ee));case"Symbol":return yield*Ve(N(Oe,Ne,ee));case"TemplateLiteral":return yield*Ve(Z(Oe,Ne,ee));case"This":return yield*Ve(ae(Oe,Ne,ee));case"Tuple":return yield*Ve(se(Oe,Ne,ee));case"Undefined":return yield*Ve(U(Oe,Ne,ee));case"Union":return yield*Ve(xe(Oe,Ne,ee));case"Uint8Array":return yield*Ve(ne(Oe,Ne,ee));case"Unknown":return yield*Ve(Pe(Oe,Ne,ee));case"Void":return yield*Ve(Ce(Oe,Ne,ee));default:if(!Mo.Has(Oe[ve]))throw new oA(H);return yield*Ve(Ue(Oe,Ne,ee))}}o(_e,"Visit");let Me={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function Q(H,ie,ee,Ee=!0){return"(".concat([..._e(H,ie,ee,Ee)].join(" && "),")")}o(Q,"CreateExpression");function it(H){return"check_".concat(nA.Encode(H))}o(it,"CreateFunctionName");function Ke(H){let ie="local_".concat(Me.variables.size);return Me.variables.set(ie,"const ".concat(ie," = ").concat(H)),ie}o(Ke,"CreateVariable");function rt(H,ie,ee,Ee,Ne=!0){let[Oe,Ye]=["\n",ot=>"".padStart(ot," ")],Pt=Ae("value","any"),Er=Be("boolean"),$n=[..._e(ie,ee,Ee,Ne)].map(ot=>"".concat(Ye(4)).concat(ot)).join(" &&".concat(Oe));return"function ".concat(H,"(").concat(Pt,")").concat(Er," {").concat(Oe).concat(Ye(2),"return (").concat(Oe).concat($n).concat(Oe).concat(Ye(2),")\n}")}o(rt,"CreateFunction");function Ae(H,ie){let ee=Me.language==="typescript"?": ".concat(ie):"";return"".concat(H).concat(ee)}o(Ae,"CreateParameter");function Be(H){return Me.language==="typescript"?": ".concat(H):""}o(Be,"CreateReturns");function We(H,ie,ee){let Ee=rt("check",H,ie,"value"),Ne=Ae("value","any"),Oe=Be("boolean"),Ye=[...Me.functions.values()],Pt=[...Me.variables.values()],Er=Qr(H.$id)?"return function check(".concat(Ne,")").concat(Oe," {\n return ").concat(it(H.$id),"(value)\n}"):"return ".concat(Ee);return[...Pt,...Ye,Er].join("\n")}o(We,"Build");function je(...H){let ie={language:"javascript"},[ee,Ee,Ne]=H.length===2&&Bt(H[1])?[H[0],H[1],ie]:H.length===2&&!Bt(H[1])?[H[0],[],H[1]]:H.length===3?[H[0],H[1],H[2]]:H.length===1?[H[0],[],ie]:[null,[],ie];if(Me.language=Ne.language,Me.variables.clear(),Me.functions.clear(),Me.instances.clear(),!en(ee))throw new cP(ee);for(let Oe of Ee)if(!en(Oe))throw new cP(Oe);return We(ee,Ee,Ne)}o(je,"Code"),e.Code=je;function Se(H,ie=[]){let ee=je(H,ie,{language:"javascript"}),Ee=globalThis.Function("kind","format","hash",ee),Ne=new Map(Me.instances);function Oe($n,ot,zt){if(!Mo.Has($n)||!Ne.has(ot))return!1;let Jo=Mo.Get($n),Ro=Ne.get(ot);return Jo(Ro,zt)}o(Oe,"typeRegistryFunction");function Ye($n,ot){return ma.Has($n)?ma.Get($n)(ot):!1}o(Ye,"formatRegistryFunction");function Pt($n){return ch($n)}o(Pt,"hashFunction");let Er=Ee(Oe,Ye,Pt);return new rA(H,ie,Er,ee)}o(Se,"Compile"),e.Compile=Se})(pP||(pP={}));g();g();var BJ={},cwe=o(function(e,t,r,n,i){var s=new Worker(BJ[t]||(BJ[t]=URL.createObjectURL(new Blob([e+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return s.onmessage=function(l){var c=l.data,p=c.$e$;if(p){var h=new Error(p[0]);h.code=p[1],h.stack=p[2],i(h,null)}else i(null,c)},s.postMessage(r,n),s},"wk"),ii=Uint8Array,ya=Uint16Array,CI=Int32Array,N1=new ii([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),k1=new ii([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),_I=new ii([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),UJ=o(function(e,t){for(var r=new ya(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var i=new CI(r[30]),n=1;n<30;++n)for(var s=r[n];s<r[n+1];++s)i[s]=s-r[n]<<5|n;return{b:r,r:i}},"freb"),VJ=UJ(N1,2),mA=VJ.b,gP=VJ.r;mA[28]=258,gP[258]=28;var zJ=UJ(k1,0),qJ=zJ.b,cA=zJ.r,SI=new ya(32768);for(wn=0;wn<32768;++wn)kf=(wn&43690)>>1|(wn&21845)<<1,kf=(kf&52428)>>2|(kf&13107)<<2,kf=(kf&61680)>>4|(kf&3855)<<4,SI[wn]=((kf&65280)>>8|(kf&255)<<8)>>1;var kf,wn,tu=o(function(e,t,r){for(var n=e.length,i=0,s=new ya(t);i<n;++i)e[i]&&++s[e[i]-1];var l=new ya(t);for(i=1;i<t;++i)l[i]=l[i-1]+s[i-1]<<1;var c;if(r){c=new ya(1<<t);var p=15-t;for(i=0;i<n;++i)if(e[i])for(var h=i<<4|e[i],y=t-e[i],b=l[e[i]-1]++<<y,_=b|(1<<y)-1;b<=_;++b)c[SI[b]>>p]=h}else for(c=new ya(n),i=0;i<n;++i)e[i]&&(c[i]=SI[l[e[i]-1]++]>>15-e[i]);return c},"hMap"),Rf=new ii(288);for(wn=0;wn<144;++wn)Rf[wn]=8;var wn;for(wn=144;wn<256;++wn)Rf[wn]=9;var wn;for(wn=256;wn<280;++wn)Rf[wn]=7;var wn;for(wn=280;wn<288;++wn)Rf[wn]=8;var wn,F1=new ii(32);for(wn=0;wn<32;++wn)F1[wn]=5;var wn,HJ=tu(Rf,9,0),WJ=tu(Rf,9,1),XJ=tu(F1,5,0),YJ=tu(F1,5,1),dP=o(function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},"max"),eu=o(function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(t&7)&r},"bits"),hP=o(function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},"bits16"),wI=o(function(e){return(e+7)/8|0},"shft"),Sg=o(function(e,t,r){return(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length),new ii(e.subarray(t,r))},"slc"),xP={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14},ZJ=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],go=o(function(e,t,r){var n=new Error(t||ZJ[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,go),!r)throw n;return n},"err"),KJ=o(function(e,t,r,n){var i=e.length,s=n?n.length:0;if(!i||t.f&&!t.l)return r||new ii(0);var l=!r,c=l||t.i!=2,p=t.i;l&&(r=new ii(i*3));var h=o(function(ee){var Ee=r.length;if(ee>Ee){var Ne=new ii(Math.max(Ee*2,ee));Ne.set(r),r=Ne}},"cbuf"),y=t.f||0,b=t.p||0,_=t.b||0,C=t.l,P=t.d,E=t.m,T=t.n,O=i*8;do{if(!C){y=eu(e,b,1);var D=eu(e,b+1,3);if(b+=3,D)if(D==1)C=WJ,P=YJ,E=9,T=5;else if(D==2){var X=eu(e,b,31)+257,Y=eu(e,b+10,15)+4,N=X+eu(e,b+5,31)+1;b+=14;for(var Z=new ii(N),ae=new ii(19),se=0;se<Y;++se)ae[_I[se]]=eu(e,b+se*3,7);b+=Y*3;for(var U=dP(ae),xe=(1<<U)-1,ne=tu(ae,U,1),se=0;se<N;){var Pe=ne[eu(e,b,xe)];b+=Pe&15;var A=Pe>>4;if(A<16)Z[se++]=A;else{var Ce=0,Ue=0;for(A==16?(Ue=3+eu(e,b,3),b+=2,Ce=Z[se-1]):A==17?(Ue=3+eu(e,b,7),b+=3):A==18&&(Ue=11+eu(e,b,127),b+=7);Ue--;)Z[se++]=Ce}}var _e=Z.subarray(0,X),Me=Z.subarray(X);E=dP(_e),T=dP(Me),C=tu(_e,E,1),P=tu(Me,T,1)}else go(1);else{var A=wI(b)+4,R=e[A-4]|e[A-3]<<8,j=A+R;if(j>i){p&&go(0);break}c&&h(_+R),r.set(e.subarray(A,j),_),t.b=_+=R,t.p=b=j*8,t.f=y;continue}if(b>O){p&&go(0);break}}c&&h(_+131072);for(var Q=(1<<E)-1,it=(1<<T)-1,Ke=b;;Ke=b){var Ce=C[hP(e,b)&Q],rt=Ce>>4;if(b+=Ce&15,b>O){p&&go(0);break}if(Ce||go(2),rt<256)r[_++]=rt;else if(rt==256){Ke=b,C=null;break}else{var Ae=rt-254;if(rt>264){var se=rt-257,Be=N1[se];Ae=eu(e,b,(1<<Be)-1)+mA[se],b+=Be}var We=P[hP(e,b)&it],je=We>>4;We||go(3),b+=We&15;var Me=qJ[je];if(je>3){var Be=k1[je];Me+=hP(e,b)&(1<<Be)-1,b+=Be}if(b>O){p&&go(0);break}c&&h(_+131072);var Se=_+Ae;if(_<Me){var H=s-Me,ie=Math.min(Me,Se);for(H+_<0&&go(3);_<ie;++_)r[_]=n[H+_]}for(;_<Se;++_)r[_]=r[_-Me]}}t.l=C,t.p=Ke,t.b=_,t.f=y,C&&(y=1,t.m=E,t.d=P,t.n=T)}while(!y);return _!=r.length&&l?Sg(r,0,_):r.subarray(0,_)},"inflt"),fp=o(function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},"wbits"),A1=o(function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16},"wbits16"),mP=o(function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var i=r.length,s=r.slice();if(!i)return{t:yA,l:0};if(i==1){var l=new ii(r[0].s+1);return l[r[0].s]=1,{t:l,l:1}}r.sort(function(j,X){return j.f-X.f}),r.push({s:-1,f:25001});var c=r[0],p=r[1],h=0,y=1,b=2;for(r[0]={s:-1,f:c.f+p.f,l:c,r:p};y!=i-1;)c=r[r[h].f<r[b].f?h++:b++],p=r[h!=y&&r[h].f<r[b].f?h++:b++],r[y++]={s:-1,f:c.f+p.f,l:c,r:p};for(var _=s[0].s,n=1;n<i;++n)s[n].s>_&&(_=s[n].s);var C=new ya(_+1),P=yP(r[y-1],C,0);if(P>t){var n=0,E=0,T=P-t,O=1<<T;for(s.sort(function(X,Y){return C[Y.s]-C[X.s]||X.f-Y.f});n<i;++n){var D=s[n].s;if(C[D]>t)E+=O-(1<<P-C[D]),C[D]=t;else break}for(E>>=T;E>0;){var A=s[n].s;C[A]<t?E-=1<<t-C[A]++-1:++n}for(;n>=0&&E;--n){var R=s[n].s;C[R]==t&&(--C[R],++E)}P=t}return{t:new ii(C),l:P}},"hTree"),yP=o(function(e,t,r){return e.s==-1?Math.max(yP(e.l,t,r+1),yP(e.r,t,r+1)):t[e.s]=r},"ln"),pA=o(function(e){for(var t=e.length;t&&!e[--t];);for(var r=new ya(++t),n=0,i=e[0],s=1,l=o(function(p){r[n++]=p},"w"),c=1;c<=t;++c)if(e[c]==i&&c!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)l(32754);s>2&&(l(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(l(i),--s;s>6;s-=6)l(8304);s>2&&(l(s-3<<5|8208),s=0)}for(;s--;)l(i);s=1,i=e[c]}return{c:r.subarray(0,n),n:t}},"lc"),D1=o(function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},"clen"),gA=o(function(e,t,r){var n=r.length,i=wI(t+2);e[i]=n&255,e[i+1]=n>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var s=0;s<n;++s)e[i+s+4]=r[s];return(i+4+n)*8},"wfblk"),fA=o(function(e,t,r,n,i,s,l,c,p,h,y){fp(t,y++,r),++i[256];for(var b=mP(i,15),_=b.t,C=b.l,P=mP(s,15),E=P.t,T=P.l,O=pA(_),D=O.c,A=O.n,R=pA(E),j=R.c,X=R.n,Y=new ya(19),N=0;N<D.length;++N)++Y[D[N]&31];for(var N=0;N<j.length;++N)++Y[j[N]&31];for(var Z=mP(Y,7),ae=Z.t,se=Z.l,U=19;U>4&&!ae[_I[U-1]];--U);var xe=h+5<<3,ne=D1(i,Rf)+D1(s,F1)+l,Pe=D1(i,_)+D1(s,E)+l+14+3*U+D1(Y,ae)+2*Y[16]+3*Y[17]+7*Y[18];if(p>=0&&xe<=ne&&xe<=Pe)return gA(t,y,e.subarray(p,p+h));var Ce,Ue,_e,Me;if(fp(t,y,1+(Pe<ne)),y+=2,Pe<ne){Ce=tu(_,C,0),Ue=_,_e=tu(E,T,0),Me=E;var Q=tu(ae,se,0);fp(t,y,A-257),fp(t,y+5,X-1),fp(t,y+10,U-4),y+=14;for(var N=0;N<U;++N)fp(t,y+3*N,ae[_I[N]]);y+=3*U;for(var it=[D,j],Ke=0;Ke<2;++Ke)for(var rt=it[Ke],N=0;N<rt.length;++N){var Ae=rt[N]&31;fp(t,y,Q[Ae]),y+=ae[Ae],Ae>15&&(fp(t,y,rt[N]>>5&127),y+=rt[N]>>12)}}else Ce=HJ,Ue=Rf,_e=XJ,Me=F1;for(var N=0;N<c;++N){var Be=n[N];if(Be>255){var Ae=Be>>18&31;A1(t,y,Ce[Ae+257]),y+=Ue[Ae+257],Ae>7&&(fp(t,y,Be>>23&31),y+=N1[Ae]);var We=Be&31;A1(t,y,_e[We]),y+=Me[We],We>3&&(A1(t,y,Be>>5&8191),y+=k1[We])}else A1(t,y,Ce[Be]),y+=Ue[Be]}return A1(t,y,Ce[256]),y+Ue[256]},"wblk"),JJ=new CI([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),yA=new ii(0),QJ=o(function(e,t,r,n,i,s){var l=s.z||e.length,c=new ii(n+l+5*(1+Math.ceil(l/7e3))+i),p=c.subarray(n,c.length-i),h=s.l,y=(s.r||0)&7;if(t){y&&(p[0]=s.r>>3);for(var b=JJ[t-1],_=b>>13,C=b&8191,P=(1<<r)-1,E=s.p||new ya(32768),T=s.h||new ya(P+1),O=Math.ceil(r/3),D=2*O,A=o(function(Oe){return(e[Oe]^e[Oe+1]<<O^e[Oe+2]<<D)&P},"hsh"),R=new CI(25e3),j=new ya(288),X=new ya(32),Y=0,N=0,Z=s.i||0,ae=0,se=s.w||0,U=0;Z+2<l;++Z){var xe=A(Z),ne=Z&32767,Pe=T[xe];if(E[ne]=Pe,T[xe]=ne,se<=Z){var Ce=l-Z;if((Y>7e3||ae>24576)&&(Ce>423||!h)){y=fA(e,p,0,R,j,X,N,ae,U,Z-U,y),ae=Y=N=0,U=Z;for(var Ue=0;Ue<286;++Ue)j[Ue]=0;for(var Ue=0;Ue<30;++Ue)X[Ue]=0}var _e=2,Me=0,Q=C,it=ne-Pe&32767;if(Ce>2&&xe==A(Z-it))for(var Ke=Math.min(_,Ce)-1,rt=Math.min(32767,Z),Ae=Math.min(258,Ce);it<=rt&&--Q&&ne!=Pe;){if(e[Z+_e]==e[Z+_e-it]){for(var Be=0;Be<Ae&&e[Z+Be]==e[Z+Be-it];++Be);if(Be>_e){if(_e=Be,Me=it,Be>Ke)break;for(var We=Math.min(it,Be-2),je=0,Ue=0;Ue<We;++Ue){var Se=Z-it+Ue&32767,H=E[Se],ie=Se-H&32767;ie>je&&(je=ie,Pe=Se)}}}ne=Pe,Pe=E[ne],it+=ne-Pe&32767}if(Me){R[ae++]=268435456|gP[_e]<<18|cA[Me];var ee=gP[_e]&31,Ee=cA[Me]&31;N+=N1[ee]+k1[Ee],++j[257+ee],++X[Ee],se=Z+_e,++Y}else R[ae++]=e[Z],++j[e[Z]]}}for(Z=Math.max(Z,se);Z<l;++Z)R[ae++]=e[Z],++j[e[Z]];y=fA(e,p,h,R,j,X,N,ae,U,Z-U,y),h||(s.r=y&7|p[y/8|0]<<3,y-=7,s.h=T,s.p=E,s.i=Z,s.w=se)}else{for(var Z=s.w||0;Z<l+h;Z+=65535){var Ne=Z+65535;Ne>=l&&(p[y/8|0]=h,Ne=l),y=gA(p,y+1,e.subarray(Z,Ne))}s.i=l}return Sg(c,0,n+wI(y)+i)},"dflt"),pwe=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(r&1&&-306674912)^r>>>1;e[t]=r}return e}(),fwe=o(function(){var e=-1;return{p:o(function(t){for(var r=e,n=0;n<t.length;++n)r=pwe[r&255^t[n]]^r>>>8;e=r},"p"),d:o(function(){return~e},"d")}},"crc");var eQ=o(function(e,t,r,n,i){if(!i&&(i={l:1},t.dictionary)){var s=t.dictionary.subarray(-32768),l=new ii(s.length+e.length);l.set(s),l.set(e,s.length),e=l,i.w=s.length}return QJ(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,r,n,i)},"dopt"),vA=o(function(e,t){var r={};for(var n in e)r[n]=e[n];for(var n in t)r[n]=t[n];return r},"mrg"),$J=o(function(e,t,r){for(var n=e(),i=e.toString(),s=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),l=0;l<n.length;++l){var c=n[l],p=s[l];if(typeof c=="function"){t+=";"+p+"=";var h=c.toString();if(c.prototype)if(h.indexOf("[native code]")!=-1){var y=h.indexOf(" ",8)+1;t+=h.slice(y,h.indexOf("(",y))}else{t+=h;for(var b in c.prototype)t+=";"+p+".prototype."+b+"="+c.prototype[b].toString()}else t+=h}else r[p]=c}return t},"wcln"),fP=[],dwe=o(function(e){var t=[];for(var r in e)e[r].buffer&&t.push((e[r]=new e[r].constructor(e[r])).buffer);return t},"cbfs"),hwe=o(function(e,t,r,n){if(!fP[r]){for(var i="",s={},l=e.length-1,c=0;c<l;++c)i=$J(e[c],i,s);fP[r]={c:$J(e[l],i,s),e:s}}var p=vA({},fP[r].e);return cwe(fP[r].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",r,p,dwe(p),n)},"wrkr"),mwe=o(function(){return[ii,ya,CI,N1,k1,_I,mA,qJ,WJ,YJ,SI,ZJ,tu,dP,eu,hP,wI,Sg,go,KJ,xA,IP,tQ]},"bInflt"),gwe=o(function(){return[ii,ya,CI,N1,k1,_I,gP,cA,HJ,Rf,XJ,F1,SI,JJ,yA,tu,fp,A1,mP,yP,pA,D1,gA,fA,wI,Sg,QJ,eQ,bA,IP]},"bDflt");var IP=o(function(e){return postMessage(e,[e.buffer])},"pbf"),tQ=o(function(e){return e&&{out:e.size&&new ii(e.size),dictionary:e.dictionary}},"gopt"),rQ=o(function(e,t,r,n,i,s){var l=hwe(r,n,i,function(c,p){l.terminate(),s(c,p)});return l.postMessage([e,t],t.consume?[e.buffer]:[]),function(){l.terminate()}},"cbify");var dp=o(function(e,t){return e[t]|e[t+1]<<8},"b2"),Xu=o(function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},"b4"),uA=o(function(e,t){return Xu(e,t)+Xu(e,t+4)*4294967296},"b8"),bs=o(function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},"wbytes");function ywe(e,t,r){return r||(r=t,t={}),typeof r!="function"&&go(7),rQ(e,t,[gwe],function(n){return IP(bA(n.data[0],n.data[1]))},0,r)}o(ywe,"deflate");function bA(e,t){return eQ(e,t||{},0,0)}o(bA,"deflateSync");function vwe(e,t,r){return r||(r=t,t={}),typeof r!="function"&&go(7),rQ(e,t,[mwe],function(n){return IP(xA(n.data[0],tQ(n.data[1])))},1,r)}o(vwe,"inflate");function xA(e,t){return KJ(e,{i:2},t&&t.out,t&&t.dictionary)}o(xA,"inflateSync");var nQ=o(function(e,t,r,n){for(var i in e){var s=e[i],l=t+i,c=n;Array.isArray(s)&&(c=vA(n,s[1]),s=s[0]),s instanceof ii?r[l]=[s,c]:(r[l+="/"]=[new ii(0),c],nQ(s,l,r,n))}},"fltn"),jJ=typeof TextEncoder<"u"&&new TextEncoder,dA=typeof TextDecoder<"u"&&new TextDecoder,bwe=0;try{dA.decode(yA,{stream:!0}),bwe=1}catch(e){}var xwe=o(function(e){for(var t="",r=0;;){var n=e[r++],i=(n>127)+(n>223)+(n>239);if(r+i>e.length)return{s:t,r:Sg(e,r-1)};i?i==3?(n=((n&15)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,t+=String.fromCharCode(55296|n>>10,56320|n&1023)):i&1?t+=String.fromCharCode((n&31)<<6|e[r++]&63):t+=String.fromCharCode((n&15)<<12|(e[r++]&63)<<6|e[r++]&63):t+=String.fromCharCode(n)}},"dutf8");function vP(e,t){if(t){for(var r=new ii(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}if(jJ)return jJ.encode(e);for(var i=e.length,s=new ii(e.length+(e.length>>1)),l=0,c=o(function(y){s[l++]=y},"w"),n=0;n<i;++n){if(l+5>s.length){var p=new ii(l+8+(i-n<<1));p.set(s),s=p}var h=e.charCodeAt(n);h<128||t?c(h):h<2048?(c(192|h>>6),c(128|h&63)):h>55295&&h<57344?(h=65536+(h&1047552)|e.charCodeAt(++n)&1023,c(240|h>>18),c(128|h>>12&63),c(128|h>>6&63),c(128|h&63)):(c(224|h>>12),c(128|h>>6&63),c(128|h&63))}return Sg(s,0,l)}o(vP,"strToU8");function IA(e,t){if(t){for(var r="",n=0;n<e.length;n+=16384)r+=String.fromCharCode.apply(null,e.subarray(n,n+16384));return r}else{if(dA)return dA.decode(e);var i=xwe(e),s=i.s,r=i.r;return r.length&&go(8),s}}o(IA,"strFromU8");var Iwe=o(function(e,t){return t+30+dp(e,t+26)+dp(e,t+28)},"slzh"),_we=o(function(e,t,r){var n=dp(e,t+28),i=IA(e.subarray(t+46,t+46+n),!(dp(e,t+8)&2048)),s=t+46+n,l=Xu(e,t+20),c=r&&l==4294967295?Swe(e,s):[l,Xu(e,t+24),Xu(e,t+42)],p=c[0],h=c[1],y=c[2];return[dp(e,t+10),p,h,i,s+dp(e,t+30)+dp(e,t+32),y]},"zh"),Swe=o(function(e,t){for(;dp(e,t)!=1;t+=4+dp(e,t+2));return[uA(e,t+12),uA(e,t+4),uA(e,t+20)]},"z64e"),hA=o(function(e){var t=0;if(e)for(var r in e){var n=e[r].length;n>65535&&go(9),t+=n+4}return t},"exfl"),GJ=o(function(e,t,r,n,i,s,l,c){var p=n.length,h=r.extra,y=c&&c.length,b=hA(h);bs(e,t,l!=null?33639248:67324752),t+=4,l!=null&&(e[t++]=20,e[t++]=r.os),e[t]=20,t+=2,e[t++]=r.flag<<1|(s<0&&8),e[t++]=i&&8,e[t++]=r.compression&255,e[t++]=r.compression>>8;var _=new Date(r.mtime==null?Date.now():r.mtime),C=_.getFullYear()-1980;if((C<0||C>119)&&go(10),bs(e,t,C<<25|_.getMonth()+1<<21|_.getDate()<<16|_.getHours()<<11|_.getMinutes()<<5|_.getSeconds()>>1),t+=4,s!=-1&&(bs(e,t,r.crc),bs(e,t+4,s<0?-s-2:s),bs(e,t+8,r.size)),bs(e,t+12,p),bs(e,t+14,b),t+=16,l!=null&&(bs(e,t,y),bs(e,t+6,r.attrs),bs(e,t+10,l),t+=14),e.set(n,t),t+=p,b)for(var P in h){var E=h[P],T=E.length;bs(e,t,+P),bs(e,t+2,T),e.set(E,t+4),t+=4+T}return y&&(e.set(c,t),t+=y),t},"wzh"),Cwe=o(function(e,t,r,n,i){bs(e,t,101010256),bs(e,t+8,r),bs(e,t+10,r),bs(e,t+12,n),bs(e,t+16,i)},"wzf");function iQ(e,t,r){r||(r=t,t={}),typeof r!="function"&&go(7);var n={};nQ(e,"",n,t);var i=Object.keys(n),s=i.length,l=0,c=0,p=s,h=new Array(s),y=[],b=o(function(){for(var T=0;T<y.length;++T)y[T]()},"tAll"),_=o(function(T,O){bP(function(){r(T,O)})},"cbd");bP(function(){_=r});var C=o(function(){var T=new ii(c+22),O=l,D=c-l;c=0;for(var A=0;A<p;++A){var R=h[A];try{var j=R.c.length;GJ(T,c,R,R.f,R.u,j);var X=30+R.f.length+hA(R.extra),Y=c+X;T.set(R.c,Y),GJ(T,l,R,R.f,R.u,j,c,R.m),l+=16+X+(R.m?R.m.length:0),c=Y+j}catch(N){return _(N,null)}}Cwe(T,l,h.length,D,O),_(null,T)},"cbf");s||C();for(var P=o(function(T){var O=i[T],D=n[O],A=D[0],R=D[1],j=fwe(),X=A.length;j.p(A);var Y=vP(O),N=Y.length,Z=R.comment,ae=Z&&vP(Z),se=ae&&ae.length,U=hA(R.extra),xe=R.level==0?0:8,ne=o(function(Pe,Ce){if(Pe)b(),_(Pe,null);else{var Ue=Ce.length;h[T]=vA(R,{size:X,crc:j.d(),c:Ce,f:Y,m:ae,u:N!=O.length||ae&&Z.length!=se,compression:xe}),l+=30+N+U+Ue,c+=76+2*(N+U)+(se||0)+Ue,--s||C()}},"cbl");if(N>65535&&ne(go(11,0,1),null),!xe)ne(null,A);else if(X<16e4)try{ne(null,bA(A,R))}catch(Pe){ne(Pe,null)}else y.push(ywe(A,R,ne))},"_loop_1"),E=0;E<p;++E)P(E);return b}o(iQ,"zip");var bP=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(e){e()};function oQ(e,t,r){r||(r=t,t={}),typeof r!="function"&&go(7);var n=[],i=o(function(){for(var T=0;T<n.length;++T)n[T]()},"tAll"),s={},l=o(function(T,O){bP(function(){r(T,O)})},"cbd");bP(function(){l=r});for(var c=e.length-22;Xu(e,c)!=101010256;--c)if(!c||e.length-c>65558)return l(go(13,0,1),null),i;var p=dp(e,c+8);if(p){var h=p,y=Xu(e,c+16),b=y==4294967295||h==65535;if(b){var _=Xu(e,c-12);b=Xu(e,_)==101075792,b&&(h=p=Xu(e,_+32),y=Xu(e,_+48))}for(var C=t&&t.filter,P=o(function(T){var O=_we(e,y,b),D=O[0],A=O[1],R=O[2],j=O[3],X=O[4],Y=O[5],N=Iwe(e,Y);y=X;var Z=o(function(se,U){se?(i(),l(se,null)):(U&&(s[j]=U),--p||l(null,s))},"cbl");if(!C||C({name:j,size:A,originalSize:R,compression:D}))if(!D)Z(null,Sg(e,N,N+A));else if(D==8){var ae=e.subarray(N,N+A);if(R<524288||A>.8*R)try{Z(null,xA(ae,{out:new ii(R)}))}catch(se){Z(se,null)}else n.push(vwe(ae,{size:R},Z))}else Z(go(14,"unknown compression type "+D,1),null);else Z(null,null)},"_loop_3"),E=0;E<h;++E)P(E)}else l(null,{});return i}o(oQ,"unzip");g();var wwe=o(e=>{if(e!=null)return e.trim()===""?void 0:e},"maybePath"),Pwe=o(e=>e!=null,"notNull"),_P=o((e,t,r=0)=>{var n;if(oe.IsNull(e))return"null";if(oe.IsUndefined(e))return"undefined";if(oe.IsString(e))return"<string>";if(oe.IsNumber(e))return"<number>";if(oe.IsBoolean(e))return"<boolean>";if(oe.IsLiteral(e))return typeof e.const=="string"?"'".concat(e.const,"'"):"".concat(e.const);if(oe.IsRef(e)){let i=t.find(s=>s.$id===e.$ref);return i==null?e.$ref:_P(i,t,r)}if(oe.IsArray(e))return"".concat(_P(e.items,t,r+1),"[]");if(oe.IsUnion(e)&&(!(e.anyOf.length>5)||e.$id==null)){let s="".concat(e.anyOf.map(l=>_P(l,t,r+1)).filter(Pwe).join(" | "));return r>0?"(".concat(s,")"):s}return(n=e.$id)!=null?n:""},"resolveSchemaIdent"),Twe=o((e,t,r)=>{var s;let n=t.message;oe.IsUnion(t.schema)&&(n="Expected one of: ".concat(_P(t.schema,r)));let i="#/definitions/".concat(e).concat((s=wwe(t.path))!=null?s:"");return"".concat(i,": ").concat(n)},"errorHandler"),SP=o((e,t,r)=>{let n=t.First();if(n!=null)return Twe(e,n,r)},"shortError");var R1;(function(e){e.Archive="Archive",e.Validate="Validate",e.Encode="Encode",e.Unknown="Unknown"})(R1||(R1={}));var SA=class SA extends Error{constructor(r,n){super(n);x(this,"name");x(this,"kind");this.name="CompressError",this.kind=r}};o(SA,"CompressError");var B1=SA,Ewe=o(e=>new B1(R1.Archive,e.message),"flateErrorIntoCompressError"),Mwe=o(e=>{let t=Object.values(xP);return e instanceof Error&&"code"in e&&typeof e.code=="number"&&t.includes(e.code)},"isFlateError"),Owe=o((e,t,r)=>{var n;return new B1(R1.Validate,(n=SP(e,t,r))!=null?n:"Unknown validate error")},"checkErrorIntoCompressError"),Lwe=o(e=>new B1(R1.Encode,e.message),"encodeErrorIntoCompressError"),Awe=o(e=>new B1(R1.Unknown,e instanceof Error?e.message:String(e)),"unknownErrorIntoCompressError"),_A=o((e,t,r)=>t instanceof bg?Lwe(t):t instanceof Kl?Owe(e,t,r):Mwe(t)?Ewe(t):Awe(t),"intoCompressError");g();var $1;(function(e){e.Unarchive="Unarchive",e.Validate="Validate",e.Decode="Decode",e.Unknown="Unknown"})($1||($1={}));var wA=class wA extends Error{constructor(r,n){super(n);x(this,"name");x(this,"kind");this.name="DecompressError",this.kind=r}};o(wA,"DecompressError");var j1=wA,Dwe=o(e=>new j1($1.Unarchive,e.message),"flateErrorIntoDecompressError"),Fwe=o(e=>{let t=Object.values(xP);return e instanceof Error&&"code"in e&&typeof e.code=="number"&&t.includes(e.code)},"isFlateError"),Nwe=o((e,t,r)=>{var n;return new j1($1.Validate,(n=SP(e,t,r))!=null?n:"Unknown validate error")},"checkErrorIntoDecompressError"),kwe=o(e=>new j1($1.Decode,e.message),"decodeErrorIntoDecompressError"),Rwe=o(e=>new j1($1.Unknown,e instanceof Error?e.message:String(e)),"unknownErrorIntoDecompressError"),CA=o((e,t,r)=>t instanceof vg?kwe(t):t instanceof Kl?Nwe(e,t,r):Fwe(t)?Dwe(t):Rwe(t),"intoDecompressError");g();g();g();var Bwe=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,$we=[0,31,28,31,30,31,30,31,31,30,31,30,31],jwe=o(e=>e%4===0&&(e%100!==0||e%400===0),"isLeapYear"),CP=o(e=>{let t=Bwe.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],i=+t[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&jwe(r)?29:$we[n])},"date");g();var Gwe=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i,wP=o(e=>{let t=Gwe.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],i=+t[3],s=t[4],l=t[5]==="-"?-1:1,c=+(t[6]||0),p=+(t[7]||0);if(c>23||p>59||!s)return!1;if(r<=23&&n<=59&&i<60)return!0;let h=n-p*l,y=r-c*l-(h<0?1:0);return(y===23||y===-1)&&(h===59||h===-1)&&i<61},"time");var Uwe=/t|\s/i,sQ=o(e=>{let t=e.split(Uwe);return t.length===2&&CP(t[0])&&wP(t[1])},"dateTime");g();var Vwe=/\/|:/,zwe=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,aQ=o(e=>Vwe.test(e)&&zwe.test(e),"uri");var qwe=[["date",CP],["time",wP],["date-time",sQ],["uri",aQ]],lQ=o(()=>{for(let[e,t]of qwe)try{Hw.Format(e,t)}catch(r){if(r instanceof vI)continue;throw r}},"registerFormats");g();g();g();var uQ=o(e=>e instanceof Error?e:new Error(String(e)),"asError");var PP=o(e=>(...t)=>{try{return st(e(...t))}catch(r){return lt(uQ(r))}},"safeFn");var Hwe=PP((e,t)=>{let r={};for(let n of t)for(let i of n.intoBundle(e))r[i.path]=vP(JSON.stringify(i.contents));return r}),PA=o(async(e,t,r)=>Hwe(e,t).andThenAsync(n=>new Promise(i=>{iQ(n,re(k({},r),{consume:!0}),(s,l)=>{i(s?lt(s):st(l))})})),"compress");g();g();function TP(e,t,r=[]){let n=k({},e);for(let[i,s]of Object.entries(t))if(s!==void 0)if(i in n){let l=i;if(Array.isArray(s)&&s.length>0){let c=Wwe(s[0],r);if(c){let p=n[l];if(!Array.isArray(p))throw new Error("Expected array at ".concat(i,", got ").concat(typeof p));let h=new Map(s.map(_=>[cQ(_,c),_])),b=p.map(_=>{let C=h.get(cQ(_,c));return C?TP(_,C,r):_});n[l]=b}else n[l]=s}else{let c=n[l];typeof c=="object"&&c!==null&&typeof s=="object"&&s!==null?Object.keys(s).length===0?n[l]=s:n[l]=TP(c,s,r):n[i]=s}}else n[i]=s;return n}o(TP,"deepMergeOn");function Wwe(e,t){function r(n){if(typeof n!="object"||n===null)return null;for(let i of t)if(i in n&&typeof n[i]<"u")return[i];if(Array.isArray(n))return null;for(let[i,s]of Object.entries(n)){let l=r(s);if(l)return[i,...l]}return null}return o(r,"search"),r(e)}o(Wwe,"findIdentifierKey");function cQ(e,t){return t.reduce((r,n)=>{if(r&&typeof r=="object")return r[n]},e)}o(cQ,"getValueByKeyPath");var Xwe=o(e=>e,"identity"),Ywe=o(e=>JSON.parse(IA(e)),"jsonDecode"),Zwe=o((e,t)=>t.some(r=>r.fromBundle(e.name,new Uint8Array,Xwe)!==void 0),"isFileExpected"),Kwe=PP((e,t)=>{let r={};for(let n of Object.keys(e)){let i=e[n];for(let s of t){let l=s.fromBundle(n,i,Ywe);if(l){r=TP(r,l,[]);break}}}return r}),TA=o(async(e,t)=>new Promise(r=>oQ(e,{filter:o(n=>Zwe(n,t),"filter")},(n,i)=>{r(n?lt(n):st(i))})).then(r=>r.andThen(n=>Kwe(n,t))),"decompress");g();var Jwe=o(e=>typeof e=="object"&&e!=null&&"$ref"in e&&typeof e.$ref=="string","isRef"),Qwe=o(e=>{if(e.length<2)return!1;let t=e.filter(Jwe);if(t.length!==e.length)return!1;let r=t[0].$ref;return t.slice(1).every(n=>n.$ref===r)},"isDuplicateRef"),EP=o(e=>typeof e=="object"&&e!=null&&"allOf"in e&&Array.isArray(e.allOf)&&Qwe(e.allOf)?e.allOf[0]:typeof e=="object"&&e!=null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,EP(r)])):Array.isArray(e)?e.map(EP):e,"fixDuplicateAllOf");g();var MP=o(e=>typeof e=="object"&&e!=null&&"$ref"in e?re(k({},e),{$ref:"#/definitions/".concat(e.$ref)}):typeof e=="object"&&e!=null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,MP(r)])):Array.isArray(e)?e.map(MP):e,"prefixReferences");var G1;(function(e){e.InvalidTypeboxSchema="InvalidTypeboxSchema",e.MissingReferenceId="MissingReferenceId",e.DuplicateReferenceId="DuplicateReferenceId",e.TypeboxError="TypeboxError",e.UnknownError="UnknownError"})(G1||(G1={}));var ePe=o(e=>({next(){for(let r of e){let n=r.next();if(!n.done)return n}return{done:!0,value:void 0}},[Symbol.iterator](){return this}}),"join"),tPe=o((...e)=>{let t=new Map;for(let r of ePe(e)){if(!r.$id)continue;let n=t.get(r.$id);if(n!=null&&n!==r)return lt({kind:G1.DuplicateReferenceId,message:"Failed to register a reference for a schema with an $id that has already been used",schema:r});t.set(r.$id,r)}return st(t)},"computeReferenceMap"),ru,Cg,Bf,Yu,LP=class LP{constructor(t,r,n,i){G(this,ru);G(this,Cg);G(this,Bf,[]);G(this,Yu);q(this,ru,t),q(this,Cg,r),q(this,Bf,n),q(this,Yu,i),this.is=this.is.bind(this),this.parse=this.parse.bind(this),this.verify=this.verify.bind(this),this.jsonSchema=this.jsonSchema.bind(this),this.compress=this.compress.bind(this),this.decompress=this.decompress.bind(this)}static create(t,r="CoreMVF"){let n=L.Composite(t.extensions.map(s=>s.schema),{$id:r});if(!oe.IsSchema(n))return lt({kind:G1.InvalidTypeboxSchema,message:"Attempting to merge schemas produced an invalid schema",schema:n});let i=tPe(hL.values(),aL.values(),uL.values(),pL.values(),fL.values(),SL.values(),t.extensions.flatMap(s=>{var l;return(l=s.references)!=null?l:[]}).values());if(!i.isOk())return i;try{lQ();let s=pP.Compile(n,[...i.value.values()]);return st(new LP(n,s,t.extensions,i.value))}catch(s){return s instanceof Mt?lt({kind:G1.TypeboxError,message:s.message,original:s}):lt({kind:G1.UnknownError,message:"An unknown error occurred while compiling the schema",original:s})}}is(t){return d(this,Cg).Check(t)}parse(t){return d(this,Cg).Check(t)?st(t):lt(d(this,Cg).Errors(t))}decode(t){try{return st(kJ(d(this,ru),[...d(this,Yu).values()],t))}catch(r){return lt(r)}}encode(t){try{return st(RJ(d(this,ru),[...d(this,Yu).values()],t))}catch(r){return lt(r)}}verify(t){for(let r of d(this,Bf))if(r.integrityCheck){let n=r.integrityCheck(t);if(n.isErr())return lt(n.error)}return st(!0)}jsonSchema(){var n;let t=JSON.parse(JSON.stringify([d(this,ru),...d(this,Yu).values()])),r=EP(MP({$id:"#/definitions/".concat((n=d(this,ru).$id)!=null?n:"CoreMVF"),$schema:"http://json-schema.org/draft-07/schema#",references:t}));return JSON.stringify(r,null,2)}async compress(t){return this.encode(t).andThen(r=>this.parse(r)).andThenAsync(r=>PA(r,d(this,Bf))).then(r=>r.mapErr(n=>{var i;return _A((i=d(this,ru).$id)!=null?i:"CoreMVF",n,[...d(this,Yu).values()])}))}async compressUnsafe(t){return this.encode(t).andThenAsync(r=>PA(r,d(this,Bf))).then(r=>r.mapErr(n=>{var i;return _A((i=d(this,ru).$id)!=null?i:"CoreMVF",n,[...d(this,Yu).values()])}))}async decompress(t){return TA(t,d(this,Bf)).then(r=>r.andThen(n=>this.parse(n)).andThen(n=>this.decode(n)).mapErr(n=>{var i;return CA((i=d(this,ru).$id)!=null?i:"CoreMVF",n,[...d(this,Yu).values()])}))}async decompressUnsafe(t){return TA(t,d(this,Bf)).then(r=>r.andThen(n=>this.decode(n)).mapErr(n=>{var i;return CA((i=d(this,ru).$id)!=null?i:"CoreMVF",n,[...d(this,Yu).values()])}))}};ru=new WeakMap,Cg=new WeakMap,Bf=new WeakMap,Yu=new WeakMap,o(LP,"MVFParser");var OP=LP;var U1,EA=class EA{constructor(){G(this,U1,[]);this.extend=this.extend.bind(this)}extend(t){return d(this,U1).push(t),this}extendOptional(t){let r=re(k({},t),{schema:L.Partial(t.schema)});return d(this,U1).push(r),this}build(){return OP.create(this)}get extensions(){return d(this,U1)}};U1=new WeakMap,o(EA,"MVFParserBuilder");var AP=EA;var pQ=o(()=>new AP().extend(ZK).extend(rJ).extend(sJ),"createParser");var wg=Ci("lcat","LocationCategoryId"),MA=L.Intersect([L.Object({id:L.Ref(wg),parent:L.Optional(L.Ref(wg))}),mg(["name"]),Wu],{$id:"LocationCategory"}),fQ=[wg,MA];g();g();var Pg;(function(e){e.UnknownCategoryError="UnknownCategoryError",e.UnknownParentCategoryError="UnknownParentCategoryError",e.UnknownParentLocationError="UnknownParentLocationError"})(Pg||(Pg={}));var dQ=o(e=>{var i,s,l,c,p,h,y,b,_;if(e.locationCategories==null&&e.locations==null)return st(!0);let t=new Set((s=(i=e.locationCategories)==null?void 0:i.map(C=>C.id))!=null?s:[]);for(let C of(l=e.locationCategories)!=null?l:[])if(C.parent!=null&&!t.has(C.parent))return lt({kind:Pg.UnknownParentCategoryError,properties:{categoryId:C.id,parentCategoryId:C.parent}});let r=Oo(e);for(let C of(c=e.locations)!=null?c:[]){for(let P of C.categories)if(!t.has(P))return lt({kind:Pg.UnknownCategoryError,properties:{locationId:C.id,categoryId:P}});for(let P of C.geometryAnchors){let E=r(P.floorId,P.geometryId);if(E.isErr())return E}}let n=new Set((h=(p=e.locations)==null?void 0:p.map(C=>C.id))!=null?h:[]);for(let C of(y=e.locationInstances)!=null?y:[]){if(!n.has(C.parentId))return lt({kind:Pg.UnknownParentLocationError,properties:{locationInstanceId:C.id,parentLocationId:C.parentId}});for(let P of(b=C.categories)!=null?b:[])if(!t.has(P))return lt({kind:Pg.UnknownCategoryError,properties:{locationId:C.id,categoryId:P}});for(let P of(_=C.geometryAnchors)!=null?_:[]){let E=r(P.floorId,P.geometryId);if(E.isErr())return E}}return st(!0)},"validateLocations");g();var Tg=Ci("loc","LocationId"),DP=Ci("loci","LocationInstanceId"),hQ=L.Object({name:L.String(),url:L.String({format:"uri"})},{$id:"LocationSocial"}),mQ=L.Object({url:L.String({format:"uri"})},{$id:"LocationImage"}),OA=L.Object({label:L.String(),url:L.String({format:"uri"})},{$id:"LocationLink"}),LA=L.String({pattern:"^[0-2][0-9]:[0-6][0-9](:[0-6][0-9])?$",$id:"OpeningHoursTime"}),gQ=L.Union([L.Literal("Sunday"),L.Literal("Monday"),L.Literal("Tuesday"),L.Literal("Wednesday"),L.Literal("Thursday"),L.Literal("Friday"),L.Literal("Saturday")],{$id:"OpeningHoursDay"}),rPe="PublicHolidays",AA=L.Union([gQ,L.Literal(rPe)],{$id:"OpeningHoursDayOrPublicHoliday"}),FP=L.Object({"@type":L.Optional(L.Literal("OpeningHoursSpecification",{description:"The type of opening hours"})),opens:L.Optional(L.Ref(LA,{description:"The time the opening hours start"})),closes:L.Optional(L.Ref(LA,{description:"The time the opening hours end"})),dayOfWeek:L.Optional(L.Union([L.Ref(AA),L.Array(L.Ref(AA))],{description:"The days of the week the opening hours apply to"})),validFrom:L.Optional(L.String({format:"date-time",description:"The date the opening hours start, in ISO 8601 format"})),validTo:L.Optional(L.String({format:"date-time",description:"The date the opening hours end, in ISO 8601 format"}))},{$id:"OpeningHoursSpecification"}),NP=L.Intersect([L.Object({id:L.Ref(Tg),categories:L.Array(L.Ref(wg)),logo:L.Optional(L.String({format:"uri"})),phone:L.Optional(L.String()),social:L.Array(L.Ref(hQ)),images:L.Array(L.Ref(mQ)),links:L.Array(L.Ref(OA)),website:L.Optional(L.Ref(OA)),openingHours:L.Optional(L.Array(L.Ref(FP)))}),mg(["name"]),gg(),Wu],{$id:"Location"}),DA=L.Intersect([L.Object({id:L.Ref(DP),parentId:L.Ref(Tg)}),L.Partial(L.Omit(NP,["id","parentId"]))],{$id:"LocationInstance"}),kP=[Tg,DP,hQ,mQ,OA,LA,gQ,AA,FP,NP,DA];var nPe=L.Object({locations:L.Array(L.Ref(NP)),locationCategories:L.Array(L.Ref(MA)),locationInstances:L.Optional(L.Array(L.Ref(DA)))},{$id:"LocationsExtensionSchema"}),yQ="locations.json",vQ="location-categories.json",bQ="location-instances.json",xQ={name:"ext:locations",schema:nPe,intoBundle:o(function*(e){e.locations!=null&&(yield{path:yQ,contents:e.locations}),e.locationCategories!=null&&(yield{path:vQ,contents:e.locationCategories}),e.locationInstances!=null&&(yield{path:bQ,contents:e.locationInstances})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e===yQ)return{locations:r(t)};if(e===vQ)return{locationCategories:r(t)};if(e===bQ)return{locationInstances:r(t)}},"fromBundle"),references:[...fQ,...kP],integrityCheck:dQ};g();g();var hp;(function(e){e.UnknownEnterpriseLocationError="UnknownEnterpriseLocationError",e.EnterpriseLocationWithUnknownLocationError="EnterpriseLocationWithUnknownLocationError",e.EnterpriseCategoryWithUnknownLocationCategoryError="EnterpriseCategoryWithUnknownLocationCategoryError",e.InstanceWithUnknownLocationInstanceError="InstanceWithUnknownLocationInstanceError",e.InstanceWithUnknownEnterpriseLocationError="InstanceWithUnknownEnterpriseLocationError",e.EnterpriseLocationWithUnknownSibling="EnterpriseLocationWithUnknownSibling",e.EnterpriseLocationInstanceWithUnknownSibling="EnterpriseLocationInstanceWithUnknownSibling"})(hp||(hp={}));var IQ=o(e=>{var p,h,y,b,_,C,P,E,T,O,D,A,R,j,X,Y,N,Z,ae,se;if(e.enterprise==null)return st(!0);let t=e.enterprise,r=new Set((h=(p=e.locationCategories)==null?void 0:p.map(U=>U.id))!=null?h:[]);for(let U of(y=t.categories)!=null?y:[])if(!r.has(U.categoryId))return lt({kind:hp.EnterpriseCategoryWithUnknownLocationCategoryError,properties:{enterpriseCategoryId:U.id,locationCategoryId:U.categoryId}});let n=new Set((_=(b=e.locations)==null?void 0:b.map(U=>U.id))!=null?_:[]);for(let U of(C=t.locations)!=null?C:[]){if(!n.has(U.locationId))return lt({kind:hp.EnterpriseLocationWithUnknownLocationError,properties:{enterpriseLocationId:U.id,locationId:U.locationId}});for(let xe of(P=U.siblingGroups)!=null?P:[])for(let ne of(E=xe.siblings)!=null?E:[])if(!n.has(ne))return lt({kind:hp.EnterpriseLocationWithUnknownSibling,properties:{enterpriseLocationId:U.id,siblingLocationId:ne,label:xe.label}})}let i=new Set((O=(T=e.enterprise.locations)==null?void 0:T.map(U=>U.id))!=null?O:[]);if(((D=t.venue)==null?void 0:D.topLocations)!=null){for(let U of t.venue.topLocations)if(!i.has(U))return lt({kind:hp.UnknownEnterpriseLocationError,properties:{enterpriseLocationId:U}})}let s=new Set((R=(A=e.locationInstances)==null?void 0:A.map(U=>U.id))!=null?R:[]);for(let U of(j=t.locationInstances)!=null?j:[]){if(!i.has(U.parentId))return lt({kind:hp.InstanceWithUnknownEnterpriseLocationError,properties:{enterpriseLocationInstanceId:U.id,enterpriseLocationId:U.parentId}});if(!s.has(U.locationInstanceId))return lt({kind:hp.InstanceWithUnknownLocationInstanceError,properties:{enterpriseLocationInstanceId:U.id,locationInstanceId:U.locationInstanceId}});for(let xe of(X=U.siblingGroups)!=null?X:[])for(let ne of(Y=xe.siblings)!=null?Y:[])if(!n.has(ne))return lt({kind:hp.EnterpriseLocationInstanceWithUnknownSibling,properties:{enterpriseLocationInstanceId:U.id,siblingLocationId:ne,label:xe.label}})}let l=Lf(e),c=Oo(e);for(let[U,xe]of un((N=t.floorText)!=null?N:{})){let ne=l(U);if(ne.isErr())return ne;for(let Pe of xe.features){if(!("geometryId"in Pe.properties))continue;let Ce=c(U,Pe.properties.geometryId);if(Ce.isErr())return Ce}}for(let[U,xe]of un((Z=t.textures)!=null?Z:{})){let ne=l(U);if(ne.isErr())return ne;for(let Pe of xe){let Ce=c(U,Pe.geometryId);if(Ce.isErr())return Ce}}for(let[U,xe]of un((ae=t.layers)!=null?ae:{})){let ne=l(U);if(ne.isErr())return ne;for(let Pe of rn(xe!=null?xe:{})){let Ce=c(U,Pe);if(Ce.isErr())return Ce}}for(let[U,xe]of un((se=t.textAreas)!=null?se:{})){let ne=l(U);if(ne.isErr())return ne;for(let Pe of xe.features)if("geometryId"in Pe.properties){let Ce=c(U,Pe.properties.geometryId);if(Ce.isErr())return Ce}}return st(!0)},"validateCMS");g();g();var Eg=Ci("el","EnterpriseLocationId"),FA=Ci("ec","EnterpriseCategoryId"),NA=Ci("eli","EnterpriseLocationInstanceId"),kA=Ci("ev","EnterpriseVenueId"),RA=Ci("eft","EnterpriseFloorTextId"),_Q=[Eg,FA,NA,kA,RA];var SQ=L.Object({id:L.Ref(FA),categoryId:L.Ref(wg),color:L.Optional(L.String()),sortOrder:L.Number(),iconFromDefaultList:L.Optional(L.Union([L.String(),L.Null()])),picture:L.Optional(L.String({format:"uri",description:"The category's picture"}))},{$id:"EnterpriseCategory"}),BA=L.Object({categories:L.Optional(L.Array(L.Ref(SQ)))},{$id:"EnterpriseCategoriesSchema"}),CQ=[SQ,BA];g();var wQ=ja(["left","center","right"]),iPe=wQ.schema,ADt=wQ.values,$A=L.Object({id:L.Ref(RA),text:L.String(),visible:L.Boolean({default:!0}),fontSize:L.Number({default:12,minimum:1}),fontFamily:L.String({default:"Droid Sans"}),color:L.String({default:"black"}),rotation:L.Number({minimum:0,maximum:360}),align:iPe},{$id:"FloorTextCommonProperties"}),jA=L.Intersect([L.Ref($A),Yl],{$id:"AnchoredFloorTextProperties"}),GA=L.Intersect([L.Ref($A),L.Object({verticalOffset:L.Number()})],{$id:"FloatingFloorTextProperties"}),PQ=L.Union([L.Ref(jA),L.Ref(GA)],{$id:"FloorTextProperties"}),TQ=gs(Vs,L.Ref(PQ),{$id:"FloorTextFeature"}),oPe=gs(Vs,L.Ref(jA),{$id:"AnchoredFloorTextFeature"}),sPe=gs(Vs,L.Ref(GA),{$id:"FloatingFloorTextFeature"}),EQ=ga(L.Ref(TQ),{$id:"EnterpriseFloorTextFeatureCollection"}),MQ=L.Record(ln,L.Ref(EQ),{$id:"EnterpriseFloorTextCollectionsByFloor",additionalProperties:!1}),UA=L.Object({floorText:L.Optional(L.Ref(MQ))},{$id:"EnterpriseFloorTextSchema"}),OQ=[$A,jA,GA,PQ,TQ,oPe,sPe,EQ,MQ,UA];g();var LQ=Ui(L.Record(Us,L.String({minLength:1}),{additionalProperties:!1,$id:"EnterpriseLayers"})),AQ=Ui(L.Record(ln,L.Ref(LQ),{additionalProperties:!1,$id:"EnterpriseLayersByFloor"})),VA=L.Object({layers:L.Optional(L.Ref(AQ))},{$id:"EnterpriseLayersSchema"}),DQ=[LQ,AQ,VA];g();g();g();var zA=ja(["closed-temporarily","new","pop-up","coming-soon","relocated"]),aPe=zA.schema,VDt=zA.values,zDt=zA.record,qA=L.Object({type:aPe,start:L.Optional(L.String({format:"date",description:"The start date of the state"})),end:L.Optional(L.String({format:"date",description:"The end date of the state"}))},{$id:"LocationState",description:"The state of a location. Start and end dates are optional."}),HA=L.Object({label:L.String(),siblings:L.Array(L.Ref(Tg))},{$id:"SiblingGroup"}),RP=L.Object({name:L.String(),code:L.String()},{$id:"Language"}),FQ=[qA,HA,RP];var BP=L.Object({id:L.Ref(Eg),locationId:L.Ref(Tg),type:L.String(),sortOrder:L.Number(),tags:L.Optional(L.Array(L.String())),picture:L.Optional(L.String({format:"uri",description:"The picture of the location"})),states:L.Optional(L.Array(L.Ref(qA),{description:"The location's state. No more than one state should be active at a time, and all but at most one should have dates set"})),siblingGroups:L.Optional(L.Array(L.Ref(HA))),gallery:L.Optional(L.Array(L.Object({caption:L.Optional(L.String()),image:L.String({format:"uri"}),embeddedUrl:L.Optional(L.String({format:"uri",description:"The URL to link from the image"}))},{description:"The location's image gallery"}),{description:"The location's image gallery"})),showFloatingLabelWhenImagePresent:L.Optional(L.Boolean({description:"Whether to show the flat label when an image is present"})),amenity:L.Optional(L.String({description:"The location's amenity type. Only set if the location is an amenity"})),showLogo:L.Optional(L.Boolean({description:"Whether to show the logo of the location"}))},{$id:"EnterpriseLocation"}),WA=L.Object({locations:L.Optional(L.Array(L.Ref(BP)))},{$id:"EnterpriseLocationsSchema"}),NQ=[BP,WA];var kQ=L.Intersect([L.Object({id:L.Ref(NA),parentId:L.Ref(Eg),locationInstanceId:L.Ref(DP)}),L.Partial(L.Omit(BP,["id","parentId","locationId"]))],{$id:"EnterpriseLocationInstance",description:"A locationInstance is a particular instance of an Enterprise Location that has some properties different from the parent."}),XA=L.Object({locationInstances:L.Optional(L.Array(L.Ref(kQ)))},{$id:"EnterpriseLocationInstancesSchema"}),RQ=[kQ,XA];g();var YA=ja(["near","center"],{$id:"EnterpriseTextAreaAlignment"}),BQ=YA.schema,u8t=YA.values,c8t=YA.record,ZA=L.Object({maxWidth:L.Number({exclusiveMinimum:0,description:"The maximum width of the label, in meters."}),maxHeight:L.Number({exclusiveMinimum:0,description:"The maximum height of the label, in meters."}),align:L.Ref(BQ),rotation:L.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"EnterpriseBaseTextAreaProperties"}),$Q=L.Intersect([L.Ref(ZA),Yl],{$id:"EnterpriseAnchoredTextAreaProperties"}),jQ=L.Intersect([L.Ref(ZA),L.Object({verticalOffset:L.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"EnterpriseFloatingTextAreaProperties"}),GQ=L.Union([$Q,jQ],{$id:"EnterpriseTextAreaProperties"}),UQ=gs(L.Ref(Vs),GQ,{$id:"EnterpriseTextAreaFeature"}),VQ=ga(L.Ref(UQ),{$id:"EnterpriseTextAreaCollection"}),zQ=L.Record(ln,L.Ref(VQ),{$id:"EnterpriseTextAreasByFloor",additionalProperties:!1}),qQ=L.Object({textAreas:L.Optional(L.Ref(zQ))},{$id:"EnterpriseTextAreasSchema"}),HQ=[BQ,ZA,$Q,jQ,GQ,UQ,VQ,zQ];g();var KA=L.Object({u:L.Number(),v:L.Number()},{$id:"EnterpriseTextureUV"}),JA=ja(["top","side"],{$id:"EnterpriseTextureFace"}),WQ=JA.schema,m8t=JA.values,g8t=JA.record,QA=ja(["inside","outside","both"],{$id:"EnterpriseTextureSurface"}),XQ=QA.schema,y8t=QA.values,v8t=QA.record,YQ=L.Tuple([_1,S1,_1,S1],{$id:"EnterpriseTextureBounds"}),ZQ=L.Intersect([L.Object({repeat:L.Ref(KA),offset:L.Ref(KA),rotation:L.Number({minimum:0,maximum:360}),path:L.String({format:"uri"}),face:L.Ref(WQ),surface:L.Ref(XQ),bounds:L.Ref(YQ)},{$id:"EnterpriseTextureProperties"}),Yl],{$id:"EnterpriseTexture"}),KQ=L.Array(L.Ref(ZQ),{$id:"EnterpriseTextures"}),JQ=L.Record(ln,L.Ref(KQ),{$id:"EnterpriseTexturesByFloor",additionalProperties:!1}),e9=L.Object({textures:L.Optional(L.Ref(JQ))},{$id:"EnterpriseTexturesSchema"}),QQ=[ZQ,KQ,e9,KA,WQ,XQ,YQ,JQ];g();var eee=L.Intersect([L.Object({id:L.Ref(kA),slug:L.String(),defaultLanguage:L.Ref(RP),languages:L.Array(L.Ref(RP)),countrycode:L.Optional(L.String()),logo:L.Optional(L.String({format:"uri"})),mappedinWebUrl:L.Optional(L.String({format:"uri"})),topLocations:L.Optional(L.Array(L.Ref(Eg))),operationHours:L.Optional(L.Array(L.Ref(FP))),coverImage:L.Optional(L.String({format:"uri"}))}),mg(["name"]),Wu],{$id:"EnterpriseVenue"}),t9=L.Object({venue:L.Optional(L.Ref(eee))},{$id:"EnterpriseVenueSchema"}),tee=[eee,t9];var nee=L.Intersect([t9,WA,XA,BA,e9,UA,VA,qQ],{$id:"EnterpriseProperties"}),ree=L.Object({enterprise:L.Optional(L.Ref(nee))},{$id:"CMSExtensionSchema"}),lPe=/^enterprise\/(?:([^/]+)\/)?([^/]+)\.(?:json|geojson)$/,iee={name:"ext:cms",schema:ree,intoBundle:o(function*(e){var r,n,i,s,l,c;if(e.enterprise==null)return;let t=e.enterprise;for(let p of rn(t))switch(p){case"floorText":for(let h of rn((r=t.floorText)!=null?r:{}))yield{path:"enterprise/floorText/".concat(h,".geojson"),contents:((n=t.floorText)!=null?n:{})[h]};continue;case"textures":for(let h of rn((i=t.textures)!=null?i:{}))yield{path:"enterprise/textures/".concat(h,".json"),contents:((s=t.textures)!=null?s:{})[h]};continue;case"textAreas":for(let h of rn((l=t.textAreas)!=null?l:{}))yield{path:"enterprise/textAreas/".concat(h,".geojson"),contents:((c=t.textAreas)!=null?c:{})[h]};continue;default:yield{path:"enterprise/".concat(p,".json"),contents:t[p]};continue}},"intoBundle"),fromBundle:o((e,t,r)=>{let n=e.match(lPe);if(!n)return;let[,i,s]=n,l=r(t);switch(i){case"floorText":case"textures":case"textAreas":return{enterprise:{[i]:{[s]:l}}};default:return{enterprise:{[s]:l}}}},"fromBundle"),references:[nee,ree,...tee,...NQ,...RQ,...CQ,...QQ,...DQ,...OQ,...HQ,..._Q,...FQ,...kP],integrityCheck:IQ};g();g();g();g();var Zu;(function(e){e.NavigationFlagMissingDeclaration="NavigationFlagMissingDeclaration",e.NavigationFlagDuplicateBit="NavigationFlagDuplicateBit",e.NavigationFlagIncorrectFlagsLength="NavigationFlagIncorrectFlagsLength",e.NavigationFlagValueTooBig="NavigationFlagValueTooBig"})(Zu||(Zu={}));var oee=o(e=>{let{navigationFlags:t}=e;if(!t||Object.keys(t).length===0)return st(!0);let r=Object.entries(t).map(([s,l])=>k({key:s},l)).sort((s,l)=>s.index!==l.index?s.index-l.index:s.bit-l.bit),n=0,i=-1;for(let s of r){if(s.bit===i)return lt({kind:Zu.NavigationFlagDuplicateBit,properties:{index:s.index,bit:s.bit,path:"navigationFlags.".concat(s.key)}});if(s.index!=n){if(i!=31)return lt({kind:Zu.NavigationFlagMissingDeclaration,properties:{index:n,bit:i+1,path:"navigationFlags"}});if(s.index!=n+1||s.bit!=0)return lt({kind:Zu.NavigationFlagMissingDeclaration,properties:{index:n+1,bit:0,path:"navigationFlags"}});n=s.index,i=0}else{if(s.bit!==i+1)return lt({kind:Zu.NavigationFlagMissingDeclaration,properties:{index:s.index,bit:i+1,path:"navigationFlags"}});i=s.bit}}return st(!0)},"validateNavigationFlags");g();function V1(e,t){return t&&(e.flags[t.index]&1<<t.bit)!==0}o(V1,"hasFlag");g();var see=2**32-1,PI=o(e=>{var i;let t=Object.keys((i=e.navigationFlags)!=null?i:{}).length;if(t===0)return{index:-1,flag:0};let r=Math.floor(t/32),n=t%32;return{index:r,flag:2**n-1}},"determineMaxNavigationFlags"),z1=o((e,t,r)=>{if(t.index==-1&&e.length===0)return st(!0);let n=t.flag>0||t.index===-1?t.index+1:t.index;if(e.length!==n)return lt({kind:Zu.NavigationFlagIncorrectFlagsLength,properties:{expected:n,actual:e.length,path:r}});for(let i=0;i<e.length;i++){let s=e[i];if(i<t.index){if(s>see)return lt({kind:Zu.NavigationFlagValueTooBig,properties:{index:i,flagValue:s,expectedMaxFlagValue:see,path:r}});continue}else if(s>t.flag)return lt({kind:Zu.NavigationFlagValueTooBig,properties:{index:i,flagValue:s,expectedMaxFlagValue:t.flag,path:r}})}return st(!0)},"validateFlags");var uPe=L.Object({index:L.Integer({description:"The index of the flag in a flags array.",minimum:0}),bit:L.Integer({description:"The bit position of the flag in a flag's bitfield.",minimum:0,maximum:31})},{$id:"NavigationFlagDeclarationCore"}),aee=L.Intersect([uPe,Hu],{$id:"NavigationFlagDeclaration",description:'A NavigationFlagDeclaration describes the relationship between a "key" that a developer might use to wayfind using that flag, and the index and bit position in an object\'s `flags` array.'}),r9={accessible:"accessible",outdoors:"outdoors"},lee=L.Record(L.String(),aee,{$id:"NavigationFlagDeclarations",description:"Any well known and custom flags present in the MVF"}),cPe=L.Object({navigationFlags:L.Ref(lee)},{$id:"NavigationFlagsSchema"}),$P=L.Array(L.Integer({minimum:0,maximum:Math.pow(2,32)-1}),{$id:"Flags"}),n9=L.Object({flags:L.Ref($P)},{$id:"WithFlags"}),Mg=L.Intersect([I1,n9],{$id:"FlaggedGeometryAnchor"}),pPe=L.Object({geometryAnchor:Mg},{$id:"WithFlaggedGeometryAnchor"}),fPe=L.Object({geometryAnchors:L.Array(Mg)},{$id:"WithFlaggedGeometryAnchors"}),uee={name:"ext:mvf-navigation-flags",schema:cPe,intoBundle:o(function*(e){e.navigationFlags!=null&&(yield{path:"navigationFlags.json",contents:e.navigationFlags})},"intoBundle"),fromBundle:o((e,t,r)=>e!=="navigationFlags.json"?void 0:{navigationFlags:r(t)},"fromBundle"),references:[aee,lee,$P,Mg,pPe,fPe],integrityCheck:oee};g();var cee=o(e=>{if(e.connections==null)return st(!0);let t=Oo(e),r=PI(e);for(let[n,i]of e.connections.entries()){for(let[s,l]of i.entrances.entries()){let c=t(l.floorId,l.geometryId);if(c.isErr())return c;let p=z1(l.flags,r,"connections[".concat(n,"].entrances[").concat(s,"]"));if(p.isErr())return p}for(let[s,l]of i.exits.entries()){let c=t(l.floorId,l.geometryId);if(c.isErr())return c;let p=z1(l.flags,r,"connections[".concat(n,"].exits[").concat(s,"]"));if(p.isErr())return p}}return st(!0)},"validateConnections");var fee=Ci("c","ConnectionId"),{schema:dPe,values:wFt,record:hPe}=ja(["elevator","escalator","travelator","stairs","door","ramp"],{$id:"ConnectionType"}),dee=dPe;var i9=hPe,hee=L.Intersect([L.Object({id:L.Ref(fee,{description:"The unique identifier for the connection."}),entrances:L.Array(L.Ref(Mg)),exits:L.Array(L.Ref(Mg)),entryCost:L.Number({description:"The cost to enter the connection.",minimum:0}),floorCostMultiplier:L.Number({description:"The cost multiplier for each floor transitioned.",minimum:1}),type:L.Ref(dee,{description:"The type of connection."})}),Hu,Wu],{$id:"ConnectionsProperties"}),mee=L.Array(L.Ref(hee),{$id:"ConnectionsCollection"}),mPe=L.Object({connections:L.Ref(mee)},{$id:"ConnectionsExtensionSchema"}),pee="connections.json",gee={name:"ext:connections",schema:mPe,intoBundle:o(function*(e){e.connections!=null&&(yield{path:pee,contents:e.connections})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e===pee)return{connections:r(t)}},"fromBundle"),references:[hee,mee,dee,fee,Mg,$P],integrityCheck:cee};g();g();var yee=o(e=>{if(e.defaultStyle==null)return st(!0);let t=Oo(e);for(let r of Object.values(e.defaultStyle))if(r!=null)for(let n of r.geometryAnchors){let i=t(n.floorId,n.geometryId);if(i.isErr())return i}return st(!0)},"validateDefaultStyle");var vee=L.Intersect([gg(),Wu,L.Object({altitude:L.Number({description:"How far off the bottom of the floor the objects with this style should be drawn, in meters."}),color:L.String({pattern:"^#[0-9a-fA-F]{6}$",description:"Color should be represented with a hash (#), followed by 6 hexadecimal digits. ex: #RRGGBB"}),height:L.Number({minimum:0,description:"The height of the objects belonging to this layer, in meters."}),opacity:L.Number({minimum:0,maximum:1,description:"The opacity of the objects belonging to this layer, from 0 to 1."}),buffer:L.Number({description:"The buffer amount to apply to the geometry, in meters. This can be used to inflate line string geometry for walls, but might also be applicable as a way to grow or shrink polygon geometry for aesthetic purposes. Can be negative."}),hidden:L.Optional(L.Boolean({description:"Whether or not the objects with this style should be hidden."}))})],{$id:"DefaultStyle"}),bee=L.Record(L.String(),L.Ref(vee),{$id:"DefaultStyleCollection",additionalProperties:!1}),gPe=L.Object({defaultStyle:L.Ref(bee)},{$id:"DefaultStyleSchema"}),xee={name:"ext:mvf-default-style",schema:gPe,intoBundle:o(function*(e){e.defaultStyle!=null&&(yield{path:"default-style.json",contents:e.defaultStyle})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e==="default-style.json")return{defaultStyle:r(t)}},"fromBundle"),references:[vee,bee],integrityCheck:yee};g();g();g();g();var jP;(function(e){e.InvalidDefaultFloorError="InvalidDefaultFloorError"})(jP||(jP={}));var Iee=o(e=>{if(e.floorStacks==null)return st(!0);let t=Lf(e);for(let r of e.floorStacks){for(let n of r.floors){let i=t(n);if(i.isErr())return i}if(r.defaultFloor!=null&&!r.floors.includes(r.defaultFloor))return lt({kind:jP.InvalidDefaultFloorError,properties:{floorStackId:r.id,floorId:r.defaultFloor}})}return st(!0)},"validateFloorStacks");var GP=Ci("fs","FloorStackId"),See=L.Intersect([L.Object({id:L.Ref(GP,{description:"The unique identifier for the floor stack."}),floors:L.Array(L.Ref(ln),{uniqueItems:!0,minItems:1,description:"The floors that are part of this floor stack."}),defaultFloor:L.Optional(L.Ref(ln,{description:"The default floor for the floor stack."}))}),Hu],{$id:"FloorStacksProperties"}),Cee=L.Array(L.Ref(See),{$id:"FloorStackCollection"}),yPe=L.Object({floorStacks:L.Ref(Cee)},{$id:"FloorStackExtensionSchema"}),_ee="floor-stacks.json",wee={name:"ext:floor-stacks",schema:yPe,intoBundle:o(function*(e){e.floorStacks!=null&&(yield{path:_ee,contents:e.floorStacks})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e===_ee)return{floorStacks:r(t)}},"fromBundle"),references:[GP,See,Cee],integrityCheck:Iee};g();g();var TI;(function(e){e.MissingFloorStackError="MissingFloorStackError",e.UnknownFloorStackError="UnknownFloorStackError"})(TI||(TI={}));var Pee=o(e=>{if(e.facade==null)return st(!0);if(e.floorStacks==null)return lt({kind:TI.MissingFloorStackError,properties:null});let t=new Set(e.floorStacks.map(n=>n.id)),r=Oo(e);for(let[n,i]of un(e.facade))if(i!=null){if(!t.has(n))return lt({kind:TI.UnknownFloorStackError,properties:{floorStackId:n}});for(let s of i.geometryAnchors){let l=r(s.floorId,s.geometryId);if(l.isErr())return l}}return st(!0)},"validateFacade");var Tee=Ci("fc","FacadeId"),Eee=L.Intersect([L.Object({id:L.Ref(Tee)}),gg({minItems:1})],{$id:"FacadeProperties"}),vPe=L.Object({facade:Ui(L.Record(GP,L.Ref(Eee),{additionalProperties:!1}))},{$id:"FacadeExtensionSchema"}),bPe=/^facade\/(.*)\.json$/,Mee={name:"ext:facade",schema:vPe,intoBundle:o(function*(e){if(e.facade!=null)for(let t of rn(e.facade))yield{path:"facade/".concat(t,".json"),contents:e.facade[t]}},"intoBundle"),fromBundle:o((e,t,r)=>{var i;let n=(i=e.match(bPe))==null?void 0:i[1];if(n)return{facade:{[n]:r(t)}}},"fromBundle"),references:[Tee,Eee],integrityCheck:Pee};g();g();var Oee=o(e=>{if(e.floorImages==null)return st(!0);let t=Oo(e);for(let[r,n]of un(e.floorImages))if(n!=null)for(let i of n.features){if(!("geometryId"in i.properties))continue;let s=i.properties.geometryId,l=t(r,s);if(l.isErr())return l}return st(!0)},"validateFloorImages");var o9=L.Object({path:L.String({format:"uri",description:"The path to the image. This will be a remote URL."}),width:L.Number({minimum:0,description:"The width of the image when represented on the map, in meters."}),height:L.Number({minimum:0,description:"The height of the image when represented on the map, in meters."}),rotation:L.Number({minimum:0,maximum:360,description:"Rotation in degrees, about the center of the image. North is 0, east is 90."})},{$id:"BaseFloorImageProperties"}),Lee=L.Intersect([L.Ref(o9),Yl],{$id:"AnchoredFloorImageProperties"}),Aee=L.Intersect([L.Ref(o9),L.Object({verticalOffset:L.Number({minimum:0,description:"How high to position the image, in meters, relative to the ground plane."})})],{$id:"FloatingFloorImageProperties"}),Dee=L.Union([Lee,Aee],{$id:"FloorImageProperties"}),Fee=gs(L.Ref(Vs),Dee,{$id:"FloorImageFeature"}),Nee=ga(L.Ref(Fee),{$id:"FloorImageCollection"}),xPe=L.Object({floorImages:Ui(L.Record(ln,L.Ref(Nee),{additionalProperties:!1}))},{$id:"FloorImagesExtensionSchema"}),IPe=/^floorImages\/(.*)\.geojson$/,kee={name:"ext:floor-images",schema:xPe,intoBundle:o(function*(e){if(e.floorImages!=null)for(let t of rn(e.floorImages))yield{path:"floorImages/".concat(t,".geojson"),contents:e.floorImages[t]}},"intoBundle"),fromBundle:o((e,t,r)=>{var i;let n=(i=e.match(IPe))==null?void 0:i[1];if(n)return{floorImages:{[n]:r(t)}}},"fromBundle"),references:[o9,Lee,Aee,Dee,Fee,Nee],integrityCheck:Oee};g();g();var Ree=o(e=>{if(e.kinds==null)return st(!0);let t=Oo(e);for(let[r,n]of un(e.kinds))if(n!=null)for(let i of rn(n)){let s=t(r,i);if(s.isErr())return s}return st(!0)},"validateKinds");var{values:qNt,schema:_Pe,record:HNt}=ja(["room","hallway","wall","desk","poi","area","window"],{$id:"Kind"}),Bee=_Pe;var $ee=Ui(L.Record(Us,L.Ref(Bee),{additionalProperties:!1,$id:"GeometryKinds"})),SPe=L.Object({kinds:Ui(L.Record(ln,L.Ref($ee),{additionalProperties:!1}))},{$id:"KindsExtensionSchema"}),CPe=/^kinds\/(.*)\.json$/,jee={name:"ext:kinds",schema:SPe,intoBundle:o(function*(e){if(e.kinds!=null)for(let t of rn(e.kinds))yield{path:"kinds/".concat(t,".json"),contents:e.kinds[t]}},"intoBundle"),fromBundle:o((e,t,r)=>{var i;let n=(i=e.match(CPe))==null?void 0:i[1];if(n)return{kinds:{[n]:r(t)}}},"fromBundle"),references:[Bee,$ee],integrityCheck:Ree};g();g();g();var UP;(function(e){e.UnknownNeighbor="UnknownNeighbor"})(UP||(UP={}));var Gee=o(e=>{if(e.nodes==null)return st(!0);let t=Oo(e),r=PI(e);for(let[n,i]of un(e.nodes)){if(i==null)continue;let s=new Set(i.features.map(l=>l.properties.id));for(let[l,c]of i.features.entries()){for(let p of c.properties.geometryIds){let h=t(n,p);if(h.isErr())return h}for(let[p,h]of c.properties.neighbors.entries()){if(!s.has(h.id))return lt({kind:UP.UnknownNeighbor,properties:{floorId:n,nodeId:c.properties.id,neighborId:h.id}});let y=z1(h.flags,r,'nodes["'.concat(n,'"].features[').concat(l,"].properties.neighbors[").concat(p,"]"));if(y.isErr())return y}}}return st(!0)},"validateNodes");var s9=Ci("n","NodeId"),Uee=L.Intersect([L.Object({id:L.Ref(s9,{description:"The unique identifier for the node."}),extraCost:L.Number({minimum:0,description:"The extra cost to traverse to the node, above the straight-line distance."})}),n9],{$id:"NodeNeighbor"}),Vee=L.Intersect([L.Object({id:L.Ref(s9,{description:"The unique identifier for the node."}),neighbors:L.Array(L.Ref(Uee),{description:"The neighbors of the node."})}),qw],{$id:"NodeProperties"}),zee=gs(L.Ref(Vs),Vee,{$id:"NodeFeature"}),qee=ga(L.Ref(zee),{$id:"NodeCollection"}),wPe=L.Object({nodes:Ui(L.Record(ln,L.Ref(qee),{additionalProperties:!1}))},{$id:"NodesExtensionSchema"}),PPe=/^nodes\/(.*)\.json$/,Hee={name:"ext:nodes",schema:wPe,intoBundle:o(function*(e){if(e.nodes!=null)for(let t of rn(e.nodes))yield{path:"nodes/".concat(t,".json"),contents:e.nodes[t]}},"intoBundle"),fromBundle:o((e,t,r)=>{var i;let n=(i=e.match(PPe))==null?void 0:i[1];if(n)return{nodes:{[n]:r(t)}}},"fromBundle"),references:[s9,Uee,Vee,zee,qee],integrityCheck:Gee};g();g();g();var VP;(function(e){e.FloorInFloorStackError="FloorInFloorStackError"})(VP||(VP={}));var Wee=o(e=>{if(e.outdoors==null)return st(!0);let t=Lf(e);for(let r of e.outdoors.floors){let n=t(r);if(n.isErr())return n;if(e.floorStacks!=null){for(let i of e.floorStacks)if(i.floors.includes(r))return lt({kind:VP.FloorInFloorStackError,properties:{floorId:r,floorStackId:i.id}})}}return st(!0)},"validateOutdoors");var Yee=L.Object({floors:L.Array(L.Ref(ln),{uniqueItems:!0,description:"A list of floor IDs that should be considered to contain outdoor features."})},{$id:"Outdoors"}),TPe=L.Object({outdoors:L.Ref(Yee)},{$id:"OutdoorsExtensionSchema"}),Xee="outdoors.json",Zee={name:"ext:outdoors",schema:TPe,intoBundle:o(function*(e){e.outdoors!=null&&(yield{path:Xee,contents:e.outdoors})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e===Xee)return{outdoors:r(t)}},"fromBundle"),references:[Yee],integrityCheck:Wee};g();g();g();var zP;(function(e){e.TilesetDuplicateKeyError="TilesetDuplicateKeyError"})(zP||(zP={}));var Kee=o(e=>{if(e.tileset==null)return st(!0);let t=new Set;if(t.add(e.tileset.default.key),e.tileset.others)for(let r of e.tileset.others){if(t.has(r.key))return lt({kind:zP.TilesetDuplicateKeyError,properties:{key:r.key}});t.add(r.key)}return st(!0)},"validateTilesets");var a9=L.Object({key:L.String({minLength:1,description:"Unique identifier for the tileset style."}),name:L.String({minLength:1,description:"Display name of the tileset style."}),url:L.String({format:"uri",description:"URL of the tileset style."})},{$id:"TilesetStyle",description:"A tileset style definition."}),Jee=L.Object({default:L.Ref(a9,{description:"The default tileset style, which should be used."}),others:L.Optional(L.Array(L.Ref(a9,{description:"Additional tileset styles that can be used."})))},{$id:"TilesetCollection"}),EPe=L.Object({tileset:L.Ref(Jee)},{$id:"TilesetExtensionSchema"}),Qee={name:"ext:mvf-tileset",schema:EPe,intoBundle:o(function*(e){e.tileset!=null&&(yield{path:"tileset.json",contents:e.tileset})},"intoBundle"),fromBundle:o((e,t,r)=>{if(e==="tileset.json")return{tileset:r(t)}},"fromBundle"),references:[a9,Jee],integrityCheck:Kee};g();var ete=L.Object({},{$id:"WalkableProperties"}),tte=L.Object({},{$id:"NonWalkableProperties"}),rte=Ui(L.Record(Us,L.Ref(ete),{$id:"WalkableGeometries",additionalProperties:!1})),nte=Ui(L.Record(Us,L.Ref(tte),{$id:"NonWalkableGeometries",additionalProperties:!1})),MPe=L.Object({walkable:Ui(L.Record(ln,L.Ref(rte),{additionalProperties:!1})),nonwalkable:Ui(L.Record(ln,L.Ref(nte),{additionalProperties:!1}))},{$id:"TraversabilitySchema"}),OPe=/^walkable\/(.*)\.json$/,LPe=/^nonwalkable\/(.*)\.json$/,ite={name:"ext:mvf-traversability",schema:MPe,intoBundle:o(function*(e){if(e.walkable!=null)for(let t of rn(e.walkable))yield{path:"walkable/".concat(t,".json"),contents:e.walkable[t]};if(e.nonwalkable!=null)for(let t of rn(e.nonwalkable))yield{path:"nonwalkable/".concat(t,".json"),contents:e.nonwalkable[t]}},"intoBundle"),fromBundle:o((e,t,r)=>{var s,l;let n=(s=e.match(OPe))==null?void 0:s[1];if(n!=null)return{walkable:{[n]:r(t)}};let i=(l=e.match(LPe))==null?void 0:l[1];if(i!=null)return{nonwalkable:{[i]:r(t)}}},"fromBundle"),references:[ete,tte,rte,nte]};g();g();function ote(e){return e.replace(/^g_/,"s_")}o(ote,"toSpaceId");function APe(e){return e.replace(/^g_/,"o_")}o(APe,"toObstructionId");function DPe(e){return e.replace(/^g_/,"w_")}o(DPe,"toWindowId");function FPe(e){return e.replace(/^g_/,"ar_")}o(FPe,"convertAreaId");function NPe(e,t,r){switch(e.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":{let n=[],i=0,s=e.geometry.type.replace("Multi","");for(let l of e.geometry.coordinates)n.push(re(k({},e),{geometry:{type:s,coordinates:l},properties:re(k({},e.properties),{id:"".concat(t,"-").concat(i++),kind:r})}));return n}default:return[re(k({},e),{properties:re(k({},e.properties),{id:t,kind:r})})]}}o(NPe,"splitMultiPartGeometryFeatureWithNewId");function EI(e,t,r,n){let i=new Map;for(let{feature:s,floorId:l}of e){let c=s.properties.id,p=n.get(c);if(t.has(c)){let h=NPe(s,r(c),p),y=h.map(_=>_.properties.id),b=y.map(_=>({geometryId:_,floorId:l}));i.set(c,{ids:y,features:h,anchors:b})}}return i}o(EI,"mapGeometryToOtherIds");function ste(e){var p,h,y;let t={space:new Map,obstruction:new Map,area:new Map,window:new Map};if(!e.geometry)return t;let r=new Map(Object.values((p=e.kinds)!=null?p:{}).filter(b=>b!==void 0).flatMap(un)),n=un(e.geometry).flatMap(([b,_])=>{var C;return((C=_==null?void 0:_.features)!=null?C:[]).map(P=>({feature:P,floorId:b}))}).flat(),i=new Set(Object.values((h=e.walkable)!=null?h:{}).filter(b=>b!==void 0).flatMap(rn)),s=new Set(Object.values((y=e.nonwalkable)!=null?y:{}).filter(b=>b!==void 0).flatMap(rn)),l=new Set(Array.from(r.entries()).filter(([b,_])=>_==="area").map(([b])=>b)),c=new Set(Array.from(r.entries()).filter(([b,_])=>_==="window").map(([b])=>b));return i.size>0&&(t.space=EI(n,i,ote,r)),s.size>0&&(t.obstruction=EI(n,s,APe,r)),l.size>0&&(t.area=EI(n,l,FPe,r)),c.size>0&&(t.window=EI(n,c,DPe,r)),i.size===0&&s.size===0&&l.size===0&&(t.space=EI(n,new Set(n.map(b=>b.feature.properties.id)),ote,r)),t}o(ste,"createGeometryMaps");function ate(e){let t=kPe(e),r=ste(e),n=RPe(e);return{geometryMaps:r,nodesByGeometryId:t,geometryFeatureById:n}}o(ate,"buildBuilderOptions");function kPe(e){var r,n,i;let t=new Map;for(let s of Object.values((r=e.nodes)!=null?r:{}))for(let l of(n=s==null?void 0:s.features)!=null?n:[])if(l.properties.geometryIds.length>0)for(let c of l.properties.geometryIds){let p=(i=t.get(c))!=null?i:[];p.push(l.properties.id),t.set(c,p)}return t}o(kPe,"buildNodesByGeometryId");function RPe(e){var r,n;let t=new Map;for(let i of Object.values((r=e.geometry)!=null?r:{}))for(let s of(n=i==null?void 0:i.features)!=null?n:[])t.set(s.properties.id,s);return t}o(RPe,"buildGeometryFeatureById");g();function lte(e,t){if(!e.annotations||!e.annotationSymbols||!e.geometry)return{};let r={};for(let[n,i]of un(e.annotations)){if(!i||i.length===0||!e.geometry[n]||e.geometry[n].features.length===0)continue;let s=new Map(e.geometry[n].features.map(c=>[c.properties.id,c])),l={type:"FeatureCollection",features:[]};for(let c of i){let p=s.get(c.geometryId);if(!p||p.geometry.type!=="Point")continue;let h={id:c.id,externalId:c.externalId,symbolId:c.symbolKey};l.features.push({type:"Feature",geometry:p.geometry,properties:h})}r[n]=l}return{annotation:r}}o(lte,"buildAnnotations");g();function ute(e,{nodesByGeometryId:t}){var l,c,p,h,y,b,_;let r={"connection.json":[],entrance:{}},n=(l=e.navigationFlags)==null?void 0:l[r9.accessible],i=(c=e.navigationFlags)==null?void 0:c[r9.outdoors],s=new Map(Object.values((p=e.geometry)!=null?p:{}).flatMap(C=>{var P;return(P=C==null?void 0:C.features)!=null?P:[]}).map(C=>[C.properties.id,C]));for(let C of(h=e.connections)!=null?h:[]){if(l9(C,s)){let O=BPe(C,s,t,i);for(let[D,A]of O)r.entrance[D]||(r.entrance[D]={type:"FeatureCollection",features:[]}),r.entrance[D].features.push(A);continue}let P=n!=null&&C.entrances.every(O=>V1(O,n))&&C.exits.every(O=>V1(O,n)),E=Array.from(new Set([...C.entrances.map(O=>t.get(O.geometryId)),...C.exits.map(O=>t.get(O.geometryId))].flat().filter(O=>O!=null))),T={id:C.id,externalId:(b=(y=C.details)==null?void 0:y.externalId)!=null?b:"",type:C.type,accessible:P,nodes:E};(_=C.details)!=null&&_.name&&(T.details={name:C.details.name}),C.extra&&(T.extra=C.extra),r["connection.json"].push(T)}return r}o(ute,"buildConnections");function l9(e,t){return e.type==i9.door&&e.entrances.every(r=>{let n=t.get(r.geometryId);return(n==null?void 0:n.geometry.type)==="LineString"})}o(l9,"isLineDoor");function BPe(e,t,r,n){var s,l;if(e.type!==i9.door)return[];let i=[];for(let c of e.entrances){let p=t.get(c.geometryId);if((p==null?void 0:p.geometry.type)==="LineString"){let h={type:"Feature",geometry:p.geometry,properties:{id:e.id,externalId:(l=(s=e.details)==null?void 0:s.externalId)!=null?l:"",isExterior:$Pe(e,n)}},y=e.details;y&&(h.properties.details={name:y.name,description:y.description},y.icon&&(h.properties.details.images=[{url:y.icon,altText:"".concat(y.name," icon")}]));let b=r.get(c.geometryId);b&&b.length>0&&(h.properties.node=b[0]),i.push([c.floorId,h])}}return i}o(BPe,"buildEntranceFeaturesFromConnection");function $Pe(e,t){return e.entrances.some(r=>V1(r,t))||e.exits.some(r=>V1(r,t))}o($Pe,"isExterior");g();function pte(e,{geometryMaps:t,nodesByGeometryId:r}){var D,A,R,j,X,Y,N,Z,ae,se,U,xe,ne,Pe,Ce,Ue,_e,Me,Q,it,Ke,rt,Ae;if(!e.enterprise)return{};let n={categories:[],locations:[],locationInstances:[],layers:[],venue:{slug:"",name:"",externalId:"",defaultLanguage:{name:"",code:""},languages:[]}},i=(D=e.manifest)==null?void 0:D.features[0];if(i&&(n.venue.defaultFloor=i.properties.defaultFloor,n.venue.tzid=i.properties.tzid,n.venue.name=i.properties.name),e.enterprise.venue){let Be=e.enterprise.venue;n.venue=re(k({},n.venue),{slug:Be.slug,name:(A=Be.details.name)!=null?A:n.venue.name,externalId:(R=Be.details.externalId)!=null?R:"",defaultLanguage:Be.defaultLanguage,languages:Be.languages,countrycode:Be.countrycode,coverImage:Be.coverImage,logo:Be.logo,icon:Be.details.icon,extra:Be.extra,mappedinWebUrl:Be.mappedinWebUrl,operationHours:Be.operationHours,topLocations:Be.topLocations})}let s=new Map,l=new Map,c=e.locations,p=e.enterprise.locations;if(c&&p){let Be=new Map(c.map(We=>[We.id,We]));for(let We of p){let je=Be.get(We.locationId);if(je){let Se=je.details,H={id:We.id,name:Se.name,externalId:(j=Se.externalId)!=null?j:"",type:We.type,sortOrder:We.sortOrder,amenity:We.amenity,description:Se.description,extra:je.extra,links:je.links,operationHours:je.openingHours,gallery:We.gallery,logo:je.logo,shortName:Se.shortName,picture:We.picture,showFloatingLabelWhenImagePresent:We.showFloatingLabelWhenImagePresent,showLogo:We.showLogo,siblingGroups:We.siblingGroups,states:We.states,tags:We.tags,spaces:[],nodes:[],polygons:[]};je.phone&&(H.phone={number:je.phone});let ie=cte(je.social);je.website&&(ie.website=je.website.url),H.social=ie;for(let ee of je.geometryAnchors){let Ee=t.space.get(ee.geometryId);if(Ee){let Oe=new Set(Ee.features.filter(Ye=>Ye.geometry.type==="Polygon").map(Ye=>Ye.properties.id));for(let Ye of Ee.anchors)H.spaces.push({floor:Ye.floorId,id:Ye.geometryId}),Oe.has(Ye.geometryId)&&H.polygons.push({map:Ye.floorId,id:Ye.geometryId})}let Ne=r.get(ee.geometryId);for(let Oe of Ne!=null?Ne:[])H.nodes.push({map:ee.floorId,id:Oe})}n.locations.push(H);for(let ee of je.categories)s.set(ee,[...(X=s.get(ee))!=null?X:[],We.id]);l.set(We.id,je.categories)}}}let h=e.enterprise.locationInstances,y=e.locationInstances;if(h&&y){let Be=new Map(y.map(je=>[je.id,je])),We=[];for(let je of h){let Se=Be.get(je.locationInstanceId);if(Se){let H={id:je.id,parent:je.parentId,name:(Y=Se.details)==null?void 0:Y.name,externalId:(N=Se.details)==null?void 0:N.externalId,type:je.type,sortOrder:je.sortOrder,amenity:je.amenity,description:(Z=Se.details)==null?void 0:Z.description,extra:Se.extra,links:Se.links,operationHours:Se.openingHours,gallery:je.gallery,picture:je.picture,showFloatingLabelWhenImagePresent:je.showFloatingLabelWhenImagePresent,showLogo:je.showLogo,siblingGroups:je.siblingGroups,states:je.states,tags:je.tags,logo:Se.logo,shortName:(ae=Se.details)==null?void 0:ae.shortName};Se.phone&&(H.phone={number:Se.phone});let ie=cte((se=Se.social)!=null?se:[]);if(Se.website&&(ie.website=Se.website.url),Object.keys(ie).length>0&&(H.social=ie),(U=Se.geometryAnchors)!=null&&U.length){let ee=Se.geometryAnchors.flatMap(Ee=>{var Ne,Oe;return(Oe=(Ne=t.space.get(Ee.geometryId))==null?void 0:Ne.anchors)!=null?Oe:[]});ee.length>0&&(H.spaces=ee.map(Ee=>({floor:Ee.floorId,id:Ee.geometryId})))}if(Se.geometryAnchors){H.spaces=[],H.polygons=[],H.nodes=[];for(let ee of Se.geometryAnchors){let Ee=t.space.get(ee.geometryId);if(Ee){let Oe=new Set(Ee.features.filter(Ye=>Ye.geometry.type==="Polygon").map(Ye=>Ye.properties.id));for(let Ye of Ee.anchors)H.spaces.push({floor:Ye.floorId,id:Ye.geometryId}),Oe.has(Ye.geometryId)&&H.polygons.push({map:Ye.floorId,id:Ye.geometryId})}let Ne=r.get(ee.geometryId);for(let Oe of Ne!=null?Ne:[])H.nodes.push({map:ee.floorId,id:Oe})}}We.push(H)}}We.length>0&&(n.locationInstances=We)}let b=e.locationCategories,_=e.enterprise.categories;if(b&&_){let Be=[],We=new Map(b.map(ie=>[ie.id,ie])),je=new Map(_.map(ie=>[ie.categoryId,ie.id])),Se=new Map;for(let ie of b){let ee=je.get(ie.parent);if(ee){let Ee=(xe=Se.get(ee))!=null?xe:[];Ee.push(ie.id),Se.set(ee,Ee)}}for(let ie of _){let ee=We.get(ie.categoryId);if(ee){let Ne=((ne=Se.get(ie.id))!=null?ne:[]).map(Ye=>je.get(Ye)).filter(Ye=>Ye!==void 0),Oe={id:ie.id,name:ee.details.name,externalId:(Pe=ee.details.externalId)!=null?Pe:"",sortOrder:ie.sortOrder,children:Ne,locations:(Ce=s.get(ie.categoryId))!=null?Ce:[],icon:ee.details.icon,picture:ie.picture,color:ie.color,extra:ee.extra,iconFromDefaultList:ie.iconFromDefaultList};Be.push(Oe)}}n.categories=Be;let H={};for(let[ie,ee]of l.entries())H[ie]=ee.map(Ee=>je.get(Ee)).filter(Ee=>Ee!==void 0);n.categoryPriorities=H}let C={};for(let[Be,We]of Object.entries((Ue=e.defaultStyle)!=null?Ue:{}))if(We.buffer>0){let je=We.geometryAnchors.flatMap(Se=>{var H,ie;return(ie=(H=t.space.get(Se.geometryId))==null?void 0:H.anchors)!=null?ie:[]});C[Be]={edgeOffset:We.buffer,geometryAnchors:je}}Object.keys(C).length>0&&(n.enterpriseStyles=C);let P=new Map;for(let Be of Object.values((_e=e.enterprise.layers)!=null?_e:{}))if(Be)for(let[We,je]of un(Be)){if(typeof je!="string")continue;let Se=(Me=P.get(je))!=null?Me:{name:je,id:"ely_".concat(je),spaces:[]};Se.spaces.push(...(it=(Q=t.space.get(We))==null?void 0:Q.anchors.map(H=>({floorId:H.floorId,spaceId:H.geometryId})))!=null?it:[]),P.set(je,Se)}P.size>0&&(n.layers=Array.from(P.values()));let E=[];for(let Be of Object.values((Ke=e.enterprise.textures)!=null?Ke:{}))for(let We of Be){let je=(rt=t.space.get(We.geometryId))==null?void 0:rt.anchors;!je||je.length<1||We.face==="unknown"||We.surface==="unknown"||E.push({repeat:We.repeat,offset:We.offset,rotation:We.rotation,path:We.path,face:We.face,surface:We.surface,bounds:We.bounds,geometryAnchors:je})}E.length>0&&(n.textures=E);let T={};for(let[Be,We]of Object.entries((Ae=e.enterprise.floorText)!=null?Ae:{})){let je={type:"FeatureCollection",features:[]};for(let Se of We.features){if(Se.properties.align==="unknown")continue;let H={align:Se.properties.align,color:Se.properties.color,fontFamily:Se.properties.fontFamily,fontSize:Se.properties.fontSize,rotation:Se.properties.rotation,text:Se.properties.text,visible:Se.properties.visible};"geometryId"in Se.properties?H.geometryId=Se.properties.geometryId:H.verticalOffset=Se.properties.verticalOffset,je.features.push({type:"Feature",geometry:Se.geometry,properties:H})}je.features.length>0&&(T[Be]=je)}Object.keys(T).length>0&&(n.floorText=T);let O={enterprise:n};if(e.enterprise.textAreas){let Be={};for(let[We,je]of un(e.enterprise.textAreas)){let Se={type:"FeatureCollection",features:[]};for(let H of je.features){if(H.properties.align==="unknown")continue;let ie={align:H.properties.align,maxWidth:H.properties.maxWidth,maxHeight:H.properties.maxHeight,rotation:H.properties.rotation};"geometryId"in H.properties?ie.anchorId=H.properties.geometryId:ie.verticalOffset=H.properties.verticalOffset;let ee={type:"Feature",geometry:H.geometry,properties:ie};Se.features.push(ee)}Be[We]=Se}O.textAreas=Be}return O}o(pte,"buildEnterprise");var jPe=["facebook","instagram","twitter"];function cte(e){let t={};for(let{name:r,url:n}of e){let i=r.toLowerCase();jPe.includes(i)&&(t[i]=n)}return t}o(cte,"convertSocials");g();function fte(e,{geometryMaps:t}){if(!e.facade)return{};let r={},n={};for(let[i,s]of un(e.facade))s&&(n[i]={id:s.id,spaces:s.geometryAnchors.flatMap(({floorId:l,geometryId:c})=>{var p;return(p=t.space.get(c))==null?void 0:p.ids.map(h=>({floorId:l,spaceId:h}))}).filter(l=>l!==void 0)});return Object.keys(n).length>0&&(r.facade=n),r}o(fte,"buildFacade");g();function dte(e,t={}){var i,s,l,c,p,h,y,b,_,C,P,E;let r={type:"FeatureCollection",features:[]},n=[];for(let T of e.floors.features)n.push({id:T.properties.id.replace(/^f_/,"m_"),externalId:(s=(i=T.properties.details)==null?void 0:i.externalId)!=null?s:"",elevation:T.properties.elevation,name:(c=(l=T.properties.details)==null?void 0:l.name)!=null?c:"",shortName:(h=(p=T.properties.details)==null?void 0:p.shortName)!=null?h:"",subtitle:T.properties.subtitle}),r.features.push({type:"Feature",geometry:T.geometry,properties:{id:T.properties.id,externalId:(b=(y=T.properties.details)==null?void 0:y.externalId)!=null?b:"",elevation:T.properties.elevation,name:(C=(_=T.properties.details)==null?void 0:_.name)!=null?C:"",shortName:(E=(P=T.properties.details)==null?void 0:P.shortName)!=null?E:"",subtitle:T.properties.subtitle}});return{"floor.geojson":r,"map.geojson":n}}o(dte,"buildFloors");g();function hte(e,{geometryMaps:t}){var i,s,c,p,h;let r={},n={};for(let[y,b]of un((i=e.floorImages)!=null?i:{})){let _={features:[],type:"FeatureCollection"};for(let C of(s=b==null?void 0:b.features)!=null?s:[])if("verticalOffset"in C.properties)_.features.push(C);else{let l=C.properties,{geometryId:P}=l,E=ls(l,["geometryId"]),T=(h=(c=t.space.get(P))==null?void 0:c.ids[0])!=null?h:(p=t.obstruction.get(P))==null?void 0:p.ids[0];if(!T)continue;let O={geometry:C.geometry,properties:re(k({},E),{anchorId:T}),type:C.type};_.features.push(O)}n[y]=_}return Object.keys(n).length>0&&(r.floorImages=n),r}o(hte,"buildFloorImages");g();function mte(e,t={}){var i,s,l,c,p,h,y;let r=[];for(let b of(i=e==null?void 0:e.floorStacks)!=null?i:[]){let _={id:b.id,floors:b.floors,maps:b.floors,externalId:(l=(s=b.details)==null?void 0:s.externalId)!=null?l:"",name:(p=(c=b.details)==null?void 0:c.name)!=null?p:"",shortName:(y=(h=b.details)==null?void 0:h.shortName)!=null?y:"",type:"Building"};b.defaultFloor&&(_.defaultFloor=b.defaultFloor),r.push(_)}if(e.outdoors){let b={id:"outdoors",floors:e.outdoors.floors,maps:e.outdoors.floors,type:"Outdoor",name:"Outdoors",externalId:"outdoors"};r.push(b)}return{"floorstack.json":r,"mapstack.geojson":r}}o(mte,"buildFloorStacks");g();g();var vte=Pn(yte(),1);var qPe=o(e=>{let t=e.geometry.coordinates[0],r=0;for(let n=0;n<t.length-1;n++)r+=t[n][0]*t[n+1][1]-t[n+1][0]*t[n][1];return Math.abs(r/2)},"calculateArea"),HPe=o((e,t)=>{let[r,n]=e,i=t.geometry.coordinates[0],s=!1;for(let l=0,c=i.length-1;l<i.length;c=l++){let[p,h]=i[l],[y,b]=i[c];h>n!=b>n&&r<(y-p)*(n-h)/(b-h)+p&&(s=!s)}return s},"pointInPolygon"),WPe=o(e=>{let t=e.geometry.coordinates[0],r=0,n=0;for(let i=0;i<t.length-1;i++)r+=t[i][0],n+=t[i][1];return{geometry:{coordinates:[r/(t.length-1),n/(t.length-1)]}}},"calculateCenterOfMass"),XPe=o(e=>{let t=qPe(e),r=Number.isFinite(t)?Math.max(t,1):1;return Math.sqrt(r)*1e-6},"estimatePrecision"),HP=o(e=>{try{let r=WPe(e).geometry.coordinates;if(!HPe(r,e)){let i=(0,vte.default)(e.geometry.coordinates,XPe(e));return st([i[0],i[1]])}return st(r)}catch(t){return lt(new Error("Unable to calculate center of polygon"))}},"labelCenter");function c9(e){var t;return((t=e==null?void 0:e.geometry)==null?void 0:t.type)==="Polygon"}o(c9,"isPolygonFeature");function bte(e,{geometryMaps:t,nodesByGeometryId:r}){var h,y,b,_,C,P,E,T,O;let n=QPe(e.defaultStyle),i={},s={},l={},c={};for(let D of rn(e.geometry)){let A=e.geometry[D];if(!A)continue;let R=[],j=[],X=[],Y=[];for(let N of A.features){let Z=N.properties.id,ae=n.has(Z),se=(h=r.get(Z))!=null?h:[];for(let U of(b=(y=t.space.get(Z))==null?void 0:y.features)!=null?b:[])R.push(YPe(U,se));for(let U of(C=(_=t.obstruction.get(Z))==null?void 0:_.features)!=null?C:[])j.push(ZPe(U,ae));for(let U of(E=(P=t.area.get(Z))==null?void 0:P.features)!=null?E:[])X.push(KPe(U,se));for(let U of(O=(T=t.window.get(Z))==null?void 0:T.features)!=null?O:[])Y.push(JPe(U))}R.length>0&&(i[D]={type:"FeatureCollection",features:R.filter(N=>N!==null)}),j.length>0&&(s[D]={type:"FeatureCollection",features:j.filter(N=>N!==null)}),X.length>0&&(l[D]={type:"FeatureCollection",features:X.filter(N=>N!==null)}),Y.length>0&&(c[D]={type:"FeatureCollection",features:Y.filter(N=>N!==null)})}let p={space:i,obstruction:s};return Object.keys(l).length>0&&(p.area=l),Object.keys(c).length>0&&(p.window=c),p}o(bte,"buildGeometry");function YPe(e,t){var n,i;switch(e.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":return null}let r={type:"Feature",geometry:e.geometry,properties:{destinationNodes:t,id:e.properties.id,externalId:(i=(n=e.properties.details)==null?void 0:n.externalId)!=null?i:"",kind:e.properties.kind}};return e.properties.details&&(r.properties.details={name:e.properties.details.name,description:e.properties.details.description,images:e.properties.details.icon?[{url:e.properties.details.icon,altText:e.properties.details.name?"".concat(e.properties.details.name," icon"):"icon"}]:void 0}),c9(r)&&(r.properties.center=HP(r).unwrapOr(void 0)),r}o(YPe,"buildSpace");function ZPe(e,t){var i,s;switch(e.geometry.type){case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"Point":return null}let r=e.properties,n={type:"Feature",geometry:e.geometry,properties:{id:r.id,externalId:(s=(i=r.details)==null?void 0:i.externalId)!=null?s:"",entrances:[],kind:r.kind,footprintComponent:t}};return c9(n)&&(n.properties.center=HP(n).unwrapOr(void 0)),r.details&&(n.properties.details={name:r.details.name,description:r.details.description,images:r.details.icon?[{url:r.details.icon,altText:r.details.name?"".concat(r.details.name," icon"):"icon"}]:void 0}),n}o(ZPe,"buildObstruction");function KPe(e,t){var i,s;if(e.geometry.type!=="Polygon")return null;let r=e.properties,n={type:"Feature",geometry:e.geometry,properties:{id:r.id,externalId:(s=(i=r.details)==null?void 0:i.externalId)!=null?s:"",destinationNodes:t}};return c9(n)&&(n.properties.center=HP(n).unwrapOr(void 0)),r.details&&(n.properties.details={name:r.details.name,description:r.details.description,images:r.details.icon?[{url:r.details.icon,altText:r.details.name?"".concat(r.details.name," icon"):"icon"}]:void 0}),n}o(KPe,"buildArea");function JPe(e){return e.geometry.type!=="LineString"?null:{type:"Feature",geometry:e.geometry,properties:{id:e.properties.id}}}o(JPe,"buildWindow");function QPe(e){var n,i,s,l;let t=[...(i=(n=e==null?void 0:e.ExteriorWalls)==null?void 0:n.geometryAnchors)!=null?i:[],...(l=(s=e==null?void 0:e.Walls)==null?void 0:s.geometryAnchors)!=null?l:[]];return new Set(t.map(c=>c.geometryId))}o(QPe,"calculateFootprintGeometry");g();function xte(e,{geometryMaps:t,geometryFeatureById:r}){var i,s,l,c,p,h,y,b,_,C,P,E,T;if(!e.locationCategories&&!e.locations)return{};let n={};if((i=e.locationCategories)!=null&&i.length){let O=[];for(let D of e.locationCategories){let A={id:D.id,name:D.details.name,icon:(s=D.details.icon)!=null?s:""};D.parent&&(A.parent=D.parent),O.push(A)}n["category.json"]=O}if((l=e.locations)!=null&&l.length){let O=e3e(e,{geometryFeatureById:r}),D=[];for(let A of e.locations){let R={id:A.id,name:A.details.name,categories:A.categories,spaces:[],obstructions:[],areas:[],annotations:[],connections:[],entrances:[],links:A.links,openingHoursSpecification:(c=A.openingHours)!=null?c:[],pictures:A.images,social:A.social,description:A.details.description,externalId:A.details.externalId,icon:A.details.icon,logo:A.logo,phone:A.phone,website:A.website};D.push(R);for(let{geometryId:j,floorId:X}of A.geometryAnchors)R.spaces.push(...(h=(p=t.space.get(j))==null?void 0:p.ids.map(Y=>({id:Y,floor:X})))!=null?h:[]),R.obstructions.push(...(b=(y=t.obstruction.get(j))==null?void 0:y.ids.map(Y=>({id:Y,floor:X})))!=null?b:[]),R.areas.push(...(C=(_=t.area.get(j))==null?void 0:_.ids.map(Y=>({id:Y,floor:X})))!=null?C:[]),R.entrances.push(...(P=O.entrancesByGeometryId.get(j))!=null?P:[]),R.connections.push(...(E=O.connectionsByGeometryId.get(j))!=null?E:[]),R.annotations.push(...(T=O.annotationsByGeometryId.get(j))!=null?T:[])}n["location.json"]=D}return n}o(xte,"buildLocations");function e3e(e,{geometryFeatureById:t}){var n,i,s;let r={annotationsByGeometryId:new Map,connectionsByGeometryId:new Map,entrancesByGeometryId:new Map};if(e.annotations)for(let[l,c]of un(e.annotations))for(let p of c!=null?c:[]){let h=p.geometryId,y=p.id,b=(n=r.annotationsByGeometryId.get(h))!=null?n:[];b.push({floor:l,id:y}),r.annotationsByGeometryId.set(h,b)}if(e.connections)for(let l of e.connections){let c=l9(l,t),p=Array.from(new Map([...l.entrances,...l.exits].map(h=>["".concat(h.geometryId,"_").concat(h.floorId),h])).values());for(let h of p){let y=h.geometryId;if(c){let b=(i=r.entrancesByGeometryId.get(y))!=null?i:[];b.push({floor:h.floorId,id:l.id}),r.entrancesByGeometryId.set(y,b)}else{let b=(s=r.connectionsByGeometryId.get(y))!=null?s:[];b.push(l.id),r.connectionsByGeometryId.set(y,b)}}}return r}o(e3e,"buildLocationAttachmentMaps");g();function Ite(e,t){let r={features:[],type:"FeatureCollection"},n={"manifest.geojson":r},i=e.manifest;if(i.features.length>0){let s=i.features[0],l=s.properties,c={type:"Feature",geometry:s.geometry,properties:{folder_struct:[],version:"2.0.0",time:l.time,name:l.name,naturalBearing:l.naturalBearing,tzid:l.tzid,map:l.mapId,org_id:l.orgId,language:l.language}};r.features.push(c)}return n}o(Ite,"buildManifest");g();function _te(e,{geometryMaps:t}){var c,p,h,y,b,_,C,P,E,T,O,D,A,R,j;let r={"node.geojson":{type:"FeatureCollection",features:[]}},n=r["node.geojson"].features,i=new Map;for(let X of(p=(c=e.floors)==null?void 0:c.features)!=null?p:[])i.set(X.properties.id,X.properties.elevation);let s=new Map;for(let X of Object.values((h=e.nodes)!=null?h:{}))for(let Y of(y=X==null?void 0:X.features)!=null?y:[])for(let N of Y.properties.geometryIds)s.set(N,[...(b=s.get(N))!=null?b:[],Y.properties.id]);let l=new Map;for(let X of(_=e.connections)!=null?_:[]){let Y=X.exits.map(N=>{var Z;return re(k({},N),{nodes:(Z=s.get(N.geometryId))!=null?Z:[]})});for(let N of X.entrances){let Z=(C=s.get(N.geometryId))!=null?C:[];for(let ae of Z)for(let se of Y){let U=Math.abs(((P=i.get(N.floorId))!=null?P:0)-((E=i.get(se.floorId))!=null?E:0))*X.floorCostMultiplier,xe=(T=l.get(ae))!=null?T:[];xe.push(...se.nodes.map(ne=>({id:ne,weight:U+X.entryCost}))),l.set(ae,xe)}}}for(let[X,Y]of un((O=e.nodes)!=null?O:{}))for(let N of(D=Y==null?void 0:Y.features)!=null?D:[]){let Z=(A=t.space.get(N.properties.geometryIds[0]))==null?void 0:A.features[0],ae=(Z==null?void 0:Z.geometry.type)==="Point"&&((R=Z==null?void 0:Z.properties.details)!=null&&R.externalId)?Z.properties.details.externalId:"",se={type:"Feature",geometry:N.geometry,properties:{id:N.properties.id,floor:X,space:N.properties.geometryIds.map(U=>{var xe;return(xe=t.space.get(U))==null?void 0:xe.ids}).flat().filter(U=>U!==void 0),neighbors:[...N.properties.neighbors.map(U=>({id:U.id,weight:U.extraCost})),...(j=l.get(N.properties.id))!=null?j:[]],map:X,externalId:ae}};n.push(se)}return r}o(_te,"buildNodes");g();function t3e(e,t){var n;let r={};for(let i of e){let s=t.get(i);s&&((n=r[s])!=null||(r[s]=[]),r[s].push(i))}return r}o(t3e,"groupGeometryByType");function Ste(e,{geometryMaps:t}){var l,c,p;if(!e.defaultStyle)return{};let r={},n={};r["styles.json"]=n;let i=[...Array.from(t.space.values()).map(h=>h.features),...Array.from(t.obstruction.values()).map(h=>h.features)],s=new Map(i.flatMap(h=>h.map(y=>[y.properties.id,y.geometry.type])));for(let[h,y]of un(e.defaultStyle)){let b=t3e(y.geometryAnchors.flatMap(_=>{var C,P,E,T;return[...(P=(C=t.space.get(_.geometryId))==null?void 0:C.ids)!=null?P:[],...(T=(E=t.obstruction.get(_.geometryId))==null?void 0:E.ids)!=null?T:[]]}),s);if(b.Point&&b.Point.length>0){let _={points:Array.from(b.Point.values()),showImage:((l=y.extra)==null?void 0:l.showImage)!==void 0?((c=y.extra)==null?void 0:c.showImage)===!0:y.opacity!==0};n["".concat(h,".Point")]=_}if(b.LineString&&b.LineString.length>0){let _={lineStrings:Array.from(b.LineString.values()),altitude:y.altitude,color:y.color,height:y.height,opacity:y.opacity,width:y.buffer};n["".concat(h,".LineString")]=_}if(b.Polygon&&b.Polygon.length>0){let _={polygons:Array.from(b.Polygon.values()),altitude:y.altitude,color:y.color,height:y.height,opacity:y.opacity};((p=y.extra)==null?void 0:p.showImage)!==void 0&&(_.showImage=y.extra.showImage===!0),n["".concat(h,".Polygon")]=_}}return r}o(Ste,"buildStyles");var r3e=pQ().extendOptional(uee).extendOptional(Hee).extendOptional(gee).extendOptional(jee).extendOptional(ite).extendOptional(xee).extendOptional(wee).extendOptional(Zee).extendOptional(Qee).extendOptional(kee).extendOptional(Mee).extendOptional(pJ).extendOptional(xQ).extendOptional(iee).build().expect("Invalid parser, this should never happen. Likely a bug in the MVFv2 library, or one of the extensions.");function n3e(e){let t=ate(e),r=dte(e,t),n=bte(e,t),i=_te(e,t),s=ute(e,t),l=Ste(e,t),c=mte(e,t),p=hte(e,t),h=fte(e,t),y=lte(e,t),b=xte(e,t),_=pte(e,t),C=Ite(e,t);return k(k(k(k(k(k(re(k(k(k(k(k(k({},r),n),i),s),l),c),{"tileset.json":e.tileset}),p),h),y),b),_),C)}o(n3e,"convertUnzippedStandardMVFv3ToParsedMVFv2");async function p9(e){let t=await r3e.decompress(e);return t.isOk()?st(n3e(t.value)):lt(t.error)}o(p9,"extractAndConvertMVFv3");g();function q1(e){return e.endsWith("/")?e:"".concat(e,"/")}o(q1,"normalizeUrl");g();var H1="https://app.mappedin.com/",Cte="https://auth.mappedin.com/";g();g();var i3e=o(e=>{let t=Date.now();return e-t},"fromNow"),WP=o((e,t)=>i3e(e)<=t*60*1e3,"shouldRefreshToken");var Pte=60,Tte=Pte*60*1e3,wte="accessTokens";async function MI(e,t=!1){let r="".concat(e.key),n=Jp.getInstance(),i=(n==null?void 0:n.loadSessionData(wte))||{},s=Math.floor(Date.now()/1e3);if(i[r]&&!WP(i[r].expiresTimestamp*1e3,Pte))return i[r];let l=t?await o3e(e,s):await s3e(e,s),c=re(k({},i),{[r]:l});return n==null||n.saveSessionData(wte,c),l}o(MI,"getAccessToken");async function o3e(e,t){var s;let r="".concat((s=e.baseAuthUri)!=null?s:Cte,"oauth2/token"),n=await Ku()(r,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials",client_id:e.key,client_secret:e.secret})});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText,": ").concat(await n.text()));let i=await n.json();return{accessToken:i.access_token,expiresTimestamp:t+i.expires_in}}o(o3e,"fetchAccessTokenEnterprise");async function s3e(e,t){let r="".concat(e.baseAuthUri?q1(e.baseAuthUri):H1,"api/api-key/token"),n=await Ku()(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e.key,secret:e.secret})});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText,": ").concat(await n.text()));let i=await n.json();return{accessToken:i.access_token,expiresTimestamp:t+i.expires_in}}o(s3e,"fetchAccessToken");g();var Mte=60,Ote=Mte*60*1e3,Ete="miSasTokens";async function f9(e,t){let r="".concat(t,"__").concat(e.mapId),n=Jp.getInstance(),i=(n==null?void 0:n.loadSessionData(Ete))||{};if(i[r]&&!WP(i[r].expires,Mte))return i[r];let s=await a3e(e,t),l=re(k({},i),{[r]:{token:s.token,expires:new Date(s.expires).getTime()}});return n==null||n.saveSessionData(Ete,l),s}o(f9,"getSasToken");async function a3e(e,t){let r="".concat(e.baseUri?q1(e.baseUri):H1,"api/v1/venue/").concat(e.mapId,"/sas-token"),n=await Ku()(r,{method:"GET",headers:{Authorization:"Bearer ".concat(t)}});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText,": ").concat(await n.text()));let i=await n.json();return{token:i.token,expires:new Date(i.expires).getTime()}}o(a3e,"fetchSasToken");var Lte=globalThis.fetch,Fte,l3e=(Fte=I==null?void 0:I.env)==null?void 0:Fte.npm_package_version;function Ku(){if(Lte==null)throw new Error("fetch is not available in your environment. Pass your own function into `setFetchFn` (node-fetch, etc)");return Lte}o(Ku,"isomorphicFetch");var d9={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",venue:""};function Nte(e){var r;let t=k(k({},d9),e);return t.headers=re(k({},t.headers),{"mappedin-sdk-version":l3e}),t.things=[],"platformString"in e&&(t.headers=re(k({},t.headers),{"mappedin-platform-version":e.platformString})),t.noAuth||(t.accessToken?t.authorization="Bearer ".concat(t.accessToken):t.clientId&&t.clientSecret&&(t.authorization="Basic ".concat(globalThis.btoa("".concat(t.clientId,":").concat(t.clientSecret))))),t.language=(r=t.language)==null?void 0:r.toLowerCase(),t}o(Nte,"parseOptions");function u3e(e,t,r=!1){let n={language:e.language,clientId:e.clientId,clientSecret:e.clientSecret};r&&delete n.language;let{headers:i}=e;i["Content-Type"]=i["Content-Type"]||"text/json",e.accessToken?i.Authorization="Bearer ".concat(e.accessToken):e.noAuth||e.clientId&&e.clientSecret&&(i["x-mappedin-key"]=btoa(e.clientId),i["x-mappedin-secret"]=btoa(e.clientSecret));let s={method:"GET",headers:i};return e.secure&&(t+="&withcdntoken"),{req:s,url:t}}o(u3e,"constructParamsForRequest");async function c3e(e,t,r=!1){let n=u3e(e,t,r),i=await Ku()(n.url,n.req);if(!i.ok)throw new Error("".concat(i.status," ").concat(i.statusText));return i.json()}o(c3e,"generateAPIRequest");var p3e=o(e=>{let t=e!=null&&typeof e=="object"&&"perspectives"in e&&e.perspectives!=null&&typeof e.perspectives=="object"?e.perspectives:null;if(t==null||Object.keys(t).length===0)return ce.warn("No perspectives available in response!"),null;let r={};for(let[n,i]of Object.entries(t)){let s="url"in i&&typeof i.url=="string"?i.url:null,l="locale_packs"in i&&typeof i.locale_packs=="object"?i.locale_packs:null;if(s==null||l==null){ce.warn("Perspective ".concat(n," is missing url or locale_packs!"));continue}r[n]={url:s,locale_packs:l}}return r},"getPerspectivesFromResponse");async function f3e(e,t="exports/mvf/1/bundle"){var h,y;let r=Nte(k(k({baseUri:"https://api-gateway.mappedin.com/"},d9),e)),n="".concat(r.baseUri+t,"?venue=").concat(r.venue,"&version=").concat((h=r.version)!=null?h:"2.0.0");r.headers["Content-Type"]="application/zip";let i=await c3e(r,n),s=i.url,l=i.locale_packs,c=(y=r.perspective)!=null?y:d9.perspective,p=p3e(i);if(c!=null&&c!==""&&p!=null){let b=p[c];b==null?ce.warn("Perspective ".concat(c," not found in response! Loading default perspective instead.")):(ce.log('Loading perspective "'.concat(c,'"')),s=b.url,l=b.locale_packs)}return{url:s,localePacks:l,updated_at:i.updated_at}}o(f3e,"getVenueMVFURL");var OI=function(){let e;return()=>(e||(e=new TextDecoder),e)}();async function h9(e,{signal:t}){let r=await(await Ku()(e,{signal:t})).arrayBuffer();return new Uint8Array(r)}o(h9,"getLanguagePackUnitArray");async function W1(e){let r=(await import("./browser-CR4WWHP7.js")).unzipSync(e),n={};if(r["enterprise/"]!=null){n.enterprise={};let i=r["enterprise/locations.json"];i&&(n.enterprise.locations=JSON.parse(OI().decode(i)));let s=r["enterprise/categories.json"];s&&(n.enterprise.categories=JSON.parse(OI().decode(s)))}return r["floorstack.json"]&&(n["floorstack.json"]=JSON.parse(OI().decode(r["floorstack.json"]))),r["floor.geojson"]&&(n["floor.geojson"]=JSON.parse(OI().decode(r["floor.geojson"]))),r["manifest.json"]&&(n["manifest.geojson"]=JSON.parse(OI().decode(r["manifest.json"]))),n}o(W1,"parseLanguagePack");async function kte(e,{signal:t}){try{let r=await(await Ku()(e,{signal:t})).arrayBuffer();if(t.aborted)return;let n=new Uint8Array(r);return await W1(n)}catch(r){let n=new Error("downloadLanguagePack failed");throw n.cause=r,n}}o(kte,"downloadLanguagePack");async function m9(e){return new Promise(async(t,r)=>{try{let n=e.useDraftData?"exports/mvf2-draft/1/bundle":"exports/mvf2/1/bundle",{url:i,localePacks:s}=await f3e(e,n),l=await Ku()(i).then(p=>p.arrayBuffer()),c=new Uint8Array(l);t({compressed:c,localePacks:s})}catch(n){r(n)}})}o(m9,"downloadVenueBundleMVFAPIGateway");async function g9(e,t){return new Promise(async(r,n)=>{try{let{url:i}=await d3e(e,t),s=await Ku()(i).then(c=>c.arrayBuffer()),l=new Uint8Array(s);r(l)}catch(i){n(i)}})}o(g9,"downloadMVF");async function d3e(e,t){let r=new URL("".concat(e.baseUri?q1(e.baseUri):H1,"api/venue/").concat(e.mapId,"/mvf"));e.viewId&&r.searchParams.set("configId",e.viewId),e.mvfVersion&&r.searchParams.set("version",e.mvfVersion);let n=await Ku()(r.toString(),{headers:{Authorization:"Bearer ".concat(t)}});if(!n.ok)throw new Error("".concat(n.status," ").concat(n.statusText));return n.json()}o(d3e,"getMakerBundleURL");function XP(e){var n,i,s,l,c,p,h,y,b,_,C,P,E,T,O,D,A,R;let t=new TextDecoder,r=t.decode.bind(t);try{let j={"connection.json":JSON.parse(r(e["connection.json"])),"manifest.geojson":JSON.parse(r(e["manifest.geojson"])),"map.geojson":e["map.geojson"]?JSON.parse(r(e["map.geojson"])):void 0,"mapstack.geojson":e["mapstack.geojson"]?JSON.parse(r(e["mapstack.geojson"])):void 0,"node.geojson":JSON.parse(r(e["node.geojson"])),obstruction:{},space:{},entrance:{},facade:{},"tileset.json":e["tileset.json"]?JSON.parse(r(e["tileset.json"])):void 0};if(e.enterprise!=null&&(j.enterprise={},(n=e.enterprise)!=null&&n["locations.json"]&&(j.enterprise.locations=JSON.parse(r((i=e.enterprise)==null?void 0:i["locations.json"]))),(s=e.enterprise)!=null&&s["categories.json"]&&(j.enterprise.categories=JSON.parse(r((l=e.enterprise)==null?void 0:l["categories.json"]))),(c=e.enterprise)!=null&&c["venue.json"]&&(j.enterprise.venue=JSON.parse(r((p=e.enterprise)==null?void 0:p["venue.json"]))),(h=e.enterprise)!=null&&h["layers.json"]&&(j.enterprise.layers=JSON.parse(r((y=e.enterprise)==null?void 0:y["layers.json"]))),(b=e.enterprise)!=null&&b["locationInstances.json"]&&(j.enterprise.locationInstances=JSON.parse(r((_=e.enterprise)==null?void 0:_["locationInstances.json"]))),(C=e.enterprise)!=null&&C["enterpriseStyles.json"]&&(j.enterprise.enterpriseStyles=JSON.parse(r((P=e.enterprise)==null?void 0:P["enterpriseStyles.json"]))),(E=e.enterprise)!=null&&E["textures.json"]&&(j.enterprise.textures=JSON.parse(r((T=e.enterprise)==null?void 0:T["textures.json"]))),(O=e.enterprise)!=null&&O["floorText.json"]&&(j.enterprise.floorText=JSON.parse(r((D=e.enterprise)==null?void 0:D["floorText.json"]))),(A=e.enterprise)!=null&&A["categoryPriorities.json"]&&(j.enterprise.categoryPriorities=JSON.parse(r((R=e.enterprise)==null?void 0:R["categoryPriorities.json"])))),e["floorstack.json"]!=null?j["floorstack.json"]=JSON.parse(r(e["floorstack.json"])):e["mapstack.json"]!=null&&(j["mapstack.json"]=JSON.parse(r(e["mapstack.json"]))),j["floorstack.json"]==null&&j["mapstack.json"]==null&&j["mapstack.geojson"]==null)throw new Error("MVF is missing floorstack.json or mapstack.json/mapstack.geojson");if(e["floor.geojson"]&&(j["floor.geojson"]=JSON.parse(r(e["floor.geojson"]))),j["floor.geojson"]==null&&j["map.geojson"]==null)throw new Error("MVF is missing floor.geojson or map.geojson");if("styles.json"in e&&(j["styles.json"]=JSON.parse(r(e["styles.json"]))),"shapes.json"in e&&(j["shapes.json"]=JSON.parse(r(e["shapes.json"]))),"location.json"in e&&(j["location.json"]=JSON.parse(r(e["location.json"]))),"category.json"in e&&(j["category.json"]=JSON.parse(r(e["category.json"]))),e.annotation!=null){j.annotation={};let Y=Object.keys(e.annotation);for(let N of Y){let Z=N.replace(/\.json|\.geojson/g,"");j.annotation[Z]=JSON.parse(r(e.annotation[N]))}}let X=Object.keys(e.space);for(let Y of X){let N=Y.replace(/\.json|\.geojson/g,"");j.space[N]=JSON.parse(r(e.space[Y]))}if(e.obstruction!=null){let Y=Object.keys(e.obstruction);for(let N of Y){let Z=N.replace(/\.json|\.geojson/g,"");j.obstruction[Z]=JSON.parse(r(e.obstruction[N]))}}else j.obstruction={};if(e.entrance!=null){let Y=Object.keys(e.entrance);for(let N of Y){let Z=N.replace(/\.json|\.geojson/g,"");j.entrance[Z]=JSON.parse(r(e.entrance[N]))}}else j.entrance={};if("floorImages"in e&&e.floorImages!=null){j.floorImages={};for(let Y of Object.keys(e.floorImages)){let N=Y.replace(/\.json|\.geojson/g,"");j.floorImages[N]=JSON.parse(r(e.floorImages[Y]))}}if("textAreas"in e&&e.textAreas!=null){j.textAreas={};for(let Y of Object.keys(e.textAreas)){let N=Y.replace(/\.json|\.geojson/g,"");j.textAreas[N]=JSON.parse(r(e.textAreas[Y]))}}if("facade"in e&&e.facade!=null){j.facade={};for(let Y of Object.keys(e.facade)){let N=Y.replace(/\.json|\.geojson/g,"");j.facade[N]=JSON.parse(r(e.facade[Y]))}}if("area"in e&&e.area!=null){j.area={};for(let Y of Object.keys(e.area)){let N=Y.replace(/\.json|\.geojson/g,"");j.area[N]=JSON.parse(r(e.area[Y]))}}return j}catch(j){throw ce.error(j),new Error("MVF parsing failed! Probably encountered a bad file.")}}o(XP,"parseMVF");function h3e(e){if(e==null||typeof e!="object")return!1;let t=["connection.json","manifest.geojson","floor.geojson"in e?"floor.geojson":"map.geojson","node.geojson","floorstack.json"in e?"floorstack.json":"mapstack.json"in e?"mapstack.json":"mapstack.geojson"];"styles.json"in e&&t.push("styles.json"),"shapes.json"in e&&t.push("shapes.json");for(let r of t)if(e[r]==null||e[r][Symbol.toStringTag]!=="Uint8Array")return!1;return!0}o(h3e,"validateStaticMVFFiles");async function YP(e){return new Promise(async(t,r)=>{try{if(e==null||typeof e!="object")throw new Error("Error parsing data! Unzipping failed.");if(e[Symbol.toStringTag]!=="Uint8Array")throw new Error("Unexpected file type! Unzipping failed.");let i=(await import("./browser-CR4WWHP7.js")).unzipSync(e);if(!h3e(i))throw new Error("MVF is missing some expect static files. Unzipping failed.");let s={},l=Object.keys(i);for(let c of l){if(i[c].length===0)continue;let p=c.split("/");if(p.length<0)throw new Error("Encounted a file with no name! Unzipping failed.");if(p.length>2)throw new Error("Encountered unexpected nesting in MVF! Unzipping failed.");if(p.length===1){s[p[0]]=i[c];continue}if(p[0]==="image"){ce.warn("MVF unzipping encountered an image. Ignoring as this case has not been implemented.");continue}else s[p[0]]==null&&(s[p[0]]={}),s[p[0]][p[1]]=i[c]}t(s)}catch(n){r(n)}})}o(YP,"unzipMVF");function fh(){let e="us",t={};function r(){return v3e(x3e(e),t)}return o(r,"getState"),{updateByUserOption(n){var i,s;n.environment&&(e=n.environment),n.baseUri&&(t.baseUri=n.baseUri),n.baseAuthUri&&(t.baseAuthUri=n.baseAuthUri),(i=n.analytics)!=null&&i.baseUri&&(t.analyticsBaseUri=(s=n.analytics)==null?void 0:s.baseUri)},updateTileServerBaseUrl(n){t.tileServerUri=n},updateEnvironment(n){e=n},getBaseUri(n){return e==="us"&&n?Ate.baseUri:r().baseUri},getBaseAuthUri(n=!1){return e==="us"&&n?Ate.baseAuthUri:r().baseAuthUri},getAnalyticsBaseUri(){return r().analyticsBaseUri},getTileServerUri(){return r().tileServerUri},reset(){e="us",t={}},__getState:r}}o(fh,"createEnvControl");var Rte=Object.freeze({baseUri:"https://app.mappedin.com/",baseAuthUri:"https://app.mappedin.com/",analyticsBaseUri:"https://api-gateway.mappedin.com/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),Ate=Object.freeze(re(k({},Rte),{baseUri:"https://api-gateway.mappedin.com/",baseAuthUri:"https://auth.mappedin.com/"})),m3e=Object.freeze({baseUri:"https://api-gateway.eu.mappedin.com/",baseAuthUri:"https://auth.eu.mappedin.com/",analyticsBaseUri:"https://api-gateway.eu.mappedin.com/track-analytics/a/",tileServerUri:"https://tiles-cdn.eu.mappedin.com/styles/mappedin/style.json"}),g3e=Object.freeze({baseUri:"https://api-gateway-staging.mappedin.net/",baseAuthUri:"https://auth-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"}),y3e=Object.freeze({baseUri:"https://app-staging.mappedin.net/",baseAuthUri:"https://app-staging.mappedin.net/",analyticsBaseUri:"https://api-gateway-staging.mappedin.net/track-analytics/a/",tileServerUri:"https://tiles-cdn.mappedin.com/styles/mappedin/style.json"});function v3e(e,t){return k(k({},e),t)}o(v3e,"getAuthStateByEnvironment");var b3e={eu:m3e,us:Rte,"us-staging-enterprise":g3e,"us-staging-self-serve":y3e};function x3e(e){return b3e[e]}o(x3e,"getEnvironmentAuthState");var ZP=o(e=>{var r,n;let t=Object.values((n=(r=e["floorstack.json"])!=null?r:e["mapstack.json"])!=null?n:{});return t.length===1?[]:t.filter(i=>i.type!=="Outdoor").map(i=>i.id.replace("fs_","").replace("ms_",""))},"getBuildingIds"),Dte=o(async e=>{let t=performance.now(),r=await p9(e);return ce.log("Parsed MVFv3 in ".concat(performance.now()-t,"ms")),r.inspectErr(n=>{throw ce.error(n),new Error("MVFv3 parsing failed!")}),r.unwrap()},"unzipAndParseMVFv3ToMVFv2");async function KP(e,t="2.0.0"){switch(t){case"2.0.0":try{let r=await YP(e);return XP(r)}catch(r){return Dte(e)}case"3.0.0":return Dte(e);default:throw new Error("Unsupported MVF version: ".concat(t))}}o(KP,"unzipAndParseMVFv2");g();function y9(e){var i,s,l,c,p,h;let t=((s=(i=e.enterprise)==null?void 0:i.locations)==null?void 0:s.reduce((y,b)=>(y[b.id]=b,y),{}))||{};for(let y of((l=e.enterprise)==null?void 0:l.locationInstances)||[])t[y.id]=y;let r={};for(let y of e["floorstack.json"]||[])r[y.id]=y;let n={};for(let y of((c=e["floor.geojson"])==null?void 0:c.features)||[])y.properties&&y.properties.id&&(n[y.properties.id]=y.properties);return{type:"downloaded",data:e,optimized:{"enterprise-location":t,"enterprise-category":((h=(p=e.enterprise)==null?void 0:p.categories)==null?void 0:h.reduce((y,b)=>(y[b.id]=b,y),{}))||{},"floor-stack":r,floor:n}}}o(y9,"parseLocalePackToLanguagePack");function Bte(e){return/^https?:\/\/cdn\.mappedin\.com/.test(e)}o(Bte,"isMappedinCdnUrl");function $te(e){let t=e.split("?")[1];return!!(t!=null&&t.includes("sv="))}o($te,"hasSasToken");g();g();g();g();g();g();g();var v9=class v9{constructor({origin:t,destination:r,distance:n=0,angle:i=0,pathWeight:s=0,multiplicativeDistanceWeightScaling:l=!0}){x(this,"origin");x(this,"destination");x(this,"distance");x(this,"angle");x(this,"weight");if(this.origin=t,this.destination=r,this.distance=n,this.angle=i,this.weight=s||0,l?t.properties.floor===r.properties.floor&&(this.weight=(this.weight>=0?this.distance*this.weight:0)+this.distance):t.properties.map===r.properties.map&&(this.weight=this.weight>=0?this.distance+this.weight:0),isNaN(this.angle))throw new Error("Invalid angle: Expected a numeric value, but received NaN.")}};o(v9,"Edge");var Og=v9;g();g();g();g();function $f([e,t],[r,n]){let i=t-n,s=e-r;return(Math.atan2(s,i)+Math.PI*3)%(Math.PI*2)}o($f,"getAngle");g();var I3e=63710088e-1;function Ju(e,t){let[r,n]=e.map(y=>y*Math.PI/180),[i,s]=t.map(y=>y*Math.PI/180),l=s-n,c=i-r,p=Math.sin(l/2)*Math.sin(l/2)+Math.cos(n)*Math.cos(s)*Math.sin(c/2)*Math.sin(c/2),h=2*Math.atan2(Math.sqrt(p),Math.sqrt(1-p));return I3e*h}o(Ju,"getDistance");g();g();function JP(e,t,r,n){let[i,s]=e,[l,c]=t,[p,h]=r,[y,b]=n;if(s===c&&i===l||h===b&&p===y)return null;let _=(y-p)*(c-s)-(b-h)*(l-i);if(_===0)return null;let C=((b-h)*(i-p)-(y-p)*(s-h))/_,P=((c-s)*(i-p)-(l-i)*(s-h))/_;if(C<0||C>1||P<0||P>1)return null;let E=s+C*(c-s);return[i+C*(l-i),E]}o(JP,"getLineIntersection");g();function b9(e,t,r,n){let i=sl(e,r/1e3,n),s=sl(t,r/1e3,n);return[i.geometry.coordinates,s.geometry.coordinates]}o(b9,"getOffsetLine");g();function x9(e){let t=e*(180/Math.PI);return t=t%360,t>180?t-=360:t<-180&&(t+=360),Object.is(t,-0)?0:t}o(x9,"radToDegNormalized");var jte=111e3;function Gte(e,t,r=[],n=0){let i=!0,s=e.geometry.coordinates,l=t.geometry.coordinates,c=x9($f(s,l)-Math.PI/2),p=x9($f(s,l)+Math.PI/2),h=n/jte,y=n/(jte*Math.cos(s[1]*Math.PI/180)),b=Math.min(s[1],l[1])-h,_=Math.max(s[1],l[1])+h,C=Math.min(s[0],l[0])-y,P=Math.max(s[0],l[0])+y;for(let E of r)if(!(Math.max(E[0][1],E[1][1])<b||Math.min(E[0][1],E[1][1])>_||Math.max(E[0][0],E[1][0])<C||Math.min(E[0][0],E[1][0])>P)){if(n>0){let T=b9(s,l,n,c),O=b9(s,l,n,p);if(JP(T[0],T[1],E[0],E[1])||JP(O[0],O[1],E[0],E[1])){i=!1;return}}else if(JP(s,l,E[0],E[1])){i=!1;return}}return i}o(Gte,"hasLineOfSight");var Lg,xs,I9,Ute,Vte,zte,qte,Hte,Wte,e3,_9=class _9{constructor({nodes:t,groupBy:r,multiplicativeDistanceWeightScaling:n}){G(this,xs);x(this,"edges",{});x(this,"nodesById");x(this,"nodesByGroup",new Map);G(this,Lg);G(this,e3,o((t,r)=>{let n=0;for(let i of r)(!i[d(this,Lg)]||i[d(this,Lg)]===t.properties[d(this,Lg)])&&ci(t.geometry.coordinates,i.geometry.geometry)&&(n+=Math.max(0,i.cost));return n},"#getZonalCost"));q(this,Lg,r);let{features:i}=t;this.nodesById=ke(this,xs,Ute).call(this,i),ke(this,xs,Vte).call(this),ke(this,xs,zte).call(this,i,r,{multiplicativeDistanceWeightScaling:n})}getShortestEuclideanDistance(t,r){return r.reduce((n,i)=>{let s=Ju(t.geometry.coordinates,i.geometry.coordinates);return Math.min(n,s)},Number.MAX_VALUE)}aStar({originIds:t,destinationNodeIds:r,excludedNodeIds:n,disabledConnectionNodeIds:i,zones:s,overrideEdgeWeights:l}){var _;let c=ke(this,xs,I9).call(this,t),p=ke(this,xs,I9).call(this,r);if(c.length===0||p.length===0)return[];let{frontier:h,cameFrom:y,costSoFar:b}=ke(this,xs,qte).call(this,c,p);for(;h.length>0;){let C=h.shift();if(!C)break;if(ke(this,xs,Hte).call(this,C.origin,p))return ke(this,xs,Wte).call(this,y,C.origin.properties.id);for(let P of this.edges[C.origin.properties.id]){let E=(_=l==null?void 0:l.get(P))!=null?_:P.weight;if(i!=null&&i.has(P.origin.properties.id)&&P.destination.properties.map!==P.origin.properties.map)continue;let T=b[C.origin.properties.id]+E+d(this,e3).call(this,P.destination,s);if(!(T===1/0||n!=null&&n.has(P.destination.properties.id))&&(b[P.destination.properties.id]==null||T<b[P.destination.properties.id])){let O=T+this.getShortestEuclideanDistance(P.destination,p);b[P.destination.properties.id]=T,y[P.destination.properties.id]=P,h.push({origin:P.destination,priority:O})}}h.sort((P,E)=>P.priority-E.priority)}return[]}};Lg=new WeakMap,xs=new WeakSet,I9=o(function(t){return t.map(r=>this.nodesById[r]).filter(Boolean)},"#filterValidNodes"),Ute=o(function(t){return t.reduce((r,n)=>(r[n.properties.id]=n,r),{})},"#createNodesById"),Vte=o(function(){for(let t in this.nodesById)this.nodesById.hasOwnProperty(t)&&(this.nodesById[t].properties.neighbors=this.nodesById[t].properties.neighbors.filter(({id:r})=>!!this.nodesById[r]))},"#removeInvalidNeighbors"),zte=o(function(t,r,n){t.forEach(i=>{let s=r==="default"?r:i.properties[r];this.nodesByGroup.has(s)||this.nodesByGroup.set(s,[]),this.nodesByGroup.get(s).push(i),this.edges[i.properties.id]=i.properties.neighbors.map(({id:l,weight:c})=>{let p=this.nodesById[l],h=Ju(i.geometry.coordinates,p.geometry.coordinates),y=$f(i.geometry.coordinates,p.geometry.coordinates);return new Og({origin:i,destination:p,pathWeight:c,distance:h,angle:y,multiplicativeDistanceWeightScaling:n==null?void 0:n.multiplicativeDistanceWeightScaling})})})},"#initializeEdgesAndGroups"),qte=o(function(t,r){let n=[],i={},s={};return t.forEach(l=>{let c=this.getShortestEuclideanDistance(l,r);n.push({origin:l,priority:c}),i[l.properties.id]=null,s[l.properties.id]=0}),n.sort((l,c)=>l.priority-c.priority),{frontier:n,cameFrom:i,costSoFar:s}},"#initializeSearch"),Hte=o(function(t,r){return r.some(n=>n.properties.id===t.properties.id)},"#isDestinationNode"),Wte=o(function(t,r){let n=[],i=t[r];for(;i;)n.push(i),i=t[i.origin.properties.id];return n.reverse()},"#reconstructPath"),e3=new WeakMap,o(_9,"NavigationGraph");var QP=_9;var _3e=.4,S9=class S9{constructor({nodes:t,geojsonCollection:r,groupBy:n="default",multiplicativeDistanceWeightScaling:i}){x(this,"groupBy");x(this,"graph");x(this,"geometryEdgesByMapId",new Map);x(this,"generatePath",o(t=>{let{destination:r}=t[t.length-1],n={type:"FeatureCollection",features:[]};for(let s=0;s<t.length;s++){let{origin:l,destination:c}=t[s],p={id:l.properties.id,angle:t[s].angle,distance:t[s].distance,destination:c.properties.id,edges:this.graph.edges[l.properties.id]};this.groupBy!=="default"&&(p.groupBy=l.properties[this.groupBy]),n.features.push({type:"Feature",geometry:{type:"Point",coordinates:[l.geometry.coordinates[0],l.geometry.coordinates[1]]},properties:p})}let i={id:r.properties.id,edges:this.graph.edges[r.properties.id]};return this.groupBy!=="default"&&(i.groupBy=r.properties[this.groupBy]),n.features.push({type:"Feature",geometry:{type:"Point",coordinates:[r.geometry.coordinates[0],r.geometry.coordinates[1]]},properties:i}),n},"generatePath"));x(this,"getDistance",o((t,r)=>Ju(t,r),"getDistance"));x(this,"getAngle",o((t,r)=>$f(t,r),"getAngle"));this.groupBy=n,this.graph=new QP({nodes:t,groupBy:this.groupBy,multiplicativeDistanceWeightScaling:i}),((r==null?void 0:r.features)||[]).forEach(l=>{let c=null;if(l.geometry.type==="LineString"?c=l.geometry.coordinates:l.geometry.type==="Polygon"&&(c=l.geometry.coordinates.flat()),c){let p=this.groupBy==="default"?this.groupBy:l.properties[this.groupBy];this.geometryEdgesByMapId.has(p)||this.geometryEdgesByMapId.set(p,[]),c.forEach((h,y)=>{this.geometryEdgesByMapId.get(p).push([h,c[y+1]||c[0]])})}})}getDirections({zones:t,originIds:r,destinationNodeIds:n,excludedNodeIds:i,disabledConnectionNodeIds:s,simplify:l,multiplicativeDistanceWeightScaling:c,overrideEdgeWeights:p}){var _,C;let h=(_=l==null?void 0:l.enabled)!=null?_:!0,y=t!=null?t:[],b=this.graph.aStar({originIds:r,destinationNodeIds:n,zones:y,excludedNodeIds:new Set(i),disabledConnectionNodeIds:new Set(s),overrideEdgeWeights:p});return b.length===0?{type:"FeatureCollection",features:[]}:(h&&(b=this.simplifyAllSteps(b,(C=l==null?void 0:l.bufferRadius)!=null?C:_3e,c)),this.generatePath(b))}simplifyAllSteps(t,r,n){var h,y;let i=[],s=[t[0]];for(let b=1;b<t.length;b++)if(this.groupBy!=="default"&&t[b].origin.properties[this.groupBy]!==t[b-1].origin.properties[this.groupBy]){let _=t[b-1].origin.properties[this.groupBy],C=(h=this.geometryEdgesByMapId.get(_))!=null?h:[];i.push(...this.simplifySteps(s,C,r,n)),s=[t[b]]}else s.push(t[b]);let l=t[t.length-1],c=this.groupBy==="default"?this.groupBy:l.origin.properties[this.groupBy],p=(y=this.geometryEdgesByMapId.get(c))!=null?y:[];return i.push(...this.simplifySteps(s,p,r,n)),i}simplifySteps(t,r,n,i){if(t.length<3)return t;let s=[t[0]],l=1;for(let c=l+2;c<t.length;c++)if(t[l].origin.properties.preventSmoothing||!Gte(t[l].origin,t[c].origin,r,n)){let p=c-1;s.push(new Og(re(k({},t[l]),{destination:t[p].origin,distance:Ju(t[l].origin.geometry.coordinates,t[p].origin.geometry.coordinates),angle:$f(t[l].origin.geometry.coordinates,t[p].origin.geometry.coordinates)}))),l=p}return s.push(new Og(re(k({},t[l]),{destination:t[t.length-1].origin,distance:Ju(t[l].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),angle:$f(t[l].origin.geometry.coordinates,t[t.length-1].origin.geometry.coordinates),multiplicativeDistanceWeightScaling:i})),t[t.length-1]),s}};o(S9,"Navigator");var X1=S9;g();var g9e={};Cc(g9e,{Annotation:()=>cf,Area:()=>rf,Connection:()=>Vd,Coordinate:()=>Ct,DOORS:()=>Z2,Door:()=>Au,E_SDK_LOG_LEVEL:()=>dN,EnterpriseCategory:()=>gx,EnterpriseLocation:()=>Uc,EnterpriseVenue:()=>TC,Facade:()=>Fl,Floor:()=>ua,FloorStack:()=>Db,Hyperlink:()=>Dd,ImageMetaData:()=>Nd,LocationCategory:()=>yx,LocationProfile:()=>Wm,MAPPEDIN_COLORS:()=>aG,MapObject:()=>Oa,Node:()=>Qp,PointOfInterest:()=>uf,Space:()=>wo,WALLS:()=>Y2,__setWatermarkOnClickFn:()=>c9e,createMapLibreOverlay:()=>h9e,disableText3DWorker:()=>Zoe,enableTestMode:()=>M9,getMapData:()=>vse,getMapDataEnterprise:()=>d9e,hydrateMapData:()=>lse,hydrateMapDataFromMVF:()=>p9e,parseMVF:()=>XP,preloadFont:()=>q7,setLoggerLevel:()=>hN,setUseEnterpriseAPI:()=>f9e,setWorkersUrl:()=>rse,show3dMap:()=>bse,show3dMapGeojson:()=>m9e,unzipMVF:()=>YP});g();g();g();g();var AI,DI,FI,C9=class C9{constructor(t,r,{enabled:n=!1}={}){G(this,AI);x(this,"searchInstance");G(this,DI);G(this,FI);x(this,"enabled",!1);q(this,AI,t),q(this,DI,r),q(this,FI,()=>{var i;(i=this.searchInstance)==null||i.then(s=>s.populate())}),n&&this.enable()}async query(t,r={}){if(this.enabled||await this.enable(),!this.searchInstance)return ce.error("Search should be enabled by now"),{places:[],enterpriseLocations:[],enterpriseCategories:[]};try{return await(await this.searchInstance).search(t,r)}catch(n){return ce.error("Search.query failed due to",n),{places:[],enterpriseLocations:[],enterpriseCategories:[]}}}async suggest(t,r={}){if(this.enabled||await this.enable(),!this.searchInstance)return ce.error("Search should be enabled by now"),[];try{return await(await this.searchInstance).suggest(t,r)}catch(n){return ce.error("Search.suggest failed due to",n),[]}}async enable(){this.enabled||(this.enabled=!0,this.searchInstance||(this.searchInstance=import("./internal-ZUMRQSCJ.js").then(({InternalSearch:t})=>new t(d(this,AI)))),d(this,DI).on("language-change",d(this,FI)),await this.searchInstance)}};AI=new WeakMap,DI=new WeakMap,FI=new WeakMap,o(C9,"Search");var LI=C9;var Xte=new WeakMap,Vi,P9=class P9 extends Lt{constructor(r,{search:n}={}){super();G(this,Vi);x(this,"Analytics");x(this,"Search");x(this,"Query");x(this,"getDirections",o((r,n,i)=>d(this,Vi).getDirections(r,n,i),"getDirections"));x(this,"getDirectionsMultiDestination",o((r,n,i)=>d(this,Vi).getDirectionsMultiDestination(r,n,i),"getDirectionsMultiDestination"));q(this,Vi,r),Xte.set(this,r),this.Analytics=new vx(r.Analytics),this.Query=r.Query,this.Search=new LI(this,r,{enabled:n==null?void 0:n.enabled}),d(this,Vi).on("language-change",i=>{this.publish("language-change",i)})}getEnv(){return d(this,Vi).getEnv()}getAccessToken(){var r;return(r=d(this,Vi).tokenManager)==null?void 0:r.getAccessToken().token}get mapName(){return d(this,Vi).mapName}get mapCenter(){return d(this,Vi).mapCenter}get organizationId(){return d(this,Vi).organizationId}get outdoorViewToken(){return d(this,Vi).outdoorViewToken}getByType(r){return d(this,Vi).getByType(r)}getById(r,n){return d(this,Vi).getById(r,n)}getByExternalId(r,n){return d(this,Vi).getByExternalId(r,n)}getGeoJSON(r){return r.geoJSON}async changeLanguage(r){return d(this,Vi).changeLanguage(r)}get currentLanguage(){return d(this,Vi).currentLanguage}get naturalBearing(){var r;return(r=d(this,Vi).naturalBearing)!=null?r:0}getDistance(r,n){return d(this,Vi).getDistance(r,n)}toBinaryBundle({downloadLanguagePacks:r=!0}={}){return d(this,Vi).toBinaryBundle({downloadLanguagePacks:r})}toJSONBundle({downloadLanguagePacks:r=!0}={}){return d(this,Vi).toJSONBundle({downloadLanguagePacks:r})}};Vi=new WeakMap,o(P9,"MapData");var w9=P9,NI=w9;function kI(e){let t=Xte.get(e);if(!t)throw new Error("MapDataInternal not found");return t}o(kI,"getMapDataInternal");g();g();g();g();var S3e=1e-7;function T9(e){return{type:"Point",coordinates:e}}o(T9,"point");function C3e(e,t){let{coordinates:r}=t.geometry,{coordinates:n}=e.geometry,i=r.map(s=>sf(e,T9(s)));return n.reduce((s,l)=>{let c=BS(T9(l),i[0],e),p=BS(T9(l),i[1],e),h=wm(c)<wm(p)?c:p;return h.properties=re(k({},e.properties),{entrances:[]}),s.concat([h])},[])}o(C3e,"splitObstructionByEntrance");function E9(e,t){return t.reduce((r,n)=>{let i={epsilon:S3e},s=r.obstructions.findIndex(c=>x0(Nc(n),c,i)),l=r.obstructions[s];if(l){let[c,p]=C3e(l,n);r.entrances.push(n),r.obstructions.splice(s,1,c,p)}return r},{obstructions:[e],entrances:[]})}o(E9,"findAndSplitObstructionByAllEntrances");g();g();g();g();(function(){typeof globalThis!="object"&&(Object.defineProperty(Object.prototype,"__magic__",{get:o(function(){return this},"get"),configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)})();var Yte="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAkGBwgHBgkICAgKCgkLDhcPDg0NDhwUFREXIh4jIyEeICAlKjUtJScyKCAgLj8vMjc5PDw8JC1CRkE6RjU7PDn/2wBDAQoKCg4MDhsPDxs5JiAmOTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTk5OTn/wgARCAIABAADAREAAhEBAxEB/8QAGwABAAMBAQEBAAAAAAAAAAAAAAECAwQFBgf/xAAWAQEBAQAAAAAAAAAAAAAAAAAAAQL/2gAMAwEAAhADEAAAAP3EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAIAAAJAFAAAAAAAAAAAAAAAAAAAAAAAAABAgAAEgCgAAAAAAAAAAAAAAAAAAAABERLSM1zM4zXMzjMoUIqCCSSS8XNC9mpoaVomharWTQAAAAAAAAAAAAAAAAEREtIoZrnGZkucUKFStQQSTFixdNDStF0TWrmiWqbJoAAAAAAAAAAAAAIgiWkZy4HNLzHLXKcxzpzmFYmRkUKFSCCSSxcuampsbR0HSdK9R1R1HTZvWll0mlAAAAAAAAAAAIiKLnLjHNLynLXKcycxzmNYmJmUKFSCAWLFy5qamxvHQvSdJ0nVHUdFm1aparWKAjNWSKAAAAARBEtYzlyXnjmOSuM4U4q4jjOM5a5k5zAyMjOqFCCCCSSS5c0jU1NzoOk6pew7TtjuO1e0646jezWr2WSaUAAAAAECIqtZco55eY464zhTirhOI5Dks5jAwMTIzqhUqQASWLFzSNTY3Og6V646zsO2O47V7DrjqNzWy9nlZ1c0LlrLEk0EQQVipRczIyMU5q5F4U8+vOPOrgThOOuU5jAxMjMzKpUggigJiSSxY0XQ1Njc6TqjtO49CX0D0T0Y7l7E6JdzU1NEvViSalBAWIqVKLSMjIxOauM4U86vPPOrz04TjrkOYwMTIzKJQqQQCKmBJJYutzQ1Njc6TrOyO475fRPRPQjuXsToXWPn6kkkEkhCkEAgggqVMjlrzzzDy7PMPPrhOQ5jBMqoVIIIAAIAJAAJJJLFzWN16TsO49CPTPUl9Q9A6o1LFiSSSSQpCwQQCCCpVMjlrzzyzy7PMPPrhOM5kwM6zKlQQAAQASAASCxY0NI3XpOw7j0I9M9SX0z0DqjU+UqpQqVIBFgEyixJYuWLFDkrzE8o8yvOONOasipBAAAAAAAAAAABJJY2OiO1fQPUj1T0pewuVKlCCqQsBIUSSSSWLlyTM5K808pPLrzziTnrEqQQAAAAAAAAAAASSWNjojtX0D1I9VfSOuND4uzMzqhQqVIALEli5c1jUuQc1vnp5pwJzVmQQAAAAAAAAAAAAAASSaHTHevpHoHTFjMyM6zKlSpABJJcsaGkamhU5q88804E5qzIIAAAAAAAAAAAAAAJJNDpjvX0j0Dqix8dVDMolSpAqCYElixc0XU0IMjlTlrIqAAAAAAAAAAAAAAAAAWNTqjqXYGZkZpUoQQRSFIsSXLroaGhBkcqctZFQAAAAAAAAAAAAAAAACxqdUdS7EngWQCAAQASACSSSwKlSCAAAAAAAAAAAAAAAAAACSSxYFSCCAACCQACSSSwKlSCAAAAAAAAAAAAAAAAAACSSxYGIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAJAJAJBAAIAIABAAAAAAAAAAAAAAAAAAAABIAJAJAJBAAIAIABAAAAJABAAAAAAAAAJBILEli5Y0LlzQ0Lly5csWLAkgFSChUoUMyhmUMyhQqVKkEEAEAAAAAAAAAkEgsSWLljQuXNDQuXLlyxYsCSAVIKFShQzKGZQzKFCpUqQe+ZmZkUKFCpUEEAAkksWLFzQ0NTU2NzY3Og3NzoNzc2NjU1NS5csSAQVKmZmZGRiYmBgYHOYGBgYGBiZGRkUMypUqQCAASSWLFi5oaGpqbG5sbnQbm50G5ubGxqampcuWJAIIKGZmZGRiYmBgYHOYGBgYGR+jmBzmBzmJiZGZQoQQSSWLmhqbGxudB0nSdJ1HSdR1HSdJ0G5qamhcsWJJJBIIIBUqVKFDIyMDA5jmOU5TlOY5TmOc5znMTEyMyhQggFixc0NTY2NzoOk6TpOo6TqOo6TpOg3NTU0LlixJJIJBAIKkFChQyMjAwOY5jlOU5jnP00yMTnOc5zAwMjMoVIJJLmhqbmx0HQdBubmxqXLkkgAAAAAAAAAAAAAEEFTMzMTEwOc5znMDAyMyhUgkkuaGpsbnQdB0G5ubGpcuSSAAAAAAAAAAAAAAQQVKGZ1gAEEEEFSCACSSxJJJIAAAAAAAAAAAAAAAAAAAAAAABBBBBUggAkkksSSSAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQCCpBUqQVIKggAkFiSSxYksSSSSAAAAAAAAAAAAAAAAAAQCCpBUqQVIKggAkFiSSxYksSWBIAAKFiQAAAAAAAAACCpUoUMzIyMzMzMyhQoVKkEEAgkEkklixYuXNDQ0NTQ1NC5cuWJAAAAAAAAAAIKlShQzMjIzMzMzKFChUqQQQCCQSSSWLFyxoXNDQ1NDU0LljUkkAAAAAAAAAAggggEEAgAAAAAAAAAAAAAEkgkkkkkAAAAAAAAAAgggggEAgAAAAAEgEAAAAAAEkgkkuAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADyyCCCCCCCCAQASCSQWJJJJLEkkkkkgkkEgkAEgAAEAAgEAggEEEEEEEFSCCCCCCAQASCSQWJJJJLEkkkkkgkkEgEgEgAAEAAgEAggEEEEEH5AQQQQVBBAIAAJBIJJJLEkkkkliSSSSSQSSCQSAAAQAQQCCCCCCCCCpBBBBBUEEEAgAAkEgkkksSSSSSWJJJJJJBJIJBIAABABBAIIIIIIIIKg/LCAQCACAAAACQCQSCQSASSASCQCQAAAAAAQCAQAQCAQAQQCACAAAACQCQSCQSASSASCQCQAAAAAAQCAQAQCAQfPgAAAAAAAAAAAAAAkAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAgAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/xAApEAAABQUBAQACAwACAwAAAAABAgQFFQMGERQWEhNAUAAgMGCAkKCw/9oACAEBAAECAP8AwTZznOf3mc5/YZE41xVivFyM6i7C8C8C8zMzMzMyDyDyDyDwV4K7ldSuZV5VgVwqZ/SCca4qxXmcjOouwvAvEzMzMzMzMyDyDyDwV4K7ldSuRVwKgrgf88TDWMrO4VHOo61Hao7ndzvB3k7yZ5M8i8i8zMzMzMyDyDyDyV5K8keSPJHmm8U3em70nam603Mi8qotUDfk5GqZUdfUc6jrUdqjvUeDvB3kzyZ5M8i8i8zMzMzMzMg8g8leSvJHkjyR5pvFN4pu9N2pOtNzIvKqLWA39PX+/saplJlh1tRfVcKrlVdKrrVdqrvVdzu53Y7sZ2M6mdRdRdBdJSUk5SUB0B0B1K6kdSOxHam7Unek70nei7UXWi6UXKk40l9NaRWWuB8/75E41zKjraq+q41nOq6VXas7VXeq71Hc7ud2O7GdRdRdZQXSUlJSUlAdCugOpXUjqR2I7U3em70nek70nai60XSk5UnGkvItIrKoCsC0FwLgXAuBbube3ubm7uiuFcZcZaZYdZUWVl1dwruVdzrulZ0qulVzqOR3EzgZeZcZcK0Vm3t7W1tbW1tgrBYC0q0q4q8jgRxpuVJzoulB0oOlBzoOVBworqa0iwi0i0q4FwLQWAr2trZ2trb3RWiuFcZaZadbUW1l1ZwruVd0rulZ0qulVzqOR3E7gZeZeK4VorNzb29ra2tsFe2CwFpVxVxV5HAjjTcqTnRdKDpQdKDnQcqDhRXU1pFhVm/ISUnKSkrLSsrKyspJyUhvitOtrLq69Q4qHGu41nGqvqLjrDKhUDW+nv1nP+Oc+vYVArFUEVEWUl1FfQcU7imckzinX0VxFoLgXyMlJykrLS0tLS0rKSclI74rjraq6uvUuKhxruNdxqr6i46wysVA1vp79Zz/AI5z6A4VArFUEVkWUl1FfQcU7imcUzinX0VxFoLZKTlJWVlpaXl5eWlpWUB0BzBxkDr669SvUr666stqqz1xqes/j5AxahFFJXRWp1yZemX0F5HCQkpOUlZaWlpeXl5aWB2lQdAcwcZE7hWcFLgpXqF1ZbVVnUDU9Z/HyBi1CV6SuitTrky9MvoLyL5AXEXEXIXIXKSkpKSkpIHIHIHIrkVxK4yJnCsvrra6uqpPVE354GJVpKaCtOtoryuEiZxM5C5C5C5SUnJSclJSQOQORXIrkVxBxM4VV9dbXV1VJ6om/PAxKtFTQVp1tFeRwkRWitFYKvb2tra2draBUCsFgLCrSrQWitOsqqT1RN+jAxKtJTTWFWitMtMtFYKzb29ra2tnaBUCsFZVhVpVoLRWnWVFJ6om/RgYlWkpprAW73v36zn++c+gOFQKv1GoJv04GCp9Rq/T36zn++c+gOFT7fUagm/TgYKn1+3/AKEeMefHjx8/n8vl8vn8/Hjx5xj9bjHnx48fP5/L5fL5/Px48ecY/wAvOPxceQIFIKIJgSAiBAVuK2FaitINAM4MwMwMsJCQkJCQkJCwosws4tAtItQtgtot4oRSCm+Hy8ecfi48gQKQUQTAkBECArcVsK1FaQaAZwZgZgZYSEhISEhISFhRZhZxaBaRahbBbRbxQikFN8BpfMWgWozWLaLcKAUWpq62vr/DX19YEoJARAhBvK2laytRGgjORlIyEYiMJLfJbxLdJbhLbJbRLaJbJbZLbAWxzHMcxzHMcxzHMDbBrYNbJraNbRrbPbh7dPbx7fOwHYjsZ2UzMZoM0maxbRbhQCi1NXW19fX19fW1QSAiBCDeVtK1laiNBGYjKRkIxEYSW+S3iW6S3CW2S2iW0S2S2yW2AtgLY5jmOY5jmOY5gbYNbJrZNbRraPbZ7cPbp7ePb52A7EdjOymZjW4e3D26e3j2+ZgMwmYhYxY4SEhISEBjKxlYiMJGAjAS3iW9TtynblO26dtUrap2zTtmnbNO2SW2S3isRWYGkG0EAItTW1/h8Phr6+rp6AtwtQs5mI9vntw9tHtk9s1LZqWzUto9tnts9uHt09vHt8zAZhMxCxixwkJCQkIDGVjKxEYSMBGAlvEt6nblO3Kdt0rap21TtmnbNO2SWyS2yW8ViKzA1A2ggBFqa2v8Ph8NfW1dPRFuFqMzGYjW+e3D20e2T2zUtk9tHto1tCzHYj2+e3T24e3D24a3DW4Nuc5znOc4FuBbhbcLbhLcJblO3CW4S3iMRGcrYVECcKYB+cJBoCjM2maDsZ7fPbp7cPbh7cNbhrcG3Oc5znOcC3C24W3C24S3CW5TtwluEt4jERnK2FRAnCmAfnCQaAoxb/7ePl8NbU09PT1NYKHy8Y/ZePl8NbU09PT1NYKHy8Y/4Z6+g1tjb3d+Rk5SVlZWVlZSTkd8Fu3s/b6es/pvX0Gtsbe7vyMnKSkrKysrKSciC8Fu3s/YKnrP9gqAb8X0NQawqBVCrMrMqMoGuNUTiYf4ICT5/L4/H4fD4fH4hSCmBAAP4AgctUtYqgqoqsqsqoFIVwqAb8X0NQawqBVCrMrMqMoGuNUTiYf4ICT5/L4/H4fD4fH4hSCmBAAP4AgctUtYqgqkqsqsqsFIV/Hn8XHj5/H4a+traurq6mpqampqampqampqampqampqampqamrq62tr/D4/Lx5/Fx4+fx+Gvra2rq6upqampqampqamrq6upqampqampqamrq6utra/w+Py/wCgEzNTc5OTs7PT09PT8/Pz09PT07Ozk3Ng9TMxLy0rKSclJSMhIb+9vbu9u7u7u7u7u729vb2/vyEjJSUnKSstLzEzNTc5OTs7Oz09PT8/Pz09PT07Ozk5NzUzMS8tKyknJSUjISG/v727vbu7u7u7u7u9u729v78hIyUlJykrLS8x0nR9H0fR9H0XRdF0XRdD0PQ9F0XRdF0XRdF0fR9H0nSdJ0vS9L0vTdN03TdP0/T9P0/T9P0/T9P0/T9R0/T9P0/T9P0/TdN03S9L0vS9J0nSdJ0fR9H0XRdF0PRdD0PQ9D0PRdF0XRdF0XR9H0fSdJ0nS9L0vS9N03TdN0/T9P0/T9P0/T9P0/T9P1HT9P0/T9P0/T9N03TdL0vS9L0vSS8tLy0tLS0rKysrKysrKysrKystLS0vLS8vLy8vMTExMTExMzMzMTMzMzM1NTUzMzMzMzMzMzExMTExMS8vLy8vLy8tKy0tKysrKysrKysrKysrLS0tLy0vLy8vLzExMTExMTMzMzEzMzMzNTU1MzMzMzMzMzMxMTExMTEvLy8vnOc5znOc5znOc5znOc5znOc59ZznPr169evXr169evXr169evXr16znOfWc5znOc5znOc5znOc5znOc5znOc59ZznPr169evXr169evXr169evXr16znOfWc5z/9YD//xAArEAEAAgIDAQABBAICAQUAAAAAAVICYgNRYQRBEEBQUzFCIDARYICQoLD/2gAIAQEAAz8A/wDgmhCEI/nYQj+RhjH5ccflxw44YMe0dtmzZs2bNmzZs2bIsjtiwlxy45/Ljn8se0fwuPbjj8uOPy44YQxR2izZs2bNmzZs2bNkWR2xYS45cc/lhP5Y9/wEQwj8sIRD1s2bNmzZs2bNmzZs2bNmzZs2bNmzZs2bNmyLMZYZMZ/KJ/dRDCPywhjCI/LZs2bNmzZs2bNmzZs2bNmzZs2bNmzZs2bNkWYywlhP5RP/ABj9hDGGMIh69bNmzZs2bNmzZsmybJsmybJsmybJsmybJsmybJs2bNmzZs2bNmzZ7+mMsZYyj9hDGGMIj9NmzZs2bNmzZs2bJsmybJsmybJs2TZNk2TZNk2bJs2bNmzZs2bNmzZ6iWMsXr16hiwYMGDBgwYo/T169/T162bNmzZs2TZNk2T2ntPae09pSlKUpSlPae09p7T2mybJsmzZs2bNmz17+nr16hiwYOPtx9uPtx9sO2DBih69evXr1s2bNmzZsmybJsmye09p7T2lKUpSlKU9p7T2ntNk2TZNmzZs2bNmz17+vr1s2bNmzZs2bNmzZs2evXr169bNmye09p7SlKUp/wC6UpSlKe09p7etmzZs9evWzZs2bNmzZs2bNmzZs2bPXr1s9bNmye09p7SlKUp/7pSlKUp7T29bPWz169evWzZs2bNmzZs2bNmzZs2bNmzZs2evU9plM/vJhMJ7T29bNnrZ62bNmzZs2bNmzZs2bNmzZs2bNnr39J7TKZ/eTCYT3+nr162bNnrZs2bJsntNk2TZPabNmzZs2etnr39JlM/wUwmP09etmzZs2bNk2TZNk2TZNk2bNmzZs2bNnv6TKZ/gphMfp69etk9p7T2ntKUpSlKUp7T2nt69e/pMpn+GmH/j9PXr1Pae09pSySlklKU9p7T29evf0mUz/DTCY/T16lP/AHSlKU/xUpSlP/dKUpT/ABUpT/8AQllKWTJl0y6ZdMumXTLpl0y6ZJSn+QlKWTJl0y6ZdMumXTLpl0y6ZJSn/sn9xKWXTLpn0z6Z9M+mXTLplVlVlVlVlVlVlVlVlVlVlRlVlVlRlVlVlVlVlVlVlVl0z6Z9M4/DPpn0z6ZdMkp/byll0y6Z9M+mfTPpn0y6ZVZVZVZVZVZVZVZVZUZVZUZVZVZVZVZVZVZVZVZVZVZdM+mfTOPwz6Z9M+mTJlVlVlVl0yZ9M2fTPpn0z6Z9M+mbPpn0z6Z9M2fTPpl0yqyqyqyqyqyomiaJomiaJomiaJomjRo0aNGjRo0aNGjRNE0TRNE0TRNE0TRNE0ZVZVZVZVZVZVZM+mbPpn0z6Z9M+mfTNn0z6Z9M+mfTPpl0y6ZVZVZVTVlVlRNE0TRlRNE0TRNE0TRo0aNGjRo0aNGjRomiaJomiaJomiaJomqaJqyq0TRNE0TRNE0TVNE1TVNU1TRNE1TVNU0TRNE0TRNGjRo0aNGjRhWHFHTgh88Pmj8Pnj/V89HBRwf1w4f64cNMXFSHFTFxUxcVIcP9cOGkOCkPno+ej55/D55cEuKemHUIo0aNGjRo0TRNE0TRNE0TVNE0TVNE1TVNE1TRNU0TRNE0TRNGjRo0aNGjRhWHFHThh88Pnj8Pnq+ejgo4P64cP9cOKkOKkOKmLipi4aYuH+uHBSHBSHz0fPR88/h88uCXFNWHUIo0aNGjRo4ZcU9MOoRRFGjRo0aNGjRo0aNGjRo0RRhVxR04IcGP4cGP+jij/GEMI/xjCP3+M/5xhxT/AJwhwT/o4Mv9XBk4p6YdQiiKNGjRo0aNGjRo0aNGjRoijGsOKOnBi4Mfw4I/0cUf4whhH+MYR+/xn/OMOKf84Q4J/wBHBP8Ar/zxrDCsOKkOKjhq4auGrhq4auGjipDjpDGsI/k8awwrDipDio4aOGrhq4auGrho4qQ46QxrCP8A0bHcMLQ47w4rw4buCzgs4O3A4HA4XA4HA4HA4O3BZwWcN3Fdx3hhaGNoR/Dx3DC0OO8OK8OG7gs4LODtwOBwOFwOBwOBwODtwWcFnDdxXcd4YWhjaEf88UftoQh4y6ZuRyuVzOZzeudz+uf1z+uf1z+uf1z+uf1zuf1z+uf1z+uf1z+udzR25nM5o7c3rlcrlZsniOkSj9tCEPGXTNyuVy+uZzOb1z+uf1z+uf1z+uf1z+uf1z+udz+uf1z+uf1z+uf1z+ueO3O5nM5vXK5XKzZPEdMUftoYsemHTDpx9OPpxVcVXDVw1cNXDVw0cNHDRw0cNHDRw0cNHDRw0cNHDRw0cNHDRw0cNHDVw1cNXFVxVcVXFVx9OPph0w6Yo/bQxY9MOnH04+nH04quKrhq4auGrhq4aOGjho4aOGjho4aOGkOGkOGkOGjho4aOGjho4aOGjhq4auGriq4quKriq4+nH0w6Ydf+wHgcLhcLicTjYdww7hh3DDuGPcMe4Y9ww7hh3DDuGHcONxuJxOFwuBwOB8753z2fPZ89nz3fNd893zXfPd893z3fP/Y+e757uC75/wCyHz/2Q+f+yHBd893z3fPd893z3fPd893zXfNd893z2fPZ8/b5+3zvncDgcLhcLicTjYdww7hh3DDuGHcMe4Ydww7hh3DDuGHcONxuJxOFwuBwPnfO+d89nz2fPZ893zXfPd813z3fPd893z/2Pnu+e7gu+f8Ash8/9kPn/shwXcF3z3fPd893z3fPd893zXfNd893z2fPZ8/b5+3zvncDdu3bt03bt26bpum6bpum6bt27du3bt26bt26bpum6bpum6bpum6bt03TdN26bpum6bpum7dN03TdN03TdN03TdN03Tdum7dum7dN27dum6bpum6bpum6bpum7du3bt03bpu3bpum6bpum6bpum6bpu3TdN03bpum6bpum6bt03TdN03TdN03TdN03TdN03TduysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysysmzKzKzKybMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrMrJT+2lKUpSlKUpSlKUpSlKUpSlKUpSlKUpSlKUpSn9tKUpSlKUpSlKUpSlKUpSlKUpSlKUpSlKUpT/wDrA//EAB0RAAMBAAMBAQEAAAAAAAAAAAABERIwQFAgkMD/2gAIAQIBAT8A/COlKioqKioqKi+zSoqKioqL59Ro0aKyvpVlZWaNFXiVGkaNFZWV9CsrNGjRpFXepo0V8c69Zo0u1pGilfVnJWaNF+NFXNUaNFfmU0aReamkaNPzNM19VlZWaKysrK/XrKzTNGjRWaKyv+u0/8QAHREBAQACAQUAAAAAAAAAAAAAEQBAUCAQITCQwP/aAAgBAwEBPwD1NkRER07eYiIiNMRERGARERGgIiNAREZRERoCIjiYBERqiIwiI1REcCIiIiIjbkREREREfXZ//9k=";g();g();var Zte=!1;function M9(){Zte=!0}o(M9,"enableTestMode");function Kte(){return Zte}o(Kte,"isTestMode");var O9=class O9{constructor(t){x(this,"backgroundAlpha",1);x(this,"backgroundColor",new An);x(this,"width",0);x(this,"height",0);x(this,"options",{});x(this,"renderer");x(this,"enabledLayers",new Set([0,1]));x(this,"handleWebGLContextCreationError",o(t=>{var r,n;(n=(r=this.options).onWebGLContextCreationError)==null||n.call(r,t)},"handleWebGLContextCreationError"));x(this,"handleWebGLContextLost",o(t=>{var r,n;(n=(r=this.options).onWebGLContextLost)==null||n.call(r,t)},"handleWebGLContextLost"));x(this,"handleWebGLContextRestored",o(t=>{var r,n;(n=(r=this.options).onWebGLContextRestored)==null||n.call(r,t)},"handleWebGLContextRestored"));var r,n,i,s,l;try{this.options=t,Kte()?(this.renderer={setSize:o(()=>{},"setSize"),state:{reset:o(()=>{},"reset")},properties:{get:o(()=>{},"get")},getSize:o(()=>({width:window.innerWidth,height:innerHeight}),"getSize"),getDrawingBufferSize:o(()=>({width:window.innerWidth,height:innerHeight}),"getDrawingBufferSize"),getClearAlpha:o(()=>1,"getClearAlpha"),getClearColor:o(()=>new An,"getClearColor"),autoUpdate:!0,shadowMap:{autoUpdate:!0},getContext:o(()=>({getContextAttributes(){return{alpha:!0,antialias:!1,depth:!0,stencil:!1}}}),"getContext"),readRenderTargetPixelsAsync:o(()=>Promise.resolve([]),"readRenderTargetPixelsAsync"),setRenderTarget:o(()=>{},"setRenderTarget"),setClearColor:o(()=>{},"setClearColor"),clear:o(()=>{},"clear"),render:o(()=>{},"render"),clearStencil:o(()=>{},"clearStencil"),clearDepth:o(()=>{},"clearDepth"),domElement:document.createElement("canvas"),capabilities:{isWebGL2:!0}},this.renderer.domElement.style.width="1920px",Object.defineProperty(this.renderer.domElement,"clientWidth",{value:1920}),this.renderer.domElement.style.height="1080px",Object.defineProperty(this.renderer.domElement,"clientHeight",{value:1080})):this.renderer=new BN({canvas:t.canvas,alpha:t.alpha||!1,stencil:!0,antialias:typeof t.antialias=="boolean"?t.antialias:!0,powerPreference:"high-performance",preserveDrawingBuffer:!0}),this.backgroundColor=new An((r=t.backgroundColor)!=null?r:"#ffffff"),this.backgroundAlpha=(n=t.backgroundAlpha)!=null?n:1}catch(c){ce.error(c),t.onWebGLRendererError&&t.onWebGLRendererError(c)}(i=this.domElement())==null||i.addEventListener("webglcontextlost",this.handleWebGLContextLost),(s=this.domElement())==null||s.addEventListener("webglcontextrestored",this.handleWebGLContextRestored),(l=this.domElement())==null||l.addEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}destroy(){var t,r,n,i,s;this.renderer&&((r=(t=this.renderer).dispose)==null||r.call(t)),(n=this.domElement())==null||n.removeEventListener("webglcontextlost",this.handleWebGLContextLost),(i=this.domElement())==null||i.removeEventListener("webglcontextrestored",this.handleWebGLContextRestored),(s=this.domElement())==null||s.removeEventListener("webglcontextcreationerror",this.handleWebGLContextCreationError)}render(t,r){if(this.renderer){this.renderer.state.reset(),r.layers.disableAll();for(let n of this.enabledLayers.values())r.layers.enable(n);this.renderer.clearStencil(),this.renderer.autoClear=!1,this.renderer.setRenderTarget(null),this.renderer.render(t,r),this.renderer.clearDepth(),r.layers.disableAll(),r.layers.enable(vS.ALWAYS_ON_TOP),this.renderer.render(t,r),this.renderer.state.reset()}}clear(){this.renderer&&(this.renderer.setClearColor(this.backgroundColor,this.backgroundAlpha),this.renderer.clear())}setBufferSize(t,r){I.env.NODE_ENV==="test"||!this.renderer||(this.width=t,this.height=r,this.renderer.setSize(t,r,!1))}setBackgroundColor(t,r){this.backgroundColor=t,this.backgroundAlpha=r}domElement(){var t;return(t=this.renderer)==null?void 0:t.domElement}};o(O9,"Renderer");var t3=O9;g();g();var Jte='"use strict";(()=>{var G=Object.defineProperty;var J=(n,e,t)=>e in n?G(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var l=(n,e,t)=>J(n,typeof e!="symbol"?e+"":e,t);function M(n,e){return e.x+e.w<n.x+n.w&&e.x>n.x&&e.y>n.y&&e.y+e.h<n.y+n.h}function j(n,e){let[t,i]=e;return t>=n.x&&t<=n.x+n.w&&i>=n.y&&i<=n.y+n.h}function q(n,e){let t=e.x,i=e.y,o=e.x+e.w,h=e.y+e.h,k=n.x,p=n.y,f=n.x+n.w,g=n.y+n.h;return t<f&&k<o&&i<g&&p<h}function c(n,e){for(let t=0;t<e.length;t++)n.push(e[t])}var s=class{constructor(e,t,i,o,h){l(this,"x");l(this,"y");l(this,"w");l(this,"h");l(this,"userData");this.userData=typeof h>"u"?null:h,this.x=e,this.y=t,this.w=i,this.h=o}contains(e){return e===this?!1:M(this,e)}intersects(e){return q(this,e)}intersectsPoint(e){return j(this,e)}draw(e){e.fillStyle="rgba(123,222,26, 0.8)",e.fillRect(this.x,this.y,this.w,this.h)}};var w=class n{constructor(e,t){l(this,"topLeft");l(this,"topRight");l(this,"bottomLeft");l(this,"bottomRight");l(this,"divided",!1);l(this,"boundary");l(this,"capacity",16);l(this,"objects",[]);l(this,"parent");this.parent=t,this.boundary=e}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:e,y:t,w:i,h:o}=this.boundary;this.topLeft=new n(new s(e,t,i/2,o/2),this),this.topRight=new n(new s(e+i/2,t,i/2,o/2),this),this.bottomLeft=new n(new s(e,t+o/2,i/2,o/2),this),this.bottomRight=new n(new s(e+i/2,t+o/2,i/2,o/2),this),this.divided=!0}queryRect(e){let t=[];if(this.boundary.intersects(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryRect(e)),c(t,this.topRight.queryRect(e)),c(t,this.bottomLeft.queryRect(e)),c(t,this.bottomRight.queryRect(e))),t}queryPoint(e){let t=[];if(this.boundary.intersectsPoint(e))t.push(...this.objects);else return[];return this.divided&&(c(t,this.topLeft.queryPoint(e)),c(t,this.topRight.queryPoint(e)),c(t,this.bottomLeft.queryPoint(e)),c(t,this.bottomRight.queryPoint(e))),t}insert(e){return(this.parent?!this.boundary.contains(e):!this.boundary.intersects(e))?!1:this.objects.length<this.capacity?(this.objects.push(e),!0):(this.divided||this.subdivide(),(this.topLeft.insert(e)||this.topRight.insert(e)||this.bottomLeft.insert(e)||this.bottomRight.insert(e))===!1&&this.objects.push(e),!0)}drawObjects(e){this.objects.forEach(t=>t.draw(e)),this.divided&&(this.topLeft.drawObjects(e),this.topRight.drawObjects(e),this.bottomLeft.drawObjects(e),this.bottomRight.drawObjects(e))}draw(e){e.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(e),this.topRight.draw(e),this.bottomLeft.draw(e),this.bottomRight.draw(e)),e.strokeStyle="black",e.lineWidth=4,e.stroke()}};var d=200,S=10;function z(n,e,t,i,o,h,k="-1"){let p=1/0,f=1/0,g=-1/0,P=-1/0,O=new s(-S,0,5,t),K=new s(-S,0,e,5),W=new s(e-5,0,e+S,t),V=new s(0,t-5,e,t+S),Q=Z(e,t,i,o,h),Y=[O,K,W,V],E=new s(-d,-d,e+d*2,t+d*2);for(let r of n){let R,T;for(let u=0;u<r.bboxes.length;u++){if(r.bboxes[u]==null||(R=r.bboxes[u].boundingBox,T=r.bboxes[u].index,r.lockedToStrategyIndex!==-1&&T!==r.lockedToStrategyIndex))continue;let[I,a,b,N]=R,[m,F,D,U]=[r.y-I,r.y+a,r.x-b,r.x+N],B=D,L=m,A=U-D,_=F-m;p=Math.min(p,B)-d,f=Math.min(f,L)-d,g=Math.max(g,B+A)+d,P=Math.max(P,L+_)+d,r.bboxes[u].boundingRect=new s(B,L,A,_)}}let y={msgId:k,colliders:new Array(n.length),debug:[]},C=new w(new s(p,f,g-p,P-f)),x;for(let r=0;r<n.length;r++)if(x=n[r],y.colliders[r]=[-1,0],x.enabledAndVisible){let[R,T,u]=[1/0,-1,void 0];for(let{index:I,boundingRect:a}of x.bboxes){if(a==null)continue;let b=[];if(b=C.queryRect(a).filter(m=>a.intersects(m)),x.shouldCollideWithScreenEdges&&Y.forEach(m=>{a.intersects(m)&&b.push(m)}),a.intersects(Q)){y.colliders[r]=[-1,0,a];break}if(b.length<=R&&(u=a,T=I,R=b.length),b.length===0){C.insert(a),y.colliders[r]=[I,E.contains(a)?0:1,a];break}}x.rank===5&&u!=null&&(C.insert(u),y.colliders[r]=[T,E.contains(u)?0:1,u])}else y.colliders[r]=[-1,0];return y}function Z(n,e,t,i,o){switch(o){case"top-right":return new s(n-t,0,t,i);case"bottom-left":return new s(0,e-i,t,i);case"bottom-right":return new s(n-t,e-i,t,i);case"top-left":return new s(0,0,t,i)}}function X(n){let e=n[0].map(t=>{let i=t[0].map(o=>({index:o[4],boundingBox:[o[0],o[1],o[2],o[3]]}));return{enabledAndVisible:t[1]===1,rank:t[2]===1?5:0,x:t[3],y:t[4],shouldCollideWithScreenEdges:t[5]===1,bboxes:i,lockedToStrategyIndex:t[6]}});return{msgId:"-1",totalWidth:n[3],totalHeight:n[2],watermarkWidth:n[4],watermarkHeight:n[5],watermarkPosition:n[6],colliders:e,devicePixelRatio:n[1]}}self.onmessage=n=>{let e=X(n.data);self.postMessage(z(e.colliders,e.totalWidth,e.totalHeight,e.watermarkWidth,e.watermarkHeight,e.watermarkPosition,e.msgId))};})();\n';g();g();g();g();g();function Qte(e,t){return t.x+t.w<e.x+e.w&&t.x>e.x&&t.y>e.y&&t.y+t.h<e.y+e.h}o(Qte,"contains");g();function ere(e,t){let[r,n]=t;return r>=e.x&&r<=e.x+e.w&&n>=e.y&&n<=e.y+e.h}o(ere,"intersectPoint");g();function tre(e,t){let r=t.x,n=t.y,i=t.x+t.w,s=t.y+t.h,l=e.x,c=e.y,p=e.x+e.w,h=e.y+e.h;return r<p&&l<i&&n<h&&c<s}o(tre,"intersects");g();function jf(e,t){for(let r=0;r<t.length;r++)e.push(t[r])}o(jf,"appendItems");g();var L9=class L9{constructor(t,r,n,i,s){x(this,"x");x(this,"y");x(this,"w");x(this,"h");x(this,"userData");this.userData=typeof s>"u"?null:s,this.x=t,this.y=r,this.w=n,this.h=i}contains(t){return t===this?!1:Qte(this,t)}intersects(t){return tre(this,t)}intersectsPoint(t){return ere(this,t)}draw(t){t.fillStyle="rgba(123,222,26, 0.8)",t.fillRect(this.x,this.y,this.w,this.h)}};o(L9,"Rectangle");var Lo=L9;var Ag=class Ag{constructor(t,r){x(this,"topLeft");x(this,"topRight");x(this,"bottomLeft");x(this,"bottomRight");x(this,"divided",!1);x(this,"boundary");x(this,"capacity",16);x(this,"objects",[]);x(this,"parent");this.parent=r,this.boundary=t}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:t,y:r,w:n,h:i}=this.boundary;this.topLeft=new Ag(new Lo(t,r,n/2,i/2),this),this.topRight=new Ag(new Lo(t+n/2,r,n/2,i/2),this),this.bottomLeft=new Ag(new Lo(t,r+i/2,n/2,i/2),this),this.bottomRight=new Ag(new Lo(t+n/2,r+i/2,n/2,i/2),this),this.divided=!0}queryRect(t){let r=[];if(this.boundary.intersects(t))r.push(...this.objects);else return[];return this.divided&&(jf(r,this.topLeft.queryRect(t)),jf(r,this.topRight.queryRect(t)),jf(r,this.bottomLeft.queryRect(t)),jf(r,this.bottomRight.queryRect(t))),r}queryPoint(t){let r=[];if(this.boundary.intersectsPoint(t))r.push(...this.objects);else return[];return this.divided&&(jf(r,this.topLeft.queryPoint(t)),jf(r,this.topRight.queryPoint(t)),jf(r,this.bottomLeft.queryPoint(t)),jf(r,this.bottomRight.queryPoint(t))),r}insert(t){return(this.parent?!this.boundary.contains(t):!this.boundary.intersects(t))?!1:this.objects.length<this.capacity?(this.objects.push(t),!0):(this.divided||this.subdivide(),(this.topLeft.insert(t)||this.topRight.insert(t)||this.bottomLeft.insert(t)||this.bottomRight.insert(t))===!1&&this.objects.push(t),!0)}drawObjects(t){this.objects.forEach(r=>r.draw(t)),this.divided&&(this.topLeft.drawObjects(t),this.topRight.drawObjects(t),this.bottomLeft.drawObjects(t),this.bottomRight.drawObjects(t))}draw(t){t.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(t),this.topRight.draw(t),this.bottomLeft.draw(t),this.bottomRight.draw(t)),t.strokeStyle="black",t.lineWidth=4,t.stroke()}};o(Ag,"QuadTree");var mp=Ag;g();g();var rre=["","","low","medium","high","always-visible"];function nre(e){return Math.min(5,Math.max(2,e))}o(nre,"clampTierNumber");function Y1(e){if(typeof e=="number")return nre(e);let t=rre.indexOf(e);return t===-1?3:t}o(Y1,"convertCollisionRankingTierToNumber");function RI(e){let t=nre(e);return rre[t]}o(RI,"convertNumberToCollisionRankingTier");function ore(e,t,r){let n,i,s,l=null,c=0;r||(r={});let p=o(function(){c=r.leading===!1?0:Date.now(),l=null,s=e.apply(n,i),l||(n=i=null)},"later");return function(){let h=Date.now();!c&&r.leading===!1&&(c=h);let y=t-(h-c);return n=globalThis,i=arguments,y<=0||y>t?(l&&(clearTimeout(l),l=null),c=h,s=e.apply(n,i),l||(n=i=null)):!l&&r.trailing!==!1&&(l=setTimeout(p,y)),s}}o(ore,"throttle");var Dg=!1,A9="",P3e=150,F9=class F9 extends Lt{constructor(r,n,i=A9?new Worker(A9):new Worker(URL.createObjectURL(new Blob([Jte],{type:"text/javascript"})))){super();x(this,"worker");x(this,"debugContext");x(this,"debugCanvas");x(this,"collidersDirty",!0);x(this,"packedMessage",[[],0,0,0,0,0,"bottom-left"]);x(this,"visibleCollidersQTree",new mp(new Lo(0,0,0,0)));x(this,"interactiveCollidersQTree",new mp(new Lo(0,0,0,0)));x(this,"coreState");x(this,"postMessage");x(this,"showCollisionBoxes",o(()=>{Dg=!0,this.debugCanvas.style.display="block"},"showCollisionBoxes"));x(this,"hideCollisionBoxes",o(()=>{Dg=!1,this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugCanvas.style.display="none"},"hideCollisionBoxes"));x(this,"currentMsgId","");x(this,"working",!1);x(this,"_postMessage",o(()=>{this.worker.postMessage(this.packedMessage)},"_postMessage"));x(this,"componentArray",[]);x(this,"update",o((r,n,i="bottom-left",s=!1)=>{let l=!1;if(this.collidersDirty){this.packedMessage=[[],0,0,0,0,0,"bottom-left"],this.componentArray=[];let c;for(let p of this.coreState.geometry2DIdsInScene){let h=this.coreState.geometry2DMap.get(p);h&&(c=h.components[0],this.componentArray.push(c))}this.resize(r,n,i),this.collidersDirty=!1,l=!0}else l=this.componentArray.some(c=>c.collisionDirty===!0);l&&this.componentArray.sort((c,p)=>p.rank-c.rank);for(let c=0;c<this.componentArray.length;c++)if(this.packedMessage){let p=this.componentArray[c].toPackedMessage(s&&!l);this.packedMessage[0][c]==null&&(this.packedMessage[0][c]=[]),this.packedMessage[0][c][0]==null&&(this.packedMessage[0][c][0]=[]),this.packedMessage[0][c][0]=p.bboxes,this.packedMessage[0][c][1]=p.enabled&&this.componentArray[c].visible&&!this.componentArray[c].isOccluded?1:0,this.packedMessage[0][c][2]=p.rank===5?1:0,this.packedMessage[0][c][3]=p.x,this.packedMessage[0][c][4]=p.y,this.packedMessage[0][c][5]=p.shouldCollideWithScreenEdges?1:0,this.packedMessage[0][c][6]=p.lockedToStrategyIndex}this.working||this.postMessage()},"update"));x(this,"resolve",o(r=>{if(this.working=!1,this.collidersDirty||!r.data)return;let n=r.data.colliders,i=-1,s,l,c;Dg&&(this.visibleCollidersQTree=new mp(new Lo(0,0,this.debugCanvas.width,this.debugCanvas.height))),this.interactiveCollidersQTree=new mp(new Lo(0,0,this.debugCanvas.width,this.debugCanvas.height));for(let p=0;p<this.componentArray.length;p++){let h=this.componentArray[p];n[p]!=null&&(i=n[p][0],s=n[p][2],h.offscreen=n[p][1]===1,i!==-1&&s!=null?(c=new Lo(s.x,s.y,s.w,s.h,{entityId:h.id}),Dg&&this.visibleCollidersQTree.insert(c),l=this.coreState.geometry2DMap.get(h.id),(l==null?void 0:l.components[1])!=null&&this.interactiveCollidersQTree.insert(new Lo(s.x,s.y,s.w,s.h,{entityId:h.id})),(h.canShow===!1||h.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in h&&(h.visibilityNeedsUpdate="show"),i!==-1&&i!==h.currentStrategyIndex&&(h.activeBoundingBox=c,h.onStrategySelected(i))):((h.canShow===!0||h.visibilityNeedsUpdate!==!1)&&"visibilityNeedsUpdate"in h&&(h.visibilityNeedsUpdate="hide"),i!==-1&&i!==h.currentStrategyIndex&&h.onStrategySelected(i)))}Dg&&this.drawDebug(),this.publish("visibility-changed")},"resolve"));x(this,"drawDebug",o(()=>{Dg&&this.visibleCollidersQTree&&(this.debugContext.clearRect(0,0,this.debugCanvas.width,this.debugCanvas.height),this.debugContext.beginPath(),this.visibleCollidersQTree.drawObjects(this.debugContext))},"drawDebug"));x(this,"destroy",o(()=>{this.worker.terminate()},"destroy"));this.coreState=n,this.debugCanvas=r,this.debugContext=r.getContext("2d"),this.worker=i,this.worker.onmessage=s=>this.resolve(s),this.postMessage=ore(this._postMessage,P3e,!1),Dg?this.showCollisionBoxes():this.hideCollisionBoxes()}resize(r,n,i){this.packedMessage[6]=i,this.packedMessage[5]=n,this.packedMessage[4]=r,this.packedMessage[3]=this.debugCanvas.width,this.packedMessage[2]=this.debugCanvas.height}};o(F9,"CollisionSystem");var r3=F9;function D9(e){A9=e}o(D9,"setWorkerUrl");g();g();g();g();var k9=class k9{constructor(t){x(this,"type");x(this,"event");this.type=0,this.event=t}get timestamp(){return this.event.timeStamp}};o(k9,"Tap");var n3=k9,R9=class R9{constructor(){x(this,"taps",[])}add(t){this.lastPointerDown&&t.timestamp-this.lastPointerDown.timestamp<50?this.lastPointerDown.type=1:this.taps.push(t)}get lastPointerDown(){return this.taps.length>=1?this.taps[this.taps.length-1]:void 0}get isSingleTapWithTwoFingers(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===1}get isSingleTapWithOneFinger(){var t;return this.isSingleTap&&((t=this.lastPointerDown)==null?void 0:t.type)===0}get isDoubleTapWithOneFinger(){var t,r;return this.isDoubleTap&&((t=this.taps[0])==null?void 0:t.type)===0&&((r=this.taps[1])==null?void 0:r.type)===0}get isSingleTap(){return this.taps.length===1}get isDoubleTap(){return this.taps.length===2}discardOutsideOfWaitWindow(t){this.taps=this.taps.filter(r=>t-r.timestamp<300)}flush(){this.taps=[]}get _taps(){return this.taps}destroy(){this.flush()}};o(R9,"TapsController");var i3=R9;g();function sre(e){let t=new Set;for(let r of e){let n=r.object;for(;n.parent&&!t.has(n.parent);)n=n.parent,n instanceof Ar&&n.type==="group-container"&&n.visible&&n.components[1]&&t.add(n)}return Array.from(t)}o(sre,"getUniqueIntersectedGroupContainers");var Z1,B9=class B9 extends Lt{constructor(r,n,i,s,l){super();x(this,"raycaster",new Ec);x(this,"state",{hovered3DEntity:void 0,hovered2DEntity:void 0,hovered3DContainers:void 0,lastHover:void 0,interaction:{mouseDownStart:void 0,distanceFromMouseDown:void 0,isPanning:!1}});x(this,"coreState");x(this,"camera");x(this,"worldPlane");x(this,"_quadtree",new mp(new Lo(0,0,0,0)));x(this,"_container");x(this,"lastPointerEvent");x(this,"cursor","grab");x(this,"touchesCount",0);x(this,"isUserInteracting");x(this,"hasTouched",!1);G(this,Z1);x(this,"onPointerMoveRaf",o(r=>{this.lastPointerEvent=r,d(this,Z1)&&cancelAnimationFrame(d(this,Z1)),q(this,Z1,requestAnimationFrame(()=>{this.onPointerMove(r)}))},"onPointerMoveRaf"));x(this,"onPointerMove",o(r=>{r.preventDefault(),this.updateInteractionStateIfPanning(r),(r.pointerType!=="touch"||r.pointerType===void 0&&this.hasTouched)&&this.handleHover(r),this.handleCursor()},"onPointerMove"));x(this,"tapsControl",new i3);x(this,"onPointerDown",o(r=>{r.target===this._container&&(this._container.addEventListener("pointerup",this.onPointerUp,!1),this._container.addEventListener("pointercancel",this.onPointerUp,!1),this.state.interaction.mouseDownStart={time:Date.now(),timestamp:r.timeStamp,clientX:r.clientX,clientY:r.clientY},this.lastPointerEvent=r,this.state.interaction.distanceFromMouseDown=0,this.handleCursor(),r.pointerType==="touch"&&(this.tapsControl.add(new n3(r)),this.touchesCount=Math.max(0,this.touchesCount+1)))},"onPointerDown"));x(this,"clickTimeout");x(this,"onPointerUp",o(r=>{this.tapsControl.discardOutsideOfWaitWindow(r.timeStamp),this.lastPointerEvent=r,this.touchesCount=Math.max(0,this.touchesCount-1),this.touchesCount===0&&(this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)),this.updateInteractionStateIfPanning(r);let{mouseDownStart:n}=this.state.interaction;!n||this.state.interaction.distanceFromMouseDown==null||(Date.now()<n.time+300&&(this.tapsControl.isSingleTapWithTwoFingers||this.state.interaction.distanceFromMouseDown<=15)&&(r.pointerType==="touch"?this.tapsControl.isSingleTapWithTwoFingers?(this.publish("singletap-with-twofinger",r),this.flush()):this.tapsControl.isSingleTapWithOneFinger&&this.touchesCount===0?(this.clickTimeout&&clearTimeout(this.clickTimeout),this.clickTimeout=window.setTimeout(()=>{this.handleClick(r),this.flush()},300)):this.tapsControl.isDoubleTapWithOneFinger&&(this.publish("doubletap-with-onefinger",r),this.flush()):this.handleClick(r)),this.state.interaction.mouseDownStart=void 0,this.state.interaction.distanceFromMouseDown=void 0,this.state.interaction.isPanning=!1,this.handleCursor())},"onPointerUp"));x(this,"dirty3D",!0);x(this,"cachedHitBoxes",{entities:[],groups:[]});x(this,"ndcPoint",new wt);x(this,"debugPanel");this.isUserInteracting=l,this.raycaster.layers.enableAll(),this.raycaster.layers.disable(1),this.camera=i,this._container=r,this.coreState=n,this.worldPlane=s,this._container.addEventListener("pointerdown",this.onPointerDown,!1),this._container.addEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.classList.add("mappedin-interactive")}updateQuadtree(r){this._quadtree=r}setHovered3DEntityInteractionComponentDirty(){if(this.state.hovered3DEntity){let r=this.state.hovered3DEntity.components[2];r&&(r.dirty=!0)}}getThreeDIntersectsFromXY(r){this.raycaster.setFromCamera(r,this.camera),this.raycaster.layers.enable(0);let n=this.raycaster.intersectObjects(this._hitBoxes.entities,!1).filter(s=>{var l,c;return((l=s.object)==null?void 0:l.name)==="worldPlane"||((c=s.object)==null?void 0:c.visible)}),i=n.findIndex(s=>{var l;return((l=s.object)==null?void 0:l.name)==="worldPlane"});return i!==-1&&n.push(n.splice(i,1)[0]),n}getGroupContainerIntersectsFromXY(r){this.raycaster.setFromCamera(r,this.camera),this.raycaster.layers.enable(0);let n=this.raycaster.intersectObjects(this._hitBoxes.groups,!0).filter(s=>s.object.visible),i;return n!=null&&n.length>0&&(i=sre(n)),i}flush(){this.tapsControl.flush(),this.clickTimeout!=null&&(clearTimeout(this.clickTimeout),this.clickTimeout=void 0)}handleHover(r){let n=r||this.lastPointerEvent;if(this.state.interaction.mouseDownStart||!n||this.isUserInteracting())return;let{entity3D:i,entity2D:s,position:l,groupContainers:c}=this.intersect(n);(this.detect3DEntityHover(i)||this.detect2DEntityHover(s)||this.detect3DContainerHover(c))&&(this.state.hovered3DEntity=i,this.state.lastHover=i,this.state.hovered2DEntity=s,this.state.hovered3DContainers=c,this.publish("hover",{entity2D:this.state.hovered2DEntity,entity3D:this.state.hovered3DEntity,position:l,groupContainers:c})),this.handleCursor()}handleCursor(){var l;let r=!!(this.state.hovered3DEntity&&((l=this.state.hovered3DEntity)!=null&&l.components[2])||this.state.hovered2DEntity),n=!!this.state.interaction.mouseDownStart,i=this.state.interaction.isPanning,s=O3e(r,i,n);this.cursor!==s&&(this.cursor=s,s==="pointer"?this._container.classList.add("mappedin-interaction-hover"):this._container.classList.remove("mappedin-interaction-hover"))}detect2DEntityHover(r){return this.state.hovered2DEntity!==r}handleClick(r){let n=this.intersect(r);this.publish("click",{entity2D:n.entity2D,entity3D:n.entity3D,position:n.position,groupContainers:n.groupContainers,pointerEvent:{button:r.button}})}get _hitBoxes(){if(this.dirty3D){this.cachedHitBoxes.entities=[],this.cachedHitBoxes.groups=[];let r;for(let n of this.coreState.geometry3DIdsInScene)r=this.coreState.geometry3DMap.get(n),(r==null?void 0:r.type)==="geometry"||(r==null?void 0:r.type)==="model"||(r==null?void 0:r.type)==="path"||(r==null?void 0:r.type)==="custom-geometry"?r.components[0].mesh&&!this.cachedHitBoxes.entities.includes(r.components[0].mesh)&&this.cachedHitBoxes.entities.push(r.components[0].mesh):(r==null?void 0:r.type)==="group-container"&&r.components[1]&&!this.cachedHitBoxes.groups.includes(r)&&this.cachedHitBoxes.groups.push(r);return this.dirty3D=!1,this.cachedHitBoxes.entities.push(this.worldPlane),this.cachedHitBoxes}return this.cachedHitBoxes}intersect(r){var T,O,D,A,R;let n=[r.offsetX,r.offsetY],i=this._quadtree.queryPoint(n),[s]=i.filter(j=>j.intersectsPoint(n)),l=this.coreState.containerOffset[0],c=this.coreState.containerOffset[1];this.ndcPoint.x=(r.clientX-c)/this._container.clientWidth*2-1,this.ndcPoint.y=-((r.clientY-l)/this._container.clientHeight)*2+1;let p=this.getThreeDIntersectsFromXY(this.ndcPoint),h=(T=p[0])==null?void 0:T.point,y=[],b=[];for(let j of p.filter(X=>X.object.name!=="worldPlane"))j.object instanceof jt&&j.object.material.depthTest===!1?y.push(j):b.push(j);let _=(D=(O=y[0])!=null?O:b[0])!=null?D:void 0,C,P;if(_!=null){if(C=A3e(_.object,this.coreState.geometry3DMap),!C){let j=(A=_==null?void 0:_.instanceId)!=null?A:_==null?void 0:_.batchId;C=j!=null&&(_!=null&&_.object.userData.entities)?this.coreState.geometry3DMap.get(_==null?void 0:_.object.userData.entities[j]):this.coreState.geometry3DMap.get(_==null?void 0:_.object.userData.entityId)}C!=null&&C.components[2]&&(P=C)}let E=this.getGroupContainerIntersectsFromXY(this.ndcPoint);return{entity2D:((R=s==null?void 0:s.userData)==null?void 0:R.entityId)==="watermark"?{id:"watermark"}:this.coreState.geometry2DMap.get(s==null?void 0:s.userData.entityId),entity3D:P,position:h,groupContainers:E}}detect3DEntityHover(r){return this.state.lastHover!==r&&(this.state.lastHover&&lre(this.state.lastHover,!1,this.coreState),r&&lre(r,!0,this.coreState)),this.state.hovered3DEntity!==r}detect3DContainerHover(r){return!GN(this.state.hovered3DContainers,r)}updateInteractionStateIfPanning(r){this.state.interaction.mouseDownStart&&(this.state.interaction.distanceFromMouseDown=Math.sqrt(Math.pow(r.clientX-this.state.interaction.mouseDownStart.clientX,2)+Math.pow(r.clientY-this.state.interaction.mouseDownStart.clientY,2)),!this.state.interaction.isPanning&&this.state.interaction.distanceFromMouseDown>15&&(this.state.interaction.isPanning=!0))}getMouseRayIntersects(){return this.raycaster.intersectObjects([this.worldPlane],!1)}destroy(){this._container.removeEventListener("pointerdown",this.onPointerDown,!1),this._container.removeEventListener("pointermove",this.onPointerMoveRaf,!1),this._container.removeEventListener("pointerup",this.onPointerUp,!1),this._container.removeEventListener("pointercancel",this.onPointerUp,!1)}enableDebug(){let r=document.createElement("div");r.style.position="absolute",r.style.top="0",r.style.right="0",r.style.backgroundColor="white",r.style.padding="10px",document.body.append(r),r.id="interaction-debug-panel",this.debugPanel=r,this.on("doubletap-with-onefinger",()=>{this.queueDebugMessage("doubletap-with-onefinger","#ffadad")}),this.on("singletap-with-twofinger",()=>{this.queueDebugMessage("singletap-with-twofinger","#ffd6a5")}),this.on("click",n=>{var i,s,l;this.queueDebugMessage("CLICK \n3D: ".concat((i=n.entity3D)==null?void 0:i.id," \n2D: ").concat((s=n.entity2D)==null?void 0:s.id," \nPos: ").concat((l=n.position)==null?void 0:l.toArray().join(", ")),"#fdffb6")}),this.on("hover",n=>{var i,s,l;this.queueDebugMessage("HOVER \n3D: ".concat((i=n.entity3D)==null?void 0:i.id," \n2D: ").concat((s=n.entity2D)==null?void 0:s.id," \nPos: ").concat((l=n.position)==null?void 0:l.toArray().join(", ")),"#caffbf")})}get _state(){return this.state}queueDebugMessage(r,n){var s;let i=document.createElement("pre");i.style.maxWidth="300px",i.style.transition="opacity 500ms cubic-bezier(0.4, 0, 0.2, 1)",i.style.backgroundColor=n,i.textContent=r,(s=this.debugPanel)==null||s.prepend(i),setTimeout(()=>{i.style.opacity="0",setTimeout(()=>{i.remove()},500)},2500)}getCursor(){return this.cursor}};Z1=new WeakMap,o(B9,"InteractionSystem");var $I=B9;function lre(e,t,r){var l;let n=e.components[2];n&&n.hover!==!0&&(n.hover=t?"user-interaction":!1,n.dirty=!0);let i=(l=e.components[0].textMesh)==null?void 0:l.userData.entityId;if(!i)return;let s=r.geometry3DMap.get(i);(s==null?void 0:s.type)==="text3d"&&(s.components[1].hoverByPolygon=t,s.components[1].dirty=!0)}o(lre,"updateHover");function O3e(e,t,r){return t?"grabbing":e?"pointer":r?"grabbing":"grab"}o(O3e,"processCursor");function L3e(e){let t=e;for(;t!=null&&t.parent;){if(t instanceof Ed)return;if(t.userData.isSingleModel)return t;t=t.parent}}o(L3e,"findModelParent");function A3e(e,t){let r=L3e(e);return r?t.get(r.userData.entityId):void 0}o(A3e,"findModelParentEntity");g();g();g();var le={};Cc(le,{BRAND:()=>iTe,DIRTY:()=>Fg,EMPTY_PATH:()=>k3e,INVALID:()=>Ot,NEVER:()=>UTe,OK:()=>Ws,ParseStatus:()=>_s,Schema:()=>Xt,ZodAny:()=>mh,ZodArray:()=>zf,ZodBigInt:()=>Rg,ZodBoolean:()=>Bg,ZodBranded:()=>HI,ZodCatch:()=>Yg,ZodDate:()=>$g,ZodDefault:()=>Xg,ZodDiscriminatedUnion:()=>u3,ZodEffects:()=>ou,ZodEnum:()=>Hg,ZodError:()=>Ga,ZodFirstPartyTypeKind:()=>Dt,ZodFunction:()=>p3,ZodIntersection:()=>Vg,ZodIssueCode:()=>qe,ZodLazy:()=>zg,ZodLiteral:()=>qg,ZodMap:()=>iv,ZodNaN:()=>sv,ZodNativeEnum:()=>Wg,ZodNever:()=>Qu,ZodNull:()=>Gg,ZodNullable:()=>bp,ZodNumber:()=>kg,ZodObject:()=>Ua,ZodOptional:()=>nu,ZodParsedType:()=>at,ZodPipeline:()=>WI,ZodPromise:()=>gh,ZodReadonly:()=>Zg,ZodRecord:()=>c3,ZodSchema:()=>Xt,ZodSet:()=>ov,ZodString:()=>hh,ZodSymbol:()=>rv,ZodTransformer:()=>ou,ZodTuple:()=>vp,ZodType:()=>Xt,ZodUndefined:()=>jg,ZodUnion:()=>Ug,ZodUnknown:()=>Vf,ZodVoid:()=>nv,addIssueToContext:()=>et,any:()=>dTe,array:()=>yTe,bigint:()=>lTe,boolean:()=>bre,coerce:()=>GTe,custom:()=>gre,date:()=>uTe,datetimeRegex:()=>hre,defaultErrorMap:()=>Gf,discriminatedUnion:()=>ITe,effect:()=>DTe,enum:()=>OTe,function:()=>TTe,getErrorMap:()=>K1,getParsedType:()=>yp,instanceof:()=>sTe,intersection:()=>_Te,isAborted:()=>a3,isAsync:()=>J1,isDirty:()=>l3,isValid:()=>dh,late:()=>oTe,lazy:()=>ETe,literal:()=>MTe,makeIssue:()=>jI,map:()=>wTe,nan:()=>aTe,nativeEnum:()=>LTe,never:()=>mTe,null:()=>fTe,nullable:()=>NTe,number:()=>vre,object:()=>vTe,objectUtil:()=>$9,oboolean:()=>jTe,onumber:()=>$Te,optional:()=>FTe,ostring:()=>BTe,pipeline:()=>RTe,preprocess:()=>kTe,promise:()=>ATe,quotelessJson:()=>D3e,record:()=>CTe,set:()=>PTe,setErrorMap:()=>N3e,strictObject:()=>bTe,string:()=>yre,symbol:()=>cTe,transformer:()=>DTe,tuple:()=>STe,undefined:()=>pTe,union:()=>xTe,unknown:()=>hTe,util:()=>zr,void:()=>gTe});g();g();g();g();g();var zr;(function(e){e.assertEqual=i=>{};function t(i){}o(t,"assertIs"),e.assertIs=t;function r(i){throw new Error}o(r,"assertNever"),e.assertNever=r,e.arrayToEnum=i=>{let s={};for(let l of i)s[l]=l;return s},e.getValidEnumValues=i=>{let s=e.objectKeys(i).filter(c=>typeof i[i[c]]!="number"),l={};for(let c of s)l[c]=i[c];return e.objectValues(l)},e.objectValues=i=>e.objectKeys(i).map(function(s){return i[s]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let l in i)Object.prototype.hasOwnProperty.call(i,l)&&s.push(l);return s},e.find=(i,s)=>{for(let l of i)if(s(l))return l},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(l=>typeof l=="string"?"'".concat(l,"'"):l).join(s)}o(n,"joinValues"),e.joinValues=n,e.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(zr||(zr={}));var $9;(function(e){e.mergeShapes=(t,r)=>k(k({},t),r)})($9||($9={}));var at=zr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),yp=o(e=>{switch(typeof e){case"undefined":return at.undefined;case"string":return at.string;case"number":return Number.isNaN(e)?at.nan:at.number;case"boolean":return at.boolean;case"function":return at.function;case"bigint":return at.bigint;case"symbol":return at.symbol;case"object":return Array.isArray(e)?at.array:e===null?at.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?at.promise:typeof Map<"u"&&e instanceof Map?at.map:typeof Set<"u"&&e instanceof Set?at.set:typeof Date<"u"&&e instanceof Date?at.date:at.object;default:return at.unknown}},"getParsedType");var qe=zr.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),D3e=o(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),o3=class o3 extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(s){return s.message},n={_errors:[]},i=o(s=>{for(let l of s.issues)if(l.code==="invalid_union")l.unionErrors.map(i);else if(l.code==="invalid_return_type")i(l.returnTypeError);else if(l.code==="invalid_arguments")i(l.argumentsError);else if(l.path.length===0)n._errors.push(r(l));else{let c=n,p=0;for(;p<l.path.length;){let h=l.path[p];p===l.path.length-1?(c[h]=c[h]||{_errors:[]},c[h]._errors.push(r(l))):c[h]=c[h]||{_errors:[]},c=c[h],p++}}},"processError");return i(this),n}static assert(t){if(!(t instanceof o3))throw new Error("Not a ZodError: ".concat(t))}toString(){return this.message}get message(){return JSON.stringify(this.issues,zr.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};o(o3,"ZodError");var Ga=o3;Ga.create=e=>new Ga(e);var F3e=o((e,t)=>{let r;switch(e.code){case qe.invalid_type:e.received===at.undefined?r="Required":r="Expected ".concat(e.expected,", received ").concat(e.received);break;case qe.invalid_literal:r="Invalid literal value, expected ".concat(JSON.stringify(e.expected,zr.jsonStringifyReplacer));break;case qe.unrecognized_keys:r="Unrecognized key(s) in object: ".concat(zr.joinValues(e.keys,", "));break;case qe.invalid_union:r="Invalid input";break;case qe.invalid_union_discriminator:r="Invalid discriminator value. Expected ".concat(zr.joinValues(e.options));break;case qe.invalid_enum_value:r="Invalid enum value. Expected ".concat(zr.joinValues(e.options),", received '").concat(e.received,"'");break;case qe.invalid_arguments:r="Invalid function arguments";break;case qe.invalid_return_type:r="Invalid function return type";break;case qe.invalid_date:r="Invalid date";break;case qe.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r='Invalid input: must include "'.concat(e.validation.includes,'"'),typeof e.validation.position=="number"&&(r="".concat(r," at one or more positions greater than or equal to ").concat(e.validation.position))):"startsWith"in e.validation?r='Invalid input: must start with "'.concat(e.validation.startsWith,'"'):"endsWith"in e.validation?r='Invalid input: must end with "'.concat(e.validation.endsWith,'"'):zr.assertNever(e.validation):e.validation!=="regex"?r="Invalid ".concat(e.validation):r="Invalid";break;case qe.too_small:e.type==="array"?r="Array must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"more than"," ").concat(e.minimum," element(s)"):e.type==="string"?r="String must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"over"," ").concat(e.minimum," character(s)"):e.type==="number"?r="Number must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(e.minimum):e.type==="date"?r="Date must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(e.minimum))):r="Invalid input";break;case qe.too_big:e.type==="array"?r="Array must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"less than"," ").concat(e.maximum," element(s)"):e.type==="string"?r="String must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"under"," ").concat(e.maximum," character(s)"):e.type==="number"?r="Number must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):e.type==="bigint"?r="BigInt must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):e.type==="date"?r="Date must be ".concat(e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(e.maximum))):r="Invalid input";break;case qe.custom:r="Invalid input";break;case qe.invalid_intersection_types:r="Intersection results could not be merged";break;case qe.not_multiple_of:r="Number must be a multiple of ".concat(e.multipleOf);break;case qe.not_finite:r="Number must be finite";break;default:r=t.defaultError,zr.assertNever(e)}return{message:r}},"errorMap"),Gf=F3e;var ure=Gf;function N3e(e){ure=e}o(N3e,"setErrorMap");function K1(){return ure}o(K1,"getErrorMap");g();var jI=o(e=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,s=[...r,...i.path||[]],l=re(k({},i),{path:s});if(i.message!==void 0)return re(k({},i),{path:s,message:i.message});let c="",p=n.filter(h=>!!h).slice().reverse();for(let h of p)c=h(l,{data:t,defaultError:c}).message;return re(k({},i),{path:s,message:c})},"makeIssue"),k3e=[];function et(e,t){let r=K1(),n=jI({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Gf?void 0:Gf].filter(i=>!!i)});e.common.issues.push(n)}o(et,"addIssueToContext");var s3=class s3{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let i of r){if(i.status==="aborted")return Ot;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let i of r){let s=await i.key,l=await i.value;n.push({key:s,value:l})}return s3.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let i of r){let{key:s,value:l}=i;if(s.status==="aborted"||l.status==="aborted")return Ot;s.status==="dirty"&&t.dirty(),l.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof l.value<"u"||i.alwaysSet)&&(n[s.value]=l.value)}return{status:t.value,value:n}}};o(s3,"ParseStatus");var _s=s3,Ot=Object.freeze({status:"aborted"}),Fg=o(e=>({status:"dirty",value:e}),"DIRTY"),Ws=o(e=>({status:"valid",value:e}),"OK"),a3=o(e=>e.status==="aborted","isAborted"),l3=o(e=>e.status==="dirty","isDirty"),dh=o(e=>e.status==="valid","isValid"),J1=o(e=>typeof Promise<"u"&&e instanceof Promise,"isAsync");g();g();g();var gt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(gt||(gt={}));var U9=class U9{constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};o(U9,"ParseInputLazyPath");var iu=U9,cre=o((e,t)=>{if(dh(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Ga(e.common.issues);return this._error=r,this._error}}},"handleResult");function Vt(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:o((l,c)=>{var h,y;let{message:p}=e;return l.code==="invalid_enum_value"?{message:p!=null?p:c.defaultError}:typeof c.data>"u"?{message:(h=p!=null?p:n)!=null?h:c.defaultError}:l.code!=="invalid_type"?{message:c.defaultError}:{message:(y=p!=null?p:r)!=null?y:c.defaultError}},"customMap"),description:i}}o(Vt,"processCreateParams");var V9=class V9{get description(){return this._def.description}_getType(t){return yp(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:yp(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new _s,ctx:{common:t.parent.common,data:t.data,parsedType:yp(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(J1(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var s;let n={common:{issues:[],async:(s=r==null?void 0:r.async)!=null?s:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:yp(t)},i=this._parseSync({data:t,path:n.path,parent:n});return cre(n,i)}"~validate"(t){var n,i;let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:yp(t)};if(!this["~standard"].async)try{let s=this._parseSync({data:t,path:[],parent:r});return dh(s)?{value:s.value}:{issues:r.common.issues}}catch(s){(i=(n=s==null?void 0:s.message)==null?void 0:n.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(s=>dh(s)?{value:s.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:yp(t)},i=this._parse({data:t,path:n.path,parent:n}),s=await(J1(i)?i:Promise.resolve(i));return cre(n,s)}refine(t,r){let n=o(i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r,"getIssueProperties");return this._refinement((i,s)=>{let l=t(i),c=o(()=>s.addIssue(k({code:qe.custom},n(i))),"setError");return typeof Promise<"u"&&l instanceof Promise?l.then(p=>p?!0:(c(),!1)):l?!0:(c(),!1)})}refinement(t,r){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(t){return new ou({schema:this,typeName:Dt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:o(r=>this["~validate"](r),"validate")}}optional(){return nu.create(this,this._def)}nullable(){return bp.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return zf.create(this)}promise(){return gh.create(this,this._def)}or(t){return Ug.create([this,t],this._def)}and(t){return Vg.create(this,t,this._def)}transform(t){return new ou(re(k({},Vt(this._def)),{schema:this,typeName:Dt.ZodEffects,effect:{type:"transform",transform:t}}))}default(t){let r=typeof t=="function"?t:()=>t;return new Xg(re(k({},Vt(this._def)),{innerType:this,defaultValue:r,typeName:Dt.ZodDefault}))}brand(){return new HI(k({typeName:Dt.ZodBranded,type:this},Vt(this._def)))}catch(t){let r=typeof t=="function"?t:()=>t;return new Yg(re(k({},Vt(this._def)),{innerType:this,catchValue:r,typeName:Dt.ZodCatch}))}describe(t){let r=this.constructor;return new r(re(k({},this._def),{description:t}))}pipe(t){return WI.create(this,t)}readonly(){return Zg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};o(V9,"ZodType");var Xt=V9,R3e=/^c[^\s-]{8,}$/i,B3e=/^[0-9a-z]+$/,$3e=/^[0-9A-HJKMNP-TV-Z]{26}$/i,j3e=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,G3e=/^[a-z0-9_-]{21}$/i,U3e=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,V3e=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,z3e=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,q3e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",j9,H3e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,W3e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,X3e=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Y3e=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Z3e=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,K3e=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,fre="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",J3e=new RegExp("^".concat(fre,"$"));function dre(e){let t="[0-5]\\d";e.precision?t="".concat(t,"\\.\\d{").concat(e.precision,"}"):e.precision==null&&(t="".concat(t,"(\\.\\d+)?"));let r=e.precision?"+":"?";return"([01]\\d|2[0-3]):[0-5]\\d(:".concat(t,")").concat(r)}o(dre,"timeRegexSource");function Q3e(e){return new RegExp("^".concat(dre(e),"$"))}o(Q3e,"timeRegex");function hre(e){let t="".concat(fre,"T").concat(dre(e)),r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t="".concat(t,"(").concat(r.join("|"),")"),new RegExp("^".concat(t,"$"))}o(hre,"datetimeRegex");function eTe(e,t){return!!((t==="v4"||!t)&&H3e.test(e)||(t==="v6"||!t)&&X3e.test(e))}o(eTe,"isValidIP");function tTe(e,t){if(!U3e.test(e))return!1;try{let[r]=e.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&i.alg!==t)}catch(r){return!1}}o(tTe,"isValidJWT");function rTe(e,t){return!!((t==="v4"||!t)&&W3e.test(e)||(t==="v6"||!t)&&Y3e.test(e))}o(rTe,"isValidCidr");var Ng=class Ng extends Xt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==at.string){let s=this._getOrReturnCtx(t);return et(s,{code:qe.invalid_type,expected:at.string,received:s.parsedType}),Ot}let n=new _s,i;for(let s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(i=this._getOrReturnCtx(t,i),et(i,{code:qe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")t.data.length>s.value&&(i=this._getOrReturnCtx(t,i),et(i,{code:qe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let l=t.data.length>s.value,c=t.data.length<s.value;(l||c)&&(i=this._getOrReturnCtx(t,i),l?et(i,{code:qe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&et(i,{code:qe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")z3e.test(t.data)||(i=this._getOrReturnCtx(t,i),et(i,{validation:"email",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")j9||(j9=new RegExp(q3e,"u")),j9.test(t.data)||(i=this._getOrReturnCtx(t,i),et(i,{validation:"emoji",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")j3e.test(t.data)||(i=this._getOrReturnCtx(t,i),et(i,{validation:"uuid",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")G3e.test(t.data)||(i=this._getOrReturnCtx(t,i),et(i,{validation:"nanoid",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")R3e.test(t.data)||(i=this._getOrReturnCtx(t,i),et(i,{validation:"cuid",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")B3e.test(t.data)||(i=this._getOrReturnCtx(t,i),et(i,{validation:"cuid2",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")$3e.test(t.data)||(i=this._getOrReturnCtx(t,i),et(i,{validation:"ulid",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(t.data)}catch(l){i=this._getOrReturnCtx(t,i),et(i,{validation:"url",code:qe.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),et(i,{validation:"regex",code:qe.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(t,i),et(i,{code:qe.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(i=this._getOrReturnCtx(t,i),et(i,{code:qe.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(i=this._getOrReturnCtx(t,i),et(i,{code:qe.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?hre(s).test(t.data)||(i=this._getOrReturnCtx(t,i),et(i,{code:qe.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?J3e.test(t.data)||(i=this._getOrReturnCtx(t,i),et(i,{code:qe.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?Q3e(s).test(t.data)||(i=this._getOrReturnCtx(t,i),et(i,{code:qe.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?V3e.test(t.data)||(i=this._getOrReturnCtx(t,i),et(i,{validation:"duration",code:qe.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?eTe(t.data,s.version)||(i=this._getOrReturnCtx(t,i),et(i,{validation:"ip",code:qe.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?tTe(t.data,s.alg)||(i=this._getOrReturnCtx(t,i),et(i,{validation:"jwt",code:qe.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?rTe(t.data,s.version)||(i=this._getOrReturnCtx(t,i),et(i,{validation:"cidr",code:qe.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?Z3e.test(t.data)||(i=this._getOrReturnCtx(t,i),et(i,{validation:"base64",code:qe.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?K3e.test(t.data)||(i=this._getOrReturnCtx(t,i),et(i,{validation:"base64url",code:qe.invalid_string,message:s.message}),n.dirty()):zr.assertNever(s);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(i=>t.test(i),k({validation:r,code:qe.invalid_string},gt.errToObj(n)))}_addCheck(t){return new Ng(re(k({},this._def),{checks:[...this._def.checks,t]}))}email(t){return this._addCheck(k({kind:"email"},gt.errToObj(t)))}url(t){return this._addCheck(k({kind:"url"},gt.errToObj(t)))}emoji(t){return this._addCheck(k({kind:"emoji"},gt.errToObj(t)))}uuid(t){return this._addCheck(k({kind:"uuid"},gt.errToObj(t)))}nanoid(t){return this._addCheck(k({kind:"nanoid"},gt.errToObj(t)))}cuid(t){return this._addCheck(k({kind:"cuid"},gt.errToObj(t)))}cuid2(t){return this._addCheck(k({kind:"cuid2"},gt.errToObj(t)))}ulid(t){return this._addCheck(k({kind:"ulid"},gt.errToObj(t)))}base64(t){return this._addCheck(k({kind:"base64"},gt.errToObj(t)))}base64url(t){return this._addCheck(k({kind:"base64url"},gt.errToObj(t)))}jwt(t){return this._addCheck(k({kind:"jwt"},gt.errToObj(t)))}ip(t){return this._addCheck(k({kind:"ip"},gt.errToObj(t)))}cidr(t){return this._addCheck(k({kind:"cidr"},gt.errToObj(t)))}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck(k({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!=null?r:!1,local:(n=t==null?void 0:t.local)!=null?n:!1},gt.errToObj(t==null?void 0:t.message)))}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck(k({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision},gt.errToObj(t==null?void 0:t.message)))}duration(t){return this._addCheck(k({kind:"duration"},gt.errToObj(t)))}regex(t,r){return this._addCheck(k({kind:"regex",regex:t},gt.errToObj(r)))}includes(t,r){return this._addCheck(k({kind:"includes",value:t,position:r==null?void 0:r.position},gt.errToObj(r==null?void 0:r.message)))}startsWith(t,r){return this._addCheck(k({kind:"startsWith",value:t},gt.errToObj(r)))}endsWith(t,r){return this._addCheck(k({kind:"endsWith",value:t},gt.errToObj(r)))}min(t,r){return this._addCheck(k({kind:"min",value:t},gt.errToObj(r)))}max(t,r){return this._addCheck(k({kind:"max",value:t},gt.errToObj(r)))}length(t,r){return this._addCheck(k({kind:"length",value:t},gt.errToObj(r)))}nonempty(t){return this.min(1,gt.errToObj(t))}trim(){return new Ng(re(k({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new Ng(re(k({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new Ng(re(k({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};o(Ng,"ZodString");var hh=Ng;hh.create=e=>{var t;return new hh(k({checks:[],typeName:Dt.ZodString,coerce:(t=e==null?void 0:e.coerce)!=null?t:!1},Vt(e)))};function nTe(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,s=Number.parseInt(e.toFixed(i).replace(".","")),l=Number.parseInt(t.toFixed(i).replace(".",""));return s%l/10**i}o(nTe,"floatSafeRemainder");var GI=class GI extends Xt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==at.number){let s=this._getOrReturnCtx(t);return et(s,{code:qe.invalid_type,expected:at.number,received:s.parsedType}),Ot}let n,i=new _s;for(let s of this._def.checks)s.kind==="int"?zr.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),et(n,{code:qe.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),et(n,{code:qe.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),et(n,{code:qe.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?nTe(t.data,s.value)!==0&&(n=this._getOrReturnCtx(t,n),et(n,{code:qe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),et(n,{code:qe.not_finite,message:s.message}),i.dirty()):zr.assertNever(s);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,gt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,gt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,gt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,gt.toString(r))}setLimit(t,r,n,i){return new GI(re(k({},this._def),{checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:gt.toString(i)}]}))}_addCheck(t){return new GI(re(k({},this._def),{checks:[...this._def.checks,t]}))}int(t){return this._addCheck({kind:"int",message:gt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:gt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:gt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:gt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:gt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:gt.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:gt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:gt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:gt.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&zr.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};o(GI,"ZodNumber");var kg=GI;kg.create=e=>new kg(k({checks:[],typeName:Dt.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1},Vt(e)));var UI=class UI extends Xt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch(s){return this._getInvalidInput(t)}if(this._getType(t)!==at.bigint)return this._getInvalidInput(t);let n,i=new _s;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),et(n,{code:qe.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),et(n,{code:qe.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),et(n,{code:qe.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):zr.assertNever(s);return{status:i.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return et(r,{code:qe.invalid_type,expected:at.bigint,received:r.parsedType}),Ot}gte(t,r){return this.setLimit("min",t,!0,gt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,gt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,gt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,gt.toString(r))}setLimit(t,r,n,i){return new UI(re(k({},this._def),{checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:gt.toString(i)}]}))}_addCheck(t){return new UI(re(k({},this._def),{checks:[...this._def.checks,t]}))}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:gt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:gt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:gt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:gt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:gt.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};o(UI,"ZodBigInt");var Rg=UI;Rg.create=e=>{var t;return new Rg(k({checks:[],typeName:Dt.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!=null?t:!1},Vt(e)))};var z9=class z9 extends Xt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==at.boolean){let n=this._getOrReturnCtx(t);return et(n,{code:qe.invalid_type,expected:at.boolean,received:n.parsedType}),Ot}return Ws(t.data)}};o(z9,"ZodBoolean");var Bg=z9;Bg.create=e=>new Bg(k({typeName:Dt.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1},Vt(e)));var f3=class f3 extends Xt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==at.date){let s=this._getOrReturnCtx(t);return et(s,{code:qe.invalid_type,expected:at.date,received:s.parsedType}),Ot}if(Number.isNaN(t.data.getTime())){let s=this._getOrReturnCtx(t);return et(s,{code:qe.invalid_date}),Ot}let n=new _s,i;for(let s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(i=this._getOrReturnCtx(t,i),et(i,{code:qe.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(i=this._getOrReturnCtx(t,i),et(i,{code:qe.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):zr.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new f3(re(k({},this._def),{checks:[...this._def.checks,t]}))}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:gt.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:gt.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};o(f3,"ZodDate");var $g=f3;$g.create=e=>new $g(k({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Dt.ZodDate},Vt(e)));var q9=class q9 extends Xt{_parse(t){if(this._getType(t)!==at.symbol){let n=this._getOrReturnCtx(t);return et(n,{code:qe.invalid_type,expected:at.symbol,received:n.parsedType}),Ot}return Ws(t.data)}};o(q9,"ZodSymbol");var rv=q9;rv.create=e=>new rv(k({typeName:Dt.ZodSymbol},Vt(e)));var H9=class H9 extends Xt{_parse(t){if(this._getType(t)!==at.undefined){let n=this._getOrReturnCtx(t);return et(n,{code:qe.invalid_type,expected:at.undefined,received:n.parsedType}),Ot}return Ws(t.data)}};o(H9,"ZodUndefined");var jg=H9;jg.create=e=>new jg(k({typeName:Dt.ZodUndefined},Vt(e)));var W9=class W9 extends Xt{_parse(t){if(this._getType(t)!==at.null){let n=this._getOrReturnCtx(t);return et(n,{code:qe.invalid_type,expected:at.null,received:n.parsedType}),Ot}return Ws(t.data)}};o(W9,"ZodNull");var Gg=W9;Gg.create=e=>new Gg(k({typeName:Dt.ZodNull},Vt(e)));var X9=class X9 extends Xt{constructor(){super(...arguments),this._any=!0}_parse(t){return Ws(t.data)}};o(X9,"ZodAny");var mh=X9;mh.create=e=>new mh(k({typeName:Dt.ZodAny},Vt(e)));var Y9=class Y9 extends Xt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ws(t.data)}};o(Y9,"ZodUnknown");var Vf=Y9;Vf.create=e=>new Vf(k({typeName:Dt.ZodUnknown},Vt(e)));var Z9=class Z9 extends Xt{_parse(t){let r=this._getOrReturnCtx(t);return et(r,{code:qe.invalid_type,expected:at.never,received:r.parsedType}),Ot}};o(Z9,"ZodNever");var Qu=Z9;Qu.create=e=>new Qu(k({typeName:Dt.ZodNever},Vt(e)));var K9=class K9 extends Xt{_parse(t){if(this._getType(t)!==at.undefined){let n=this._getOrReturnCtx(t);return et(n,{code:qe.invalid_type,expected:at.void,received:n.parsedType}),Ot}return Ws(t.data)}};o(K9,"ZodVoid");var nv=K9;nv.create=e=>new nv(k({typeName:Dt.ZodVoid},Vt(e)));var ev=class ev extends Xt{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==at.array)return et(r,{code:qe.invalid_type,expected:at.array,received:r.parsedType}),Ot;if(i.exactLength!==null){let l=r.data.length>i.exactLength.value,c=r.data.length<i.exactLength.value;(l||c)&&(et(r,{code:l?qe.too_big:qe.too_small,minimum:c?i.exactLength.value:void 0,maximum:l?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(et(r,{code:qe.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(et(r,{code:qe.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((l,c)=>i.type._parseAsync(new iu(r,l,r.path,c)))).then(l=>_s.mergeArray(n,l));let s=[...r.data].map((l,c)=>i.type._parseSync(new iu(r,l,r.path,c)));return _s.mergeArray(n,s)}get element(){return this._def.type}min(t,r){return new ev(re(k({},this._def),{minLength:{value:t,message:gt.toString(r)}}))}max(t,r){return new ev(re(k({},this._def),{maxLength:{value:t,message:gt.toString(r)}}))}length(t,r){return new ev(re(k({},this._def),{exactLength:{value:t,message:gt.toString(r)}}))}nonempty(t){return this.min(1,t)}};o(ev,"ZodArray");var zf=ev;zf.create=(e,t)=>new zf(k({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Dt.ZodArray},Vt(t)));function Q1(e){if(e instanceof Ua){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=nu.create(Q1(n))}return new Ua(re(k({},e._def),{shape:o(()=>t,"shape")}))}else return e instanceof zf?new zf(re(k({},e._def),{type:Q1(e.element)})):e instanceof nu?nu.create(Q1(e.unwrap())):e instanceof bp?bp.create(Q1(e.unwrap())):e instanceof vp?vp.create(e.items.map(t=>Q1(t))):e}o(Q1,"deepPartialify");var ml=class ml extends Xt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=zr.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==at.object){let h=this._getOrReturnCtx(t);return et(h,{code:qe.invalid_type,expected:at.object,received:h.parsedType}),Ot}let{status:n,ctx:i}=this._processInputParams(t),{shape:s,keys:l}=this._getCached(),c=[];if(!(this._def.catchall instanceof Qu&&this._def.unknownKeys==="strip"))for(let h in i.data)l.includes(h)||c.push(h);let p=[];for(let h of l){let y=s[h],b=i.data[h];p.push({key:{status:"valid",value:h},value:y._parse(new iu(i,b,i.path,h)),alwaysSet:h in i.data})}if(this._def.catchall instanceof Qu){let h=this._def.unknownKeys;if(h==="passthrough")for(let y of c)p.push({key:{status:"valid",value:y},value:{status:"valid",value:i.data[y]}});else if(h==="strict")c.length>0&&(et(i,{code:qe.unrecognized_keys,keys:c}),n.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let h=this._def.catchall;for(let y of c){let b=i.data[y];p.push({key:{status:"valid",value:y},value:h._parse(new iu(i,b,i.path,y)),alwaysSet:y in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let h=[];for(let y of p){let b=await y.key,_=await y.value;h.push({key:b,value:_,alwaysSet:y.alwaysSet})}return h}).then(h=>_s.mergeObjectSync(n,h)):_s.mergeObjectSync(n,p)}get shape(){return this._def.shape()}strict(t){return gt.errToObj,new ml(k(re(k({},this._def),{unknownKeys:"strict"}),t!==void 0?{errorMap:o((r,n)=>{var s,l,c,p;let i=(c=(l=(s=this._def).errorMap)==null?void 0:l.call(s,r,n).message)!=null?c:n.defaultError;return r.code==="unrecognized_keys"?{message:(p=gt.errToObj(t).message)!=null?p:i}:{message:i}},"errorMap")}:{}))}strip(){return new ml(re(k({},this._def),{unknownKeys:"strip"}))}passthrough(){return new ml(re(k({},this._def),{unknownKeys:"passthrough"}))}extend(t){return new ml(re(k({},this._def),{shape:o(()=>k(k({},this._def.shape()),t),"shape")}))}merge(t){return new ml({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:o(()=>k(k({},this._def.shape()),t._def.shape()),"shape"),typeName:Dt.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new ml(re(k({},this._def),{catchall:t}))}pick(t){let r={};for(let n of zr.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new ml(re(k({},this._def),{shape:o(()=>r,"shape")}))}omit(t){let r={};for(let n of zr.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new ml(re(k({},this._def),{shape:o(()=>r,"shape")}))}deepPartial(){return Q1(this)}partial(t){let r={};for(let n of zr.objectKeys(this.shape)){let i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}return new ml(re(k({},this._def),{shape:o(()=>r,"shape")}))}required(t){let r={};for(let n of zr.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof nu;)s=s._def.innerType;r[n]=s}return new ml(re(k({},this._def),{shape:o(()=>r,"shape")}))}keyof(){return mre(zr.objectKeys(this.shape))}};o(ml,"ZodObject");var Ua=ml;Ua.create=(e,t)=>new Ua(k({shape:o(()=>e,"shape"),unknownKeys:"strip",catchall:Qu.create(),typeName:Dt.ZodObject},Vt(t)));Ua.strictCreate=(e,t)=>new Ua(k({shape:o(()=>e,"shape"),unknownKeys:"strict",catchall:Qu.create(),typeName:Dt.ZodObject},Vt(t)));Ua.lazycreate=(e,t)=>new Ua(k({shape:e,unknownKeys:"strip",catchall:Qu.create(),typeName:Dt.ZodObject},Vt(t)));var J9=class J9 extends Xt{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function i(s){for(let c of s)if(c.result.status==="valid")return c.result;for(let c of s)if(c.result.status==="dirty")return r.common.issues.push(...c.ctx.common.issues),c.result;let l=s.map(c=>new Ga(c.ctx.common.issues));return et(r,{code:qe.invalid_union,unionErrors:l}),Ot}if(o(i,"handleResults"),r.common.async)return Promise.all(n.map(async s=>{let l=re(k({},r),{common:re(k({},r.common),{issues:[]}),parent:null});return{result:await s._parseAsync({data:r.data,path:r.path,parent:l}),ctx:l}})).then(i);{let s,l=[];for(let p of n){let h=re(k({},r),{common:re(k({},r.common),{issues:[]}),parent:null}),y=p._parseSync({data:r.data,path:r.path,parent:h});if(y.status==="valid")return y;y.status==="dirty"&&!s&&(s={result:y,ctx:h}),h.common.issues.length&&l.push(h.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let c=l.map(p=>new Ga(p));return et(r,{code:qe.invalid_union,unionErrors:c}),Ot}}get options(){return this._def.options}};o(J9,"ZodUnion");var Ug=J9;Ug.create=(e,t)=>new Ug(k({options:e,typeName:Dt.ZodUnion},Vt(t)));var Uf=o(e=>e instanceof zg?Uf(e.schema):e instanceof ou?Uf(e.innerType()):e instanceof qg?[e.value]:e instanceof Hg?e.options:e instanceof Wg?zr.objectValues(e.enum):e instanceof Xg?Uf(e._def.innerType):e instanceof jg?[void 0]:e instanceof Gg?[null]:e instanceof nu?[void 0,...Uf(e.unwrap())]:e instanceof bp?[null,...Uf(e.unwrap())]:e instanceof HI||e instanceof Zg?Uf(e.unwrap()):e instanceof Yg?Uf(e._def.innerType):[],"getDiscriminator"),d3=class d3 extends Xt{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==at.object)return et(r,{code:qe.invalid_type,expected:at.object,received:r.parsedType}),Ot;let n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(et(r,{code:qe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ot)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let i=new Map;for(let s of r){let l=Uf(s.shape[t]);if(!l.length)throw new Error("A discriminator value for key `".concat(t,"` could not be extracted from all schema options"));for(let c of l){if(i.has(c))throw new Error("Discriminator property ".concat(String(t)," has duplicate value ").concat(String(c)));i.set(c,s)}}return new d3(k({typeName:Dt.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i},Vt(n)))}};o(d3,"ZodDiscriminatedUnion");var u3=d3;function G9(e,t){let r=yp(e),n=yp(t);if(e===t)return{valid:!0,data:e};if(r===at.object&&n===at.object){let i=zr.objectKeys(t),s=zr.objectKeys(e).filter(c=>i.indexOf(c)!==-1),l=k(k({},e),t);for(let c of s){let p=G9(e[c],t[c]);if(!p.valid)return{valid:!1};l[c]=p.data}return{valid:!0,data:l}}else if(r===at.array&&n===at.array){if(e.length!==t.length)return{valid:!1};let i=[];for(let s=0;s<e.length;s++){let l=e[s],c=t[s],p=G9(l,c);if(!p.valid)return{valid:!1};i.push(p.data)}return{valid:!0,data:i}}else return r===at.date&&n===at.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}o(G9,"mergeValues");var Q9=class Q9 extends Xt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=o((s,l)=>{if(a3(s)||a3(l))return Ot;let c=G9(s.value,l.value);return c.valid?((l3(s)||l3(l))&&r.dirty(),{status:r.value,value:c.data}):(et(n,{code:qe.invalid_intersection_types}),Ot)},"handleParsed");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,l])=>i(s,l)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};o(Q9,"ZodIntersection");var Vg=Q9;Vg.create=(e,t,r)=>new Vg(k({left:e,right:t,typeName:Dt.ZodIntersection},Vt(r)));var h3=class h3 extends Xt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==at.array)return et(n,{code:qe.invalid_type,expected:at.array,received:n.parsedType}),Ot;if(n.data.length<this._def.items.length)return et(n,{code:qe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ot;!this._def.rest&&n.data.length>this._def.items.length&&(et(n,{code:qe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((l,c)=>{let p=this._def.items[c]||this._def.rest;return p?p._parse(new iu(n,l,n.path,c)):null}).filter(l=>!!l);return n.common.async?Promise.all(s).then(l=>_s.mergeArray(r,l)):_s.mergeArray(r,s)}get items(){return this._def.items}rest(t){return new h3(re(k({},this._def),{rest:t}))}};o(h3,"ZodTuple");var vp=h3;vp.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new vp(k({items:e,typeName:Dt.ZodTuple,rest:null},Vt(t)))};var VI=class VI extends Xt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==at.object)return et(n,{code:qe.invalid_type,expected:at.object,received:n.parsedType}),Ot;let i=[],s=this._def.keyType,l=this._def.valueType;for(let c in n.data)i.push({key:s._parse(new iu(n,c,n.path,c)),value:l._parse(new iu(n,n.data[c],n.path,c)),alwaysSet:c in n.data});return n.common.async?_s.mergeObjectAsync(r,i):_s.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Xt?new VI(k({keyType:t,valueType:r,typeName:Dt.ZodRecord},Vt(n))):new VI(k({keyType:hh.create(),valueType:t,typeName:Dt.ZodRecord},Vt(r)))}};o(VI,"ZodRecord");var c3=VI,e7=class e7 extends Xt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==at.map)return et(n,{code:qe.invalid_type,expected:at.map,received:n.parsedType}),Ot;let i=this._def.keyType,s=this._def.valueType,l=[...n.data.entries()].map(([c,p],h)=>({key:i._parse(new iu(n,c,n.path,[h,"key"])),value:s._parse(new iu(n,p,n.path,[h,"value"]))}));if(n.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let p of l){let h=await p.key,y=await p.value;if(h.status==="aborted"||y.status==="aborted")return Ot;(h.status==="dirty"||y.status==="dirty")&&r.dirty(),c.set(h.value,y.value)}return{status:r.value,value:c}})}else{let c=new Map;for(let p of l){let h=p.key,y=p.value;if(h.status==="aborted"||y.status==="aborted")return Ot;(h.status==="dirty"||y.status==="dirty")&&r.dirty(),c.set(h.value,y.value)}return{status:r.value,value:c}}}};o(e7,"ZodMap");var iv=e7;iv.create=(e,t,r)=>new iv(k({valueType:t,keyType:e,typeName:Dt.ZodMap},Vt(r)));var zI=class zI extends Xt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==at.set)return et(n,{code:qe.invalid_type,expected:at.set,received:n.parsedType}),Ot;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(et(n,{code:qe.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(et(n,{code:qe.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let s=this._def.valueType;function l(p){let h=new Set;for(let y of p){if(y.status==="aborted")return Ot;y.status==="dirty"&&r.dirty(),h.add(y.value)}return{status:r.value,value:h}}o(l,"finalizeSet");let c=[...n.data.values()].map((p,h)=>s._parse(new iu(n,p,n.path,h)));return n.common.async?Promise.all(c).then(p=>l(p)):l(c)}min(t,r){return new zI(re(k({},this._def),{minSize:{value:t,message:gt.toString(r)}}))}max(t,r){return new zI(re(k({},this._def),{maxSize:{value:t,message:gt.toString(r)}}))}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};o(zI,"ZodSet");var ov=zI;ov.create=(e,t)=>new ov(k({valueType:e,minSize:null,maxSize:null,typeName:Dt.ZodSet},Vt(t)));var tv=class tv extends Xt{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==at.function)return et(r,{code:qe.invalid_type,expected:at.function,received:r.parsedType}),Ot;function n(c,p){return jI({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,K1(),Gf].filter(h=>!!h),issueData:{code:qe.invalid_arguments,argumentsError:p}})}o(n,"makeArgsIssue");function i(c,p){return jI({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,K1(),Gf].filter(h=>!!h),issueData:{code:qe.invalid_return_type,returnTypeError:p}})}o(i,"makeReturnsIssue");let s={errorMap:r.common.contextualErrorMap},l=r.data;if(this._def.returns instanceof gh){let c=this;return Ws(async function(...p){let h=new Ga([]),y=await c._def.args.parseAsync(p,s).catch(C=>{throw h.addIssue(n(p,C)),h}),b=await Reflect.apply(l,this,y);return await c._def.returns._def.type.parseAsync(b,s).catch(C=>{throw h.addIssue(i(b,C)),h})})}else{let c=this;return Ws(function(...p){let h=c._def.args.safeParse(p,s);if(!h.success)throw new Ga([n(p,h.error)]);let y=Reflect.apply(l,this,h.data),b=c._def.returns.safeParse(y,s);if(!b.success)throw new Ga([i(y,b.error)]);return b.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new tv(re(k({},this._def),{args:vp.create(t).rest(Vf.create())}))}returns(t){return new tv(re(k({},this._def),{returns:t}))}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new tv(k({args:t||vp.create([]).rest(Vf.create()),returns:r||Vf.create(),typeName:Dt.ZodFunction},Vt(n)))}};o(tv,"ZodFunction");var p3=tv,t7=class t7 extends Xt{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};o(t7,"ZodLazy");var zg=t7;zg.create=(e,t)=>new zg(k({getter:e,typeName:Dt.ZodLazy},Vt(t)));var r7=class r7 extends Xt{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return et(r,{received:r.data,code:qe.invalid_literal,expected:this._def.value}),Ot}return{status:"valid",value:t.data}}get value(){return this._def.value}};o(r7,"ZodLiteral");var qg=r7;qg.create=(e,t)=>new qg(k({value:e,typeName:Dt.ZodLiteral},Vt(t)));function mre(e,t){return new Hg(k({values:e,typeName:Dt.ZodEnum},Vt(t)))}o(mre,"createZodEnum");var qI=class qI extends Xt{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return et(r,{expected:zr.joinValues(n),received:r.parsedType,code:qe.invalid_type}),Ot}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return et(r,{received:r.data,code:qe.invalid_enum_value,options:n}),Ot}return Ws(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return qI.create(t,k(k({},this._def),r))}exclude(t,r=this._def){return qI.create(this.options.filter(n=>!t.includes(n)),k(k({},this._def),r))}};o(qI,"ZodEnum");var Hg=qI;Hg.create=mre;var n7=class n7 extends Xt{_parse(t){let r=zr.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==at.string&&n.parsedType!==at.number){let i=zr.objectValues(r);return et(n,{expected:zr.joinValues(i),received:n.parsedType,code:qe.invalid_type}),Ot}if(this._cache||(this._cache=new Set(zr.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let i=zr.objectValues(r);return et(n,{received:n.data,code:qe.invalid_enum_value,options:i}),Ot}return Ws(t.data)}get enum(){return this._def.values}};o(n7,"ZodNativeEnum");var Wg=n7;Wg.create=(e,t)=>new Wg(k({values:e,typeName:Dt.ZodNativeEnum},Vt(t)));var i7=class i7 extends Xt{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==at.promise&&r.common.async===!1)return et(r,{code:qe.invalid_type,expected:at.promise,received:r.parsedType}),Ot;let n=r.parsedType===at.promise?r.data:Promise.resolve(r.data);return Ws(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};o(i7,"ZodPromise");var gh=i7;gh.create=(e,t)=>new gh(k({type:e,typeName:Dt.ZodPromise},Vt(t)));var o7=class o7 extends Xt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Dt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,s={addIssue:o(l=>{et(n,l),l.fatal?r.abort():r.dirty()},"addIssue"),get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let l=i.transform(n.data,s);if(n.common.async)return Promise.resolve(l).then(async c=>{if(r.value==="aborted")return Ot;let p=await this._def.schema._parseAsync({data:c,path:n.path,parent:n});return p.status==="aborted"?Ot:p.status==="dirty"?Fg(p.value):r.value==="dirty"?Fg(p.value):p});{if(r.value==="aborted")return Ot;let c=this._def.schema._parseSync({data:l,path:n.path,parent:n});return c.status==="aborted"?Ot:c.status==="dirty"?Fg(c.value):r.value==="dirty"?Fg(c.value):c}}if(i.type==="refinement"){let l=o(c=>{let p=i.refinement(c,s);if(n.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c},"executeRefinement");if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return c.status==="aborted"?Ot:(c.status==="dirty"&&r.dirty(),l(c.value),{status:r.value,value:c.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>c.status==="aborted"?Ot:(c.status==="dirty"&&r.dirty(),l(c.value).then(()=>({status:r.value,value:c.value}))))}if(i.type==="transform")if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!dh(l))return Ot;let c=i.transform(l.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:c}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>dh(l)?Promise.resolve(i.transform(l.value,s)).then(c=>({status:r.value,value:c})):Ot);zr.assertNever(i)}};o(o7,"ZodEffects");var ou=o7;ou.create=(e,t,r)=>new ou(k({schema:e,typeName:Dt.ZodEffects,effect:t},Vt(r)));ou.createWithPreprocess=(e,t,r)=>new ou(k({schema:t,effect:{type:"preprocess",transform:e},typeName:Dt.ZodEffects},Vt(r)));var s7=class s7 extends Xt{_parse(t){return this._getType(t)===at.undefined?Ws(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};o(s7,"ZodOptional");var nu=s7;nu.create=(e,t)=>new nu(k({innerType:e,typeName:Dt.ZodOptional},Vt(t)));var a7=class a7 extends Xt{_parse(t){return this._getType(t)===at.null?Ws(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};o(a7,"ZodNullable");var bp=a7;bp.create=(e,t)=>new bp(k({innerType:e,typeName:Dt.ZodNullable},Vt(t)));var l7=class l7 extends Xt{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===at.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};o(l7,"ZodDefault");var Xg=l7;Xg.create=(e,t)=>new Xg(k({innerType:e,typeName:Dt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default},Vt(t)));var u7=class u7 extends Xt{_parse(t){let{ctx:r}=this._processInputParams(t),n=re(k({},r),{common:re(k({},r.common),{issues:[]})}),i=this._def.innerType._parse({data:n.data,path:n.path,parent:k({},n)});return J1(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ga(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ga(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};o(u7,"ZodCatch");var Yg=u7;Yg.create=(e,t)=>new Yg(k({innerType:e,typeName:Dt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch},Vt(t)));var c7=class c7 extends Xt{_parse(t){if(this._getType(t)!==at.nan){let n=this._getOrReturnCtx(t);return et(n,{code:qe.invalid_type,expected:at.nan,received:n.parsedType}),Ot}return{status:"valid",value:t.data}}};o(c7,"ZodNaN");var sv=c7;sv.create=e=>new sv(k({typeName:Dt.ZodNaN},Vt(e)));var iTe=Symbol("zod_brand"),p7=class p7 extends Xt{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}};o(p7,"ZodBranded");var HI=p7,m3=class m3 extends Xt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return o(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Ot:s.status==="dirty"?(r.dirty(),Fg(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})},"handleAsync")();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Ot:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(t,r){return new m3({in:t,out:r,typeName:Dt.ZodPipeline})}};o(m3,"ZodPipeline");var WI=m3,f7=class f7 extends Xt{_parse(t){let r=this._def.innerType._parse(t),n=o(i=>(dh(i)&&(i.value=Object.freeze(i.value)),i),"freeze");return J1(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};o(f7,"ZodReadonly");var Zg=f7;Zg.create=(e,t)=>new Zg(k({innerType:e,typeName:Dt.ZodReadonly},Vt(t)));function pre(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}o(pre,"cleanParams");function gre(e,t={},r){return e?mh.create().superRefine((n,i)=>{var l,c;let s=e(n);if(s instanceof Promise)return s.then(p=>{var h,y;if(!p){let b=pre(t,n),_=(y=(h=b.fatal)!=null?h:r)!=null?y:!0;i.addIssue(re(k({code:"custom"},b),{fatal:_}))}});if(!s){let p=pre(t,n),h=(c=(l=p.fatal)!=null?l:r)!=null?c:!0;i.addIssue(re(k({code:"custom"},p),{fatal:h}))}}):mh.create()}o(gre,"custom");var oTe={object:Ua.lazycreate},Dt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Dt||(Dt={}));var sTe=o((e,t={message:"Input not instance of ".concat(e.name)})=>gre(r=>r instanceof e,t),"instanceOfType"),yre=hh.create,vre=kg.create,aTe=sv.create,lTe=Rg.create,bre=Bg.create,uTe=$g.create,cTe=rv.create,pTe=jg.create,fTe=Gg.create,dTe=mh.create,hTe=Vf.create,mTe=Qu.create,gTe=nv.create,yTe=zf.create,vTe=Ua.create,bTe=Ua.strictCreate,xTe=Ug.create,ITe=u3.create,_Te=Vg.create,STe=vp.create,CTe=c3.create,wTe=iv.create,PTe=ov.create,TTe=p3.create,ETe=zg.create,MTe=qg.create,OTe=Hg.create,LTe=Wg.create,ATe=gh.create,DTe=ou.create,FTe=nu.create,NTe=bp.create,kTe=ou.createWithPreprocess,RTe=WI.create,BTe=o(()=>yre().optional(),"ostring"),$Te=o(()=>vre().optional(),"onumber"),jTe=o(()=>bre().optional(),"oboolean"),GTe={string:o(e=>hh.create(re(k({},e),{coerce:!0})),"string"),number:o(e=>kg.create(re(k({},e),{coerce:!0})),"number"),boolean:o(e=>Bg.create(re(k({},e),{coerce:!0})),"boolean"),bigint:o(e=>Rg.create(re(k({},e),{coerce:!0})),"bigint"),date:o(e=>$g.create(re(k({},e),{coerce:!0})),"date")};var UTe=Ot;var xre=le;var Ss=xre;var Zre=Pn(S7());var QI=4,NMe=8,kMe="0.6",Yre="low-priority-pin",C7=le.object({rank:le.union([le.enum(["low","medium","high","always-visible"]),le.number()]).optional(),interactive:le.union([le.boolean(),le.literal("pointer-events-auto")]).optional(),id:le.string().optional(),anchor:le.union([le.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]),le.array(le.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]))]).optional(),dynamicResize:le.boolean().optional(),zIndex:le.number().optional(),lowPriorityPin:le.object({enabled:le.boolean().optional(),size:le.number().positive().optional(),color:le.string().optional()}).optional()});function Kre(e,t,r){le.array(le.number()).min(2).max(3).parse(e),le.string().parse(t),C7.parse(r)}o(Kre,"validateMarker");var RMe=Object.freeze({enabled:!0,size:NMe,color:"#666"}),ey=class ey{constructor(t,r={}){x(this,"id");x(this,"type","marker");x(this,"rank",0);x(this,"initialRank",0);x(this,"activeAnchor","center");x(this,"pointerEvents","none");x(this,"options",{rank:"low",interactive:!1,id:"",anchor:"center",dynamicResize:!1,occluderId:0,zIndex:void 0,verticalOffset:0,lowPriorityPin:k({},RMe)});x(this,"projection",new wt);x(this,"enabled",!0);x(this,"canShow",!1);x(this,"visible",!0);x(this,"isOccluded",!1);x(this,"offscreen",!1);x(this,"strategyIndex",-1);x(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});x(this,"dimensions",{width:0,height:0});x(this,"markerContainer");x(this,"containerEl");x(this,"contentEl",null);x(this,"contentHtml","");x(this,"style",{top:"0px",left:"0px"});x(this,"dirty",!1);x(this,"attachedDirty",!0);x(this,"collisionDirty",!0);x(this,"visibilityNeedsUpdate","show");x(this,"animation",null);x(this,"currentStrategyIndex",-1);x(this,"onStrategySelected",o((t,r=!1)=>{var i,s;if(this.currentStrategyIndex===t&&!r)return;if(this.currentStrategyIndex=t,t===this.lowPriorityPinStrategyIndex){this.activeAnchor="center",this.markerContainer.setAttribute("data-anchor",Yre);let l=this.options.lowPriorityPin,c=l.size,p=l.color;this.markerContainer.style.setProperty("--mappedin-pin-size","".concat(c,"px")),this.markerContainer.style.setProperty("--pin-color",p),this.markerContainer.style.opacity=kMe,this.style.top=-c/2+"px",this.style.left=-c/2+"px"}else{this.activeAnchor=(s=(i=this.strategies[t])==null?void 0:i.name)!=null?s:"center",this.markerContainer.setAttribute("data-anchor",this.activeAnchor),this.markerContainer.style.removeProperty("--mappedin-pin-size"),this.markerContainer.style.removeProperty("--pin-color"),this.markerContainer.style.opacity="1";let{width:l,height:c}=this.dimensions,p=-c/2+"px",h=-l/2+"px";switch(this.style.top=p,this.style.left=h,this.activeAnchor){case"top":{this.style.top=-c+"px";break}case"bottom":{this.style.top="0px";break}case"left":{this.style.left=-l+"px";break}case"right":{this.style.left="0px";break}case"top-left":{this.style.top=-c+"px",this.style.left=-l+"px";break}case"top-right":{this.style.top=-c+"px",this.style.left="0px";break}case"bottom-left":{this.style.top="0px",this.style.left=-l+"px";break}case"bottom-right":{this.style.top="0px",this.style.left="0px";break}default:this.style.top=p,this.style.left=h}}this.markerContainer.style.top=this.style.top,this.markerContainer.style.left=this.style.left},"onStrategySelected"));x(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],lockedToStrategyIndex:-1,shouldCollideWithScreenEdges:!1});var n,i,s;if(this.id=(r==null?void 0:r.id)||xn(),this.options=(0,Zre.default)(this.options,r),typeof r.rank=="string")this.rank=Y1(r.rank);else if(r.rank!=null&&r.rank>0)this.rank=r.rank;else{let l=Math.trunc(I.env.NODE_ENV==="test"?ey.testId:ey.testId*10)/10;ey.testId+=.001,this.rank=l}typeof r.interactive=="string"&&(this.pointerEvents=r.interactive==="pointer-events-auto"?"auto":"none"),this.contentHtml=t,this.initialRank=this.rank,this.markerContainer=document.createElement("div"),this.markerContainer.className="mappedin-marker",this.markerContainer.style.opacity="0",this.markerContainer.innerHTML='<div class="mappedin-marker-content">'.concat(this.contentHtml,"</div>"),this.markerContainer.setAttribute("data-marker-id",this.id.toString()),this.containerEl=(n=this.markerContainer.firstElementChild)!=null?n:null,this.contentEl=(s=(i=this.markerContainer.firstElementChild)==null?void 0:i.firstElementChild)!=null?s:null}updateDimensions(t,r){if(t!=null&&r!=null)this.dimensions={width:t,height:r};else{let{width:n,height:i}=this.markerContainer.getBoundingClientRect();this.dimensions={width:n,height:i}}Object.assign(this.markerContainer,{width:this.dimensions.width+"px",height:this.dimensions.height+"px"}),this.currentStrategyIndex=-1}get strategies(){var s;let{width:t,height:r}=this.dimensions;if(t===0||r===0)return[];let i=(Array.isArray(this.options.anchor)?this.options.anchor:[this.options.anchor]).map(l=>({name:l,getBoundingBox:o(()=>{let c=r/2,p=r/2,h=t/2,y=t/2;switch(l){case"top":{c=r,p=0;break}case"bottom":{c=0,p=r;break}case"left":{h=t,y=0;break}case"right":{h=0,y=t;break}case"top-left":{c=r,h=t,p=0,y=0;break}case"top-right":{c=r,y=t,p=0,h=0;break}case"bottom-left":{p=r,h=t,c=0,y=0;break}case"bottom-right":{p=r,y=t,c=0,h=0;break}}return[c+QI,p+QI,h+QI,y+QI]},"getBoundingBox")}));if((s=this.options.lowPriorityPin)!=null&&s.enabled&&this.options.rank!=="always-visible"){let l={name:Yre,getBoundingBox:o(()=>{let c=Math.max(2,QI/2);return[this.options.lowPriorityPin.size/2+c,this.options.lowPriorityPin.size/2+c,this.options.lowPriorityPin.size/2+c,this.options.lowPriorityPin.size/2+c]},"getBoundingBox")};i.push(l)}return i}toPackedMessage(t=!1){var n;this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.packedMessage.shouldCollideWithScreenEdges=!0;let r=this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityPinStrategyIndex;if(this.visible&&t&&r&&this.collisionDirty===!1?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,r&&this.currentStrategyIndex!==((n=this.packedMessage.bboxes[0])==null?void 0:n[4])){let i=this.packedMessage.bboxes.findIndex(s=>s[4]===this.currentStrategyIndex);if(i!==-1){let s=this.packedMessage.bboxes.splice(i,1)[0];this.packedMessage.bboxes.unshift(s)}}if(!this.collisionDirty)return this.packedMessage;this.packedMessage.bboxes=[];for(let i=0;i<this.strategies.length;i++){let s=this.strategies[i];i===this.currentStrategyIndex&&r?this.packedMessage.bboxes.unshift([...s.getBoundingBox(),i]):this.packedMessage.bboxes.push([...s.getBoundingBox(),i])}return this.collisionDirty=!1,this.packedMessage}get lowPriorityPinStrategyIndex(){var t;return!((t=this.options.lowPriorityPin)!=null&&t.enabled)||this.options.rank==="always-visible"?-1:Array.isArray(this.options.anchor)?this.options.anchor.length:1}destroy(){}};o(ey,"MarkerComponent"),x(ey,"testId",0);var xp=ey;g();g();g();g();g();var w7=class w7{constructor(){x(this,"hover",!1);x(this,"dirty",!1)}};o(w7,"InteractionComponent");var cv=w7;g();g();function C3(e){"@babel/helpers - typeof";return C3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C3(e)}o(C3,"_typeof");var BMe=/^\s+/,$Me=/\s+$/;function ft(e,t){if(e=e||"",t=t||{},e instanceof ft)return e;if(!(this instanceof ft))return new ft(e,t);var r=jMe(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}o(ft,"tinycolor");ft.prototype={isDark:o(function(){return this.getBrightness()<128},"isDark"),isLight:o(function(){return!this.isDark()},"isLight"),isValid:o(function(){return this._ok},"isValid"),getOriginalInput:o(function(){return this._originalInput},"getOriginalInput"),getFormat:o(function(){return this._format},"getFormat"),getAlpha:o(function(){return this._a},"getAlpha"),getBrightness:o(function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},"getBrightness"),getLuminance:o(function(){var t=this.toRgb(),r,n,i,s,l,c;return r=t.r/255,n=t.g/255,i=t.b/255,r<=.03928?s=r/12.92:s=Math.pow((r+.055)/1.055,2.4),n<=.03928?l=n/12.92:l=Math.pow((n+.055)/1.055,2.4),i<=.03928?c=i/12.92:c=Math.pow((i+.055)/1.055,2.4),.2126*s+.7152*l+.0722*c},"getLuminance"),setAlpha:o(function(t){return this._a=ine(t),this._roundA=Math.round(100*this._a)/100,this},"setAlpha"),toHsv:o(function(){var t=Qre(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},"toHsv"),toHsvString:o(function(){var t=Qre(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.v*100);return this._a==1?"hsv("+r+", "+n+"%, "+i+"%)":"hsva("+r+", "+n+"%, "+i+"%, "+this._roundA+")"},"toHsvString"),toHsl:o(function(){var t=Jre(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},"toHsl"),toHslString:o(function(){var t=Jre(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.l*100);return this._a==1?"hsl("+r+", "+n+"%, "+i+"%)":"hsla("+r+", "+n+"%, "+i+"%, "+this._roundA+")"},"toHslString"),toHex:o(function(t){return ene(this._r,this._g,this._b,t)},"toHex"),toHexString:o(function(t){return"#"+this.toHex(t)},"toHexString"),toHex8:o(function(t){return zMe(this._r,this._g,this._b,this._a,t)},"toHex8"),toHex8String:o(function(t){return"#"+this.toHex8(t)},"toHex8String"),toRgb:o(function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},"toRgb"),toRgbString:o(function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},"toRgbString"),toPercentageRgb:o(function(){return{r:Math.round(wi(this._r,255)*100)+"%",g:Math.round(wi(this._g,255)*100)+"%",b:Math.round(wi(this._b,255)*100)+"%",a:this._a}},"toPercentageRgb"),toPercentageRgbString:o(function(){return this._a==1?"rgb("+Math.round(wi(this._r,255)*100)+"%, "+Math.round(wi(this._g,255)*100)+"%, "+Math.round(wi(this._b,255)*100)+"%)":"rgba("+Math.round(wi(this._r,255)*100)+"%, "+Math.round(wi(this._g,255)*100)+"%, "+Math.round(wi(this._b,255)*100)+"%, "+this._roundA+")"},"toPercentageRgbString"),toName:o(function(){return this._a===0?"transparent":this._a<1?!1:rOe[ene(this._r,this._g,this._b,!0)]||!1},"toName"),toFilter:o(function(t){var r="#"+tne(this._r,this._g,this._b,this._a),n=r,i=this._gradientType?"GradientType = 1, ":"";if(t){var s=ft(t);n="#"+tne(s._r,s._g,s._b,s._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+r+",endColorstr="+n+")"},"toFilter"),toString:o(function(t){var r=!!t;t=t||this._format;var n=!1,i=this._a<1&&this._a>=0,s=!r&&i&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return s?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(n=this.toRgbString()),t==="prgb"&&(n=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(n=this.toHexString()),t==="hex3"&&(n=this.toHexString(!0)),t==="hex4"&&(n=this.toHex8String(!0)),t==="hex8"&&(n=this.toHex8String()),t==="name"&&(n=this.toName()),t==="hsl"&&(n=this.toHslString()),t==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},"toString"),clone:o(function(){return ft(this.toString())},"clone"),_applyModification:o(function(t,r){var n=t.apply(null,[this].concat([].slice.call(r)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},"_applyModification"),lighten:o(function(){return this._applyModification(XMe,arguments)},"lighten"),brighten:o(function(){return this._applyModification(YMe,arguments)},"brighten"),darken:o(function(){return this._applyModification(ZMe,arguments)},"darken"),desaturate:o(function(){return this._applyModification(qMe,arguments)},"desaturate"),saturate:o(function(){return this._applyModification(HMe,arguments)},"saturate"),greyscale:o(function(){return this._applyModification(WMe,arguments)},"greyscale"),spin:o(function(){return this._applyModification(KMe,arguments)},"spin"),_applyCombination:o(function(t,r){return t.apply(null,[this].concat([].slice.call(r)))},"_applyCombination"),analogous:o(function(){return this._applyCombination(eOe,arguments)},"analogous"),complement:o(function(){return this._applyCombination(JMe,arguments)},"complement"),monochromatic:o(function(){return this._applyCombination(tOe,arguments)},"monochromatic"),splitcomplement:o(function(){return this._applyCombination(QMe,arguments)},"splitcomplement"),triad:o(function(){return this._applyCombination(rne,[3])},"triad"),tetrad:o(function(){return this._applyCombination(rne,[4])},"tetrad")};ft.fromRatio=function(e,t){if(C3(e)=="object"){var r={};for(var n in e)e.hasOwnProperty(n)&&(n==="a"?r[n]=e[n]:r[n]=e2(e[n]));e=r}return ft(e,t)};function jMe(e){var t={r:0,g:0,b:0},r=1,n=null,i=null,s=null,l=!1,c=!1;return typeof e=="string"&&(e=sOe(e)),C3(e)=="object"&&(Wf(e.r)&&Wf(e.g)&&Wf(e.b)?(t=GMe(e.r,e.g,e.b),l=!0,c=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Wf(e.h)&&Wf(e.s)&&Wf(e.v)?(n=e2(e.s),i=e2(e.v),t=VMe(e.h,n,i),l=!0,c="hsv"):Wf(e.h)&&Wf(e.s)&&Wf(e.l)&&(n=e2(e.s),s=e2(e.l),t=UMe(e.h,n,s),l=!0,c="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=ine(r),{ok:l,format:e.format||c,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}o(jMe,"inputToRGB");function GMe(e,t,r){return{r:wi(e,255)*255,g:wi(t,255)*255,b:wi(r,255)*255}}o(GMe,"rgbToRgb");function Jre(e,t,r){e=wi(e,255),t=wi(t,255),r=wi(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),s,l,c=(n+i)/2;if(n==i)s=l=0;else{var p=n-i;switch(l=c>.5?p/(2-n-i):p/(n+i),n){case e:s=(t-r)/p+(t<r?6:0);break;case t:s=(r-e)/p+2;break;case r:s=(e-t)/p+4;break}s/=6}return{h:s,s:l,l:c}}o(Jre,"rgbToHsl");function UMe(e,t,r){var n,i,s;e=wi(e,360),t=wi(t,100),r=wi(r,100);function l(h,y,b){return b<0&&(b+=1),b>1&&(b-=1),b<1/6?h+(y-h)*6*b:b<1/2?y:b<2/3?h+(y-h)*(2/3-b)*6:h}if(o(l,"hue2rgb"),t===0)n=i=s=r;else{var c=r<.5?r*(1+t):r+t-r*t,p=2*r-c;n=l(p,c,e+1/3),i=l(p,c,e),s=l(p,c,e-1/3)}return{r:n*255,g:i*255,b:s*255}}o(UMe,"hslToRgb");function Qre(e,t,r){e=wi(e,255),t=wi(t,255),r=wi(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),s,l,c=n,p=n-i;if(l=n===0?0:p/n,n==i)s=0;else{switch(n){case e:s=(t-r)/p+(t<r?6:0);break;case t:s=(r-e)/p+2;break;case r:s=(e-t)/p+4;break}s/=6}return{h:s,s:l,v:c}}o(Qre,"rgbToHsv");function VMe(e,t,r){e=wi(e,360)*6,t=wi(t,100),r=wi(r,100);var n=Math.floor(e),i=e-n,s=r*(1-t),l=r*(1-i*t),c=r*(1-(1-i)*t),p=n%6,h=[r,l,s,s,c,r][p],y=[c,r,r,l,s,s][p],b=[s,s,c,r,r,l][p];return{r:h*255,g:y*255,b:b*255}}o(VMe,"hsvToRgb");function ene(e,t,r,n){var i=[tc(Math.round(e).toString(16)),tc(Math.round(t).toString(16)),tc(Math.round(r).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}o(ene,"rgbToHex");function zMe(e,t,r,n,i){var s=[tc(Math.round(e).toString(16)),tc(Math.round(t).toString(16)),tc(Math.round(r).toString(16)),tc(one(n))];return i&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}o(zMe,"rgbaToHex");function tne(e,t,r,n){var i=[tc(one(n)),tc(Math.round(e).toString(16)),tc(Math.round(t).toString(16)),tc(Math.round(r).toString(16))];return i.join("")}o(tne,"rgbaToArgbHex");ft.equals=function(e,t){return!e||!t?!1:ft(e).toRgbString()==ft(t).toRgbString()};ft.random=function(){return ft.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function qMe(e,t){t=t===0?0:t||10;var r=ft(e).toHsl();return r.s-=t/100,r.s=w3(r.s),ft(r)}o(qMe,"_desaturate");function HMe(e,t){t=t===0?0:t||10;var r=ft(e).toHsl();return r.s+=t/100,r.s=w3(r.s),ft(r)}o(HMe,"_saturate");function WMe(e){return ft(e).desaturate(100)}o(WMe,"_greyscale");function XMe(e,t){t=t===0?0:t||10;var r=ft(e).toHsl();return r.l+=t/100,r.l=w3(r.l),ft(r)}o(XMe,"_lighten");function YMe(e,t){t=t===0?0:t||10;var r=ft(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),ft(r)}o(YMe,"_brighten");function ZMe(e,t){t=t===0?0:t||10;var r=ft(e).toHsl();return r.l-=t/100,r.l=w3(r.l),ft(r)}o(ZMe,"_darken");function KMe(e,t){var r=ft(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,ft(r)}o(KMe,"_spin");function JMe(e){var t=ft(e).toHsl();return t.h=(t.h+180)%360,ft(t)}o(JMe,"_complement");function rne(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var r=ft(e).toHsl(),n=[ft(e)],i=360/t,s=1;s<t;s++)n.push(ft({h:(r.h+s*i)%360,s:r.s,l:r.l}));return n}o(rne,"polyad");function QMe(e){var t=ft(e).toHsl(),r=t.h;return[ft(e),ft({h:(r+72)%360,s:t.s,l:t.l}),ft({h:(r+216)%360,s:t.s,l:t.l})]}o(QMe,"_splitcomplement");function eOe(e,t,r){t=t||6,r=r||30;var n=ft(e).toHsl(),i=360/r,s=[ft(e)];for(n.h=(n.h-(i*t>>1)+720)%360;--t;)n.h=(n.h+i)%360,s.push(ft(n));return s}o(eOe,"_analogous");function tOe(e,t){t=t||6;for(var r=ft(e).toHsv(),n=r.h,i=r.s,s=r.v,l=[],c=1/t;t--;)l.push(ft({h:n,s:i,v:s})),s=(s+c)%1;return l}o(tOe,"_monochromatic");ft.mix=function(e,t,r){r=r===0?0:r||50;var n=ft(e).toRgb(),i=ft(t).toRgb(),s=r/100,l={r:(i.r-n.r)*s+n.r,g:(i.g-n.g)*s+n.g,b:(i.b-n.b)*s+n.b,a:(i.a-n.a)*s+n.a};return ft(l)};ft.readability=function(e,t){var r=ft(e),n=ft(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)};ft.isReadable=function(e,t,r){var n=ft.readability(e,t),i,s;switch(s=!1,i=aOe(r),i.level+i.size){case"AAsmall":case"AAAlarge":s=n>=4.5;break;case"AAlarge":s=n>=3;break;case"AAAsmall":s=n>=7;break}return s};ft.mostReadable=function(e,t,r){var n=null,i=0,s,l,c,p;r=r||{},l=r.includeFallbackColors,c=r.level,p=r.size;for(var h=0;h<t.length;h++)s=ft.readability(e,t[h]),s>i&&(i=s,n=ft(t[h]));return ft.isReadable(e,n,{level:c,size:p})||!l?n:(r.includeFallbackColors=!1,ft.mostReadable(e,["#fff","#000"],r))};var P7=ft.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},rOe=ft.hexNames=nOe(P7);function nOe(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}o(nOe,"flip");function ine(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}o(ine,"boundAlpha");function wi(e,t){iOe(e)&&(e="100%");var r=oOe(e);return e=Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}o(wi,"bound01");function w3(e){return Math.min(1,Math.max(0,e))}o(w3,"clamp01");function gl(e){return parseInt(e,16)}o(gl,"parseIntFromHex");function iOe(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}o(iOe,"isOnePointZero");function oOe(e){return typeof e=="string"&&e.indexOf("%")!=-1}o(oOe,"isPercentage");function tc(e){return e.length==1?"0"+e:""+e}o(tc,"pad2");function e2(e){return e<=1&&(e=e*100+"%"),e}o(e2,"convertToPercentage");function one(e){return Math.round(parseFloat(e)*255).toString(16)}o(one,"convertDecimalToHex");function nne(e){return gl(e)/255}o(nne,"convertHexToDecimal");var ec=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",r="(?:"+t+")|(?:"+e+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Wf(e){return!!ec.CSS_UNIT.exec(e)}o(Wf,"isValidCSSUnit");function sOe(e){e=e.replace(BMe,"").replace($Me,"").toLowerCase();var t=!1;if(P7[e])e=P7[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=ec.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=ec.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=ec.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=ec.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=ec.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=ec.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=ec.hex8.exec(e))?{r:gl(r[1]),g:gl(r[2]),b:gl(r[3]),a:nne(r[4]),format:t?"name":"hex8"}:(r=ec.hex6.exec(e))?{r:gl(r[1]),g:gl(r[2]),b:gl(r[3]),format:t?"name":"hex"}:(r=ec.hex4.exec(e))?{r:gl(r[1]+""+r[1]),g:gl(r[2]+""+r[2]),b:gl(r[3]+""+r[3]),a:nne(r[4]+""+r[4]),format:t?"name":"hex8"}:(r=ec.hex3.exec(e))?{r:gl(r[1]+""+r[1]),g:gl(r[2]+""+r[2]),b:gl(r[3]+""+r[3]),format:t?"name":"hex"}:!1}o(sOe,"stringInputToObject");function aOe(e){var t,r;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:t,size:r}}o(aOe,"validateWCAG2Parms");var $7=Pn(B7());var G7=le.object({rank:le.union([le.enum(["low","medium","high","always-visible"]),le.number()]).optional(),interactive:le.boolean().optional(),appearance:le.object({margin:le.number().min(6).optional(),text:le.object({numLines:le.number().optional(),lineHeight:le.number().optional(),size:le.number().optional(),maxWidth:le.number().optional(),foregroundColor:le.string().optional(),backgroundColor:le.string().optional()}).optional(),marker:le.object({size:le.number().optional(),foregroundColor:le.object({active:le.string().optional(),inactive:le.string().optional()}).optional(),backgroundColor:le.object({active:le.string().optional(),inactive:le.string().optional()}).optional(),iconSizeInterpolation:le.object({nearZoomLevel:le.number().optional(),farZoomLevel:le.number().optional(),nearScale:le.number().optional(),farScale:le.number().optional()}).optional()}).optional()}).optional()});function $ne(e,t,r){le.array(le.number()).min(2).max(3).parse(e),le.string().parse(t),G7.parse(r||{})}o($ne,"validateLabel");var hv={margin:6,text:{numLines:2,lineHeight:1.2,size:11.5,maxWidth:150,foregroundColor:"white",backgroundColor:"#333"},marker:{size:5,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},Q4e={lightOnDark:re(k({},hv),{text:re(k({},hv.text),{foregroundColor:"white",backgroundColor:"#333"}),marker:re(k({},hv.marker),{foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}})}),darkOnLight:re(k({},hv),{text:re(k({},hv.text),{foregroundColor:"#333",backgroundColor:"white"}),marker:re(k({},hv.marker),{foregroundColor:{active:"#333",inactive:void 0},backgroundColor:{active:"white",inactive:void 0}})})},e5e="LOW_PRIORITY",kne=4,t5e=6,r5e=20,n5e=2.5,i5e=2,o5e="cover",s5e=-1/0,Rne=6.5,Bne={heightAbovePolygon:0,appearance:Q4e.darkOnLight},jne=o((e,t)=>["numLines","lineHeight","size","maxWidth","foregroundColor","backgroundColor"].some(r=>{var n,i,s;return((n=t.text)==null?void 0:n[r])!=null&&((i=e.text)==null?void 0:i[r])!==((s=t.text)==null?void 0:s[r])}),"isOneOfTextDirtyOptions"),Gne=o((e,t)=>["foregroundColor","backgroundColor","icon"].some(r=>{var n,i,s;return((n=t.marker)==null?void 0:n[r])!=null&&((i=e.marker)==null?void 0:i[r])!==((s=t.marker)==null?void 0:s[r])}),"isOneOfMarkerDirtyOptions");var s2,a2,ny=class ny{constructor(t,r,n){x(this,"lines",0);x(this,"id");x(this,"rank");x(this,"type","label");x(this,"initialRank");x(this,"contextConfigured",!1);x(this,"fillText");x(this,"newStyle",{});x(this,"opacity",0);x(this,"visibilityNeedsUpdate",!1);x(this,"text");x(this,"style",{top:0,left:0,textLabelVisible:!0,pinVisibility:1,textAlign:"left"});x(this,"projection",new wt);x(this,"labelCacheId");x(this,"_cache",{});x(this,"appearance");x(this,"options");x(this,"visible",!0);x(this,"enabled",!0);x(this,"isOccluded",!1);x(this,"offscreen",!1);x(this,"canShow",!1);x(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});x(this,"dimensions",{width:0,height:0});x(this,"currentStrategyIndex",-1);G(this,s2,0);x(this,"iconScale",1);G(this,a2);x(this,"dirty",!0);x(this,"textDirty",!0);x(this,"markerDirty",!0);x(this,"attachedDirty",!0);x(this,"collisionDirty",!0);x(this,"lastTextAlign");x(this,"imageHash");x(this,"markerSize",0);x(this,"iconVisible",!1);x(this,"dp");x(this,"animate",!0);x(this,"onStrategySelected",o(t=>{if(this.currentStrategyIndex===t)return;this.currentStrategyIndex=t;let r=this.strategies[this.currentStrategyIndex];if(r){r.onStrategySelected();let n=this.style;this.style=this.newStyle,this.newStyle=n}},"onStrategySelected"));x(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],shouldCollideWithScreenEdges:!1,lockedToStrategyIndex:-1});var s,l;if(this.id=(s=r.id)!=null?s:xn(),this.options=(0,$7.default)({},r,Bne),this.text=t,this.dp=(c=1)=>c*n.pixelRatio,typeof r.rank=="string")this.rank=Y1(r.rank),this.initialRank=this.rank;else if(r.rank!=null&&r.rank>0)this.rank=r.rank,this.initialRank=r.rank;else{let c=Math.trunc(I.env.NODE_ENV==="test"?ny.testId:ny.testId*10)/10;ny.testId+=.001,this.rank=c,this.initialRank=c}let i=(0,$7.default)({},this.options.appearance,Bne.appearance);this.appearance={margin:i.margin,text:{lineHeight:i.text.lineHeight,numLines:i.text.numLines,size:i.text.size,maxWidth:i.text.maxWidth,foregroundColor:i.text.foregroundColor,backgroundColor:i.text.backgroundColor},marker:{foregroundColor:{active:i.marker.foregroundColor.active,inactive:i.marker.foregroundColor.inactive||ft(i.marker.foregroundColor.active).setAlpha(.5).toRgbString()},backgroundColor:{active:i.marker.backgroundColor.active,inactive:i.marker.backgroundColor.inactive||ft(i.marker.backgroundColor.active).setAlpha(.5).toRgbString()},icon:i.marker.icon,iconSize:i.marker.iconSize||r5e,iconPadding:(l=i.marker.iconPadding)!=null?l:i5e,iconFit:i.marker.iconFit||o5e,iconOverflow:i.marker.iconOverflow||"hidden",iconVisibleAtZoomLevel:i.marker.iconVisibleAtZoomLevel==null?s5e:i.marker.iconVisibleAtZoomLevel,iconSizeInterpolation:i.marker.iconSizeInterpolation}},this.scaledIconPadding=this.appearance.marker.iconPadding}get totalMarkerSize(){return d(this,s2)*this.iconScale}set totalMarkerSize(t){q(this,s2,t)}get scaledIconPadding(){return(d(this,a2)||this.appearance.marker.iconPadding||0)*this.iconScale}set scaledIconPadding(t){q(this,a2,t)}setEntity(){}calculateMarkerSize(){let t=this.dp();this.iconVisible&&typeof this.appearance.marker.iconSize<"u"&&this.imageHash?this.markerSize=this.dp(this.appearance.marker.iconSize):this.markerSize=this.dp(Rne),this.totalMarkerSize=Math.ceil((this.markerSize+n5e)/t)}get lowPriorityStrategyIndex(){return this.text===""?-1:3}get strategies(){let{width:t,height:r}=this.dimensions,{margin:n}=this.appearance,i=Math.max(t5e,n),s=this.iconVisible?i/2:0,l=this.iconVisible?this.totalMarkerSize:Rne/2,c=[{name:"RIGHT",getBoundingBox:o(()=>{let p=Math.max(this.totalMarkerSize,r);return[p/2+i,p/2+i,this.totalMarkerSize/2+i,this.totalMarkerSize/2+t+i]},"getBoundingBox"),onStrategySelected:o(()=>{this.newStyle.textAlign="left",this.newStyle.pinVisibility=1,this.newStyle.top=-r/2,this.newStyle.left=this.totalMarkerSize/2+kne,this.newStyle.textLabelVisible=!0},"onStrategySelected")},{name:"LEFT",getBoundingBox:o(()=>{let p=Math.max(this.totalMarkerSize,r);return[p/2+i,p/2+i,this.totalMarkerSize/2+t+i,this.totalMarkerSize/2+i]},"getBoundingBox"),onStrategySelected:o(()=>{this.newStyle.textAlign="right",this.newStyle.pinVisibility=1,this.newStyle.top=-r/2,this.newStyle.left=-t-this.totalMarkerSize/2-kne,this.newStyle.textLabelVisible=!0},"onStrategySelected")},{name:"TOP",getBoundingBox:o(()=>{let p=this.dp();return[r+this.totalMarkerSize/2/p+i,this.totalMarkerSize/2+i,t/2+i,t/2+i]},"getBoundingBox"),onStrategySelected:o(()=>{this.newStyle.pinVisibility=1,this.newStyle.textAlign="center",this.newStyle.textLabelVisible=!0,this.newStyle.top=-r-this.totalMarkerSize/2,this.newStyle.left=-t/2},"onStrategySelected")},{name:e5e,getBoundingBox:o(()=>[l+s,l+s,l+s,l+s],"getBoundingBox"),onStrategySelected:o(()=>{this.newStyle.pinVisibility=.5,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0},"onStrategySelected")}];return this.text===""?[{name:"ICON_ONLY",getBoundingBox:o(()=>[this.totalMarkerSize/2+i,this.totalMarkerSize/2+i,this.totalMarkerSize/2+i,this.totalMarkerSize/2+i],"getBoundingBox"),onStrategySelected:o(()=>{this.newStyle.pinVisibility=1,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0},"onStrategySelected")}]:c}recomputeCurrentStrategy(t=this.iconScale){if(this.iconScale!==t||this.dirty){let r=this.strategies[this.currentStrategyIndex];if(this.iconScale=t,this.collisionDirty=!0,r){r.onStrategySelected(t);let n=this.style;this.style=this.newStyle,this.newStyle=n}this.dirty=!1}}updatePosition(){}disable(){this.visible=!1}toPackedMessage(t=!1){var r;if(this.visible&&t&&this.collisionDirty===!1&&this.currentStrategyIndex!=null&&this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex&&this.currentStrategyIndex!==((r=this.packedMessage.bboxes[0])==null?void 0:r[4])){let n=this.packedMessage.bboxes.findIndex(i=>i[4]===this.currentStrategyIndex);if(n!==-1){let i=this.packedMessage.bboxes.splice(n,1)[0];this.packedMessage.bboxes.unshift(i)}}if(!this.collisionDirty)return this.packedMessage;this.packedMessage.bboxes=[];for(let n=0;n<this.strategies.length;n++){let i=this.strategies[n];n===this.currentStrategyIndex&&this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex?this.packedMessage.bboxes.unshift([...i.getBoundingBox(),n]):this.packedMessage.bboxes.push([...i.getBoundingBox(),n])}return this.packedMessage.shouldCollideWithScreenEdges=!1,this.collisionDirty=!1,this.packedMessage}destroy(){}};s2=new WeakMap,a2=new WeakMap,o(ny,"LabelComponent"),x(ny,"testId",0);var j7=ny,Ip=j7;g();g();var W7=class W7 extends Lt{constructor(r,n){super();x(this,"rendererState");x(this,"convertTo3DMapPosition");x(this,"textSet",new Set);x(this,"batchedTextMap",new Map);x(this,"debugTextAreaMesh",new Map);this.rendererState=r,this.convertTo3DMapPosition=n}remove(r){this.textSet.delete(r)}update(r){var c,p,h;let n,i,s,l=[];for(let y of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(y),(n==null?void 0:n.type)==="text3d"){i=n.components[0],s=n.components[1];let b=(c=i.mesh)==null?void 0:c.parent;if(!b||!(b instanceof Ar)||!(i instanceof yh))continue;if("textArea"in i.feature.properties&&i.mesh!=null&&i.polygonEntityId!=null&&i.textMesh==null&&i.mesh.parent!=null&&((h=(p=i.feature.properties)==null?void 0:p.textArea)==null?void 0:h.position)!=null){if(this.textSet.has(i.polygonEntityId))continue;this.textSet.add(i.polygonEntityId),this.batchedTextMap.has(b)||this.batchedTextMap.set(b,mv().then(({BatchedText:P})=>{let E=new P;return E.type="batchedtext",b.add(E),E}));let C=this.batchedTextMap.get(b);if(!C)throw new Error("batched text required");l.push(Une({entityId:y,textComponent:i,styleComponent:s,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:C,rendererState:this.rendererState,type:"text-area"}).then(()=>{this.publish("render")}))}else if(i.mesh!=null&&i.textMesh==null&&i.mesh.parent!=null){if(this.textSet.has(y.toString()))continue;this.textSet.add(y.toString()),this.batchedTextMap.has(b)||this.batchedTextMap.set(b,mv().then(({BatchedText:P})=>{let E=new P;return E.type="batchedtext",b.add(E),E}));let C=this.batchedTextMap.get(b);if(!C)throw new Error("batched text required");l.push(Une({entityId:y,textComponent:i,styleComponent:s,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:C,rendererState:this.rendererState,type:"point"}).then(()=>{this.publish("render")}))}let _=this.batchedTextMap.get(b);i.textMesh&&_&&i.polygonEntityId!=null&&Promise.all([_,Promise.resolve({meshComponent:i,styleComponent:s})]).then(([C,{meshComponent:P,styleComponent:E}])=>{let{textMesh:T}=P;if(C&&T){let O=H7(C,T);P.visible&&!O?C.add(T):!P.visible&&O&&C.remove(T)}E.flipToFaceCamera&&this.flipIfNeeded(P,r)})}return Promise.all(l)}flipIfNeeded(r,n){let i=r.textMesh;if(!i)return!1;let s=i.rotation.z,l=ME(s+n);l>Math.PI/2&&l<3*Math.PI/2&&(i.rotation.z=ME(s+Math.PI))}showTextAreaMesh(){let r,n;for(let i of this.rendererState.geometry3DIdsInScene)if(r=this.rendererState.geometry3DMap.get(i),(r==null?void 0:r.type)==="text3d"&&(n=r.components[0],"textArea"in n.feature.properties)){let s=n.feature.properties.textArea;if(!s)continue;let l=new wu(s.maxWidth,s.maxHeight),c=new jt(l,new _o({color:"pink"})),{textMesh:p}=n;if(!p)continue;let h=this.convertTo3DMapPosition(s.position,l2);c.position.copy(h),c.position.z=p.position.z-.1,c.rotation.z=p.rotation.z,U7.identity(),U7.makeRotationAxis(new ht(0,0,1),p.userData.rotationZ),l2.set(s.maxWidth/2,0,0),l2.applyMatrix4(U7),c.position.x-=l2.x,c.position.y-=l2.y,this.rendererState.entityScene.add(c),this.debugTextAreaMesh.set(i,c)}this.publish("render")}hideTextAreaMesh(){this.debugTextAreaMesh.forEach(r=>{this.rendererState.entityScene.remove(r)}),this.debugTextAreaMesh.clear(),this.publish("render")}};o(W7,"Text3DSystem");var F3=W7;function z7(e){mv().then(({configureTroikaTextBuilder:t})=>{t({useWorker:e})})}o(z7,"configureWorker");var U7=new Su,l2=new ht,V7;async function q7(e){let{preloadFont:t}=await mv();return t(e)}o(q7,"preloadFont");function mv(){return V7||(V7=import("./text3d-DNZ77VLG.js").then(e=>e)),V7}o(mv,"getText3DService");async function Une({entityId:e,textComponent:t,styleComponent:r,convertTo3DMapPosition:n,batchedMeshPromise:i,rendererState:s,type:l="text-area"}){return Promise.all([mv(),Promise.resolve({entityId:e,meshComponent:t,styleComponent:r})]).then(([{createTroikaTextPoint:c,createTroikaTextArea:p},h])=>l==="text-area"?p(h.entityId,h.meshComponent,h.styleComponent,n):c(h.entityId,h.meshComponent,h.styleComponent,n)).catch(c=>{ce.warn("Trouble creating text: ",c)}).then(c=>{if(!(c!=null&&c.text))return;let p=[Promise.resolve(c.text),i,Promise.resolve()];if(t.polygonEntityId){let h=s.geometry3DMap.get(t.polygonEntityId);if((h==null?void 0:h.type)==="geometry"){let y=h.components[0],b=h.components[1];y.textMesh=c.text,y.mesh!=null&&(c.text.position.z=b.altitude+b.height+a5e)}}else p[2]=mv().then(({syncText:h})=>h(c.text));return Promise.all(p)}).then(c=>{if(!c)return;let[p,h]=c;h.add(p),t.batchedText||(t.batchedText=h)})}o(Une,"createText");function H7(e,t){return e._members.has(t)}o(H7,"doesBatchedTextContainsText");var a5e=.5;var l5e=le.object({visible:le.boolean(),color:le.string(),flipToFaceCamera:le.boolean(),font:le.string().optional(),fontSize:le.number(),margin:le.union([le.number(),le.tuple([le.number(),le.number(),le.number(),le.number()])]),outlineColor:le.string(),outlineOpacity:le.number(),outlineBlur:le.union([le.number(),le.string()]),outlineWidth:le.number(),outlineOffsetX:le.number(),outlineOffsetY:le.number(),strokeWidth:le.number(),maxWidth:le.number().optional(),maxHeight:le.number().optional(),strokeOpacity:le.number(),strokeColor:le.string(),fillOpacity:le.number(),hoverColor:le.string().optional(),id:le.union([le.string(),le.number()]),type:le.literal("text3d"),position:le.tuple([le.number(),le.number(),le.number()]),content:le.string()}),Vne=l5e.partial().omit({id:!0,type:!0}).strict(),zne=Vne.omit({margin:!0,position:!0,maxWidth:!0,maxHeight:!0,content:!0}).strict(),qne=le.object({appearance:Vne.optional(),parentId:le.string().optional()}).strict(),X7=class X7{constructor(t){x(this,"mesh",new Eu);x(this,"textMesh");x(this,"type","text3d");x(this,"feature");x(this,"parent");x(this,"batchedText");x(this,"polygonEntityId");this.feature=t}get visible(){return this.batchedText&&this.textMesh?H7(this.batchedText,this.textMesh):this.textMesh?this.textMesh.visible:!1}set visible(t){this.batchedText&&this.textMesh?t?this.batchedText.addText(this.textMesh):this.batchedText.removeText(this.textMesh):this.textMesh&&(this.textMesh.visible=t),this.mesh.visible=t}};o(X7,"Text3DComponent");var yh=X7;g();var Y7=class Y7{constructor(t){x(this,"color");x(this,"dirty",!0);x(this,"visible",!0);x(this,"edgeColors");x(this,"geometry");x(this,"ranges");x(this,"topFaceVerticesIndices");this.color=t}get currentOpacity(){return this.edgeColors&&this.ranges?this.edgeColors.array[3]:0}get currentColor(){return this.edgeColors&&this.ranges?[this.edgeColors.array[0],this.edgeColors.array[1],this.edgeColors.array[2]]:[0,0,0]}};o(Y7,"OutlineComponent");var gv=Y7;g();g();g();var Z7=class Z7 extends MN{constructor(r){let n=r,i=3,s=i*4;super(new Float32Array(r*s),i,r,oS,vN);x(this,"_width");x(this,"_height");x(this,"_propertiesLength");this._width=s,this._height=n,this._propertiesLength=i}setColor(r,n,i){let s=this.image.data,l=r*this._width;s[l]=n.r,s[l+1]=n.g,s[l+2]=n.b,s[l+3]=0,s[l+4]=i.r,s[l+5]=i.g,s[l+6]=i.b,s[l+7]=0,this.needsUpdate=!0}getColor(r){let n=this.image.data,i=r*this._width,s=new An(n[i],n[i+1],n[i+2]),l=new An(n[i+4],n[i+5],n[i+6]);return{color:s,topColor:l}}setTexture(r,n,i){let s=this.image.data,l=r*this._width;s[l+8]=n?1:0,s[l+9]=i?1:0,s[l+10]=0,s[l+11]=0,this.needsUpdate=!0}};o(Z7,"BatchedPropertiesTexture");var N3=Z7;g();var Hne="#define LAMBERT\nvarying vec3 vViewPosition;\nvarying vec4 vPosition;\nvarying vec2 vUv;\nvarying vec4 finalPosition;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\nvarying float vBatchId;\n\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n\n vViewPosition = - mvPosition.xyz;\n\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n \n // To mitigate visual defects on machines such as windows and iOS\n vBatchId = getIndirectIndex(gl_DrawID) + 0.5;\n vViewPosition = - mvPosition.xyz;\n worldNormal = normal;\n vUv = uv;\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n}\n";g();var Wne="#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nuniform float uGradientEnd;\nuniform float uGradientIntensity;\nuniform float uMinSideAlpha;\nuniform float uMaxSideAlpha;\nuniform float uGradientStart;\nuniform highp sampler2D uPropertiesTexture;\nuniform highp sampler2D uTopTexture;\nuniform highp sampler2D uTexture;\nuniform float uRepeatYFactor;\nuniform bool uBlendTexture;\nvarying float vBatchId;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvec3 blendTextureColor(vec3 diffuseColor, vec4 texColor) {\n vec3 texturedColor = diffuseColor * texColor.rgb;\n return mix(diffuseColor, texturedColor, texColor.a);\n}\n\nvoid main() {\n #include <clipping_planes_fragment>\n\n // get the normalized world normal of vertex fragment\n vec3 surfaceNormal = normalize(worldNormal);\n\n // get angle relative to Z up\n float angle = degrees(acos(abs(dot(surfaceNormal, vec3(0.0, 0.0, 1.0)))));\n\n int idx = int(vBatchId) * 1;\n vec3 diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(0, idx), 0).rgb);\n bool shouldShowTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).r > 0.99;\n\n if(shouldShowTexture) {\n vec4 tex2d = texture2D(uTexture, vec2(vUv.x, vUv.y * uRepeatYFactor));\n diffuse = uBlendTexture ? blendTextureColor(diffuse, tex2d) : tex2d.rgb;\n }\n\n // if this is a fragment facing upwards, use topColor. Avoid any sort of '==' comparison, due to floating point precision issue\n if(angle < 0.02) {\n bool shouldShowTopTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).g > 0.99;\n\n if(shouldShowTopTexture) {\n vec4 topTex2d = texture2D(uTopTexture, vUv);\n diffuse = uBlendTexture ? blendTextureColor(diffuse, topTex2d) : topTex2d.rgb;\n } else {\n diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(1, idx), 0).rgb);\n }\n }\n\n vec4 diffuseColor = vec4(diffuse, opacity);\n\n // only for vertical surfaces\n if(angle > 89.0 && angle < 91.0) {\n\n // get the percentage of the z position from the ground, up\n float percentFromZeroZ = max((abs(vWorldPosition.z) - uGradientStart) / uGradientEnd, 0.0);\n\n // gradient based on percentage\n float alpha = smoothstep(uMinSideAlpha, uMaxSideAlpha, percentFromZeroZ);\n\n // mix the shadow color with the diffuse color based on the alpha and opacity\n diffuseColor = vec4(mix(diffuseColor.rgb, diffuseColor.rgb * (1.0 - uGradientIntensity), 1.0 - alpha), opacity);\n }\n\n ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n vec3 totalEmissiveRadiance = emissive;\n\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n\n // accumulation\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n\n // modulation\n #include <aomap_fragment>\n\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n\n}\n";var u5e=-.05,c5e=1,K7=class K7 extends Pu{constructor(r,n,i=1){super(r);x(this,"propertiesTexture");x(this,"uniforms",{uGradientIntensity:{value:0},uGradientEnd:{value:0},uGradientStart:{value:0},uTopTexture:{value:null},uTexture:{value:null},uRepeatYFactor:{value:1},uBlendTexture:{value:!1}});x(this,"colorSpace",Xp);x(this,"showTextures",o(r=>{let n=!!this.uniforms.uTexture.value,i=!!this.uniforms.uTopTexture.value;(n||i)&&(this.propertiesTexture.setTexture(r,n,i),this.needsUpdate=!0)},"showTextures"));this.propertiesTexture=new N3(n),this.uniforms.uRepeatYFactor.value=i,this.onBeforeCompile=s=>{let l=this.uniforms.uGradientIntensity,c=this.uniforms.uGradientEnd,p=this.uniforms.uGradientStart,h=this.uniforms.uTopTexture,y=this.uniforms.uTexture,b=this.uniforms.uRepeatYFactor,_=this.uniforms.uBlendTexture;this.uniforms=s.uniforms,s.vertexShader=Hne,s.fragmentShader=Wne,Object.assign(this.uniforms,{uGradientIntensity:l,uGradientEnd:c,uGradientStart:p,uMinSideAlpha:{value:u5e},uMaxSideAlpha:{value:c5e},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:h,uTexture:y,uRepeatYFactor:b,uBlendTexture:_})}}get repeatYFactor(){return this.uniforms.uRepeatYFactor.value}set repeatYFactor(r){r!==this.uniforms.uRepeatYFactor.value&&(this.uniforms.uRepeatYFactor.value=r,this.needsUpdate=!0)}get texture(){return this.uniforms.uTexture.value}set texture(r){r.wrapS=wc,r.wrapT=wc,r.colorSpace=this.colorSpace,this.uniforms.uTexture.value=r}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(r){r.wrapS=wc,r.wrapT=wc,r.colorSpace=this.colorSpace,this.uniforms.uTopTexture.value=r}get blendTexture(){return this.uniforms.uBlendTexture.value}set blendTexture(r){r!==this.uniforms.uBlendTexture.value&&(this.uniforms.uBlendTexture.value=r,this.colorSpace=r?bN:Xp,this.texture&&(this.texture.colorSpace=this.colorSpace),this.topTexture&&(this.topTexture.colorSpace=this.colorSpace),this.needsUpdate=!0)}setGradientShading(r,n,i){this.uniforms.uGradientStart.value=r,this.uniforms.uGradientEnd.value=n,this.uniforms.uGradientIntensity.value=i}setColor(r,n,i){this.propertiesTexture.setColor(r,n,i)}getColor(r){return this.propertiesTexture.getColor(r)}hideTextures(r){let n=!!this.uniforms.uTexture.value,i=!!this.uniforms.uTopTexture.value;(n||i)&&(this.propertiesTexture.setTexture(r,!1,!1),this.needsUpdate=!0)}removeSideTexture(r){if(this.texture){this.texture.dispose(),this.uniforms.uTexture.value=null;let n=!!this.uniforms.uTopTexture.value;this.propertiesTexture.setTexture(r,!1,n),this.needsUpdate=!0}}removeTopTexture(r){if(this.topTexture){this.topTexture.dispose(),this.uniforms.uTopTexture.value=null;let n=!!this.uniforms.uTexture.value;this.propertiesTexture.setTexture(r,n,!1),this.needsUpdate=!0}}dispose(){super.dispose(),this.propertiesTexture.dispose()}};o(K7,"BatchedStandardMaterial");var iy=K7;g();function Xne(e,t){var c,p,h;let r=0;for(let y of e)r+=((p=(c=y.components[0])==null?void 0:c.geometry)==null?void 0:p.attributes.position.count)||0;let n=new An(t.color),i;i=new iy({color:n,side:t.side==="back"?mN:t.side==="front"?iS:Wp,opacity:(h=t.opacity)!=null?h:1,transparent:t.opacity!==void 0?t.opacity<1:!1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1},e.length);let s=new yS(e.length,r,0,i),l;for(let y of e)l=y.components[0],!(!(l instanceof Mi)||!l.geometry)&&(l.mesh=s,l.material=i,l.instanceIndex=s.addGeometry(l.geometry),s.addInstance(l.instanceIndex),s.userData.entities[l.instanceIndex]=y.id,i instanceof iy&&i.setColor(l.instanceIndex,n,t.topColor?new An(t.topColor):n));return s.perObjectFrustumCulled=!0,s.matrixAutoUpdate=!1,s}o(Xne,"batchGeometries");function k3(e){return ft(e).darken(30).toRgbString()}o(k3,"darkenColorForOutline");function Yne(e,t,r,n){if(t.length<1)return;e.boundingBox||e.computeBoundingBox();let i=e.boundingBox,s=e.getAttribute("position"),l=e.getAttribute("normal"),c=e.getAttribute("uv"),p,h;e.index?(p=e.index.count/3,h=o(function(A,R){return e.index.getX(A*3+R)},"meshIndex")):(p=s.count/3,h=o(function(A,R){return A*3+R},"meshIndex"));let y=new Su;y.makeRotationFromQuaternion(new Eb().setFromEuler(new Yp(0,0,r/180*Math.PI)));let b=t.find(A=>A.face==="top"),_;b&&(_={min:n(b.bounds[1],b.bounds[0],0),max:n(b.bounds[3],b.bounds[2],i.max.z)});let C=t.find(A=>A.face==="side"),P;if(C&&(P={min:n(C.bounds[1],C.bounds[0],0),max:n(C.bounds[3],C.bounds[2],i.max.z)}),!(!P&&!_))for(let A=0;A<p;++A){let R=l.getX(h(A,0))+l.getX(h(A,1))+l.getX(h(A,2)),j=l.getY(h(A,0))+l.getY(h(A,1))+l.getY(h(A,2)),X=l.getZ(h(A,0))+l.getZ(h(A,1))+l.getZ(h(A,2)),Y=Math.abs(R),N=Math.abs(j),Z=Math.abs(X);var E,T;Y<=N&&Y<=Z?(E="x",N<=Z?T="y":T="z"):N<=Y&&N<=Z?(E="y",Y<=Z?T="x":T="z"):(E="z",Y<=N?T="x":T="y"),E==="z"&&(E=T,T="z");let ae,se,U,xe,ne,Pe;if(T==="z"||E==="z"){if(!C||!P)continue;ae=C.repeat.u,se=C.repeat.v,U=C.offset.u,xe=C.offset.v,ne=C.rotation,Pe=P}else{if(!b||!_)continue;ae=b.repeat.u,se=b.repeat.v,U=b.offset.u,xe=b.offset.v,ne=(360-r+b.rotation)%360,Pe=_}let{min:Ce,max:Ue}=Pe,_e=new Zp;_e.position.set(Ce.x,Ce.y,0),_e.updateMatrix(),_e.updateMatrixWorld();let Me=Ce.clone().applyMatrix4(y),Q=Ue.clone().applyMatrix4(y),it=Math.abs(Q.x-Me.x),Ke=Math.abs(Q.y-Me.y),rt=new ht(it,Ke,Ue.z).applyMatrix4(_e.matrixWorld),Ae=Math.abs(rt[E]-Ce[E]),Be=Math.abs(rt[T]-Ce[T]),We=ne*Math.PI/180||0,je=Math.cos(We),Se=Math.sin(We),H=_e.matrixWorld.clone().invert(),ie=new Eb().setFromEuler(new Yp(0,0,r/180*Math.PI));for(let ee=0;ee<3;ee++){let Ne=new ht(s.getX(h(A,ee)),s.getY(h(A,ee)),s.getZ(h(A,ee))).applyMatrix4(H);Ne.applyQuaternion(ie);let Oe=Ne.applyMatrix4(_e.matrixWorld),Ye=Oe.x,Pt=Oe.y,Er=Oe.z;var O,D;E==="x"?O=ae*(Ye-Ce[E])/Ae+U:E==="y"?O=ae*(Pt-Ce[E])/Ae+U:O=ae*(Er-Ce[E])/Ae+U,T==="x"?D=se*(Ye-Ce[T])/Be+xe:T==="y"?D=se*(Pt-Ce[T])/Be+xe:D=se*(Er-Ce[T])/Be+xe,O-=.5,D-=.5;let $n=O*je-D*Se+.5,ot=O*Se+D*je+.5;c.setX(h(A,ee),$n),c.setY(h(A,ee),ot)}}}o(Yne,"updateUVsLegacy");g();var J7=class J7{constructor(){x(this,"focusMesh");x(this,"dirty",!0)}};o(J7,"FocusableComponent");var yv=J7;function Cs(e,t,r){if(t!==void 0){if(e.type==="model"||e.type==="path"||e.type==="marker"||e.type==="label"||e.type==="geometry"||e.type==="group-container"||e.type==="custom-geometry")return t===!0?(e instanceof sm&&e.components[1]===void 0?(e.components[1]=new cv,e.components[1].dirty=!0):e instanceof mn&&e.components[2]===void 0?(e.components[2]=new cv,e.components[2].dirty=!0):e instanceof Ar&&e.components[1]===void 0&&(e.components[1]=new cv,e.components[1].dirty=!0),!0):(e instanceof sm?e.components[1]=void 0:e instanceof mn?e.components[2]=void 0:e instanceof Ar&&(e.components[1]=void 0),!0);if(e.type==="geometry-group"){let n;for(let i of e.userData.entities3D.values())n=r.geometry3DMap.get(i),Cs(n,t,r);return!0}}return!1}o(Cs,"updateInteractivity");function Zne(e,t,r){if(!(!(r!=null&&r.color)&&!("topColor"in r))){if(r!==void 0&&e.type==="geometry-group"&&e.components[0]!=null){let n,i,s=e.components[0];for(let l of e.userData.entities3D.values())if(n=t.geometry3DMap.get(l),n){i=n.components[1],i.color===s.color&&(i.initialColor=r.color||s.color,i.color=r.color||s.color,i.dirty=!0);let c=n.components[3];c&&(c.color=k3(i.color||s.color),c.dirty=!0),i.topColor===s.topColor&&(i.topColor=r.topColor||s.topColor,i.dirty=!0)}return r.color!==void 0&&(s.color=r.color,s.dirty=!0),"topColor"in r&&(s.topColor=r.topColor,s.dirty=!0),!0}return!1}}o(Zne,"updateGroupColor");function Kne(e,t){if(t!==void 0&&e.type==="geometry-group"&&e.components[0]!=null){let r=e.components[0];return r.shading=r.shading||{},r.shading&&(t.start!==r.shading.start||t.end!==r.shading.end||t.intensity!==r.shading.intensity)&&(Object.assign(r.shading,t),e.userData.shadingDirty=!0),!0}return!1}o(Kne,"updateGroupShading");function Jne(e,t){t!==void 0&&e.type==="geometry"&&(t.showImage!==void 0&&(e.components[1].showImage=t.showImage),t.flipImageToFaceCamera!==void 0&&(e.components[1].flipImageToFaceCamera=t.flipImageToFaceCamera))}o(Jne,"updateImageProps");function eD(e,t,r){if(r!==void 0){if(e.type==="geometry"){let n=e.components[1];if(n.height!==r)return n.height=r,n.dirty=!0,e.components[3]&&(e.components[3].dirty=!0),!0}else if(e.type==="geometry-group"){let n=e.components[0];for(let i of e.userData.entities3D.values()){let s=t.geometry3DMap.get(i),l;((s==null?void 0:s.type)==="geometry"||(s==null?void 0:s.type)==="model")&&(l=s.components[1],l.height===n.height&&(s.components[1].height=r,s.components[1].dirty=!0),s.components[3]&&(s.components[3].dirty=!0))}return e.components[0].height=r,!0}}return!1}o(eD,"updateHeight");function tD(e,t){if(t!==void 0){let r=!1;(e.type==="path"||e.type==="geometry")&&(t.initialColor!==void 0&&t.initialColor!==e.components[1].initialColor&&(e.components[1].initialColor=t.initialColor,r=!0),t.color!==void 0&&t.color!==e.components[1].color&&(e.components[1].color=t.color,r=!0,e.components[3]&&(e.components[3].color=t.color,e.components[3].dirty=!0)),"topColor"in t&&(e.components[1].topColor=t.topColor,r=!0),r&&(e.components[1].dirty=!0))}}o(tD,"updateColor");function rD(e,t,r){t!==void 0&&(e.type==="label"||e.type==="marker"?e.updatePosition(r(t[1],t[0],t[2]||0)):e.type==="custom-geometry"&&e.components[0].position.copy(r(t[1],t[0],t[2]||0)))}o(rD,"updatePosition");function nD(e,t){var r;return t!==void 0&&(e.type==="marker"||e.type==="label"||e.type==="custom-geometry")&&e.parentObject3D!==t&&e.parentObject3D instanceof Ar?((r=e.parentObject3D)==null||r.removeEntity(e),t.addEntity(e),!0):!1}o(nD,"updateParent");function Qne(e,t){t!==void 0&&(e.type==="marker"||e.type==="label")&&e.components[0].enabled!==t&&(e.components[0].enabled=t)}o(Qne,"updateEnabled");function eie(e,t,r){if(t!==void 0&&e.type==="marker"){let n=e.components[0];if(t.contentHTML!==void 0)return n.containerEl.innerHTML=t.contentHTML,n.contentHtml=t.contentHTML,!0;if(t.anchor!==void 0&&(n.options.anchor=t.anchor,n.collisionDirty=!0),t.dynamicResize!==void 0)return n.options.dynamicResize=t.dynamicResize,!0;if(t.options!=null){try{C7.parse(t.options||{})}catch(i){return ce.error(i),!1}return t.options.interactive!=null&&(t.options.interactive==="pointer-events-auto"?(n.pointerEvents="auto",Cs(e,!1,r)):(n.pointerEvents="none",Cs(e,t.options.interactive,r))),tie(e,t.options.rank),!0}}return!1}o(eie,"updateMarker");function tie(e,t){return t!==void 0&&(e.type==="marker"||e.type==="label")?(e.components[0].rank=Y1(t),!0):!1}o(tie,"updateRank");function rie(e,t,r){var n,i,s,l,c;if(t!==void 0&&e.type==="label"){let p=e.components[0];t.text!==void 0&&t.text!==p.text&&(p.text=t.text,p.textDirty=!0);try{G7.parse(t.options||{})}catch(h){ce.error(h);return}jne(p.appearance,((n=t.options)==null?void 0:n.appearance)||{})&&(p.textDirty=!0),Gne(p.appearance,((i=t.options)==null?void 0:i.appearance)||{})&&(p.markerDirty=!0),ik(p.appearance,((s=t.options)==null?void 0:s.appearance)||{}),Cs(e,(l=t.options)==null?void 0:l.interactive,r),tie(e,(c=t.options)==null?void 0:c.rank)}}o(rie,"updateLabel");function nie(e,t){t!==void 0&&e.type==="geometry"&&(e.components[1].hoverColor=t,e.components[1].dirty=!0)}o(nie,"updateHoverColor");function iie(e,t){if(t!==void 0){let r=e.components[2];if(e.type==="geometry"&&r!=null)return r.hover=t,r.dirty=!0,!0}return!1}o(iie,"updateHovered");function iD(e,t){t!==void 0&&e.type==="image"&&(e.components[1].flipImageToFaceCamera=t)}o(iD,"updateFlipImageToFaceCamera");function _p(e,t,r){if(r!==void 0){if(e.type==="model"||e.type==="path"||e.type==="geometry"||e.type==="custom-geometry"||e.type==="image"||e.type==="text3d"){r!==e.components[1].visible&&(e.components[1].visible=r,e.components[1].dirty=!0);let n=e.components[3];n&&(n.visible=r,n.dirty=!0)}else e.type==="geometry-group"?e.setVisible(r):e.type==="group-container"?(e.setVisible(r),r===!1&&e.traverse(n=>{if(n instanceof WN){let i=t.geometry2DMap.get(n.userData.entityId);if(i){let s=i.components[0];s instanceof Ip&&(s.canShow=r)}}})):e.type==="label"&&(e.components[0].visible=r);return!0}return!1}o(_p,"updateVisibility");function oD(e,t,r){if(r!==void 0){if(e.type==="geometry-group"){let n=e.components[0];if(n.opacity!==r){for(let i of e.userData.entities3D.values()){let s=t.geometry3DMap.get(i),l;((s==null?void 0:s.type)==="geometry"||(s==null?void 0:s.type)==="model")&&(l=s.components[1],(!l.opacity||l.opacity===n.opacity)&&(l.opacity=r,l.dirty=!0))}return e.setOpacity(r),n.opacity=r,!0}}else if(e.type==="group-container"&&e.opacity!==r){e.setOpacity(r);let n=1;return e.parent instanceof Ar&&(n=e.parent.opacity),oie(e,t,n),!0}}return!1}o(oD,"updateOpacity");function oie(e,t,r=1){if(e.type==="group-container"&&"children"in e&&e.children.length>0){let n=r*e.opacity;e.userData.computedOpacity=n;for(let i of e.children)(i instanceof Fs&&i.type==="geometry-group"||i instanceof Ar&&i.type==="group-container")&&oie(i,t,n)}else if(e.type==="geometry-group")for(let n of e.userData.entities3D.values()){let i=t.geometry3DMap.get(n),s;((i==null?void 0:i.type)==="geometry"||(i==null?void 0:i.type)==="model")&&(s=i.components[1],s.dirty=!0)}}o(oie,"cascadeOpacity");function sie(e,t){if(t!==void 0&&e.type==="geometry-group"){let r=e.components[0];(t==null?void 0:t.texture)!=null&&r.texture!==(t==null?void 0:t.texture)&&(r.texture=t.texture,r.dirty=!0),(t==null?void 0:t.topTexture)!=null&&r.topTexture!==(t==null?void 0:t.topTexture)&&(r.topTexture=t.topTexture,r.dirty=!0)}}o(sie,"updateGroupTexture");function aie(e,t){if(e.type==="geometry"){let r=!1,n=e.components[1];if((t==null?void 0:t.texture)!=null&&n.texture!==(t==null?void 0:t.texture)&&(n.texture=t.texture,r=!0),(t==null?void 0:t.topTexture)!=null&&n.topTexture!==(t==null?void 0:t.topTexture)&&(n.topTexture=t.topTexture,r=!0),r&&e.components[0]instanceof Mi){let i=e.components[0];return i.detached===!1&&(i.detached=!0,i.dirty=!0),e.components[1].dirty=!0,!0}}return!1}o(aie,"updateIndividualGeometryTexture");function lie(e,t){if(t!==void 0&&e.type==="geometry"){let r=e.components[1];if(r.opacity!==t){r.opacity=t;let n=e.components[0],i=e.components[3];i&&(i.dirty=!0),n.detached===!1&&(n.detached=!0,n.dirty=!0),t===0?r.visible=!1:r.visible=!0,r.dirty=!0;let s=e.parentObject3D;return(s==null?void 0:s.type)==="geometry-group"&&(s.userData.shadingDirty=!0),!0}}return!1}o(lie,"updateIndividualGeometryOpacity");function R3(e,t){if(t!==void 0)if(e.type==="path"||e.type==="geometry"||e.type==="custom-geometry")e.components[1].altitude=t,e.components[1].dirty=!0;else{if(e.type==="group-container"&&e.altitude!==t)return e.setAltitude(t),!0;if(e.type==="geometry-group")return e.setAltitude(t),!0}return!1}o(R3,"updateAltitude");function B3(e,t,r){if(r!==void 0){if(e.type==="geometry-group"&&e.components[0]!=null)for(let n of e.userData.entities3D.values()){let i=t.geometry3DMap.get(n);i instanceof mn&&B3(i,t,r)}else if(e.type==="geometry"){let n=e.components[3],i=e.components[1];!n&&r===!0?e.components[3]=new gv(i.color):n&&(n.visible=r,n.dirty=!0)}return!0}return!1}o(B3,"updateOutline");function sD(e,t){if(t!==void 0){if(e.type==="geometry"){let r=e.components[0];if(e.type==="geometry"&&r&&r instanceof Mi&&r.focusable!==t)return r.focusable=t,!0}else if(e.type==="group-container"){let r=e.components[2]!==void 0;if(t===!0&&!r)return e.components[2]=new yv,!0;if(t===!1&&r)return e.components[2]=void 0,!0}}return!1}o(sD,"updateFocusable");function uie(e,t){if(t!==void 0&&e.type==="geometry"){let r=e.components[1];if(r.renderOrder!==t){r.renderOrder=t;let n=e.components[0];return n.detached===!1&&(n.detached=!0,n.dirty=!0),n.imageMesh&&(n.imageMesh.renderOrder=t+1),r.dirty=!0,!0}}return!1}o(uie,"updateIndividualGeometryRenderOrder");function cie(e,t,r){let{visible:n,color:i}=r;if(e.type!=="path")return;let s=e.components[0];n!=null&&_p(e,t,n),i!=null&&tD(e,{color:i}),Object.assign(s,aD(r)),ek(r)||(s.materialDirty=!0,(r.nearRadius!=null||r.farRadius!=null)&&(s.dirty=!0),(r.nearZoomLevel!=null||r.farZoomLevel!=null)&&(s.dirty=!0))}o(cie,"handlePathUpdate");function aD(e){return nl(e,f5e)}o(aD,"pickPathOptions");var f5e=["animateArrowsOnPath","displayArrowsOnPath","nearRadius","farRadius","accentColor","completeFraction","nearZoomLevel","farZoomLevel","dashed","visibleThroughGeometry"];function pie(e){if(!(e instanceof mn&&e.type==="text3d"))throw new Error("expect target is TextGeometry3D")}o(pie,"assetGeometryIsText3D");var $3=["visible","color","strokeWidth","outlineOffsetX","outlineOffsetY","outlineWidth","outlineBlur","outlineOpacity","outlineColor","strokeWidth","strokeColor","strokeOpacity","maxWidth","maxHeight","font","hoverColor","fillOpacity","fontSize","flipToFaceCamera"];function fie(e,t,r){_p(e,t,r.visible);let n=e.components[1],i=nl(r,$3);"margin"in r&&ce.warn("update to margin is not supported atm"),"content"in r&&ce.warn("content update is not supported atm");try{zne.parse(i)}catch(s){ce.error(s);return}Object.keys(i).length>0&&(Object.assign(n,i),n.dirty=!0)}o(fie,"handleText3DUpdate");var d5e=["color","material","opacity","verticalOffset","rotation","position","scale"];function die(e,t){let r=nl(t,d5e),n=e.components[1],i=e.components[0];Object.keys(r).length>0&&(r.material&&(n.material=r.material),r.opacity!=null&&(n.opacity=r.opacity,r.opacity===0?n.visible=!1:n.visible=!0,n.dirty=!0),r.verticalOffset!=null&&(n.verticalOffset=r.verticalOffset),r.color!=null&&(n.color=r.color),r.position!=null&&(i.feature.geometry.coordinates=r.position,i.positionDirty=!0),r.rotation!=null&&(n.rotation=r.rotation),r.scale!=null&&(n.scale=r.scale),n.dirty=!0)}o(die,"handleModelStyleUpdate");var oy,Sp,j3,vh,hie,c2,G3,mie,gie,p2,U3,f2,d2,V3,lD=class lD{constructor(t){G(this,vh);G(this,oy,null);G(this,Sp);x(this,"getCurrentSceneGLTF",o(async t=>{let r=k({onlyVisible:!0,binary:!0,light:!0,scale:1},t),n=await ke(this,vh,hie).call(this),i=d(this,j3).call(this,r),s=await n.parseAsync(i,{trs:!1,maxTextureSize:1/0,onlyVisible:r.onlyVisible,binary:r.binary,scale:r.scale}),l;if(s instanceof ArrayBuffer)l=new Blob([s],{type:"application/octet-stream"});else{let c=JSON.stringify(s,null,2);l=new Blob([c],{type:"text/plain"})}return l},"getCurrentSceneGLTF"));G(this,j3,o(t=>{let{scale:r,light:n,onlyVisible:i}=t,s=new Ed,l=new co().setFromObject(d(this,Sp).entityScene);if(d(this,c2).call(this,d(this,Sp).entityScene,s,i),n){let c=new pS(16777215,.3*Math.PI);c.position.set(0,Math.max(l.max.x,l.max.y)*r*.5,l.max.y*r*4),c.lookAt(0,0,-1),c.target.position.set(0,0,-1),c.add(c.target),s.add(c)}return s},"#getExportedScene"));G(this,c2,o((t,r,n)=>{t.material&&(t instanceof lS?ke(this,vh,mie).call(this,t).forEach(i=>r.add(i)):t instanceof e0&&r.add(ke(this,vh,gie).call(this,t))),t.children.forEach(i=>{(!n||i.visible)&&d(this,c2).call(this,i,r,n)})},"#processObject3D"));G(this,G3,o((t,r,n)=>{let i=new DN({color:new An(t),metalness:0});return i.opacity=r,i.transparent=n,i},"#createStandardMaterial"));G(this,p2,o(t=>{let{geometry:r,material:n,position:i,rotation:s,quaternion:l,scale:c}=t;if(!(r!=null&&r.isBufferGeometry))return t;let p=r.attributes.position,h=r.attributes.normal,y=r.attributes.uv;return d(this,U3).call(this,p,h),d(this,d2).call(this,i,c,s,l),y&&d(this,V3).call(this,y),n!=null&&n.map&&r.type==="PlaneGeometry"&&(t.side=Wp),t},"#convertGeometry"));G(this,U3,o((t,r)=>{let n=new ht,i=new ht;for(let s=0;s<t.count;s++)n.fromBufferAttribute(t,s),d(this,f2).call(this,n),t.setXYZ(s,n.x,n.y,n.z),r&&(i.fromBufferAttribute(r,s),d(this,f2).call(this,i),r.setXYZ(s,i.x,i.y,i.z))},"#convertAttributes"));G(this,f2,o(t=>{let r=t.y;t.y=t.z,t.z=-r},"#convertVector"));G(this,d2,o((t,r,n,i)=>{let s=t.y;t.y=t.z,t.z=-s;let l=r.y;if(r.y=r.z,r.z=l,n instanceof Yp)n.order="YXZ",n.set(n.x,n.y,n.z,n.order);else{let c=i.y;i.set(i.x,i.z,-c,i.w)}},"#convertObjectProperties"));G(this,V3,o(t=>{for(let r=0;r<t.count;r++){let n=t.getX(r),i=t.getY(r);t.setXY(r,n,i)}},"#convertUVs"));q(this,Sp,t),d(this,Sp).entityScene=t.entityScene,d(this,Sp).geometry3DMap=t.geometry3DMap}destroy(){q(this,oy,null)}};oy=new WeakMap,Sp=new WeakMap,j3=new WeakMap,vh=new WeakSet,hie=o(async function(){if(!d(this,oy)){let{GLTFExporter:t}=await import("./GLTFExporter-U7TU265Z.js");q(this,oy,new t)}return d(this,oy)},"#getGLTFExporter"),c2=new WeakMap,G3=new WeakMap,mie=o(function(t){var l,c;let r=[],i=((l=t.userData)!=null&&l.entities?Object.values((c=t.userData)==null?void 0:c.entities):[]).map(p=>d(this,Sp).geometry3DMap.get(p)),s=new Map;return i.forEach(p=>{var C;if(!p||!(p instanceof mn))return;let h=p.components[1],y=p.components[2];if(!h.visible||h instanceof Lc&&h.opacity===0||h instanceof Lb||h instanceof _S)return;let b=y!=null&&y.hover?h.hoverColor||d(this,Sp).hoverColor:h.color,_="".concat(b,"-").concat(h.opacity,"-").concat(Number(h.visible));s.has(_)||s.set(_,[]),(C=s.get(_))==null||C.push(p)}),s.forEach((p,h)=>{let[y,b,_]=h.split("-"),C=p.reduce((O,D)=>{if(D.type==="custom-geometry")return O;let A=D.components[0];return"geometry"in A&&A.geometry instanceof TN&&O.push(A.geometry),O},[]),P=d(this,G3).call(this,y,Number(b),t.material.transparent),E=Ll(C,!0),T=new jt(E,P);T.position.copy(t.position),T.rotation.copy(t.rotation),T.scale.copy(t.scale),T.visible=!!_,d(this,d2).call(this,T.position,T.scale,T.rotation,T.quaternion),r.push(d(this,p2).call(this,T))}),r},"#processBatchedMesh"),gie=o(function(t){let r=t.geometry.clone(),n=t.material,i=new _o({color:n.color,side:Wp});i.opacity=n.opacity,i.transparent=n.transparent;let s=new e0(r,i);return s.position.copy(t.position),s.rotation.copy(t.rotation),s.scale.copy(t.scale),s.visible=t.visible,d(this,p2).call(this,s)},"#processLineSegments"),p2=new WeakMap,U3=new WeakMap,f2=new WeakMap,d2=new WeakMap,V3=new WeakMap,o(lD,"ExporterSystem");var u2=lD;g();g();g();var pD=Pn(Pie());function Tie(e){this.name="JSClipperError",this.message=e,this.stack=new Error().stack}o(Tie,"JSClipperError");Tie.prototype=Error.prototype;pD.default.Error=function(e){throw new Tie(e)};var Do=pD.default;var sLe="gray",aLe=.1,g2=100,fD=new Do.ClipperOffset;function lLe(e,t){fD.Clear(),t/=2;let r=e.map(i=>({X:i.x*g2,Y:i.y*g2}));fD.AddPath(r,Do.JoinType.jtMiter,Do.EndType.etClosedPolygon);let n=new Do.Paths;return fD.Execute(n,t*g2),n.length?n.map(s=>s.map(l=>({x:l.X/g2,y:l.Y/g2}))):[e]}o(lLe,"offset");function Y3(e,t,r){var _,C,P,E,T;let{color:n=sLe,opacity:i=1,altitude:s=0,height:l=aLe}=r||{};Array.isArray(i)&&(i=1);let c={min:{x:1/0,y:1/0,z:s},max:{x:-1/0,y:-1/0,z:l+s},center:{x:0,y:0,z:(l+s)/2}},h=e.geometry.coordinates[0].map(O=>{let D=t(O[1],O[0]);return c.min.x=Math.min(c.min.x,D.x),c.min.y=Math.min(c.min.y,D.y),c.max.x=Math.max(c.max.x,D.x),c.max.y=Math.max(c.max.y,D.y),D});((C=(_=e.properties)==null?void 0:_.style)==null?void 0:C.edgeOffset)!=null&&e.properties.style.edgeOffset!==0||((P=e.properties)==null?void 0:P.image)!=null?h=lLe(h,((T=(E=e.properties)==null?void 0:E.style)==null?void 0:T.edgeOffset)||0):h=[h];let y=[];for(let O of h){let D=new Pc;D.moveTo(O[0].x,O[0].y),O.slice(1).forEach(X=>D.lineTo(X.x,X.y)),D.lineTo(O[0].x,O[0].y);let A=e.geometry.coordinates.slice(1);D.holes=A.map(X=>{let Y=X.map(Z=>t(Z[1],Z[0])),N=new Od;return N.moveTo(Y[0].x,Y[0].y),Y.slice(1).forEach(Z=>N.lineTo(Z.x,Z.y)),N.lineTo(Y[0].x,Y[0].y),N});let R={bevelEnabled:!1,depth:l},j=new Tc(D,R);j.userData={style:{color:n,opacity:i}},y.push(j)}if(y.length===1)return y[0];let b=Ll(y);return b.userData={style:{color:n,opacity:i},_split:!0},b}o(Y3,"renderPolygonGeometry");g();var uLe="gray",cLe=.1;function Z3(e,t,r){let{color:n=uLe,opacity:i=1,altitude:s=0,height:l=cLe}=r||{};Array.isArray(i)&&(i=1);let c={min:{x:1/0,y:1/0,z:s},max:{x:-1/0,y:-1/0,z:l+s}},p={bevelEnabled:!1,depth:l},h=[];e.geometry.coordinates.forEach(b=>{let _=new Pc,C=b[0].map(T=>{let O=t(T[1],T[0]);return c.min.x=Math.min(c.min.x,O.x),c.min.y=Math.min(c.min.y,O.y),c.max.x=Math.max(c.max.x,O.x),c.max.y=Math.max(c.max.y,O.y),O});_.moveTo(C[0].x,C[0].y),C.slice(1).forEach(T=>_.lineTo(T.x,T.y)),_.lineTo(C[0].x,C[0].y);let P=b.slice(1);_.holes=P.map(T=>{let O=T.map(A=>t(A[1],A[0])),D=new Od;return D.moveTo(O[0].x,O[0].y),O.slice(1).forEach(A=>D.lineTo(A.x,A.y)),D.lineTo(O[0].x,O[0].y),D});let E=new Tc(_,p);h.push(E)});let y=Ll(h);return y.translate(0,0,s||0),y.userData={style:{color:n,opacity:i}},y}o(Z3,"renderMultiPolygonGeometry");g();var pLe="gray",dD=new Do.ClipperOffset,ba=100;function Eie(e,t,r){let{color:n=pLe,opacity:i=1,width:s=1,join:l="round",cap:c="round",height:p=.01,altitude:h=0}=r||{};Array.isArray(i)&&(i=0);let y=[];for(let E=0;E<e.geometry.coordinates.length-1;E++){let T=t(e.geometry.coordinates[E][1],e.geometry.coordinates[E][0]),O=t(e.geometry.coordinates[E+1][1],e.geometry.coordinates[E+1][0]);y.push([T,O])}dD.AddPaths(y.map(E=>E.map(T=>({X:T.x*ba,Y:T.y*ba}))),l==="round"?Do.JoinType.jsRound:l==="miter"?Do.JoinType.jsMiter:Do.JoinType.jsSquare,c==="round"?Do.EndType.etOpenRound:c==="butt"?Do.EndType.etOpenButt:Do.EndType.etOpenSquare);let b=new Do.PolyTree;dD.Execute(b,s/2*ba);let _=[],C={bevelEnabled:!1,depth:p};for(let E of b.m_AllPolys){let T=new Pc;if(E.IsHole())continue;let O=E.m_polygon;T.moveTo(O[0].X/ba,O[0].Y/ba),O.slice(1).forEach(D=>T.lineTo(D.X/ba,D.Y/ba)),T.lineTo(O[0].X/ba,O[0].Y/ba),T.holes=E.m_Childs.map(D=>{let A=new Od,R=D.m_polygon;return A.moveTo(R[0].X/ba,R[0].Y/ba),R.slice(1).forEach(j=>A.lineTo(j.X/ba,j.Y/ba)),A.lineTo(R[0].X/ba,R[0].Y/ba),A}),_.push(new Tc(T,C))}let P=Ll(_);return P.translate(0,0,h||0),P.userData={style:{color:n,opacity:i}},dD.Clear(),P}o(Eie,"renderLineStringGeometry");g();var xa=100,fLe=.22,dLe=.01;function Mie(e,t,r={}){let{width:n=fLe,height:i=dLe,color:s="gray",opacity:l=1,altitude:c=0}=r,p={min:{x:1/0,y:1/0,z:c},max:{x:-1/0,y:-1/0,z:c+i}},h={bevelEnabled:!1,depth:i},y=new Do.ClipperOffset,b=e.geometry.coordinates.map(E=>E.map(T=>t(T[1],T[0])));y.AddPaths(b.map(E=>E.map(T=>({X:T.x*xa,Y:T.y*xa}))),Do.JoinType.jsMiter,Do.EndType.etOpenRound);let _=new Do.PolyTree;y.Execute(_,n/2*xa);let C=[];for(let E of _.m_AllPolys){let T=new Pc;if(E.IsHole())continue;p.min.x=Math.min(p.min.x,E.m_polygon[0].X),p.min.y=Math.min(p.min.y,E.m_polygon[0].Y),p.max.x=Math.max(p.max.x,E.m_polygon[0].X),p.max.y=Math.max(p.max.y,E.m_polygon[0].Y);let O=E.m_polygon;T.moveTo(O[0].X/xa,O[0].Y/xa),O.slice(1).forEach(D=>T.lineTo(D.X/xa,D.Y/xa)),T.lineTo(O[0].X/xa,O[0].Y/xa),T.holes=E.m_Childs.map(D=>{let A=new Od,R=D.m_polygon;return A.moveTo(R[0].X/xa,R[0].Y/xa),R.slice(1).forEach(j=>A.lineTo(j.X/xa,j.Y/xa)),A.lineTo(R[0].X/xa,R[0].Y/xa),A}),C.push(new Tc(T,h))}let P=Ll(C);return P.translate(0,0,c||0),P.userData={style:{color:s,opacity:l}},y.Clear(),P}o(Mie,"renderMultiLineStringGeometry");g();g();var xv=le.object({type:le.enum(["Point"]),coordinates:le.array(le.number()).min(2).max(3)});var hLe=le.object({rotation:le.array(le.number()).length(3).optional(),altitude:le.number().optional(),scale:le.array(le.number()).length(3).optional(),interactive:le.boolean().optional(),verticalOffset:le.number().optional(),id:le.union([le.number(),le.string()]).optional()}),mLe=le.object({type:le.enum(["Feature"]),geometry:xv,properties:hLe}),gLe=le.object({type:le.enum(["FeatureCollection"]),features:le.array(mLe)}),yLe=le.object({color:le.string()}),vLe=le.object({url:le.string(),color:le.string().optional(),opacity:le.number().optional(),material:le.record(le.string(),yLe).optional()});function Lie(e,t,r){le.union([le.number(),le.string()]).parse(e),gLe.parse(t),vLe.parse(r)}o(Lie,"validateModelGroup");var y2,v2,hD=class hD{constructor(t){x(this,"mesh");x(this,"type","model");x(this,"positionDirty",!0);x(this,"outline");x(this,"geometry");x(this,"material");x(this,"feature");x(this,"instanceIndex",-1);x(this,"visible",!0);x(this,"color",new An);x(this,"position",new ht);G(this,y2,0);G(this,v2,1);this.feature=t}setOpacity(){}setColor(){}get altitude(){return d(this,y2)}set altitude(t){this.mesh&&(this.mesh.position.z=t,q(this,y2,t))}getRotation(){return this.mesh?[this.mesh.rotation.x,this.mesh.rotation.y,this.mesh.rotation.z]:void 0}setRotation(t){this.mesh&&this.mesh.rotation.set(Yt.degToRad(t[0]),Yt.degToRad(t[1]),Yt.degToRad(t[2]))}getScale(){return this.mesh?[this.mesh.scale.x,this.mesh.scale.y,this.mesh.scale.z]:void 0}setScale(t){this.mesh&&this.mesh.scale.set(t[0],t[1],t[2])}get opacity(){return d(this,v2)}set opacity(t){var r,n,i;if(this.mesh){if(this.mesh.children[0]instanceof Md){for(let s of this.mesh.children)if(s instanceof Md){((r=s.userData)==null?void 0:r.originalOpacity)===void 0&&(s.userData.originalOpacity=s.material.opacity);let l=Ol(t,0,(n=s.userData)==null?void 0:n.originalOpacity,0,1);s.material.opacity=l,s.material.transparent=l<1,s.material.needsUpdate=!0}}else(i=this.mesh)==null||i.traverse(s=>{s instanceof jt&&s.material&&(Array.isArray(s.material)?s.material.forEach(l=>{Oie(l,t)}):Oie(s.material,t))});q(this,v2,t)}}};y2=new WeakMap,v2=new WeakMap,o(hD,"ModelComponent");var Ih=hD;function Oie(e,t){e.opacity!==t&&(t===1?(e.opacity=1,e.transparent=!1):(e.opacity=t,e.transparent=!0),e.needsUpdate=!0)}o(Oie,"updateMaterialOpacity");g();function K3(e){var c,p;let t=e.components[0],r=e.components[1];r.opacity!=null&&r.opacity!==t.opacity&&(t.opacity=r.opacity);let n=r.material,i=r.color;if(n||i){let h=bLe(i,n);(c=t.mesh)==null||c.traverse(y=>{y instanceof jt&&y.material&&(Array.isArray(y.material)?y.material.forEach(b=>{h[b.name]?b.color.set(h[b.name].color):b.color.set(i)}):h[y.material.name]?y.material.color.set(h[y.material.name].color):y.material.color.set(i))})}let s=(p=t.feature.geometry.coordinates[2])!=null?p:0,l=r.verticalOffset+s;t.altitude!==l&&(t.altitude=l),r.visible!==t.visible&&(t.visible=r.visible),r.rotation&&t.setRotation(r.rotation),r.scale&&t.setScale(r.scale)}o(K3,"applyModelGeometryStyle");function bLe(e,t){let r={};if(e&&Object.assign(r,{Default:{color:e},Fabric:{color:e},Mpdn_Logo:{color:e},CouchLogo:{color:e}}),t)for(let n in t)t[n].color&&(r[n]?r[n].color=t[n].color:r[n]={color:t[n].color});return r}o(bLe,"consolidateColorAndMaterial");function Aie(e,t){var l,c;let r=e.components[0],i=(l=e.components[1].verticalOffset)!=null?l:0,s=r.feature.geometry.coordinates.slice();s[2]=((c=s[2])!=null?c:0)+i,r.mesh?r.mesh.position.copy(t(s)):r.position.copy(t(s))}o(Aie,"applyModelPosition");function xLe(e){let{color:t,opacity:r,topColor:n,texture:i,topTexture:s}=e;return"".concat(t).concat(r).concat(n||"").concat(i||"").concat(s||"")}o(xLe,"generateIndex");var ILe=1e4,mD=class mD extends Lt{constructor(r,n){super();x(this,"state");x(this,"convertTo3DMapPosition");x(this,"loader");x(this,"optimizePromise",[]);this.state=r,this.convertTo3DMapPosition=n}async getGLTFLoader(){if(this.loader)return this.loader;let{GLTFLoader:r}=await import("./GLTFLoader-6MJPEGD7.js");return this.loader=new r,this.loader}createEntityFromFeature(r,n,i){var c,p;let s=new Mi(n),l=new mn(s,new Lc(re(k({},i),{url:(p=(c=n.properties)==null?void 0:c.image)==null?void 0:p.path})));return i!=null&&i.outline&&(l.components[3]=new gv(k3(i.color))),l.id=r,l}createModelFromFeature(r,n,i){let s=new Ih(n),l=k({},i);n.properties.verticalOffset!=null&&(l.verticalOffset=n.properties.verticalOffset),n.properties.rotation!=null&&(l.rotation=n.properties.rotation),n.properties.scale!=null&&(l.scale=n.properties.scale);let c=new _S(l),p=new mn(s,c);return p.id=r,p}populateEntityMesh(r,n){let i=r.components[0];i.geometry=n,i.currentHeight=r.components[1].height,i.dirty=!1}async populateModelGroup(r,n,i){let s=new Su,l=new Yp,c=new Eb,p=new ht,h=new Eu,y=await this.getGLTFLoader(),b=new Promise(_=>{y.load(n,C=>{"entities3D"in i.userData&&(i.userData.entities3D.size>1?C.scene.traverse(P=>{let E=P;if("isMesh"in E&&E.isMesh===!0){let T=new Md(E.geometry,E.material,r.size);T.userData={entities:{}},h.add(T),i.add(h)}}):(C.scene.traverse(P=>{"isMesh"in P&&P.isMesh===!0&&(P.position.set(0,0,0),P.rotation.set(0,0,0),P.scale.set(1,1,1),P.updateMatrix())}),h.add(C.scene),i.add(h),h.userData.isSingleModel=!0,h.userData.entityId=r.values().next().value,h.userData.type="model")),_()})});return this.optimizePromise.push(b.then(()=>{var P,E,T,O,D,A,R,j,X,Y,N,Z;let _=0,C;for(let ae of r.values()){if(C=this.state.geometry3DMap.get(ae),!C||(C==null?void 0:C.type)!=="model")continue;let se=C.components[0],U=C.components[1],xe=C.components[0].feature;se.mesh=h,se.instanceIndex=_,K3(C),C.components[1].dirty=!1;let{x:ne,y:Pe}=this.convertTo3DMapPosition(xe.geometry.coordinates[1],xe.geometry.coordinates[0],0);se.position.set(ne,Pe,se.altitude),l.set(Yt.degToRad((E=(P=U.rotation)==null?void 0:P[0])!=null?E:l0[0]),Yt.degToRad((O=(T=U.rotation)==null?void 0:T[1])!=null?O:l0[1]),Yt.degToRad((A=(D=U.rotation)==null?void 0:D[2])!=null?A:l0[2])),p.set((j=(R=U.scale)==null?void 0:R[0])!=null?j:a0[0],(Y=(X=U.scale)==null?void 0:X[1])!=null?Y:a0[1],(Z=(N=U.scale)==null?void 0:N[2])!=null?Z:a0[2]),c.setFromEuler(l),s.compose(se.position,c,p),h.children.forEach(Ce=>{!C||(C==null?void 0:C.type)!=="model"||!(Ce instanceof Md)||(Ce.setMatrixAt(_,s),Ce.userData.entities[_]=C.id)}),se.mesh.userData.isSingleModel&&(se.mesh.matrix.copy(s),se.mesh.matrix.decompose(se.mesh.position,se.mesh.quaternion,se.mesh.scale)),_++}this.publish("model-loaded")})),h}populateEntityGroup(r){var c;let n,i,s,l;for(let p of r.values())l=this.state.geometry3DMap.get(p),l.components[0]instanceof Mi&&(i=l.components[0].feature,s=l.components[1],i.geometry.type==="Polygon"?(n=Y3(i,this.convertTo3DMapPosition,s),(c=i.properties)!=null&&c.textures&&i.properties.textures.length>0&&Yne(n,i.properties.textures,this.state.naturalBearing,this.convertTo3DMapPosition),this.populateEntityMesh(l,n)):i.geometry.type==="MultiPolygon"?(n=Z3(i,this.convertTo3DMapPosition,s),this.populateEntityMesh(l,n)):i.geometry.type==="LineString"?(n=Eie(i,this.convertTo3DMapPosition,s),this.populateEntityMesh(l,n)):i.geometry.type==="MultiLineString"&&(n=Mie(i,this.convertTo3DMapPosition,s),this.populateEntityMesh(l,n)));return r}optimize(r){var n;if((r.visible||r.userData.preloadGeometry)&&(r instanceof Fs||r instanceof Ar)){for(let l of r.children)this.optimize(l);if(r instanceof Ar||r.userData.dirty===!1)return;let i={};if(!r.userData.modelURL&&r.userData.dirty)try{this.populateEntityGroup(r.userData.entities3D)}catch(l){ce.warn(l)}else r.userData.modelURL&&r.userData.dirty&&(this.populateModelGroup(r.userData.entities3D,r.userData.modelURL,r),r.userData.dirty=!1);let s=0;if(r.userData.dirty){let l=0,c;for(let p of r.userData.entities3D.values()){c=this.state.geometry3DMap.get(p);let h=c==null?void 0:c.components[0];if((c==null?void 0:c.type)==="geometry"){let y=c.components[1];l++,l>=ILe&&(l=0,s++);let b=xLe(y)+s;i[b]===void 0&&(i[b]={style:y,entities:[]}),i[b].entities.push(c)}else h&&"mesh"in h&&h.mesh&&((n=h.mesh)==null?void 0:n.parent)!==r&&r.add(h.mesh)}for(let p in i){let h=Xne(i[p].entities,i[p].style);r.add(h),r.userData.dirty=!1}for(let p of r.userData.entities3D.values())if(c=this.state.geometry3DMap.get(p),c!=null&&c.entities2D.size>0)for(let h of c.entities2D.values())h&&(c.attach(h),this.publish("geometry-2d-added"))}}}update(){return this.optimizePromise=[],this.optimize(this.state.entityScene),this.optimizePromise.length>0?Promise.all(this.optimizePromise):void 0}};o(mD,"MeshCreationAndOptimizationSystem");var J3=mD;g();var gD=class gD{constructor(t,r){x(this,"state");x(this,"dirty",!0);x(this,"domTree");this.state=t,this.domTree=r}update(){if(this.dirty){let t;for(let r of Array.from(this.domTree.children))if(t=this.state.geometry2DMap.get(r.userData.entityId),t){let n=t.components[0];(!n.enabled||!n.visible||!this.state.geometry2DIdsInScene.has(r.userData.entityId))&&this.domTree.removeChild(r)}else this.domTree.removeChild(r);for(let r of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(r),t){let n=t.components[0];n instanceof xp&&n.enabled&&n.markerContainer&&!this.domTree.contains(n.markerContainer)&&(n.markerContainer.userData={entityId:t.id},this.domTree.appendChild(n.markerContainer),n.updateDimensions())}this.dirty=!1}}};o(gD,"DOMVisibilitySystem");var Q3=gD;g();var yD=class yD{constructor(t,r){x(this,"state");x(this,"project");this.state=t,this.project=r}update(){let t,r=0,n,i;for(let s of this.state.geometry2DIdsInScene)if(t=this.state.geometry2DMap.get(s),t){i=t.components[0];let l=t.attachedTo?this.state.geometry3DMap.get(t.attachedTo):void 0;if(l instanceof mn)if(this.state.geometry3DIdsInScene.has(l.id)){n=l.components[1],i=t.components[0],(n.dirty||t.components[0].attachedDirty)&&(r=n.height,t.setAltitude(r));let c=n.visible&&n.opacity>0;i.visible!==c&&(i.visible=c)}else i.visible===!0&&(i.visible=!1);this.project(t.components[0].projection,t.position),t.components[0].attachedDirty=!1}}};o(yD,"TwoDProjectionSystem");var eT=yD;g();g();var _Le=o(function(){let t,r;return n=>{if((!r||!r)&&(t=document.createElement("canvas"),t.width=500*n,t.height=500*n,t.style.width="500px",t.style.height="500px",r=t.getContext("2d")),!r)throw new Error("Could not get 2D context");return{measureCanvas:t,measureCanvasContext:r}}},"createMeasureCanvasContext")(),Die=o(({text:e,size:t,maxWidth:r,pixelRatio:n,maxLines:i=2,lineHeight:s=1.2,options:l={strokeText:!0}})=>{let c="bold ".concat(t*n,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),{measureCanvasContext:p}=_Le(n);p.font=c;let h=[],y=e.split(" "),b=0,_=0,C=0;for(;_<y.length;){let O=y[_];if(b===i&&b>0){h[b-1]+="...";break}if(h[b]==null&&(h[b]=O,_++),y.length===1){h[b]=O;break}if(y[_]==null)break;let{width:D}=p.measureText(h[b]+" "+y[_]);D<=r*n?(h[b]+=" "+y[_],_++):b++}h.forEach(O=>{let{width:D}=p.measureText(O);C=Math.max(D,C)});let P=t*n*s,E=h.length*P;return{maxWidth:C,maxHeight:E,lines:h.length,draw:o((O,D,A)=>{h.length===1?(l.strokeText&&O.strokeText(h[0],D,A),O.fillText(h[0],D,A)):(l.strokeText&&(O.strokeText(h[0],D,A-P/2),O.strokeText(h[1],D,A+P/2)),O.fillText(h[0],D,A-P/2),O.fillText(h[1],D,A+P/2))},"draw")}},"shaveText");g();function Fie(e){let t=new Image;return e&&(/<svg[\s\S]*>/i.test(e)?t.src="data:image/svg+xml;base64,".concat(btoa(e)):t.src=e),t}o(Fie,"createImage");var SLe=3.5,CLe=2.5,wLe=2,PLe=5,b2=2.5;var vD=class vD extends Lt{constructor(r,n,i){super();x(this,"dirty",!1);x(this,"state");x(this,"colliderContext");x(this,"colliderCanvas");x(this,"transformRequestFunc");x(this,"transformRequest",o(async r=>this.transformRequestFunc?await this.transformRequestFunc(r):{url:r},"transformRequest"));x(this,"pinCache",{});x(this,"imageCache",{});x(this,"imagePromiseCache",{});x(this,"imageDimensionsCache",{});x(this,"textCache",{});x(this,"update",o(r=>{let n=this.state.pixelRatio;this.colliderContext.clearRect(0,0,this.colliderCanvas.width,this.colliderCanvas.height);let i,s,l,c,p,h,y;for(let b of this.state.geometry2DIdsInScene)if(y=this.state.geometry2DMap.get(b),y!=null&&(h=y.components[0],h instanceof Ip&&!y.disposed)){if(p=h.appearance.marker.iconVisibleAtZoomLevel,h.appearance.marker.icon!=null&&p&&r>=p!==h.iconVisible&&(h.iconVisible=r>=p,h.dirty=!0),(h.dirty||this.dirty)&&h.calculateMarkerSize(),s=h.appearance.marker.foregroundColor,l=h.appearance.marker.backgroundColor,c=r0(h.markerSize,2),i="".concat(s.active,"-").concat(s.inactive,"-").concat(l.active,"-").concat(l.inactive,"-").concat(c,"-").concat(h.iconVisible),h.labelCacheId=i,(!this.pinCache[i]||this.dirty)&&(this.prepare(h,i,this.colliderContext),h.dirty=!0),(h.appearance.marker.icon&&(!h.imageHash||h.markerDirty)||this.dirty)&&this.cacheImage(h),this.textCache[h.id]==null||h.textDirty||this.dirty){h.dirty=!0,this.textCache[h.id]={};let{textDrawFn:C,width:P,height:E}=this.processText(h.text,h.appearance.text.size,h.appearance.text.maxWidth,h.appearance.text.numLines,h.appearance.text.lineHeight);["left","center","right"].forEach(T=>{this.textCache[h.id][T]=this.textToCanvas(C,h.appearance.text.size,T,P,E,h.appearance.text.foregroundColor,h.appearance.text.backgroundColor)}),h.dimensions={width:Math.ceil(P/n),height:Math.ceil(E/n)}}let _=1;if(h.appearance.marker.iconSizeInterpolation&&h.appearance.marker.iconSize){let{minZoomLevel:C,maxZoomLevel:P,minScale:E,maxScale:T}=h.appearance.marker.iconSizeInterpolation;_=Ol(r,C,P,E,T)}h.recomputeCurrentStrategy(h.iconVisible?_:1),h.canShow&&h.visible&&(h.enabled||h.visibilityNeedsUpdate!==!1)&&this.draw(h,i,this.colliderContext),h.textDirty=!1,h.markerDirty=!1}this.dirty=!1},"update"));x(this,"processText",o((r,n,i,s,l)=>{let c=this.state.pixelRatio,{draw:p,maxWidth:h,maxHeight:y}=Die({text:r,size:n,pixelRatio:c,maxWidth:i,maxLines:s,lineHeight:l});return{textDrawFn:p,width:h+b2*c*2,height:y+b2*c*2}},"processText"));x(this,"textToCanvas",o((r,n,i,s,l,c,p)=>{let h=this.state.pixelRatio,y,b=s,_=l;window.OffscreenCanvas!=null&&!QN()?y=new OffscreenCanvas(b,_):(y=document.createElement("canvas"),y.width=b,y.height=_,y.style.width=b+"px",y.style.height=_+"px");let C=y.getContext("2d",{willReadFrequently:!0});if(!C)return;C.textAlign=i,C.font="bold ".concat(n*h,"px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif"),C.textBaseline="middle",C.lineJoin="miter",C.miterLimit=2,C.strokeStyle="white",C.lineWidth=b2*h,C.fillStyle=c,C.strokeStyle=p;let P=i==="left"?0:i==="center"?b/2:b-b2*h/2;return r(C,P,(_+b2*h/2)/2),y},"textToCanvas"));x(this,"cacheImage",o(r=>{if(!r.appearance.marker.icon)return;let n=sk(r.appearance.marker.icon);this.imagePromiseCache[n]||(this.imagePromiseCache[n]=new Promise(i=>{this.transformRequest(r.appearance.marker.icon).then(s=>{let l=Fie(s.url);l.onload=()=>{this.imageCache[n]=l,this.publish("img:loaded"),i(l)}})})),r.imageHash!==n&&(r.imageHash=n,this.imagePromiseCache[n].then(()=>{r.dirty=!0}))},"cacheImage"));x(this,"createPinCanvas",o((r,n,i,s,l=1)=>{let c,p=this.state.pixelRatio,h=r.totalMarkerSize*2*p*l;window.OffscreenCanvas!=null?c=new OffscreenCanvas(h,h):(c=document.createElement("canvas"),c.width=h,c.height=h,c.style.width=h/p+"px",c.style.height=h/p+"px");let y=c.getContext("2d");return y.shadowColor="rgba(0,0,0,0.3)",y.shadowOffsetY=wLe*p,y.shadowBlur=PLe*p,y.beginPath(),y.arc(h/2,h/2,(n/2+CLe*p/2)*l,0,2*Math.PI),y.fillStyle=i,y.fill(),y.beginPath(),y.arc(h/2,h/2,n/2*l,0,2*Math.PI),y.shadowColor="transparent",y.fillStyle=s,y.fill(),c},"createPinCanvas"));x(this,"prepare",o((r,n,i)=>{var p,h;let s=this.state.pixelRatio;i.lineWidth=4*s;let l=this.createPinCanvas(r,r.markerSize,r.appearance.marker.backgroundColor.active,r.appearance.marker.foregroundColor.active,(p=r.appearance.marker.iconSizeInterpolation)==null?void 0:p.maxScale),c=this.createPinCanvas(r,r.iconVisible?r.markerSize:SLe*s,r.appearance.marker.backgroundColor.inactive,r.appearance.marker.foregroundColor.inactive,(h=r.appearance.marker.iconSizeInterpolation)==null?void 0:h.maxScale);this.pinCache[n]=[l,c]},"prepare"));this.state=r,this.colliderCanvas=n,this.colliderContext=n.getContext("2d"),this.transformRequestFunc=i}draw(r,n,i){var h,y;if(!r.canShow||!r.visible)return;i.save(),i.globalAlpha=r.opacity;let s=this.state.pixelRatio,l=r.projection.x*s,c=r.projection.y*s,p=r.style.pinVisibility===1?this.pinCache[n][0]:this.pinCache[n][1];if(i.drawImage(p,l-r.totalMarkerSize*s,c-r.totalMarkerSize*s,r.totalMarkerSize*2*s,r.totalMarkerSize*2*s),r.appearance.marker.icon&&r.iconVisible&&r.imageHash&&r.appearance.marker.iconSize&&this.imageCache[r.imageHash]){let b=this.imageCache[r.imageHash],_=(r.totalMarkerSize-r.scaledIconPadding)*s,C=r.appearance.marker.iconFit,P=_,E=_,T="".concat(r.imageHash,"_").concat(C);if(this.imageDimensionsCache[T])P=this.imageDimensionsCache[T].width,E=this.imageDimensionsCache[T].height;else{let O=b.width*s,D=b.height*s;if(C==="contain"){let A=Math.sqrt(O**2+D**2),R=_/A;P=O*R,E=D*R}if(C==="cover"){let A=_/O,R=_/D,j=Math.max(A,R);P=O*j,E=D*j}}i.save(),i.beginPath(),i.arc(l,c,_/2,0,2*Math.PI),i.closePath(),((y=(h=r==null?void 0:r.appearance)==null?void 0:h.marker)==null?void 0:y.iconOverflow)!=="visible"&&i.clip(),i.drawImage(b,l-P/2,c-E/2,P,E),i.restore()}r.style.textLabelVisible&&r.style.textAlign!=null&&r.style.left!=null&&r.style.top!=null&&i.drawImage(this.textCache[r.id][r.style.textAlign],l+r.style.left*s,c+r.style.top*s),i.restore()}};o(vD,"TwoDDrawSystem");var tT=vD;g();g();var _h=class _h{constructor(){x(this,"loader");this.loader=new t0}static getInstance(){return _h.instance||(_h.instance=new _h),_h.instance}getLoader(){return this.loader}load(t){return new Promise((r,n)=>{this.loader.load(t,r,void 0,n)})}};o(_h,"TextureLoaderSingleton"),x(_h,"instance");var bD=_h,Sh=bD.getInstance();function TLe(e,t){let r=e.components[2],n=e.components[1];return r!=null&&r.hover?[n.hoverColor||t,n.hoverColor||t]:[n.color,n.topColor||n.color]}o(TLe,"processColor");var uy,x2,xD=class xD extends Lt{constructor(r,n){super();G(this,uy);x(this,"state");x(this,"convertTo3DMapPosition");x(this,"textureLoadingCache",new Map);this.convertTo3DMapPosition=n,this.state=r}setShading(r,n){r.material&&r.material.setGradientShading(n.start,n.end,n.intensity)}processTextures(r,n,i){var s;if(n.texture!==r.texture&&n.texture!==""&&ke(this,uy,x2).call(this,n.texture,r,"texture"),n.topTexture!==r.topTexture&&n.topTexture!==""&&ke(this,uy,x2).call(this,n.topTexture,r,"topTexture"),(r.texture==null||r.topTexture==null)&&Array.isArray((s=r.feature.properties)==null?void 0:s.textures)&&r.feature.properties.textures.length>0)for(let l of r.feature.properties.textures)l.face==="top"&&r.topTexture!==l.path?ke(this,uy,x2).call(this,l.path,r,"topTexture"):l.face==="side"&&r.texture!==l.path&&ke(this,uy,x2).call(this,l.path,r,"texture"),r.blendTexture=!0;(r.texture!=null||r.topTexture!=null)&&(i!=null&&i.hover&&r.texturesVisible?r.hideTextures():r.texturesVisible||r.showTextures(),n.texture===""&&r.removeSideTexture(),n.topTexture===""&&r.removeTopTexture())}update(){var s,l,c,p,h,y,b,_;let r,n,i;for(let C of this.state.geometry3DIdsInScene)if(i=this.state.geometry3DMap.get(C),i instanceof Fs&&i.type==="geometry-group"){let P=i.components[0];if(i.userData.shadingDirty){let E=i.userData.entities3D.values().next().value;if(E==null)continue;let T=this.state.geometry3DMap.get(E);T instanceof mn&&(T.type==="geometry"||T.type==="custom-geometry")&&(r=T.components[0],i.userData.shadingDirty&&P.shading&&this.setShading(r,P.shading));let O,D;for(let A of i.userData.entities3D.values())O=this.state.geometry3DMap.get(A),D=O.components[0],O.type==="geometry"&&D.detached&&i.userData.shadingDirty&&P.shading&&this.setShading(D,P.shading);i.userData.shadingDirty=!1}if(P.dirty){let E=i.getfirstChildEntityId();if(E){let O=this.state.geometry3DMap.get(E),D=O==null?void 0:O.components[0];D instanceof Mi&&this.processTextures(D,P)}let T=P.opacity*am(i);i.getOpacity()!==T&&i.setOpacity(T),P.dirty=!1}}else if(i&&(i.type==="geometry"||i.type==="custom-geometry")&&((s=i.components[1])!=null&&s.dirty||(l=i.components[2])!=null&&l.dirty)){let P=i.components[0],E=i.components[1];n=i.components[2];let T=TLe(i,this.state.hoverColor);if(P.setColor(T[0],T[1]),E.visible!==P.visible&&(P.visible=E.visible,P instanceof Mi&&P.textMesh)){let D=this.state.geometry3DMap.get(P.textMesh.userData.entityId);(D==null?void 0:D.type)==="text3d"&&D.components[0].polygonEntityId!=null&&(D.components[0].visible=E.visible)}E.altitude!==P.altitude&&(P.altitude=E.altitude);let O=E.opacity*am(i);O!==P.opacity&&(P.opacity=O),E.renderOrder!==P.renderOrder&&(P.renderOrder=E.renderOrder),E.dirty=!1,P instanceof Mi&&this.processTextures(P,E,n),i.components[2]&&(i.components[2].dirty=!1)}else if((i==null?void 0:i.type)==="model")i.components[1].dirty&&(K3(i),i.components[1].dirty=!1),i.components[0].positionDirty&&(Aie(i,this.convertTo3DMapPosition),i.components[0].positionDirty=!1);else if((i==null?void 0:i.type)==="image"&&((c=i.components[1])!=null&&c.dirty)){r=i.components[0];let P=i.components[1];P.visible!==r.visible&&(r.visible=P.visible),P.dirty=!1}else if((i==null?void 0:i.type)==="text3d"&&((p=i.components[1])!=null&&p.dirty)&&i.components[0].polygonEntityId!=null){r=i.components[0];let P=i.components[1];P.visible!=null&&P.visible!==r.visible&&(r.visible=P.visible);let{textMesh:E}=r;if(E){Object.assign(E,P.getState());let T=(h=P.hoverColor)!=null?h:this.state.text3dHoverColor;E.color=P.hoverByPolygon?T:(y=P.color)!=null?y:s0.color,E.outlineColor=P.hoverByPolygon?T:(b=P.outlineColor)!=null?b:s0.outlineColor,E.strokeColor=P.hoverByPolygon?T:(_=P.strokeColor)!=null?_:s0.strokeColor}P.dirty=!1}}destroy(){this.textureLoadingCache.forEach(async r=>{(await r).dispose()}),this.textureLoadingCache.clear()}};uy=new WeakSet,x2=o(async function(r,n,i){if(!(!r||!n.showTextures))if(this.textureLoadingCache.has(r)){i==="topTexture"?n.topTexture=await this.textureLoadingCache.get(r):n.texture=await this.textureLoadingCache.get(r),n.showTextures();return}else{let s=new Promise((l,c)=>{Sh.getLoader().load(r,p=>{i==="topTexture"?n.topTexture=p:n.texture=p,n.showTextures(),this.publish("texture-loaded"),l(p)},void 0,()=>{ce.error("Failed to load texture: ".concat(r)),c("Failed to load texture: ".concat(r))})});this.textureLoadingCache.set(r,s)}},"#loadTexture"),o(xD,"DrawSystem");var rT=xD;g();var ID=class ID extends Lt{constructor(r){super();x(this,"state");x(this,"animating",new Map);x(this,"isAnimating",!1);x(this,"startTime",-1);x(this,"showDuration",300);x(this,"hideDuration",250);x(this,"update",o(()=>{this.animating.clear();let r,n;for(let i of this.state.geometry2DIdsInScene)r=this.state.geometry2DMap.get(i),r&&(n=r.components[0],n instanceof Ip&&(n.visibilityNeedsUpdate==="show"?(n.canShow=!0,this.animating.set(n,[n.opacity,1])):n.visibilityNeedsUpdate==="hide"&&this.animating.set(n,[n.opacity,0])));this.startTime=performance.now(),this.publish("animate:2d")},"update"));x(this,"playAnimations");this.state=r,this.playAnimations=this._playAnimations}_playAnimations(){let r=performance.now();for(let[n,[i,s]]of this.animating.entries()){let l=s===1?this.showDuration:this.hideDuration,c=(r-this.startTime)/l;n.opacity=Ol(c,0,1,i,s,s===0?ak:lk),r-this.startTime>=l&&(s===1?n.canShow=!0:s===0&&(n.canShow=!1),n.visibilityNeedsUpdate=!1,this.animating.delete(n))}this.publish("draw:2d"),this.animating.size>0&&this.publish("animate:2d")}};o(ID,"TwoDVisibilitySystem");var nT=ID;g();var _D=class _D extends Lt{constructor(r,n,i,s,l,c,p){super();x(this,"state");x(this,"renderer");x(this,"mode");x(this,"scene");x(this,"cameraObject");x(this,"viewCamera");x(this,"systems");x(this,"needs2DRecompute",!1);x(this,"twoDdirty",!0);x(this,"threeDdirty",!0);x(this,"frameId",null);x(this,"twoDFrameId",null);x(this,"animationFrameId",null);x(this,"nextFrame",null);x(this,"update",o((r=!1)=>{var n;if(((n=this.renderer)==null?void 0:n.renderer)==null)return Promise.resolve();if(r){let i=this.commitRenderState();return this.paint(),i}else return this.frameId?Promise.resolve():new Promise(i=>{this.frameId=requestAnimationFrame(()=>{var s,l;return((s=this.renderer)==null?void 0:s.renderer)==null?i():this.mode==="standalone"?(l=this.commitRenderState())==null?void 0:l.then(()=>{this.paint(),i()}):i()})})},"update"));x(this,"animate2D",o(()=>{this.animationFrameId=requestAnimationFrame(()=>{this.animationFrameId=null,this.systems.twoDVisiblitySystem.playAnimations()})},"animate2D"));x(this,"drawEntities2D",o(()=>{this.twoDFrameId||(this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel())}))},"drawEntities2D"));x(this,"updateEntities2D",o(()=>{this.twoDFrameId&&(cancelAnimationFrame(this.twoDFrameId),this.twoDFrameId=null),this.twoDFrameId=requestAnimationFrame(()=>{this.twoDFrameId=null,this.systems.watermarkSystem.insertIntoQuadTree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.interactionSystem.updateQuadtree(this.systems.collisionSystem.interactiveCollidersQTree),this.systems.twoDVisiblitySystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting())})},"updateEntities2D"));x(this,"commitRenderState",o(()=>{try{let r=[];this.frameId=null,this.publish("pre-render"),this.state.tweenGroup.update(),(this.mode==="outdoors-interleaved"||this.mode==="standalone")&&this.systems.cameraSystem.update(),this.state.shouldMeasureCanvas&&(this.state.shouldMeasureCanvas=!1,this.publish("measure-canvas")),this.twoDdirty&&(this.state.geometry2DIdsInScene.clear(),nk(this.state.entityScene,this.state.geometry2DIdsInScene),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.collidersDirty=!0,this.systems.domMutationSystem.dirty=!0,this.systems.panBoundsSystem.dirty=!0,this.twoDdirty=!1),this.threeDdirty&&(this.state.geometry3DIdsInScene.clear(),rk(this.state.entityScene,this.state.geometry3DIdsInScene),this.threeDdirty=!1,this.systems.interactionSystem.dirty3D=!0,this.systems.panBoundsSystem.dirty=!0,this.systems.outlineInterpolationSystem.geometries3DDirty=!0,this.systems.geometryInFocusSystem.focusablesDirty=!0);let n=this.systems.meshOptimizationSystem.update();n&&r.push(n),this.systems.meshModificationSystem.update(),this.systems.meshDetachmentSystem.update(),this.systems.imageSystem.update(this.systems.cameraSystem.getRotation()),r.push(this.systems.text3DSystem.update(this.systems.cameraSystem.getRotation())),this.systems.customGeometrySystem.update(),this.systems.panBoundsSystem.update(),this.systems.geometryInFocusSystem.update(this.systems.cameraSystem.isCameraMoving(),this.systems.cameraSystem.lastCameraStoppedMovingTime()),this.systems.stackSystem.update(),this.systems.outlineInterpolationSystem.update(this.systems.cameraSystem.getZoomLevel(),this.systems.cameraSystem.zoomDirty),this.systems.pathSystem.update(this.systems.cameraSystem.minZoomAltitude,this.systems.cameraSystem.maxZoomAltitude,this.systems.cameraSystem.getZoomAltitude(),this.systems.cameraSystem.getRotation()),this.systems.cameraSystem.postRender(),this.systems.domVisiblitySystem.update(),this.systems.domMutationSystem.update(),this.systems.twoDProjectionSystem.update(),this.systems.occlusion2DSystem.update(),this.systems.twoDDrawSystem.update(this.systems.cameraSystem.getZoomLevel()),this.systems.domDrawSystem.update(this.systems.cameraSystem.isUserInteracting()),this.systems.watermarkSystem.update();let i=this.needs2DRecompute;return this.nextFrame=requestAnimationFrame(()=>{this.systems.collisionSystem.update(this.systems.watermarkSystem.width,this.systems.watermarkSystem.height,this.systems.watermarkSystem.options.position,!i)}),this.systems.drawSystem.update(),this.systems.cameraSystem.dirty=!1,this.systems.cameraSystem.zoomDirty=!1,this.systems.cameraSystem.rotationDirty=!1,this.publish("post-render"),Promise.all(r)}catch(r){ce.error("Render failed: ",r)}},"commitRenderState"));this.renderer=r,this.state=n,this.mode=i,this.scene=s,this.cameraObject=l,this.viewCamera=c,this.systems=p,this.systems.collisionSystem.on("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.on("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.on("animate:2d",this.animate2D),this.systems.cameraSystem.on("pan-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("zoom-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("zoom-end",()=>this.needs2DRecompute=!0),this.systems.cameraSystem.on("rotate-start",()=>this.needs2DRecompute=!1),this.systems.cameraSystem.on("rotate-end",()=>this.needs2DRecompute=!0)}paint(){var r;(r=this.renderer)!=null&&r.renderer&&(this.mode==="standalone"&&this.renderer.clear(),this.renderer.render(this.scene,this.state.useStandaloneCamera||this.mode==="standalone"?this.cameraObject:this.viewCamera))}destroy(){this.frameId&&cancelAnimationFrame(this.frameId),this.twoDFrameId&&cancelAnimationFrame(this.twoDFrameId),this.animationFrameId&&cancelAnimationFrame(this.animationFrameId),this.nextFrame&&cancelAnimationFrame(this.nextFrame),this.state.geometry2DIdsInScene.clear(),this.state.geometry3DIdsInScene.clear(),this.systems.domVisiblitySystem.dirty=!0,this.systems.collisionSystem.collidersDirty=!0,this.update(),this.systems.collisionSystem.off("visibility-changed",this.updateEntities2D),this.systems.twoDVisiblitySystem.off("draw:2d",this.drawEntities2D),this.systems.twoDVisiblitySystem.off("animate:2d",this.animate2D)}};o(_D,"RenderSystem");var iT=_D;g();var ELe=le.object({interactive:le.boolean().optional(),id:le.string().optional(),nearRadius:le.number().optional(),farRadius:le.number().optional(),accentColor:le.string().optional(),displayArrowsOnPath:le.boolean().optional(),animateArrowsOnPath:le.boolean().optional(),nearZoomLevel:le.number().optional(),farZoomLevel:le.number().optional(),visibleThroughGeometry:le.boolean().optional(),dashed:le.boolean().optional()}),MLe=le.object({type:le.enum(["Feature"]),geometry:xv,properties:le.object({parentId:le.any().optional()})});function Nie(e,t){le.object({features:le.array(MLe)}).parse(e),ELe.parse(t)}o(Nie,"validatePath");var I2,SD=class SD{constructor(t,r){x(this,"type","path");x(this,"mesh",new Eu);x(this,"material");x(this,"geometry");x(this,"outline");x(this,"feature");x(this,"options");x(this,"nearRadius",.2);x(this,"farRadius",.4);x(this,"nearZoomLevel");x(this,"farZoomLevel");x(this,"nearZoomAltitude");x(this,"farZoomAltitude");x(this,"accentColor","blue");x(this,"completeFraction",1);x(this,"altitudeAdjustment",1);x(this,"displayArrowsOnPath",!1);x(this,"animateArrowsOnPath",!1);x(this,"visibleThroughGeometry",!1);x(this,"dashed",!1);x(this,"isVertical",!1);x(this,"dirty",!0);x(this,"materialDirty",!0);x(this,"position",new ht);G(this,I2,0);var n,i,s,l,c,p,h;this.feature=t,this.options=r||{},this.accentColor=(n=r==null?void 0:r.accentColor)!=null?n:this.accentColor,this.nearRadius=(i=r==null?void 0:r.nearRadius)!=null?i:this.nearRadius,this.farRadius=(s=r==null?void 0:r.farRadius)!=null?s:this.farRadius,this.nearZoomLevel=r==null?void 0:r.nearZoomLevel,this.farZoomLevel=r==null?void 0:r.farZoomLevel,this.displayArrowsOnPath=(l=r==null?void 0:r.displayArrowsOnPath)!=null?l:this.displayArrowsOnPath,this.animateArrowsOnPath=(c=r==null?void 0:r.animateArrowsOnPath)!=null?c:this.animateArrowsOnPath,this.visibleThroughGeometry=(p=r==null?void 0:r.visibleThroughGeometry)!=null?p:this.visibleThroughGeometry,this.dashed=(h=r==null?void 0:r.dashed)!=null?h:this.dashed}setColor(){}setOpacity(){}set visible(t){this.mesh&&(this.mesh.visible=t)}get visible(){return this.mesh?this.mesh.visible:!1}get altitude(){return d(this,I2)}set altitude(t){this.mesh&&(this.mesh.position.z=t,q(this,I2,t))}set complete(t){this.material&&(this.material.uniforms.complete.value=t,this.material.needsUpdate=!0)}};I2=new WeakMap,o(SD,"PathComponent");var Ch=SD;g();var CD=class CD{constructor(t){x(this,"rendererState");this.rendererState=t}update(){let t;for(let r of this.rendererState.geometry3DIdsInScene)if(t=this.rendererState.geometry3DMap.get(r),t instanceof Ar&&t.components[0]){let n=t.components[0];if(n.dirty){for(let i of t.children)(i instanceof Fs||i instanceof Ar)&&(i.userData.entityId!==t.components[0].activeId?i.setVisible(!1):i.setVisible(!0));n.dirty=!1}}}};o(CD,"StackSystem");var oT=CD;g();g();g();var Qi=Object.freeze({Linear:Object.freeze({None:o(function(e){return e},"None"),In:o(function(e){return e},"In"),Out:o(function(e){return e},"Out"),InOut:o(function(e){return e},"InOut")}),Quadratic:Object.freeze({In:o(function(e){return e*e},"In"),Out:o(function(e){return e*(2-e)},"Out"),InOut:o(function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},"InOut")}),Cubic:Object.freeze({In:o(function(e){return e*e*e},"In"),Out:o(function(e){return--e*e*e+1},"Out"),InOut:o(function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},"InOut")}),Quartic:Object.freeze({In:o(function(e){return e*e*e*e},"In"),Out:o(function(e){return 1- --e*e*e*e},"Out"),InOut:o(function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},"InOut")}),Quintic:Object.freeze({In:o(function(e){return e*e*e*e*e},"In"),Out:o(function(e){return--e*e*e*e*e+1},"Out"),InOut:o(function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},"InOut")}),Sinusoidal:Object.freeze({In:o(function(e){return 1-Math.sin((1-e)*Math.PI/2)},"In"),Out:o(function(e){return Math.sin(e*Math.PI/2)},"Out"),InOut:o(function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))},"InOut")}),Exponential:Object.freeze({In:o(function(e){return e===0?0:Math.pow(1024,e-1)},"In"),Out:o(function(e){return e===1?1:1-Math.pow(2,-10*e)},"Out"),InOut:o(function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},"InOut")}),Circular:Object.freeze({In:o(function(e){return 1-Math.sqrt(1-e*e)},"In"),Out:o(function(e){return Math.sqrt(1- --e*e)},"Out"),InOut:o(function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},"InOut")}),Elastic:Object.freeze({In:o(function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},"In"),Out:o(function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},"Out"),InOut:o(function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)},"InOut")}),Back:Object.freeze({In:o(function(e){var t=1.70158;return e===1?1:e*e*((t+1)*e-t)},"In"),Out:o(function(e){var t=1.70158;return e===0?0:--e*e*((t+1)*e+t)+1},"Out"),InOut:o(function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)},"InOut")}),Bounce:Object.freeze({In:o(function(e){return 1-Qi.Bounce.Out(1-e)},"In"),Out:o(function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},"Out"),InOut:o(function(e){return e<.5?Qi.Bounce.In(e*2)*.5:Qi.Bounce.Out(e*2-1)*.5+.5},"InOut")}),generatePow:o(function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:o(function(t){return Math.pow(t,e)},"In"),Out:o(function(t){return 1-Math.pow(1-t,e)},"Out"),InOut:o(function(t){return t<.5?Math.pow(t*2,e)/2:(1-Math.pow(2-t*2,e))/2+.5},"InOut")}},"generatePow")}),_2=o(function(){return performance.now()},"now"),PD=function(){function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return o(e,"Group"),e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(r){return t._tweens[r]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];for(var i=0,s=r;i<s.length;i++){var l=s[i];(t=l._group)===null||t===void 0||t.remove(l),l._group=this,this._tweens[l.getId()]=l,this._tweensAddedDuringUpdate[l.getId()]=l}},e.prototype.remove=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var n=0,i=t;n<i.length;n++){var s=i[n];s._group=void 0,delete this._tweens[s.getId()],delete this._tweensAddedDuringUpdate[s.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},e.prototype.update=function(t,r){t===void 0&&(t=_2()),r===void 0&&(r=!0);var n=Object.keys(this._tweens);if(n.length!==0)for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<n.length;i++){var s=this._tweens[n[i]],l=!r;s&&s.update(t,l)===!1&&!r&&this.remove(s)}n=Object.keys(this._tweensAddedDuringUpdate)}},e}(),Iv={Linear:o(function(e,t){var r=e.length-1,n=r*t,i=Math.floor(n),s=Iv.Utils.Linear;return t<0?s(e[0],e[1],n):t>1?s(e[r],e[r-1],r-n):s(e[i],e[i+1>r?r:i+1],n-i)},"Linear"),Bezier:o(function(e,t){for(var r=0,n=e.length-1,i=Math.pow,s=Iv.Utils.Bernstein,l=0;l<=n;l++)r+=i(1-t,n-l)*i(t,l)*e[l]*s(n,l);return r},"Bezier"),CatmullRom:o(function(e,t){var r=e.length-1,n=r*t,i=Math.floor(n),s=Iv.Utils.CatmullRom;return e[0]===e[r]?(t<0&&(i=Math.floor(n=r*(1+t))),s(e[(i-1+r)%r],e[i],e[(i+1)%r],e[(i+2)%r],n-i)):t<0?e[0]-(s(e[0],e[0],e[1],e[1],-n)-e[0]):t>1?e[r]-(s(e[r],e[r],e[r-1],e[r-1],n-r)-e[r]):s(e[i?i-1:0],e[i],e[r<i+1?r:i+1],e[r<i+2?r:i+2],n-i)},"CatmullRom"),Utils:{Linear:o(function(e,t,r){return(t-e)*r+e},"Linear"),Bernstein:o(function(e,t){var r=Iv.Utils.Factorial;return r(e)/r(t)/r(e-t)},"Bernstein"),Factorial:function(){var e=[1];return function(t){var r=1;if(e[t])return e[t];for(var n=t;n>1;n--)r*=n;return e[t]=r,r}}(),CatmullRom:o(function(e,t,r,n,i){var s=(r-e)*.5,l=(n-t)*.5,c=i*i,p=i*c;return(2*t-2*r+s+l)*p+(-3*t+3*r-2*s-l)*c+s*i+t},"CatmullRom")}},kie=function(){function e(){}return o(e,"Sequence"),e.nextId=function(){return e._nextId++},e._nextId=0,e}(),wD=new PD,Va=function(){function e(t,r){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Qi.Linear.None,this._interpolationFunction=Iv.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=kie.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof r=="object"?(this._group=r,r.add(this)):r===!0&&(this._group=wD,wD.add(this))}return o(e,"Tween"),e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(t,r){if(r===void 0&&(r=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=r<0?0:r,this},e.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},e.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},e.prototype.start=function(t,r){if(t===void 0&&(t=_2()),r===void 0&&(r=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var n in this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||r){if(this._propertiesAreSetUp=!0,!this._isDynamic){var i={};for(var s in this._valuesEnd)i[s]=this._valuesEnd[s];this._valuesEnd=i}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,r)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,r,n,i,s){for(var l in n){var c=t[l],p=Array.isArray(c),h=p?"array":typeof c,y=!p&&Array.isArray(n[l]);if(!(h==="undefined"||h==="function")){if(y){var b=n[l];if(b.length===0)continue;for(var _=[c],C=0,P=b.length;C<P;C+=1){var E=this._handleRelativeValue(c,b[C]);if(isNaN(E)){y=!1,console.warn("Found invalid interpolation list. Skipping.");break}_.push(E)}y&&(n[l]=_)}if((h==="object"||p)&&c&&!y){r[l]=p?[]:{};var T=c;for(var O in T)r[l][O]=T[O];i[l]=p?[]:{};var b=n[l];if(!this._isDynamic){var D={};for(var O in b)D[O]=b[O];n[l]=b=D}this._setupProperties(T,r[l],b,i[l],s)}else(typeof r[l]>"u"||s)&&(r[l]=c),p||(r[l]*=1),y?i[l]=n[l].slice().reverse():i[l]=r[l]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(t){return t===void 0&&(t=_2()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=_2()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var t=0,r=this._chainedTweens.length;t<r;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},e.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},e.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},e.prototype.easing=function(t){return t===void 0&&(t=Qi.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=Iv.Linear),this._interpolationFunction=t,this},e.prototype.chain=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return this._chainedTweens=t,this},e.prototype.onStart=function(t){return this._onStartCallback=t,this},e.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},e.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},e.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},e.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},e.prototype.onStop=function(t){return this._onStopCallback=t,this},e.prototype.update=function(t,r){var n=this,i;if(t===void 0&&(t=_2()),r===void 0&&(r=e.autoStartOnUpdate),this._isPaused)return!0;var s;if(!this._goToEnd&&!this._isPlaying)if(r)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var l=t-this._startTime,c=this._duration+((i=this._repeatDelayTime)!==null&&i!==void 0?i:this._delayTime),p=this._duration+this._repeat*c,h=o(function(){if(n._duration===0||l>p)return 1;var E=Math.trunc(l/c),T=l-E*c,O=Math.min(T/n._duration,1);return O===0&&l===n._duration?1:O},"calculateElapsedPortion"),y=h(),b=this._easingFunction(y);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,b),this._onUpdateCallback&&this._onUpdateCallback(this._object,y),this._duration===0||l>=this._duration)if(this._repeat>0){var _=Math.min(Math.trunc((l-this._duration)/c)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=_);for(s in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[s]=="string"&&(this._valuesStartRepeat[s]=this._valuesStartRepeat[s]+parseFloat(this._valuesEnd[s])),this._yoyo&&this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=c*_,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var C=0,P=this._chainedTweens.length;C<P;C++)this._chainedTweens[C].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,r,n,i){for(var s in n)if(r[s]!==void 0){var l=r[s]||0,c=n[s],p=Array.isArray(t[s]),h=Array.isArray(c),y=!p&&h;y?t[s]=this._interpolationFunction(c,i):typeof c=="object"&&c?this._updateProperties(t[s],l,c,i):(c=this._handleRelativeValue(l,c),typeof c=="number"&&(t[s]=l+(c-l)*i))}},e.prototype._handleRelativeValue=function(t,r){return typeof r!="string"?r:r.charAt(0)==="+"||r.charAt(0)==="-"?t+parseFloat(r):parseFloat(r)},e.prototype._swapEndStartRepeatValues=function(t){var r=this._valuesStartRepeat[t],n=this._valuesEnd[t];typeof n=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(n):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=r},e.autoStartOnUpdate=!1,e}();var hXt=kie.nextId,Cp=wD,mXt=Cp.getAll.bind(Cp),gXt=Cp.removeAll.bind(Cp),yXt=Cp.add.bind(Cp),vXt=Cp.remove.bind(Cp),bXt=Cp.update.bind(Cp);g();g();g();var Rie=o((e,t)=>(t-e+Math.PI)%(Math.PI*2)+Math.PI*2%(Math.PI*2)-Math.PI,"differenceBetweenAngles"),Bie=o((e,t)=>new wt(e.clientX-t.offsetLeft,e.clientY-t.offsetTop),"getTouchPos"),TD=o((e,t)=>Math.atan2(t.y-e.y,t.x-e.x),"angle"),S2=o((e,t)=>Math.sqrt((t.y-e.y)**2+(t.x-e.x)**2),"distance"),ED=o((e,t)=>new wt((e.x+t.x)/2,(e.y+t.y)/2),"average"),MD=o(e=>{let t=0,{wheelDelta:r,detail:n}=e;return r!==void 0?t=r:n!==void 0&&(t=-n),t},"getScrollDelta");var OD=class OD{constructor(t,r){x(this,"input1");x(this,"input2");x(this,"lastAngle");x(this,"lastDistance");x(this,"totalDistance");x(this,"first");x(this,"second");this.input1=t,this.input2=r,this.lastAngle=TD(t,r),this.lastDistance=S2(t,r),this.totalDistance=0,this.first=t,this.second=r}update(t,r){let n=S2(t,r);this.input1=t,this.input2=r;let i=TD(t,r);this.lastAngle=i,this.lastDistance=n,this.totalDistance+=(S2(this.first,t)+S2(this.second,r))/2,this.first=ED(this.first,t),this.second=ED(this.second,r)}};o(OD,"InputSet");var sT=OD;g();var LD=class LD{constructor(t,r,n){x(this,"touch");x(this,"camera");x(this,"cameraPlane");x(this,"viewCoordinate");x(this,"snapHolderMatrix");x(this,"snapCamera");x(this,"cameraPosition");x(this,"raycaster");x(this,"worldCoordinate");x(this,"snapshotted",!1);this.touch=t,this.camera=r,this.cameraPlane=n,this.viewCoordinate={x:t.x,y:t.y},this.camera.updateMatrixWorld(),this.camera.updateMatrix(),this.snapHolderMatrix=this.camera.matrixWorld.clone(),this.snapCamera=this.camera.clone(),this.snapshotCameraState()}snapshotCameraState(){this.camera.updateMatrix(),this.camera.updateMatrixWorld(),this.cameraPosition=this.camera.position.clone();let t=new wt(this.viewCoordinate.x,this.viewCoordinate.y);this.raycaster=this.raycaster||new Ec,this.raycaster.setFromCamera(t,this.snapCamera);let r=this.raycaster.intersectObject(this.cameraPlane,!0);this.worldCoordinate=r&&r.length>0?r[0].point:null,this.snapshotted=!0}updateAnchorState(t,r){this.camera=t,this.snapCamera=t.clone(),this.snapHolderMatrix=t.matrixWorld.clone(),this.updateViewCoordinate(r),this.snapshotCameraState()}updateViewCoordinate(t){this.viewCoordinate={x:t.x,y:t.y}}reUnproject(){var n,i;let t=new wt(this.viewCoordinate.x,this.viewCoordinate.y);(n=this.raycaster)==null||n.setFromCamera(t,this.snapCamera);let r=(i=this.raycaster)==null?void 0:i.intersectObject(this.cameraPlane,!0)[0];return r?r.point:void 0}};o(LD,"TouchAnchor");var C2=LD;var au={};Cc(au,{BLOCK_MERCATOR_ZOOM_LEVEL:()=>LLe,CLIPPING_RADIUS:()=>w2,CONTROL_OPTIONS:()=>OLe,DEFAULT_ANIMATION_DURATION:()=>kD,DEFAULT_BEARING:()=>kLe,DEFAULT_MAX_ZOOM_LEVEL:()=>FLe,DEFAULT_MIN_ZOOM_LEVEL:()=>RD,DEFAULT_PITCH:()=>NLe,DEFAULT_ZOOM_LEVEL:()=>DLe,EVENTS:()=>cT,MAPLIBRE_TILE_SIZE:()=>aT,MAX_LAT:()=>DD,MAX_MERCATOR_ZOOM_LEVEL:()=>uT,MIN_LAT:()=>AD,MIN_MERCATOR_ZOOM_LEVEL:()=>lT,ROOM_MERCATOR_ZOOM_LEVEL:()=>ALe,TWO_PI:()=>FD,WHEEL_ZOOM_MULTIPLIER:()=>ND,ZRANGE:()=>_v});g();var aT=512,AD=-85.051129,DD=85.051129,w2=1e4,OLe={chain:"chain",cancel:"cancel"},FD=Math.PI*2,_v=100,ND=1e4,lT=0,uT=24,LLe=17,ALe=20,kD=200,cT=["change","pan-start","pan-end","rotate-start","rotate-end","zoom-start","zoom-end","multi-start","multi-end","multi-cancel","pedestal-start","pedestal-change","pedestal-end","user-pan-start","user-pedestal-start","user-rotate-start","user-dolly-start","user-zoom-start","user-tilt-start","user-pan-end","user-pedestal-end","user-rotate-end","user-dolly-end","user-zoom-end","user-tilt-end","position-updated","zoom-updated","tilt-updated","rotation-updated"],DLe=18,RD=12,FLe=22,NLe=0,kLe=0;g();function $ie(e){e&&(e.map&&(e.map.dispose(),e.map=void 0),e.dispose())}o($ie,"scrubMaterial");function Pi(e){for(let t=e.children.length-1;t>=0;t--)Pi(e.children[t]);"geometry"in e&&e.geometry&&e.geometry.dispose(),e.parent&&e.parent.remove(e),"material"in e&&Array.isArray(e.material)?e.material.forEach(function(t){$ie(t)}):"material"in e&&typeof e.material<"u"&&$ie(e.material)}o(Pi,"destroyObject3D");var pT=!1,RLe=!1;var fT,dT=class dT extends Lt{constructor(r,n,i,s,l){super();x(this,"dirty",!1);x(this,"zoomDirty",!1);x(this,"rotationDirty",!1);x(this,"panDirty",!1);G(this,fT,RD);x(this,"zoomSpeed",5);x(this,"rotateSpeed",100);x(this,"enabled",!0);x(this,"enableZoom",!0);x(this,"enablePan",!0);x(this,"enablePedestal",!1);x(this,"maxPedestal",1/0);x(this,"minPedestal",0);x(this,"enableRotate",!0);x(this,"minZoomAltitude",0);x(this,"maxZoomAltitude",1/0);x(this,"ignoreZoomLimits",!1);x(this,"zoomFactor",1);x(this,"panBounds",{min:new ht(1/0,1/0),max:new ht(-1/0,-1/0),center:new ht(0,0,0),radius:1/0});x(this,"minTilt",0);x(this,"maxTilt",1.2);x(this,"MOUSE_BUTTONS",{ORBIT:nS.RIGHT,ZOOM:nS.MIDDLE,PAN:nS.LEFT});x(this,"camera");x(this,"scene");x(this,"renderer");x(this,"elevation");x(this,"orbit");x(this,"cameraPlane");x(this,"raycaster",new Ec);x(this,"rendererState");x(this,"options");x(this,"state",-1);x(this,"intersection");x(this,"viewState",null);x(this,"tweens",new Map);x(this,"clock",new NN(!0));x(this,"coords",{mouse:new wt,rotateStart:new wt,rotateEnd:new wt,rotateDelta:new wt,panStart:new ht,panCameraStart:new ht,panEnd:new ht,panDelta:new ht,initialShiftPos:new wt,initialPedestal:0,floorAnchor:new ht});x(this,"touch",{origin:{offsetLeft:0,offsetTop:0},touches:[],anchor1:null,anchor2:null,inputs:null});x(this,"scrollTimer",null);x(this,"lastWheelTime",0);x(this,"resetZoom",!1);x(this,"zoomStart");x(this,"pedestalScaleFactor",1);x(this,"isUserZooming",!1);x(this,"stayInsideBounds",!0);x(this,"userInteracting",!1);x(this,"cameraMoving",!1);x(this,"lastCameraMoveTime",Date.now());x(this,"raycastToFloor",o(r=>{this.raycaster.setFromCamera(r,this.camera);let n=this.raycaster.intersectObject(this.cameraPlane,!1)[0];return n?n.point:new ht},"raycastToFloor"));x(this,"isUserInteracting",o(()=>this.userInteracting,"isUserInteracting"));x(this,"getPosition",o(()=>new ht(this.orbit.position.x,this.orbit.position.y,this.orbit.position.z),"getPosition"));x(this,"getPedestal",o(()=>this.orbit.position.z,"getPedestal"));x(this,"pan",o((r,n)=>{isNaN(r)||isNaN(n)||(this.setPosition(this.orbit.position.x+r,this.orbit.position.y+n),this.publish("position-updated"))},"pan"));x(this,"postRender",o(()=>{(this.state===2||this.state===6)&&(this.raycaster.setFromCamera(this.coords.mouse,this.camera),this.intersection=this.raycaster.intersectObject(this.cameraPlane,!1)[0],this.intersection&&(this.coords.panStart.set(this.intersection.point.x,this.intersection.point.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0))),this.state===3&&this.resetZoom&&(this.resetZoom=!1,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0)),this.state===7&&this.isAnimating===!1&&(this.state=-1,this.publish("multi-end"))},"postRender"));x(this,"isCameraMoving",o(()=>this.cameraMoving,"isCameraMoving"));x(this,"lastCameraStoppedMovingTime",o(()=>this.lastCameraMoveTime,"lastCameraStoppedMovingTime"));x(this,"setPosition",o((r,n)=>{r===void 0||n===void 0||isNaN(r)||isNaN(n)||(this.state===-1&&this.publish("pan-start"),this.updateCameraPosition(r,n),this.publish("position-updated"),this.publish("change"),this.state===-1&&this.publish("pan-end"),this.dirty=!0)},"setPosition"));x(this,"updateCameraPosition",o((r,n)=>{let i=r-this.panBounds.center.x,s=n-this.panBounds.center.y,l=Math.sqrt(i*i+s*s);if(this.stayInsideBounds&&l>this.panBounds.radius){let c=Math.atan2(s,i),p={x:Math.cos(c)*this.panBounds.radius+this.panBounds.center.x,y:Math.sin(c)*this.panBounds.radius+this.panBounds.center.y};this.orbit.position.x=p.x,this.orbit.position.y=p.y}else this.orbit.position.x=r,this.orbit.position.y=n},"updateCameraPosition"));x(this,"tilt",o(r=>{if(isNaN(r))return;this.state===-1&&this.publish("rotate-start");let n=this.stayInsideBounds?Math.max(Math.min(r+this.getTilt(),this.maxTilt),this.minTilt):r+this.getTilt();n!==this.elevation.rotation.x&&(this.elevation.rotation.x=n,this.publish("tilt-updated")),this.publish("change"),this.state===-1&&this.publish("rotate-end")},"tilt"));x(this,"zoomIn",o((r,n,i)=>{let s=this.getZoomAltitude();this.animateCamera({zoom:s/1.5},r,n,i)},"zoomIn"));x(this,"zoomOut",o((r,n,i)=>{let s=this.getZoomAltitude();this.animateCamera({zoom:s*1.5},r,n,i)},"zoomOut"));x(this,"getRotation",o(()=>(-this.orbit.rotation.z+Math.PI*2)%(Math.PI*2),"getRotation"));x(this,"cancelAnimation",o(()=>{let r=Array.from(this.tweens.keys()),n=r[r.length-1];n.state===7&&this.publish("multi-cancel",{zooming:!0,rotating:!0,tilting:!0}),this.completeTween(n)},"cancelAnimation"));x(this,"animateCamera",o((r,n,i,s,l,c)=>{let p=k({interruptible:!0},c),h={},y={},b=this.getPosition();if(r.position!=null&&(r.position.x!==void 0&&(h.x=b.x,y.x=r.position.x),r.position.y!==void 0&&(h.y=b.y,y.y=r.position.y),r.position.z!==void 0&&(h.z=b.z,y.z=r.position.z)),r.zoom!==void 0&&(h.zoom=this.stayInsideBounds?Math.min(Math.max(this.getZoomAltitude(),this.getZoomScaledMin()),this.getZoomScaledMax()):this.getZoomAltitude(),this.viewState==="multi_floor"||!this.stayInsideBounds?y.zoom=r.zoom:y.zoom=Math.min(Math.max(r.zoom,this.getZoomScaledMin()),this.getZoomScaledMax())),r.rotation!==void 0){let{start:A,end:R}=hS(this.getRotation(),r.rotation);h.rotation=A,y.rotation=R}r.tilt!==void 0&&(h.tilt=this.getTilt(),this.viewState==="multi_floor"||!this.stayInsideBounds?y.tilt=r.tilt:y.tilt=Math.max(Math.min(r.tilt,this.maxTilt),this.minTilt));let _=h.zoom!==y.zoom,C=h.rotation!==y.rotation,P=h.tilt!==y.tilt,E=new Va(h).to(y,I.env.TESTING?0:n).onUpdate(A=>{this.setMulti({x:A.x,y:A.y,z:A.z},A.zoom,A.rotation,A.tilt)}).onComplete(()=>{this.completeTween(E),this.publish("multi-end",{zooming:_,rotating:C,tilting:P}),s&&s()}).onStart(()=>{this.state!==7&&(this.state=7,E.state=7,this.publish("multi-start",{zooming:_,rotating:C,tilting:P})),this.publish("change")});this.rendererState.tweenGroup.add(E);let T=Array.from(this.tweens.entries()),O=T[T.length-1],D=!1;return O!=null&&(O[1].interruptible?(typeof O[1].cancelledCallback=="function"&&O[1].cancelledCallback(),this.completeTween(O[0])):(D=!0,O[0].chain(E))),this.tweens.set(E,{cancelledCallback:l,interruptible:p.interruptible}),i?E.easing(i):E.easing(Qi.Quadratic.In),!r.doNotAutoStart&&!D&&(E.start(),this.publish("change")),E.cameraAnimation=!0,E},"animateCamera"));x(this,"setMulti",o((r,n,i,s,l=!0)=>{this.state===-1&&this.publish("multi-start");let c=!1;r!=null&&(r.x!==void 0&&!isNaN(r.x)&&r.y!==void 0&&!isNaN(r.y)&&(this.updateCameraPosition(r.x,r.y),c=!0),r.z!==void 0&&!isNaN(r.z)&&(this.setPedestal(r.z,!0),c=!0)),c&&this.publish("position-updated");let p={zooming:!1,tilting:!!n,rotating:!1};if(n!==void 0&&!isNaN(n)){let h=this.stayInsideBounds?Math.min(Math.max(n,this.getZoomScaledMin()),this.getZoomScaledMax()):n;h!==this.camera.position.z&&(p.zooming=!0,this.camera.position.z=h,this.publish("zoom-updated"),this.zoomDirty=!0,this.viewState==="multi_floor"?n>w2&&(this.camera.near=n-w2,this.camera.far=n+w2):(this.camera.near=n/_v,this.camera.far=n*_v),this.camera.updateProjectionMatrix())}if(i!==void 0&&!isNaN(i)&&i!==this.getRotation()&&(p.rotating=!0,this.orbit.rotation.z=-i,this.publish("rotation-updated")),s!==void 0&&!isNaN(s)){let h=this.stayInsideBounds?Math.max(Math.min(s,this.maxTilt),this.minTilt):s;h!==this.elevation.rotation.x&&(p.tilting=!0,this.elevation.rotation.x=h,this.publish("tilt-updated"))}l&&this.publish("change"),this.state===-1&&this.publish("multi-end",p)},"setMulti"));x(this,"getZoomScaledMin",o(()=>this.minZoomAltitude*this.zoomFactor,"getZoomScaledMin"));x(this,"getZoomScaledMax",o(()=>{let r=this.minZoomAltitude*this.zoomFactor;return Math.max(this.maxZoomAltitude,r)},"getZoomScaledMax"));x(this,"setRotation",o((r,n)=>{if(isNaN(r))return;this.state===-1&&!n&&this.publish("rotate-start");let i=-(r%FD);i!==this.orbit.rotation.z&&(this.orbit.rotation.z=i,n||this.publish("rotation-updated")),n||this.publish("change"),this.state===-1&&!n&&this.publish("rotate-end"),this.dirty=!0,this.rotationDirty=!0},"setRotation"));x(this,"setZoomAltitude",o(r=>{if(isNaN(r))return;this.state===-1&&this.publish("zoom-start");let n=this.stayInsideBounds?Math.min(Math.max(r,this.getZoomScaledMin()),this.getZoomScaledMax()):r;n!==this.camera.position.z&&(this.camera.position.z=n,this.publish("zoom-updated"),this.zoomDirty=!0),this.camera.near=n/_v,this.camera.far=n*_v,this.camera.updateProjectionMatrix(),this.publish("change"),this.state===-1&&this.publish("zoom-end"),this.dirty=!0},"setZoomAltitude"));x(this,"setZoomLevel",o(r=>{this.setZoomAltitude(this.convertZoomLevelToAltitude(r))},"setZoomLevel"));x(this,"getZoomAltitude",o(()=>this.camera.position.z,"getZoomAltitude"));x(this,"getZoomLevel",o(()=>this.convertAltitudeToZoomLevel(this.getZoomAltitude()),"getZoomLevel"));x(this,"setTilt",o((r,n)=>{if(isNaN(r))return;this.state===-1&&!n&&this.publish("rotate-start");let i=this.stayInsideBounds?Math.max(Math.min(r,this.maxTilt),this.minTilt):r;i!==this.elevation.rotation.x&&(this.elevation.rotation.x=i,n||this.publish("tilt-updated")),n||this.publish("change"),this.state===-1&&!n&&this.publish("rotate-end"),this.dirty=!0},"setTilt"));x(this,"getTilt",o(()=>this.elevation.rotation.x,"getTilt"));x(this,"setCameraPlaneElevation",o(r=>{this.cameraPlane.position.z=r},"setCameraPlaneElevation"));x(this,"zoom",o(r=>{if(isNaN(r))return;this.state===-1&&this.publish("zoom-start");let n=this.getZoomAltitude()-r;this.camera.position.z=this.stayInsideBounds?Math.min(Math.max(n,this.minZoomAltitude*this.zoomFactor),this.maxZoomAltitude*this.zoomFactor):n,this.publish("zoom-updated"),this.zoomDirty=!0,this.publish("change"),this.state===-1&&this.publish("zoom-end")},"zoom"));x(this,"getProjectionScaleFactor",o((r,n,i)=>OE(r,n,i),"getProjectionScaleFactor"));x(this,"update",o(()=>{this.orbit.updateMatrixWorld(),this.lastWheelTime>0&&this.state===3&&this.clock.getElapsedTime()-this.lastWheelTime>.2&&(this.lastWheelTime=0,this.state=-1,this.publish("zoom-end"),this.removeMouseMoveEventListeners())},"update"));x(this,"setPedestal",o((r,n=!1)=>{typeof r=="number"&&!isNaN(r)&&(this.orbit.position.z=r,n&&(this.publishPedestalChangeEvent(r),this.publish("pedestal-change",{pedestal:r})),this.publish("change"),this.dirty=!0)},"setPedestal"));x(this,"dispose",o(()=>{for(let r of cT)r.endsWith("start")?(this.off(r,this.setCameraMoving),r.startsWith("user")&&this.off(r,this.setUserInteracting)):(r.endsWith("end")||r.endsWith("cancel"))&&(this.off(r,this.unsetCameraMoving),r.startsWith("user")&&this.off(r,this.unsetUserInteracting));this.removeEventListeners(),this.scene.remove(this.cameraPlane)},"dispose"));x(this,"createCameraPlane",o(()=>{let r=pT?2e3:1e10,n=pT?100:1,i=new wu(r,r,n,n),s=new _o({color:0,wireframe:pT,visible:pT}),l=new jt(i,s);return this.scene.add(l),l},"createCameraPlane"));x(this,"addEventListeners",o(()=>{let{domElement:r}=this.renderer;for(let n of cT)n.endsWith("start")?(this.on(n,this.setCameraMoving),n.startsWith("user")&&this.on(n,this.setUserInteracting)):(n.endsWith("end")||n.endsWith("cancel"))&&(this.on(n,this.unsetCameraMoving),n.startsWith("user")&&this.on(n,this.unsetUserInteracting));r.addEventListener("contextmenu",this.onContextMenu,!1),r.addEventListener("mousedown",this.onMouseDown,!1),r.addEventListener("wheel",this.onMouseWheel,{passive:!1}),r.addEventListener("touchstart",this.onTouchStart,!1),r.addEventListener("touchend",this.onTouchEnd,!1),r.addEventListener("touchmove",this.onTouchMove,!1)},"addEventListeners"));x(this,"addMouseEventListeners",o(()=>{this.addMouseMoveEventListeners(),window.addEventListener("mouseup",this.onMouseUp,!1),window.addEventListener("mouseout",this.onMouseUp,!1)},"addMouseEventListeners"));x(this,"addMouseMoveEventListeners",o(()=>{this.renderer.domElement.addEventListener("mousemove",this.onMouseMove,!1)},"addMouseMoveEventListeners"));x(this,"removeMouseMoveEventListeners",o(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1)},"removeMouseMoveEventListeners"));x(this,"removeEventListeners",o(()=>{let{domElement:r}=this.renderer;r.removeEventListener("contextmenu",this.onContextMenu,!1),r.removeEventListener("mousedown",this.onMouseDown,!1),r.removeEventListener("wheel",this.onMouseWheel,!1),r.removeEventListener("touchstart",this.onTouchStart,!1),r.removeEventListener("touchend",this.onTouchEnd,!1),r.removeEventListener("touchmove",this.onTouchMove,!1),r.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeEventListeners"));x(this,"removeMouseUpEventListeners",o(()=>{this.renderer.domElement.removeEventListener("mousemove",this.onMouseMove,!1),window.removeEventListener("mouseup",this.onMouseUp,!1),window.removeEventListener("mouseout",this.onMouseUp,!1)},"removeMouseUpEventListeners"));x(this,"onContextMenu",o(r=>{r.preventDefault()},"onContextMenu"));x(this,"onMouseUp",o(()=>{if(this.enabled!==!1){switch(this.removeMouseUpEventListeners(),this.state){case 2:this.publish("pan-end"),this.publish("user-pan-end");break;case 1:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}this.state=-1,this.panDirty=!1}},"onMouseUp"));x(this,"onMouseMove",o(r=>{if(this.enabled!==!1)if(r.preventDefault(),this.mouseToScene(r),this.state===0){if(this.enableRotate===!1)return;this.handleMouseMoveRotate(r)}else if(this.state===2){if(this.enablePan===!1)return;this.handleMouseMovePan()}else this.state===3?(this.resetZoom=!0,this.state=-1):this.state===8&&this.handleMouseMovePedestal(r)},"onMouseMove"));x(this,"onTouchStart",o(r=>{if(this.enabled!==!1){switch(this.updateTouchOrigin(),this.touchToScene(r),r.touches.length){case 1:this.enablePedestal?(this.handleTouchStartPedestal(r),this.state=9):this.enablePan&&(this.handleTouchStartPan(r),this.state=6);break;case 2:this.touch.inputs=new sT(this.touch.touches[0],this.touch.touches[1]);break;default:this.state=-1}this.state}},"onTouchStart"));x(this,"onTouchMove",o(r=>{if(this.enabled!==!1)switch(this.touchToScene(r),r.touches.length){case 2:r.preventDefault(),r.stopPropagation();let n=k({},this.touch.inputs.first),i=k({},this.touch.inputs.second),s=new wt(this.touch.touches[0].x,this.touch.touches[0].y),l=new wt(this.touch.touches[1].x,this.touch.touches[1].y);if(this.touch.inputs.update(this.touch.touches[0],this.touch.touches[1]),this.enableRotate&&this.state===4)this.handleTouchMoveTilt(r);else if(this.state===5)this.handleTouchMoveDolly();else if(this.state!==5&&this.touch.inputs.totalDistance>.05){let c=n.y<s.y&&i.y<l.y,p=n.y>s.y&&i.y>l.y;this.enableRotate&&this.state!==4&&(p||c)?(this.handleTouchStartTilt(r),this.state=4):(this.handleTouchStartDolly(),this.state=5)}break;case 1:(this.enablePedestal||this.enablePan)&&(r.preventDefault(),r.stopPropagation()),this.enablePedestal&&this.state===9?this.handleTouchMovePedestal(r):this.enablePan&&this.state===6&&this.handleTouchMovePan(r);break;default:this.state=-1}},"onTouchMove"));x(this,"onTouchEnd",o(r=>{if(this.enabled!==!1){switch(this.handleTouchEnd(),this.state){case 2:case 6:this.publish("user-pan-end");break;case 4:this.publish("pan-end"),this.publish("user-tilt-end");break;case 1:case 5:this.publish("zoom-end"),this.publish("user-dolly-end");break;case 0:this.publish("rotate-end"),this.publish("user-rotate-end");break;case 8:case 9:this.publish("pedestal-end"),this.publish("user-pedestal-end");break}r.touches.length?this.onTouchStart(r):this.state=-1}},"onTouchEnd"));x(this,"handleTouchMovePan",o(r=>{let n=Object.hasOwn(r,"x")?new wt(r.x,r.y):this.touch.touches[0],i=this.raycastToFloor(n);this.coords.panEnd.set(i.x,i.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change"),this.panDirty=!0},"handleTouchMovePan"));x(this,"handleTouchStartDolly",o(()=>{let r=this.touch.touches[0].x-this.touch.touches[1].x,n=this.touch.touches[0].y-this.touch.touches[1].y;this.zoomStart=this.getZoomAltitude();let i=new wt(this.touch.touches[0].x-r/2,this.touch.touches[0].y-n/2);this.coords.floorAnchor=this.raycastToFloor(i),this.orbit.updateMatrixWorld(),this.touch.anchor1=new C2(this.touch.touches[0],this.camera,this.cameraPlane),this.touch.anchor2=new C2(this.touch.touches[1],this.camera,this.cameraPlane),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-dolly-start"),this.publish("zoom-start"),this.publish("multi-start")},"handleTouchStartDolly"));x(this,"handleMouseMovePan",o(()=>{let r=this.raycastToFloor(this.coords.mouse);this.coords.panEnd.set(r.x,r.y,0),this.coords.panDelta.subVectors(this.coords.panEnd,this.coords.panStart),this.setPosition(this.coords.panCameraStart.x-this.coords.panDelta.x,this.coords.panCameraStart.y-this.coords.panDelta.y),this.publish("change"),this.panDirty=!0},"handleMouseMovePan"));x(this,"handleTouchStartTilt",o(r=>{this.coords.rotateStart.set(r.touches[1].clientX,r.touches[1].clientY),this.publish("user-tilt-start"),this.publish("rotate-start")},"handleTouchStartTilt"));x(this,"handleTouchMovePedestal",o(r=>{this.handleMouseMovePedestal(r.touches[0])},"handleTouchMovePedestal"));x(this,"handleTouchMoveTilt",o(r=>{this.coords.rotateEnd.set(r.touches[1].clientX,r.touches[1].clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd)},"handleTouchMoveTilt"));x(this,"handleTouchMoveDolly",o(()=>{let r=this.touch.inputs.first,n=this.touch.inputs.second;this.touch.anchor1.viewCoordinate={x:r.x,y:r.y},this.touch.anchor2.viewCoordinate={x:n.x,y:n.y};let i=this.makeTransformFromTouchAnchors(this.touch.anchor1,this.touch.anchor2);i&&this.setCameraFromTransformMatrix(i),this.orbit.updateMatrixWorld(),this.touch.anchor1.updateAnchorState(this.camera,r),this.touch.anchor2.updateAnchorState(this.camera,n)},"handleTouchMoveDolly"));x(this,"handleTouchEnd",o(()=>{this.state===4||this.state===5?this.publish("multi-end"):this.state===6&&this.publish("pan-end"),this.panDirty=!1},"handleTouchEnd"));x(this,"handleTouchStartPan",o(r=>{let n=Object.hasOwn(r,"x")?new wt(r.x,r.y):this.touch.touches[0],i=this.raycastToFloor(n);this.coords.panStart.set(i.x,i.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("user-pan-start"),this.publish("pan-start")},"handleTouchStartPan"));x(this,"handleTouchStartPedestal",o(r=>{this.handleMouseDownPedestal(r.touches[0])},"handleTouchStartPedestal"));x(this,"onMouseDown",o(r=>{if(this.enabled!==!1){if(this.mouseToScene(r),r.preventDefault(),this.state===3&&this.publish("zoom-end"),r.button===this.MOUSE_BUTTONS.ORBIT){if(this.enableRotate===!1)return;this.handleMouseDownRotate(r),this.state=0}else r.button===this.MOUSE_BUTTONS.PAN&&(this.enablePan?(this.handleMouseDownPan(),this.state=2):this.enablePedestal&&(this.handleMouseDownPedestal(r),this.state=8));this.state!==-1&&this.addMouseEventListeners()}},"onMouseDown"));x(this,"onMouseWheel",o(r=>{this.enabled===!1||this.enableZoom===!1||this.state!==-1&&this.state!==3||(r.preventDefault(),r.stopPropagation(),this.mouseToScene(r),this.canScrollZoom(r)&&(this.lastWheelTime=this.clock.getElapsedTime(),this.publishUserZoomEvent()),this.state!==3&&this.canScrollZoom(r)&&(this.addMouseMoveEventListeners(),this.state=3,this.zoomStart=this.getZoomAltitude(),this.coords.floorAnchor=this.raycastToFloor(this.coords.mouse),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("zoom-start")),this.scrollTimer!=null&&clearTimeout(this.scrollTimer),this.scrollTimer=setTimeout(()=>{this.publish("zoom-end")},50),this.handleMouseWheel(r))},"onMouseWheel"));x(this,"handleMouseWheel",o(r=>{if(this.publish("zoom-start"),!this.canScrollZoom(r)){this.lastWheelTime>0&&this.publish("zoom-end"),this.lastWheelTime=0,this.state=-1;return}let n=this.getZoomAltitude(),i=n-MD(r)*n/ND*this.zoomSpeed;if(this.setZoomAltitude(i),this.enablePan){let s=i/this.zoomStart;this.coords.panDelta.subVectors(this.coords.floorAnchor,this.coords.panCameraStart).multiplyScalar(1-s),this.setPosition(this.coords.panCameraStart.x+this.coords.panDelta.x,this.coords.panCameraStart.y+this.coords.panDelta.y)}this.publish("change")},"handleMouseWheel"));x(this,"setCameraFromTransformMatrix",o(r=>{this.orbit.updateMatrixWorld();let n=new Yp;n.setFromRotationMatrix(r,"ZYX");let i=(r.elements[14]-this.cameraPlane.position.z)/Math.cos(n.x),s=n.z,l=new ht(0,0,1);l.applyEuler(n),l.setLength(i);let c=new ht;c.setFromMatrixPosition(r),c.sub(l),this.enablePan&&this.setPosition(c.x,c.y),this.enableZoom&&this.setZoomAltitude(i),this.enableRotate&&this.setRotation(-s)},"setCameraFromTransformMatrix"));x(this,"makeTransformFromTouchAnchors",o((r,n)=>{this.orbit.updateMatrixWorld(),this.camera.updateProjectionMatrix();let i=this.camera.projectionMatrix.clone(),s=r.worldCoordinate,l=n.worldCoordinate,c=r.reUnproject(),p=n.reUnproject();if(!c||!p||!s||!l)return null;let h=r.viewCoordinate,y=n.viewCoordinate,b=l.x-s.x,_=l.y-s.y,C=Math.atan2(_,b),P=p.x-c.x,E=p.y-c.y,T=Math.atan2(E,P),O=Rie(C,T),D=new Su;D.makeRotationZ(-O);let A=D.clone();A.multiply(r.snapHolderMatrix);let R=o((Qo,ro,es)=>Qo.elements[(ro-1)*4+es-1],"m"),j=R(i,1,1)*R(A,1,1)-h.x*R(i,3,4)*R(A,3,1),X=R(i,1,1)*R(A,1,2)-h.x*R(i,3,4)*R(A,3,2),Y=R(i,1,1)*R(A,1,3)-h.x*R(i,3,4)*R(A,3,3),N=s.x*j+s.y*X+s.z*Y,Z=R(i,2,2)*R(A,2,1)-h.y*R(i,3,4)*R(A,3,1),ae=R(i,2,2)*R(A,2,2)-h.y*R(i,3,4)*R(A,3,2),se=R(i,2,2)*R(A,2,3)-h.y*R(i,3,4)*R(A,3,3),U=s.x*Z+s.y*ae+s.z*se,xe=R(i,1,1)*R(A,1,1)-y.x*R(i,3,4)*R(A,3,1),ne=R(i,1,1)*R(A,1,2)-y.x*R(i,3,4)*R(A,3,2),Pe=R(i,1,1)*R(A,1,3)-y.x*R(i,3,4)*R(A,3,3),Ce=l.x*xe+l.y*ne+l.z*Pe,Ue=R(i,2,2)*R(A,2,1)-y.y*R(i,3,4)*R(A,3,1),_e=R(i,2,2)*R(A,2,2)-y.y*R(i,3,4)*R(A,3,2),Me=R(i,2,2)*R(A,2,3)-y.y*R(i,3,4)*R(A,3,3),Q=l.x*Ue+l.y*_e+l.z*Me,it=Math.abs(xe-j),Ke=Math.abs(ne-X),rt=Math.abs(Pe-Y),Ae=Math.abs(xe-Z),Be=Math.abs(ne-ae),We=Math.abs(Pe-se),je=Math.abs(Ue-j),Se=Math.abs(_e-X),H=Math.abs(Me-Y),ie=Math.abs(Ue-Z),ee=Math.abs(_e-ae),Ee=Math.abs(Me-se),Ne=Math.min(it+Ke+rt,Ae+Be+We),Oe=Math.min(je+Se+H,ie+ee+Ee);Ne<Oe&&(xe=Ue,ne=_e,Pe=Me,Ce=Q);let Ye=Z*Y-j*se,Pt=ae*Y-X*se,Er=U*Y-N*se,$n=xe*se-Z*Pe,ot=ne*se-ae*Pe,zt=Ce*se-U*Pe,Jo=(zt*Pt-Er*ot)/($n*Pt-Ye*ot),Ro=(zt*Ye-Er*$n)/(ot*Ye-Pt*$n),Ks=ae*j-X*Z,Ri=se*j-Y*Z,ze=U*j-N*Z,fu=ne*Z-ae*xe,Ya=Pe*Z-se*xe,Js=((Ce*Z-U*xe)*Ks-ze*fu)/(Ya*Ks-Ri*fu),dc=A.clone();return dc.elements[12]=Jo,dc.elements[13]=Ro,dc.elements[14]=Js,Js>0?dc:null},"makeTransformFromTouchAnchors"));x(this,"updateTouchOrigin",o(()=>{let r=this.renderer.domElement;this.touch.origin.offsetLeft=r.getBoundingClientRect().left,this.touch.origin.offsetTop=r.getBoundingClientRect().top},"updateTouchOrigin"));x(this,"touchToScene",o(r=>{this.touch.touches=[];for(let n=0,i=r.touches.length;n<i;n++){let s=r.touches[n],l=Bie(s,this.touch.origin);this.touch.touches.push(new wt(l.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,-(l.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1))}this.coords.mouse=this.touch.touches[0]},"touchToScene"));x(this,"canScrollZoom",o(r=>{let n=MD(r),i=this.getZoomAltitude();return!(n<0&&i===this.getZoomScaledMax()||n>0&&i===this.getZoomScaledMin())},"canScrollZoom"));x(this,"mouseToScene",o(r=>{let n=this.getMousePos(r);return this.coords.mouse.x=n.x/this.renderer.domElement.width*this.rendererState.pixelRatio*2-1,this.coords.mouse.y=-(n.y/this.renderer.domElement.height*this.rendererState.pixelRatio)*2+1,this.coords.mouse},"mouseToScene"));x(this,"getMousePos",o(r=>({x:r.offsetX,y:r.offsetY}),"getMousePos"));x(this,"handleMouseDownRotate",o(r=>{this.coords.rotateStart.set(r.clientX,r.clientY),this.publish("rotate-start"),this.publish("user-rotate-start")},"handleMouseDownRotate"));x(this,"handleMouseDownPan",o(()=>{let r=this.raycastToFloor(this.coords.mouse);this.coords.panStart.set(r.x,r.y,0),this.coords.panCameraStart.set(this.orbit.position.x,this.orbit.position.y,0),this.publish("pan-start"),this.publish("user-pan-start")},"handleMouseDownPan"));x(this,"handleMouseDownPedestal",o(r=>{let n=new wt(r.clientX,r.clientY);this.coords.initialShiftPos=n,this.coords.initialPedestal=this.getPedestal(),this.pedestalScaleFactor=OE(this.camera.fov,this.renderer.domElement.clientHeight,this.getZoomAltitude()),this.publish("pedestal-start"),this.publish("user-pedestal-start")},"handleMouseDownPedestal"));x(this,"handleMouseMovePedestal",o(r=>{let n={x:r.clientX,y:r.clientY},i=this.coords.initialPedestal+this.pedestalScaleFactor*(n.y-this.coords.initialShiftPos.y);this.stayInsideBounds&&(i<this.minPedestal?i=Math.max(i,this.minPedestal):i>this.maxPedestal&&(i=Math.min(i,this.maxPedestal))),i!==this.getPedestal()&&this.setPedestal(i,!0)},"handleMouseMovePedestal"));x(this,"handleMouseMoveRotate",o(r=>{this.coords.rotateEnd.set(r.clientX,r.clientY),this.coords.rotateDelta.subVectors(this.coords.rotateEnd,this.coords.rotateStart),this.setRotation(this.getRotation()+this.coords.rotateDelta.x/this.rotateSpeed),this.setTilt(this.getTilt()-this.coords.rotateDelta.y/this.rotateSpeed),this.coords.rotateStart.copy(this.coords.rotateEnd),this.publish("change")},"handleMouseMoveRotate"));x(this,"publishUserZoomDebounced",o0(()=>{this.isUserZooming=!1,this.publish("user-zoom-end")},250));x(this,"publishUserZoomEvent",o(()=>{this.isUserZooming?this.publishUserZoomDebounced():(this.publish("user-zoom-start"),this.isUserZooming=!0,this.publishUserZoomDebounced())},"publishUserZoomEvent"));x(this,"setCameraMoving",o(()=>{this.cameraMoving=!0},"setCameraMoving"));x(this,"unsetCameraMoving",o(()=>{this.cameraMoving=!1,this.lastCameraMoveTime=Date.now()},"unsetCameraMoving"));x(this,"setUserInteracting",o(()=>{this.userInteracting=!0},"setUserInteracting"));x(this,"unsetUserInteracting",o(()=>{this.userInteracting=!1},"unsetUserInteracting"));x(this,"publishPedestalChangeEvent",o(r=>{this.publish("pedestal-change",{pedestal:r,scrolledToTop:this.scrolledToTop,scrolledToBottom:this.scrolledToBottom,scrollPercent:this.scrollPercent})},"publishPedestalChangeEvent"));x(this,"convertAltitudeToZoomLevel",o(r=>{let[,n]=this.center,s=r*2*Math.tan(Yt.degToRad(this.camera.fov)/2)/this.options.canvasHeight,l=Math.cos(Yt.degToRad(n))*2*Math.PI*xE/s;return Yt.clamp(Math.log2(l/512),lT,uT)},"convertAltitudeToZoomLevel"));x(this,"convertZoomLevelToAltitude",o(r=>{let[,n]=this.center,i=Yt.clamp(r,lT,uT),s=Math.pow(2,i),l=Yt.clamp(n,AD,DD),c=s*512;return Math.cos(Yt.degToRad(l))*Math.PI*2*xE/c*this.options.canvasHeight/2/Math.tan(Yt.degToRad(this.camera.fov)/2)},"convertZoomLevelToAltitude"));x(this,"completeTween",o(r=>{r.isPlaying()&&r.stop(),this.rendererState.tweenGroup.remove(r),this.tweens.delete(r)},"completeTween"));x(this,"debugContainer",new Zp);this.camera=r,this.renderer=i,this.rendererState=s,this.scene=n,this.options=l,this.elevation=r.parent,this.orbit=this.elevation.parent,this.cameraPlane=this.createCameraPlane(),this.zoomStart=r.position.z,l.mode!=="outdoors-overlay"&&this.addEventListeners()}get maxZoomLevel(){return this.convertAltitudeToZoomLevel(this.minZoomAltitude)}setMaxZoomLevel(r){this.minZoomAltitude=this.convertZoomLevelToAltitude(r)}get defaultMinZoomLevel(){return d(this,fT)}get minZoomLevel(){return this.convertAltitudeToZoomLevel(this.maxZoomAltitude)}setMinZoomLevel(r){this.maxZoomAltitude=this.convertZoomLevelToAltitude(r)}get scrollPercent(){let r=this.minPedestal,n=this.maxPedestal,i=this.getPedestal();return i=Math.min(i,n),i=Math.max(i,r),(i-r)/(n-r)*100}get fov(){return this.camera.fov}get scrolledToBottom(){return this.minPedestal===0||Math.floor(this.getPedestal())<=this.minPedestal}get scrolledToTop(){return this.maxPedestal===0||Math.ceil(this.getPedestal())>=this.maxPedestal}get center(){var s,l,c,p;let r=this.getPosition(),{lat:n,lon:i}=bS((l=(s=this.rendererState.center)==null?void 0:s[1])!=null?l:0,(p=(c=this.rendererState.center)==null?void 0:c[0])!=null?p:0,r.x,r.y);return[i,n]}setCenter(r,n){var l,c,p,h;let{x:i,y:s}=xS((c=(l=this.rendererState.center)==null?void 0:l[1])!=null?c:0,(h=(p=this.rendererState.center)==null?void 0:p[0])!=null?h:0,n,r);this.setPosition(i,s)}get isAnimating(){return this.rendererState.tweenGroup.getAll().some(r=>r.cameraAnimation)}getCameraFrameForCoordinates(r,n){let i=n.minZoom!==void 0?n.minZoom:this.minZoomAltitude,s=n.maxZoom!==void 0?n.maxZoom:this.maxZoomAltitude,l=this.options.canvasWidth,c=this.options.canvasHeight,p=this.getRotation(),h=this.getTilt(),y=this.getPosition();this.setRotation(n.rotation||p,!0),this.setTilt(n.tilt||h,!0);let b=jie(r,{canvasWidth:l,canvasHeight:c,paddingOption:n.padding,verticalPadding:n.verticalPadding,minZoom:i,maxZoom:s,position:y,camera:this.camera,orbit:this.orbit});return this.setRotation(p,!0),this.setTilt(h,!0),{center:b.position,zoomLevel:this.convertAltitudeToZoomLevel(b.zoom)}}focusOn(r,n){if(RLe){this.debugContainer&&Pi(this.debugContainer);let T=new Cu(4,4,4),O=new _o({color:65280,depthTest:!1}),D=new Md(T,O,r.length),A=new Su;r.forEach((R,j)=>{A.setPosition(R),D.setMatrixAt(j,A)}),D.instanceMatrix.needsUpdate=!0,this.debugContainer.add(D),this.scene.add(this.debugContainer)}let i=n.curve,s=n.callback,l=n.cancelledCallback,c=n.minZoom!==void 0?n.minZoom:this.minZoomAltitude,p=n.maxZoom!==void 0?n.maxZoom:this.maxZoomAltitude,h=this.options.canvasWidth,y=this.options.canvasHeight,b;n.duration!==void 0?b=n.duration:I.env.TESTING==="true"?b=0:b=kD;let _=n.padding,C=this.getRotation(),P=this.getTilt();n.rotation!=null&&this.setRotation(n.rotation),n.tilt!=null&&this.setTilt(n.tilt);let E=jie(r,{canvasHeight:y,paddingOption:_,canvasWidth:h,minZoom:c,maxZoom:p,camera:this.camera,orbit:this.orbit,position:this.getPosition(),verticalPadding:n.verticalPadding});this.setRotation(C),this.setTilt(P),this.animateCamera({position:E.position,tilt:n.tilt,rotation:n.rotation,zoom:E.zoom},b,i,s,l,n)}resize(r,n){this.options.canvasWidth=r,this.options.canvasHeight=n}};fT=new WeakMap,o(dT,"CameraSystem"),x(dT,"CAMERA_FRAME_PADDING_SIDES",["top","bottom","left","right"]);var Sv=dT;function jie(e,{canvasWidth:t,orbit:r,paddingOption:n,verticalPadding:i=0,canvasHeight:s,minZoom:l,maxZoom:c,camera:p,position:h}){let y={zoom:l,position:h};if(e.length===0)return y;for(let Ye of Sv.CAMERA_FRAME_PADDING_SIDES)typeof n[Ye]!="number"&&(n[Ye]=0);let b=n.type==="portion"?{top:n.top*s,bottom:n.bottom*s,left:n.left*t,right:n.right*t,type:"pixel"}:n;if(b.left+b.right>=t||b.top+b.bottom>=s)return y;r.updateMatrixWorld();let _=p.matrixWorldInverse,C=p.fov*(Math.PI/180)/2,P=C,T=Math.atan(Math.tan(C)*(t/s)),O=new ht(1/0,1/0,1/0),D=new ht(-1/0,-1/0,-1/0),A=new co,R=new ht;for(let Ye=0,Pt=e.length;Ye<Pt;Ye++)R.copy(e[Ye]),A.expandByPoint(R),R.applyMatrix4(_),O.min(R),D.max(R),R.copy(e[Ye]),R.z-=i,R.applyMatrix4(_),O.min(R),D.max(R),R.copy(e[Ye]),R.z+=i,R.applyMatrix4(_),O.min(R),D.max(R);let j=D.x-O.x,X=D.y-O.y,Y=t-b.left-b.right,N=s-b.top-b.bottom,Z=(D.x+O.x)/2,ae=(D.y+O.y)/2,se=j/Y,U=X/N,xe=l,ne=c,Pe=xe*Math.tan(T)*2,Ce=ne*Math.tan(T)*2,Ue=Pe/t,_e=Ce/t,Me=Math.max(se,U);Me=Yt.clamp(Me,Ue,_e);let Q=Y*Me,it=N*Me,Ke={min:{x:Z-Q/2-b.left*Me,y:ae-it/2-b.bottom*Me},max:{x:Z+Q/2+b.right*Me,y:ae+it/2+b.top*Me}},rt=(Ke.min.x+Ke.max.x)/2,Ae=(Ke.min.y+Ke.max.y)/2,Be=A.getCenter(new ht),We=Math.abs(rt-Ke.min.x),je=Math.abs(Ae-Ke.min.y),Se=We/Math.tan(T),H=je/Math.tan(P),ie=new ht;ie.set(rt,Ae,D.z+Math.max(Se,H)),ie.applyMatrix4(p.matrixWorld);let ee=new ht;ee.set(rt,Ae,D.z),ee.applyMatrix4(p.matrixWorld);let Ee=new ht().subVectors(ee,ie),Ne=(Be.z-ie.z)/Ee.z,Oe=new ht().copy(ie).add(Ee.clone().multiplyScalar(Ne));return ee.set(Oe.x,Oe.y,Oe.z),ie.sub(ee),{position:Oe,zoom:ie.length()}}o(jie,"getCameraFrameForPoints");g();var BLe=300,P2,T2,BD=class BD{constructor(t){x(this,"state");G(this,P2,new ht);G(this,T2,new ht);this.state=t}update(t){var i;let r,n;this.state.cameraObject.getWorldPosition(d(this,T2));for(let s of this.state.geometry2DIdsInScene)if(r=this.state.geometry2DMap.get(s),r&&(n=r.components[0],n&&"containerEl"in n&&n.markerContainer!=null)){if(n.visibilityNeedsUpdate!==!1&&(n.visibilityNeedsUpdate==="show"?n.canShow=!0:n.canShow=!1),(n.canShow&&n.visible===!0||((i=n.animation)==null?void 0:i.pending)===!0)&&!n.offscreen)if(n.options.zIndex!=null)n.markerContainer.style.transform="translate3D(".concat(n.projection.x,"px, ").concat(n.projection.y,"px, ").concat(n.options.zIndex,"px)");else{r.object3d.getWorldPosition(d(this,P2));let l=d(this,T2).distanceTo(d(this,P2));n.markerContainer.style.transform="translate3D(".concat(n.projection.x,"px, ").concat(n.projection.y,"px, ").concat(-l,"px)")}if(n.canShow===!0&&n.visible===!0?n.markerContainer.style.pointerEvents=t?"none":n.pointerEvents:n.markerContainer.style.pointerEvents="none",n.currentStrategyIndex===-1&&n.visible&&n.visibilityNeedsUpdate==="show")continue;n.visibilityNeedsUpdate!==!1&&!n.offscreen&&(n.visibilityNeedsUpdate==="show"&&(n.markerContainer.style.opacity="0"),n.animation&&n.animation.cancel(),n.animation=n.markerContainer.animate([{opacity:n.canShow&&n.visible?"1":"0"}],{duration:BLe,easing:"ease-in-out",fill:"forwards"}),n.visibilityNeedsUpdate=!1)}}};P2=new WeakMap,T2=new WeakMap,o(BD,"DOMDrawSystem");var hT=BD;g();var $D=class $D{constructor(){x(this,"percentExpanded",0);x(this,"activeId","");x(this,"gap",20);x(this,"dirty",!0)}};o($D,"StackComponent");var mT=$D;g();var jD=class jD extends Lt{constructor(r,n){super();x(this,"state");x(this,"dirty",!0);x(this,"domTree");x(this,"observers",new Map);x(this,"updateDimensions",o(r=>{r.forEach(n=>{var l;let s=(l=n.target.parentElement)==null?void 0:l.getAttribute("data-marker-id");if(s){let c=this.state.geometry2DMap.get(s),p=c==null?void 0:c.components[0];c&&p instanceof xp&&(p.updateDimensions(n.contentRect.width,n.contentRect.height),p.collisionDirty=!0)}}),this.publish("dimensions-update")},"updateDimensions"));this.state=r,this.domTree=n}setupObserver(){var i;if(this.observers){for(let s of this.observers.values())s.disconnect();this.observers.clear()}let r,n;for(let s of this.domTree.children){let l=s.getAttribute("data-marker-id");if(l!=null&&(r=this.state.geometry2DMap.get(l),n=r.components[0],(i=n.options)!=null&&i.dynamicResize)){let c=new ResizeObserver(this.updateDimensions);c.observe(n.containerEl),this.observers.set(s.userData.entityId,c)}}}update(){this.dirty&&(this.setupObserver(),this.dirty=!1)}destroy(){for(let r of this.observers.values())r.disconnect();this.observers.clear()}};o(jD,"DOMResizeSystem");var gT=jD;g();var $Le=0,jLe=90,GLe=(I.env.NODE_ENV==="test",!1),Kf={linear:Qi.Linear.None,"ease-in":Qi.Quadratic.In,"ease-out":Qi.Quadratic.Out,"ease-in-out":Qi.Quadratic.InOut},ULe=-50,yt,Ft,wh,E2,M2,UD,VD=class VD{constructor(t,r,n){G(this,M2);G(this,yt);G(this,Ft);G(this,wh);G(this,E2);q(this,yt,t),q(this,Ft,r),q(this,wh,n),d(this,Ft).cameraSystem.on("pedestal-change",({pedestal:i})=>{d(this,yt).map&&(d(this,yt).map.transform.elevation=i,d(this,yt).map.transform.minElevationForCurrentTile=ULe,d(this,yt).map.triggerRepaint()),d(this,Ft).cameraSystem.setCameraPlaneElevation(i)})}get center(){return d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map?d(this,yt).map.getCenter().toArray():d(this,Ft).cameraSystem.center}setCenter(t){var r;if(d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map){(r=d(this,yt).map)==null||r.setCenter(t),d(this,Ft).interactionSystem.handleHover();return}d(this,Ft).cameraSystem.setCenter(t[0],t[1]),d(this,Ft).interactionSystem.handleHover()}get zoomLevel(){var t;return d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map?(t=d(this,yt).map)==null?void 0:t.getZoom():d(this,Ft).cameraSystem.getZoomLevel()}setZoomLevel(t){var r;d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map&&((r=d(this,yt).map)==null||r.setZoom(t)),d(this,Ft).cameraSystem.setZoomLevel(Mc(t,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits."))}get isAnimating(){return d(this,Ft).cameraSystem.isAnimating}cancelAnimation(){d(this,Ft).cameraSystem.cancelAnimation()}get maxZoomLevel(){return d(this,Ft).cameraSystem.maxZoomLevel}get minZoomLevel(){return d(this,Ft).cameraSystem.minZoomLevel}setAutoMinZoomLevel(t){d(this,Ft).panBoundsSystem.autoMinZoomLevel=t,t&&(d(this,Ft).panBoundsSystem.dirty=!0,d(this,Ft).panBoundsSystem.update())}get autoMinZoomLevel(){return d(this,Ft).panBoundsSystem.autoMinZoomLevel}setMinZoomLevel(t,r=!1){var i;r&&this.setAutoMinZoomLevel(!1);let n=Mc(t,au.MIN_MERCATOR_ZOOM_LEVEL,this.maxZoomLevel,"setMinZoomLevel was clamped. minZoomLevel must be between ".concat(au.MIN_MERCATOR_ZOOM_LEVEL," and maxZoomLevel."));d(this,Ft).cameraSystem.setMinZoomLevel(n),this.zoomLevel<n&&this.setZoomLevel(n),(i=d(this,yt).map)==null||i.setMinZoom(n)}setMaxZoomLevel(t){var n;let r=Mc(t,this.minZoomLevel,au.MAX_MERCATOR_ZOOM_LEVEL,"setMaxZoomLevel was clamped. maxZoomLevel must be between minZoomLevel and ".concat(au.MAX_MERCATOR_ZOOM_LEVEL,"."));d(this,Ft).cameraSystem.setMaxZoomLevel(r),this.zoomLevel>r&&this.setZoomLevel(r),(n=d(this,yt).map)==null||n.setMaxZoom(r)}get maxPitch(){var t;return d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map?(t=d(this,yt).map)==null?void 0:t.getMaxPitch():Yt.radToDeg(d(this,Ft).cameraSystem.maxTilt)}get minPitch(){var t;return d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map?(t=d(this,yt).map)==null?void 0:t.getMinPitch():Yt.radToDeg(d(this,Ft).cameraSystem.minTilt)}setMinPitch(t){var n;let r=Math.max($Le,t);(n=d(this,yt).map)==null||n.setMinPitch(r),d(this,Ft).cameraSystem.minTilt=Yt.degToRad(r)}setMaxPitch(t){var n;let r=Math.min(jLe,t);(n=d(this,yt).map)==null||n.setMaxPitch(r),d(this,Ft).cameraSystem.maxTilt=Yt.degToRad(r)}get bearing(){var t;return d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map?(t=d(this,yt).map)==null?void 0:t.getBearing():Yt.radToDeg(d(this,Ft).cameraSystem.getRotation())}setBearing(t){var r;if(d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map){(r=d(this,yt).map)==null||r.setBearing(t);return}d(this,Ft).cameraSystem.setRotation(Yt.degToRad(t))}get pitch(){var t;return d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map?(t=d(this,yt).map)==null?void 0:t.getPitch():Yt.radToDeg(d(this,Ft).cameraSystem.getTilt())}setPitch(t){var r;if(d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map){(r=d(this,yt).map)==null||r.setPitch(t);return}d(this,Ft).cameraSystem.setTilt(Yt.degToRad(Mc(t,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")))}get elevation(){return d(this,Ft).cameraSystem.getPedestal()}setElevation(t){d(this,Ft).cameraSystem.setPedestal(t,!0)}animateElevation(t,r){return d(this,E2)&&d(this,E2).stop(),new Promise(n=>{var s;let i=d(this,Ft).cameraSystem.getPosition();i.z=t,d(this,Ft).cameraSystem.animateCamera({position:i},(r==null?void 0:r.duration)||300,Kf[(r==null?void 0:r.easing)||"ease-in-out"],n,n,{interruptible:(s=r==null?void 0:r.interruptible)!=null?s:!0})})}get insetsPadding(){return d(this,wh).insetsPadding}get panMode(){return d(this,Ft).cameraSystem.enablePan===!1&&d(this,Ft).cameraSystem.enablePedestal===!0?"elevation":"default"}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&(t==="default"?(d(this,Ft).cameraSystem.enablePan=!0,d(this,Ft).cameraSystem.enablePedestal=!1):(d(this,Ft).cameraSystem.enablePan=!1,d(this,Ft).cameraSystem.enablePedestal=!0))}setInsetPadding(t){d(this,wh).insetsPadding=Object.assign({},Mb,t)}animateTo(t){var l,c,p,h,y,b;if(d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map)return(b=d(this,yt).map)==null||b.flyTo({center:(l=t.center)!=null?l:this.center,zoom:(c=t.zoomLevel)!=null?c:this.zoomLevel,bearing:(p=t.bearing)!=null?p:this.bearing,pitch:(h=t.pitch)!=null?h:this.pitch,duration:(y=t.duration)!=null?y:600}),Promise.resolve();let r=t.center?d(this,yt).convertTo3DMapPosition(t.center[1],t.center[0],t.center[2]||this.elevation):void 0,n=t.zoomLevel!==void 0?d(this,Ft).cameraSystem.convertZoomLevelToAltitude(Mc(t.zoomLevel,this.minZoomLevel,this.maxZoomLevel,"zoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() and mapView.Camera.setMaxZoomLevel() to adjust limits.")):void 0,i=t.bearing!==void 0?Yt.degToRad(t.bearing):void 0,s=t.pitch!==void 0?Yt.degToRad(Mc(t.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0;return new Promise(_=>{var C;d(this,Ft).cameraSystem.animateCamera({position:r,zoom:n,rotation:i,tilt:s},t.duration||0,Kf[t.easing||"ease-in-out"],()=>{d(this,Ft).interactionSystem.handleHover(),_()},_,{interruptible:(C=t==null?void 0:t.interruptible)!=null?C:!0})})}getCameraFrameForCoordinates(t,r){let n=ke(this,M2,UD).call(this,r||{},()=>Promise.resolve()),{pointCloud:i}=Gie(t,d(this,yt),d(this,wh).geometry3DMap);if(i.length===0)return ce.error("No valid coordinates found in targets:",t),{center:this.center,zoomLevel:this.zoomLevel};let{center:s,zoomLevel:l}=d(this,Ft).cameraSystem.getCameraFrameForCoordinates(i,n);return{center:d(this,yt).convert3DMapPositionToCoordinate(s),zoomLevel:l}}focusOn(t,r){var l,c,p,h;let{pointCloud:n,geoBounds:i,firstPosition:s}=Gie(t,d(this,yt),d(this,wh).geometry3DMap);return n.length===0?(ce.error("No valid coordinates found in targets:",t),Promise.resolve()):d(this,yt).mode==="outdoors-overlay"&&d(this,yt).map?(n.length===1&&s?(l=d(this,yt).map)==null||l.flyTo({center:[s[0],s[1]],duration:(r==null?void 0:r.duration)||d(this,yt).map.getBearing(),animate:!0,bearing:(r==null?void 0:r.bearing)===void 0?d(this,yt).map.getBearing():r==null?void 0:r.bearing,pitch:(r==null?void 0:r.pitch)===void 0?d(this,yt).map.getPitch():r==null?void 0:r.pitch,zoom:(r==null?void 0:r.maxZoomLevel)||d(this,yt).map.getMaxZoom()}):(GLe&&VLe(d(this,yt),i),(h=d(this,yt).map)==null||h.fitBounds(i,{duration:(c=r==null?void 0:r.duration)!=null?c:au.DEFAULT_ANIMATION_DURATION,bearing:(r==null?void 0:r.bearing)===void 0?d(this,yt).map.getBearing():r==null?void 0:r.bearing,pitch:(r==null?void 0:r.pitch)===void 0?d(this,yt).map.getPitch():r==null?void 0:r.pitch,maxZoom:(p=r==null?void 0:r.maxZoomLevel)!=null?p:d(this,yt).map.getMaxZoom()})),d(this,Ft).interactionSystem.handleHover(),Promise.resolve()):new Promise(y=>{d(this,Ft).cameraSystem.focusOn(n,ke(this,M2,UD).call(this,r||{},y))})}};yt=new WeakMap,Ft=new WeakMap,wh=new WeakMap,E2=new WeakMap,M2=new WeakSet,UD=o(function(t,r){var n;return{minZoom:(t==null?void 0:t.maxZoomLevel)===void 0?void 0:d(this,Ft).cameraSystem.convertZoomLevelToAltitude(Mc(t.maxZoomLevel,this.minZoomLevel,this.maxZoomLevel,"maxZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMaxZoomLevel() to adjust limits.")),maxZoom:(t==null?void 0:t.minZoomLevel)===void 0?void 0:d(this,Ft).cameraSystem.convertZoomLevelToAltitude(Mc(t.minZoomLevel,this.minZoomLevel,this.maxZoomLevel,"minZoomLevel was clamped to minZoomLevel/maxZoomLevel bounds. Use mapView.Camera.setMinZoomLevel() to adjust limits.")),padding:t!=null&&t.padding?Object.assign({},Mb,t==null?void 0:t.padding):this.insetsPadding,curve:Kf[(t==null?void 0:t.easing)||"ease-in-out"],rotation:(t==null?void 0:t.bearing)===void 0?void 0:Yt.degToRad(t.bearing),tilt:(t==null?void 0:t.pitch)!==void 0?Yt.degToRad(Mc(t.pitch,this.minPitch,this.maxPitch,"pitch was clamped to minPitch/maxPitch bounds. Use mapView.Camera.setMinPitch() and mapView.Camera.setMaxPitch() to adjust limits.")):void 0,duration:t==null?void 0:t.duration,callback:o(()=>{d(this,Ft).interactionSystem.handleHover(),r()},"callback"),cancelledCallback:r,interruptible:(n=t==null?void 0:t.interruptible)!=null?n:!0,verticalPadding:t==null?void 0:t.verticalPadding}},"#convertToLegacy"),o(VD,"Camera");var yT=VD;function GD(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}o(GD,"updateBounds");function Gie(e,t,r){var c;let n=[],i=[1/0,1/0,-1/0,-1/0],s=null;if(!e||!Array.isArray(e)||e.length===0)return{pointCloud:n,geoBounds:i,firstPosition:s};let l=t.getSystems().renderSystem;(l.threeDdirty||l.twoDdirty)&&t.renderSync();for(let p of e)if(typeof p=="string"){let h=r.get(p);if(!h){ce.error("Entity not found with id:",p);continue}let y=new co;JN(t,"userData"in h&&(c=h.userData.entityId)!=null?c:h.id,n,y,h instanceof Ar?h.position.z:void 0);let b=t.convert3DMapPositionToCoordinate(y.min),_=t.convert3DMapPositionToCoordinate(y.max);GD(i,b),GD(i,_),s||(s=t.convert3DMapPositionToCoordinate(y.getCenter(new ht)))}else n.push(t.convertTo3DMapPosition(p[1],p[0],p[2]||0)),GD(i,p),s||(s=p);return{pointCloud:n,geoBounds:i,firstPosition:s}}o(Gie,"processTargets");function VLe(e,t){var n,i,s,l;let r=[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]]];(n=e.map)!=null&&n.getLayer("bounds-outline")&&e.map.removeLayer("bounds-outline"),(i=e.map)!=null&&i.getSource("bounds-source")&&e.map.removeSource("bounds-source"),(s=e.map)==null||s.addSource("bounds-source",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:r}}}),(l=e.map)==null||l.addLayer({id:"bounds-outline",type:"line",source:"bounds-source",layout:{},paint:{"line-color":"#FF0000","line-width":2,"line-opacity":.8}})}o(VLe,"drawBounds");g();g();var Uie="uniform vec4 uSize;\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n // Scale the position by the size of the quad\n // and shift to top left corner for 0,0\n vec2 transformed = position.xy * uSize.xy - vec2(1.0, -1.0);\n // Apply width .x and height .y of image\n transformed += vec2(uSize.x, -uSize.y);\n // Apply left .w and top .z offset\n transformed += vec2(uSize.w, -uSize.z) * 2.0;\n gl_Position = vec4(transformed, 1.0, 1.0);\n}";g();var Vie="varying vec2 vUv;\nuniform sampler2D uTexture;\nuniform float uOpacity;\nvoid main() {\n #ifndef debug\n vec4 texture = texture2D(uTexture, vUv);\n gl_FragColor = vec4(texture.rgb, texture.a * uOpacity);\n #else\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n #endif\n}";g();var zie=4.291666666666667,qie=15,Hie=25,Wie=43/60;g();var Xie=["horizontal","icon"],zLe=new Map([[Xie[0],'<svg viewBox="0 0 206 48">\n <path d="M27.2678 14.2261H22.3187C21.0695 14.2261 20.4695 14.7801 20.4695 15.9852V31.142L10.3966 15.5591C9.69665 14.4784 9.2475 14.2773 7.8475 14.2261H2.97462C1.67462 14.2261 1.07631 14.7801 1.07631 15.9852V44.7665C1.07631 45.9716 1.67462 46.5256 2.97462 46.5256H7.92377C9.22207 46.5256 9.82207 45.9716 9.82207 44.7665V29.6847L19.9441 45.1926C20.695 46.3244 21.095 46.5256 22.4933 46.5256H27.2933C28.5916 46.5256 29.1916 45.9716 29.1916 44.7665V15.9852C29.1407 14.7801 28.5424 14.2261 27.2678 14.2261Z"/>\n <path d="M5.44915 10.9602C8.45863 10.9602 10.8983 8.50669 10.8983 5.48011C10.8983 2.45353 8.45863 0 5.44915 0C2.43967 0 0 2.45353 0 5.48011C0 8.50669 2.43967 10.9602 5.44915 10.9602Z"/>\n <path d="M61.7899 25.0449C63.2306 23.1903 65.078 22.2051 67.556 22.2051C72.0526 22.2051 74.7611 25.3347 74.7611 29.4511V39.2489C74.8187 39.7125 74.5306 39.9443 74.0695 39.9443H72.5136C72.0526 39.9443 71.7645 39.7125 71.8221 39.2489V29.5091C71.8221 27.1909 69.9187 25.2187 67.4984 25.2187C65.1339 25.2187 63.2323 27.1329 63.2323 29.2773V39.2489C63.2899 39.7125 63.0018 39.9443 62.5407 39.9443H60.9831C60.5221 39.9443 60.2916 39.7125 60.2916 39.2489V29.4511C60.2916 27.1329 58.3899 25.2187 56.0255 25.2187C53.7204 25.2187 51.7594 27.075 51.7594 29.2773V39.3068C51.817 39.7705 51.5289 40.0023 51.0102 40.0023H49.5119C49.0509 40.0023 48.7628 39.7705 48.7628 39.3068V23.25C48.7051 22.7864 48.9933 22.4966 49.5119 22.4966H50.9526C51.356 22.4966 51.5289 22.6704 51.5289 23.0182V24.2352C52.7407 22.9602 54.239 22.2648 56.0255 22.2648C58.4475 22.2068 60.3492 23.192 61.7899 25.0466V25.0449ZM77.1255 31.2477C77.1255 26.3216 81.1018 22.2051 86.1187 22.2051C88.539 22.2051 90.6136 23.1903 92.3441 25.1608V23.1903C92.3441 22.7267 92.5746 22.5528 93.0357 22.5528H94.4187C94.8797 22.5528 95.1102 22.7847 95.1102 23.3062V39.3648C95.1102 39.8284 94.8797 40.0602 94.4187 40.0602H93.0357C92.5746 40.0602 92.3441 39.8284 92.3441 39.4227V37.4523C90.6712 39.3648 88.5967 40.35 86.1746 40.35C81.1018 40.2341 77.1238 36.1773 77.1238 31.2477H77.1255ZM92.1136 31.2477C92.1136 27.8284 89.4611 25.2187 86.0594 25.2187C82.7746 25.2187 80.1221 27.8864 80.1221 31.2477C80.1221 34.6687 82.7746 37.2784 86.1187 37.2784C86.9062 37.2789 87.6861 37.1232 88.4138 36.8202C89.1414 36.5173 89.8026 36.0731 90.3593 35.513C90.9161 34.9528 91.3577 34.2878 91.6587 33.556C91.9597 32.8241 92.1143 32.0397 92.1136 31.2477ZM100.992 37.3943V46.3807C101.049 46.8443 100.761 47.1341 100.298 47.1341H98.7424C98.2814 47.1341 97.9933 46.9023 97.9933 46.3807V23.1903C97.9933 22.7267 98.2238 22.4369 98.7424 22.4369H100.183C100.646 22.379 100.934 22.6687 100.934 23.0744V24.9869C102.605 23.0744 104.68 22.1472 107.044 22.1472C112.002 22.1472 116.037 26.2619 116.037 31.1898C116.037 36.1176 112.059 40.2341 107.044 40.2341C104.622 40.2341 102.603 39.3068 100.992 37.3943ZM106.987 25.2187C103.7 25.2187 101.049 27.8864 101.049 31.2477C101.049 34.6687 103.7 37.2784 107.044 37.2784C110.446 37.2784 113.039 34.6108 113.039 31.2477C113.039 27.8864 110.388 25.2187 106.987 25.2187ZM121.11 37.3943V46.3807C121.168 46.8443 120.88 47.1341 120.419 47.1341H118.861C118.4 47.1341 118.112 46.9023 118.112 46.3807V23.1903C118.112 22.7267 118.342 22.4369 118.861 22.4369H120.302C120.764 22.379 121.053 22.6687 121.053 23.0744V24.9869C122.724 23.0744 124.798 22.1472 127.163 22.1472C132.12 22.1472 136.156 26.2619 136.156 31.1898C136.156 36.1176 132.178 40.2341 127.163 40.2341C124.742 40.2341 122.781 39.3068 121.11 37.3943ZM127.105 25.2187C123.819 25.2187 121.168 27.8864 121.168 31.2477C121.168 34.6687 123.819 37.2784 127.163 37.2784C130.564 37.2784 133.158 34.6108 133.158 31.2477C133.158 27.8864 130.507 25.2187 127.107 25.2187H127.105ZM153.97 32.3506H141.054C141.342 35.2483 143.995 37.4523 147.164 37.4523C148.893 37.4523 150.393 37.0466 151.719 36.0597C152.007 35.8858 152.295 35.7699 152.353 35.7699C152.583 35.7699 152.756 35.8858 152.929 36.1773L153.505 37.1625C153.622 37.3364 153.68 37.4523 153.68 37.5682C153.68 37.8 153.507 38.0318 153.103 38.3216C151.258 39.5966 149.183 40.292 146.992 40.292C141.688 40.292 137.883 36.3511 137.883 31.2477C137.883 26.204 141.803 22.2051 146.703 22.2051C151.546 22.2051 154.717 25.7983 154.717 31.0176C154.717 31.5972 154.717 32.3506 153.968 32.3506H153.97ZM141.056 30.0324H151.72C151.432 26.8432 149.473 24.929 146.648 24.929C145.241 24.8904 143.875 25.3995 142.833 26.3501C141.791 27.3007 141.154 28.6194 141.056 30.0307V30.0324ZM156.332 31.2477C156.332 26.3216 160.31 22.2051 165.326 22.2051C167.748 22.2051 169.707 23.1324 171.32 25.0449V16.2324C171.263 15.7687 171.551 15.479 172.012 15.479H173.57C174.031 15.479 174.319 15.7108 174.319 16.2324V39.3068C174.319 39.7705 174.088 40.0023 173.57 40.0023H172.129C171.666 40.0602 171.378 39.7705 171.378 39.3648V37.3943C169.649 39.3068 167.632 40.292 165.268 40.292C160.31 40.2341 156.332 36.1773 156.332 31.2477ZM171.264 31.2477C171.264 27.8284 168.612 25.2187 165.21 25.2187C161.924 25.2187 159.273 27.8864 159.273 31.2477C159.273 34.6687 161.924 37.2784 165.268 37.2784C166.057 37.2838 166.839 37.1316 167.569 36.8304C168.299 36.5292 168.962 36.0852 169.52 35.5241C170.077 34.963 170.519 34.296 170.818 33.5619C171.117 32.8277 171.268 32.0411 171.263 31.2477H171.264ZM177.72 19.0739C177.715 18.8594 177.754 18.646 177.833 18.4468C177.912 18.2476 178.031 18.0667 178.182 17.915C178.333 17.7633 178.512 17.6439 178.71 17.5642C178.909 17.4845 179.121 17.446 179.334 17.4511C179.546 17.4507 179.756 17.4923 179.952 17.5737C180.148 17.6551 180.326 17.7746 180.476 17.9254C180.626 18.0762 180.745 18.2553 180.826 18.4523C180.907 18.6494 180.948 18.8606 180.948 19.0739C180.953 19.2884 180.914 19.5017 180.835 19.7009C180.756 19.9001 180.637 20.081 180.486 20.2327C180.335 20.3845 180.156 20.5038 179.957 20.5835C179.759 20.6633 179.547 20.7017 179.334 20.6966C178.412 20.7545 177.72 20.0591 177.72 19.0739ZM177.836 39.2489V23.1903C177.836 22.7267 178.066 22.4369 178.527 22.4369H180.083C180.544 22.4369 180.832 22.6687 180.775 23.1903V39.2489C180.832 39.7125 180.544 39.9443 180.083 39.9443H178.527C178.066 39.9443 177.836 39.7125 177.836 39.2489ZM186.944 23.0165V24.1756C188.212 22.8426 189.71 22.2051 191.497 22.2051C195.937 22.2051 198.646 25.2767 198.646 29.3932V39.2489C198.703 39.7125 198.415 39.9443 197.954 39.9443H196.398C195.936 39.9443 195.705 39.7125 195.705 39.2489V29.4511C195.705 27.1329 193.803 25.2187 191.439 25.2187C189.134 25.2187 187.175 27.075 187.175 29.2773V39.3068C187.232 39.7705 186.944 40.0023 186.424 40.0023H184.868C184.407 40.0023 184.119 39.7705 184.119 39.3068V23.1903C184.061 22.7267 184.349 22.4949 184.868 22.4949H186.309C186.712 22.4949 186.944 22.6687 186.944 23.0165Z"/>\n <path d="M204 40C205.115 40 206 39.0857 206 38V37.9886C206 36.9029 205.126 36 204 36C202.885 36 202 36.9143 202 38V38.0114C202 39.0971 202.874 40 204 40ZM204 39.7829C202.989 39.7829 202.23 38.9829 202.23 38.0114V38C202.23 37.0286 203 36.2171 204 36.2171C205.011 36.2171 205.77 37.0171 205.77 37.9886V38C205.77 38.9714 205 39.7829 204 39.7829ZM203.218 38.9714H203.609V38.2743H204.034L204.517 38.9714H204.989L204.448 38.2057C204.724 38.1257 204.92 37.92 204.92 37.5886C204.92 37.1657 204.586 36.9486 204.138 36.9486H203.218V38.9714ZM203.609 37.9543V37.2914H204.103C204.368 37.2914 204.517 37.4057 204.517 37.6229C204.517 37.8171 204.368 37.9543 204.103 37.9543H203.609Z"/>\n </svg>'],[Xie[1],'<svg viewBox="0 0 43 60">\n <path d="M14.0291 7.06645C14.0291 10.9691 10.8885 14.1329 7.01453 14.1329C3.14051 14.1329 0 10.9691 0 7.06645C0 3.16376 3.14051 0 7.01453 0C10.8885 0 14.0291 3.16376 14.0291 7.06645Z"/>\n <path d="M28.7335 18.3468H35.1045C36.7455 18.3468 37.5178 19.0599 37.5821 20.6158V57.7309C37.5821 59.2868 36.8099 60 35.1367 60H28.9588C27.1569 60 26.642 59.7406 25.6767 58.282L12.6452 38.282V57.7309C12.6452 59.2868 11.8729 60 10.1997 60H3.82873C2.15554 60 1.3833 59.2868 1.3833 57.7309V20.6158C1.3833 19.0599 2.15554 18.3468 3.82873 18.3468H10.1032C11.9051 18.4116 12.4843 18.671 13.3852 20.0648L26.3524 40.162V20.6158C26.3524 19.0599 27.1247 18.3468 28.7335 18.3468Z"/>\n <path d="M41.5 60C42.3362 60 43 59.3143 43 58.5V58.4914C43 57.6771 42.3448 57 41.5 57C40.6638 57 40 57.6857 40 58.5V58.5086C40 59.3229 40.6552 60 41.5 60ZM41.5 59.8371C40.7414 59.8371 40.1724 59.2371 40.1724 58.5086V58.5C40.1724 57.7714 40.75 57.1629 41.5 57.1629C42.2586 57.1629 42.8276 57.7629 42.8276 58.4914V58.5C42.8276 59.2286 42.25 59.8371 41.5 59.8371ZM40.9138 59.2286H41.2069V58.7057H41.5259L41.8879 59.2286H42.2414L41.8362 58.6543C42.0431 58.5943 42.1897 58.44 42.1897 58.1914C42.1897 57.8743 41.9397 57.7114 41.6034 57.7114H40.9138V59.2286ZM41.2069 58.4657V57.9686H41.5776C41.7759 57.9686 41.8879 58.0543 41.8879 58.2171C41.8879 58.3629 41.7759 58.4657 41.5776 58.4657H41.2069Z"/>\n </svg>']]),qLe=/<svg([^>]*)>/g;function Yie(e,t,r,n){let i=zLe.get(e);return i?i.replace(qLe,'<svg$1 width="'.concat(r,'" height="').concat(n,'" xmlns="http://www.w3.org/2000/svg" style="fill: ').concat(t,';">')):""}o(Yie,"getLogoIcon");var Zie=!1,Wn,Jf,Cv,Fo,Ia,cy,rc,wp,zD=class zD extends Lt{constructor(r,n,i){super();G(this,Wn,{padding:16,scale:1,iconOnly:!1,position:"bottom-left",color:"dark",onClick:o(()=>{window!=null&&window.open("https://www.mappedin.com")},"onClick"),interactive:!0,visible:!0});G(this,Jf);G(this,Cv);G(this,Fo);G(this,Ia);G(this,cy);G(this,rc,0);G(this,wp,0);x(this,"dirty",!0);x(this,"getPositionAlignedCanvasCoordinates",o((r,n)=>({"top-left":{x:0,y:0},"top-right":{x:r,y:0},"bottom-left":{x:0,y:n},"bottom-right":{x:r,y:n},center:{x:r/2,y:n/2},top:{x:r/2,y:0},bottom:{x:r/2,y:n},left:{x:0,y:n/2},right:{x:r,y:n/2}})[d(this,Wn).position],"getPositionAlignedCanvasCoordinates"));x(this,"getPositionAlignedPadding",o(()=>{var i,s,l,c;let r=d(this,Wn).padding;if(typeof r=="number")return{"top-left":{x:r,y:r},"top-right":{x:-r,y:r},"bottom-left":{x:r,y:-r},"bottom-right":{x:-r,y:-r},center:{x:0,y:0},top:{x:0,y:r},bottom:{x:0,y:-r},left:{x:r,y:0},right:{x:-r,y:0}}[d(this,Wn).position];let n={top:(i=r.top)!=null?i:0,right:(s=r.right)!=null?s:0,bottom:(l=r.bottom)!=null?l:0,left:(c=r.left)!=null?c:0};return{x:n.left-n.right,y:n.top-n.bottom}},"getPositionAlignedPadding"));i&&Object.entries(i).forEach(([s,l])=>{l!==void 0&&(d(this,Wn)[s]=l)}),q(this,Cv,r),q(this,Jf,n)}get color(){return d(this,Wn).color==="light"?"white":"#293136"}get iconName(){return d(this,Wn).iconOnly?"icon":"horizontal"}get minWidth(){return d(this,Wn).iconOnly?qie:75}get defaultWidth(){return d(this,Wn).iconOnly?Hie:150}get aspectRatio(){return d(this,Wn).iconOnly?Wie:zie}get options(){return k({},d(this,Wn))}set options(r){var n,i;q(this,Wn,{padding:r.padding||d(this,Wn).padding,position:r.position||d(this,Wn).position,iconOnly:r.iconOnly||d(this,Wn).iconOnly,color:r.color||d(this,Wn).color,scale:r.scale||d(this,Wn).scale,onClick:d(this,Wn).onClick,interactive:(n=r.interactive)!=null?n:d(this,Wn).interactive,visible:(i=r.visible)!=null?i:d(this,Wn).visible})}get icon(){return Yie(this.iconName,this.color,d(this,rc)*d(this,Jf).pixelRatio,d(this,wp)*d(this,Jf).pixelRatio)}setSize(r,n){d(this,Ia)&&(d(this,Ia).uniforms.uSize.value.x=r,d(this,Ia).uniforms.uSize.value.y=n)}setXY(r,n){d(this,Ia)&&(d(this,Ia).uniforms.uSize.value.w=r,d(this,Ia).uniforms.uSize.value.z=n)}get width(){return d(this,rc)}get height(){return d(this,wp)}getPositionAlignedOffset(r,n){return{"top-left":{x:0,y:0},"top-right":{x:-r,y:0},"bottom-left":{x:0,y:-n},"bottom-right":{x:-r,y:-n},center:{x:-(r/2),y:-(n/2)},top:{x:-(r/2),y:0},bottom:{x:-(r/2),y:-n},left:{x:0,y:-(n/2)},right:{x:-r,y:-(n/2)}}[d(this,Wn).position]}insertIntoQuadTree(r){d(this,cy)!=null&&typeof d(this,Wn).onClick=="function"&&d(this,Wn).interactive&&r.insert(d(this,cy))}resize(r,n){if(d(this,Wn).visible!==!0)return;let i=this.getPositionAlignedCanvasCoordinates(r,n),s=this.getPositionAlignedPadding(),l=this.getPositionAlignedOffset(d(this,rc),d(this,wp)),c=Math.min(r-d(this,rc),Math.max(0,i.x+s.x+l.x)),p=Math.min(n-d(this,wp),Math.max(0,i.y+s.y+l.y));this.setSize(d(this,rc)/r,d(this,wp)/n),this.setXY(c/r,p/n),q(this,cy,new Lo(c,p,d(this,rc),d(this,wp),{entityId:"watermark"}))}update(){this.dirty&&(d(this,Wn).visible===!0?(q(this,rc,Math.min(d(this,Jf).canvasWidth,Math.max(this.minWidth,this.defaultWidth*d(this,Wn).scale))),q(this,wp,d(this,rc)/this.aspectRatio),Sh.getLoader().load("data:image/svg+xml;base64,".concat(btoa(this.icon)),r=>{if(q(this,Ia,new Td({uniforms:{uTexture:{value:r},uSize:{value:new CN(0,0,0,0)},uOpacity:{value:.7}},vertexShader:Uie,fragmentShader:Vie,depthWrite:!1,depthTest:!1,defines:{debug:Zie},wireframe:Zie,transparent:!0,visible:!0})),d(this,Fo))d(this,Fo).visible=!0,d(this,Fo).material=d(this,Ia),d(this,Fo).material.needsUpdate=!0;else{let n=new wu(2,2,1,1);q(this,Fo,new jt(n,d(this,Ia))),d(this,Fo).position.set(0,0,-1),d(this,Fo).frustumCulled=!1,d(this,Fo).renderOrder=999;let i=new Cu(1,1,1),s=new jt(i,new _o({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}));s.frustumCulled=!1,s.layers.set(1),d(this,Fo).add(s),d(this,Cv).add(d(this,Fo))}this.resize(d(this,Jf).canvasWidth,d(this,Jf).canvasHeight),this.publish("texture-loaded")})):d(this,Fo)&&(d(this,Fo).visible=!1),this.dirty=!1)}destroy(){d(this,Fo)&&(d(this,Cv).remove(d(this,Fo)),Pi(d(this,Fo))),q(this,Fo,void 0),d(this,Ia)&&d(this,Ia).dispose(),q(this,Ia,void 0),q(this,cy,void 0)}};Wn=new WeakMap,Jf=new WeakMap,Cv=new WeakMap,Fo=new WeakMap,Ia=new WeakMap,cy=new WeakMap,rc=new WeakMap,wp=new WeakMap,o(zD,"WatermarkSystem");var vT=zD;g();var bT=100,XLe=!1,qD=class qD extends Lt{constructor(r,n){super();x(this,"currentTotalBoundingBox");x(this,"state");x(this,"cameraSystem");x(this,"debugMesh",null);x(this,"dirty",!0);x(this,"autoMinZoomLevel",!0);this.state=r,this.cameraSystem=n}update(){if(this.dirty){this.currentTotalBoundingBox==null&&(this.currentTotalBoundingBox=new co,this.state.entityScene.children.length===0?this.currentTotalBoundingBox.setFromCenterAndSize(new ht(0,0,0),new ht(bT*2,bT*2,0)):(this.currentTotalBoundingBox.setFromObject(this.state.entityScene),this.currentTotalBoundingBox.expandByScalar(bT)));let r=new co().setFromObject(this.state.entityScene);this.currentTotalBoundingBox.union(r);let n=r.getSize(new ht),i=Math.max(n.x,n.y,n.z);for(let l of this.state.geometry2DMap.values())l.positionDirty===!0&&(this.currentTotalBoundingBox.expandByPoint(l.position),l.positionDirty=!1);let s=xT.copy(this.currentTotalBoundingBox).expandByScalar(Math.max(i,bT)).getBoundingSphere(YLe).radius;if(this.cameraSystem.panBounds={center:this.currentTotalBoundingBox.getCenter(new ht),min:xT.min,max:xT.max,radius:s},this.publish("update"),this.cameraSystem.dirty=!0,this.dirty=!1,XLe&&this.state.entityScene.parent instanceof Ed){this.debugMesh&&(this.state.entityScene.parent.remove(this.debugMesh),this.debugMesh=null),this.debugMesh=new Zp,this.debugMesh.add(new jt(new cS(this.cameraSystem.panBounds.radius),new _o({color:16711680,transparent:!0,opacity:.2}))),this.debugMesh.position.copy(this.cameraSystem.panBounds.center),this.state.entityScene.parent.add(this.debugMesh);let l=new ht;xT.getSize(l);let c=new Cu(l.x,l.y,l.z),p=new _o({color:65280,wireframe:!0,transparent:!0,opacity:.5}),h=new jt(c,p);h.position.copy(this.currentTotalBoundingBox.getCenter(new ht)),this.debugMesh.add(h)}}}};o(qD,"PanBoundsSystem");var IT=qD,xT=new co,YLe=new PN;g();var Kie="\xA9 Mappedin",ZLe="https://info.mappedin.com/feedback",WD=["top-left","top-right","bottom-left","bottom-right"],KLe=640,JLe=o(()=>"<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' fill-rule='evenodd' viewBox='0 0 20 20'>\n <circle cx='10' cy='10' r='5.9' style='fill:rgba(255,255,255,1);'/>\n <path style='fill:rgba(0,0,0,0.7);' d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/>\n </svg>","getAttributionButtonIcon"),HD={custom:[],position:"bottom-right",feedback:!0},XD=class XD{constructor(t){x(this,"controlContainerEl");x(this,"controlPositions");x(this,"compact");x(this,"attribContainerEl");x(this,"attribInnerEl");x(this,"attribButtonEl");x(this,"feedbackLinkEl");x(this,"attribHTML",Kie);x(this,"customAttributions",[]);x(this,"toggleAttribution",o(t=>{this.attribContainerEl!=null&&(t.preventDefault(),this.attribContainerEl.classList.contains("mappedin-compact")&&(this.attribContainerEl.classList.contains("mappedin-compact-show")?(this.attribContainerEl.removeAttribute("open"),this.attribContainerEl.classList.remove("mappedin-compact-show")):(this.attribContainerEl.classList.add("mappedin-compact-show"),this.attribContainerEl.setAttribute("open",""))))},"toggleAttribution"));this.controlContainerEl=document.createElement("div"),this.controlContainerEl.classList.add("mappedin-control-container"),t.appendChild(this.controlContainerEl),this.controlPositions=WD.reduce((r,n)=>{let i=document.createElement("div");return i.classList.add("mappedin-ctrl-".concat(n)),this.controlContainerEl.appendChild(i),r[n]=i,r},{})}addAttributionControl(t=HD){var i;let r=t.position&&WD.includes(t.position)?t.position:HD.position;this.attribContainerEl=document.createElement("details"),this.attribContainerEl.classList.add("mappedin-ctrl-attrib","mappedin-ctrl-attrib-".concat(r)),this.attribContainerEl.open=!0,this.attribContainerEl.tabIndex=0,this.attribContainerEl.ariaLabel="Attribution",this.controlPositions[r].appendChild(this.attribContainerEl),this.attribButtonEl=document.createElement("summary"),this.attribButtonEl.addEventListener("click",this.toggleAttribution),this.attribButtonEl.classList.add("mappedin-ctrl-attrib-button"),this.attribButtonEl.title="Toggle attribution",this.attribButtonEl.ariaLabel="Toggle attribution",this.attribButtonEl.tabIndex=0,this.attribButtonEl.innerHTML=JLe(),this.attribContainerEl.appendChild(this.attribButtonEl),this.attribInnerEl=document.createElement("div"),this.attribInnerEl.classList.add("mappedin-ctrl-attrib-inner"),this.attribInnerEl.innerHTML=this.attribHTML,this.attribContainerEl.appendChild(this.attribInnerEl),((i=t.feedback)!=null?i:HD.feedback)&&(this.feedbackLinkEl=document.createElement("a"),this.feedbackLinkEl.href=ZLe,this.feedbackLinkEl.target="_blank",this.feedbackLinkEl.rel="noopener",this.feedbackLinkEl.textContent="Provide Feedback",this.feedbackLinkEl.classList.add("mappedin-ctrl-attrib-inner"),this.feedbackLinkEl.classList.add("mappedin-ctrl-attrib-inner-bold"),this.attribContainerEl.appendChild(this.feedbackLinkEl)),t.custom&&(this.customAttributions=t.custom),this.updateAttributionDisplay()}updateAttribution(t){if(!t.style||!this.attribInnerEl||!this.attribContainerEl)return;let r=[Kie],n=t.style.sourceCaches;for(let i in n){let s=n[i];if(s.used||s.usedForTerrain){let l=s.getSource();l.attribution&&r.indexOf(l.attribution)<0&&r.push(l.attribution)}}r=r.filter(i=>String(i).trim()),r=r.filter((i,s)=>{for(let l=s+1;l<r.length;l++)if(r[l].indexOf(i)>=0)return!1;return!0}),this.attribHTML=r.join(" "),this.updateAttributionDisplay()}updateAttributionDisplay(){let t=[...new Set([this.attribHTML,...this.customAttributions])].filter(Boolean).join(" ");this.attribInnerEl&&(this.attribInnerEl.innerHTML=t)}resizeAttribution(t){this.attribContainerEl&&(t<=KLe||this.compact?this.compact===!1?this.attribContainerEl.setAttribute("open",""):!this.attribContainerEl.classList.contains("mappedin-compact")&&!this.attribContainerEl.classList.contains("mappedin-attrib-empty")&&(this.attribContainerEl.setAttribute("open",""),this.attribContainerEl.classList.add("mappedin-compact","mappedin-compact-show")):(this.attribContainerEl.setAttribute("open",""),this.attribContainerEl.classList.contains("mappedin-compact")&&this.attribContainerEl.classList.remove("mappedin-compact","mappedin-compact-show")))}destroyAttributionControl(){this.attribButtonEl&&this.attribButtonEl.removeEventListener("click",this.toggleAttribution),this.attribContainerEl&&(this.attribContainerEl.remove(),this.attribContainerEl=void 0,this.attribInnerEl=void 0,this.attribButtonEl=void 0)}resize(t){this.resizeAttribution(t)}updateData(t){this.updateAttribution(t)}destroy(){this.destroyAttributionControl(),this.controlContainerEl.remove(),this.compact=void 0}};o(XD,"HTMLControlsSystem");var _T=XD;g();var O2,L2,YD=class YD{constructor(t,r){x(this,"mesh");x(this,"type","custom-geometry");x(this,"dirty",!0);x(this,"feature");x(this,"builder");x(this,"outline");G(this,O2,1);x(this,"color",new An);G(this,L2,0);this.mesh=new Eu,this.feature=t,this.builder=r}get visible(){return this.mesh.visible}set visible(t){this.mesh.visible=t}set opacity(t){q(this,O2,t)}get opacity(){return d(this,O2)}setColor(t){this.color.set(t)}get position(){var t;return(t=this.mesh)==null?void 0:t.position}get altitude(){return d(this,L2)}set altitude(t){this.mesh&&(this.mesh.position.z=t,q(this,L2,t))}get renderOrder(){return this.mesh?this.mesh.renderOrder:0}set renderOrder(t){this.mesh&&(this.mesh.renderOrder=t)}};O2=new WeakMap,L2=new WeakMap,o(YD,"CustomGeometryComponent");var wv=YD;g();var ZD=class ZD{constructor(t,r){x(this,"state");x(this,"convertTo3DMapPosition");this.state=t,this.convertTo3DMapPosition=r}update(){let t,r;for(let n of this.state.geometry3DIdsInScene){let i=this.state.geometry3DMap.get(n);(i==null?void 0:i.type)==="custom-geometry"&&(t=i.components[0],r=i.components[1],t.dirty&&r.visible!==!1&&(t.position.copy(this.convertTo3DMapPosition(t.feature.geometry.coordinates[1],t.feature.geometry.coordinates[0],r.altitude)),t.builder.setup(t.mesh),t.mesh.traverse(s=>{s.userData={entityId:n,type:"custom-geometry"}}),t.dirty=!1),r.visible!==!1&&t.builder.update(t.mesh))}}};o(ZD,"CustomGeometrySystem");var ST=ZD;g();g();function Jie(e){return e.children.some(t=>t.userData.isOutline)}o(Jie,"hasOutline");var tAe=80,py,Pv,wT,PT,KD=class KD{constructor(t){x(this,"rendererState");x(this,"outlineOpacitiesDirty",!0);G(this,py,!0);G(this,Pv,-1/0);G(this,wT,new Map);G(this,PT,new _E({vertexColors:!0,linewidth:1,transparent:!0,opacity:1,side:iS}));this.rendererState=t}get geometries3DDirty(){return d(this,py)}set geometries3DDirty(t){q(this,py,t)}update(t,r=!0){let n;if(this.geometries3DDirty){for(let s of this.rendererState.geometry3DMap.values())if(s instanceof Ar&&(s.visible||s.userData.preloadGeometry)){for(let l of s.children)if(l instanceof Fs&&l.components[0].outline&&(l.visible||s.userData.preloadGeometry)&&!Jie(l)&&l.userData.entities3D.size>0)for(let c of l.userData.entities3D.values()){let p=this.rendererState.geometry3DMap.get(c),h=[];if(p instanceof mn&&p.type==="geometry"&&p.components[3]&&p.components[3].dirty===!0&&p.components[0].geometry!=null&&p.components[0].material!=null){let T=p.components[0].geometry;if(!T)continue;h.push([p.components[3],new SE(T,tAe)])}if(h.length===0)continue;let y=Ll(h.map(T=>T[1]),!1);if(y==null)continue;let b=y.getAttribute("position"),_=new Float32Array(b.count*4),C=new Kp(_,4);y.setAttribute("color",C);let P=0;for(let T=0;T<h.length;T++){let[O,D]=h[T],A=D.getAttribute("position").count;O.edgeColors=C,O.geometry=y,O.ranges={count:A,start:P},P+=A,D.dispose()}let E=new e0(y,d(this,PT));E.userData.isOutline=!0,l.add(E)}}q(this,py,!1),this.outlineOpacitiesDirty=!0}for(let s of this.rendererState.geometry3DIdsInScene){let l=this.rendererState.geometry3DMap.get(s);if(l instanceof mn&&l.type==="geometry"&&l.components[3]&&l.components[3].dirty===!0&&l.components[0].geometry!=null&&l.components[0].material!=null&&l.parentObject3D instanceof Fs){let c=l.components[3].geometry;if(!c)continue;let p=l.components[3];if(!p)continue;let h=p.edgeColors;if(!h)continue;let y=new An(p.color);for(let E=0;E<p.ranges.count;E++){let T=p.ranges.start+E;h.setXYZ(T,y.r,y.g,y.b)}let b=l.components[1].height,C=c.getAttribute("position").array,P=-1/0;for(let E=0;E<p.ranges.count;E++){let O=(p.ranges.start+E)*3,D=C[O+2];P=Math.max(P,D)}for(let E=0;E<p.ranges.count;E++){let O=(p.ranges.start+E)*3,D=C[O+2];Math.abs(D-P)<1e-4&&(C[O+2]=Math.max(b,2e-4))}c.attributes.color.needsUpdate=!0,c.attributes.position.needsUpdate=!0,p.dirty=!1}}let i=r?Ol(t,16,19,0,1):d(this,Pv);if((i!==d(this,Pv)||this.outlineOpacitiesDirty)&&this.rendererState.geometry3DIdsInScene.size>0){for(let s of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(s),(n==null?void 0:n.type)==="geometry"&&n.components[0]instanceof Mi){let l=n.components[3];if(l&&l.edgeColors&&l.geometry){let c=l.visible,p=Math.min(i,c?n.components[1].opacity*am(n):0);if(l.currentOpacity!==p){for(let h=0;h<l.ranges.count;h++){let y=l.ranges.start+h;l.edgeColors.setW(y,p)}l.geometry.attributes.color.needsUpdate=!0}}}}q(this,Pv,i),q(this,py,!1),this.outlineOpacitiesDirty=!1}destroy(){d(this,wT).clear()}};py=new WeakMap,Pv=new WeakMap,wT=new WeakMap,PT=new WeakMap,o(KD,"OutlineInterpolationSystem");var CT=KD;g();g();var JD=class JD extends jt{constructor(){super(...arguments);x(this,"userData",{entityId:""})}};o(JD,"EntityMesh");var TT=JD,rAe=le.object({flipImageToFaceCamera:le.boolean().optional(),url:le.string()}),nAe=le.object({type:le.enum(["Feature"]),properties:le.object({width:le.number(),height:le.number(),rotation:le.number().min(0).max(360).optional(),verticalOffset:le.number().optional()}),geometry:xv});function Qie(e,t,r){le.union([le.number(),le.string()]).parse(e),nAe.parse(t),rAe.parse(r)}o(Qie,"validateImage");var QD=class QD{constructor(t){x(this,"mesh",new Eu);x(this,"imageMesh");x(this,"outline");x(this,"type","image");x(this,"instanceIndex",-1);x(this,"geometry");x(this,"material");x(this,"feature");x(this,"position",new ht);this.feature=t}get visible(){var t,r;return(r=(t=this.mesh)==null?void 0:t.visible)!=null?r:!1}set visible(t){this.mesh&&(this.mesh.visible=t)}};o(QD,"ImageComponent");var ET=QD;g();function e8(e,t){return{x:e.x*Math.cos(t)-e.y*Math.sin(t),y:e.x*Math.sin(t)+e.y*Math.cos(t)}}o(e8,"rotatePoint");function iAe(e,t){return e.map(r=>e8(r,t))}o(iAe,"rotatePoints");function oAe(e){let t=1/0,r=1/0,n=-1/0,i=-1/0;for(let s of e)t=Math.min(t,s.x),r=Math.min(r,s.y),n=Math.max(n,s.x),i=Math.max(i,s.y);return{minX:t,minY:r,maxX:n,maxY:i}}o(oAe,"getBounds");function sAe(e,t){let r=!1;for(let n=0,i=t.length-1;n<t.length;i=n++){let s=t[n].x,l=t[n].y,c=t[i].x,p=t[i].y;l>e.y!=p>e.y&&e.x<(c-s)*(e.y-l)/(p-l)+s&&(r=!r)}return r}o(sAe,"pointInPolygon");function eoe(e,t,r,n,i){for(let s=0;s<i;s++)for(let l=0;l<n;l++)if(e[r+s][t+l]!==1)return!1;return!0}o(eoe,"isValidRectangle");function aAe(e,t,r){let n=e.maxX-e.minX,i=e.maxY-e.minY,s,l,c=k({},e);return n/i>t?(l=i/r,s=l*t,c.minX+=(n-s*r)/2):(s=n/r,l=s/t,c.minY+=(i-l*r)/2),{dx:s,dy:l,gridBounds:c}}o(aAe,"calculateGridDimensions");function lAe(e,t,r,n,i){let s=Array(r).fill(0).map(()=>Array(r).fill(0));for(let l=0;l<r;l++)for(let c=0;c<r;c++){let p={x:t.minX+c*n,y:t.minY+l*i};sAe(p,e)&&(s[l][c]=1)}return s}o(lAe,"createAndFillGrid");function uAe(e,t){let r=Array(t).fill(0).map(()=>Array(t).fill(0));for(let n=0;n<t;n++)for(let i=0;i<t;i++)if(e[n][i]===1){let s=0;for(let l=1;l<=Math.min(t-i,t-n)&&eoe(e,i,n,l,l);l++)s=l;r[n][i]=s}return r}o(uAe,"calculateRectSizes");function cAe(e,t,r,n,i,s){let l=0,c=0,p=0;for(let h=0;h<n;h++)for(let y=0;y<n;y++)if(e[h][y]===1){let b=Math.pow(t[h][y],2),_=r.minX+y*i,C=r.minY+h*s;l+=b,c+=_*b,p+=C*b}return{x:c/l,y:p/l}}o(cAe,"calculatePolygonCenter");function pAe(e,t,r,n,i,s,l){let c=-1/0,p=null,h=e.length,y=Math.sqrt(Math.pow(t.maxX-t.minX,2)+Math.pow(t.maxY-t.minY,2));for(let b=0;b<h;b++)for(let _=0;_<h;_++)if(e[b][_]===1)for(let C=1;C<=h-_;C++){let P=C;if(!(P>h-b)&&eoe(e,_,b,C,P)){let E=C*P,T=t.minX+(_+C/2)*r,O=t.minY+(b+P/2)*n,D={x:T,y:O},R=Math.sqrt(Math.pow(D.x-i.x,2)+Math.pow(D.y-i.y,2))/y,j=E*(1-s)-R*s*E;j>c&&(c=j,p={center:D,width:C*r*l,height:C*n*l})}}return p}o(pAe,"findBestRectangle");function t8(e,t,r,n={}){let{scaleFactor:i=.9,centerPriority:s=.5,resolution:l=100,minimumSizeRatio:c=.5}=n,p=$N(r),h=e.width/e.height,y=iAe(t,p),b=oAe(y),{dx:_,dy:C,gridBounds:P}=aAe(b,h,l),E=lAe(y,P,l,_,C),T=uAe(E,l),O=cAe(E,T,P,l,_,C),D=pAe(E,P,_,C,O,s,i);return!D||D.width<e.width*c||D.height<e.height*c?e:re(k({},D),{center:e8(D.center,-p),rotation:r,polygonCenter:e8(O,-p)})}o(t8,"findLargestInteriorRectangle");var A2=Math.PI*2,fAe=Math.PI/2,dAe=Math.PI*1.5,hAe=r0(fAe,2),mAe=r0(dAe,2),gAe=.01,toe=!1,r8=class r8 extends Lt{constructor(r,n,i=0,s=0,l={}){super();x(this,"rendererState");x(this,"convertTo3DMapPosition");x(this,"initialBearing",0);x(this,"naturalBearing",0);x(this,"imagePlacementOptions");x(this,"imageLoadingCache",new Map);this.rendererState=r,this.convertTo3DMapPosition=n,this.initialBearing=i,this.naturalBearing=s,this.imagePlacementOptions=l}createImageMesh(r,n,i,s=0,l,c){var P,E,T;let p={width:i.width,height:i.height,center:this.convertTo3DMapPosition(l),rotation:(P=i.rotation)!=null?P:0},h=(E=this.imagePlacementOptions.mode)!=null?E:"default",y=(()=>{switch(h){case"fit-nearest-90":let O=(this.initialBearing-this.naturalBearing+360)%180;return O>=45&&O<=135?t8(p,c,p.rotation+90,this.imagePlacementOptions):p;case"fit-initial-bearing":return t8(p,c,this.initialBearing,this.imagePlacementOptions);case"default":case"none":default:return p}})();if(toe&&y.polygonCenter){let O=new jt(new cS(1),new Pu({color:65280}));O.position.set(y.polygonCenter.x,y.polygonCenter.y,s),this.rendererState.entityScene.add(O)}let b=new Pu({transparent:!0,depthWrite:!1,side:Wp}),_=new wu(y.width,y.height),C=new TT(_);if(C.visible=!1,(T=this.getOrDownloadImage(n))==null||T.then(O=>{b.map=O,b.needsUpdate=!0,b.map.colorSpace=Xp,C.visible=!0,this.publish("image-loaded")}),C.userData.entityId=r,C.material=b,toe){let O=new jt(new wu(i.width,i.height),new Pu({color:"gray"}));C.add(O);let D=new RN;C.add(D),D.scale.set(10,10,10)}return C.position.set(y.center.x,y.center.y,s+gAe),C.rotation.z=(-Yt.degToRad(y.rotation)+A2)%A2,C}getOrDownloadImage(r){var n;if(this.imageLoadingCache.has(r))return(n=this.imageLoadingCache.get(r))==null?void 0:n.promise;{let i=new Promise(s=>{Sh.getLoader().load(r,l=>{let c=this.imageLoadingCache.get(r);c&&!c.loaded&&(c.loaded=!0),s(l)})});return this.imageLoadingCache.set(r,{loaded:!1,promise:i}),i}}flipIfNeeded(r,n){if(r.imageMesh==null)return;let i=-n,s=r.imageMesh.rotation.z,l=r0((s-i+A2)%A2,2);l>hAe&&l<mAe&&(r.imageMesh.rotation.z=(s+Math.PI)%A2)}update(r){var l,c,p,h,y;let n,i,s;for(let b of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(b),(n==null?void 0:n.type)==="image"){if(i=n.components[0],s=n.components[1],s.url&&i.imageMesh==null){let _=this.convertTo3DMapPosition(i.feature.geometry.coordinates),C={x:_.x,y:_.y};i.imageMesh=this.createImageMesh(n.id,s.url,i.feature.properties,i.feature.properties.verticalOffset,i.feature.geometry.coordinates,[C]),i.mesh.add(i.imageMesh),i.position.copy(i.imageMesh.position)}i.imageMesh&&s.flipImageToFaceCamera&&this.flipIfNeeded(i,r)}else if((n==null?void 0:n.type)==="geometry"){if(i=n.components[0],s=n.components[1],s.showImage&&((l=i.feature.properties)!=null&&l.image)&&i.imageMesh==null&&i.visible&&i.mesh!=null&&i.mesh.parent!=null&&((c=i.feature.properties)==null?void 0:c.image.position)!=null&&i.feature.geometry.coordinates!=null&&i.feature.geometry.coordinates.length>0){let _=i.feature.geometry.coordinates[0].map(P=>{let E=this.convertTo3DMapPosition(P);return{x:E.x,y:E.y}}),C=this.createImageMesh(b,(p=i.feature.properties)==null?void 0:p.image.path,(h=i.feature.properties)==null?void 0:h.image,s.height,(y=i.feature.properties)==null?void 0:y.image.position,_);i.mesh.parent.add(C),i.imageMesh=C}if(i.imageMesh){if(!i.visible)i.imageMesh.visible=!1;else if(s.showImage&&!i.imageMesh.visible)if(s.url){let _=this.imageLoadingCache.get(s.url);_&&_.loaded&&(i.imageMesh.visible=!0)}else i.imageMesh.visible=!0;else!s.showImage&&i.imageMesh.visible&&(i.imageMesh.visible=!1);s.flipImageToFaceCamera&&this.flipIfNeeded(i,r)}}}};o(r8,"ImageSystem");var MT=r8;g();var yAe=250,Ph,n8=class n8 extends Lt{constructor(r,n){super();x(this,"cameraDirty",!0);x(this,"focusablesDirty",!0);x(this,"state");x(this,"camera");x(this,"debugEl",null);x(this,"raycasters",[]);x(this,"collisions",new Map);x(this,"focusableEntities",new Set);x(this,"debugRaycasters",!1);G(this,Ph);x(this,"update",o((r=!1,n=Date.now())=>{r||Date.now()-n>yAe||(d(this,Ph)&&cancelAnimationFrame(d(this,Ph)),q(this,Ph,requestAnimationFrame(()=>{this.updateRaf()})))},"update"));this.state=r,this.camera=n,this.buildRaycasters()}resize(){this.buildRaycasters()}buildRaycasters(){this.debugEl&&this.debugEl.remove();let r=new wt(this.state.canvasWidth/2,this.state.canvasHeight/2),n=new wt(r.x/1.2,r.y/1.2),i=new wt(r.x+(r.x-n.x),n.y),s=new wt(n.x,r.y+(r.y-n.y)),l=new wt(i.x,s.y),c=new wt(r.x,r.y/1.5),p=new wt(r.x,r.y+(r.y-c.y));this.debugEl=document.createElement("div"),Object.assign(this.debugEl.style,{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none"}),document.body.append(this.debugEl),this.raycasters=[r,c,p,n,i,s,l].map((h,y)=>{if(this.debugRaycasters){let E=document.createElement("div");E.style.position="absolute",E.style.top=h.y+"px",E.style.left=h.x+"px",E.style.width="10px",E.style.height="10px",E.style.backgroundColor="red",this.debugEl.append(E)}let b=h.x/this.state.canvasWidth*2-1,_=-(h.y/this.state.canvasHeight)*2+1,C=new wt(b,_),P=new Ec;return P.setFromCamera(C,this.camera),[P,C,y===0?10:y<7?2:1]})}updateFocusableEntities(){this.focusableEntities.clear();let r,n;for(let i of this.state.geometry3DIdsInScene)if(n=this.state.geometry3DMap.get(i),n!=null){if(n.type==="group-container"&&n.components[2]!==void 0&&n.components[2]instanceof yv){let s=n.components[2];if(s.dirty===!0||s.focusMesh==null){s.focusMesh&&Pi(s.focusMesh);let l=new co;l.setFromObject(n);let c=new Cu(l.max.x-l.min.x,l.max.y-l.min.y,l.max.z-l.min.z),p=new _o({transparent:!0,opacity:this.debugRaycasters?1:0,visible:this.debugRaycasters}),h=new jt(c,p);h.position.set((l.min.x+l.max.x)/2,(l.min.y+l.max.y)/2,(l.min.z+l.max.z)/2),h.userData={entityId:n.userData.entityId},s.focusMesh=h,n.add(h),n.components[2].dirty=!1}this.focusableEntities.add(s.focusMesh)}else if(n.components[0]&&n.components[0]instanceof Mi&&n.components[0].focusable&&n.components[0].geometry!=null&&(r=n.components[0],r instanceof Mi&&r.focusable&&r.geometry!=null)){if(r.focusMesh==null){let s=new jt(r.geometry);s.userData={entityId:n.id},r.focusMesh=s}this.focusableEntities.add(r.focusMesh)}}this.focusablesDirty=!1}updateRaf(){if(this.cameraDirty){if(this.focusablesDirty&&this.updateFocusableEntities(),this.focusableEntities.size===0){this.publish("geometry-in-focus",[]);return}this.raycast()}}raycast(){this.collisions.clear();for(let[n,i]of this.raycasters)n.setFromCamera(i,this.camera);for(let[n,i,s]of this.raycasters)n.intersectObjects(Array.from(this.focusableEntities.values())).forEach(c=>{var p;if((c==null?void 0:c.object)!=null&&"isMesh"in c.object&&(c!=null&&c.object.isMesh)){let h=c.object.userData.entityId,y=(p=this.collisions.get(h))!=null?p:0;this.collisions.set(h,y+s)}});let r=Array.from(this.collisions,([n,i])=>({entityId:n,weight:i})).sort((n,i)=>i.weight-n.weight).map(({entityId:n})=>n);this.publish("geometry-in-focus",r),this.cameraDirty=!1}showRaycasters(){this.debugRaycasters=!0,this.buildRaycasters()}hideRaycasters(){this.debugRaycasters=!1,this.buildRaycasters()}destroy(){d(this,Ph)&&cancelAnimationFrame(d(this,Ph)),this.debugEl&&this.debugEl.remove(),this.collisions.clear(),this.focusableEntities.clear(),this.raycasters=[]}};Ph=new WeakMap,o(n8,"GeometryInFocusSystem");var OT=n8;g();var roe=20,vAe=5e3,lu,D2,F2,Th,fy,dy,AT,N2,i8=class i8{constructor(t){x(this,"dirty",!0);x(this,"map");x(this,"stylesheetId","");x(this,"userHiddenLayers",new Set);x(this,"hiddenLayersInStyle",new Set);x(this,"centerPoint");x(this,"bbox");x(this,"polygons");G(this,lu,null);G(this,D2,o(()=>{d(this,lu)&&(clearTimeout(d(this,lu)),q(this,lu,null),this.dirty=!1)},"#stopTrying"));G(this,F2,o(()=>{d(this,lu)&&(clearTimeout(d(this,lu)),q(this,lu,null)),q(this,lu,setTimeout(()=>{d(this,D2).call(this)},vAe))},"#startTrying"));x(this,"handleRender",o(async()=>{if(!(!this.map||!this.dirty)&&!(!this.hiddenLayersInStyle||this.hiddenLayersInStyle.size===0)){if(d(this,Th)&&(d(this,AT).call(this),q(this,Th,!1)),this.centerPoint){let t=this.map.project(this.centerPoint),r=this.map.queryRenderedFeatures(t,{layers:Array.from(this.hiddenLayersInStyle)});if(r.length>0){for(let n of r)this.expr.push(["!=",["id"],n.id]);this.expr.length>0&&this.hiddenLayersInStyle.forEach(n=>{this.map.setFilter(n,["all",...this.expr])}),this.expr=[],q(this,Th,!1),this.dirty=!1}}else if(this.bbox&&this.polygons){let t=this.map.queryRenderedFeatures([this.map.project([this.bbox[0],this.bbox[1]]),this.map.project([this.bbox[2],this.bbox[3]])],{layers:Array.from(this.hiddenLayersInStyle)});if(t.length>0){q(this,Th,!0);for(let r=0;r<t.length;r+=roe){let n=t.slice(r,r+roe);d(this,fy).push(()=>{for(let i of n)if(i.geometry!=null&&"coordinates"in i.geometry){if(this.polygons==null)return;let s;if(i.geometry.type==="Polygon"?s=Gn(i.geometry.coordinates):i.geometry.type==="MultiPolygon"&&(s=Tu(i.geometry.coordinates)),!s)continue;for(let l of this.polygons)if(Jb(l,s)){this.expr.push(["!=",["id"],i.id]);continue}}})}d(this,N2).call(this)}}}},"handleRender"));x(this,"expr",[]);G(this,Th,!1);G(this,fy,[]);G(this,dy,null);G(this,AT,o(()=>{d(this,dy)&&(globalThis.cancelAnimationFrame(d(this,dy)),q(this,dy,null)),q(this,fy,[])},"#cancelJobs"));G(this,N2,o(()=>{let t=d(this,fy).pop();typeof t=="function"&&(t(),d(this,fy).length>0&&q(this,dy,globalThis.requestAnimationFrame(d(this,N2)))),this.expr.length>0&&(this.hiddenLayersInStyle.forEach(r=>{this.map.setFilter(r,["all",...this.expr])}),this.dirty=!1),this.expr=[],q(this,Th,!1),d(this,D2).call(this)},"#runJobs"));x(this,"handleStyleChange",o(t=>{var r,n;if(this.map&&t&&t.dataType==="style"&&t.type==="styledata"&&this.userHiddenLayers.size>0){let i=(n=(r=t==null?void 0:t.style)==null?void 0:r.stylesheet)==null?void 0:n.id;(!i||i!==this.stylesheetId)&&(this.stylesheetId=i,this.filterStylesInMap(),this.dirty=!0)}},"handleStyleChange"));t&&(this.map=t,this.map.on("styledata",this.handleStyleChange),this.map.on("render",this.handleRender))}hideLayersUnderPoint(t,r){d(this,F2).call(this),this.centerPoint=t;for(let n of r)this.userHiddenLayers.add(n);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}hideLayersIntersectingPolygons(t,r,n){d(this,lu)&&clearTimeout(d(this,lu)),d(this,F2).call(this),this.bbox=t,this.polygons=r.reduce((i,s)=>{if(s.geometry.type==="Polygon"){let l=Gn(s.geometry.coordinates);i.push(l)}else s.geometry.type==="MultiPolygon"&&i.push(...s.geometry.coordinates.map(l=>Gn(l)));return i},[]);for(let i of n)this.userHiddenLayers.add(i);this.dirty=!0,this.filterStylesInMap(),this.handleRender()}filterStylesInMap(){if(this.hiddenLayersInStyle=new Set,this.map)for(let t of this.userHiddenLayers)this.map.getLayer(t)&&this.hiddenLayersInStyle.add(t)}destroy(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("render",this.handleRender))}};lu=new WeakMap,D2=new WeakMap,F2=new WeakMap,Th=new WeakMap,fy=new WeakMap,dy=new WeakMap,AT=new WeakMap,N2=new WeakMap,o(i8,"OutdoorLayers");var LT=i8;g();g();g();g();var DT="attribute float pathDistance;\nattribute vec3 pathNormal;\nattribute vec3 pathTangent;\n\nuniform vec2 uvScale;\nuniform float vertexes;\nuniform float complete;\nuniform float nearRadius;\nuniform float farRadius;\nuniform float nearZoom;\nuniform float farZoom;\nuniform float pulse;\nuniform float pulseLength;\nuniform bool pathIsVertical;\nuniform bool displayArrowsOnPath;\nuniform vec2 cameraParameters;\nuniform float flattenFactor;\n\nvarying float zoomLevel;\nvarying float radius;\nvarying vec2 fragTexcoord;\nvarying float fragTopTextureU;\nvarying float fragPathDistance;\n\n// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using\n// linear interpolation/extrapolation.\n//\n// This performs a pure linear mapping y = mx + b where\n// 'm = (yMax - yMin) / (xMax - xMin)',\n// 'b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin'.\nfloat remap(float x, float xMin, float xMax, float yMin, float yMax) {\n return (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;\n}\n\n// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear\n// interpolation, clamping result values outside [yMin, yMax].\nfloat clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {\n return clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);\n}\n\nvoid main() {\n fragPathDistance = pathDistance;\n\n // We can get an origin point for the cross-section of the path by\n // subtracting the surface normal times the radius, since the surface normal\n // points strictly away from the centre.\n vec3 origin = position - nearRadius * normal;\n\n // Inflate the path along its surface normal to increase its radius from\n // 'nearRadius' to 'farRadius' when the camera is at 'farZoom'.\n vec3 adjustedPosition = position;\n zoomLevel = clampRemap(cameraParameters.x, nearZoom, farZoom, 0.0, 1.0);\n adjustedPosition += normal * (farRadius - nearRadius) * zoomLevel;\n\n // Determine how far the path extends \"up\" or \"down\" in the direction of the\n // path normal.\n float height = dot(adjustedPosition - origin, pathNormal);\n\n // Flatten the bottom half of the path entirely so that it's flat\n // against the floor. This makes the path look nicer when it's\n // semitransparent behind opaque geometry, so you don't see it\n // peeking through.\n float desiredHeight = max(height, 0.0);\n\n desiredHeight = desiredHeight * flattenFactor;\n\n float flattenMagnitude = height - desiredHeight;\n adjustedPosition = adjustedPosition - pathNormal * flattenMagnitude;\n\n // Transform the vertices into NDC.\n vec4 mvPosition = modelViewMatrix * vec4(adjustedPosition, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n\n fragTexcoord = uv;\n\n // Compute a texture coordinate for mapping the arrow texture to the path.\n // We don't want to use the u-value that Three.js provides, because the\n // path may end up twisting arbitrarily -- but we want the arrow texture to\n // always be on the top of the path.\n vec3 bitangent = cross(normal, pathTangent);\n fragTopTextureU = -dot(bitangent, pathNormal) * 0.5 + 0.5;\n\n radius = mix(nearRadius, farRadius, zoomLevel);\n}\n";g();var o8="#define ARROW_FADING_POINT 0.15\n\nuniform float complete;\nuniform float nearRadius;\nuniform float farRadius;\nuniform vec2 resolution;\nuniform vec2 cameraParameters;\nuniform vec3 color;\nuniform float pathLength;\nuniform bool showPulse;\nuniform vec3 pulseColor;\nuniform float pulse;\nuniform float pulseLength;\nuniform bool pathIsVertical;\nuniform bool displayArrowsOnPath;\nuniform float arrowAnimationTimer;\nuniform float opacityMultiplier;\nuniform bool dashed;\nuniform sampler2D arrowTexture;\n\nvarying float zoomLevel;\nvarying float radius;\nvarying vec2 fragTexcoord;\nvarying float fragTopTextureU;\nvarying float fragPathDistance;\n\n// How long the arrow should be, as a factor of pathRadius. Since we've\n// mostly flattened the top of the path, values near 2.0 (the diameter)\n// will probably look best.\nconst float arrowLength = 2.0;\n\n// How much of a relative margin the arrow texture should have inside the\n// area laid out for it. Useful to pull the arrow away from the edges of the\n// path, which slope down.\nconst float arrowMargin = 0.1;\n\n// How many arrow-lengths of space should be between arrows on a short path.\nconst float arrowSpacingOnShortPath = 6.0;\n\n// How many arrow-lengths of space should be between arrows on a long path.\nconst float arrowSpacingOnLongPath = 7.5;\n\n// How long a path must be to be considered \"long\", as a factor of\n// the path radius.\nconst float longPathLength = 200.;\n\n// How long a path must be to be considered \"short\", as a factor of the\n// path radius.\nconst float shortPathLength = 75.;\n\n// How much of the path's length the fade-in should comprise when going from\n// zero opacity to full opacity.\nconst float completeLength = 0.1;\n\n// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using\n// linear interpolation/extrapolation.\n//\n// This performs a pure linear mapping 'y = mx + b' where\n// 'm = (yMax - yMin) / (xMax - xMin)',\n// 'b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin'.\nfloat remap(float x, float xMin, float xMax, float yMin, float yMax) {\n return (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;\n}\n\n// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear\n// interpolation, clamping result values outside [yMin, yMax].\nfloat clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {\n return clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);\n}\n\nvoid main(void) {\n // Compute the opacity of the path based on the distance from the current\n // fragment to the 'complete' value as it varies from 0.0 to 1.0.\n // Fragments that are at the 'complete' value or past it will be fully\n // transparent, while fragments that are at 'complete - completeLength'\n // or before it will be fully opaque. However, we adjust the 'complete'\n // value here so that it overshoots by one full 'completeLength', so that\n // the entire path will be opaque when the 'complete' value is at 1.0.\n float completeLocation = complete * (1.0 + completeLength);\n float completeAmount = clampRemap(\n fragPathDistance,\n completeLocation - completeLength,\n completeLocation,\n 0.0,\n 1.0\n );\n float opacity = 1.0 - smoothstep(0.0, 1.0, completeAmount);\n\n // 2020/01/09 Terence Dickson\n // When we render the background and overlay for the mapbox outdoor context\n // behind everything else in single-buffer rendering, the fact that the path\n // writes to the depth buffer means that the background and overlay will not\n // be drawn behind the path even when the path is still fading in. The effect\n // is subtle and is only visible in single-buffer rendering so this quick fix\n // prevents writes to the depth buffer for zero opacity fragments, which gets\n // rid of the most visually-offensive ghosting.\n if (opacity <= 0.0) {\n discard;\n }\n\n // Push in the texture coordinates so that they ramp up\n // at 'arrowMargin' instead of at zero; this remapping looks somewhat\n // like this:\n // 1 ^ ___\n // | /\n // | /\n // | /\n // | /\n // |___/\n // 0 +---------->\n // 0 ^ 1\n // arrowMargin\n // Making the arrows narrower on the path.\n float u = fragTopTextureU;\n u = clamp(\n u * (1. / (1. - arrowMargin * 2.)) - (1. / (1. - arrowMargin * 2.) - 1.) / 2.,\n 0.0,\n 1.0\n );\n\n float arrowSpacing = clampRemap(\n pathLength,\n shortPathLength * radius,\n longPathLength * radius,\n arrowSpacingOnShortPath,\n arrowSpacingOnLongPath\n );\n\n // Reduce the spacing between arrows when the camera zooms out, as increasing\n // the path radius will increase the arrow size and thus be able to fit\n // fewer arrows on in total, and this secondary movement of the arrows\n // \"zooming off\" the end of the path is unpleasant\n float expandAmount = mix(1.0, farRadius / nearRadius, zoomLevel);\n float effectiveArrowSpacing =\n arrowSpacing * 1.0 / expandAmount +\n arrowMargin * 2.0;\n\n float effectiveArrowLength = arrowLength * radius * (1. - arrowMargin * 2.0);\n\n // Adjust the slope of the vertical texture coordinate so that it goes\n // from 0 to 1 along the length of the arrow plus the spacing between\n // arrows, and adjust its x-intercept so that one arrow moves to the\n // exact position of the next arrow as 'arrowAnimationTimer' goes\n // from 0 to 1\n float v = (\n fragTexcoord.x * (pathLength / effectiveArrowLength)\n - arrowAnimationTimer * (1. + effectiveArrowSpacing)\n );\n\n // Compute a \"looping sawtooth\" wave for determining the vertical texture\n // coordinates of the arrow texture, roughly as follows:\n // 3 ^ /\n // | ___/\n // 2 | /\n // | ___/\n // 1 | /\n // |___/\n // 0 +--------------->\n // 0 ^ ^\n // ^ |_|\n // | effectiveArrowLength\n // |___|\n // effectiveArrowSpacing\n //\n // This is effectively equivalent to this sort of sawtooth wave:\n // ^\n // 1 | / / /\n // |___/ ___/ ___/\n // 0 +--------------->\n //\n // Causing the image of the arrow to repeat, with dead space (the bottom\n // edge of the texture stretched out) between the arrows at the provided\n // spacing. The reason why the \"looping\" design is preferred is because\n // it takes advantage of WebGL's 'GL_REPEAT' texture wrapping behaviour\n // to avoid the discontinuity that can end up causing visual artifacts.\n if (mod(v, (1. + effectiveArrowSpacing)) < 1.) {\n v = v - effectiveArrowSpacing * floor(v / (1. + effectiveArrowSpacing));\n } else {\n v = ceil(v / (1. + effectiveArrowSpacing));\n }\n\n // Use the r-component of the texture to determine whether the arrow covers\n // this fragment or not\n vec2 sampleTexcoord = vec2(u, v);\n float arrowAmount = 0.0;\n vec3 secondColor = pulseColor;\n\n if (displayArrowsOnPath) {\n arrowAmount = texture2D(arrowTexture, sampleTexcoord).r;\n float delta = 1.0 - abs(fragPathDistance * 2.0 - 1.0);\n secondColor = mix(color, pulseColor, 1.0 - smoothstep(ARROW_FADING_POINT, 0.0, delta));\n }\n\n if (dashed) {\n float dashLength = 0.1; // Adjust this value to change the dash length\n float gapLength = 0.1; // Adjust this value to change the gap length\n float totalLength = dashLength + gapLength;\n float numSegments = ceil(1.0 / totalLength);\n float adjustedTotalLength = 1.0 / numSegments;\n float adjustedDashLength = adjustedTotalLength * (dashLength / (dashLength + gapLength));\n float pattern = mod(fragPathDistance, adjustedTotalLength);\n opacity = pattern < adjustedDashLength ? 1.0 : 0.0;\n }\n\n\n if (showPulse) {\n // Add the pulse color to the path by determining how far the current fragment\n // is from 'pulse'\n float pulseLocation = remap(\n pulse,\n 0.0,\n 1.0,\n -pulseLength,\n 1.0 + pulseLength\n );\n float pulseDistance = smoothstep(\n 0.0,\n pulseLength,\n abs(fragPathDistance - pulseLocation)\n );\n\n // Blend the pulse color to the path based on how close this fragment is to\n // the 'pulse' value and whether it's covered by an arrow -- but if it's\n // covered by *both*, then we go back to using the regular path color\n // (making arrows look like \"holes\" when they're overlapping the pulse.)\n float pulseLevel = abs(1.0 - pulseDistance - arrowAmount);\n\n gl_FragColor = vec4(mix(color, secondColor, pulseLevel), opacity * opacityMultiplier);\n } else if (displayArrowsOnPath) {\n gl_FragColor = vec4(mix(color, pulseColor, arrowAmount), opacity * opacityMultiplier);\n } else {\n gl_FragColor = vec4(color, opacity * opacityMultiplier);\n }\n #include <colorspace_fragment>\n}\n";g();var noe="void main(void) {\n gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);\n}";var ioe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAAAAAB5Gfe6AAAQkHpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjarZpZciQ7rkT/uYpeAicQ5HI4mr0dvOX3ATOl0li3q3SVJkUqFMEBcHc4IuX2///fcf/hK7cSXRatpZXi+cott9h5U/3j63EMPt+fL1/h+fPdeff6NnJMHNPjD2U/7+qcl183aH6eH+/PO52PN7E+B3qZ+Tlgspkjb57X1edAKT7Oh+fvrj3v6/nNdp7ftd057abHnz78npVgLGG8FF3cKSTPz2oXJFaQWuocCz9D0mhnEu8Tx54k6dexc98F77vY+f48n96HwvnyvKB8iNHzfJCvY3cj9HZF4dfM7/6QZ4j+7deb2J2z6jn7sbueC5Eq7rmpl63cd1w4GCrd2wov5Vt4r/fVeFW2OMnYIpuD13ShhUi0T8hhhR5O2Pc4w2SJOe5IuGOMM6Z7rhL+FudNSrZXOFFJz3KpkqtJ1hKn4+tawp233flmqMy8AlfGwGCBOz693Fcn/+b1OtA5Bt0QfH2NFeuKFnCWYZmzn1xFQsJ5xlRufO/LvcGNf5PYRAblhrmywe7HY4gh4Re20s1z4jrx2fkHNYKu5wCEiLmFxYREBnwJSUIJXmPUEIhjJT+dlceU4yADQSSu4A65SamQnBptbu7RcK+NEh+nkRYSIZBGSQ0EIlk5C/jRXMFQlyTZiUgRlSpNekklFymlaDGN6po0q2hR1apNe001V6mlaq211d5iS0iYtNLUtdpa651JO0N37u5c0fuII408ZJSho442+gQ+M0+ZZeqss82+4koL+q+y1K262uo7bKC085Zdtu662+4HrJ108pFTjp562umvWXtm9X3WwofM/T5r4Zk1y1i+1+mvrHFa9WWIYHIiljMyFnMg42oZANDRcuZryDla5ixnvkVIIZGsBbHkrGAZI4N5hygnvObuV+Z+mzcn+Y/yFr/LnLPU/RuZc5a6Z+Y+5+2LrK1+K0q6CTIWWkx9OggbF+zaY+1Wk/766H46wF8ONFY+O8hBMEc7oc4Vdh+8JsE+PUSrVjr70Zz1+H56PH3o9sRR1ql5Ha8bUMQxpe89Tki8Sb0tE23cw3DcfEo+ugnj2G3WEmononVfoag71pVjR+EmAE53eT5tqYfEHl/7ThMusaI+St0jktFa9gKnreiQqCNpZ2mJdSkbaiK6DrovYR4/JhJfRsx5d5EVZnEIPetHnU5KynJPTSuCPuC0lOuXH7n1DNq7DpUtHbhM5lDA0c2bnDCJoOObMnyj+aPjPwx0yiDUxKKsg35VnRnBEVhonKwK5hOk5NttUrhr2+tMOXkPJb1RZ+iAelYjL2MuO3pGRQ78GdxwOOaTAcJZcewq7ilB1RJCSozUdSEdwVJVb6asiBsHH1Bqgbiv3Cmkkis6ktVnZGRRwMNJjUA3Ao2127YWdhAIblxF51hzMcZsVZc0r0dJo5Liqfn41Q+q193SGhhkMkgaLJRNnEpqBtyVvbcVffIk+LE9QPFBTMTQe0aWkMXMnx3dy5sfHreDE60Ql50E+SqRcmfK16L2p0Ol8JFATu3qASXy7SvmiGW2cdMBxsty44CvtLogfGlv7WkCSV0WId2270EaD5Ym40cs+SAwZuNjPSTywAvEfLmzQhtLDntfCnhl/fNmUNnzyA2g76Zn0SP+c+I6bCC0FONUQ4L50e95dif+DH/m9htQjBEhPPpOjYjmm2ChbfEMIUaYtAIxmWJHlilLU8ZRs9pCsHbDpFaRgZljz2QandjDIBPZDGTuoZW1KdlYh52ALzisKJRNWSQmLAWx8iv9mGttT15bBc2oxd57bZtVF98CYtK3UH22Yd/A7WaKa+ZjNTOXEzNhMJ5kmQOvfzsbxbZALJ2xwGBjX2HFQybhi7kpbA7DVpS3RxMJwFyHwGk5gs6a4lrRHVqhYT0QTJC9UZcC9Yrelkn6yXch68NKNtG7CiU3vf/zMZAYXPWdrR9XZ/ctMV1sJQ2wJEGxzaHs7LmmHIwnUwbwnNAapBY9xhE19DNJW3ua0dDk/AjwITacR0PqZxkbyJ+E5jYbxI84x1TBE+y90hwDCYZIM0tqAKPZfCzFrbH8kYCm3eqQkZ2+2GovcL8Suokyg8yyCJes6dcouSLiNSLb0ETJU+/N/WFsBBSOXBbm9Cwp4CzlOag7ro7R2vC19nSsCPmAjIEMiobFwaoVXhjTU2XMpgEsDH/L3Sx54OCTMUSXI/IIA2V4QcLQpwVz12pInI0bY56pIQ2BSGRLL+yLfZ7JkiimbK+aepsbwRStpokx5gCqe1hjdMAwcINbkk5jmedrNRAG5pUXPe0sZIoXy1h7lSDxApzheg24JeDNtDS1oBDBUC4iWZFilBPhZx0Kqx2lihpbG9q4sYidksCN4yRYhNM4nxfBbTi4E3AT6B3igbvs9Gv8ZkHsIfdlep+2HelEDbkJdNjqZQ90B7k6OIoFfkkPNoY+z0gzACa1f2qcBYxVJpT2QQgS19dKQlbC24S92xiEAFRKB5Uy1qrBgOtwIge55G0kRPfIytGx0tMOrGfrijB2FHOk/TKcMjDTMPeBo4FnXD5cQ8vtdgoAN0yuzZQHQI09wm/5vAB6RHyI9rYKiZ6YWC6rbaiLmDtoaToC1bViXQFNtgWsOfEEKCleC3GWPSfgQWRQWMgw/9FDgvOZrFAT3SmsA3DLbqlsSppQG5QeOjPXavUUkxF/qgLM05vW5o7UakuBqo2ZW8Nj0LB7imVJC9QSA+wd7RPztIUZ80xQZq0ROrc8CSVncWzkTA/RwmunldCPAQKjqVC7bhRuTIv0plbk7gOX4m5OAi2YesYZ0KBQRToG8iv9x8dgGtgECYRBeEU87OxoSc8epu+s7Mq/MN0VbBT19dii7ekO66UZwdAMtoAVQd13J5nwZe98OgGslmVqAGBkeLZNVNVlWpV18qihntXKnBZvrDIVgFpx4q5poLqREOVplMPSpTF2KvjBAzDpprkruXIaaUmUD4Xo2yrGWcYlixKIwRFjl0jPQhKznUXZAoSjlg9c/NwAI4p3Q/w5bCNfhUZS7bGfqesHqKAlyZZxZgNrhGevZXccaqBys4NEqB3Vqfptji9uUrhCL6yXFqxtm0hhLyYU3Tjd8I/HZaWD1oyVjnG5hhpCN5yHSf8BQUZlVNd00OP4M0TK+JSM7iqWi01SinFkCQXWxiZJLqqAHiEt3G3I2WYd46KU9pIJIOkoRQYCcEAAPguHo0Y4k8Hl6SW50MoW0uZU8jJOUghKo38Nl5ZSwsJNAUC2/lFZWkfMjrU8dFrTjHpJnUrLCILQIxINiYdQlDXaE/razQ4jjQluN5jW1Eh/S7yYvI5gigSjdLYU9TiFXAcHjISiLhQd9obb3OQmwY+YqVwiBMCkOGLXaK/ljBShh56c1g0uyIb2lBRKO7ZTAFncw5c5UGjGSy3CsI1Jt2mtruZkfhBZmbR+842Yu1eDiWEl0V6LZcGem6Ct+LW4Wy3oAjyNObazKBHomhJ3HMKEKHgiGksH+Ig1nTidfNMyA+oYHqVFaRGLiQreVLc9GvQgftKjW9cfUSKNYL80rqU7Um2rwqQJR1ai31Wq7vzKJEsFHDj0bAEMUKXgvfD5bWbaLPBTKz1Nk/Fg+GUZvUzFw80CLaKtPAACVAWrismh863FU4IJ0716SXBUNVb/SDMVvZgDt34CXoOq1JKvg0n08gPHTwXBNgD5W8pZZ8E9EVWcv1DZMB2NFysIwkqBSaH5QRmsAHdkHB+UANvLJvFpQKAahSmYTLEd2AFO+5rsqRRU6sVv5IP0wsSPLcWsbC1Y95mte71CUm6RJJWwkg6Q4k+xWMM0ByElJPQ6j2ED5hY42ALpZRytx9RlgQlJLijzhKi5eX5JBSIRGfo9o2xhd/0aWku8OS+4D9ZnovHDQMPaYo4qm2mlZbUnd7pR6oQj29Z2BqJ9n3LRT+MTLu3IR+ZP2TCPh3EDw8H1NHpoT7FibNYU8WHd9ESHcY12aDOQCUBddi4Ucp+4yuzz8ybcCCu1h8zvzXhDN4HYLq1R+U0xzUqg5QSA3iSBgdDouy55Ifx0DaeEhgezxBRGmoEJ6AJitVuzwtKPlUskHgU2F0LS7AFIwW5jPu0RUL7sp+fkNk0ee8P6uXYgl40WM+cdCOW21r13e0ivt0ff/mYcUfrQZWs2BiN6G+MDTGz1BKORmUTNQp9YGSHFxAeTkQrKd6FoVUogyytW25OLy3OpaO5oZCQp46aPzb5LnJiFEIwAKkmbYVYIjzVv3vj7rA6HignEeQAXTAHKDhoD7Uujh0QjtsB6fTP1NzO7T1Nzq4F1GnfHdXCG1Yxjwdtjf+PGRGTzEtEAUCz7KLfTdItLwCXuSOAzVjaZB6LvbUZhYGWmifSZlcMDnGHPd6gPeiK9erhpiw7ZP9ahTrMhFDa1J53m9ri2DloziqGETTcVSppCbTDDjExg6RrZ6cPEzB8XArEjQSB29odrUoLyoS/65RfM9fprGGjlHpbhGgbYD8MtmW1eFcAWX5dbcMHcl8sUI2k+H7GPW9VrArw3G+BefcCrCaAT/N53YLvP26Uy0kMFnDEZz0DJkmQqEOlL7SlKweYhH8gxpYeAYi0f9magqPbMYZuUI6007lSZQoyoGfYQHsNRzHXR3MMINTSMZpq1KD2A5MDJgtMLdRU6R4CEOJcKGiIJ7K6P/vAM6xpECHI8rRHsaEj6smkngAUjXTzrRoSI48ZpHOqgOY5OejKVdpnmiYUChQnVdIPa6ekGqRSRgEO119oDHOiIUQ5ciYVgaF1oG8Udo8WYtD+DEi8D/w8rAJE2k2PoyV0oMtpauxreaFjpujAvxFlwBhjuNqM9P0IfI5iD8Nh8y1kG4igjJkDNkOijnlLhItAd9lhRd670yNRTu95cR/Xuu0c5WO4DEFk5YQAPtLvU4TYPGRh4APPEDNiuuwR6SC21JoFbQBBMr+zJmT32QplNI6p16PbculN/pCX1wAyTWGTeJ774aln0gvQikw7TmkfsNbdQNs0adutYUDqNtGc0RqngUYdhUYuHSL1/eLrgvqDTC5neu++vufRkEgP9D2T64Kg/c4n+s7k3dDr3me8nOr0c72MRNmgF7D4WySPP0YAI/bI4eixwc7K13QiRiL85A8fnSsUj+mvTrsZtVUEQZ6sTpVafW8nYJZyaZS0U+0xIb6et9PhhtoObozQbjKAoDf6eiFgx1UUvpUYj1GweH0MNMrofhynfWn7+KYu7n5r83hN9aqm+6qjcH7dUlgvZVLV3xqq4fbP16qv+eofuTz43eomAqfS7GBAB9zEE31WJ37eVIPtdGN5A8nMYPvvLt8t2/V/6gM19G4g/hIL7UXf9JgbuLRZ+AoW//AzyMxTcWyz8BAruLRZ+AgX3r3y2+mT/PwfiN1DoVI+QT3CZDmvb8022JeYb6HiQPQpPPvboFB+i1MZdcqWZqthHmix6vttw0UAI1z8oEnGwVe++c7JamxslC+8xKJE41XJmug1npz+6CUAKyURd9gSxo+kWxvtZth848GBlws/0SKjYhmbZ9IiV+mcGBSdWHk8sqSr2zz5J7QME/0yD+z4Pe+JuGn1MV/vUyZwOHojWPlmPXgf9CuoeN9UAT+FGwaLg44v3dWe6QpvuL3Ln/p3k/2AgqNDcfwHgqUmIIqn+hwAAAAJiS0dEAACqjSMyAAAACXBIWXMAAAsSAAALEgHS3X78AAAAB3RJTUUH4wYRESAMujenGAAAB9FJREFUeNrtnWlsFVUUx899fS1gUoKioEY+WBRUEohGkUhAKxgEjSgGoRGB4AJCNKAIJBJZJSiyGYMKKkIoLlEUKhUraxFkKUE2kU1aCrRgW2jpg9f29R2/sBTo67v3zL2zvfP73MzM+XU6mf+5504BGIZhGIZhGIZhGIZhGMZGGq3JvSmR62++BXHH7Ylbf9ouRMT99yVq/e0PICIiHumUmPV3PooXOf5EItafXoCXOdUn8ep/pgjrUDY40ervX4JXUTEiocoXL5/FawiNEwlU/6hzeB3hqQljQIwJYT3UzEkQA2JiGOslsiAhDIgZ1RiD6NIEMBD8NIKxyQr6vv7FtdgQa31uILg0ig2zsZmv4//yePUj7rjNv/U3yUEJ/r7Xr/XfvBmlOPKwT+vfhpIUdvdj/Wm7UZpTz/mv/g4HUYGyQb5r/+SjEhXD/VV/j5OoSGisj16LRe9iVCY8xTcGxIulSKBmtk8MiKHlSMIn8ViMqkQivojHgfcuIJ0VAc/XPzmMVljrcQOBmdVojY1NvVx/8mcRtEqeh+NxypJatM6+ezxb/7Io6uBwR4/e/1moicJunvz956A2ip/1Xv3Nt6JGSgd6rf47/0KtlHssHrfZi5rxVDwWDx5C7XgoHotHC9AANbO8YqBXERohMt8bv/8X/kNDRDM9cA+IgWVojhWuNxAYXo4mWePyeBwYHUKz5Lo6HidNvICmybvVxfXPqEbz7Gvr2vrn1KAdHH7IpX//8yNoD8dcGY+TM6NoF26MxzLTL26Mx0majtM4q5ed7yhNulVsd5WAxqset/mGS6/d5CIBLXI62/7I6ZKyzjUC0rIfsP+hE3zkxt9c8vy7tPnJbiKfuyP+Xdn8ZDeuiMei+zF0juWOGyBNv+iMxw4bEBkl6CzOxmPx6ll0mryWDtb/ViU6z17H4rEYG0I3cMiheByYFEZ34Ew8Dn5UjW7BiXisY/rFDfGYmgWCCwcngXto0q08z1YBSUsy3NWgb5Qe2WSjgJRlfdy2RJPcNXm9bQIarexpsP5VdxHjcbMcm2Q3/5P64i71U8k/ELuLNsVjcct2cnST+rGg+Jo4XmhLPBZ376GOfoOkAIB5NWTHxuu/nzj9ElkA8gLgA+pLlvF43IU4/VI9G1QEAHnIPjfVaP1PnqRdVngKqAkActDMa2Hw/u9zijjjNg5UBcBr1FbD3jbG6h9QSruk8ovfyFESABnUWSNT8VgMI06/lF7aBqomAJ4n3m+G4nHgbeJfZfHljcCKAqDHcWo87m2g/gnE53LhlS+lqQqATv9S4/FL2u//qcT2T34XoAuAdvuJBspf11z/LOKbyYG6q4bqAqDVTqKByjFa21/U6ZfdaWBNADTdTDQQnqSv/pRMYjrZevVLCUUAiF+JBqpnaqv/J2I+zb3mxZwkAMTPDq8ep1A3P/1y3ZOEJABgiaPxuOnvxLN/B7oEwELq/sPl1utvSdz8VPsl6BMAn1AbBKut1t96F+3ENXOFTgFiehXRwAZL8Vi0JW5+qppW7+HIAgDGnyca2G4hHouOh2knvTARdAuAkedsj8cinTj9Ujka9AuAV87YHI/F08TNT2eHgQkB0I/aIDhGmuIU/YnnKxkAZgTAU8SGHC0eDyJufiqKfTKrAqBrPtFAiXo8HlFBO1VBA7ebZQHQifhUVo7H4p2QgQeOdQHQbp8t8Tg4idj+2dPgwJIGAdBqhw3xmDz9EuelQ4cASP3DeDwOziW+ecdbldEiACDbcDxOWkBs/8QNHpoEAPXjLNFMmfpv+IZ4+PjRU5cAWGwwHqcQNz/J2NUmAMgjavHjMfEPTGpvvz4BQH1MrzMkoHoW2CsAppEaBFskemQUA+HJYLcAeJfQINgpNVuvbiA0FuwXAG8qNwh2S07WqxqQ/saPXgEwRDGu7W8te2Q1A6XSH0HWLAD6nVa5zoPS9asZKJb/DLZuAdDzhPx1Hu2gkobkDRQq/J8w7QJAfstevuI3+WQN1F39dkAAtP9H7jpPdFVtiMgZOKC0Z9aAAEiT+mrbScLQjIyBXWngtABokRf/kKefonRF4xvYqrjmYEQApG6Md8SyvrS+eDwDG5QbzUYExL3QMxnUlZGGD5wFbhEADQ7YVwyhr401YCD6LbhHACyK3SA4N9TK6mhMA5EvwE0CYF6sBkFopLXl8exYq9/gLgHwYf3x+PxoqwMC9RoIvw9uE1D/gH3VeOsjItnSq9/OCqhvwL5qAoABA5XU28qsAHjj2tW8mukABgzEXP12WgAMvrpBEPkYwICB2KvfjguAvnUH7GvnARgwUGRhEt24gLoD9tGvAAwYKLDyySzzAqDzpQH76CIAAwYOWtqNYoMAaH9xwP57AAMG9ljbj2SHALhjJyLijwAGDGyzuCPNFgGQuhlxpfw1yR94dfAxi5cmojI/lRyx+rtaX9XDhADr2CVABc//JycWwAJYAAtgASyABbAAFsACWAALYAEsgAWwABbAAlgAC2ABLIAFsAAWwAJYAAtgASyABbAAFsACWAALYAEsgAWwABbAAlgAC2ABLIAFsAAWwAJYAAtgASyABbAAFsACWAALYAEsgAWwABbAAlgAC2ABLIAFsAAWwAJYAAtgASyABbAAFsACWIDToH8FyJUWtVWAALedDoFhGIZhGIZhGIZhGIYxyf+YwEMsIhMo/AAAAABJRU5ErkJggg==";var xAe=new t0;function ooe(e,t,r){let{nearRadius:n,farRadius:i,accentColor:s,completeFraction:l,isVertical:c,visibleThroughGeometry:p,dashed:h}=t,{color:y}=r,b=!0,_=0,C=1/0,P=t.displayArrowsOnPath,E=!0,T=P,O=n/2+IAe,D=0;e[0].z+=O;for(let Se=1;Se<e.length;++Se){e[Se].z+=O;let H=e[Se].x-e[Se-1].x,ie=e[Se].z-e[Se-1].z;if(c)D+=Math.sqrt(H*H+ie*ie);else{let ee=e[Se].y-e[Se-1].y;D+=Math.sqrt(H*H+ee*ee+ie*ie)}}if(!c){let Se=e[0],H=e[e.length-1];e.push(H.clone().setZ(H.z-.01)),e.unshift(Se.clone().setZ(Se.z-.01))}let A=new SN;T&&(A=xAe.load(ioe),A.colorSpace=Xp);let R=new An(y),j=new An(s),X={vertexes:{type:"f",value:1},resolution:{type:"v2",value:new wt(1,1)},cameraParameters:{type:"v2",value:new wt(_,0)},complete:{type:"f",value:b?0:1},color:{type:"c",value:R},pathLength:{type:"f",value:D},nearRadius:{type:"f",value:n},farRadius:{type:"f",value:i},nearZoom:{type:"f",value:_},farZoom:{type:"f",value:C},pulseColor:{type:"c",value:j},pulse:{type:"f",value:0},pulseLength:{type:"f",value:.075},pathIsVertical:{type:"b",value:c},arrowAnimationTimer:{type:"f",value:0},arrowTexture:{type:"t",value:A},displayArrowsOnPath:{type:"b",value:P},showPulse:{type:"b",value:E},opacityMultiplier:{type:"f",value:1},dashed:{type:"b",value:h}},Y=new LN(e);Y.curveType="catmullrom",Y.tension=0;let N=30,Z=8,ae=N*e.length,se=new AN(Y,ae,n,Z,!1),U=new Float32Array(se.attributes.position.count);for(let Se=e.length;Se<U.length;Se++)U[Se]=Se;se.setAttribute("vertexIndex",new Kp(U,1));let xe=new Float32Array(se.attributes.position.count),ne=new Kp(xe,1);for(let Se=0;Se<=ae;Se++)for(let H=0;H<=Z;++H)ne.setX(Se*(Z+1)+H,Se/ae);se.setAttribute("pathDistance",ne);let Pe=new Float32Array(se.attributes.normal.count*3),Ce=new Kp(Pe,3);for(let Se=0;Se<ae;Se++){let H=se.tangents[Se];for(let ie=0;ie<=Z;++ie)Ce.setXYZ(Se*(Z+1)+ie,H.x,H.y,H.z)}se.setAttribute("pathTangent",Ce);let Ue=new Float32Array(se.attributes.normal.count*3),_e=new Kp(Ue,3);for(let Se=0;Se<ae;Se++){let H=se.tangents[Se];var Me,Q,it;c?(Me=H.x*H.y,Q=-1+H.y*H.y,it=H.z*H.y):(Me=-H.x*H.z,Q=-H.y*H.z,it=1-H.z*H.z);let ie=Math.sqrt(Me*Me+Q*Q+it*it);ie===0&&(ie=1);let ee=Me/ie,Ee=Q/ie,Ne=it/ie;for(let Oe=0;Oe<=Z;++Oe)_e.setXYZ(Se*(Z+1)+Oe,ee,Ee,Ne)}se.setAttribute("pathNormal",_e);let Ke=new Td({uniforms:X,vertexShader:DT,fragmentShader:o8});Ke.transparent=!0,Ke.alphaTest=.5,X.resolution.value.x=1,X.resolution.value.y=1,X.vertexes.value=U.length,X.arrowTexture.value.wrapS=wc,X.arrowTexture.value.wrapT=wc,X.arrowTexture.value.anisotropy=16;let rt=new jt(se,Ke),Ae=rt.clone(),Be=re(k({},X),{opacityMultiplier:{type:"f",value:.25}});Be.complete.value=1,Ae.material=new Td({uniforms:Be,vertexShader:DT,fragmentShader:o8}),Ae.material.transparent=!0,Ae.material.alphaTest=.5,Ae.material.depthWrite=!1,Ae.material.depthTest=!1,Be.resolution.value.x=1,Be.resolution.value.y=1,Be.vertexes.value=U.length,Be.arrowTexture.value.wrapS=wc,Be.arrowTexture.value.wrapT=wc,Be.arrowTexture.value.anisotropy=16,Be.complete.value=l,rt.userData=Ae.userData=t.mesh.userData;let We=t.mesh;if(!p){let Se=new Td({uniforms:X,vertexShader:DT,fragmentShader:noe}),H=new jt(se,Se);H.name="stencil",H.material.colorWrite=!1,H.material.stencilWrite=!0,H.material.stencilRef=1,H.material.stencilFunc=IN,H.material.stencilZPass=aS,H.material.stencilZFail=aS,H.material.stencilFail=aS,H.material.depthWrite=!1,H.material.depthTest=!1,We.add(H),We.add(Ae)}if(We.add(rt),c){let Se=new co().setFromObject(rt),H=new ht;Se.getCenter(H),We.children.forEach(ie=>{ie.geometry.center(),ie.position.copy(H)})}p&&(rt.material.stencilWrite=!0,rt.material.stencilRef=1,rt.material.stencilFunc=xN,rt.material.stencilZPass=sS,rt.material.stencilZFail=sS,rt.material.stencilFail=sS,rt.material.needsUpdate=!0,rt.layers.disableAll(),rt.layers.enable(vS.ALWAYS_ON_TOP)),se.computeBoundingBox();let je=new ht;return se.boundingBox.getCenter(je),{mesh:We,material:Ke,center:je}}o(ooe,"buildPath");var IAe=.15;var _Ae=.5,s8=class s8 extends Lt{constructor(r,n,i,s){super();x(this,"rendererState");x(this,"altitudeDirty",!0);x(this,"convertTo3DMapPosition");x(this,"getParentContainer");x(this,"convertZoomLevelToAltitude");this.rendererState=r,this.convertTo3DMapPosition=n,this.getParentContainer=i,this.convertZoomLevelToAltitude=s}update(r,n,i,s=0){let l,c=!1;for(let p of this.rendererState.geometry3DIdsInScene)if(l=this.rendererState.geometry3DMap.get(p),l&&l.type==="path"&&l.components[0].type==="path"){let h=l.components[0],y=l.components[1],b=h.isVertical&&this.altitudeDirty;if(!(h instanceof Ch))continue;let _=[];if(h.dirty||b){if(h.mesh.parent!=null)for(let C=h.mesh.children.length-1;C>=0;C--)Pi(h.mesh.children[0]);if(h.feature.features.length===2&&h.feature.features[0].properties.parentId&&h.feature.features[1].properties.parentId){let C=h.feature.features[0],P=h.feature.features[h.feature.features.length-1],E,T,O=C.geometry.coordinates[2]||0,D=P.geometry.coordinates[2]||0;C.properties.parentId&&(E=this.getParentContainer(C.properties.parentId,!0),E!=null&&E.altitude!=null&&(O+=E.altitude,h.isVertical=!0)),P.properties.parentId&&(T=this.getParentContainer(P.properties.parentId,!0),T!=null&&T.altitude!=null&&(D+=T.altitude,h.isVertical=!0));let A=this.convertTo3DMapPosition(C.geometry.coordinates[1],C.geometry.coordinates[0],O),R=this.convertTo3DMapPosition(P.geometry.coordinates[1],P.geometry.coordinates[0],D);Math.abs(A.z-R.z)>_Ae&&E!=null&&E.visible&&T!=null&&T.visible&&(_=[A,R])}else _=h.feature.features.map(C=>this.convertTo3DMapPosition(C.geometry.coordinates[1],C.geometry.coordinates[0],C.geometry.coordinates[2]||0));if(_.length>1){let{mesh:C,material:P,center:E}=ooe(_,h,{color:y.color});h.mesh=C,h.material=P,h.position=E}h.dirty&&(h.nearZoomLevel!=null&&(h.nearZoomAltitude=this.convertZoomLevelToAltitude(h.nearZoomLevel)),h.farZoomLevel!=null&&(h.farZoomAltitude=this.convertZoomLevelToAltitude(h.farZoomLevel))),h.dirty=!1}y.dirty&&(h.mesh.children.forEach(C=>{C.name!=="stencil"&&(C.material.uniforms.color.value.set(y.color),C.material.visible=y.visible,C.material.needsUpdate=!0)}),h.mesh.position.z=y.altitude,y.dirty=!1),h.isVertical&&h.mesh.children.forEach(C=>{C.rotation.z=-s}),h.material&&(h.mesh.children.forEach(C=>{var E,T;if(C.name==="stencil")return;let P=C.material.uniforms;P.nearZoom.value=(E=h.nearZoomAltitude)!=null?E:r,P.farZoom.value=(T=h.farZoomAltitude)!=null?T:n,P.cameraParameters.value.x=i,h.materialDirty&&(P.nearRadius.value=h.nearRadius,P.displayArrowsOnPath.value=h.displayArrowsOnPath,P.farRadius.value=h.farRadius,P.pulseColor.value.set(h.accentColor),P.complete.value=h.completeFraction),C.material.needsUpdate=!0}),h.displayArrowsOnPath&&h.animateArrowsOnPath&&(h.mesh.children.forEach(C=>{C.name!=="stencil"&&(C.material.uniforms.arrowAnimationTimer.value=performance.now()/3e3,C.material.needsUpdate=!0)}),c=!0),h.materialDirty=!1)}this.altitudeDirty=!1,c&&this.publish("animate:path")}};o(s8,"PathSystem");var k2=s8;g();var No,Tv,Qf,a8=class a8{constructor(t){x(this,"rendererState");x(this,"dirty",!1);G(this,No);G(this,Tv);G(this,Qf);this.rendererState=t}updateOne(t){if(t instanceof mn&&t.components[0]instanceof Mi&&t.components[1]instanceof Lc&&t.parentObject3D instanceof Fs&&(q(this,No,t.components[0]),q(this,Qf,t.components[1]),d(this,No).detached&&d(this,No).dirty&&d(this,No).geometry!=null&&d(this,No).material!=null)){q(this,Tv,t.parentObject3D),d(this,No).visible=!1;let r=new An(d(this,Qf).color),n=d(this,Qf).opacity*am(t),i=new iy({color:r,side:Wp,opacity:n!=null?n:1,transparent:n!==void 0?n<1:!1},1,d(this,No).material.repeatYFactor),s=new yS(1,d(this,No).geometry.attributes.position.count||0,0,i),l=s.addGeometry(d(this,No).geometry);s.addInstance(l),s.userData={entities:{0:t.id},detached:!0},d(this,No).instanceIndex=l,d(this,No).material.setColor(d(this,No).instanceIndex,r,d(this,Qf).topColor?new An(d(this,Qf).topColor):r),d(this,No).mesh=s,d(this,No).material=i,d(this,Tv).add(s),d(this,No).dirty=!1}}update(){if(!this.dirty)return;let t;for(let r of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(r),this.updateOne(t);this.dirty=!1,this.cleanup()}cleanup(){q(this,No,void 0),q(this,Tv,void 0),q(this,Qf,void 0)}};No=new WeakMap,Tv=new WeakMap,Qf=new WeakMap,o(a8,"MeshDetachmentSystem");var FT=a8;g();g();function soe(e,t,r){var n;if(e.geometry!=null){let i=t||1e-4,s=i/e.currentHeight,l=i/r;e.geometry.scale(1,1,s),e.material&&(e.material.repeatYFactor=l),(n=e.mesh)==null||n.setGeometryAt(e.instanceIndex,e.geometry),e.currentHeight=i}}o(soe,"updateHeight");var hy,Eh,l8=class l8{constructor(t){x(this,"rendererState");x(this,"dirty",!1);G(this,hy);G(this,Eh);this.rendererState=t}updateOne(t){var r;t instanceof mn&&t.type==="geometry"&&((r=t.components[1])!=null&&r.dirty)&&(q(this,hy,t.components[0]),q(this,Eh,t.components[1]),t.type==="geometry"&&d(this,Eh).height!==d(this,hy).currentHeight&&soe(d(this,hy),d(this,Eh).height,d(this,Eh).initialHeight))}update(){let t;for(let r of this.rendererState.geometry3DIdsInScene)t=this.rendererState.geometry3DMap.get(r),this.updateOne(t);this.cleanup()}cleanup(){q(this,hy,void 0),q(this,Eh,void 0)}};hy=new WeakMap,Eh=new WeakMap,o(l8,"MeshModificationSystem");var NT=l8;g();var SAe={showPolygonLabelTextAreaMesh:!1,showEnvMap:!1,showCollisionBoxes:!1},u8=class u8{constructor(t){x(this,"state",SAe);x(this,"core");this.core=t}update(t){let r={};for(let[n,i]of Object.entries(t))n in this.state&&this.state[n]!==t[n]&&(this.state[n]=i,r[n]=i);this.handleUpdate(r)}handleUpdate(t){t.showPolygonLabelTextAreaMesh!=null&&(t.showPolygonLabelTextAreaMesh?this.core.getSystems().text3DSystem.showTextAreaMesh():this.core.getSystems().text3DSystem.hideTextAreaMesh()),t.showEnvMap!=null&&(t.showEnvMap?this.core.setEnvironment("basic"):this.core.setEnvironment(!1)),t.showCollisionBoxes!=null&&(t.showCollisionBoxes?(this.core.getSystems().collisionSystem.showCollisionBoxes(),this.core.render()):this.core.getSystems().collisionSystem.hideCollisionBoxes())}};o(u8,"Debug");var kT=u8;g();var R2=9,CAe=!1,aoe=.1;function wAe(e,t,r){for(let n=0;n<t;n++){let i=(r&16711680)>>16,s=(r&65280)>>8,l=r&255;e[n*3]=i/255,e[n*3+1]=s/255,e[n*3+2]=l/255}}o(wAe,"fillArrayWithColor");var c8=class c8{constructor(t,r,n){x(this,"state");x(this,"renderer");x(this,"renderService");x(this,"pickingTexture");x(this,"pickingMaterial");x(this,"pixelBuffer");x(this,"width",0);x(this,"height",0);x(this,"scale",1/2);x(this,"color",1);x(this,"convertTo3DMapPosition");x(this,"destroyed",!1);x(this,"enabled",!1);x(this,"backgroundId",16777215);x(this,"resize",o(()=>{let t=this.state.pixelRatio;this.width=Math.floor(this.renderer.domElement.width/t*this.scale),this.height=Math.floor(this.renderer.domElement.height/t*this.scale),this.pixelBuffer=new Uint8Array(4*this.width*this.height),this.pickingTexture=new wN(this.width,this.height,{format:oS,type:yN,internalFormat:"RGBA"})},"resize"));x(this,"shouldShowByXY",o((t,r,n)=>{if(this.pixelBuffer==null)return!1;let i=t+(this.height-r-1)*this.width,s=this.pixelBuffer[i*4],l=this.pixelBuffer[i*4+1],c=this.pixelBuffer[i*4+2],p=s<<16|l<<8|c;return p===n||p===this.backgroundId},"shouldShowByXY"));x(this,"activeOccluders",new Set);x(this,"update",o(()=>{if(!this.enabled||(this.activeOccluders.clear(),this.activeOccluders.add(this.backgroundId),!this.pickingTexture||!this.pixelBuffer))return;let t,r;for(let i of this.state.geometry3DIdsInScene){let s=this.state.geometry3DMap.get(i);if(s&&s instanceof Ar&&s.userData.occluderFeature!=null&&s.userData.occluderId!=null&&(this.activeOccluders.add(s.userData.occluderId),s.userData.occluderDirty)){if(t=s.userData.occluderFeature,t.geometry.type==="Polygon"){let l=Y3(t,this.convertTo3DMapPosition,{color:"white",height:aoe});r=this.createOccluderMesh(l,s.userData.occluderId),s.add(r)}else if(t.geometry.type==="MultiPolygon"){let l=Z3(t,this.convertTo3DMapPosition,{color:"white",height:aoe});r=this.createOccluderMesh(l,s.userData.occluderId),s==null||s.add(r)}s.userData.occluderDirty=!1}}this.renderer.setRenderTarget(this.pickingTexture);let n=new An(this.backgroundId);this.renderer.setClearColor(n),this.renderer.clear(),this.state.cameraObject.layers.disableAll(),this.state.cameraObject.layers.enable(R2),this.renderer.render(this.state.entityScene.parent,this.state.cameraObject),this.renderer.setRenderTarget(null),this.state.cameraObject.layers.disable(R2),CAe?this.renderService.enabledLayers.add(R2):this.renderService.enabledLayers.delete(R2),this.renderer.readRenderTargetPixelsAsync(this.pickingTexture,0,0,this.width,this.height,this.pixelBuffer).then(()=>{if(!this.destroyed)for(let i of this.state.geometry2DIdsInScene){let s=this.state.geometry2DMap.get(i);if(s&&(s==null?void 0:s.occluderId)!=null&&this.activeOccluders.has(s==null?void 0:s.occluderId)){let l=s.components[0].projection,c=Math.floor(l.x*this.scale),p=Math.floor(l.y*this.scale),h=this.shouldShowByXY(c,p,s.occluderId);s.components[0].isOccluded=!h}}})},"update"));if(this.state=t,this.convertTo3DMapPosition=r,(n==null?void 0:n.renderer)==null)throw new Error("No Renderer");this.renderService=n,this.renderer=n.renderer,this.resize(),this.pickingMaterial=new Td({glslVersion:_N,vertexShader:"\n attribute vec3 color;\n varying vec3 vColor;\n void main() {\n vColor = color;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",fragmentShader:"\n varying vec3 vColor;\n out vec4 fragColor;\n\n void main() {\n fragColor = vec4(vColor, 1.0);\n }\n "})}applyId(t,r){let n=t.attributes.position,i=new Float32Array(n.count*3);wAe(i,n.count,r),t.setAttribute("color",new Kp(i,3))}createOccluderMesh(t,r){let n=new jt(t,this.pickingMaterial);return n.layers.set(R2),this.applyId(n.geometry,r),n.userData.occluderId=r,n}reserveOccluderId(){return this.color++,this.color}enable(){this.enabled=!0}disable(){this.enabled=!1}destroy(){var t;this.destroyed=!0,(t=this.pickingTexture)==null||t.dispose(),this.pickingMaterial.dispose(),this.pickingTexture=void 0,this.pixelBuffer=void 0}};o(c8,"Occlusion2DSystem");var RT=c8;var loe=new Ec;var{DEFAULT_PITCH:m8,DEFAULT_BEARING:g8,DEFAULT_ZOOM_LEVEL:y8,DEFAULT_MIN_ZOOM_LEVEL:PAe,DEFAULT_MAX_ZOOM_LEVEL:TAe}=au,EAe=Yt.radToDeg(.6435011087932844),zi,Ni,my,B2,Ev,Mh,gy,Mv,ws,f8,he,Bn,nc,ki,Pp,Ko,me,$2,yo,Xn,uoe,coe,poe,Oh,j2,G2,U2,Ov,BT,V2,z2,q2,Lv,d8,yy,H2,_a,Sa,h8,Av,W2,v8=class v8 extends Lt{constructor(r,n={}){var _,C,P,E,T,O,D,A,R,j,X,Y;super();G(this,ws);x(this,"options");x(this,"container");x(this,"Debug");G(this,zi);G(this,Ni);G(this,my);G(this,B2);G(this,Ev);G(this,Mh);G(this,gy);G(this,Mv);x(this,"rendererDomElement");G(this,he,{geometry3DMap:new Map,geometry2DMap:new Map,geometry2DIdsInScene:new Set,geometry3DIdsInScene:new Set,entityScene:new Ar("__scene"),hoverColor:"#f6efff",text3dHoverColor:"white",insetsPadding:Mb,shouldMeasureCanvas:!0,pixelRatio:this.resolutionScale,canvasWidth:0,canvasHeight:0,tweenGroup:new PD,cameraObject:new IE,naturalBearing:0,containerOffset:[0,0],useStandaloneCamera:!1});x(this,"camera");G(this,Bn);G(this,nc);G(this,ki);G(this,Pp);G(this,Ko);G(this,me,{});G(this,$2,window.matchMedia("screen and (min-resolution: 2dppx)"));x(this,"map");G(this,yo,o(()=>{d(this,me).renderSystem.twoDdirty=!0},"#invalidate2DEntities"));G(this,Xn,o(()=>{d(this,me).renderSystem.threeDdirty=!0},"#invalidate3DEntities"));G(this,Oh,"standalone");G(this,j2,o(r=>Math.trunc(r*10)/10,"#round10"));G(this,G2,o(()=>{ke(this,ws,f8).call(this,i0()),d(this,me).twoDDrawSystem.dirty=!0,d(this,Ov).call(this,void 0,void 0,!0)},"#handlePixelRatioChange"));G(this,U2,o(()=>{d(this,Ov).call(this)},"#handleWindowResizeWithEvent"));G(this,Ov,o((r,n,i=!1)=>{let s=r!=null?r:this.rendererDomElement.clientWidth,l=n!=null?n:this.rendererDomElement.clientHeight;if((s===0||l===0)&&!i)return;d(this,he).canvasWidth=s,d(this,he).canvasHeight=l,ke(this,ws,f8).call(this,i0()),d(this,Lv).call(this),ke(this,ws,poe).call(this),d(this,me).cameraSystem.resize(this.canvasWidth,this.canvasHeight),d(this,me).cameraSystem.dirty=!0,d(this,me).watermarkSystem.resize(this.canvasWidth,this.canvasHeight),d(this,me).htmlControlsSystem.resize(this.canvasWidth),d(this,me).geometryInFocusSystem.resize(),d(this,me).occlusion2DSystem.resize();let{top:c,left:p}=this.container.getBoundingClientRect();d(this,he).containerOffset=[c,p],this.publish("resize"),this.render()},"#handleWindowResize"));G(this,BT,o(()=>{this.renderSync()},"#renderFull"));G(this,V2,new ht);G(this,z2,o((r,n)=>{let i=this.mode==="standalone"?d(this,Ni):this.viewCamera;if(d(this,Ni).position.z+this.camera.elevation>n.z){d(this,V2).copy(n);let s=d(this,V2).project(i),l=(s.x+1)/2*this.canvasWidth-0/2,c=(-s.y+1)/2*this.canvasHeight-0/2,p=d(this,j2).call(this,l),h=d(this,j2).call(this,c);r.x=p,r.y=h}else r.x=-1e3,r.y=-1e3},"#project"));G(this,q2,o((r,n)=>{d(this,Ko).setBufferSize(r,n),d(this,Ni).aspect=r/n,d(this,Ni).updateProjectionMatrix(),d(this,Ni).updateMatrixWorld(!0),d(this,Ev).x=r,d(this,Ev).y=n},"#setBufferSize"));G(this,Lv,o(()=>{var l;let r=d(this,he).canvasWidth=this.rendererDomElement.clientWidth,n=d(this,he).canvasHeight=this.rendererDomElement.clientHeight,i=Math.floor(r*this.resolutionScale),s=Math.floor(n*this.resolutionScale);d(this,q2).call(this,i,s),(l=this.map)==null||l.resize(),d(this,he).shouldMeasureCanvas=!1},"#measureCanvas"));x(this,"getParentContainer",o((r,n=!0)=>{if(!r)return n?d(this,he).entityScene:void 0;if(typeof r=="string"||typeof r=="number"){let i=d(this,he).geometry3DMap.get(r);return i instanceof Ar?i:(ce.warn("Parent (".concat(typeof r=="object"?r.id:r,") is not a valid container, adding to scene")),n?d(this,he).entityScene:void 0)}else if(r.type==="group-container"){let i=d(this,he).geometry3DMap.get(r.id);if(i instanceof Ar)return i}return n?d(this,he).entityScene:void 0},"getParentContainer"));x(this,"showCollisionBoxes",o(()=>{d(this,me).collisionSystem.showCollisionBoxes(),this.render()},"showCollisionBoxes"));x(this,"hideCollisionBoxes",o(()=>{d(this,me).collisionSystem.hideCollisionBoxes(),this.render()},"hideCollisionBoxes"));x(this,"projectScreenXYToCoordinate",o((r,n,i=!1)=>{var _,C;let s=d(this,he).containerOffset[0],l=d(this,he).containerOffset[1],c=(r-l)/d(this,he).canvasWidth*2-1,p=-((n-s)/d(this,he).canvasHeight)*2+1,h=new wt(c,p),y,b;if(i)loe.setFromCamera(h,d(this,Ni)),y=(_=loe.intersectObject(d(this,Mh),!1)[0])==null?void 0:_.point;else{let P=d(this,me).interactionSystem.getThreeDIntersectsFromXY(h);y=(C=P==null?void 0:P[0])==null?void 0:C.point,b=d(this,me).interactionSystem.getGroupContainerIntersectsFromXY(h)}if(y)return{coordinate:this.convert3DMapPositionToCoordinate(y),groupContainers:b}},"projectScreenXYToCoordinate"));x(this,"projectCoordinateToScreenXY",o(r=>{let n=this.convertTo3DMapPosition(r[1],r[0],r[2]||0),i=new wt;return d(this,z2).call(this,i,n),{x:i.x,y:i.y}},"projectCoordinateToScreenXY"));x(this,"convert3DMapPositionToCoordinate",o(r=>{var s,l,c,p;let{lat:n,lon:i}=bS((l=(s=d(this,he).center)==null?void 0:s[1])!=null?l:0,(p=(c=d(this,he).center)==null?void 0:c[0])!=null?p:0,r.x,r.y);return[i,n,r.z]},"convert3DMapPositionToCoordinate"));x(this,"setBackgroundColor",o((r,n)=>{d(this,Ko).setBackgroundColor(r,n)},"setBackgroundColor"));x(this,"getMetresPerPixel",o(()=>{let r=this.container.clientWidth,n=this.container.clientHeight/2,i=this.projectScreenXYToCoordinate(0,n,!0),s=this.projectScreenXYToCoordinate(r,n,!0);return i==null||s==null?void 0:dS(i.coordinate,s.coordinate)/r},"getMetresPerPixel"));x(this,"hideOutdoorLayersUnderPoint",o((r,n)=>{!this.map||(n==null?void 0:n.length)===0||(d(this,me).outdoorLayersSystem.hideLayersUnderPoint(r,n),this.render())},"hideOutdoorLayersUnderPoint"));x(this,"hideOutdoorLayersIntersectingPolygons",o((r,n,i)=>{d(this,me).outdoorLayersSystem.hideLayersIntersectingPolygons(r,n,i),this.render()},"hideOutdoorLayersIntersectingPolygons"));G(this,yy,new ON);G(this,H2,new Su);x(this,"render",o(()=>{var r;if(((r=d(this,me))==null?void 0:r.renderSystem)!=null)if(this.map&&(this.mode==="outdoors-interleaved"||this.mode==="outdoors-overlay"))this.map.triggerRepaint();else return d(this,me).renderSystem.update()},"render"));x(this,"renderSync",o(()=>d(this,me).renderSystem.update(!0),"renderSync"));G(this,_a,o0(()=>{this.publish("user-interaction-start",void 0)},0,!0));G(this,Sa,o0(()=>{this.publish("user-interaction-end",void 0),this.render()},0,!0));x(this,"on",o((r,n)=>{super.on(r,n),["outdoor-view-loaded","outdoor-style-loaded"].includes(r)&&this.mode==="standalone"&&I.env.NODE_ENV!=="test"&&(ce.warn('"'.concat(r,'" was subscribed to but outdoor view is disabled. The event has been triggered immediately. Enable outdoor view or remove the listener.')),this.publish(r))},"on"));x(this,"off",o((r,n)=>{super.off(r,n)},"off"));x(this,"getCursor",o(()=>d(this,me).interactionSystem.getCursor(),"getCursor"));x(this,"destroy",o(()=>{var r;d(this,me)&&(d(this,me).cameraSystem.off("user-dolly-start",d(this,_a)),d(this,me).cameraSystem.off("user-pan-start",d(this,_a)),d(this,me).cameraSystem.off("user-rotate-start",d(this,_a)),d(this,me).cameraSystem.off("user-zoom-start",d(this,_a)),d(this,me).cameraSystem.off("user-tilt-start",d(this,_a)),d(this,me).cameraSystem.off("user-pedestal-start",d(this,_a)),d(this,me).cameraSystem.off("user-dolly-end",d(this,Sa)),d(this,me).cameraSystem.off("user-pan-end",d(this,Sa)),d(this,me).cameraSystem.off("user-rotate-end",d(this,Sa)),d(this,me).cameraSystem.off("user-zoom-end",d(this,Sa)),d(this,me).cameraSystem.off("user-tilt-end",d(this,Sa)),d(this,me).cameraSystem.off("user-pedestal-end",d(this,Sa)),d(this,me).renderSystem.off("measure-canvas",d(this,Lv)),d(this,me).meshOptimizationSystem.off("geometry-2d-added",this.render),d(this,me).meshOptimizationSystem.off("model-loaded",this.render),this.remove("__scene"),d(this,yo).call(this),d(this,Xn).call(this),this.renderSync(),d(this,me).renderSystem.destroy(),d(this,me).cameraSystem.off("change",this.render),d(this,me).pathSystem.off("animate:path",this.render),d(this,me).cameraSystem.dispose(),d(this,me).exporterSystem.destroy(),d(this,me).outdoorLayersSystem.destroy(),d(this,me).drawSystem.destroy(),window.removeEventListener("resize",d(this,U2),!1),d(this,$2).removeEventListener("change",d(this,G2)),d(this,gy)&&d(this,gy).disconnect(),this._subscribers={},d(this,Ko).destroy(),(r=d(this,zi))==null||r.traverse(n=>{Pi(n),"dispose"in n&&typeof n.dispose=="function"&&n.dispose()}),q(this,zi,void 0),d(this,me).htmlControlsSystem.destroy(),d(this,me).collisionSystem.destroy(),d(this,me).interactionSystem.destroy(),d(this,me).domMutationSystem.destroy(),d(this,me).geometryInFocusSystem.destroy(),q(this,me,void 0),d(this,Oh)!=="outdoors-overlay"&&(this.map&&(this.map.transform.getElevation=void 0,this.map.remove()),this.container.contains(this.rendererDomElement)&&this.container.removeChild(this.rendererDomElement)),this.container.removeChild(d(this,Pp)),this.container.removeChild(d(this,Bn)),q(this,Ko,void 0))},"destroy"));G(this,Av,new ht);G(this,W2,new ht);if(d(this,he).useStandaloneCamera=(_=n.useStandaloneCamera)!=null?_:!1,d(this,he).naturalBearing=(C=n.naturalBearing)!=null?C:0,this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),!r.clientWidth||!r.clientHeight)throw new Error("[MappedinJS] Container width and height must be greater than 0");this.convertTo3DMapPosition=this.convertTo3DMapPosition.bind(this),(n.mode==="outdoors-interleaved"||n.mode==="outdoors-overlay")&&n.map&&(q(this,Oh,n.mode),this.map=n.map),d(this,he).entityScene.addEventListener("childadded",()=>{d(this,Xn).call(this),d(this,yo).call(this)}),d(this,he).entityScene.addEventListener("childremoved",()=>{d(this,Xn).call(this),d(this,yo).call(this)}),d(this,he).geometry3DMap.set(d(this,he).entityScene.userData.entityId,d(this,he).entityScene),n.center&&(d(this,he).center=n.center?[...n.center]:[0,0]),this.options=n,this.container=r,ke(this,ws,uoe).call(this),ke(this,ws,coe).call(this),d(this,me).htmlControlsSystem=new _T(this.container),d(this,Oh)!=="outdoors-overlay"&&d(this,me).htmlControlsSystem.addAttributionControl(this.options.attribution),window.MappedinDebug||(window.MappedinDebug={}),I.env.NODE_ENV==="test"&&(window.MappedinDebug.mapViewCoreInstance=this),q(this,Ko,new t3({antialias:typeof n.antialias=="boolean"?n.antialias:!0,alpha:!1,canvas:this.mode!=="standalone"?(P=n.gl)==null?void 0:P.canvas:void 0,onWebGLContextCreationError:n.onWebGLContextCreationError,onWebGLContextLost:n.onWebGLContextLost,onWebGLContextRestored:o(N=>{var Z;(Z=n.onWebGLContextRestored)==null||Z.call(n,N),d(this,yo).call(this),d(this,Xn).call(this),this.render()},"onWebGLContextRestored"),onWebGLRendererError:n.onWebGLRendererError,backgroundColor:n.backgroundColor||"#ffffff",backgroundAlpha:(E=n.backgroundAlpha)!=null?E:1})),q(this,zi,new Ed),d(this,zi).add(d(this,he).entityScene);let i=window.__THREE_DEVTOOLS__;I.env.NODE_ENV==="dev"&&typeof i<"u"&&(i.dispatchEvent(new CustomEvent("observe",{detail:d(this,zi)})),i.dispatchEvent(new CustomEvent("observe",{detail:d(this,Ko)}))),q(this,Ni,new IE(EAe,this.aspect,50,1e5)),d(this,he).cameraObject=d(this,Ni),q(this,B2,new EN),d(this,Ni).renderOrder=999;let s=new Zp;s.add(d(this,Ni)),q(this,Mv,new Zp),d(this,Mv).add(s),d(this,zi).add(d(this,Mv)),d(this,Ni).updateProjectionMatrix(),d(this,Ni).updateMatrixWorld(!0),this.referenceMap={scale:1,latitude:0,longitude:0,getNorth:o(()=>0,"getNorth"),georeference:[{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}},{target:{x:0,y:0}}]},this.rendererDomElement=d(this,Ko).domElement(),q(this,Ev,new wt);let l=new wu(1e6,1e6),c=new _o({color:0,visible:!1});q(this,Mh,new jt(l,c)),d(this,Mh).name="worldPlane",d(this,zi).add(d(this,Mh)),(T=n.gl)!=null&&T.canvas||r.appendChild(this.rendererDomElement),window.addEventListener("resize",d(this,U2),!1),d(this,$2).addEventListener("change",d(this,G2)),typeof ResizeObserver=="function"&&((O=I.env)==null?void 0:O.NODE_ENV)!=="test"&&(q(this,gy,new ResizeObserver(YN(N=>{d(this,Ov).call(this,N[0].contentRect.width,N[0].contentRect.height)},50))),(D=d(this,gy))==null||D.observe(r)),r.classList.add("mappedin-map"),this.rendererDomElement.style.width=(A=globalThis.MappedinDebug)!=null&&A.TEST_IOS?"1080px":"100%",this.rendererDomElement.style.height=(R=globalThis.MappedinDebug)!=null&&R.TEST_IOS?"1920px":"100%",I.env.NODE_ENV==="test"&&this.rendererDomElement.setAttribute("data-testid","mappedin-canvas"),d(this,he).canvasWidth=this.rendererDomElement.clientWidth,d(this,he).canvasHeight=this.rendererDomElement.clientHeight,this.rendererDomElement.style.touchAction="manipulation";let p=this.canvasWidth,h=this.canvasHeight;d(this,me).watermarkSystem=new vT(d(this,Ni),d(this,he),n==null?void 0:n.watermark),d(this,me).watermarkSystem.on("texture-loaded",this.render),d(this,he).shouldMeasureCanvas=!0,d(this,he).pixelRatio=this.resolutionScale,d(this,q2).call(this,Math.floor(p*this.resolutionScale),Math.floor(h*this.resolutionScale));let y=new pS(16777215,.3*Math.PI);y.position.set(-150,-150,350),d(this,zi).add(y);let b=new FN(16777215,.741*Math.PI);d(this,zi).add(b),d(this,me).cameraSystem=new Sv(d(this,Ni),d(this,zi),d(this,Ko).renderer,d(this,he),{mode:this.mode,canvasHeight:h,canvasWidth:p}),d(this,me).cameraSystem.on("user-dolly-start",d(this,_a)),d(this,me).cameraSystem.on("user-pan-start",d(this,_a)),d(this,me).cameraSystem.on("user-rotate-start",d(this,_a)),d(this,me).cameraSystem.on("user-zoom-start",d(this,_a)),d(this,me).cameraSystem.on("user-tilt-start",d(this,_a)),d(this,me).cameraSystem.on("user-pedestal-start",d(this,_a)),d(this,me).cameraSystem.on("user-dolly-end",d(this,Sa)),d(this,me).cameraSystem.on("user-pan-end",d(this,Sa)),d(this,me).cameraSystem.on("user-rotate-end",d(this,Sa)),d(this,me).cameraSystem.on("user-zoom-end",d(this,Sa)),d(this,me).cameraSystem.on("user-tilt-end",d(this,Sa)),d(this,me).cameraSystem.on("user-pedestal-end",d(this,Sa)),d(this,me).cameraSystem.on("change",()=>{this.publish("camera-change",this.camera),d(this,me).geometryInFocusSystem&&(d(this,me).geometryInFocusSystem.cameraDirty=!0),this.render()}),d(this,me).pathSystem=new k2(d(this,he),this.convertTo3DMapPosition,this.getParentContainer,d(this,me).cameraSystem.convertZoomLevelToAltitude),d(this,me).pathSystem.on("animate:path",this.render),d(this,me).panBoundsSystem=new IT(d(this,he),d(this,me).cameraSystem),d(this,me).panBoundsSystem.on("update",()=>{let{panBounds:N,fov:Z,convertAltitudeToZoomLevel:ae}=d(this,me).cameraSystem;if(d(this,me).panBoundsSystem.autoMinZoomLevel){if(N.radius<=0)return;let se=Math.min(d(this,he).canvasWidth/d(this,he).canvasHeight,1),U=Z*Math.PI/180*se,xe=Math.tan(U/2),{radius:ne,center:Pe}=d(this,me).cameraSystem.panBounds,Ce=ne/xe,Ue=this.getThreeCamera().getWorldPosition(new ht),_e=Pe.distanceTo(Ue),Me=Math.abs(Ue.z-Pe.z),Q=Ce*Me/_e,it=ae(Q);ck(it,this.camera.minZoomLevel)&&this.camera.setMinZoomLevel(it)}}),this.camera=new yT(this,d(this,me),d(this,he)),this.camera.setZoomLevel((j=n.zoomLevel)!=null?j:y8),this.camera.setBearing((X=n.bearing)!=null?X:g8),this.camera.setPitch((Y=n.pitch)!=null?Y:m8),this.camera.setMaxZoomLevel(TAe),this.camera.setMinZoomLevel(PAe),d(this,me).domVisiblitySystem=new Q3(d(this,he),d(this,Pp)),d(this,me).domMutationSystem=new gT(d(this,he),d(this,Pp)),d(this,me).domMutationSystem.on("dimensions-update",()=>{d(this,me).collisionSystem.collidersDirty=!0,this.render()}),d(this,me).domDrawSystem=new hT(d(this,he)),d(this,me).collisionSystem=new r3(d(this,nc),d(this,he)),d(this,me).twoDDrawSystem=new tT(d(this,he),d(this,ki),n.transformImageRequest),d(this,me).twoDDrawSystem.on("img:loaded",this.render),d(this,me).interactionSystem=new $I(this.rendererDomElement,d(this,he),d(this,Ni),d(this,Mh),d(this,me).cameraSystem.isUserInteracting),d(this,me).interactionSystem.on("doubletap-with-onefinger",N=>{var Z;this.camera.animateTo({center:(Z=this.projectScreenXYToCoordinate(N.clientX,N.clientY))==null?void 0:Z.coordinate,zoomLevel:this.camera.zoomLevel+1,duration:EE,easing:"ease-out"})}),d(this,me).interactionSystem.on("singletap-with-twofinger",()=>{this.camera.animateTo({zoomLevel:this.camera.zoomLevel-1,duration:EE,easing:"ease-out"})}),d(this,me).interactionSystem.on("hover",this.render),d(this,me).interactionSystem.on("click",N=>{var Z,ae,se,U,xe,ne;if(((Z=N.entity2D)==null?void 0:Z.id)==="watermark"&&typeof d(this,me).watermarkSystem.options.onClick=="function"&&d(this,me).watermarkSystem.options.interactive){d(this,me).watermarkSystem.options.onClick();return}this.publish("click",{coordinate:this.convert3DMapPositionToCoordinate(N.position),geometry:N.entity3D?[(ae=N.entity3D)==null?void 0:ae.id]:[],paths:((se=N.entity3D)==null?void 0:se.components[0])instanceof Ch?[N.entity3D.id]:[],markers:((U=N.entity2D)==null?void 0:U.components[0])instanceof xp?[N.entity2D.id]:[],models:((xe=N.entity3D)==null?void 0:xe.components[0])instanceof Ih?[N.entity3D.id]:[],labels:((ne=N.entity2D)==null?void 0:ne.components[0])instanceof Ip?[N.entity2D.id]:[],containers:Array.isArray(N.groupContainers)?N.groupContainers.map(Pe=>Pe.userData.entityId):[],pointerEvent:N.pointerEvent})}),d(this,me).interactionSystem.on("hover",N=>{var Z,ae,se,U,xe,ne;N.position&&((Z=N.entity2D)==null?void 0:Z.id)!=="watermark"&&this.publish("hover",{coordinate:this.convert3DMapPositionToCoordinate(N.position),geometry:N.entity3D?[(ae=N.entity3D)==null?void 0:ae.id]:[],paths:((se=N.entity3D)==null?void 0:se.components[0])instanceof Ch?[N.entity3D.id]:[],markers:((U=N.entity2D)==null?void 0:U.components[0])instanceof xp?[N.entity2D.id]:[],models:((xe=N.entity3D)==null?void 0:xe.components[0])instanceof Ih?[N.entity3D.id]:[],labels:((ne=N.entity2D)==null?void 0:ne.components[0])instanceof Ip?[N.entity2D.id]:[],containers:Array.isArray(N.groupContainers)?N.groupContainers.map(Pe=>Pe.userData.entityId):[]})}),d(this,me).geometryInFocusSystem=new OT(d(this,he),d(this,Ni)),d(this,me).geometryInFocusSystem.on("geometry-in-focus",N=>{this.publish("geometry-in-focus",N)}),d(this,me).twoDVisiblitySystem=new nT(d(this,he)),d(this,me).drawSystem=new rT(d(this,he),this.convertTo3DMapPosition),d(this,me).drawSystem.on("texture-loaded",this.render),d(this,me).stackSystem=new oT(d(this,he)),d(this,me).twoDProjectionSystem=new eT(d(this,he),d(this,z2)),d(this,me).exporterSystem=new u2(d(this,he)),d(this,me).meshOptimizationSystem=new J3(d(this,he),this.convertTo3DMapPosition),d(this,me).meshOptimizationSystem.on("model-loaded",this.render),d(this,me).meshOptimizationSystem.on("geometry-2d-added",this.render),d(this,me).meshDetachmentSystem=new FT(d(this,he)),d(this,me).meshModificationSystem=new NT(d(this,he)),d(this,me).customGeometrySystem=new ST(d(this,he),this.convertTo3DMapPosition),d(this,me).outlineInterpolationSystem=new CT(d(this,he)),d(this,me).renderSystem=new iT(d(this,Ko),d(this,he),this.mode,d(this,zi),d(this,Ni),this.viewCamera,d(this,me)),d(this,me).imageSystem=new MT(d(this,he),this.convertTo3DMapPosition,n.bearing,n.naturalBearing,n.imagePlacementOptions),d(this,me).text3DSystem=new F3(d(this,he),this.convertTo3DMapPosition),d(this,me).text3DSystem.on("render",this.render),d(this,me).imageSystem.on("image-loaded",this.render),d(this,me).renderSystem.on("pre-render",()=>this.publish("pre-render")),d(this,me).renderSystem.on("post-render",()=>this.publish("post-render")),d(this,me).renderSystem.on("measure-canvas",d(this,Lv)),d(this,me).outdoorLayersSystem=new LT(this.map),d(this,me).occlusion2DSystem=new RT(d(this,he),this.convertTo3DMapPosition,d(this,Ko)),n.occlusionEnabled&&d(this,me).occlusion2DSystem.enable(),this.Debug=new kT(this),n.environment!==!1&&q(this,my,ke(this,ws,h8).call(this)),d(this,BT).call(this)}get viewCamera(){return d(this,B2)}get canvasWidth(){return d(this,he).canvasWidth}get canvasHeight(){return d(this,he).canvasHeight}get resolutionScale(){var r,n;return(n=(r=this.map)==null?void 0:r._getClampedPixelRatio(this.canvasWidth,this.canvasHeight))!=null?n:i0()}get aspect(){return this.canvasWidth/this.canvasHeight}get mode(){return d(this,Oh)}addGroupContainer(r,n,i){if(!d(this,he).geometry3DMap.has(r)&&!d(this,he).geometry2DMap.has(r)){let s=new Ar(r);s.addEventListener("childadded",()=>{d(this,Xn).call(this),d(this,yo).call(this)}),s.addEventListener("childremoved",()=>{d(this,Xn).call(this),d(this,yo).call(this)}),(n==null?void 0:n.visible)!==void 0&&(s.visible=n.visible),(n==null?void 0:n.altitude)!==void 0&&s.setAltitude(n.altitude),(n==null?void 0:n.interactive)!==void 0&&Cs(s,n.interactive,d(this,he)),(n==null?void 0:n.focusable)!==void 0&&sD(s,n.focusable),(n==null?void 0:n.preloadGeometry)!==void 0&&(s.userData.preloadGeometry=n.preloadGeometry),d(this,he).geometry3DMap.set(r,s);let l=this.getParentContainer(i);l instanceof Ar&&l.addEntity(s),d(this,Xn).call(this),this.render()}else ce.error("Group container with ID '".concat(r,"' already exists. The group container cannot be added."));return{id:r,type:"group-container"}}addStackContainer(r,n,i){if(d(this,he).geometry3DMap.has(r))ce.error("Stack container with ID '".concat(r,"' already exists. The stack container cannot be added."));else{let s=new Ar(r);s.addEventListener("childadded",()=>{d(this,Xn).call(this),d(this,yo).call(this)}),s.addEventListener("childremoved",()=>{d(this,Xn).call(this),d(this,yo).call(this)}),s.components[0]=new mT,(n==null?void 0:n.visible)!==void 0&&(s.visible=n.visible),d(this,he).geometry3DMap.set(r,s);let l=this.getParentContainer(i);l instanceof Ar&&l.addEntity(s)}return{id:r,type:"stack-container"}}addCustomGeometry(r,n,i,s,l){if(d(this,he).geometry3DMap.has(r))ce.error("Custom geometry with ID '".concat(r,"' already exists. The custom geometry cannot be added."));else{let c=new wv(n,i),p=new mn(c,new Lc(s));(s==null?void 0:s.interactive)!==void 0&&Cs(p,s.interactive,d(this,he)),p.id=r,c.mesh.userData={entityId:r,type:"custom-geometry"},d(this,he).geometry3DMap.set(p.id,p);let h=this.getParentContainer(l);h instanceof Ar&&h.addEntity(p),d(this,Xn).call(this),this.render()}return{id:r,type:"custom-geometry"}}addGeometryGroup(r,n,i,s){var l,p;if(!d(this,he).geometry3DMap.has(r)&&!d(this,he).geometry2DMap.has(r)){let h=new Fs(r,new PE(i));h.addEventListener("childadded",()=>{d(this,Xn).call(this),d(this,yo).call(this)}),h.addEventListener("childremoved",()=>{d(this,Xn).call(this),d(this,yo).call(this)}),h.userData.dirty=!0,d(this,he).geometry3DMap.set(r,h);for(let b of n.features){if(b.geometry==null||!["Polygon","MultiPolygon","LineString","MultiLineString"].includes(b.geometry.type))continue;let _=(b==null?void 0:b.id)||((l=b==null?void 0:b.properties)==null?void 0:l.id)||xn(),c=i||{color:HN},{visible:C}=c,P=ls(c,["visible"]),E=d(this,me).meshOptimizationSystem.createEntityFromFeature(_,b,re(k({},P),{outline:!0}));d(this,he).geometry3DMap.set(_,E),h.userData.entities3D.add(_)}h.setVisible((p=i==null?void 0:i.visible)!=null?p:!0),(i==null?void 0:i.altitude)!=null&&h.setAltitude(i.altitude);let y=this.getParentContainer(s);y instanceof Ar&&y.addEntity(h),d(this,Xn).call(this),this.render()}else ce.error("Geometry group with ID '".concat(r,"' already exists. The geometry group cannot be added."));return d(this,me).outlineInterpolationSystem.geometries3DDirty=!0,{id:r,type:"geometry-group"}}addOccluder(r,n){let i=this.getParentContainer(n),s=d(this,me).occlusion2DSystem.reserveOccluderId();return i==null||i.addOccluderFeature(r,s),s}addImage(r,n,i,s){try{Qie(r,n,i)}catch(l){ce.error(l);return}if(!d(this,he).geometry3DMap.has(r)&&!d(this,he).geometry2DMap.has(r)){let l=new ET(n),c=new mn(l,new Lc(i));c.id=r||xn(),l.mesh.userData={entityId:c.id,type:"path"},d(this,he).geometry3DMap.set(c.id,c);let p=this.getParentContainer(s);p instanceof Ar&&p.addEntity(c),d(this,Xn).call(this),this.render()}else ce.error("Image with ID '".concat(r,"' already exists. The image cannot be added."));return{id:r,type:"image"}}addModelGroup(r,n,i,{parent:s,onComplete:l}={}){var c,p;try{Lie(r,n,i)}catch(h){ce.error(h);return}if(!d(this,he).geometry3DMap.has(r)&&!d(this,he).geometry2DMap.has(r)){let h=new Fs(r,new PE(re(k({},i),{outline:!1})));h.addEventListener("childadded",()=>{d(this,Xn).call(this),d(this,yo).call(this)}),h.addEventListener("childremoved",()=>{d(this,Xn).call(this),d(this,yo).call(this)}),d(this,he).geometry3DMap.set(r,h),h.userData.dirty=!0,h.userData.modelURL=i.url;for(let b of n.features){let _=b.id||b.properties.id||xn(),C=d(this,me).meshOptimizationSystem.createModelFromFeature(_,b,i);(b.properties.interactive!==void 0||i.interactive!=null)&&Cs(C,(c=b.properties.interactive)!=null?c:i.interactive,d(this,he)),d(this,he).geometry3DMap.set(_,C),h.userData.entities3D.add(_)}let y=this.getParentContainer(s);y instanceof Ar&&y.addEntity(h),d(this,Xn).call(this),(p=this.render())==null||p.then(l)}else ce.error("Model group with ID '".concat(r,"' already exists. The model group cannot be added."));return{id:r,type:"geometry-group"}}addMarker2D(r,n,i,s){var c;let l=i==null?void 0:i.id;try{Kre(r,n,i||{})}catch(p){ce.error(p);return}if(l===void 0||!d(this,he).geometry2DMap.has(l)&&!d(this,he).geometry3DMap.has(l)){let p=ke(this,ws,d8).call(this,r,new xp(n,i),i==null?void 0:i.occluderId,i==null?void 0:i.verticalOffset);p.id=l||String(p.id),l=p.id,(i==null?void 0:i.interactive)!=null&&i.interactive!=="pointer-events-auto"&&Cs(p,i==null?void 0:i.interactive,d(this,he));let h=typeof(i==null?void 0:i.attachTo)=="string"||typeof(i==null?void 0:i.attachTo)=="number"?d(this,he).geometry3DMap.get(i.attachTo):void 0;h instanceof mn&&h.attach(p),(c=this.getParentContainer(s))==null||c.addEntity(p),this.render()}else ce.error("Marker2D with ID '".concat(l,"' already exists. The marker cannot be added."));return{id:l,type:"marker"}}addText3D(r,n,i,s){if(!d(this,he).geometry3DMap.has(r)&&!d(this,he).geometry2DMap.has(r)){let l=new yh(re(k({},n),{properties:re(k({},n.properties),{id:r,content:n.properties.text})})),c=new mn(l,new Lb(i==null?void 0:i.appearance));c.id=r,l.mesh.userData.entityId=r.toString(),l.mesh.userData.type="text3d",d(this,he).geometry3DMap.set(r,c);let p=this.getParentContainer(s);p instanceof Ar&&p.addEntity(c),d(this,Xn).call(this),this.render()}else ce.error("Text3D with ID '".concat(r,"' already exists. The text3d cannot be added."));return{id:r,type:"text3d"}}labelText3D(r,n,i={}){var h,y;try{if(!n||!r)throw new Error("content and meshGeometryId are required");qne.parse(i)}catch(b){ce.error(b);return}let s=d(this,he).geometry3DMap.get(r);if((s==null?void 0:s.type)!=="geometry"){ce.error(".labelText3D failed: target incorrect");return}let l=s==null?void 0:s.components[0];if(!l.feature.properties.textArea)return;if(l.textEntityId){let b=d(this,he).geometry3DMap.get(l.textEntityId);if((b==null?void 0:b.type)!=="text3d"){ce.error(".labelText3D failed: existing text3d not found");return}return{id:b.id,type:b.type}}let c=new yh({type:"Feature",geometry:{coordinates:(h=l.feature.properties.textArea)==null?void 0:h.position,type:"Point"},properties:{textArea:l.feature.properties.textArea,content:n,id:xn()}});c.polygonEntityId=r;let p=new mn(c,new Lb(i==null?void 0:i.appearance));return l.textEntityId=p.id.toString(),c.mesh.userData.entityId=p.id.toString(),c.mesh.userData.type="text3d",d(this,he).geometry3DMap.set(p.id.toString(),p),i.parentId&&((y=this.getParentContainer(i.parentId))==null||y.addEntity(p)),this.render(),{id:p.id,type:"text3d"}}addLabel2D(r,n,i,s){var c;let l=i==null?void 0:i.id;try{$ne(r,n,i||{})}catch(p){ce.error(p);return}if(l===void 0||!d(this,he).geometry2DMap.has(l)&&!d(this,he).geometry3DMap.has(l)){let p=ke(this,ws,d8).call(this,r,new Ip(n,i||{},d(this,he)),i==null?void 0:i.occluderId,i==null?void 0:i.verticalOffset);p.id=l||String(p.id),l=p.id,(i==null?void 0:i.interactive)!=null&&Cs(p,i==null?void 0:i.interactive,d(this,he));let h=typeof(i==null?void 0:i.attachTo)=="string"||typeof(i==null?void 0:i.attachTo)=="number"?d(this,he).geometry3DMap.get(i.attachTo):void 0;h instanceof mn&&h.attach(p),(c=this.getParentContainer(s))==null||c.addEntity(p),d(this,yo).call(this),this.render()}else ce.error("Label2D with ID '".concat(l,"' already exists. The label cannot be added."));return{id:l,type:"label"}}addPath(r,n={},i){var p;try{Nie(r,n||{})}catch(h){ce.error(h);return}let s=new Ch(r,aD(n)),l=new mn(s,new Lc({color:(p=n==null?void 0:n.color)!=null?p:"#ff834c"}));l.id=(n==null?void 0:n.id)||xn(),s.mesh.userData={entityId:l.id,type:"path"},d(this,he).geometry3DMap.set(l.id,l),(n==null?void 0:n.interactive)!=null&&Cs(l,n==null?void 0:n.interactive,d(this,he));let c=this.getParentContainer(i);return c instanceof Ar&&c.addEntity(l),d(this,Xn).call(this),this.render(),{id:l.id,type:"path"}}updateWatermark(r){d(this,me).watermarkSystem.options=r,d(this,me).watermarkSystem.dirty=!0,d(this,me).collisionSystem.collidersDirty=!0,this.render()}remove(r){var i;let n;if(typeof r=="string"||typeof r=="number"?(n=d(this,he).geometry2DMap.get(r),n==null&&(n=d(this,he).geometry3DMap.get(r))):typeof r.id=="string"||typeof r.id=="number"?(n=d(this,he).geometry2DMap.get(r.id),n==null&&(n=d(this,he).geometry3DMap.get(r.id))):n=r,n!=null){if(n.type==="custom-geometry")d(this,he).geometry3DMap.delete(n.id),n.object3d&&Pi(n.object3d);else if(n.type==="group-container"){d(this,he).geometry3DMap.delete(n.userData.entityId);for(let l of n.childrenIds.values())this.remove(l),n.userData.entities2D.delete(l);let s=n.components[2];s&&s.focusMesh&&Pi(s.focusMesh),Pi(n)}else if(n.type==="geometry-group"){d(this,he).geometry3DMap.delete(n.userData.entityId);for(let s of n.userData.entities3D.values())this.remove(s),n.userData.entities3D.delete(s);Pi(n)}else if(n.type==="geometry"||n.type==="model"||n.type==="path"){let s=n.components[0];if(n.entities2D.size>0){for(let l of n.entities2D.values())this.remove(l);n.removeAllEntities()}if(n.object3d&&(((i=n.parentObject3D)==null?void 0:i.type)==="geometry-group"&&n.parentObject3D.userData.entities3D.delete(n.id),Pi(n.object3d)),n.type==="geometry"){let l=n.components[3];l&&(l.visible=!1,l.dirty=!0)}"focusMesh"in s&&s.focusMesh!=null&&Pi(s.focusMesh),"textMesh"in s&&s.textMesh!=null&&this.remove(s.textMesh.userData.entityId),d(this,he).geometry3DMap.delete(n.id)}else if(n.type==="marker"||n.type==="label"){let s=n.attachedTo;if(s){let l=d(this,he).geometry3DMap.get(s);l instanceof mn&&l.detach(n)}n.object3d&&Pi(n.object3d),n.type==="label"&&delete d(this,me).twoDDrawSystem.textCache[n.id],d(this,he).geometry2DMap.delete(n.id)}else if(n.type==="image")n.object3d&&Pi(n.object3d),d(this,he).geometry3DMap.delete(n.id);else if(n.type==="text3d"){Pi(n.object3d);let{batchedText:s,textMesh:l,polygonEntityId:c}=n.components[0];if(l&&(s&&s.removeText(l),Pi(l)),c){d(this,me).text3DSystem.remove(c);let p=d(this,he).geometry3DMap.get(c);(p==null?void 0:p.type)==="geometry"&&(p.components[0].textMesh=void 0,p.components[0].textEntityId=void 0)}d(this,he).geometry3DMap.delete(n.id)}d(this,Xn).call(this),d(this,yo).call(this),this.render()}}getScene(){return this.getState("__scene")}getThreeScene(){return d(this,zi)}getThreeCamera(){return d(this,Ni)}async setEnvironment(r){if(d(this,zi))if(r==="basic"){d(this,my)||q(this,my,ke(this,ws,h8).call(this));let n=await d(this,my);d(this,zi).environment=n}else d(this,zi).environment=null}getEnvironment(){var r;return(r=d(this,zi))!=null&&r.environment?"basic":!1}getCurrentSceneGLTF(r){return d(this,me).exporterSystem.getCurrentSceneGLTF(r)}getBoundingArea(r){(d(this,me).renderSystem.threeDdirty||d(this,me).renderSystem.twoDdirty)&&this.renderSync();let n=new co;if(r==null)n.setFromObject(d(this,he).entityScene);else{let i=Ob(d(this,he),r);if((i==null?void 0:i.type)==="geometry"&&(i==null?void 0:i.object3d)!=null){let s=i.components[0],l=s instanceof Mi?s.geometry:void 0;s.mesh instanceof lS&&l?(l.computeBoundingBox(),l.boundingBox&&n.union(l.boundingBox)):n.setFromObject(i.object3d)}else((i==null?void 0:i.type)==="geometry-group"||(i==null?void 0:i.type)==="group-container")&&(i==null?void 0:i.userData.entityId)!=null&&n.setFromObject(i)}if(im(n))return KN(n).map(this.convert3DMapPositionToCoordinate)}getState(r){var i,s,l,c,p,h,y,b,_,C;if(r==null)return{type:"map-view",hoverColor:d(this,he).hoverColor,text3dHoverColor:d(this,he).text3dHoverColor};let n=Ob(d(this,he),r);if((n==null?void 0:n.type)==="custom-geometry"){let P=n.components[0],E=n.components[1];return{id:n.id,type:"custom-geometry",visible:E.visible,altitude:E.altitude,parent:(i=n.parentObject3D)==null?void 0:i.userData.entityId,position:this.convert3DMapPositionToCoordinate(P.position)}}else if((n==null?void 0:n.type)==="geometry-group"){let P=[];for(let T of n.userData.entities3D.values()){let O=this.getState(T);((O==null?void 0:O.type)==="geometry"||(O==null?void 0:O.type)==="model")&&P.push(O)}let E=n.components[0];return{id:n.userData.entityId,type:"geometry-group",visible:n.visible,opacity:E.opacity,color:E.color,initialColor:E.initialColor,height:E.height,altitude:n.altitude,topColor:E.topColor,outline:E.outline,shading:E.shading,texture:E.texture,topTexture:E.topTexture,interactive:Array.from(n.userData.entities3D.values()).map(T=>d(this,he).geometry3DMap.get(T)).every(T=>T&&T.components[2]!=null),children:Array.from(n.userData.entities3D.values()).map(T=>this.getState(T)).filter(Boolean)}}else{if((n==null?void 0:n.type)==="group-container")return{id:n.userData.entityId,type:"group-container",visible:n.visible,altitude:n.altitude,opacity:n.opacity,interactive:!!n.components[1],children:Array.from(n.childrenIds.values()).map(P=>this.getState(P)).filter(Boolean)};if((n==null?void 0:n.type)==="label"){let P=n.components[0],E=n.object3d.parent,T=E==null?void 0:E.userData.entityId;return{id:n.id,type:"label",text:P.text||"",parent:{id:T,type:E==null?void 0:E.type},position:this.convert3DMapPositionToCoordinate(n.position),enabled:P.enabled,visible:P.visible,initialRank:RI(P.initialRank),options:{rank:RI(P.rank),appearance:P.appearance,interactive:n.components[1]!=null,verticalOffset:n.verticalOffset,attachTo:n.attachedTo}}}else if((n==null?void 0:n.type)==="marker"){let P=n.components[0],E=n.object3d.parent,T=E==null?void 0:E.userData.entityId;return{id:n.id,type:"marker",enabled:P.enabled,visible:P.visible,anchor:P.options.anchor,dynamicResize:P.options.dynamicResize,parent:{id:T,type:E==null?void 0:E.type},position:this.convert3DMapPositionToCoordinate(n.position),element:P.containerEl,initialRank:RI(P.initialRank),options:{rank:RI(P.rank),interactive:n.components[1]!=null||!1,verticalOffset:n.verticalOffset,attachTo:n.attachedTo,lowPriorityPin:P.options.lowPriorityPin}}}else if((n==null?void 0:n.type)==="geometry"){let{color:P,hoverColor:E,initialColor:T,initialTopColor:O,topColor:D}=n.components[1],A=n.components[0],R=n.components[1],j=n.components[2],X=n.components[3],Y=n.parentObject3D;return{id:n.id,type:"geometry",opacity:R.opacity,initialColor:T,color:P,focusable:A.focusable,initialTopColor:O,topColor:D,hoverColor:E,hovered:!!(j!=null&&j.hover),height:R.height,visible:R.visible,outline:X==null?void 0:X.visible,showImage:R.showImage,texture:R.texture,topTexture:R.topTexture,flipImageToFaceCamera:R.flipImageToFaceCamera,parent:{id:Y==null?void 0:Y.userData.entityId,type:Y==null?void 0:Y.type},position:this.convert3DMapPositionToCoordinate(A.position),interactive:n.components[2]!=null}}else if((n==null?void 0:n.type)==="model"){let P=n.components[0],E=n.components[1],T=n.components[2];return{id:n.id,type:"model",position:P.mesh?this.convert3DMapPositionToCoordinate((s=P.mesh)==null?void 0:s.getWorldPosition(new ht)):this.convert3DMapPositionToCoordinate(P.position),interactive:T!=null,material:E.material,parent:(l=n.parentObject3D)!=null&&l.parent?{id:n.parentObject3D.parent.userData.entityId,type:n.parentObject3D.parent.type}:void 0,visible:E.visible,verticalOffset:E.verticalOffset,color:E.color,opacity:E.opacity,rotation:(c=E.rotation)!=null?c:l0,scale:(p=E.scale)!=null?p:a0}}else if((n==null?void 0:n.type)==="path"){let P=n.components[0],E=n.components[2],T=n.components[1];return{id:n.id,type:"path",position:this.convert3DMapPositionToCoordinate(P.position),visible:T.visible,interactive:E!=null,completeFraction:P.completeFraction,color:T.color,accentColor:P.accentColor,nearRadius:P.nearRadius,farRadius:P.farRadius,animateArrowsOnPath:P.animateArrowsOnPath,displayArrowsOnPath:P.displayArrowsOnPath,nearZoomLevel:P.nearZoomLevel,farZoomLevel:P.farZoomLevel}}else if((n==null?void 0:n.type)==="image"){let P=n.components[0];return{id:n.id,type:"image",position:this.convert3DMapPositionToCoordinate(P.position),visible:n.components[1].visible,verticalOffset:(h=P.feature.properties.verticalOffset)!=null?h:0,flipImageToFaceCamera:n.components[1].flipImageToFaceCamera}}else if((n==null?void 0:n.type)==="text3d"&&n.components[0]instanceof yh&&"textArea"in n.components[0].feature.properties){pie(n);let P=n.components[0],E=n.components[1],{textMesh:T}=P,O=(y=P.mesh)==null?void 0:y.parent;O instanceof Ar&&((b=O.children.find(R=>R.type==="batchedtext"))==null||b.getWorldPosition(d(this,W2))),d(this,Av).set(0,0,0);let D=T?T.getWorldPosition(d(this,Av)):d(this,Av);return Object.assign({},s0,E.getState(),{id:n.id,type:"text3d",position:this.convert3DMapPositionToCoordinate(D.add(d(this,W2))),visible:(_=P.visible)!=null?_:!1,content:(C=P.feature.properties.content)!=null?C:""})}else return}}setState(r,n){var s,l;if(typeof r=="object"&&n==null){"hoverColor"in r&&(d(this,he).hoverColor=(s=r.hoverColor)!=null?s:d(this,he).hoverColor),"text3dHoverColor"in r&&(d(this,he).text3dHoverColor=(l=r.text3dHoverColor)!=null?l:d(this,he).text3dHoverColor);return}let i=Ob(d(this,he),r);if(i!=null){if(i.type==="custom-geometry"){let c=d(this,he).geometry3DMap.get(i.id);if(c instanceof mn&&c.components[0]instanceof wv){let p=n;_p(i,d(this,he),p.visible),R3(i,p.altitude),rD(i,p.position,this.convertTo3DMapPosition),nD(i,this.getParentContainer(p.parent,!1))}}else if(i.type==="path"){let c=n;Cs(i,c.interactive,d(this,he))&&d(this,Xn).call(this),R3(i,c.altitude),cie(i,d(this,he),c)}else if(i.type==="model"){let c=n;Cs(i,c.interactive,d(this,he))&&d(this,Xn).call(this),_p(i,d(this,he),c.visible),die(i,c)}else if(i.type==="group-container"){let c=n;_p(i,d(this,he),c.visible)&&(d(this,me).outlineInterpolationSystem.outlineOpacitiesDirty=!0,d(this,me).pathSystem.altitudeDirty=!0),R3(i,c.altitude)&&(d(this,me).pathSystem.altitudeDirty=!0),Cs(i,c.interactive,d(this,he))&&d(this,Xn).call(this),oD(i,d(this,he),c.opacity)&&(d(this,me).outlineInterpolationSystem.outlineOpacitiesDirty=!0),c.preloadGeometry&&i.userData.preloadGeometry!==!0&&(i.userData.preloadGeometry=!0,d(this,me).outlineInterpolationSystem.geometries3DDirty=!0)}else if(i.type==="geometry-group"){let c=n;_p(i,d(this,he),c.visible)&&(d(this,me).outlineInterpolationSystem.outlineOpacitiesDirty=!0),Zne(i,d(this,he),c),B3(i,d(this,he),c.outline),c.height!=null&&eD(i,d(this,he),c.height),c.altitude!=null&&i.setAltitude(c.altitude),sie(i,c),Kne(i,c.shading),oD(i,d(this,he),c.opacity)&&(d(this,me).outlineInterpolationSystem.outlineOpacitiesDirty=!0),Cs(i,c.interactive,d(this,he))&&(d(this,Xn).call(this),d(this,yo).call(this))}else if(i.type==="geometry"){if(i.components[0]instanceof Mi){let c=n;_p(i,d(this,he),c.visible)&&(d(this,me).outlineInterpolationSystem.outlineOpacitiesDirty=!0),B3(i,d(this,he),c.outline),Jne(i,c),sD(i,c.focusable)&&(d(this,me).geometryInFocusSystem.focusablesDirty=!0),uie(i,c.renderOrder)&&(d(this,me).meshDetachmentSystem.dirty=!0),lie(i,c.opacity)&&(d(this,me).meshDetachmentSystem.dirty=!0,d(this,me).outlineInterpolationSystem.outlineOpacitiesDirty=!0),iD(i,c.flipImageToFaceCamera),c.height!=null&&eD(i,d(this,he),c.height),aie(i,c)&&(d(this,me).meshDetachmentSystem.dirty=!0),tD(i,c),nie(i,c.hoverColor),Cs(i,c.interactive,d(this,he)),iie(i,c.hovered)}d(this,Xn).call(this)}else if(i.type==="label"||i.type==="marker"){let c=n;rie(i,n,d(this,he)),eie(i,n,d(this,he))&&(d(this,yo).call(this),d(this,me).domMutationSystem.dirty=!0),rD(i,c.position,this.convertTo3DMapPosition),nD(i,this.getParentContainer(c.parent,!1))&&(d(this,yo).call(this),d(this,me).panBoundsSystem.dirty=!0),Qne(i,c.enabled),_p(i,d(this,he),c.visible)}else if(i.type==="image"){let c=n;_p(i,d(this,he),c.visible),iD(i,c.flipImageToFaceCamera)}else if(i.type==="text3d"){let c=n;fie(i,d(this,he),c)}this.render()}}convertTo3DMapPosition(r,n,i=0,s){var p,h,y,b,_;if(Array.isArray(r))return this.convertTo3DMapPosition(r[1],r[0],(p=r[2])!=null?p:i,typeof n=="function"?n:void 0);if(typeof n!="number")throw new Error("convertTo3DMapPosition failed: longitude must be a number");let{x:l,y:c}=xS((y=(h=d(this,he).center)==null?void 0:h[1])!=null?y:0,(_=(b=d(this,he).center)==null?void 0:b[0])!=null?_:0,r,n);return s?(s.set(l,c,i),s):new ht(l,c,i)}get backgroundColor(){return typeof d(this,Ko).backgroundColor=="string"?d(this,Ko).backgroundColor:"#".concat(d(this,Ko).backgroundColor.getHexString())}get backgroundAlpha(){return d(this,Ko).backgroundAlpha}getThreeRenderer(){return d(this,Ko)}getCenter(r){let n=Array.isArray(r)?r:this.getBoundingArea(r);return n?uk(n):void 0}isInView(r){let n=Ob(d(this,he),r);if(d(this,H2).identity().multiply(d(this,Ni).projectionMatrix).multiply(d(this,Ni).matrixWorldInverse),d(this,yy).setFromProjectionMatrix(d(this,H2)),n instanceof sm)return d(this,yy).containsPoint(n.position);if(n instanceof mn){let i=n==null?void 0:n.components[0];if(i instanceof wv||i instanceof Ih)return d(this,yy).containsPoint(this.convertTo3DMapPosition(i.feature.geometry.coordinates));if(i instanceof Mi){let s=new co(this.convertTo3DMapPosition(i.featureBbox[1],i.featureBbox[0],0),this.convertTo3DMapPosition(i.featureBbox[3],i.featureBbox[2],0));return d(this,yy).intersectsBox(s)}}return!1}getSystems(){return d(this,me)}getInternalState(){return d(this,he)}getTweenGroup(){return d(this,he).tweenGroup}};zi=new WeakMap,Ni=new WeakMap,my=new WeakMap,B2=new WeakMap,Ev=new WeakMap,Mh=new WeakMap,gy=new WeakMap,Mv=new WeakMap,ws=new WeakSet,f8=o(function(r){var n;d(this,Oh)!=="outdoors-overlay"&&((n=this.map)==null||n.setPixelRatio(r)),d(this,he).pixelRatio=this.resolutionScale},"#setResolutionScale"),he=new WeakMap,Bn=new WeakMap,nc=new WeakMap,ki=new WeakMap,Pp=new WeakMap,Ko=new WeakMap,me=new WeakMap,$2=new WeakMap,yo=new WeakMap,Xn=new WeakMap,uoe=o(function(){q(this,Bn,document.createElement("div")),d(this,Bn).classList.add("mappedin__smart-collision-engine__container"),q(this,nc,document.createElement("canvas")),d(this,nc).classList.add("mappedin__smart-collision-engine-debug__container"),this.container.appendChild(d(this,Bn)),q(this,ki,document.createElement("canvas")),d(this,ki).classList.add("mappedin__smart-collision-engine__container"),d(this,ki).width=d(this,Bn).clientWidth*this.resolutionScale,d(this,ki).height=d(this,Bn).clientHeight*this.resolutionScale,d(this,ki).style.width=d(this,Bn).clientWidth+"px",d(this,ki).style.height=d(this,Bn).clientHeight+"px",d(this,Bn).appendChild(d(this,nc)),d(this,Bn).appendChild(d(this,ki)),d(this,nc).width=d(this,Bn).clientWidth,d(this,nc).height=d(this,Bn).clientHeight,d(this,ki).width=d(this,Bn).clientWidth*this.resolutionScale,d(this,ki).height=d(this,Bn).clientHeight*this.resolutionScale,d(this,ki).style.width=d(this,Bn).clientWidth+"px",d(this,ki).style.height=d(this,Bn).clientHeight+"px"},"#renderEntity2DContainer"),coe=o(function(){q(this,Pp,document.createElement("div")),d(this,Pp).classList.add("mappedin-2d-entities"),Object.assign(d(this,Pp).style,{position:"absolute",top:"0",left:"0",bottom:"0",right:"0",pointerEvents:"none","transform-style":"preserve-3d"}),this.container.appendChild(d(this,Pp))},"#renderEntityDOMContainer"),poe=o(function(){d(this,ki).width=d(this,Bn).clientWidth*this.resolutionScale,d(this,ki).height=d(this,Bn).clientHeight*this.resolutionScale,d(this,ki).style.width=d(this,Bn).clientWidth+"px",d(this,ki).style.height=d(this,Bn).clientHeight+"px",d(this,nc).width=d(this,Bn).clientWidth,d(this,nc).height=d(this,Bn).clientHeight,d(this,ki).width=d(this,Bn).clientWidth*this.resolutionScale,d(this,ki).height=d(this,Bn).clientHeight*this.resolutionScale,d(this,ki).style.width=d(this,Bn).clientWidth+"px",d(this,ki).style.height=d(this,Bn).clientHeight+"px",d(this,me).collisionSystem.collidersDirty=!0},"#resizeCollisionCanvas"),Oh=new WeakMap,j2=new WeakMap,G2=new WeakMap,U2=new WeakMap,Ov=new WeakMap,BT=new WeakMap,V2=new WeakMap,z2=new WeakMap,q2=new WeakMap,Lv=new WeakMap,d8=o(function(r,n,i,s){let l=new sm(n,this.convertTo3DMapPosition(r[1],r[0],r[2]||0),s);return l.occluderId=i!=null?i:d(this,me).occlusion2DSystem.backgroundId,d(this,he).geometry2DMap.set(l.id,l),l},"#createEntity2D"),yy=new WeakMap,H2=new WeakMap,_a=new WeakMap,Sa=new WeakMap,h8=o(async function(){return Sh.load(Yte).then(r=>{var n;return d(this,zi)&&((n=d(this,zi).environment)==null||n.dispose(),r.mapping=gN,d(this,zi).environment=r,this.render()),r})},"#loadEnvMap"),Av=new WeakMap,W2=new WeakMap,o(v8,"Core");var p8=v8,X2=p8;g();function MAe(e,t){OAe(e,t)(e.getScene(),t),LAe(e,t),t.addFolder("Export").add({export:o(async()=>{let l=await e.getCurrentSceneGLTF({binary:!0}),c=new Blob([l],{type:"application/octet-stream"});var p=document.createElement("a");document.body.appendChild(p),p.style.display="none";let h=window.URL.createObjectURL(c);p.href=h,p.download="scene.glb",p.click(),window.URL.revokeObjectURL(h)},"export")},"export");let i=t.addFolder("Camera"),s={get bearing(){return e.camera.bearing},set bearing(l){e.camera.setBearing(l)},get pitch(){return e.camera.pitch},set pitch(l){e.camera.setPitch(l)},get zoomLevel(){return e.camera.zoomLevel},set zoomLevel(l){e.camera.setZoomLevel(l)}};i.add(s,"bearing",-359,359,1),i.add(s,"pitch",e.camera.minPitch,e.camera.maxPitch,1),i.add(s,"zoomLevel",e.camera.minZoomLevel,e.camera.maxZoomLevel,.1)}o(MAe,"mountSceneGraphVisualizer");function OAe(e,t){let r=t;return o(function n(i,s){let l=s.addFolder("".concat([i.type]," ").concat(i.id.slice(0,16)));if(s.close(),i.type==="geometry"||i.type==="model"||i.type==="path"||i.type==="image"){let c={get height(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry"?p.height:0},set height(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry"&&e.setState(i,{height:p})},set flipImageToFaceCamera(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="image"&&e.setState(i,{flipImageToFaceCamera:p})},get flipImageToFaceCamera(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="image"?p.flipImageToFaceCamera:!1},set visible(p){let h=e.getState(i.id);((h==null?void 0:h.type)==="geometry"||(h==null?void 0:h.type)==="path"||(h==null?void 0:h.type)==="image")&&e.setState(i,{visible:p})},get visible(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry"||(p==null?void 0:p.type)==="path"||(p==null?void 0:p.type)==="image"?p.visible:!1},set outline(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry"&&e.setState(i,{outline:p})},get outline(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry"?p.outline:!1},get opacity(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry"?p.opacity:1},set opacity(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry"&&e.setState(h,{opacity:p})},get color(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry"&&p.color?ft(p.color).toHexString():"#ffffff"},set color(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry"&&e.setState(h,{color:p})},set interactive(p){let h=e.getState(i.id);((h==null?void 0:h.type)==="geometry"||(h==null?void 0:h.type)==="model"||(h==null?void 0:h.type)==="path")&&(e.setState(i,{interactive:p}),r.controllersRecursive().forEach(y=>y.updateDisplay()))},get interactive(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry"||(p==null?void 0:p.type)==="model"||(p==null?void 0:p.type)==="path"?p.interactive:!1},get completeFraction(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="path"?p.completeFraction:1},set completeFraction(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="path"&&e.setState(h,{completeFraction:p})},focus:o(()=>{},"focus")};l.add(c,"focus").onChange(()=>{let p=e.getState(i.id);(p==null?void 0:p.type)==="model"||(p==null?void 0:p.type)==="path"||(p==null?void 0:p.type)==="image"?e.camera.focusOn([p.position]):(p==null?void 0:p.type)==="geometry"&&e.camera.focusOn(e.getBoundingArea(p))}),l.add(c,"visible"),i.type==="image"?l.add(c,"flipImageToFaceCamera"):(l.add(c,"interactive"),i.type==="path"&&l.add(c,"completeFraction",0,1,.1),i.type!=="model"&&(l.addColor(c,"color"),l.add(c,"outline"))),i.type==="geometry"&&(l.add(c,"height"),l.add(c,"opacity",0,1,.1))}else if(i.type==="marker"){let c={get interactive(){var h;let p=e.getState(i.id);return(p==null?void 0:p.type)==="marker"?(h=p.options)==null?void 0:h.interactive:!1},set interactive(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="marker"&&(e.setState(h,{options:{interactive:p}}),r.controllersRecursive().forEach(y=>y.updateDisplay()))},focus:o(()=>{},"focus")};l.add(c,"focus").onChange(()=>{let p=e.getState(i.id);(p==null?void 0:p.type)==="marker"&&e.camera.focusOn([p.position])}),l.add(c,"interactive")}else if(i.type==="label"){let c={get interactive(){var h;let p=e.getState(i.id);return(p==null?void 0:p.type)==="label"?(h=p.options)==null?void 0:h.interactive:!1},set interactive(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="label"&&(e.setState(h,{options:{interactive:p}}),r.controllersRecursive().forEach(y=>y.updateDisplay()))},get text(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="label"?p.text:""},set text(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="label"&&e.setState(h,{text:p})},get"Text Color"(){var h,y;let p=e.getState(i.id);return(p==null?void 0:p.type)==="label"?(y=(h=p.options.appearance)==null?void 0:h.text)==null?void 0:y.foregroundColor:"#000000"},set"Text Color"(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="label"&&e.setState(i.id,{text:c.text,options:{appearance:{text:{foregroundColor:p}}}})},get"Text Size"(){var h,y;let p=e.getState(i.id);return(p==null?void 0:p.type)==="label"?(y=(h=p.options.appearance)==null?void 0:h.text)==null?void 0:y.size:10},set"Text Size"(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="label"&&e.setState(h,{text:c.text,options:{appearance:{text:{size:p}}}})},get"Icon Size"(){var h,y;let p=e.getState(i.id);return(p==null?void 0:p.type)==="label"?(y=(h=p.options.appearance)==null?void 0:h.marker)==null?void 0:y.iconSize:10},set"Icon Size"(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="label"&&e.setState(h,{text:c.text,options:{appearance:{marker:{iconSize:p}}}})},get"Active Foreground Color"(){var h,y,b;let p=e.getState(i.id);return(p==null?void 0:p.type)==="label"?(b=(y=(h=p.options.appearance)==null?void 0:h.marker)==null?void 0:y.foregroundColor)==null?void 0:b.active:"#000000"},set"Active Foreground Color"(p){var y,b;let h=e.getState(i.id);(h==null?void 0:h.type)==="label"&&e.setState(h,{text:c.text,options:{appearance:{marker:{foregroundColor:re(k({},(b=(y=h.options.appearance)==null?void 0:y.marker)==null?void 0:b.foregroundColor),{active:p})}}}})},get"Inactive Foreground Color"(){var h,y,b;let p=e.getState(i.id);return(p==null?void 0:p.type)==="label"?(b=(y=(h=p.options.appearance)==null?void 0:h.marker)==null?void 0:y.foregroundColor)==null?void 0:b.inactive:"#000000"},set"Inactive Foreground Color"(p){var y,b;let h=e.getState(i.id);(h==null?void 0:h.type)==="label"&&e.setState(h,{text:c.text,options:{appearance:{marker:{foregroundColor:re(k({},(b=(y=h.options.appearance)==null?void 0:y.marker)==null?void 0:b.foregroundColor),{inactive:p})}}}})},get"Active Background Color"(){var h,y,b;let p=e.getState(i.id);return(p==null?void 0:p.type)==="label"?(b=(y=(h=p.options.appearance)==null?void 0:h.marker)==null?void 0:y.backgroundColor)==null?void 0:b.active:"#000000"},set"Active Background Color"(p){var y,b;let h=e.getState(i.id);(h==null?void 0:h.type)==="label"&&e.setState(h,{text:c.text,options:{appearance:{marker:{backgroundColor:re(k({},(b=(y=h.options.appearance)==null?void 0:y.marker)==null?void 0:b.backgroundColor),{active:p})}}}})},get"Inactive Background Color"(){var h,y,b;let p=e.getState(i.id);return(p==null?void 0:p.type)==="label"?(b=(y=(h=p.options.appearance)==null?void 0:h.marker)==null?void 0:y.backgroundColor)==null?void 0:b.inactive:"#000000"},set"Inactive Background Color"(p){var y,b;let h=e.getState(i.id);(h==null?void 0:h.type)==="label"&&e.setState(h,{text:c.text,options:{appearance:{marker:{backgroundColor:re(k({},(b=(y=h.options.appearance)==null?void 0:y.marker)==null?void 0:b.backgroundColor),{inactive:p})}}}})},focus:o(()=>{},"focus")};l.add(c,"focus").onChange(()=>{let p=e.getState(i.id);(p==null?void 0:p.type)==="label"&&e.camera.focusOn([p.position])}),l.add(c,"interactive"),l.add(c,"text"),l.add(c,"Text Size",10,50),l.add(c,"Icon Size",10,50),l.addColor(c,"Text Color"),l.addColor(c,"Active Background Color"),l.addColor(c,"Inactive Background Color"),l.addColor(c,"Active Foreground Color"),l.addColor(c,"Inactive Foreground Color")}else if(i.type==="geometry-group"){let c={get opacity(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry-group"?p.opacity:1},set opacity(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry-group"&&e.setState(i,{opacity:p})},set visible(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry-group"&&e.setState(i,{visible:p})},get visible(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry-group"?p.visible:!1},set outline(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry-group"&&e.setState(i,{outline:p})},get outline(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry-group"?p.outline:!1},set interactive(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry-group"&&(e.setState(i,{interactive:p}),r.controllersRecursive().forEach(y=>y.updateDisplay()))},get interactive(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry-group"?p.interactive:!1},get shadingStart(){var h,y;let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry-group"&&(y=(h=p.shading)==null?void 0:h.start)!=null?y:0},set shadingStart(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry-group"&&e.setState(h,{shading:{start:p}})},get shadingEnd(){var h,y;let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry-group"&&(y=(h=p.shading)==null?void 0:h.end)!=null?y:0},set shadingEnd(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry-group"&&e.setState(h,{shading:{end:p}})},get shadingIntensity(){var h,y;let p=e.getState(i.id);return(p==null?void 0:p.type)==="geometry-group"&&(y=(h=p.shading)==null?void 0:h.intensity)!=null?y:0},set shadingIntensity(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="geometry-group"&&e.setState(h,{shading:{intensity:p}})}};l.add(c,"visible"),l.add(c,"opacity",0,1,.1),l.add(c,"interactive"),l.add(c,"outline"),l.add(c,"shadingStart",0,1,.1),l.add(c,"shadingEnd",0,1,.1),l.add(c,"shadingIntensity",0,1,.1)}else if(i.type==="group-container"){let c={set visible(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="group-container"&&e.setState(i,{visible:p})},get visible(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="group-container"?p.visible:!1},set interactive(p){let h=e.getState(i.id);(h==null?void 0:h.type)==="group-container"&&(e.setState(h,{interactive:p}),r.controllersRecursive().forEach(y=>y.updateDisplay()))},get interactive(){let p=e.getState(i.id);return(p==null?void 0:p.type)==="group-container"?p.interactive:!1}};l.add(c,"visible"),l.add(c,"interactive")}if(l.close(),i.children)for(let c of i.children.values())n(c,l)},"parseChild")}o(OAe,"createParseChild");function LAe(e,t){let r=t.addFolder("Watermark"),n={padding:16,iconOnly:!1,position:"bottom-left",color:"dark",scale:1};r.add(n,"padding",0,100,1),r.add(n,"scale",.5,1.5,.1),r.add(n,"color",["dark","light"]),r.add(n,"position",["top-left","top-right","bottom-left","bottom-right","center","top","bottom","left","right"]),r.add(n,"iconOnly"),r.onChange(()=>{e.updateWatermark(n)})}o(LAe,"createWatermarkChild");var foe="https://tiles-cdn.mappedin.com/styles/mappedin/style.json",AAe="https://auth.mappedin.com/oauth2/token";async function doe(e,t){var r,n,i,s,l,c;if((r=t==null?void 0:t.outdoorView)!=null&&r.enabled){let{Map:p,MercatorCoordinate:h}=await import("./outdoor-context-v4-ME4STCCK.js"),y=t.outdoorView.headers;y==null&&(y=await ok(AAe));let b=t.center||[0,0],_=new p({container:e,style:t.outdoorView.style||foe,center:b,attributionControl:!1,zoom:(n=t.zoomLevel)!=null?n:y8,pitch:(i=t.pitch)!=null?i:m8,bearing:(s=t.bearing)!=null?s:g8,transformRequest:tk(y),trackResize:!1,pixelRatio:t.outdoorView.lowDpi?1:i0(),antialias:typeof t.antialias=="boolean"?t.antialias:!0,boxZoom:!1,doubleClickZoom:!1,scrollZoom:!1,dragPan:!1,dragRotate:!1,keyboard:!1,touchZoomRotate:!1}),C=_.painter.context.gl,P=new X2(e,{center:b,zoomLevel:_.getZoom(),pitch:_.getPitch(),bearing:_.getBearing(),gl:C,map:_,mode:"outdoors-interleaved",watermark:t.watermark,attribution:t.attribution,antialias:t.antialias,occlusionEnabled:t.occlusionEnabled,transformImageRequest:t.transformImageRequest,naturalBearing:(l=t.naturalBearing)!=null?l:0,imagePlacementOptions:t.imagePlacementOptions,onWebGLContextCreationError:t.onWebGLContextCreationError,onWebGLContextLost:t.onWebGLContextLost,onWebGLContextRestored:t.onWebGLContextRestored,onWebGLRendererError:t.onWebGLRendererError,useStandaloneCamera:(c=t.useStandaloneCamera)!=null?c:!1}),E={center:_.getCenter().toArray(),zoom:_.getZoom(),bearing:_.getBearing(),pitch:_.getPitch()};_.setMinZoom(P.camera.minZoomLevel),_.setMaxZoom(P.camera.maxZoomLevel),P.on("camera-change",j=>{E.center=j.center,E.zoom=j.zoomLevel,E.bearing=j.bearing,E.pitch=j.pitch,_.jumpTo(E)});let T=h.fromLngLat(b,0),O=IS(T,P.viewCamera,P.camera,()=>{P.renderSync()});_.on("style.load",async()=>{_&&(_.addLayer(O),P.renderSync())});let D=!1,A=!1;_.on("idle",()=>{_&&(D||(P.publish("outdoor-view-loaded"),D=!0),A||(A=!0,P.publish("outdoor-style-loaded")))});let R=o(j=>{j&&(j.sourceDataType==="metadata"||j.sourceDataType==="visibility"||j.dataType==="style"||j.type==="terrain")&&P.getSystems().htmlControlsSystem.updateData(_)},"updateData");return _.on("styledata",j=>{_&&j&&j.dataType==="style"&&j.type==="styledata"&&(A=!1),R(j)}),_.on("sourcedata",R),_.on("terrain",R),_.on("error",j=>{var X;if(((X=j.error)==null?void 0:X.url)===foe){ce.error('Failed to load outdoor view style, possibly due to invalid token "'.concat(y["x-mappedin-tiles-key"],'"'));return}ce.warn(j)}),P}else return new X2(e,t)}o(doe,"createRenderer");g();g();g();var Y2=(r=>(r.Exterior="exterior-walls",r.Interior="interior-walls",r))(Y2||{}),Z2=(r=>(r.Interior="interior-doors",r.Exterior="exterior-doors",r))(Z2||{});g();g();var Dv=class Dv{constructor(t,r,n){x(this,"id");x(this,"text");x(this,"target");x(this,"__type",Dv.__type);this.id=t,this.text=r,this.target=n}static is(t){return t.__type===Dv.__type}get focusTarget(){return this.target.anchorTarget}};o(Dv,"Label"),x(Dv,"__type","Label");var Lh=Dv;g();var vy,Fv=class Fv{constructor(t,r,n){x(this,"id");G(this,vy);x(this,"__type",Fv.__type);x(this,"contentEl");this.id=t,this.contentEl=r,q(this,vy,n)}get target(){return d(this,vy)}get coordinate(){return d(this,vy).anchorTarget}static is(t){return t.__type===Fv.__type}get focusTarget(){return this.target.anchorTarget}updateTarget(t){q(this,vy,t)}};vy=new WeakMap,o(Fv,"Marker"),x(Fv,"__type","Marker");var ed=Fv;g();var J2,Q2,Nv=class Nv{constructor(t,r,n){G(this,J2);G(this,Q2);x(this,"target");x(this,"__type",Nv.__type);q(this,J2,t),q(this,Q2,r),this.target=n}static is(t){return t.__type===Nv.__type}get id(){return d(this,J2)}get url(){return d(this,Q2)}};J2=new WeakMap,Q2=new WeakMap,o(Nv,"Image"),x(Nv,"__type","Image");var K2=Nv;g();var Rv,kv=class kv{constructor(t,r,n){x(this,"id");x(this,"groupId");x(this,"__type",kv.__type);G(this,Rv);this.id=t,this.groupId=r,q(this,Rv,n)}get target(){return d(this,Rv)}static is(t){return t.__type===kv.__type}updateTarget(t){q(this,Rv,t)}};Rv=new WeakMap,o(kv,"Model"),x(kv,"__type","Model");var by=kv;g();var Bv=class Bv{constructor(t,r){x(this,"id");x(this,"coordinates");x(this,"__type",Bv.__type);this.id=t,this.coordinates=r}static is(t){return t.__type===Bv.__type}get focusTarget(){return this.coordinates}};o(Bv,"PathSegment"),x(Bv,"__type","PathSegment");var jv=Bv,$v=class $v{constructor(t,r,n,i){x(this,"id");x(this,"animation");x(this,"coordinates");x(this,"segments");x(this,"__type",$v.__type);this.id=t,this.animation=r,this.coordinates=n,this.segments=i.map(({id:s,coordinates:l})=>new jv(s.toString(),l))}static is(t){return t.__type===$v.__type}get focusTarget(){return this.coordinates}};o($v,"Path"),x($v,"__type","Path");var ic=$v;g();var Ah,b8=class b8{constructor(t){G(this,Ah);q(this,Ah,t)}get center(){return d(this,Ah).center}get bearing(){return d(this,Ah).bearing}get pitch(){return d(this,Ah).pitch}get zoomLevel(){return d(this,Ah).zoomLevel}};Ah=new WeakMap,o(b8,"CameraTransform");var e_=b8;g();var Gv=class Gv{constructor(t){x(this,"id");x(this,"__type",Gv.__type);this.id=t}static is(t){return t.__type===Gv.__type}get focusTarget(){return this}};o(Gv,"Shape"),x(Gv,"__type","Shape");var Dh=Gv;g();var t_=class t_{constructor(t,r){x(this,"id");x(this,"target");x(this,"__type","Text3D");this.id=t,this.target=r}static is(t){return t.__type===t_.__type}};o(t_,"Text3D"),x(t_,"__type","Text3D");var Fh=t_;g();g();g();var DAe=new Map([["search-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M1 7C1 3.68629 3.68629 1 7 1C10.3137 1 13 3.68629 13 7C13 8.29583 12.5892 9.49572 11.8907 10.4765L15.4614 14.0472C15.6567 14.2425 15.6567 14.559 15.4614 14.7543L14.7543 15.4614C14.559 15.6567 14.2424 15.6567 14.0472 15.4614L10.4765 11.8907C9.49571 12.5892 8.29583 13 7 13C3.68629 13 1 10.3137 1 7ZM7 11C4.79086 11 3 9.20914 3 7C3 4.79086 4.79086 3 7 3C9.20914 3 11 4.79086 11 7C11 9.20914 9.20914 11 7 11Z"\n stroke="none"\n />\n </svg>'],["close-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M12.5963 1.98959C12.7916 1.79433 13.1082 1.79433 13.3034 1.98959L14.0105 2.6967C14.2058 2.89196 14.2058 3.20855 14.0105 3.40381L3.40392 14.0104C3.20866 14.2057 2.89208 14.2057 2.69682 14.0104L1.98971 13.3033C1.79445 13.108 1.79445 12.7915 1.98971 12.5962L12.5963 1.98959Z"\n stroke="none"\n />\n <path\n d="M1.98971 3.40381C1.79445 3.20855 1.79445 2.89196 1.98971 2.6967L2.69682 1.98959C2.89208 1.79433 3.20866 1.79433 3.40392 1.98959L14.0105 12.5962C14.2058 12.7915 14.2058 13.108 14.0105 13.3033L13.3034 14.0104C13.1082 14.2057 12.7916 14.2057 12.5963 14.0104L1.98971 3.40381Z"\n stroke="none"\n />\n </svg>'],["empty-64x40",'<svg viewBox="0 0 64 40">\n <g>\n <g clipPath="url(#clip0_499_175492)">\n <path\n d="M32 39.7032C49.6731 39.7032 64 36.5925 64 32.7552C64 28.9179 49.6731 25.8071 32 25.8071C14.3269 25.8071 0 28.9179 0 32.7552C0 36.5925 14.3269 39.7032 32 39.7032Z"\n stroke="none"\n fill="#F5F5F5"\n />\n <path\n d="M55 13.6653L44.854 2.24866C44.367 1.47048 43.656 1 42.907 1H21.093C20.344 1 19.633 1.47048 19.146 2.24767L9 13.6663V22.8367H55V13.6653Z"\n fill="none"\n />\n <path\n d="M41.613 16.8128C41.613 15.2197 42.607 13.9046 43.84 13.9036H55V31.9059C55 34.0132 53.68 35.7402 52.05 35.7402H11.95C10.32 35.7402 9 34.0122 9 31.9059V13.9036H20.16C21.393 13.9036 22.387 15.2167 22.387 16.8098V16.8317C22.387 18.4248 23.392 19.7111 24.624 19.7111H39.376C40.608 19.7111 41.613 18.4128 41.613 16.8198V16.8128Z"\n fill="#FAFAFA"\n />\n </g>\n <defs>\n <clipPath id="clip0_499_175492">\n <rect width="64" height="40" fill="white" />\n </clipPath>\n </defs>\n </g>\n </svg>'],["caret-12x12",'<svg viewBox="0 0 12 12">\n <path\n stroke="none"\n d="M8.38828 5.78337L3.92578 1.93493C3.75938 1.79196 3.51562 1.92087 3.51562 2.15173V9.84861C3.51562 10.0795 3.75938 10.2084 3.92578 10.0654L8.38828 6.21696C8.51602 6.10681 8.51602 5.89353 8.38828 5.78337Z"\n />\n </svg>'],["plus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M7.5 1C7.22386 1 7 1.22386 7 1.5V7H1.5C1.22386 7 1 7.22386 1 7.5L1 8.5C1 8.77614 1.22386 9 1.5 9H7V14.5C7 14.7761 7.22386 15 7.5 15H8.5C8.77614 15 9 14.7761 9 14.5V9H14.5C14.7761 9 15 8.77614 15 8.5V7.5C15 7.22386 14.7761 7 14.5 7H9V1.5C9 1.22386 8.77614 1 8.5 1H7.5Z"\n stroke="none"\n />\n </svg>'],["recenter-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M0 2.5C0 2.22386 0.223858 2 0.5 2H1.5C1.77614 2 2 2.22386 2 2.5V13.5C2 13.7761 1.77614 14 1.5 14H0.5C0.223858 14 0 13.7761 0 13.5V2.5Z" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M4.5 4C4.22386 4 4 4.22386 4 4.5V11.5C4 11.7761 4.22386 12 4.5 12H11.5C11.7761 12 12 11.7761 12 11.5V4.5C12 4.22386 11.7761 4 11.5 4H4.5ZM6 6V10H10V6H6Z"\n />\n <path d="M14.5 2C14.2239 2 14 2.22386 14 2.5V13.5C14 13.7761 14.2239 14 14.5 14H15.5C15.7761 14 16 13.7761 16 13.5V2.5C16 2.22386 15.7761 2 15.5 2H14.5Z" />\n </g>\n </svg>'],["minus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M1.5 9C1.22386 9 1 8.77614 1 8.5L1 7.5C1 7.22386 1.22386 7 1.5 7L14.5 7C14.7761 7 15 7.22386 15 7.5V8.5C15 8.77614 14.7761 9 14.5 9L1.5 9Z"\n stroke="none"\n />\n </svg>'],["logo-horizontal-206x48",'<svg viewBox="0 0 206 48">\n <path d="M27.2678 14.2261H22.3187C21.0695 14.2261 20.4695 14.7801 20.4695 15.9852V31.142L10.3966 15.5591C9.69665 14.4784 9.2475 14.2773 7.8475 14.2261H2.97462C1.67462 14.2261 1.07631 14.7801 1.07631 15.9852V44.7665C1.07631 45.9716 1.67462 46.5256 2.97462 46.5256H7.92377C9.22207 46.5256 9.82207 45.9716 9.82207 44.7665V29.6847L19.9441 45.1926C20.695 46.3244 21.095 46.5256 22.4933 46.5256H27.2933C28.5916 46.5256 29.1916 45.9716 29.1916 44.7665V15.9852C29.1407 14.7801 28.5424 14.2261 27.2678 14.2261Z" />\n <path d="M5.44915 10.9602C8.45863 10.9602 10.8983 8.50669 10.8983 5.48011C10.8983 2.45353 8.45863 0 5.44915 0C2.43967 0 0 2.45353 0 5.48011C0 8.50669 2.43967 10.9602 5.44915 10.9602Z" />\n <path d="M61.7899 25.0449C63.2306 23.1903 65.078 22.2051 67.556 22.2051C72.0526 22.2051 74.7611 25.3347 74.7611 29.4511V39.2489C74.8187 39.7125 74.5306 39.9443 74.0695 39.9443H72.5136C72.0526 39.9443 71.7645 39.7125 71.8221 39.2489V29.5091C71.8221 27.1909 69.9187 25.2187 67.4984 25.2187C65.1339 25.2187 63.2323 27.1329 63.2323 29.2773V39.2489C63.2899 39.7125 63.0018 39.9443 62.5407 39.9443H60.9831C60.5221 39.9443 60.2916 39.7125 60.2916 39.2489V29.4511C60.2916 27.1329 58.3899 25.2187 56.0255 25.2187C53.7204 25.2187 51.7594 27.075 51.7594 29.2773V39.3068C51.817 39.7705 51.5289 40.0023 51.0102 40.0023H49.5119C49.0509 40.0023 48.7628 39.7705 48.7628 39.3068V23.25C48.7051 22.7864 48.9933 22.4966 49.5119 22.4966H50.9526C51.356 22.4966 51.5289 22.6704 51.5289 23.0182V24.2352C52.7407 22.9602 54.239 22.2648 56.0255 22.2648C58.4475 22.2068 60.3492 23.192 61.7899 25.0466V25.0449ZM77.1255 31.2477C77.1255 26.3216 81.1018 22.2051 86.1187 22.2051C88.539 22.2051 90.6136 23.1903 92.3441 25.1608V23.1903C92.3441 22.7267 92.5746 22.5528 93.0357 22.5528H94.4187C94.8797 22.5528 95.1102 22.7847 95.1102 23.3062V39.3648C95.1102 39.8284 94.8797 40.0602 94.4187 40.0602H93.0357C92.5746 40.0602 92.3441 39.8284 92.3441 39.4227V37.4523C90.6712 39.3648 88.5967 40.35 86.1746 40.35C81.1018 40.2341 77.1238 36.1773 77.1238 31.2477H77.1255ZM92.1136 31.2477C92.1136 27.8284 89.4611 25.2187 86.0594 25.2187C82.7746 25.2187 80.1221 27.8864 80.1221 31.2477C80.1221 34.6687 82.7746 37.2784 86.1187 37.2784C86.9062 37.2789 87.6861 37.1232 88.4138 36.8202C89.1414 36.5173 89.8026 36.0731 90.3593 35.513C90.9161 34.9528 91.3577 34.2878 91.6587 33.556C91.9597 32.8241 92.1143 32.0397 92.1136 31.2477ZM100.992 37.3943V46.3807C101.049 46.8443 100.761 47.1341 100.298 47.1341H98.7424C98.2814 47.1341 97.9933 46.9023 97.9933 46.3807V23.1903C97.9933 22.7267 98.2238 22.4369 98.7424 22.4369H100.183C100.646 22.379 100.934 22.6687 100.934 23.0744V24.9869C102.605 23.0744 104.68 22.1472 107.044 22.1472C112.002 22.1472 116.037 26.2619 116.037 31.1898C116.037 36.1176 112.059 40.2341 107.044 40.2341C104.622 40.2341 102.603 39.3068 100.992 37.3943ZM106.987 25.2187C103.7 25.2187 101.049 27.8864 101.049 31.2477C101.049 34.6687 103.7 37.2784 107.044 37.2784C110.446 37.2784 113.039 34.6108 113.039 31.2477C113.039 27.8864 110.388 25.2187 106.987 25.2187ZM121.11 37.3943V46.3807C121.168 46.8443 120.88 47.1341 120.419 47.1341H118.861C118.4 47.1341 118.112 46.9023 118.112 46.3807V23.1903C118.112 22.7267 118.342 22.4369 118.861 22.4369H120.302C120.764 22.379 121.053 22.6687 121.053 23.0744V24.9869C122.724 23.0744 124.798 22.1472 127.163 22.1472C132.12 22.1472 136.156 26.2619 136.156 31.1898C136.156 36.1176 132.178 40.2341 127.163 40.2341C124.742 40.2341 122.781 39.3068 121.11 37.3943ZM127.105 25.2187C123.819 25.2187 121.168 27.8864 121.168 31.2477C121.168 34.6687 123.819 37.2784 127.163 37.2784C130.564 37.2784 133.158 34.6108 133.158 31.2477C133.158 27.8864 130.507 25.2187 127.107 25.2187H127.105ZM153.97 32.3506H141.054C141.342 35.2483 143.995 37.4523 147.164 37.4523C148.893 37.4523 150.393 37.0466 151.719 36.0597C152.007 35.8858 152.295 35.7699 152.353 35.7699C152.583 35.7699 152.756 35.8858 152.929 36.1773L153.505 37.1625C153.622 37.3364 153.68 37.4523 153.68 37.5682C153.68 37.8 153.507 38.0318 153.103 38.3216C151.258 39.5966 149.183 40.292 146.992 40.292C141.688 40.292 137.883 36.3511 137.883 31.2477C137.883 26.204 141.803 22.2051 146.703 22.2051C151.546 22.2051 154.717 25.7983 154.717 31.0176C154.717 31.5972 154.717 32.3506 153.968 32.3506H153.97ZM141.056 30.0324H151.72C151.432 26.8432 149.473 24.929 146.648 24.929C145.241 24.8904 143.875 25.3995 142.833 26.3501C141.791 27.3007 141.154 28.6194 141.056 30.0307V30.0324ZM156.332 31.2477C156.332 26.3216 160.31 22.2051 165.326 22.2051C167.748 22.2051 169.707 23.1324 171.32 25.0449V16.2324C171.263 15.7687 171.551 15.479 172.012 15.479H173.57C174.031 15.479 174.319 15.7108 174.319 16.2324V39.3068C174.319 39.7705 174.088 40.0023 173.57 40.0023H172.129C171.666 40.0602 171.378 39.7705 171.378 39.3648V37.3943C169.649 39.3068 167.632 40.292 165.268 40.292C160.31 40.2341 156.332 36.1773 156.332 31.2477ZM171.264 31.2477C171.264 27.8284 168.612 25.2187 165.21 25.2187C161.924 25.2187 159.273 27.8864 159.273 31.2477C159.273 34.6687 161.924 37.2784 165.268 37.2784C166.057 37.2838 166.839 37.1316 167.569 36.8304C168.299 36.5292 168.962 36.0852 169.52 35.5241C170.077 34.963 170.519 34.296 170.818 33.5619C171.117 32.8277 171.268 32.0411 171.263 31.2477H171.264ZM177.72 19.0739C177.715 18.8594 177.754 18.646 177.833 18.4468C177.912 18.2476 178.031 18.0667 178.182 17.915C178.333 17.7633 178.512 17.6439 178.71 17.5642C178.909 17.4845 179.121 17.446 179.334 17.4511C179.546 17.4507 179.756 17.4923 179.952 17.5737C180.148 17.6551 180.326 17.7746 180.476 17.9254C180.626 18.0762 180.745 18.2553 180.826 18.4523C180.907 18.6494 180.948 18.8606 180.948 19.0739C180.953 19.2884 180.914 19.5017 180.835 19.7009C180.756 19.9001 180.637 20.081 180.486 20.2327C180.335 20.3845 180.156 20.5038 179.957 20.5835C179.759 20.6633 179.547 20.7017 179.334 20.6966C178.412 20.7545 177.72 20.0591 177.72 19.0739ZM177.836 39.2489V23.1903C177.836 22.7267 178.066 22.4369 178.527 22.4369H180.083C180.544 22.4369 180.832 22.6687 180.775 23.1903V39.2489C180.832 39.7125 180.544 39.9443 180.083 39.9443H178.527C178.066 39.9443 177.836 39.7125 177.836 39.2489ZM186.944 23.0165V24.1756C188.212 22.8426 189.71 22.2051 191.497 22.2051C195.937 22.2051 198.646 25.2767 198.646 29.3932V39.2489C198.703 39.7125 198.415 39.9443 197.954 39.9443H196.398C195.936 39.9443 195.705 39.7125 195.705 39.2489V29.4511C195.705 27.1329 193.803 25.2187 191.439 25.2187C189.134 25.2187 187.175 27.075 187.175 29.2773V39.3068C187.232 39.7705 186.944 40.0023 186.424 40.0023H184.868C184.407 40.0023 184.119 39.7705 184.119 39.3068V23.1903C184.061 22.7267 184.349 22.4949 184.868 22.4949H186.309C186.712 22.4949 186.944 22.6687 186.944 23.0165Z" />\n <path d="M204 40C205.115 40 206 39.0857 206 38V37.9886C206 36.9029 205.126 36 204 36C202.885 36 202 36.9143 202 38V38.0114C202 39.0971 202.874 40 204 40ZM204 39.7829C202.989 39.7829 202.23 38.9829 202.23 38.0114V38C202.23 37.0286 203 36.2171 204 36.2171C205.011 36.2171 205.77 37.0171 205.77 37.9886V38C205.77 38.9714 205 39.7829 204 39.7829ZM203.218 38.9714H203.609V38.2743H204.034L204.517 38.9714H204.989L204.448 38.2057C204.724 38.1257 204.92 37.92 204.92 37.5886C204.92 37.1657 204.586 36.9486 204.138 36.9486H203.218V38.9714ZM203.609 37.9543V37.2914H204.103C204.368 37.2914 204.517 37.4057 204.517 37.6229C204.517 37.8171 204.368 37.9543 204.103 37.9543H203.609Z" />\n </svg>'],["share-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M13 6C14.6569 6 16 4.65685 16 3C16 1.34315 14.6569 0 13 0C11.3431 0 10 1.34315 10 3C10 3.13463 10.0089 3.26719 10.0261 3.39712L6.82972 5.17286C6.10576 4.44825 5.10523 4 4 4C1.79086 4 0 5.79086 0 8C0 10.2091 1.79086 12 4 12C5.10523 12 6.10576 11.5518 6.82972 10.8271L10.0261 12.6029C10.0089 12.7328 10 12.8654 10 13C10 14.6569 11.3431 16 13 16C14.6569 16 16 14.6569 16 13C16 11.3431 14.6569 10 13 10C12.2011 10 11.4752 10.3123 10.9376 10.8214L7.84579 9.1037C7.94622 8.75313 8 8.38284 8 8C8 7.61716 7.94622 7.24687 7.84579 6.8963L10.9376 5.17864C11.4752 5.68775 12.2011 6 13 6ZM13 4C13.5523 4 14 3.55228 14 3C14 2.44772 13.5523 2 13 2C12.4477 2 12 2.44772 12 3C12 3.55228 12.4477 4 13 4ZM4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10ZM14 13C14 13.5523 13.5523 14 13 14C12.4477 14 12 13.5523 12 13C12 12.4477 12.4477 12 13 12C13.5523 12 14 12.4477 14 13Z"\n stroke="none"\n />\n </svg>'],["checkmark-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M15.387 3.31662C15.6008 3.49148 15.6323 3.80649 15.4574 4.02021L6.77402 14.6332C6.58509 14.8642 6.30292 14.9986 6.00457 15C5.70622 15.0013 5.42285 14.8694 5.23184 14.6402L0.551937 9.02429C0.375155 8.81215 0.403817 8.49687 0.615956 8.32009L1.38418 7.67991C1.59632 7.50312 1.9116 7.53179 2.08838 7.74392L5.99299 12.4295L13.9095 2.75374C14.0844 2.54002 14.3994 2.50852 14.6131 2.68338L15.387 3.31662Z"\n stroke="none"\n />\n </svg>'],["arrow-right-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.35355 1.64645C8.54881 1.45118 8.8654 1.45118 9.06066 1.64645L14.7071 7.29289C15.0976 7.68342 15.0976 8.31658 14.7071 8.70711L9.06066 14.3536C8.8654 14.5488 8.54882 14.5488 8.35355 14.3536L7.64645 13.6464C7.45118 13.4512 7.45118 13.1346 7.64645 12.9393L11.5858 9H0.5C0.223858 9 0 8.77614 0 8.5V7.5C0 7.22386 0.223858 7 0.5 7H11.5858L7.64645 3.06066C7.45118 2.8654 7.45118 2.54882 7.64645 2.35355L8.35355 1.64645Z"\n stroke="none"\n />\n </svg>'],["arrow-up-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M1 11.5C1 11.2239 1.22386 11 1.5 11H6V13.5C6 13.7761 5.77614 14 5.5 14H1.5C1.22386 14 1 13.7761 1 13.5V11.5Z" />\n <path d="M4 8.5C4 8.22386 4.22386 8 4.5 8H9V10.5C9 10.7761 8.77614 11 8.5 11H4V8.5Z" />\n <path d="M7 5.5C7 5.22386 7.22386 5 7.5 5H12V7.5C12 7.77614 11.7761 8 11.5 8H7V5.5Z" />\n <path d="M10 2.5C10 2.22386 10.2239 2 10.5 2H14.5C14.7761 2 15 2.22386 15 2.5V4.5C15 4.77614 14.7761 5 14.5 5H10V2.5Z" />\n </g>\n </svg>'],["connection-stairs-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.25 12H2.5C2.225 12 2 11.7429 2 11.4286C2 11.1143 2.225 10.8571 2.5 10.8571H4.25V7.91429H6.5V4.94286H8.75V2H11.5C11.775 2 12 2.25714 12 2.57143C12 2.88571 11.775 3.14286 11.5 3.14286H9.75V6.08571H7.5V9.02857H5.25V12Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path d="M1.625 8.1875C1.625 8.01491 1.76491 7.875 1.9375 7.875H4.75V9.4375C4.75 9.61009 4.61009 9.75 4.4375 9.75H1.9375C1.76491 9.75 1.625 9.61009 1.625 9.4375V8.1875Z" />\n <path d="M3.5 6.3125C3.5 6.13991 3.63991 6 3.8125 6H6.625V7.5625C6.625 7.73509 6.48509 7.875 6.3125 7.875H3.5V6.3125Z" />\n <path d="M5.375 4.4375C5.375 4.26491 5.51491 4.125 5.6875 4.125H8.5V5.6875C8.5 5.86009 8.36009 6 8.1875 6H5.375V4.4375Z" />\n <path d="M7.25 2.5625C7.25 2.38991 7.38991 2.25 7.5625 2.25H10.0625C10.2351 2.25 10.375 2.38991 10.375 2.5625V3.8125C10.375 3.98509 10.2351 4.125 10.0625 4.125H7.25V2.5625Z" />\n </svg>'],["connection-escalator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3.63008 12H2C0.895431 12 0 12.8954 0 14C0 15.1046 0.89543 16 2 16H4.63008C4.86879 16 5.09962 15.9146 5.28087 15.7593L11.7191 10.2407C11.9004 10.0854 12.1312 10 12.3699 10H14C15.1046 10 16 9.10457 16 8C16 6.89543 15.1046 6 14 6H11.3699C11.1312 6 10.9004 6.08539 10.7191 6.24074L4.28087 11.7593C4.09962 11.9146 3.86879 12 3.63008 12Z" />\n <path d="M5 6C5 4.89543 5.89543 4 7 4C8.10457 4 9 4.89543 9 6L5 9.5V6Z" />\n <path d="M9 2C9 3.10457 8.10457 4 7 4C5.89543 4 5 3.10457 5 2C5 0.89543 5.89543 0 7 0C8.10457 0 9 0.89543 9 2Z" />\n </g>\n </svg>'],["connection-escalator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.26686 2.98522C5.26686 2.44335 5.71573 2 6.26436 2C6.81299 2 7.26187 2.44335 7.26187 2.98522C7.26187 3.5271 6.81299 3.97045 6.26436 3.97045C5.71573 3.97045 5.26686 3.50246 5.26686 2.98522Z"\n stroke="none"\n />\n <path\n d="M7.26188 5.48588V5.25125C7.26188 4.85716 6.91275 4.53696 6.48881 4.53696H6.03993C5.61599 4.53696 5.26687 4.88179 5.26687 5.25125V7.66458L4.3192 8.6995H3.67082C2.74813 8.6995 2 9.43842 2 10.3498C2 11.2611 2.74813 12 3.67082 12H4.61845C5.36658 12 6.11471 11.6798 6.61347 11.1133L9.6808 7.76354H10.3292C11.2519 7.76354 12 7.02463 12 6.11329C12 5.20196 11.2519 4.46305 10.3292 4.46305H9.38155C8.60848 4.46305 7.88529 4.78324 7.38653 5.34975L7.26188 5.48588ZM4.61846 11.0148H3.67083C3.29677 11.0148 2.99751 10.7192 2.99751 10.3498C2.99751 9.9803 3.29677 9.68473 3.67083 9.68473H4.61846C4.71821 9.68473 4.81796 9.63547 4.86784 9.56158L8.13467 5.99015C8.45886 5.64532 8.90774 5.44828 9.38155 5.44828H10.3292C10.7032 5.44828 11.0025 5.74384 11.0025 6.1133C11.0025 6.48276 10.7032 6.77833 10.3292 6.77833H9.38155C9.2818 6.77833 9.18205 6.82759 9.13218 6.87685L5.86534 10.4729C5.54115 10.8177 5.09228 11.0148 4.61846 11.0148Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3 5.5C3 6.32843 2.32843 7 1.5 7C0.671573 7 0 6.32843 0 5.5C0 4.67157 0.671573 4 1.5 4C2.32843 4 3 4.67157 3 5.5Z" />\n <path d="M3 10.5C3 11.3284 2.32843 12 1.5 12C0.671573 12 0 11.3284 0 10.5C0 9.67157 0.671573 9 1.5 9C2.32843 9 3 9.67157 3 10.5Z" />\n <path d="M11 1H14C14.5523 1 15 1.44772 15 2V14C15 14.5523 14.5523 15 14 15H11V1Z" />\n <path d="M9 1H6C5.44772 1 5 1.44772 5 2V14C5 14.5523 5.44772 15 6 15H9V1Z" />\n </g>\n </svg>'],["connection-elevator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M7.476 2H2.72693C1.77095 2 1 2.72464 1 3.62319V10.3768C1 11.2754 1.77095 12 2.72693 12H7.476C8.43198 12 9.20293 11.2754 9.20293 10.3768V3.62319C9.17209 2.72464 8.40114 2 7.476 2ZM7.476 3.15942C7.75354 3.15942 7.96941 3.36232 7.96941 3.62319V10.3768C7.96941 10.6377 7.75354 10.8406 7.476 10.8406H5.71824V3.15942H7.476ZM4.48472 3.15942V10.8406H2.72693C2.44939 10.8406 2.23352 10.6377 2.23352 10.3768V3.62319C2.23352 3.36232 2.44939 3.15942 2.72693 3.15942H4.48472Z"\n stroke="none"\n />\n <path\n d="M12.4643 6.19064H10.6638C10.4456 6.19064 10.2546 6.06243 10.1728 5.88294C10.0909 5.70346 10.1455 5.47269 10.2819 5.31884L11.1821 4.47269C11.4004 4.26756 11.755 4.26756 11.946 4.47269L12.8462 5.31884C13.0099 5.47269 13.0371 5.67781 12.9553 5.88294C12.8735 6.08807 12.6825 6.19064 12.4643 6.19064Z"\n stroke="none"\n />\n <path\n d="M11.564 9.65216C11.4276 9.65216 11.2912 9.60088 11.1821 9.49831L10.2819 8.65216C10.1182 8.49831 10.0909 8.29319 10.1728 8.08806C10.2546 7.90857 10.4456 7.78036 10.6638 7.78036H12.4643C12.6825 7.78036 12.8735 7.90857 12.9553 8.08806C13.0371 8.26754 12.9826 8.49831 12.8462 8.65216L11.9459 9.49831C11.8641 9.60088 11.7004 9.65216 11.564 9.65216Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <circle cx="1.9375" cy="4.4375" r="0.9375" />\n <circle cx="1.9375" cy="7.5625" r="0.9375" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M7.6 2H9.4C9.73137 2 10 2.26863 10 2.6V9.41328C10 9.74465 9.73137 10.0133 9.4 10.0133H7.6V2ZM6.4 2H4.6C4.26863 2 4 2.26863 4 2.6V9.41328C4 9.74465 4.26863 10.0133 4.6 10.0133H6.4V2Z"\n />\n </svg>'],["new-tab-14x14",'<svg viewBox="0 0 14 14">\n <g stroke="none">\n <path d="M2.625 2.625H5.6875C5.92913 2.625 6.125 2.42912 6.125 2.1875V1.3125C6.125 1.07088 5.92913 0.875 5.6875 0.875H1.3125C1.07088 0.875 0.875 1.07088 0.875 1.3125V12.6875C0.875 12.9291 1.07088 13.125 1.3125 13.125H12.6875C12.9291 13.125 13.125 12.9291 13.125 12.6875V8.3125C13.125 8.07088 12.9291 7.875 12.6875 7.875H11.8125C11.5709 7.875 11.375 8.07088 11.375 8.3125V11.375H2.625V2.625Z" />\n <path d="M12.9063 0.875H8.40311C8.20822 0.875 8.11063 1.11062 8.24843 1.24843L9.88124 2.88124L5.8156 6.94688C5.64475 7.11774 5.64475 7.39475 5.8156 7.5656L6.43432 8.18432C6.60517 8.35517 6.88218 8.35517 7.05304 8.18432L11.1187 4.11868L12.7516 5.75157C12.8894 5.88938 13.125 5.79178 13.125 5.59689V1.09375C13.125 0.972938 13.0271 0.875 12.9063 0.875Z" />\n </g>\n </svg>'],["compress-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path\n id="Vector"\n d="M4.67773 10.7154H0.713449C0.556306 10.7154 0.427734 10.844 0.427734 11.0011V11.8583C0.427734 12.0154 0.556306 12.144 0.713449 12.144H3.82059V15.2868C3.82059 15.444 3.94916 15.5725 4.10631 15.5725H4.96345C5.12059 15.5725 5.24916 15.444 5.24916 15.2868V11.2868C5.24916 10.9708 4.99381 10.7154 4.67773 10.7154ZM4.96345 0.429688H4.10631C3.94916 0.429688 3.82059 0.558259 3.82059 0.715402V3.85826H0.713449C0.556306 3.85826 0.427734 3.98683 0.427734 4.14397V5.00112C0.427734 5.15826 0.556306 5.28683 0.713449 5.28683H4.67773C4.99381 5.28683 5.24916 5.03147 5.24916 4.7154V0.715402C5.24916 0.558259 5.12059 0.429688 4.96345 0.429688ZM15.2849 10.7154H11.3206C11.0045 10.7154 10.7492 10.9708 10.7492 11.2868V15.2868C10.7492 15.444 10.8777 15.5725 11.0349 15.5725H11.892C12.0492 15.5725 12.1777 15.444 12.1777 15.2868V12.144H15.2849C15.442 12.144 15.5706 12.0154 15.5706 11.8583V11.0011C15.5706 10.844 15.442 10.7154 15.2849 10.7154ZM15.2849 3.85826H12.1777V0.715402C12.1777 0.558259 12.0492 0.429688 11.892 0.429688H11.0349C10.8777 0.429688 10.7492 0.558259 10.7492 0.715402V4.7154C10.7492 5.03147 11.0045 5.28683 11.3206 5.28683H15.2849C15.442 5.28683 15.5706 5.15826 15.5706 5.00112V4.14397C15.5706 3.98683 15.442 3.85826 15.2849 3.85826Z"\n />\n </g>\n </svg>'],["washroom-14x14",'<svg viewBox="0 0 14 14" stroke="none">\n <path d="M4.55125 3.09062C4.55125 3.69326 4.07639 4.18176 3.49058 4.18176C2.90525 4.18176 2.43039 3.69326 2.43039 3.09062C2.43039 2.4885 2.90525 2 3.49058 2C4.07639 2 4.55125 2.4885 4.55125 3.09062Z" />\n <path d="M5.1193 5.48047C4.81653 4.83116 4.17252 4.41571 3.47822 4.41571C2.78392 4.41571 2.13986 4.83116 1.83714 5.48047L1.04175 7.22034C0.940664 7.441 1.02893 7.70073 1.24393 7.81791C1.47077 7.90871 1.72324 7.81791 1.82433 7.59725L2.49349 6.15554L2.21587 11.4407C2.20305 11.7263 2.41805 11.9734 2.69567 11.9993C2.97329 12.0124 3.21344 11.7913 3.23859 11.5057L3.4028 8.285H3.567L3.73121 11.5057C3.74403 11.7913 3.97086 11.9993 4.23616 11.9993H4.26131C4.53893 11.9861 4.75343 11.7395 4.74111 11.4407L4.46349 6.15554L5.13265 7.59725C5.20858 7.75298 5.35997 7.85697 5.52418 7.85697C5.5873 7.85697 5.65042 7.84379 5.71354 7.81792C5.92804 7.71393 6.0163 7.44153 5.91572 7.22035L5.1193 5.48047Z" />\n <path d="M12.9582 7.22034L12.1505 5.48047C11.8477 4.83116 11.2037 4.41571 10.5094 4.41571C9.81513 4.41571 9.17107 4.83116 8.86836 5.48047L8.06064 7.22034C7.95955 7.441 8.04782 7.70073 8.26282 7.81791C8.47732 7.9219 8.7298 7.8311 8.84371 7.60993L9.52519 6.12977L9.46207 7.2204L8.57842 8.92184C8.47733 9.11663 8.61638 9.36316 8.83089 9.36316H9.33584L9.22242 11.4668C9.2096 11.7397 9.41177 11.9862 9.68939 11.9994C9.95469 12.0126 10.1943 11.8046 10.2072 11.519L10.3581 9.33723H10.6737L10.7871 11.5058C10.7999 11.7787 11.0144 11.9862 11.2792 11.9862H11.3043C11.5696 11.973 11.7841 11.7396 11.7713 11.4535L11.6579 9.33718H12.1628C12.3773 9.33718 12.5287 9.09066 12.4153 8.89586L11.5317 7.19442L11.4685 6.1038L12.1757 7.5972C12.2516 7.75293 12.403 7.85692 12.5672 7.85692C12.6303 7.85692 12.6934 7.84373 12.7566 7.81786C12.9711 7.70068 13.0593 7.44102 12.9582 7.22034Z" />\n <path d="M11.5696 3.09062C11.5696 3.69326 11.0948 4.18176 10.5094 4.18176C9.92363 4.18176 9.44876 3.69326 9.44876 3.09062C9.44876 2.4885 9.92363 2 10.5094 2C11.0948 2 11.5696 2.4885 11.5696 3.09062Z" />\n <path d="M6.99996 2.00006C6.76031 2.00006 6.57095 2.19485 6.57095 2.44138V11.5575C6.57095 11.804 6.76031 11.9988 6.99996 11.9988C7.2396 11.9988 7.42896 11.804 7.42896 11.5575V2.44138C7.42896 2.19485 7.2396 2.00006 6.99996 2.00006Z" />\n </svg>'],["point-of-interest-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path\n stroke="none"\n id="Subtract"\n // Do not change these to fillRule or clipRule, since they need to be rendered as actual SVGs in labels, not React SVGs\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M6.24724 10.7516C7.94597 9.0358 9.85962 6.89195 9.85962 4.85965C9.85962 2.72802 8.13159 1 5.99997 1C3.86834 1 2.14032 2.72802 2.14032 4.85965C2.14032 6.89195 4.05397 9.0358 5.7527 10.7516C5.88904 10.8893 6.1109 10.8893 6.24724 10.7516ZM5.99994 6.26317C6.77508 6.26317 7.40345 5.6348 7.40345 4.85967C7.40345 4.08453 6.77508 3.45616 5.99994 3.45616C5.22481 3.45616 4.59644 4.08453 4.59644 4.85967C4.59644 5.6348 5.22481 6.26317 5.99994 6.26317Z"\n />\n </svg>'],["flag-20x20",'<svg viewBox="0 0 20 20" stroke="none">\n <path\n d="M16.9987 4.27111C16.936 5.06715 16.3836 5.93162 15.5238 6.57845C14.7549 7.15682 13.0885 8.04927 10.5434 7.55174C8.32167 7.1164 6.82156 8.02129 6.08085 10.2416L8.24615 17.3998C8.31833 17.6471 8.17711 17.9059 7.9292 17.9813C7.88527 17.9938 7.83976 18 7.79426 18C7.58634 18 7.40277 17.8647 7.34236 17.6673L5.1644 10.4686C5.13773 10.4173 5.12125 10.3613 5.11419 10.3038L3.41956 4.70042C3.38112 4.63512 3.35994 4.56127 3.3568 4.48587L3.02101 3.37886C2.98413 3.25992 2.9959 3.13165 3.05553 3.02203C3.11437 2.91242 3.21479 2.83079 3.33482 2.79504C3.45564 2.75928 3.5851 2.7725 3.69494 2.83235C3.80477 2.89144 3.88637 2.99172 3.92167 3.11143L3.9813 3.31355C4.38847 2.85956 4.90472 2.51439 5.48136 2.30915C6.97201 1.75566 8.95216 1.95467 10.6469 2.83156C11.6888 3.36951 14.3374 4.54493 16.3647 3.79553C16.5154 3.74111 16.684 3.76599 16.8127 3.86239C16.9406 3.95879 17.0105 4.11251 16.9987 4.27111Z"\n stroke="none"\n />\n </svg>'],["link-16x16",'<svg viewBox="0 0 16 16" stroke="none">\n <path\n d="M9.10678 11.2433C9.07993 11.2167 9.04367 11.2018 9.00589 11.2018C8.9681 11.2018 8.93184 11.2167 8.90499 11.2433L6.82999 13.3183C5.86928 14.279 4.24785 14.3808 3.18714 13.3183C2.12464 12.2558 2.22642 10.6362 3.18714 9.67546L5.26214 7.60046C5.31749 7.5451 5.31749 7.45403 5.26214 7.39868L4.55142 6.68796C4.52457 6.66138 4.48832 6.64646 4.45053 6.64646C4.41274 6.64646 4.37649 6.66138 4.34964 6.68796L2.27464 8.76296C0.763923 10.2737 0.763923 12.7183 2.27464 14.2272C3.78535 15.7362 6.22999 15.738 7.73892 14.2272L9.81392 12.1522C9.86928 12.0969 9.86928 12.0058 9.81392 11.9505L9.10678 11.2433ZM13.7246 2.77903C12.2139 1.26832 9.76928 1.26832 8.26035 2.77903L6.18357 4.85403C6.15698 4.88088 6.14207 4.91714 6.14207 4.95493C6.14207 4.99271 6.15698 5.02897 6.18357 5.05582L6.89249 5.76475C6.94785 5.8201 7.03892 5.8201 7.09428 5.76475L9.16928 3.68975C10.13 2.72903 11.7514 2.62725 12.8121 3.68975C13.8746 4.75225 13.7729 6.37189 12.8121 7.3326L10.7371 9.4076C10.7106 9.43445 10.6956 9.47071 10.6956 9.5085C10.6956 9.54628 10.7106 9.58254 10.7371 9.60939L11.4479 10.3201C11.5032 10.3755 11.5943 10.3755 11.6496 10.3201L13.7246 8.2451C15.2336 6.73439 15.2336 4.28975 13.7246 2.77903ZM9.75142 6.00939C9.72457 5.9828 9.68832 5.96789 9.65053 5.96789C9.61275 5.96789 9.57649 5.9828 9.54964 6.00939L5.50499 10.0522C5.47841 10.0791 5.46349 10.1154 5.46349 10.1531C5.46349 10.1909 5.47841 10.2272 5.50499 10.254L6.21214 10.9612C6.26749 11.0165 6.35857 11.0165 6.41392 10.9612L10.4568 6.91832C10.5121 6.86296 10.5121 6.77189 10.4568 6.71653L9.75142 6.00939Z"\n stroke="none"\n />\n </svg>']]),FAe=/<svg([^>]*)>/g;function hoe(e,t,r){let n=DAe.get(e);return n?n.replace(FAe,'<svg$1 style="fill:'.concat(t,"; width:").concat(r,"px; height:").concat(r,'px">')):""}o(hoe,"getStyledIcon");var NAe=o(e=>'\n <div class="pin-shadow" style="background: '.concat(e,'"></div>\n <svg width="').concat(20*.9,'px" height="').concat(48*.9,'px" viewBox="0 0 20 48">\n <path\n d="M1.37965 29.3246C1.5778 31.2167 2.27661 33.0694 3.83078 33.775C4.0998 37.1861 4.7451 40.2227 5.65918 42.4784C6.14556 43.6787 6.72883 44.71 7.41453 45.4578C8.10027 46.2056 8.97065 46.7527 9.99989 46.7527C11.0292 46.7527 11.8995 46.2055 12.585 45.4576C13.2706 44.7098 13.8536 43.6785 14.3398 42.4783C15.2536 40.2226 15.8988 37.186 16.1688 33.7752C17.7232 33.0697 18.422 31.2169 18.6201 29.3247C18.8386 27.2385 18.5165 24.6502 17.6475 22.0285L17.6473 22.0278C16.9657 19.9761 16.0319 18.1622 14.9848 16.7474C17.0884 15.1587 18.4471 12.5964 18.4471 9.7152C18.4471 4.93539 14.6967 1 9.99966 1C5.30272 1 1.54993 4.93527 1.54993 9.7152C1.54993 12.5961 2.90839 15.1583 5.01167 16.747C3.9635 18.1625 3.03185 19.977 2.3522 22.0286C1.48319 24.6503 1.16118 27.2385 1.37965 29.3246Z"\n fill="').concat(e,'"\n stroke="white"\n strokeWidth="2"\n />\n </svg>\n '),"getDeparturePin"),kAe=o(e=>'\n <div class="pin-shadow" style="background: '.concat(e,'"></div>\n <svg width="36" height="42" viewBox="-2 -2 40 46">\n <path\n d="M35.8372 5.86776C35.6765 7.92448 34.2625 10.158 32.0612 11.8292C30.0929 13.3235 25.8269 15.6292 19.3114 14.3438C13.6237 13.219 9.78333 15.5569 7.88708 21.2934L13.4303 39.7879C13.6151 40.4267 13.2536 41.0955 12.6189 41.2903C12.5064 41.3225 12.39 41.3385 12.2735 41.3385C11.7412 41.3385 11.2712 40.989 11.1166 40.4789L5.54093 21.88C5.47265 21.7474 5.43047 21.6028 5.41239 21.4542L1.07409 6.97696C0.975678 6.80825 0.921449 6.61744 0.913417 6.42263L0.053779 3.56251C-0.0406172 3.2552 -0.0104927 2.92379 0.142154 2.64058C0.29279 2.35738 0.549874 2.14649 0.857157 2.05411C1.16646 1.96172 1.49786 1.99587 1.77906 2.15052C2.06025 2.30317 2.26912 2.56226 2.35951 2.87155L2.51215 3.39375C3.55453 2.22081 4.87615 1.32902 6.35237 0.798742C10.1685 -0.631292 15.2377 -0.117113 19.5763 2.14846C22.2435 3.53834 29.0241 6.57524 34.2141 4.63904C34.5998 4.49845 35.0316 4.56272 35.361 4.81178C35.6884 5.06083 35.8673 5.45801 35.8372 5.86776Z"\n fill="none"\n stroke="white"\n strokeWidth="4"\n />\n <path\n d="M35.8372 5.86776C35.6765 7.92448 34.2625 10.158 32.0612 11.8292C30.0929 13.3235 25.8269 15.6292 19.3114 14.3438C13.6237 13.219 9.78333 15.5569 7.88708 21.2934L13.4303 39.7879C13.6151 40.4267 13.2536 41.0955 12.6189 41.2903C12.5064 41.3225 12.39 41.3385 12.2735 41.3385C11.7412 41.3385 11.2712 40.989 11.1166 40.4789L5.54093 21.88C5.47265 21.7474 5.43047 21.6028 5.41239 21.4542L1.07409 6.97696C0.975678 6.80825 0.921449 6.61744 0.913417 6.42263L0.053779 3.56251C-0.0406172 3.2552 -0.0104927 2.92379 0.142154 2.64058C0.29279 2.35738 0.549874 2.14649 0.857157 2.05411C1.16646 1.96172 1.49786 1.99587 1.77906 2.15052C2.06025 2.30317 2.26912 2.56226 2.35951 2.87155L2.51215 3.39375C3.55453 2.22081 4.87615 1.32902 6.35237 0.798742C10.1685 -0.631292 15.2377 -0.117113 19.5763 2.14846C22.2435 3.53834 29.0241 6.57524 34.2141 4.63904C34.5998 4.49845 35.0316 4.56272 35.361 4.81178C35.6884 5.06083 35.8673 5.45801 35.8372 5.86776Z"\n fill="').concat(e,'"\n />\n </svg>\n '),"getDestinationPin"),x8="#722ED1",I8="#1890FF",moe=o(({type:e="departure",color:t=I8})=>'<div class="dropped-pin-wrapper">\n '.concat(e==="departure"?NAe(t):kAe(t),"\n </div>"),"DroppedPin"),RAe=o(e=>{switch(e){case"default":return 28;case"selection":return 28;case"navigation":return 32}},"getSize"),goe=o(({type:e="stairs",color:t=x8,direction:r="up"})=>{let n=RAe("default"),i=n/2+2,s=r&&r!=="none";return'<div class="mappedin-connection-marker">\n <div class="connection-circle"\n role="button"\n style="background:'.concat(t,"; width:").concat(n,"px; height:").concat(n,'px;"\n >\n ').concat(hoe("connection-"+e+"-16x16","white",i)||"","\n </div>\n ").concat(s?'<div style="margin-left: -'.concat(n*.2,'px;">\n <div class="bouncey">\n <div class="connection-circle"\n role="button"\n style="width: ').concat(n,"px; height: ").concat(n,'px;">\n <div class="').concat(r==="up"?"":"arrow--down",'">\n <svg viewBox="0 0 16 16" style="fill: white; width: ').concat(i,"px; height: ").concat(i,'px">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>\n </div>\n </div>\n </div>\n </div>'):"","\n </div>")},"ConnectionMarker");g();var yoe=o(async e=>new Promise(t=>setTimeout(t,e)),"ms");var BAe={drawDuration:1e3,color:"#40A9FF",interactive:!1,accentColor:"blue",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},$Ae={drawDuration:1e3,color:"#B3DDFF",interactive:!1,accentColor:"#40A9FF",nearRadius:.25,farRadius:.25*4,displayArrowsOnPath:!1,animateArrowsOnPath:!1},Nh={setMapOnConnectionClick:!0,setMapToDeparture:!0,createMarkers:{departure:!0,destination:!0,connection:!0},pathOptions:BAe,inactivePathOptions:$Ae,markerOptions:{departureColor:I8,destinationColor:x8},animatePathDrawing:!0},td,oc,rd,Wr,n_,nd,xy,vo,sc,za,ac,kh,qi,voe,boe,_8,$T,Uv,S8,Vv,C8=class C8{constructor(t,r,n){G(this,qi);G(this,td,new Map);G(this,oc);G(this,rd);G(this,Wr,Nh);G(this,n_);G(this,nd);G(this,xy);G(this,vo,[]);G(this,sc);G(this,za,new Map);G(this,ac,new Map);G(this,kh,new Map);G(this,Vv,o(t=>{var r;if((r=d(this,Wr).createMarkers)!=null&&r.connection&&t.markers.length>0){let{instruction:n}=d(this,td).get(t.markers[0]);n!=null&&n.action.toFloor&&(d(this,Wr).setMapOnConnectionClick&&this.currentMap.setFloor(n.action.toFloor.id,"navigation-connection-click"),this.currentMap.publish("navigation-connection-click",{instruction:n,fromFloor:n.action.fromFloor,toFloor:n.action.toFloor}))}},"#handleClick"));q(this,oc,t),q(this,n_,n),q(this,rd,r)}get currentMap(){return d(this,n_).call(this)}get isMultiFloor(){if(!d(this,vo).length)return!1;let t=new Set;for(let r of d(this,vo))for(let n of r.coordinates)if(n.floorId&&(t.add(n.floorId),t.size>1))return!0;return!1}getPathById(t){return d(this,za).get(t)}getMarkerById(t){return d(this,td).get(t)}get paths(){let t=new Set;return d(this,za).forEach(({path:r})=>t.add(r)),Array.from(t)}get activeDirections(){return d(this,kh).get(d(this,sc))}get activePath(){var t;if(d(this,sc))return(t=d(this,za).get(d(this,sc).id))==null?void 0:t.path}get floorStacks(){let t=d(this,rd).getMapData();if(!d(this,vo).length||!t)return[];let r=new Set;for(let n of d(this,vo))for(let i of n.coordinates)if(i.floorId){let s=t.getById("floor",i.floorId);s&&r.add(s.floorStack)}return Array.from(r)}get floors(){let t=d(this,rd).getMapData();if(!d(this,vo).length||!t)return[];let r=new Set;for(let n of d(this,vo))for(let i of n.coordinates)if(i.floorId){let s=t.getById("floor",i.floorId);s&&r.add(s)}return Array.from(r)}setActivePathByIndex(t){let r=d(this,vo)[t];if(!d(this,vo).length){ce.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!d(this,vo)[t]){ce.warn("Direction #".concat(t," does not exist"));return}let n=d(this,ac).get(r);if(!n){ce.warn("The direction is not a part of muli-direcional path");return}ke(this,qi,$T).call(this,n)}setActivePath(t){if(!d(this,vo).length){ce.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}if(!d(this,kh).get(t)){ce.warn('Path "'.concat(t.id,'" is not a part of muli-direcional path'));return}ke(this,qi,$T).call(this,t)}setActivePathByDirections(t){if(!d(this,vo).length){ce.warn("Cannot set an active path before drawing. Call Navigation.draw() first.");return}let r=d(this,ac).get(t);if(!r){ce.warn("The direction is not a part of muli-direcional path");return}ke(this,qi,$T).call(this,r)}drawSync(t,r={}){var c,p,h;d(this,xy)&&this.clear(),q(this,xy,!0),ke(this,qi,_8).call(this,r);let n=Array.isArray(t)?t:[t],i=n[0],s=n[n.length-1],l=i.coordinates[0];q(this,vo,n),l.floorId&&d(this,Wr).setMapToDeparture&&this.currentMap.setFloor(l.floorId),(c=d(this,Wr).createMarkers)!=null&&c.departure&&ke(this,qi,Uv).call(this,i.coordinates[0],"departure",i.instructions[0]);for(let y=0;y<n.length;y++){let b=n[y],_=y?k({},d(this,Wr).inactivePathOptions):k({},d(this,Wr).pathOptions);if(b.coordinates.length<2){ce.warn("Directions must have at least 2 coordinates");return}let C=this.currentMap.Paths.add(b.coordinates,re(k({},_),{animateDrawing:d(this,Wr).animatePathDrawing})),P=C.paths.map(T=>T.id.toString()),E=new ic(xn(),C.animation,b.coordinates,C.paths);for(let T of P){d(this,za).set(T,{path:E,entityIds:P});let O=y?re(k({},d(this,Wr).inactivePathOptions),{altitude:0}):re(k({},d(this,Wr).pathOptions),{altitude:.05});d(this,oc).setState(T,O)}d(this,za).set(E.id,{path:E,entityIds:P}),d(this,ac).set(b,E),d(this,kh).set(E,b),(p=d(this,Wr).createMarkers)!=null&&p.connection&&ke(this,qi,S8).call(this,b.instructions,"connection"),y===0&&(q(this,sc,d(this,ac).get(d(this,vo)[0])),d(this,oc).on("click",d(this,Vv)))}(h=d(this,Wr).createMarkers)!=null&&h.destination&&ke(this,qi,Uv).call(this,s.coordinates[s.coordinates.length-1],"destination",s.instructions[s.instructions.length-1]),d(this,rd).mapObjects.forEach(y=>{y.processFloorChange(y.currentFloorId)})}async draw(t,r={}){d(this,nd)&&this.clear(),ke(this,qi,_8).call(this,r);let n=Array.isArray(t)?t:[t],s=n[0].coordinates[0];return q(this,vo,n),s.floorId&&d(this,Wr).setMapToDeparture&&this.currentMap.setFloor(s.floorId),ke(this,qi,boe).call(this,n)}clear(){d(this,td).forEach((t,r)=>{this.currentMap.Markers.remove(r.toString())}),d(this,td).clear(),d(this,za).forEach(({path:t,entityIds:r})=>{d(this,za).delete(t.id),r.forEach(n=>d(this,za).delete(n)),this.currentMap.Paths.remove(r)}),d(this,nd)&&(d(this,nd).cancel(),q(this,nd,void 0)),d(this,xy)&&q(this,xy,!1),q(this,vo,[]),d(this,ac).clear(),d(this,kh).clear(),q(this,sc,void 0),d(this,oc).off("click",d(this,Vv)),d(this,rd).mapObjects.forEach(t=>{t.processFloorChange(t.currentFloorId)})}};td=new WeakMap,oc=new WeakMap,rd=new WeakMap,Wr=new WeakMap,n_=new WeakMap,nd=new WeakMap,xy=new WeakMap,vo=new WeakMap,sc=new WeakMap,za=new WeakMap,ac=new WeakMap,kh=new WeakMap,qi=new WeakSet,voe=o(function(t){return t!=null&&["TakeConnection","ExitConnection","TakeVortex","ExitVortex"].includes(t.type)},"#isVortexAction"),boe=o(function(t){let r=t[0],n=t[t.length-1],i=!1;return q(this,nd,{promise:new Promise(async s=>{var l,c,p;if(I.env.NODE_ENV!=="test"&&await yoe(500),i||!t.length){s();return}(l=d(this,Wr).createMarkers)!=null&&l.departure&&ke(this,qi,Uv).call(this,r.coordinates[0],"departure",r.instructions[0]);for(let h=0;h<t.length;h++){let y=t[h],b=h?k({},d(this,Wr).inactivePathOptions):k({},d(this,Wr).pathOptions);if(y.coordinates.length<2){ce.warn("Directions must have at least 2 coordinates"),s();return}let _=this.currentMap.Paths.add(y.coordinates,re(k({},b),{animateDrawing:d(this,Wr).animatePathDrawing})),C=_.paths.map(E=>E.id.toString()),P=new ic(xn(),_.animation,y.coordinates,_.paths);for(let E of C){d(this,za).set(E,{path:P,entityIds:C});let T=h?re(k({},d(this,Wr).inactivePathOptions),{altitude:0}):re(k({},d(this,Wr).pathOptions),{altitude:.05});d(this,oc).setState(E,T)}if(d(this,za).set(P.id,{path:P,entityIds:C}),d(this,ac).set(y,P),d(this,kh).set(P,y),I.env.NODE_ENV!=="test"&&await _.animation,i){s();return}(c=d(this,Wr).createMarkers)!=null&&c.connection&&ke(this,qi,S8).call(this,y.instructions,"connection"),h===0&&(q(this,sc,d(this,ac).get(d(this,vo)[0])),d(this,oc).on("click",d(this,Vv)))}if((p=d(this,Wr).createMarkers)!=null&&p.destination&&ke(this,qi,Uv).call(this,n.coordinates[n.coordinates.length-1],"destination",n.instructions[n.instructions.length-1]),i){s();return}d(this,rd).mapObjects.forEach(h=>{h.processFloorChange(h.currentFloorId)}),s()}),cancel:o(()=>{i=!0},"cancel")}),d(this,nd).promise},"#drawAsync"),_8=o(function(t){var r,n,i;q(this,Wr,{setMapOnConnectionClick:(r=t.setMapOnConnectionClick)!=null?r:Nh.setMapOnConnectionClick,setMapToDeparture:(n=t.setMapToDeparture)!=null?n:Nh.setMapToDeparture,pathOptions:k(k({},Nh.pathOptions),t.pathOptions),inactivePathOptions:k(k({},Nh.inactivePathOptions),t.inactivePathOptions),createMarkers:k(k({},Nh.createMarkers),t.createMarkers),markerOptions:k(k({},Nh.markerOptions),t.markerOptions),animatePathDrawing:(i=t.animatePathDrawing)!=null?i:Nh.animatePathDrawing})},"#setupOptions"),$T=o(function(t){q(this,sc,t),d(this,vo).forEach(r=>{let n=d(this,ac).get(r);if(n){let i=d(this,za).get(n.id),s=i.path.id===d(this,sc).id?re(k({},d(this,Wr).pathOptions),{altitude:.05}):re(k({},d(this,Wr).inactivePathOptions),{altitude:0});i.entityIds.forEach(l=>{d(this,oc).setState(l,s)})}}),this.currentMap.publish("navigation-active-path-change",{directions:this.activeDirections,path:this.activePath})},"#setActiveDirections"),Uv=o(function(t,r,n){var i,s,l,c,p;if(r==="connection"&&n){let h=n.action.type==="ExitConnection"?d(this,Wr).markerOptions.departureColor:d(this,Wr).markerOptions.destinationColor,y;if(typeof((i=d(this,Wr).createMarkers)==null?void 0:i.connection)=="function"){let _=d(this,Wr).createMarkers.connection(n);d(this,oc).setState(_.id.toString(),{options:{interactive:!0}}),y={id:_.id,type:"marker"}}else y=this.currentMap.Markers.add(n.coordinate,goe({type:(l=(s=n.action.connection)==null?void 0:s.type)!=null?l:n.action.connectionType,color:h,direction:n.action.direction}),{interactive:!0,anchor:"top",rank:"always-visible"});let b=this.currentMap.Markers.getContentEl(y.id.toString());if(!b)throw new Error("marker component should exist");d(this,td).set(y.id,{instruction:n,marker:new ed(y.id.toString(),b,n.coordinate)})}else{let h=r==="departure"?d(this,Wr).markerOptions.departureColor:d(this,Wr).markerOptions.destinationColor,y;typeof((c=d(this,Wr).createMarkers)==null?void 0:c.departure)=="function"&&r==="departure"?y={id:d(this,Wr).createMarkers.departure(n).id,type:"marker"}:typeof((p=d(this,Wr).createMarkers)==null?void 0:p.destination)=="function"&&r==="destination"?y={id:d(this,Wr).createMarkers.destination(n).id,type:"marker"}:y=this.currentMap.Markers.add(t,moe({type:r,color:h}),{anchor:"top",rank:"always-visible"}),d(this,td).set(y.id,void 0)}},"#addMarker"),S8=o(function(t,r){t.filter(i=>ke(this,qi,voe).call(this,i.action)).forEach(i=>{ke(this,qi,Uv).call(this,i.coordinate,r,i)})},"#addMarkers"),Vv=new WeakMap,o(C8,"Navigation");var r_=C8;g();g();g();var jAe=new Map([["search-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M1 7C1 3.68629 3.68629 1 7 1C10.3137 1 13 3.68629 13 7C13 8.29583 12.5892 9.49572 11.8907 10.4765L15.4614 14.0472C15.6567 14.2425 15.6567 14.559 15.4614 14.7543L14.7543 15.4614C14.559 15.6567 14.2424 15.6567 14.0472 15.4614L10.4765 11.8907C9.49571 12.5892 8.29583 13 7 13C3.68629 13 1 10.3137 1 7ZM7 11C4.79086 11 3 9.20914 3 7C3 4.79086 4.79086 3 7 3C9.20914 3 11 4.79086 11 7C11 9.20914 9.20914 11 7 11Z"\n stroke="none"\n />\n </svg>'],["close-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M12.5963 1.98959C12.7916 1.79433 13.1082 1.79433 13.3034 1.98959L14.0105 2.6967C14.2058 2.89196 14.2058 3.20855 14.0105 3.40381L3.40392 14.0104C3.20866 14.2057 2.89208 14.2057 2.69682 14.0104L1.98971 13.3033C1.79445 13.108 1.79445 12.7915 1.98971 12.5962L12.5963 1.98959Z"\n stroke="none"\n />\n <path\n d="M1.98971 3.40381C1.79445 3.20855 1.79445 2.89196 1.98971 2.6967L2.69682 1.98959C2.89208 1.79433 3.20866 1.79433 3.40392 1.98959L14.0105 12.5962C14.2058 12.7915 14.2058 13.108 14.0105 13.3033L13.3034 14.0104C13.1082 14.2057 12.7916 14.2057 12.5963 14.0104L1.98971 3.40381Z"\n stroke="none"\n />\n </svg>'],["empty-64x40",'<svg viewBox="0 0 64 40">\n <g>\n <g clipPath="url(#clip0_499_175492)">\n <path\n d="M32 39.7032C49.6731 39.7032 64 36.5925 64 32.7552C64 28.9179 49.6731 25.8071 32 25.8071C14.3269 25.8071 0 28.9179 0 32.7552C0 36.5925 14.3269 39.7032 32 39.7032Z"\n stroke="none"\n fill="#F5F5F5"\n />\n <path\n d="M55 13.6653L44.854 2.24866C44.367 1.47048 43.656 1 42.907 1H21.093C20.344 1 19.633 1.47048 19.146 2.24767L9 13.6663V22.8367H55V13.6653Z"\n fill="none"\n />\n <path\n d="M41.613 16.8128C41.613 15.2197 42.607 13.9046 43.84 13.9036H55V31.9059C55 34.0132 53.68 35.7402 52.05 35.7402H11.95C10.32 35.7402 9 34.0122 9 31.9059V13.9036H20.16C21.393 13.9036 22.387 15.2167 22.387 16.8098V16.8317C22.387 18.4248 23.392 19.7111 24.624 19.7111H39.376C40.608 19.7111 41.613 18.4128 41.613 16.8198V16.8128Z"\n fill="#FAFAFA"\n />\n </g>\n <defs>\n <clipPath id="clip0_499_175492">\n <rect width="64" height="40" fill="white" />\n </clipPath>\n </defs>\n </g>\n </svg>'],["caret-12x12",'<svg viewBox="0 0 12 12">\n <path\n stroke="none"\n d="M8.38828 5.78337L3.92578 1.93493C3.75938 1.79196 3.51562 1.92087 3.51562 2.15173V9.84861C3.51562 10.0795 3.75938 10.2084 3.92578 10.0654L8.38828 6.21696C8.51602 6.10681 8.51602 5.89353 8.38828 5.78337Z"\n />\n </svg>'],["plus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M7.5 1C7.22386 1 7 1.22386 7 1.5V7H1.5C1.22386 7 1 7.22386 1 7.5L1 8.5C1 8.77614 1.22386 9 1.5 9H7V14.5C7 14.7761 7.22386 15 7.5 15H8.5C8.77614 15 9 14.7761 9 14.5V9H14.5C14.7761 9 15 8.77614 15 8.5V7.5C15 7.22386 14.7761 7 14.5 7H9V1.5C9 1.22386 8.77614 1 8.5 1H7.5Z"\n stroke="none"\n />\n </svg>'],["recenter-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M0 2.5C0 2.22386 0.223858 2 0.5 2H1.5C1.77614 2 2 2.22386 2 2.5V13.5C2 13.7761 1.77614 14 1.5 14H0.5C0.223858 14 0 13.7761 0 13.5V2.5Z" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M4.5 4C4.22386 4 4 4.22386 4 4.5V11.5C4 11.7761 4.22386 12 4.5 12H11.5C11.7761 12 12 11.7761 12 11.5V4.5C12 4.22386 11.7761 4 11.5 4H4.5ZM6 6V10H10V6H6Z"\n />\n <path d="M14.5 2C14.2239 2 14 2.22386 14 2.5V13.5C14 13.7761 14.2239 14 14.5 14H15.5C15.7761 14 16 13.7761 16 13.5V2.5C16 2.22386 15.7761 2 15.5 2H14.5Z" />\n </g>\n </svg>'],["minus-16x16",'<svg viewBox="0 0 16 16">\n <path\n d="M1.5 9C1.22386 9 1 8.77614 1 8.5L1 7.5C1 7.22386 1.22386 7 1.5 7L14.5 7C14.7761 7 15 7.22386 15 7.5V8.5C15 8.77614 14.7761 9 14.5 9L1.5 9Z"\n stroke="none"\n />\n </svg>'],["logo-horizontal-206x48",'<svg viewBox="0 0 206 48">\n <path d="M27.2678 14.2261H22.3187C21.0695 14.2261 20.4695 14.7801 20.4695 15.9852V31.142L10.3966 15.5591C9.69665 14.4784 9.2475 14.2773 7.8475 14.2261H2.97462C1.67462 14.2261 1.07631 14.7801 1.07631 15.9852V44.7665C1.07631 45.9716 1.67462 46.5256 2.97462 46.5256H7.92377C9.22207 46.5256 9.82207 45.9716 9.82207 44.7665V29.6847L19.9441 45.1926C20.695 46.3244 21.095 46.5256 22.4933 46.5256H27.2933C28.5916 46.5256 29.1916 45.9716 29.1916 44.7665V15.9852C29.1407 14.7801 28.5424 14.2261 27.2678 14.2261Z" />\n <path d="M5.44915 10.9602C8.45863 10.9602 10.8983 8.50669 10.8983 5.48011C10.8983 2.45353 8.45863 0 5.44915 0C2.43967 0 0 2.45353 0 5.48011C0 8.50669 2.43967 10.9602 5.44915 10.9602Z" />\n <path d="M61.7899 25.0449C63.2306 23.1903 65.078 22.2051 67.556 22.2051C72.0526 22.2051 74.7611 25.3347 74.7611 29.4511V39.2489C74.8187 39.7125 74.5306 39.9443 74.0695 39.9443H72.5136C72.0526 39.9443 71.7645 39.7125 71.8221 39.2489V29.5091C71.8221 27.1909 69.9187 25.2187 67.4984 25.2187C65.1339 25.2187 63.2323 27.1329 63.2323 29.2773V39.2489C63.2899 39.7125 63.0018 39.9443 62.5407 39.9443H60.9831C60.5221 39.9443 60.2916 39.7125 60.2916 39.2489V29.4511C60.2916 27.1329 58.3899 25.2187 56.0255 25.2187C53.7204 25.2187 51.7594 27.075 51.7594 29.2773V39.3068C51.817 39.7705 51.5289 40.0023 51.0102 40.0023H49.5119C49.0509 40.0023 48.7628 39.7705 48.7628 39.3068V23.25C48.7051 22.7864 48.9933 22.4966 49.5119 22.4966H50.9526C51.356 22.4966 51.5289 22.6704 51.5289 23.0182V24.2352C52.7407 22.9602 54.239 22.2648 56.0255 22.2648C58.4475 22.2068 60.3492 23.192 61.7899 25.0466V25.0449ZM77.1255 31.2477C77.1255 26.3216 81.1018 22.2051 86.1187 22.2051C88.539 22.2051 90.6136 23.1903 92.3441 25.1608V23.1903C92.3441 22.7267 92.5746 22.5528 93.0357 22.5528H94.4187C94.8797 22.5528 95.1102 22.7847 95.1102 23.3062V39.3648C95.1102 39.8284 94.8797 40.0602 94.4187 40.0602H93.0357C92.5746 40.0602 92.3441 39.8284 92.3441 39.4227V37.4523C90.6712 39.3648 88.5967 40.35 86.1746 40.35C81.1018 40.2341 77.1238 36.1773 77.1238 31.2477H77.1255ZM92.1136 31.2477C92.1136 27.8284 89.4611 25.2187 86.0594 25.2187C82.7746 25.2187 80.1221 27.8864 80.1221 31.2477C80.1221 34.6687 82.7746 37.2784 86.1187 37.2784C86.9062 37.2789 87.6861 37.1232 88.4138 36.8202C89.1414 36.5173 89.8026 36.0731 90.3593 35.513C90.9161 34.9528 91.3577 34.2878 91.6587 33.556C91.9597 32.8241 92.1143 32.0397 92.1136 31.2477ZM100.992 37.3943V46.3807C101.049 46.8443 100.761 47.1341 100.298 47.1341H98.7424C98.2814 47.1341 97.9933 46.9023 97.9933 46.3807V23.1903C97.9933 22.7267 98.2238 22.4369 98.7424 22.4369H100.183C100.646 22.379 100.934 22.6687 100.934 23.0744V24.9869C102.605 23.0744 104.68 22.1472 107.044 22.1472C112.002 22.1472 116.037 26.2619 116.037 31.1898C116.037 36.1176 112.059 40.2341 107.044 40.2341C104.622 40.2341 102.603 39.3068 100.992 37.3943ZM106.987 25.2187C103.7 25.2187 101.049 27.8864 101.049 31.2477C101.049 34.6687 103.7 37.2784 107.044 37.2784C110.446 37.2784 113.039 34.6108 113.039 31.2477C113.039 27.8864 110.388 25.2187 106.987 25.2187ZM121.11 37.3943V46.3807C121.168 46.8443 120.88 47.1341 120.419 47.1341H118.861C118.4 47.1341 118.112 46.9023 118.112 46.3807V23.1903C118.112 22.7267 118.342 22.4369 118.861 22.4369H120.302C120.764 22.379 121.053 22.6687 121.053 23.0744V24.9869C122.724 23.0744 124.798 22.1472 127.163 22.1472C132.12 22.1472 136.156 26.2619 136.156 31.1898C136.156 36.1176 132.178 40.2341 127.163 40.2341C124.742 40.2341 122.781 39.3068 121.11 37.3943ZM127.105 25.2187C123.819 25.2187 121.168 27.8864 121.168 31.2477C121.168 34.6687 123.819 37.2784 127.163 37.2784C130.564 37.2784 133.158 34.6108 133.158 31.2477C133.158 27.8864 130.507 25.2187 127.107 25.2187H127.105ZM153.97 32.3506H141.054C141.342 35.2483 143.995 37.4523 147.164 37.4523C148.893 37.4523 150.393 37.0466 151.719 36.0597C152.007 35.8858 152.295 35.7699 152.353 35.7699C152.583 35.7699 152.756 35.8858 152.929 36.1773L153.505 37.1625C153.622 37.3364 153.68 37.4523 153.68 37.5682C153.68 37.8 153.507 38.0318 153.103 38.3216C151.258 39.5966 149.183 40.292 146.992 40.292C141.688 40.292 137.883 36.3511 137.883 31.2477C137.883 26.204 141.803 22.2051 146.703 22.2051C151.546 22.2051 154.717 25.7983 154.717 31.0176C154.717 31.5972 154.717 32.3506 153.968 32.3506H153.97ZM141.056 30.0324H151.72C151.432 26.8432 149.473 24.929 146.648 24.929C145.241 24.8904 143.875 25.3995 142.833 26.3501C141.791 27.3007 141.154 28.6194 141.056 30.0307V30.0324ZM156.332 31.2477C156.332 26.3216 160.31 22.2051 165.326 22.2051C167.748 22.2051 169.707 23.1324 171.32 25.0449V16.2324C171.263 15.7687 171.551 15.479 172.012 15.479H173.57C174.031 15.479 174.319 15.7108 174.319 16.2324V39.3068C174.319 39.7705 174.088 40.0023 173.57 40.0023H172.129C171.666 40.0602 171.378 39.7705 171.378 39.3648V37.3943C169.649 39.3068 167.632 40.292 165.268 40.292C160.31 40.2341 156.332 36.1773 156.332 31.2477ZM171.264 31.2477C171.264 27.8284 168.612 25.2187 165.21 25.2187C161.924 25.2187 159.273 27.8864 159.273 31.2477C159.273 34.6687 161.924 37.2784 165.268 37.2784C166.057 37.2838 166.839 37.1316 167.569 36.8304C168.299 36.5292 168.962 36.0852 169.52 35.5241C170.077 34.963 170.519 34.296 170.818 33.5619C171.117 32.8277 171.268 32.0411 171.263 31.2477H171.264ZM177.72 19.0739C177.715 18.8594 177.754 18.646 177.833 18.4468C177.912 18.2476 178.031 18.0667 178.182 17.915C178.333 17.7633 178.512 17.6439 178.71 17.5642C178.909 17.4845 179.121 17.446 179.334 17.4511C179.546 17.4507 179.756 17.4923 179.952 17.5737C180.148 17.6551 180.326 17.7746 180.476 17.9254C180.626 18.0762 180.745 18.2553 180.826 18.4523C180.907 18.6494 180.948 18.8606 180.948 19.0739C180.953 19.2884 180.914 19.5017 180.835 19.7009C180.756 19.9001 180.637 20.081 180.486 20.2327C180.335 20.3845 180.156 20.5038 179.957 20.5835C179.759 20.6633 179.547 20.7017 179.334 20.6966C178.412 20.7545 177.72 20.0591 177.72 19.0739ZM177.836 39.2489V23.1903C177.836 22.7267 178.066 22.4369 178.527 22.4369H180.083C180.544 22.4369 180.832 22.6687 180.775 23.1903V39.2489C180.832 39.7125 180.544 39.9443 180.083 39.9443H178.527C178.066 39.9443 177.836 39.7125 177.836 39.2489ZM186.944 23.0165V24.1756C188.212 22.8426 189.71 22.2051 191.497 22.2051C195.937 22.2051 198.646 25.2767 198.646 29.3932V39.2489C198.703 39.7125 198.415 39.9443 197.954 39.9443H196.398C195.936 39.9443 195.705 39.7125 195.705 39.2489V29.4511C195.705 27.1329 193.803 25.2187 191.439 25.2187C189.134 25.2187 187.175 27.075 187.175 29.2773V39.3068C187.232 39.7705 186.944 40.0023 186.424 40.0023H184.868C184.407 40.0023 184.119 39.7705 184.119 39.3068V23.1903C184.061 22.7267 184.349 22.4949 184.868 22.4949H186.309C186.712 22.4949 186.944 22.6687 186.944 23.0165Z" />\n <path d="M204 40C205.115 40 206 39.0857 206 38V37.9886C206 36.9029 205.126 36 204 36C202.885 36 202 36.9143 202 38V38.0114C202 39.0971 202.874 40 204 40ZM204 39.7829C202.989 39.7829 202.23 38.9829 202.23 38.0114V38C202.23 37.0286 203 36.2171 204 36.2171C205.011 36.2171 205.77 37.0171 205.77 37.9886V38C205.77 38.9714 205 39.7829 204 39.7829ZM203.218 38.9714H203.609V38.2743H204.034L204.517 38.9714H204.989L204.448 38.2057C204.724 38.1257 204.92 37.92 204.92 37.5886C204.92 37.1657 204.586 36.9486 204.138 36.9486H203.218V38.9714ZM203.609 37.9543V37.2914H204.103C204.368 37.2914 204.517 37.4057 204.517 37.6229C204.517 37.8171 204.368 37.9543 204.103 37.9543H203.609Z" />\n </svg>'],["share-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M13 6C14.6569 6 16 4.65685 16 3C16 1.34315 14.6569 0 13 0C11.3431 0 10 1.34315 10 3C10 3.13463 10.0089 3.26719 10.0261 3.39712L6.82972 5.17286C6.10576 4.44825 5.10523 4 4 4C1.79086 4 0 5.79086 0 8C0 10.2091 1.79086 12 4 12C5.10523 12 6.10576 11.5518 6.82972 10.8271L10.0261 12.6029C10.0089 12.7328 10 12.8654 10 13C10 14.6569 11.3431 16 13 16C14.6569 16 16 14.6569 16 13C16 11.3431 14.6569 10 13 10C12.2011 10 11.4752 10.3123 10.9376 10.8214L7.84579 9.1037C7.94622 8.75313 8 8.38284 8 8C8 7.61716 7.94622 7.24687 7.84579 6.8963L10.9376 5.17864C11.4752 5.68775 12.2011 6 13 6ZM13 4C13.5523 4 14 3.55228 14 3C14 2.44772 13.5523 2 13 2C12.4477 2 12 2.44772 12 3C12 3.55228 12.4477 4 13 4ZM4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10ZM14 13C14 13.5523 13.5523 14 13 14C12.4477 14 12 13.5523 12 13C12 12.4477 12.4477 12 13 12C13.5523 12 14 12.4477 14 13Z"\n stroke="none"\n />\n </svg>'],["checkmark-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M15.387 3.31662C15.6008 3.49148 15.6323 3.80649 15.4574 4.02021L6.77402 14.6332C6.58509 14.8642 6.30292 14.9986 6.00457 15C5.70622 15.0013 5.42285 14.8694 5.23184 14.6402L0.551937 9.02429C0.375155 8.81215 0.403817 8.49687 0.615956 8.32009L1.38418 7.67991C1.59632 7.50312 1.9116 7.53179 2.08838 7.74392L5.99299 12.4295L13.9095 2.75374C14.0844 2.54002 14.3994 2.50852 14.6131 2.68338L15.387 3.31662Z"\n stroke="none"\n />\n </svg>'],["arrow-right-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.35355 1.64645C8.54881 1.45118 8.8654 1.45118 9.06066 1.64645L14.7071 7.29289C15.0976 7.68342 15.0976 8.31658 14.7071 8.70711L9.06066 14.3536C8.8654 14.5488 8.54882 14.5488 8.35355 14.3536L7.64645 13.6464C7.45118 13.4512 7.45118 13.1346 7.64645 12.9393L11.5858 9H0.5C0.223858 9 0 8.77614 0 8.5V7.5C0 7.22386 0.223858 7 0.5 7H11.5858L7.64645 3.06066C7.45118 2.8654 7.45118 2.54882 7.64645 2.35355L8.35355 1.64645Z"\n stroke="none"\n />\n </svg>'],["arrow-up-16x16",'<svg viewBox="0 0 16 16">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M8.00015 0.5C8.34685 0.5 8.67835 0.642318 8.91714 0.893677L15.6517 7.98267C15.8441 8.18525 15.8359 8.50548 15.6333 8.69793L14.533 9.7433C14.3304 9.93575 14.0101 9.92754 13.8177 9.72496L9.26497 4.93262V15.4249C9.26497 15.7043 9.03846 15.9308 8.75904 15.9308H7.24125C6.96184 15.9308 6.73532 15.7043 6.73532 15.4249V4.93262L2.1826 9.72496C1.99015 9.92754 1.66992 9.93575 1.46734 9.7433L0.366945 8.69793C0.164367 8.50548 0.156156 8.18525 0.348604 7.98267L7.08315 0.893677C7.32194 0.642318 7.65344 0.5 8.00015 0.5Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M1 11.5C1 11.2239 1.22386 11 1.5 11H6V13.5C6 13.7761 5.77614 14 5.5 14H1.5C1.22386 14 1 13.7761 1 13.5V11.5Z" />\n <path d="M4 8.5C4 8.22386 4.22386 8 4.5 8H9V10.5C9 10.7761 8.77614 11 8.5 11H4V8.5Z" />\n <path d="M7 5.5C7 5.22386 7.22386 5 7.5 5H12V7.5C12 7.77614 11.7761 8 11.5 8H7V5.5Z" />\n <path d="M10 2.5C10 2.22386 10.2239 2 10.5 2H14.5C14.7761 2 15 2.22386 15 2.5V4.5C15 4.77614 14.7761 5 14.5 5H10V2.5Z" />\n </g>\n </svg>'],["connection-stairs-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.25 12H2.5C2.225 12 2 11.7429 2 11.4286C2 11.1143 2.225 10.8571 2.5 10.8571H4.25V7.91429H6.5V4.94286H8.75V2H11.5C11.775 2 12 2.25714 12 2.57143C12 2.88571 11.775 3.14286 11.5 3.14286H9.75V6.08571H7.5V9.02857H5.25V12Z"\n stroke="none"\n />\n </svg>'],["connection-stairs-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path d="M1.625 8.1875C1.625 8.01491 1.76491 7.875 1.9375 7.875H4.75V9.4375C4.75 9.61009 4.61009 9.75 4.4375 9.75H1.9375C1.76491 9.75 1.625 9.61009 1.625 9.4375V8.1875Z" />\n <path d="M3.5 6.3125C3.5 6.13991 3.63991 6 3.8125 6H6.625V7.5625C6.625 7.73509 6.48509 7.875 6.3125 7.875H3.5V6.3125Z" />\n <path d="M5.375 4.4375C5.375 4.26491 5.51491 4.125 5.6875 4.125H8.5V5.6875C8.5 5.86009 8.36009 6 8.1875 6H5.375V4.4375Z" />\n <path d="M7.25 2.5625C7.25 2.38991 7.38991 2.25 7.5625 2.25H10.0625C10.2351 2.25 10.375 2.38991 10.375 2.5625V3.8125C10.375 3.98509 10.2351 4.125 10.0625 4.125H7.25V2.5625Z" />\n </svg>'],["connection-escalator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3.63008 12H2C0.895431 12 0 12.8954 0 14C0 15.1046 0.89543 16 2 16H4.63008C4.86879 16 5.09962 15.9146 5.28087 15.7593L11.7191 10.2407C11.9004 10.0854 12.1312 10 12.3699 10H14C15.1046 10 16 9.10457 16 8C16 6.89543 15.1046 6 14 6H11.3699C11.1312 6 10.9004 6.08539 10.7191 6.24074L4.28087 11.7593C4.09962 11.9146 3.86879 12 3.63008 12Z" />\n <path d="M5 6C5 4.89543 5.89543 4 7 4C8.10457 4 9 4.89543 9 6L5 9.5V6Z" />\n <path d="M9 2C9 3.10457 8.10457 4 7 4C5.89543 4 5 3.10457 5 2C5 0.89543 5.89543 0 7 0C8.10457 0 9 0.89543 9 2Z" />\n </g>\n </svg>'],["connection-escalator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M5.26686 2.98522C5.26686 2.44335 5.71573 2 6.26436 2C6.81299 2 7.26187 2.44335 7.26187 2.98522C7.26187 3.5271 6.81299 3.97045 6.26436 3.97045C5.71573 3.97045 5.26686 3.50246 5.26686 2.98522Z"\n stroke="none"\n />\n <path\n d="M7.26188 5.48588V5.25125C7.26188 4.85716 6.91275 4.53696 6.48881 4.53696H6.03993C5.61599 4.53696 5.26687 4.88179 5.26687 5.25125V7.66458L4.3192 8.6995H3.67082C2.74813 8.6995 2 9.43842 2 10.3498C2 11.2611 2.74813 12 3.67082 12H4.61845C5.36658 12 6.11471 11.6798 6.61347 11.1133L9.6808 7.76354H10.3292C11.2519 7.76354 12 7.02463 12 6.11329C12 5.20196 11.2519 4.46305 10.3292 4.46305H9.38155C8.60848 4.46305 7.88529 4.78324 7.38653 5.34975L7.26188 5.48588ZM4.61846 11.0148H3.67083C3.29677 11.0148 2.99751 10.7192 2.99751 10.3498C2.99751 9.9803 3.29677 9.68473 3.67083 9.68473H4.61846C4.71821 9.68473 4.81796 9.63547 4.86784 9.56158L8.13467 5.99015C8.45886 5.64532 8.90774 5.44828 9.38155 5.44828H10.3292C10.7032 5.44828 11.0025 5.74384 11.0025 6.1133C11.0025 6.48276 10.7032 6.77833 10.3292 6.77833H9.38155C9.2818 6.77833 9.18205 6.82759 9.13218 6.87685L5.86534 10.4729C5.54115 10.8177 5.09228 11.0148 4.61846 11.0148Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path d="M3 5.5C3 6.32843 2.32843 7 1.5 7C0.671573 7 0 6.32843 0 5.5C0 4.67157 0.671573 4 1.5 4C2.32843 4 3 4.67157 3 5.5Z" />\n <path d="M3 10.5C3 11.3284 2.32843 12 1.5 12C0.671573 12 0 11.3284 0 10.5C0 9.67157 0.671573 9 1.5 9C2.32843 9 3 9.67157 3 10.5Z" />\n <path d="M11 1H14C14.5523 1 15 1.44772 15 2V14C15 14.5523 14.5523 15 14 15H11V1Z" />\n <path d="M9 1H6C5.44772 1 5 1.44772 5 2V14C5 14.5523 5.44772 15 6 15H9V1Z" />\n </g>\n </svg>'],["connection-elevator-14x14",'<svg viewBox="0 0 14 14">\n <path\n d="M7.476 2H2.72693C1.77095 2 1 2.72464 1 3.62319V10.3768C1 11.2754 1.77095 12 2.72693 12H7.476C8.43198 12 9.20293 11.2754 9.20293 10.3768V3.62319C9.17209 2.72464 8.40114 2 7.476 2ZM7.476 3.15942C7.75354 3.15942 7.96941 3.36232 7.96941 3.62319V10.3768C7.96941 10.6377 7.75354 10.8406 7.476 10.8406H5.71824V3.15942H7.476ZM4.48472 3.15942V10.8406H2.72693C2.44939 10.8406 2.23352 10.6377 2.23352 10.3768V3.62319C2.23352 3.36232 2.44939 3.15942 2.72693 3.15942H4.48472Z"\n stroke="none"\n />\n <path\n d="M12.4643 6.19064H10.6638C10.4456 6.19064 10.2546 6.06243 10.1728 5.88294C10.0909 5.70346 10.1455 5.47269 10.2819 5.31884L11.1821 4.47269C11.4004 4.26756 11.755 4.26756 11.946 4.47269L12.8462 5.31884C13.0099 5.47269 13.0371 5.67781 12.9553 5.88294C12.8735 6.08807 12.6825 6.19064 12.4643 6.19064Z"\n stroke="none"\n />\n <path\n d="M11.564 9.65216C11.4276 9.65216 11.2912 9.60088 11.1821 9.49831L10.2819 8.65216C10.1182 8.49831 10.0909 8.29319 10.1728 8.08806C10.2546 7.90857 10.4456 7.78036 10.6638 7.78036H12.4643C12.6825 7.78036 12.8735 7.90857 12.9553 8.08806C13.0371 8.26754 12.9826 8.49831 12.8462 8.65216L11.9459 9.49831C11.8641 9.60088 11.7004 9.65216 11.564 9.65216Z"\n stroke="none"\n />\n </svg>'],["connection-elevator-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <circle cx="1.9375" cy="4.4375" r="0.9375" />\n <circle cx="1.9375" cy="7.5625" r="0.9375" />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M7.6 2H9.4C9.73137 2 10 2.26863 10 2.6V9.41328C10 9.74465 9.73137 10.0133 9.4 10.0133H7.6V2ZM6.4 2H4.6C4.26863 2 4 2.26863 4 2.6V9.41328C4 9.74465 4.26863 10.0133 4.6 10.0133H6.4V2Z"\n />\n </svg>'],["new-tab-14x14",'<svg viewBox="0 0 14 14">\n <g stroke="none">\n <path d="M2.625 2.625H5.6875C5.92913 2.625 6.125 2.42912 6.125 2.1875V1.3125C6.125 1.07088 5.92913 0.875 5.6875 0.875H1.3125C1.07088 0.875 0.875 1.07088 0.875 1.3125V12.6875C0.875 12.9291 1.07088 13.125 1.3125 13.125H12.6875C12.9291 13.125 13.125 12.9291 13.125 12.6875V8.3125C13.125 8.07088 12.9291 7.875 12.6875 7.875H11.8125C11.5709 7.875 11.375 8.07088 11.375 8.3125V11.375H2.625V2.625Z" />\n <path d="M12.9063 0.875H8.40311C8.20822 0.875 8.11063 1.11062 8.24843 1.24843L9.88124 2.88124L5.8156 6.94688C5.64475 7.11774 5.64475 7.39475 5.8156 7.5656L6.43432 8.18432C6.60517 8.35517 6.88218 8.35517 7.05304 8.18432L11.1187 4.11868L12.7516 5.75157C12.8894 5.88938 13.125 5.79178 13.125 5.59689V1.09375C13.125 0.972938 13.0271 0.875 12.9063 0.875Z" />\n </g>\n </svg>'],["compress-16x16",'<svg viewBox="0 0 16 16">\n <g stroke="none">\n <path\n id="Vector"\n d="M4.67773 10.7154H0.713449C0.556306 10.7154 0.427734 10.844 0.427734 11.0011V11.8583C0.427734 12.0154 0.556306 12.144 0.713449 12.144H3.82059V15.2868C3.82059 15.444 3.94916 15.5725 4.10631 15.5725H4.96345C5.12059 15.5725 5.24916 15.444 5.24916 15.2868V11.2868C5.24916 10.9708 4.99381 10.7154 4.67773 10.7154ZM4.96345 0.429688H4.10631C3.94916 0.429688 3.82059 0.558259 3.82059 0.715402V3.85826H0.713449C0.556306 3.85826 0.427734 3.98683 0.427734 4.14397V5.00112C0.427734 5.15826 0.556306 5.28683 0.713449 5.28683H4.67773C4.99381 5.28683 5.24916 5.03147 5.24916 4.7154V0.715402C5.24916 0.558259 5.12059 0.429688 4.96345 0.429688ZM15.2849 10.7154H11.3206C11.0045 10.7154 10.7492 10.9708 10.7492 11.2868V15.2868C10.7492 15.444 10.8777 15.5725 11.0349 15.5725H11.892C12.0492 15.5725 12.1777 15.444 12.1777 15.2868V12.144H15.2849C15.442 12.144 15.5706 12.0154 15.5706 11.8583V11.0011C15.5706 10.844 15.442 10.7154 15.2849 10.7154ZM15.2849 3.85826H12.1777V0.715402C12.1777 0.558259 12.0492 0.429688 11.892 0.429688H11.0349C10.8777 0.429688 10.7492 0.558259 10.7492 0.715402V4.7154C10.7492 5.03147 11.0045 5.28683 11.3206 5.28683H15.2849C15.442 5.28683 15.5706 5.15826 15.5706 5.00112V4.14397C15.5706 3.98683 15.442 3.85826 15.2849 3.85826Z"\n />\n </g>\n </svg>'],["washroom-14x14",'<svg viewBox="0 0 14 14" stroke="none">\n <path d="M4.55125 3.09062C4.55125 3.69326 4.07639 4.18176 3.49058 4.18176C2.90525 4.18176 2.43039 3.69326 2.43039 3.09062C2.43039 2.4885 2.90525 2 3.49058 2C4.07639 2 4.55125 2.4885 4.55125 3.09062Z" />\n <path d="M5.1193 5.48047C4.81653 4.83116 4.17252 4.41571 3.47822 4.41571C2.78392 4.41571 2.13986 4.83116 1.83714 5.48047L1.04175 7.22034C0.940664 7.441 1.02893 7.70073 1.24393 7.81791C1.47077 7.90871 1.72324 7.81791 1.82433 7.59725L2.49349 6.15554L2.21587 11.4407C2.20305 11.7263 2.41805 11.9734 2.69567 11.9993C2.97329 12.0124 3.21344 11.7913 3.23859 11.5057L3.4028 8.285H3.567L3.73121 11.5057C3.74403 11.7913 3.97086 11.9993 4.23616 11.9993H4.26131C4.53893 11.9861 4.75343 11.7395 4.74111 11.4407L4.46349 6.15554L5.13265 7.59725C5.20858 7.75298 5.35997 7.85697 5.52418 7.85697C5.5873 7.85697 5.65042 7.84379 5.71354 7.81792C5.92804 7.71393 6.0163 7.44153 5.91572 7.22035L5.1193 5.48047Z" />\n <path d="M12.9582 7.22034L12.1505 5.48047C11.8477 4.83116 11.2037 4.41571 10.5094 4.41571C9.81513 4.41571 9.17107 4.83116 8.86836 5.48047L8.06064 7.22034C7.95955 7.441 8.04782 7.70073 8.26282 7.81791C8.47732 7.9219 8.7298 7.8311 8.84371 7.60993L9.52519 6.12977L9.46207 7.2204L8.57842 8.92184C8.47733 9.11663 8.61638 9.36316 8.83089 9.36316H9.33584L9.22242 11.4668C9.2096 11.7397 9.41177 11.9862 9.68939 11.9994C9.95469 12.0126 10.1943 11.8046 10.2072 11.519L10.3581 9.33723H10.6737L10.7871 11.5058C10.7999 11.7787 11.0144 11.9862 11.2792 11.9862H11.3043C11.5696 11.973 11.7841 11.7396 11.7713 11.4535L11.6579 9.33718H12.1628C12.3773 9.33718 12.5287 9.09066 12.4153 8.89586L11.5317 7.19442L11.4685 6.1038L12.1757 7.5972C12.2516 7.75293 12.403 7.85692 12.5672 7.85692C12.6303 7.85692 12.6934 7.84373 12.7566 7.81786C12.9711 7.70068 13.0593 7.44102 12.9582 7.22034Z" />\n <path d="M11.5696 3.09062C11.5696 3.69326 11.0948 4.18176 10.5094 4.18176C9.92363 4.18176 9.44876 3.69326 9.44876 3.09062C9.44876 2.4885 9.92363 2 10.5094 2C11.0948 2 11.5696 2.4885 11.5696 3.09062Z" />\n <path d="M6.99996 2.00006C6.76031 2.00006 6.57095 2.19485 6.57095 2.44138V11.5575C6.57095 11.804 6.76031 11.9988 6.99996 11.9988C7.2396 11.9988 7.42896 11.804 7.42896 11.5575V2.44138C7.42896 2.19485 7.2396 2.00006 6.99996 2.00006Z" />\n </svg>'],["point-of-interest-12x12",'<svg viewBox="0 0 12 12" stroke="none">\n <path\n stroke="none"\n id="Subtract"\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M6.24724 10.7516C7.94597 9.0358 9.85962 6.89195 9.85962 4.85965C9.85962 2.72802 8.13159 1 5.99997 1C3.86834 1 2.14032 2.72802 2.14032 4.85965C2.14032 6.89195 4.05397 9.0358 5.7527 10.7516C5.88904 10.8893 6.1109 10.8893 6.24724 10.7516ZM5.99994 6.26317C6.77508 6.26317 7.40345 5.6348 7.40345 4.85967C7.40345 4.08453 6.77508 3.45616 5.99994 3.45616C5.22481 3.45616 4.59644 4.08453 4.59644 4.85967C4.59644 5.6348 5.22481 6.26317 5.99994 6.26317Z"\n />\n </svg>'],["flag-20x20",'<svg viewBox="0 0 20 20" stroke="none">\n <path\n d="M16.9987 4.27111C16.936 5.06715 16.3836 5.93162 15.5238 6.57845C14.7549 7.15682 13.0885 8.04927 10.5434 7.55174C8.32167 7.1164 6.82156 8.02129 6.08085 10.2416L8.24615 17.3998C8.31833 17.6471 8.17711 17.9059 7.9292 17.9813C7.88527 17.9938 7.83976 18 7.79426 18C7.58634 18 7.40277 17.8647 7.34236 17.6673L5.1644 10.4686C5.13773 10.4173 5.12125 10.3613 5.11419 10.3038L3.41956 4.70042C3.38112 4.63512 3.35994 4.56127 3.3568 4.48587L3.02101 3.37886C2.98413 3.25992 2.9959 3.13165 3.05553 3.02203C3.11437 2.91242 3.21479 2.83079 3.33482 2.79504C3.45564 2.75928 3.5851 2.7725 3.69494 2.83235C3.80477 2.89144 3.88637 2.99172 3.92167 3.11143L3.9813 3.31355C4.38847 2.85956 4.90472 2.51439 5.48136 2.30915C6.97201 1.75566 8.95216 1.95467 10.6469 2.83156C11.6888 3.36951 14.3374 4.54493 16.3647 3.79553C16.5154 3.74111 16.684 3.76599 16.8127 3.86239C16.9406 3.95879 17.0105 4.11251 16.9987 4.27111Z"\n stroke="none"\n />\n </svg>'],["link-16x16",'<svg viewBox="0 0 16 16" stroke="none">\n <path\n d="M9.10678 11.2433C9.07993 11.2167 9.04367 11.2018 9.00589 11.2018C8.9681 11.2018 8.93184 11.2167 8.90499 11.2433L6.82999 13.3183C5.86928 14.279 4.24785 14.3808 3.18714 13.3183C2.12464 12.2558 2.22642 10.6362 3.18714 9.67546L5.26214 7.60046C5.31749 7.5451 5.31749 7.45403 5.26214 7.39868L4.55142 6.68796C4.52457 6.66138 4.48832 6.64646 4.45053 6.64646C4.41274 6.64646 4.37649 6.66138 4.34964 6.68796L2.27464 8.76296C0.763923 10.2737 0.763923 12.7183 2.27464 14.2272C3.78535 15.7362 6.22999 15.738 7.73892 14.2272L9.81392 12.1522C9.86928 12.0969 9.86928 12.0058 9.81392 11.9505L9.10678 11.2433ZM13.7246 2.77903C12.2139 1.26832 9.76928 1.26832 8.26035 2.77903L6.18357 4.85403C6.15698 4.88088 6.14207 4.91714 6.14207 4.95493C6.14207 4.99271 6.15698 5.02897 6.18357 5.05582L6.89249 5.76475C6.94785 5.8201 7.03892 5.8201 7.09428 5.76475L9.16928 3.68975C10.13 2.72903 11.7514 2.62725 12.8121 3.68975C13.8746 4.75225 13.7729 6.37189 12.8121 7.3326L10.7371 9.4076C10.7106 9.43445 10.6956 9.47071 10.6956 9.5085C10.6956 9.54628 10.7106 9.58254 10.7371 9.60939L11.4479 10.3201C11.5032 10.3755 11.5943 10.3755 11.6496 10.3201L13.7246 8.2451C15.2336 6.73439 15.2336 4.28975 13.7246 2.77903ZM9.75142 6.00939C9.72457 5.9828 9.68832 5.96789 9.65053 5.96789C9.61275 5.96789 9.57649 5.9828 9.54964 6.00939L5.50499 10.0522C5.47841 10.0791 5.46349 10.1154 5.46349 10.1531C5.46349 10.1909 5.47841 10.2272 5.50499 10.254L6.21214 10.9612C6.26749 11.0165 6.35857 11.0165 6.41392 10.9612L10.4568 6.91832C10.5121 6.86296 10.5121 6.77189 10.4568 6.71653L9.75142 6.00939Z"\n stroke="none"\n />\n </svg>']]),GAe=/<svg([^>]*)>/g;function xoe(e,t,r){let n=jAe.get(e);return n?n.replace(GAe,'<svg$1 xmlns="http://www.w3.org/2000/svg" style="fill:'.concat(t,"; width:").concat(r,"px; height:").concat(r,'px">')):""}o(xoe,"getStyledIcon");var Iy,zv,qa,w8,Ioe,_oe,P8,Soe,T8=class T8{constructor(t,r){G(this,qa);G(this,Iy);G(this,zv);x(this,"colors",{default:"#3D5676",connection:"#128387",washroom:"#3161B4",point:"#AD468F"});q(this,Iy,t),q(this,zv,r)}auto(){let t=[],r=d(this,zv)[Object.keys(d(this,zv))[0]];return[...r.getByType("connection"),...r.getByType("point-of-interest"),...r.getByType("space")].forEach(n=>{if(n.__type==="connection")n.coordinates.forEach(i=>{let s=n.name||n.externalId;if(s){let l=d(this,Iy).Labels.add(i,s,ke(this,qa,w8).call(this,n));t.push(l)}});else{n.__type==="space"&&n.name!==""&&d(this,Iy).updateState(n,{interactive:!0,hoverColor:"#F0F0F0"});let i=n.name;if(i){let s=d(this,Iy).Labels.add(n,i,ke(this,qa,w8).call(this,n));t.push(s)}}}),{labels:t}}};Iy=new WeakMap,zv=new WeakMap,qa=new WeakSet,w8=o(function(t){let r=xoe(ke(this,qa,Ioe).call(this,t),"white",12);return{appearance:{text:{foregroundColor:ke(this,qa,P8).call(this,t)},marker:{foregroundColor:{active:ke(this,qa,P8).call(this,t)},icon:r,iconSize:12}},interactive:!0,rank:ke(this,qa,Soe).call(this,t)}},"#generatLabelAppearance"),Ioe=o(function(t){return t.__type==="connection"?ke(this,qa,_oe).call(this,t.type):t.name.includes("Washroom")?"washroom-14x14":t.__type==="point-of-interest"?"point-of-interest-12x12":""},"#getIconName"),_oe=o(function(t){let r="";switch(t){case"elevator":r="connection-elevator-12x12";break;case"escalator":r="connection-escalator-12x12";break;case"stairs":r="connection-stairs-12x12";break}return r},"#attemptIconNameForConnection"),P8=o(function(t){return t.__type==="connection"?this.colors.connection:t.__type==="point-of-interest"?this.colors.point:"name"in t&&t.name.includes("Washroom")?this.colors.washroom:this.colors.default},"#getLabelColor"),Soe=o(function(t){return t.__type==="connection"?"high":(t.__type==="point-of-interest","medium")},"#getDefaultLabelRank"),o(T8,"Labels");var jT=T8;var E8=class E8{constructor(t,r){x(this,"Labels");x(this,"auto",o(()=>this.Labels.auto(),"auto"));this.Labels=new jT(t,r)}};o(E8,"DefaultTheme");var GT=E8;g();var Nt,o_,id,UT,M8,O8=class O8{constructor(t){G(this,id);G(this,Nt);G(this,o_);x(this,"interactions",{set:o(t=>{(t==null?void 0:t.pan)!=null&&(d(this,Nt).getSystems().cameraSystem.enablePan=t.pan),(t==null?void 0:t.zoom)!=null&&(d(this,Nt).getSystems().cameraSystem.enableZoom=t.zoom),(t==null?void 0:t.bearingAndPitch)!=null&&(d(this,Nt).getSystems().cameraSystem.enableRotate=t.bearingAndPitch)},"set"),enable:o(()=>{d(this,Nt).getSystems().cameraSystem.enablePan=!0,d(this,Nt).getSystems().cameraSystem.enableZoom=!0,d(this,Nt).getSystems().cameraSystem.enableRotate=!0},"enable"),disable:o(()=>{d(this,Nt).getSystems().cameraSystem.enablePan=!1,d(this,Nt).getSystems().cameraSystem.enableZoom=!1,d(this,Nt).getSystems().cameraSystem.enableRotate=!1},"disable")});x(this,"setMinPitch",o(t=>{d(this,Nt).camera.setMinPitch(t)},"setMinPitch"));x(this,"setMaxPitch",o(t=>{d(this,Nt).camera.setMaxPitch(t)},"setMaxPitch"));x(this,"setMinZoomLevel",o(t=>{d(this,Nt).camera.setMinZoomLevel(t,!0)},"setMinZoomLevel"));x(this,"setMaxZoomLevel",o(t=>{d(this,Nt).camera.setMaxZoomLevel(t)},"setMaxZoomLevel"));q(this,o_,t),q(this,Nt,t.core)}setScreenOffsets(t){d(this,Nt).camera.setInsetPadding(t)}get screenOffsets(){return d(this,Nt).camera.insetsPadding}get panMode(){return d(this,Nt).camera.panMode}setPanMode(t){if(t!=="default"&&t!=="elevation")throw new Error("Invalid pan mode");t!==this.panMode&&d(this,Nt).camera.setPanMode(t)}getFocusOnTransform(t,r){var i;let n=d(this,Nt).camera.getCameraFrameForCoordinates(ke(this,id,M8).call(this,t),{pitch:r==null?void 0:r.pitch,bearing:r==null?void 0:r.bearing,padding:(r==null?void 0:r.screenOffsets)||this.screenOffsets,maxZoomLevel:r==null?void 0:r.maxZoomLevel,verticalPadding:(i=r==null?void 0:r.axisAlignedPadding)==null?void 0:i.vertical,minZoomLevel:r==null?void 0:r.minZoomLevel,duration:r==null?void 0:r.duration,easing:r==null?void 0:r.easing});return{center:new Ct(n.center[1],n.center[0]),zoomLevel:n.zoomLevel}}focusOn(t,r){var n;return d(this,Nt).camera.focusOn(ke(this,id,M8).call(this,t),{pitch:r==null?void 0:r.pitch,bearing:r==null?void 0:r.bearing,padding:(r==null?void 0:r.screenOffsets)||this.screenOffsets,maxZoomLevel:r==null?void 0:r.maxZoomLevel,minZoomLevel:r==null?void 0:r.minZoomLevel,duration:r==null?void 0:r.duration,verticalPadding:(n=r==null?void 0:r.axisAlignedPadding)==null?void 0:n.vertical,easing:r==null?void 0:r.easing})}animateTo(t,r){var p;let{center:n,zoomLevel:i,bearing:s,pitch:l}=t,c=n!=null?n:this.center;return d(this,Nt).camera.animateTo({center:n!=null?[c.longitude,c.latitude,d(this,Nt).camera.elevation]:void 0,zoomLevel:i,bearing:s,pitch:l,duration:(p=r==null?void 0:r.duration)!=null?p:600,easing:r==null?void 0:r.easing})}set(t){let{center:r=this.center,zoomLevel:n=this.zoomLevel,bearing:i=this.bearing,pitch:s=this.pitch}=t,l=[r.longitude,r.latitude];d(this,Nt).camera.setCenter(l),d(this,Nt).camera.setZoomLevel(n),d(this,Nt).camera.setBearing(i),d(this,Nt).camera.setPitch(s)}get center(){let t=d(this,Nt).camera.center;return new Ct(t[1],t[0],void 0)}setAutoMinZoomLevel(t){d(this,Nt).camera.setAutoMinZoomLevel(t)}get autoMinZoomLevel(){return d(this,Nt).camera.autoMinZoomLevel}get zoomLevel(){return d(this,Nt).camera.zoomLevel}get pitch(){return d(this,Nt).camera.pitch}get minPitch(){return d(this,Nt).camera.minPitch}get maxPitch(){return d(this,Nt).camera.maxPitch}get bearing(){let t=d(this,Nt).camera.bearing;return(t<0?t+360:t)%360}get minZoomLevel(){return d(this,Nt).camera.minZoomLevel}get maxZoomLevel(){return d(this,Nt).camera.maxZoomLevel}setElevation(t){d(this,Nt).camera.setElevation(t)}get elevation(){return d(this,Nt).camera.elevation}animateElevation(t,r){return d(this,Nt).camera.animateElevation(t,r)}updateFacadesInView(){d(this,Nt).getSystems().geometryInFocusSystem.raycast()}};Nt=new WeakMap,o_=new WeakMap,id=new WeakSet,UT=o(function(t){var n,i,s,l,c,p;let r=d(this,Nt).camera.elevation;return Ct.is(t)&&t.floorId!=null?(i=(n=d(this,Nt).getState(t.floorId))==null?void 0:n.altitude)!=null?i:r:ua.is(t)?(l=(s=d(this,Nt).getState(t.id))==null?void 0:s.altitude)!=null?l:r:"floor"in t&&ua.is(t.floor)&&(p=(c=d(this,Nt).getState(t.floor.id))==null?void 0:c.altitude)!=null?p:r},"#getFloorAltitude"),M8=o(function(t){var s;let r=[],i=(Array.isArray(t)?t:[t]).flatMap(l=>{var c;return(c=l==null?void 0:l.focusTarget)!=null?c:[l]});for(let l of i)if(l!=null)if(Ct.is(l)){let c=ke(this,id,UT).call(this,l);r.push([l.longitude,l.latitude,c])}else if((l==null?void 0:l.id)!=null){let c=ke(this,id,UT).call(this,l);if(ua.is(l)&&((s=d(this,o_).getMapDataInternal())!=null&&s.enterpriseMode)){r.push(l.id);continue}else if("geoJSON"in l&&l.geoJSON.geometry.coordinates.length>0){us(l.geoJSON,h=>{r.push([h[0],h[1],c])});continue}let p=d(this,Nt).getBoundingArea(l.id);if(p)r.push(...p.map(h=>[h[0],h[1],c]));else if("geoJSONBoundingBox"in l){let h=ke(this,id,UT).call(this,l);if(l.geoJSONBoundingBox!=null){let y=[[l.geoJSONBoundingBox[0],l.geoJSONBoundingBox[1],h],[l.geoJSONBoundingBox[2],l.geoJSONBoundingBox[3],h]];r.push(...y)}}}else $E(l)&&r.push(l);return r},"#computeCoordinateCloud"),o(O8,"Camera");var i_=O8;g();var qv,L8=class L8{constructor({currentMapGetter:t}){G(this,qv);q(this,qv,t)}get currentMap(){return d(this,qv).call(this)}async getCurrentSceneGLTF(t){let r=d(this,qv).call(this);return r?r==null?void 0:r.Exporter.getCurrentSceneGLTF(t):(ce.error("There is no map to export. Please load a map first."),new Blob)}};qv=new WeakMap,o(L8,"Exporter");var s_=L8;g();var Tp,l_,A8=class A8{constructor({currentMapGetter:t}){G(this,Tp,new Map);G(this,l_);q(this,l_,t)}get currentMap(){return d(this,l_).call(this)}getById(t){return d(this,Tp).get(t)}add(t,r,n){let i=t.anchorTarget,s=this.currentMap;if(!s)throw new Error("currentMap should exist");let l=s.Labels.add(i,r,re(k({},n),{attachTo:Hv(t),rank:(n==null?void 0:n.rank)==null||(n==null?void 0:n.rank)==="initial"?"medium":n.rank})),c=new Lh(l.id.toString(),r,t);return d(this,Tp).set(c.id,{label:c,entityId:c.id}),c}all(t){var n;let r=[];return(n=this.currentMap)==null||n.Labels.all({onCreate:o((i,s,l)=>{let c=new Lh(i.toString(),s,l);d(this,Tp).set(c.id,{label:c,entityId:c.id}),r.push(c)},"onCreate"),labelOptions:t}),r}remove(t){var n;let r=d(this,Tp).get(t.id);r&&((n=this.currentMap)==null||n.Labels.remove(r),d(this,Tp).delete(t.id.toString()))}removeAll(){let t=[];return d(this,Tp).forEach(({label:r})=>{this.remove(r),t.push(r),d(this,Tp).delete(r.id.toString())}),t}};Tp=new WeakMap,l_=new WeakMap,o(A8,"Labels");var a_=A8;g();g();var D8={altitude:0,height:1,color:"#ffffff",opacity:1,width:.15},Coe={opacity:.25,color:"#a7d1ec",height:.8,width:.05,altitude:.1,cap:"square",visible:!1},woe=.5,k8=class k8{constructor(t,r,n=new Map){x(this,"containerId");x(this,"layers");x(this,"renderer");this.containerId=r,this.layers=n,this.renderer=t}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}};o(k8,"Layer");var od=k8,_y,R8=class R8{constructor(t,r,n,i,s,l,c,p){x(this,"id");x(this,"name");x(this,"elevation");x(this,"containerId");x(this,"externalId");x(this,"metadata");x(this,"shortName");x(this,"subtitle");x(this,"occluderId");x(this,"loaded",!1);x(this,"styleMap",{});x(this,"obstructions");x(this,"entrances");x(this,"spaces");x(this,"floorImages");x(this,"floorText");x(this,"renderer");x(this,"options");x(this,"layers",new Map);x(this,"footprint");x(this,"floorStackId");x(this,"multiFloorView");x(this,"mapDataInternal");x(this,"facadesByStyleId",new Map);G(this,_y);x(this,"load",o(()=>{var i,s,l,c,p,h,y,b,_,C,P,E,T,O;if(this.loaded||this.obstructions==null&&this.spaces==null)return this;this.loaded=!0;let t=this.renderer.addGroupContainer("".concat(pf,"-").concat(this.id),{},this.id);this.layers.set(pf,new od(this.renderer,t.id.toString()));let r=this.renderer.addGroupContainer("".concat(zc,"-").concat(this.id),{},this.id);this.layers.set(zc,new od(this.renderer,r.id.toString()));let n=this.renderer.addGroupContainer("".concat(Zi,"-").concat(this.id),{},this.id);if(this.layers.set(Zi,new od(this.renderer,n.id.toString())),((i=this.footprint)==null?void 0:i.geometry)!=null&&((s=this.footprint)==null?void 0:s.geometry.coordinates.length)!==0){let D=D8;if(this.obstructions!=null&&this.obstructions.features.length>0){let j=this.obstructions.features.filter(X=>X.geometry.type==="LineString"&&X.properties.kind==="Wall"&&X.properties.footprintComponent===!0);j!=null&&j.length>0&&(D=this.styleMap[(l=j[0].properties)==null?void 0:l.id])}let A=this.renderer.addGeometryGroup("Footprint-".concat(this.id),{features:[{geometry:this.footprint.geometry,properties:{id:"Footprint-Floor-".concat(this.id)}}]},re(k({},D),{height:(p=(c=this.multiFloorView)==null?void 0:c.floorHeight)!=null?p:10,altitude:0,visible:!1,opacity:this.elevation<0?1:.4,side:this.elevation<0?"back":"front",color:this.elevation<0?"#F0EEE8":D.color,renderOrder:2}),this.id);this.layers.set(px,new od(this.renderer,A.id.toString()));let R=this.renderer.addGroupContainer("".concat(B0,"-").concat(this.id),{},this.id);this.layers.set(B0,new od(this.renderer,R.id.toString())),this.occluderId=this.renderer.addOccluder(this.footprint,R.id)}if(this.spaces!=null&&this.spaces.features.length>0){let D=[],A=new Map;this.spaces.features.filter(Y=>{var N;return Y.geometry.type==="Polygon"&&((N=Y.properties.kind)==null?void 0:N.toLowerCase())!=="void"}).forEach(Y=>{var Z;let N=(Z=this.mapDataInternal)==null?void 0:Z.facadesBySpaceId[Y.properties.id];if(N){let ae=A.get(N.id)||[];A.set(N.id,[...ae,Y])}else D.push(Y)});let R=VT(D,this.styleMap),j=this.renderer.addGroupContainer("spaces-".concat(this.id),{},n),X=0;for(let[Y,N]of R){let Z=this.renderer.addGeometryGroup("Spaces-".concat(this.id,"-").concat(X),{features:N},Wv(Y,this.options),j);X++;let ae=j.id.toString();this.layers.get(Zi).layers.set(Y.id||ae,Z.id.toString())}if(A.size>0){let Y=this.renderer.addGroupContainer("".concat(Rm,"-").concat(this.id),{},this.id);this.layers.set(Rm,new od(this.renderer,Y.id.toString()));for(let[N,Z]of A){let ae=this.renderer.addGroupContainer(N,{focusable:!0},Y),se=this.renderer.addGroupContainer("".concat(N,"-geometry"),{},ae),U=VT(Z,this.styleMap),xe=0;for(let[ne,Pe]of U){let Ce=this.renderer.addGeometryGroup("Facades-".concat(this.id,"-").concat(N,"-").concat(xe),{features:Pe},re(k({},Wv(ne,this.options)),{renderOrder:3}),se);xe++;let Ue=ne.id||Ce.id.toString();this.layers.get(Rm).layers.set("".concat(N,"-").concat(Ue),Ce.id.toString()),this.facadesByStyleId.has(Ue)?(h=this.facadesByStyleId.get(Ue))==null||h.push(N):this.facadesByStyleId.set(Ue,[N])}}}}if(this.obstructions!=null&&this.obstructions.features.length>0){let D=this.obstructions.features.filter(se=>se.geometry.type==="Polygon"&&se.properties.kind==="object"),A=VT(D,this.styleMap),R=this.renderer.addGroupContainer("objects-".concat(this.id),{},n),j=0;for(let[se,U]of A){let xe=this.renderer.addGeometryGroup("Objects-".concat(this.id,"-").concat(j),{features:U},Wv(se,this.options),R);j++;let ne=R.id.toString();this.layers.get(Zi).layers.set(se.id||ne,xe.id.toString())}let X=this.obstructions.features.filter(se=>se.geometry.type==="LineString"&&se.properties.kind==="Wall"&&se.properties.footprintComponent===!1),Y=this.obstructions.features.filter(se=>se.geometry.type==="LineString"&&se.properties.kind==="Wall"&&se.properties.footprintComponent===!0),N=this.entrances,Z=D8,ae=D8;if(X!=null&&X.length>0){let se=this.styleMap[(y=X[0].properties)==null?void 0:y.id];se!=null&&(Z=k({},se)),ae=Z;let{walls:U,entrances:xe}=F8(X,(N==null?void 0:N.features)||[]),ne=Math.max(Z.height-.11,woe),Pe=re(k({},Coe),{height:ne}),Ce=this.renderer.addGeometryGroup("InteriorDoors-".concat(this.id),xe,Pe,n);this.layers.get(Zi).layers.set(k0,Ce.id.toString());let Ue=this.renderer.addGeometryGroup("Walls-".concat(this.id),{features:[U]},Wv(Z,this.options),n);this.layers.get(Zi).layers.set(Gd,Ue.id.toString())}if(Y!=null&&Y.length>0){let se=this.styleMap[(b=Y[0].properties)==null?void 0:b.id];se!=null&&(ae=re(k({},se),{id:Vc}));let{walls:U,entrances:xe}=F8(Y,(N==null?void 0:N.features)||[]),ne=Math.max(ae.height-.11,woe),Pe=re(k({},Coe),{height:ne}),Ce=this.renderer.addGeometryGroup("ExteriorDoors-".concat(this.id),xe,Pe,n);this.layers.get(Zi).layers.set(R0,Ce.id.toString());let Ue=this.renderer.addGeometryGroup("ExteriorWalls-".concat(this.id),{features:[U]},Wv(ae,this.options),n);this.layers.get(Zi).layers.set(Vc,Ue.id.toString())}}if(this.floorImages!=null){let D=this.renderer.addGroupContainer("images-".concat(this.id),{},this.id);for(let A of this.floorImages.features||[])"anchorId"in A.properties||"anchorId"in A.properties&&((_=A.properties)==null?void 0:_.anchorId)==null||this.renderer.addImage(xn(),A,{url:A.properties.path,flipImageToFaceCamera:(C=this.options.flipImagesToFaceCamera)!=null?C:!0},D);this.layers.set(oG,new od(this.renderer,D.id.toString()))}if(this.floorText!=null)for(let D of this.floorText.features||[]){let A=0;"geometryId"in D.properties?A=(E=(P=this.renderer.getState(D.properties.geometryId))==null?void 0:P.height)!=null?E:0:A=(T=D.properties.verticalOffset)!=null?T:0,this.renderer.addText3D(xn(),re(k({},D),{properties:re(k({},D.properties),{verticalOffset:A})}),{},this.id)}return(O=this.multiFloorView)!=null&&O.enabled&&this.renderer.setState(this.id,{altitude:this.elevation*this.multiFloorView.floorHeight}),this.renderer.render(),this},"load"));var y,b,_,C,P;this.id=r.id,this.options=s;let h=n.addGroupContainer(this.id,{visible:!1,interactive:!0,preloadGeometry:(y=s.preloadFloors)==null?void 0:y.map(E=>E.id).includes(r.id)},t);this.containerId=h.id.toString(),this.externalId=r.externalId,this.metadata=r.metadata,this.shortName=r.shortName,this.subtitle=r.subtitle,this.name=r.name,this.elevation=r.elevation,l!=null&&c!=null&&(this.styleMap=c,this.spaces=l.space[this.id],this.entrances=l.entrance[this.id],this.obstructions=l.obstruction[this.id],this.floorImages=(b=l.floorImages)==null?void 0:b[this.id],this.floorText=(C=(_=l.enterprise)==null?void 0:_.floorText)==null?void 0:C[this.id],this.footprint=(P=l["floor.geojson"])==null?void 0:P.features.find(E=>E.properties.id===r.id)),this.renderer=n,this.floorStackId=t,this.multiFloorView=i,this.mapDataInternal=p}get geoJSONBoundingBox(){if(d(this,_y))return d(this,_y);if(!this.footprint){ce.warn("Attempting to get bounding box with no footprint for floor ".concat(this.id));return}return q(this,_y,zT(this.footprint)),d(this,_y)}get visible(){return this.renderer.getState(this.containerId).visible}setVisible(t){this.renderer.setState(this.containerId,{visible:t})}};_y=new WeakMap,o(R8,"FloorObject");var u_=R8;g();var B8=50,$8=!1,UAe=1e3,Ti,Xv,Ep,lc,Ps,p_,Bh,Yv,Sy,Ha,G8,Cy,f_,d_,h_,m_,sd,Moe,g_,$h,U8,Ooe,Loe,wy,V8=class V8 extends Lt{constructor({currentMapGetter:r}){super();G(this,Ha);G(this,Ti);G(this,Xv,0);G(this,Ep);G(this,lc,!1);G(this,Ps,[]);G(this,p_,0);G(this,Bh,B8);G(this,Yv,!1);G(this,Sy,"collapsed");x(this,"expandedFactor",0);G(this,Cy,"all-floors");G(this,f_,o(()=>{let r=d(this,Ti).call(this);if(d(this,p_)===this.expandedFactor||r==null||!d(this,lc))return;q(this,p_,this.expandedFactor);let n=Ol(this.expandedFactor,0,1,0,this.distanceBetweenFloors),s=Ol(this.expandedFactor,0,.1,0,1)===0;d(this,Ps).forEach((l,c)=>{r.api.updateState(l.containerId,{visible:s?l.id===r.currentFloorId:!0,altitude:n*c})}),this.expandedFactor===0?(q(this,lc,!1),r.renderer.camera.setPanMode("default"),d(this,$h)&&d(this,$h).call(this)):this.expandedFactor===1&&(q(this,lc,!1),d(this,$h)&&d(this,$h).call(this))},"#handlePreRender"));G(this,d_,o(()=>{var r,n,i;this.expanded&&q(this,Xv,(n=(r=d(this,Ti).call(this))==null?void 0:r.renderer.camera.elevation)!=null?n:0),(i=d(this,Ti).call(this))==null||i.renderer.on("user-interaction-end",d(this,m_))},"#handleUserInteractionStart"));G(this,h_,o(()=>{var n;let r=d(this,Ti).call(this);if(r!=null&&this.expanded&&d(this,Yv)&&!d(this,lc)){let i=r.currentFloorId,s=[1/0,r.currentFloorId];for(let l=0;l<d(this,Ps).length;l++){let c=d(this,Ps)[l],p=Math.abs(((n=r.renderer.camera.elevation)!=null?n:0)-l*this.distanceBetweenFloors);p<this.distanceBetweenFloors/3&&(s[0]=p,s[1]=c.id)}s[1]!==r.currentFloorId&&(r.currentFloorId=s[1],d(this,Ps).forEach(l=>{r.api.updateState(l.containerId,{visible:d(this,Cy)==="all-floors"?!0:r.currentFloor.id===l.id})}),r.publish("floor-change",{reason:"stacked-maps-elevation-change",floorId:r.currentFloorId,previousFloorId:i}))}},"#determineCurrentMapBasedOnElevation"));G(this,m_,o(()=>{var n,i;let r=d(this,Ti).call(this);if(this.expanded&&r&&d(this,Xv)!==((n=r.renderer.camera.elevation)!=null?n:0)){let s=[1/0,r.currentFloorId,0];for(let l=0;l<d(this,Ps).length;l++){let c=d(this,Ps)[l],p=Math.abs(((i=r.renderer.camera.elevation)!=null?i:0)-l*this.distanceBetweenFloors);p<s[0]&&(s[0]=p,s[1]=c.id,s[2]=l*this.distanceBetweenFloors)}d(this,Yv)&&ke(this,Ha,Moe).call(this,s[2]),q(this,Xv,0),r.renderer.off("user-interaction-end",d(this,m_))}},"#handleUserInteractionEnd"));G(this,sd,null);G(this,g_,null);G(this,$h);G(this,wy);q(this,Ti,r);let n=d(this,Ti).call(this);n!=null&&n.id!=="outdoors"&&(n.renderer.on("user-interaction-start",d(this,d_)),n.renderer.on("camera-change",d(this,h_)),n.renderer.on("pre-render",d(this,f_)))}get state(){return d(this,Sy)}get expanded(){return d(this,Sy)!=="collapsed"}get distanceBetweenFloors(){if(d(this,Bh)==="auto"){if(d(this,wy)!=null)return d(this,wy);let r=ke(this,Ha,Loe).call(this);if(r)return q(this,wy,r),r}return typeof d(this,Bh)=="number"?d(this,Bh):B8}clearCachedFloorSeparationDistance(){q(this,wy,void 0)}get includedFloors(){var r;return(r=d(this,Ha,G8))!=null&&r.api.mapData?d(this,Ps).map(n=>{var i,s;return(s=(i=d(this,Ha,G8))==null?void 0:i.api.mapData)==null?void 0:s.getById("floor",n.id)}).filter(Boolean):[]}get floorVisibilityMode(){return d(this,Cy)}setFloorVisiblityMode(r){q(this,Cy,r);let n=d(this,Ti).call(this);n!=null&&d(this,Ps).forEach(i=>{n.api.updateState(i.containerId,{visible:d(this,Cy)==="all-floors"?!0:n.currentFloor.id===i.id})})}changeFloorOnElevationChanges(r){q(this,Yv,r)}async expand(r){var i,s,l;let n=d(this,Ti).call(this);if(n!=null)return(r==null?void 0:r.distanceBetweenFloors)==="auto"?q(this,Bh,"auto"):q(this,Bh,(i=r==null?void 0:r.distanceBetweenFloors)!=null?i:B8),q(this,Ps,(r==null?void 0:r.includedFloors)!=null&&(r==null?void 0:r.includedFloors.length)>0?r==null?void 0:r.includedFloors.map(c=>n.floorsById.get(c.id)).filter(Boolean):n.currentFloorStack.floorObjects),d(this,Ps).sort((c,p)=>c.elevation-p.elevation),d(this,Ps).length<=1||this.expanded===!0?Promise.resolve():(q(this,lc,!0),n.api.Camera.setPanMode((s=r==null?void 0:r.cameraPanMode)!=null?s:"elevation"),this.changeFloorOnElevationChanges((l=r==null?void 0:r.changeFloorOnElevationChanges)!=null?l:!0),ke(this,Ha,U8).call(this,"expand",r).then(()=>{q(this,Sy,"expanded"),this.publish("stacked-maps-state-change",{state:"expanded"})}).finally(()=>{q(this,lc,!1)}))}async collapse(r){let n=d(this,Ti).call(this);if(n!=null)return this.expanded===!0?(q(this,lc,!0),n.api.Camera.setPanMode("default"),this.changeFloorOnElevationChanges(!1),ke(this,Ha,U8).call(this,"collapse",r).then(()=>{q(this,Sy,"collapsed"),this.publish("stacked-maps-state-change",{state:"collapsed"})}).finally(()=>{q(this,lc,!1)})):Promise.resolve()}destroy(){let r=d(this,Ti).call(this);r!=null&&(r.renderer.off("user-interaction-start",d(this,d_)),r.renderer.off("camera-change",d(this,h_)),r.renderer.off("pre-render",d(this,f_)))}};Ti=new WeakMap,Xv=new WeakMap,Ep=new WeakMap,lc=new WeakMap,Ps=new WeakMap,p_=new WeakMap,Bh=new WeakMap,Yv=new WeakMap,Sy=new WeakMap,Ha=new WeakSet,G8=o(function(){return d(this,Ti).call(this)},"#currentMap"),Cy=new WeakMap,f_=new WeakMap,d_=new WeakMap,h_=new WeakMap,m_=new WeakMap,sd=new WeakMap,Moe=o(function(r){var i,s,l;d(this,sd)&&d(this,sd).stop();let n=d(this,Ti).call(this);n!=null&&(q(this,sd,new Va({elevation:(i=n.renderer.camera.elevation)!=null?i:0}).to({elevation:r},150).easing(Qi.Quadratic.Out).onComplete(()=>{var c;d(this,sd)&&((c=d(this,Ti).call(this))==null||c.renderer.getTweenGroup().remove(d(this,sd)))}).onUpdate(({elevation:c})=>{n.renderer.camera.setElevation(c)}).start()),(s=d(this,Ti).call(this))==null||s.renderer.getTweenGroup().add(d(this,sd)),(l=d(this,Ti).call(this))==null||l.renderer.render())},"#animateElevationTo"),g_=new WeakMap,$h=new WeakMap,U8=o(function(r,n){var c,p,h,y;d(this,Ep)&&d(this,Ep).stop();let i=d(this,Ti).call(this);if(i==null)return Promise.reject(new Error("No current map"));let s=d(this,Ps).indexOf(i.currentFloor),l=(c=i.renderer.camera.elevation)!=null?c:0;return q(this,g_,new Promise(b=>{q(this,$h,b)})),q(this,Ep,new Va({percentExpanded:this.expandedFactor}).to({percentExpanded:r==="expand"?1:0},(p=n==null?void 0:n.duration)!=null?p:UAe).easing(Kf[(n==null?void 0:n.easing)||"ease-in-out"]).onUpdate(({percentExpanded:b})=>{this.expandedFactor=b;let _=s*this.distanceBetweenFloors;i.renderer.camera.setElevation(r==="expand"?_*b:l*b)}).onComplete(()=>{var b;d(this,Ep)&&((b=d(this,Ti).call(this))==null||b.renderer.getTweenGroup().remove(d(this,Ep)))}).start()),d(this,Ep).cameraAnimation=!0,(h=d(this,Ti).call(this))==null||h.renderer.getTweenGroup().add(d(this,Ep)),(y=d(this,Ti).call(this))==null||y.renderer.render(),d(this,g_)},"#animate"),Ooe=o(function(r,n,i,s){let l=j8(r,i),c=n.clone(),p=j8(c,i);if(!im(l)||!im(p))return-1;let h=0,y;$8&&s.querySelectorAll(".debug-box").forEach(_=>_.remove());do{if(h>1e4)return-1;if(h+=20,c.position.z=h,c.updateMatrixWorld(),p.makeEmpty(),j8(c,i,p),y=l.intersectsBox(p),$8){let b=Eoe(l,"blue",s),_=Eoe(p,y?"red":"green",s);b.classList.add("debug-box"),_.classList.add("debug-box")}}while(y);return h},"#computeMinZOffsetToSeparateFirstTwoFloors"),Loe=o(function(){let r=d(this,Ti).call(this);if(!r)return;let n=r.renderer,i=n.getThreeScene();if(!r.api.mapData||!i)return;let l=d(this,Ps).length>0?d(this,Ps):r.currentFloorStack.floorObjects;if(l.length<2)return;let c=n.getInternalState().geometry3DMap.get(l[0].id),p=n.getInternalState().geometry3DMap.get(l[1].id);if(!c||!p)return;if(CE(c,"group-container"),CE(p,"group-container"),$8){let y=new co;y.setFromObject(c);let b=new co;if(b.setFromObject(p),c.children.forEach(D=>{D instanceof jt&&D.userData.debugBox&&Pi(D)}),p.children.forEach(D=>{D instanceof jt&&D.userData.debugBox&&Pi(D)}),!im(y)||!im(b))return;let _=new Cu(y.max.x-y.min.x,y.max.y-y.min.y,y.max.z-y.min.z),C=new _o({color:255,transparent:!0,opacity:.5}),P=new jt(_,C);P.position.set((y.min.x+y.max.x)/2,(y.min.y+y.max.y)/2,(y.min.z+y.max.z)/2),P.userData.debugBox=!0;let E=new Cu(b.max.x-b.min.x,b.max.y-b.min.y,b.max.z-b.min.z),T=new _o({color:"cyan",transparent:!0,opacity:.5}),O=new jt(E,T);O.position.set((b.min.x+b.max.x)/2,(b.min.y+b.max.y)/2,(b.min.z+b.max.z)/2),O.userData.debugBox=!0,c.add(P),p.add(O)}let h=ke(this,Ha,Ooe).call(this,c,p,n.getThreeCamera(),n.container);if(h!==-1)return h},"#computeZOffsetSeparatesFirstTwoFloorsInClipSpace"),wy=new WeakMap,o(V8,"StackedMaps");var c_=V8,Rh=new ht,Poe=new wt;function j8(e,t,r=new kN){return e.traverse(n=>{if(n instanceof jt){let s=n.geometry.attributes.position;if(t.position.distanceTo(n.position)<t.near)return;for(let c=0;c<s.count;c++)Rh.fromBufferAttribute(s,c),Rh.applyMatrix4(n.matrixWorld),Rh.applyMatrix4(t.matrixWorldInverse),Rh.applyMatrix4(t.projectionMatrix),Rh.z<1&&Rh.z>0&&(Poe.set(Rh.x,Rh.y),r.expandByPoint(Poe))}}),r}o(j8,"projectToBox2D");function Toe(e,t){let r=t.clientWidth,n=t.clientHeight;return new wt((e.x+1)*r/2,(1-e.y)*n/2)}o(Toe,"ndcToScreen");function Eoe(e,t,r){let n=document.createElement("div");n.style.position="absolute",n.style.border="2px solid ".concat(t),n.style.pointerEvents="none";let i=Toe(new wt(e.min.x,e.min.y),r),s=Toe(new wt(e.max.x,e.max.y),r);n.style.left="".concat(i.x,"px"),n.style.top="".concat(s.y,"px");let l=Math.abs(s.x-i.x),c=Math.abs(s.y-i.y);return n.style.width="".concat(l,"px"),n.style.height="".concat(c,"px"),r.appendChild(n),n}o(Eoe,"drawProjectedBox");g();g();function VAe(e,t){return"".concat(t," ").concat(e)}o(VAe,"formatMessage");var z8=class z8 extends Error{constructor(t,r=fN){super(VAe(t,r)),this.name="MappedinError"}};o(z8,"MappedinError");var Xs=z8;var Zv,q8=class q8{constructor(t,r,n,i){x(this,"id");x(this,"externalId");x(this,"name");x(this,"type");x(this,"floorIds");x(this,"defaultFloorId");x(this,"floorObjects",[]);x(this,"floorObjectsByElevation",new Map);x(this,"metadata");x(this,"containerId");x(this,"facade");x(this,"renderer");G(this,Zv);var l;this.id=t.id,this.externalId=t.externalId,this.name=t.name,this.type=t.type,this.metadata=t.metadata,this.floorIds=(l=t.floors)!=null?l:t.maps,this.defaultFloorId=t.defaultFloor,this.renderer=n;let s=n.addGroupContainer(this.id,{visible:!0,interactive:!0},r);this.containerId=s.id.toString(),this.facade=i}get defaultFloor(){if(d(this,Zv)==null){if(this.floorObjects.length===0)throw new Xs("No floors in floor stack (".concat(this.id,"). Could not get default floor."));let t;this.defaultFloorId&&(t=this.floorObjects.find(r=>r.id===this.defaultFloorId)),t||(t=this.floorObjects.reduce((r,n)=>Math.abs(n.elevation)<Math.abs(r.elevation)?n:r)),q(this,Zv,t)}return d(this,Zv)}addFloor(t){if(this.floorObjectsByElevation.has(t.elevation)){ce.error("Floor with same elevation ".concat(t.elevation," already exists in Stack (").concat(this.id,"). Floor (").concat(t.id,") will not be added."));return}t.load(),this.floorObjects.push(t),this.floorObjectsByElevation.set(t.elevation,t)}setFacadeVisible(t){var r,n;(n=(r=this.facade)==null?void 0:r.spaces)==null||n.forEach(i=>{this.renderer.setState(i.spaceId,{visible:t})})}};Zv=new WeakMap,o(q8,"FloorStackObject");var y_=q8;g();function Aoe(e,t,r,n){let i={outdoorOpacity:1,floorStates:[]},s=e.sort((y,b)=>y.elevation-b.elevation),l=Math.min(0,s[0].elevation),c=s[s.length-1].elevation,p,h;for(let y=l;y<=c;y++){let b=s.find(T=>T.elevation===y);if(b==null){y>=0&&(p==null?p=y:h=y);continue}let _=0,C=y<0?Math.abs(b.elevation)*r:r,P=!1;if(p===0&&h!=null){let T=r*h;_=-T,C=T,P=!0}else if(p!=null&&h!=null){let T=p,O=e.find(A=>A.elevation===T-1),D=i.floorStates.find(A=>A.floor===O);if(D){let A=r*(h-p+2);D.state.footprint=re(k({},D.state.footprint),{altitude:0,height:A,visible:!0})}}p=void 0,h=void 0;let E={floor:b,state:{type:"floor",visible:!1,geometry:{visible:!1},labels:{enabled:!1},markers:{enabled:!1},footprint:{visible:!1},occlusion:{enabled:!1}}};i.floorStates.push(E),b.id===t.id?(E.state.visible=!0,E.state.geometry.visible=!0,E.state.labels.enabled=!0,E.state.markers.enabled=!0,E.state.occlusion.enabled=!0,(b.elevation<0||P)&&(b.elevation<0&&(i.outdoorOpacity=.2),E.state.footprint.height=C,E.state.footprint.altitude=_,E.state.footprint.visible=!0)):n.includes(b.id)&&b.elevation<t.elevation?(E.state.visible=!0,E.state.geometry.visible=!0,E.state.markers.enabled=!0,E.state.occlusion.enabled=!0,E.state.footprint.visible=!0,b.elevation<0?(E.state.footprint.height=C,E.state.footprint.altitude=_,i.outdoorOpacity=.2):(E.state.footprint.height=C,E.state.footprint.altitude=_)):t.elevation>0&&b.elevation<t.elevation&&b.elevation>=0&&(E.state.visible=!0,E.state.footprint.visible=!0,E.state.footprint.height=r,E.state.footprint.altitude=_)}return i}o(Aoe,"getVisiblityState");var zAe={linear:Qi.Linear.None,easeIn:Qi.Quadratic.In,easeOut:Qi.Quadratic.Out,easeInOut:Qi.Quadratic.InOut},Mp,X8=class X8 extends Lt{constructor(r,n,i,s){var h,y,b,_;super();x(this,"floorStacksById",new Map);x(this,"floorsById",new Map);x(this,"currentFloorId","");x(this,"currentFloorStackId","");x(this,"outdoorFloorStacks",new Set);x(this,"id");x(this,"renderer");x(this,"api");x(this,"mvf");x(this,"options",{});x(this,"styleMap");x(this,"StackedMaps");x(this,"animations",new Map);x(this,"Models",{add:o((r,n,i)=>{let b=i,{floorId:s,scale:l}=b,c=ls(b,["floorId","scale"]),p=s?this.floorsById.get(s):this.currentFloor,h=k({},c);l!=null&&(h.scale=Array.isArray(i.scale)?i.scale:[i.scale,i.scale,i.scale]);let y=this.renderer.addModelGroup(r,{type:"FeatureCollection",features:n.map(_=>{var C;return{type:"Feature",properties:{id:xn(),rotation:i.rotation,scale:h.scale,interactive:i.interactive,verticalOffset:_.verticalOffset+((C=i.verticalOffset)!=null?C:0)},geometry:{type:"Point",coordinates:uu(_)}}})},h,{parent:p.id});if(y==null)throw new Xs("error creating model");return this.renderer.getState(y).children},"add"),remove:o((r,n)=>{this.renderer.remove(r),this.renderer.getState(n).children.length===0&&this.renderer.remove(n)},"remove")});x(this,"Images",{add:o((r,n,i)=>{let y=i,{floorId:s,flipImageToFaceCamera:l}=y,c=ls(y,["floorId","flipImageToFaceCamera"]),p=s?this.floorsById.get(s):this.currentFloor,h={type:"Feature",properties:c,geometry:{type:"Point",coordinates:r}};return this.renderer.addImage(xn(),h,{url:n,flipImageToFaceCamera:l!=null?l:!1},p.id)},"add"),remove:o(r=>{this.renderer.remove(r)},"remove"),removeAll:o(()=>{},"removeAll")});x(this,"Markers",{add:o((r,n,i)=>{let s=W8(r,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),b=i,{attachTo:l}=b,c=ls(b,["attachTo"]),p=c;c.rank==="initial"&&(p.rank="medium");let h=s.layers.get(zc),y=this.renderer.addMarker2D(uu(r),n,re(k({},p),{occluderId:s==null?void 0:s.occluderId,attachTo:l}),h==null?void 0:h.containerId);if(!y)throw new Xs("Failed to create Marker");return y},"add"),remove:o(r=>{this.renderer.remove(r)},"remove"),getContentEl:o(r=>{let n=this.renderer.getState(r);if((n==null?void 0:n.type)==="marker")return n.element},"getContentEl"),removeAll:o(()=>{},"removeAll"),setPosition:o((r,n,i)=>{var c;let s=this.renderer.getState(r),l=i?this.floorsById.get(i):this.currentFloor;if(!s){ce.error('Failed to retrieve state for Marker with id "'.concat(r,'".'));return}if(s.type!=="marker"){ce.error('Geometry with id "'.concat(r,'" is not of type "marker".'));return}this.renderer.setState(s,{position:n,parent:(c=l==null?void 0:l.layers.get(zc))==null?void 0:c.containerId})},"setPosition"),animateTo:o((r,n,i,s)=>{let l=this.renderer.getState(r),c=i?this.floorsById.get(i):this.currentFloor;if(!l)return ce.error('Failed to retrieve state for Marker with id "'.concat(r,'".')),Promise.resolve();if(l.type!=="marker")return ce.error('Geometry with id "'.concat(r,'" is not of type "marker".')),Promise.resolve();let p=k({duration:1e3,easing:"ease-in-out"},s);this.cancelAnimation(r);let h=new Va({lon:l.position[0],lat:l.position[1]}).to({lon:n[0],lat:n[1]},p.duration).easing(zAe[p.easing]).onUpdate(({lon:y,lat:b})=>{var C;if(!this.renderer.getState(r))this.cancelAnimation(r);else{let P=(C=c==null?void 0:c.layers.get(zc))==null?void 0:C.containerId;P&&this.Markers.setPosition(r,[y,b],P)}}).start();return this.renderer.getTweenGroup().add(h),this.renderer.render(),this.animations.set(r,h),H8(h).then(()=>{this.animations.delete(r)})},"animateTo")});x(this,"Exporter",{getCurrentSceneGLTF:o(async r=>this.renderer.getCurrentSceneGLTF(r),"getCurrentSceneGLTF")});x(this,"Shapes",{add:o((r,n,i)=>{let s=i!=null&&i.floorId?this.floorsById.get(i==null?void 0:i.floorId):this.currentFloor,l=xn();return this.renderer.addGeometryGroup(l,r,n,s.id),l},"add"),remove:o(r=>(this.renderer.remove(r.id),r.id),"remove")});x(this,"Text3D",{label:o((r,n,i)=>{var l;if(!((l=this.api.getMapDataInternal())!=null&&l.enterpriseMode)){ce.warn("Enterprise mode is not enabled, skipping label creation");return}let s=Doe(this.renderer,r,n,i);if(s)return{textInfo:s,target:r}},"label"),labelAll:o((r={})=>{var s;if(!((s=this.api.getMapDataInternal())!=null&&s.enterpriseMode))return ce.warn("Enterprise mode is not enabled, skipping label creation"),[];let n=this.api.getMapData();if(!n)return[];let i=[];return n.getByType("space").forEach(l=>{var c,p;if(l.locations[0]){let h=Doe(this.renderer,l,(p=(c=l.locations[0])==null?void 0:c.name)!=null?p:l.name,r);h&&i.push({textInfo:h,target:l})}}),i},"labelAll"),remove:o(r=>{var n;if(!((n=this.api.getMapDataInternal())!=null&&n.enterpriseMode)){ce.warn("Remove text label only works in enterprise mode");return}return this.renderer.remove(r),r},"remove")});x(this,"Labels",{all:o(({onCreate:r,labelOptions:n={}})=>{for(let i of Object.entries(this.mvf.space)){let[s,l]=i;l&&l.features.forEach(c=>{var E,T,O,D,A;let p=(E=this.api.getMapData())==null?void 0:E.getById("space",c.properties.id);if(!p)return;let h=(T=this.styleMap[c.properties.id])==null?void 0:T.showImage,y=(O=c.properties.details)==null?void 0:O.images,b=h&&((D=y==null?void 0:y[0])!=null&&D.url)?{icon:y[0].url}:{},_=k({marker:k(k({},b),(A=n.appearance)==null?void 0:A.marker)},n.appearance),P=(s?this.floorsById.get(s):this.currentFloor).layers.get(pf);if(c.properties.center&&p.name!==""){let R=this.renderer.addLabel2D(c.properties.center,p.name,re(k({id:c.properties.id+"-label"},n),{appearance:_,rank:n.rank,attachTo:Hv(p)}),wo.is(p)?p.id:P==null?void 0:P.containerId);R&&r(R.id,p.name,p)}})}},"all"),add:o((r,n,i={})=>{let y=i,{attachTo:s}=y,l=ls(y,["attachTo"]),c=W8(r,this.floorsById,this.api.mapObjects[0].floorsById.get("default-floor")),p=c.layers.get(pf),h=this.renderer.addLabel2D(uu(r),n,re(k({},l),{occluderId:c.occluderId,attachTo:s}),p==null?void 0:p.containerId);if(!h)throw new Xs("label creating failed");return h},"add"),remove:o(({entityId:r})=>{this.renderer.remove(r)},"remove"),removeAll:o(()=>{},"removeAll")});x(this,"Paths",{add:o((r,n)=>{var h;let i=(h=n==null?void 0:n.animateDrawing)!=null?h:!0,s=[],l=r[0].floorId||"root",c=0;for(let y of r){let{floorId:b="root",latitude:_,longitude:C}=y;b!==l&&(c++,l=b),s[c]==null&&s.push({floorId:b,coordinates:[]});let P=b===y.floorId?y:new Ct({longitude:C,latitude:_,floorId:b});s[c].coordinates.push(P)}let p=s.reduce((y,{floorId:b,coordinates:_},C)=>{if(C!==0){let E=s[C-1],T=E.coordinates[E.coordinates.length-1],O=_[0],D=uu(T),A=uu(O),R=this.renderer.addPath({type:"FeatureCollection",features:[{type:"Feature",properties:{parentId:E.floorId},geometry:{type:"Point",coordinates:D}},{type:"Feature",properties:{parentId:b},geometry:{type:"Point",coordinates:A}}]},n,this.id);R&&(n!=null&&n.animateDrawing&&this.renderer.setState(R.id,{completeFraction:0}),y.push(re(k({},R),{coordinates:[T,O]})))}let P=this.renderer.addPath({type:"FeatureCollection",features:_.map(E=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:uu(E)}}))},n,b);return P&&(n!=null&&n.animateDrawing&&this.renderer.setState(P.id,{completeFraction:0}),y.push(re(k({},P),{coordinates:_}))),y},[]);if(i){let y=[],b=this.api.getMapData();return p.forEach(_=>{var P;let C=Noe(_,b,this.api);y.push(new Va({fraction:0}).to({fraction:1},C===!1?0:(P=n==null?void 0:n.drawDuration)!=null?P:1500).onUpdate(E=>{this.renderer.setState(_.id,{completeFraction:E.fraction})}))}),y.forEach((_,C)=>{C<y.length-1&&_.chain(y[C+1]),this.renderer.getTweenGroup().add(_)}),y[0].start(),this.renderer.render(),this.animations.set(p[0].id.toString(),y[0]),{paths:p,animation:H8(y[y.length-1]).then(()=>{this.animations.delete(p[0].id.toString())})}}else return{paths:p,animation:Promise.resolve()}},"add"),remove:o(r=>{r.forEach(n=>{this.cancelAnimation(n),this.renderer.remove(n)})},"remove")});G(this,Mp,{enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0});this.renderer=s.core,this.api=s,this.id=r,this.renderer.addGroupContainer(r,{},"root"),this.options=i!=null?i:{},this.StackedMaps=new c_({currentMapGetter:o(()=>this,"currentMapGetter")}),this.mvf=(h=n==null?void 0:n.mvf)!=null?h:{};let l=Foe(this.mvf["styles.json"]||{});if(this.styleMap=l,q(this,Mp,k({enabled:!1,floorHeight:10,updateCameraElevationOnFloorChange:!0},i==null?void 0:i.multiFloorView)),!n){this.id!=="outdoors-container"&&ce.warn("Map (".concat(this.id,") created with no data."));let C=new y_({id:"default-stack",externalId:"default-stack",name:"Default Stack",maps:["default-floor"]},this.id,this.renderer);this.floorStacksById.set(C.id,C),this.currentFloorStackId=C.id;let P=new u_(C.id,{id:"default-floor",externalId:"default-floor",name:"Default Floor",elevation:0},this.renderer,d(this,Mp),i!=null?i:{});C.addFloor(P),this.floorsById.set(P.id,P),this.setFloor(P.id);return}let c=n.getMVFFeatureByType("floor-stack");if(c==null||c.length===0)throw new Xs("MVF does not contain any Floor Stacks.");for(let C of c){let P=new y_(C,this.id,this.renderer,(y=this.mvf.facade)==null?void 0:y[C.id]);if(P.floorIds.length!==0){for(let E of P.floorIds){let T=n.getMVFFeatureById("floor",E);if(T!=null){let O=this.mvf.space[T.id],D=this.mvf.obstruction[T.id];if((O==null||O.features.length===0)&&(D==null||D.features.length===0))continue;let A=new u_(P.id,T,this.renderer,d(this,Mp),i!=null?i:{},this.mvf,l,n);P.addFloor(A),this.floorsById.set(A.id,A)}}this.floorStacksById.set(C.id,P),this.currentFloorStackId||(this.currentFloorStackId=C.id)}}for(let[C]of Object.entries(n.facadesBySpaceId)){let P=n.getById("space",C);P&&(this.outdoorFloorStacks.add(P.floor.floorStack.id),(b=this.floorsById.get(P.floor.id))==null||b.setVisible(!0))}let p=(_=this.mvf.enterprise)==null?void 0:_.venue.defaultMap;if(i!=null&&i.initialFloor){let C=Nb(i.initialFloor);C&&this.floorsById.has(C)?p=C:ce.error("Invalid initial floor specified (".concat(i.initialFloor,"), using default behavior instead"))}p||(p=this.currentFloorStack.defaultFloor.id),this.setFloor(p)}get currentFloorStack(){let r=this.floorStacksById.get(this.currentFloorStackId);if(!r)throw new Xs('Current floor stack with id "'.concat(this.currentFloorStackId,'" not found'));return r}setFloorStack(r,n){if(this.currentFloorStackId===r)return;let i=this.floorStacksById.get(r);if(i==null){ce.error("Invalid floor stack passed to setFloorStack (".concat(r,"), the floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}if(i.floorObjects.length===0){ce.error("Floor stack (".concat(r,") has no floors. The floor stack was not changed. Current floor stack is still ").concat(this.currentFloorStack.id,"."));return}this.setFloor(i.defaultFloor.id,n)}get currentFloor(){let r=this.floorsById.get(this.currentFloorId);if(!r)throw new Xs('Floor with id "'.concat(this.currentFloorId,'" not found'));return r}get floors(){return Array.from(this.floorsById.values())}processFloorChange(r){var s,l,c,p,h;if(this.api.manualFloorVisibility===!0||this.StackedMaps.expandedFactor!==0)return;let n=this.floorsById.get(r),i=this.floorStacksById.get(this.currentFloorStackId);if(n&&i)if(!((s=d(this,Mp))!=null&&s.enabled)||n.floorStackId!==(i==null?void 0:i.id))for(let y of this.floorStacksById.values())y.floorObjects.forEach(b=>{b.id!==r&&b.setVisible(!1)});else{let y=Aoe(this.currentFloorStack.floorObjects,n,d(this,Mp).floorHeight,((c=(l=this.api.Navigation)==null?void 0:l.floors)==null?void 0:c.map(b=>b.id))||[]);(h=(p=this.api)==null?void 0:p.Outdoor)==null||h.setOpacity(y.outdoorOpacity),y.floorStates.forEach(b=>{b.floor&&this.api.updateState(b.floor.id,b.state)}),d(this,Mp).updateCameraElevationOnFloorChange&&this.api.Camera.setElevation(n.elevation*d(this,Mp).floorHeight)}}setFloor(r,n){if(this.currentFloorId===r)return;if(!this.floorsById.get(r)){ce.error("Invalid floor passed to setFloor (".concat(r,"), the floor was not changed. Current floor is still ").concat(this.currentFloor.id));return}let s=this.currentFloorId;this.publish("floor-change-start",{previousFloorId:s,floorId:r,reason:n}),!this.StackedMaps.expanded&&this.currentFloorStack&&this.processFloorChange(r),this.currentFloorId=r,this.currentFloorStackId=this.currentFloor.floorStackId,this.currentFloor.setVisible(!0),this.publish("floor-change",{reason:n,floorId:this.currentFloor.id,previousFloorId:s})}cancelAnimation(r){let n=this.animations.get(r);n&&(n.stop(),this.animations.delete(r),this.renderer.getTweenGroup().remove(n))}};Mp=new WeakMap,o(X8,"GeojsonApiMapObject");var v_=X8;function Doe(e,t,r,n){return e.labelText3D(t.id,r!=null?r:t.name,re(k({},n),{parentId:t.floor.id}))}o(Doe,"labelSpace");g();var uc,x_,Y8=class Y8{constructor({currentMapGetter:t}){G(this,uc,new Map);G(this,x_);q(this,x_,t)}get currentMap(){return d(this,x_).call(this)}getById(t){return d(this,uc).get(t)}add(t,r,n){let i=t.anchorTarget;if(!i)throw new Error("get coordinate failed");let s=this.currentMap;if(!s)throw new Error("currentMap should exist");let l=s.Markers.add(i,r,re(k({},n),{rank:(n==null?void 0:n.rank)||"medium",dynamicResize:(n==null?void 0:n.dynamicResize)||!1,attachTo:Hv(t)}));if(l==null)throw new Error("error creating marker");let c=s.Markers.getContentEl(l.id.toString());if(!c)throw new Error("marker component should exist");let p=new ed(l.id.toString(),c,t);return d(this,uc).set(p.id,{marker:p,entityId:l.id.toString()}),p}remove(t){var n;let r=d(this,uc).get(t.id);r&&((n=this.currentMap)==null||n.Markers.remove(r.entityId),d(this,uc).delete(t.id.toString()))}removeAll(){let t=[];return d(this,uc).forEach(({marker:r})=>{this.remove(r),t.push(r),d(this,uc).delete(r.id.toString())}),t}setPosition(t,r){var l;let n=r.anchorTarget;if(!n){ce.error("Cannot determine coordinate from target.");return}let i=this.currentMap;if(!i){ce.error("Cannot determine the current map.");return}let s=d(this,uc).get(t.id);if(!s){ce.error('Cannot find the Marker with id "'.concat(t.id,'".'));return}i.Markers.setPosition(s.entityId,uu(n),(l=n.floorId)!=null?l:i.currentFloorId),s.marker.updateTarget(r)}animateTo(t,r,n){var c;let i=r.anchorTarget;if(!i)return ce.error("Cannot determine coordinate from target."),Promise.resolve();let s=this.currentMap;if(!s)return ce.error("Cannot determine the current map."),Promise.resolve();let l=d(this,uc).get(t.id);return l?(l.marker.updateTarget(r),s.Markers.animateTo(l.entityId,uu(i),(c=i.floorId)!=null?c:s.currentFloorId,n)):(ce.error('Cannot find the Marker with id "'.concat(t.id,'".')),Promise.resolve())}};uc=new WeakMap,x_=new WeakMap,o(Y8,"Markers");var b_=Y8;g();var ad,__,Z8=class Z8{constructor({currentMapGetter:t}){G(this,ad,new Map);G(this,__);q(this,__,t)}get currentMap(){return d(this,__).call(this)}getById(t){return d(this,ad).get(t)}add(t,r,n){var p;let i=t.anchorTarget;if(!i)throw new Error("Target does not implement IAnchorable.");let s=this.currentMap;if(!s)throw new Error("currentMap should exist");let l=s.Images.add(uu(i),r,re(k({},n),{floorId:i.floorId,verticalOffset:i.verticalOffset+((p=n.verticalOffset)!=null?p:0)}));if(!l)throw new Error("image component should exist");let c=new K2(l.id.toString(),r,t);return d(this,ad).set(c.id,{image:c,entityId:l.id.toString()}),c}remove(t){var n;let r=d(this,ad).get(t.id);r&&((n=this.currentMap)==null||n.Images.remove(r.entityId),d(this,ad).delete(t.id.toString()))}removeAll(){let t=[];return d(this,ad).forEach(({image:r})=>{this.remove(r),t.push(r),d(this,ad).delete(r.id.toString())}),t}};ad=new WeakMap,__=new WeakMap,o(Z8,"Images");var I_=Z8;g();var Op,C_,K8=class K8{constructor({currentMapGetter:t}){G(this,Op,new Map);G(this,C_);q(this,C_,t)}get currentMap(){return d(this,C_).call(this)}getById(t){return d(this,Op).get(t)}add(t,r,n){let i=[t],s=i.reduce((p,h)=>{var y;return h?(p.has(h.floorId)||p.set(h.floorId,[]),(y=p.get(h.floorId))==null||y.push(h),p):(ce.error("Cannot determine coordinate from options."),p)},new Map);if(!i.length)throw new Error("targets should not be empty when adding a model");let l=this.currentMap;if(!l)throw new Error("currentMap should exist");let c=[];return s.forEach((p,h)=>{let y=xn();l.Models.add(y,p,re(k({},n),{url:r,floorId:h})).forEach(({id:_})=>{let C=new by(_.toString(),y,p[0]);d(this,Op).set(C.id,{model:C,entityId:_.toString(),groupId:y}),c.push(C)})}),c[0]}remove(t){var n;let r=d(this,Op).get(t.id);r&&((n=this.currentMap)==null||n.Models.remove(r.entityId,r.groupId),d(this,Op).delete(t.id.toString()))}removeAll(){let t=[];return d(this,Op).forEach(({model:r})=>{var i;let n=d(this,Op).get(r.id);n&&(t.push(r),(i=this.currentMap)==null||i.Models.remove(n.entityId,n.groupId),d(this,Op).delete(r.id.toString()))}),t}};Op=new WeakMap,C_=new WeakMap,o(K8,"Models");var S_=K8;g();var Lp,P_,J8=class J8{constructor({currentMapGetter:t}){G(this,Lp,new Map);G(this,P_);q(this,P_,t)}get currentMap(){return d(this,P_).call(this)}getById(t){return d(this,Lp).get(t)}add(t,r){let n=this.currentMap;if(!n)throw new Error("currentMap should exist");let i=n.Paths.add(t,r),s=i.paths.map(c=>c.id.toString()),l=new ic(xn(),i.animation,t,i.paths);for(let c of s)d(this,Lp).set(c,{path:l,entityIds:s});return d(this,Lp).set(l.id,{path:l,entityIds:s}),l}remove(t){var n;let r=d(this,Lp).get(t.id);r&&((n=this.currentMap)==null||n.Paths.remove(r.entityIds),d(this,Lp).delete(t.id),r.entityIds.forEach(i=>d(this,Lp).delete(i)))}removeAll(){let t=[];return d(this,Lp).forEach(({path:r})=>{this.remove(r),t.push(r)}),t}};Lp=new WeakMap,P_=new WeakMap,o(J8,"Paths");var w_=J8;g();var Woe=Pn(B7(),1);g();var Q8="#2266ff",qAe="#808080",koe="#f5f5f5";var Roe={radius:10,color:Q8,inactiveColor:qAe,heading:{color:Q8,opacity:.7},accuracyRing:{color:Q8,opacity:.3},timeout:3e4,watchDevicePosition:!0,debug:!1};g();var Boe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";g();var $oe=o((e,t,r=0)=>{if(Math.abs(e)>=Math.PI)throw new Error("Sector angle too wide!");let n=r/Math.tan(e/2),i=r/Math.sin(e/2),s=i+t,l=10,c=new Pc;c.moveTo(-i*Math.sin(e/2),i*Math.cos(e/2)-n);for(let p=0;p<l;p++)c.lineTo(-(s*Math.sin(e/2-e/l*p)),s*Math.cos(e/2-e/l*p)-n);for(let p=0;p<l;p++)c.lineTo(-(r*Math.sin(Math.PI/-2+Math.PI/l*p)),r*Math.cos(Math.PI/-2+Math.PI/l*p));return new Tc(c,{depth:.1,bevelEnabled:!1,UVGenerator:WAe(t)})},"createSectorGeometry"),eF=o((e,t,r)=>{let i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2))/r;return i>1?i=1:i<0&&(i=0),new wt(0,i)},"generateRadialUV"),WAe=o(e=>({generateTopUV:o((t,r,n,i,s)=>{let l=r[n*3],c=r[n*3+1],p=r[i*3],h=r[i*3+1],y=r[s*3],b=r[s*3+1];return[eF(l,c,e),eF(p,h,e),eF(y,b,e)]},"generateTopUV"),generateSideWallUV:o(()=>[new wt(0,1),new wt(0,1),new wt(0,1),new wt(0,1)],"generateSideWallUV")}),"radialUVGenerator");function joe(e,t){if(t==null)return e;let r={latitude:e==null?void 0:e.latitude,longitude:e==null?void 0:e.longitude,accuracy:e==null?void 0:e.accuracy,floor:e==null?void 0:e.floor,heading:e==null?void 0:e.heading};return"latitude"in t&&(r.latitude=(t==null?void 0:t.latitude)==null||t.latitude==="device"?e==null?void 0:e.latitude:t.latitude),"longitude"in t&&(r.longitude=t.longitude==null||t.longitude==="device"?e==null?void 0:e.longitude:t.longitude),"accuracy"in t&&(r.accuracy=t.accuracy==="device"?e==null?void 0:e.accuracy:t.accuracy),"floor"in t&&(r.floor=t.floor==="device"?e==null?void 0:e.floor:t.floor),"heading"in t&&(r.heading=t.heading==="device"?e==null?void 0:e.heading:t.heading),r}o(joe,"getPositionWithOverrides");function XAe([e,t],[r,n],[i,s]){let l=r-e,c=n-t,p=l**2+c**2;if(p===0)return;let h=((i-e)*l+(s-t)*c)/p,y;h<=0?y=[e,t]:h>=1?y=[r,n]:y=[e+h*l,t+h*c];let b=dS([i,s],y);return{proportion:Math.max(0,Math.min(1,h)),intersection:y,distance:b}}o(XAe,"getPointLineIntersection");function Goe(e,t){if(e==null||e.length<2)return;let r=Number.MAX_SAFE_INTEGER,n,i=0,s=0;for(let l=0;l<e.length-1;l++){let c=e[l],p=e[l+1],h=XAe(c,p,t);h!=null&&h.distance<r&&(r=h.distance,n=h.intersection,i=l,s=h.proportion)}if(n)return{intersection:n,distance:r,segmentIndex:i,proportion:s}}o(Goe,"findBlueDotOnPath");function Uoe(e,t){let r=new Pu({color:e,opacity:t,transparent:!0,depthTest:!1,depthWrite:!1}),n=.35,i=.35*4,s=$oe(Math.PI/6,i,n);new t0().load(Boe,c=>{r.alphaMap=c,r.needsUpdate=!0});let l=new jt(s,r);return l.position.z=-.05,l.renderOrder=0,l}o(Uoe,"createHeadingCone");function Voe(e,t){let r=new uS(1,1,.05,32),n=new Pu({transparent:!0,color:e,opacity:t,depthTest:!1,depthWrite:!1}),i=new jt(r,n);return i.scale.set(0,0,.05),i.renderOrder=1,i.rotation.x=Math.PI/2,i}o(Voe,"createAccuracyRing");function zoe(e){let t=new uS(.35,.35,.07,32),r=new Pu({transparent:!0,color:koe,depthTest:!1,depthWrite:!1}),n=new jt(t,r);n.renderOrder=2;let i=new uS(.35*.8,.35*.8,.01,32),s=new Pu({transparent:!0,color:e,depthTest:!1,depthWrite:!1}),l=new jt(i,s);return l.renderOrder=3,n.rotation.x=Math.PI/2,n.position.z=.07/2,l.rotation.x=Math.PI/2,l.position.z=.07,{outerMesh:n,innerMesh:l}}o(zoe,"createBlueDot");var Xoe=Pn(qoe(),1);var XT="blue-dot",Py,ld,yl,vl,ud,Ty,Ey,My,eo,Wa,T_,cd,E_,M_,O_,L_,HT,Ap,pd,WT,Oy,A_,Dp,tF=class tF extends Lt{constructor(r,n){super();this.core=r;this.geoJSONApi=n;G(this,Py,null);x(this,"geometry");G(this,ld);G(this,yl);G(this,vl);G(this,ud);G(this,Ty);G(this,Ey);G(this,My);G(this,eo,Roe);G(this,Wa,1);G(this,T_);G(this,cd);x(this,"state","disabled");x(this,"following",!1);G(this,E_,o(r=>{var n;return(n=this.geoJSONApi.getMapData())==null?void 0:n.getById("floor",r)},"#getFloorByFloorId"));G(this,M_,o(r=>{var i;let n;if(r!=null){let s=(i=this.geoJSONApi.currentMap)==null?void 0:i.currentFloorStack.floorObjectsByElevation.get(r);n=s?d(this,E_).call(this,s.id):void 0}return n},"#getFloorByFloorLevel"));G(this,O_,o(r=>{if(this.state==="hidden"||this.state==="disabled")return;let[n,i,s,l]=r.children;if(d(this,HT).call(this),i.scale.set(d(this,Wa),d(this,Wa),d(this,Wa)),i.position.z=.07/2*d(this,Wa),s.scale.set(d(this,Wa),d(this,Wa),d(this,Wa)),s.position.z=.07*d(this,Wa),this.state==="active"){s.material.color.set(d(this,eo).color);let c=this.accuracy;c!=null?(n.visible=!0,d(this,Ey)&&d(this,Ey).stop(),q(this,Ey,new Va({scale:n.scale.x}).to({scale:c/2},150).onUpdate(({scale:h})=>{n.scale.set(h,1,h)}).start()),this.core.getTweenGroup().add(d(this,Ey))):n.visible=!1;let p=this.heading;if(p!=null){l.visible=!0,d(this,My)&&d(this,My).stop();let{start:h,end:y}=hS(l.rotation.z,-Yt.degToRad(p));q(this,My,new Va({rotation:h}).to({rotation:y},150).onUpdate(({rotation:b})=>{l.rotation.z=b}).start()),this.core.getTweenGroup().add(d(this,My)),l.scale.set(d(this,Wa),d(this,Wa),1)}else l.visible=!1}else this.state==="inactive"&&(s.material.color.set(d(this,eo).inactiveColor),l.visible=!1,n.visible=!1)},"#updateGeometryPerFrame"));G(this,L_,o(r=>{var l,c;let n;try{n=QAe.parse(joe(r,d(this,yl)))}catch(p){d(this,Ap).call(this,"error"),ce.error("BlueDot: Position parse failed",p instanceof le.ZodError?p.message:String(p)),this.publish("error");return}d(this,eo).debug&&ce.log("BlueDot: Parsed position",n),q(this,vl,n),d(this,Ap).call(this,"position-update"),d(this,ud)&&clearTimeout(d(this,ud)),typeof d(this,eo).timeout=="number"&&d(this,eo).timeout<1/0&&q(this,ud,setTimeout(()=>{d(this,eo).debug&&ce.log("BlueDot: Position timed out after ".concat(d(this,eo).timeout,"ms")),d(this,Ap).call(this,"timeout"),this.core.render()},d(this,eo).timeout)),(c=this.geoJSONApi.getMapDataInternal())==null||c.Analytics.updateState({userPosition:{bluedotTimestamp:Date.now(),latitude:n.latitude,longitude:n.longitude,floorLevel:(l=n.floor)==null?void 0:l.elevation,accuracy:n.accuracy}});let i=n.floor!=null?n.floor.id:this.geoJSONApi.currentFloor.id||"outdoors-container",s=[n.longitude,n.latitude];if(!this.geometry)this.geometry=this.core.addCustomGeometry(XT,{type:"Feature",properties:{},geometry:{type:"Point",coordinates:s}},{setup:o(p=>{let h=Voe(d(this,eo).accuracyRing.color,d(this,eo).accuracyRing.opacity),{outerMesh:y,innerMesh:b}=zoe(d(this,eo).color),_=Uoe(d(this,eo).heading.color,d(this,eo).heading.opacity);p.add(h),h.visible=!1,p.add(y),p.add(b),p.add(_),_.visible=!1,d(this,O_).call(this,p)},"setup"),update:d(this,O_)},{visible:!0,interactive:!0},i);else{let p=this.core.getState(this.geometry);s=[p.position[0],p.position[1]]}d(this,Ty)&&d(this,Ty).stop(),q(this,Ty,new Va(s).to([n.longitude,n.latitude],1e3).easing(Qi.Cubic.Out).onUpdate(p=>{if(this.geometry){let h={position:[p[0],p[1]]};h.parent=i,this.core.setState(this.geometry,h)}}).start()),this.core.getTweenGroup().add(d(this,Ty)),this.publish("position-update",{floor:this.floor,heading:this.heading,accuracy:this.accuracy,coordinate:this.coordinate}),this.core.render()},"#setPosition"));x(this,"onPositionUpdate",o(r=>{var n,i,s,l,c;if(this.state!=="disabled"){try{JAe.parse(r)}catch(p){d(this,Ap).call(this,"error"),ce.error("BlueDot: Browser sent invalid position",p instanceof le.ZodError?p.message:String(p)),this.publish("error");return}q(this,ld,{latitude:(n=r.coords)==null?void 0:n.latitude,longitude:(i=r.coords)==null?void 0:i.longitude,accuracy:(s=r.coords)==null?void 0:s.accuracy,heading:(l=r.coords)==null?void 0:l.heading,floor:d(this,M_).call(this,(c=r.coords)==null?void 0:c.floorLevel)}),d(this,L_).call(this,d(this,ld))}},"onPositionUpdate"));x(this,"onPositionError",o(r=>{var n;switch(d(this,Ap).call(this,"error"),r.code){case r.PERMISSION_DENIED:ce.error("Geolocation permission denied by the user.",r),(n=this.geoJSONApi.getMapDataInternal())==null||n.Analytics.sendWatchPositionDenied();break;case r.POSITION_UNAVAILABLE:ce.error("Geolocation position unavailable.",r);break;case r.TIMEOUT:ce.error("Geolocation request timed out.",r);break;default:ce.error("An unknown geolocation error occurred.",r);break}this.publish("error",r)},"onPositionError"));G(this,HT,o(()=>{var n;let r=Math.round(this.core.camera.zoomLevel*1e5);if(r!==d(this,T_)){q(this,T_,r);let i=(n=this.core.getMetresPerPixel())!=null?n:1;q(this,Wa,Math.max(d(this,eo).radius/(.35/i),1))}},"#updateScale"));G(this,Ap,o(r=>{let n=KAe[this.state].actions[r];if(n){switch(d(this,eo).debug&&ce.log("BlueDot: Transitioning from ".concat(this.state," to ").concat(n," using ").concat(r)),n){case"hidden":case"disabled":this.geometry&&this.core.setState(this.geometry,{visible:!1});break;case"active":this.geometry&&this.core.setState(this.geometry,{visible:!0});break}this.state!==n&&(this.publish("state-change",{state:n,action:r}),this.state=n)}else ce.warn("BlueDot: Invalid state transition from ".concat(this.state," to ").concat(n," using ").concat(r))},"#transitionAction"));G(this,pd);G(this,WT,o(()=>{if(d(this,pd)==null&&this.geoJSONApi.Navigation.activeDirections!=null){let n=(Array.isArray(this.geoJSONApi.Navigation.activeDirections)?this.geoJSONApi.Navigation.activeDirections.flatMap(i=>i.coordinates):this.geoJSONApi.Navigation.activeDirections.coordinates).filter(i=>i.floorId===this.geoJSONApi.currentFloor.id);q(this,pd,(0,Xoe.default)(n.map(i=>({x:i.longitude,y:i.latitude})),1e-5).map(i=>[i.x,i.y]))}return d(this,pd)},"#getSimplifiedDirections"));G(this,Oy,o(()=>{this.core.camera.isAnimating&&this.core.camera.cancelAnimation(),d(this,Dp)&&(this.off("position-update",d(this,Dp)),q(this,Dp,void 0)),this.following=!1,q(this,pd,void 0),this.core.off("user-interaction-start",d(this,Oy)),this.geoJSONApi.currentMap.off("navigation-active-path-change",d(this,A_)),this.publish("follow-change",{following:!1})},"#cancelFollow"));G(this,A_,o(()=>{q(this,pd,void 0)},"#pathChangeHandler"));G(this,Dp);x(this,"follow",o((r,n)=>{var s,l,c,p;if(r===!1){d(this,Oy).call(this);return}r!=="position-only"&&(n==null?void 0:n.bearing)!=null&&ce.warn("BlueDot: Camera bearing option will be ignored in follow mode '".concat(r,"'. To control the bearing manually, use mode 'position-only'."));let i={zoomLevel:(s=n==null?void 0:n.zoomLevel)!=null?s:21,bearing:r==="position-only"?n==null?void 0:n.bearing:void 0,pitch:(l=n==null?void 0:n.pitch)!=null?l:45,duration:(c=n==null?void 0:n.duration)!=null?c:1e3,easing:(p=n==null?void 0:n.easing)!=null?p:"ease-in-out"};this.following?d(this,Dp)&&this.off("position-update",d(this,Dp)):(this.following=!0,this.core.on("user-interaction-start",d(this,Oy)),this.geoJSONApi.currentMap.on("navigation-active-path-change",d(this,A_))),q(this,Dp,h=>{let{coordinate:y,heading:b,floor:_}=h;if(i.center=[y.longitude,y.latitude],_!=null&&_.id!==this.geoJSONApi.currentFloor.id&&(this.geoJSONApi.currentMap.setFloor(_.id),q(this,pd,void 0)),r==="position-and-heading")i.bearing=b!=null?b:void 0;else if(r==="position-and-path-direction"){let C=d(this,WT).call(this);if(C!=null){let P=Goe(C,[y.longitude,y.latitude]);if(P!=null){let E=C[P.segmentIndex],T=C[P.segmentIndex+1];i.bearing=jN(E,T)}}}this.core.camera.animateTo(i)}),this.on("position-update",d(this,Dp)),this.publish("follow-change",{following:!0,mode:r})},"follow"))}get heading(){var r;return(r=d(this,vl))==null?void 0:r.heading}get accuracy(){var r;return(r=d(this,vl))==null?void 0:r.accuracy}get coordinate(){var r,n;if(d(this,vl)!=null)return(d(this,cd)==null||((r=this.floor)==null?void 0:r.id)!==d(this,cd).floorId||d(this,vl).latitude!==d(this,cd).latitude||d(this,vl).longitude!==d(this,cd).longitude)&&q(this,cd,new Ct(d(this,vl).latitude,d(this,vl).longitude,(n=this.floor)==null?void 0:n.id)),d(this,cd)}get floor(){var r;return(r=d(this,vl))==null?void 0:r.floor}enable(r){q(this,eo,(0,Woe.default)({},r,d(this,eo))),d(this,Ap).call(this,"enable"),this.watchDevicePosition(d(this,eo).watchDevicePosition)}disable(){this.geometry&&(this.core.remove(this.geometry.id),this.geometry=void 0),d(this,ud)&&(clearTimeout(d(this,ud)),q(this,ud,void 0)),this.following&&d(this,Oy).call(this),this.watchDevicePosition(!1),q(this,vl,void 0),q(this,yl,void 0),d(this,Ap).call(this,"disable")}watchDevicePosition(r){if(d(this,Py)&&(navigator.geolocation.clearWatch(d(this,Py)),q(this,Py,null)),d(this,ld)&&q(this,ld,void 0),r){if(this.state==="disabled"){ce.warn("BlueDot must be enabled before watching browser position.");return}q(this,Py,navigator.geolocation.watchPosition(this.onPositionUpdate,this.onPositionError,{enableHighAccuracy:!0}))}}update(r){var i,s;r==null?q(this,yl,void 0):"coords"in r?q(this,yl,Object.assign({},d(this,yl),{latitude:r.coords.latitude,longitude:r.coords.longitude,accuracy:r.coords.accuracy,heading:r.coords.heading,floor:d(this,M_).call(this,r.coords.floorLevel)})):(q(this,yl,Object.assign({},d(this,yl),r)),"floorOrFloorId"in r&&(d(this,yl).floor=typeof r.floorOrFloorId=="string"&&r.floorOrFloorId!=="device"?d(this,E_).call(this,r.floorOrFloorId):r.floorOrFloorId)),(((i=d(this,yl))==null?void 0:i.latitude)!=null&&((s=d(this,yl))==null?void 0:s.longitude)!=null||d(this,ld)!=null)&&d(this,L_).call(this,d(this,ld))}};Py=new WeakMap,ld=new WeakMap,yl=new WeakMap,vl=new WeakMap,ud=new WeakMap,Ty=new WeakMap,Ey=new WeakMap,My=new WeakMap,eo=new WeakMap,Wa=new WeakMap,T_=new WeakMap,cd=new WeakMap,E_=new WeakMap,M_=new WeakMap,O_=new WeakMap,L_=new WeakMap,HT=new WeakMap,Ap=new WeakMap,pd=new WeakMap,WT=new WeakMap,Oy=new WeakMap,A_=new WeakMap,Dp=new WeakMap,o(tF,"BlueDot");var Jv=tF,KAe={hidden:{actions:{enable:"hidden",error:"hidden","position-update":"active",disable:"disabled",timeout:"hidden"}},active:{actions:{enable:"active",disable:"disabled","position-update":"active",error:"inactive",timeout:"inactive"}},inactive:{actions:{enable:"inactive",disable:"disabled","position-update":"active",error:"inactive",timeout:"inactive"}},disabled:{actions:{enable:"hidden",disable:"disabled"}}},JAe=le.object({coords:le.object({latitude:le.number(),longitude:le.number(),accuracy:le.number(),altitude:le.number().optional().nullable(),altitudeAccuracy:le.number().optional().nullable(),heading:le.number().optional().nullable(),speed:le.number().optional().nullable(),floorLevel:le.number().optional().nullable()}),timestamp:le.number()}),QAe=le.object({latitude:le.number(),longitude:le.number(),floor:le.custom().optional(),accuracy:le.number().optional(),heading:le.number().optional().nullable()});g();var fd,F_,rF=class rF{constructor({currentMapGetter:t}){G(this,fd,new Map);G(this,F_);q(this,F_,t)}get currentMap(){return d(this,F_).call(this)}getById(t){return d(this,fd).get(t)}add(t,r,n){let i=this.currentMap;if(!i)throw new Error("currentMap should exist");let s=i.Shapes.add(t,r||{},{floorId:n==null?void 0:n.id}),l=new Dh(s);return d(this,fd).set(l.id,l),l}remove(t){var n;d(this,fd).get(t.id)&&((n=this.currentMap)==null||n.Shapes.remove(t),d(this,fd).delete(t.id.toString()))}removeAll(){let t=[];return d(this,fd).forEach(r=>{this.remove(r),t.push(r.id),d(this,fd).delete(r.id.toString())}),t}};fd=new WeakMap,F_=new WeakMap,o(rF,"Shapes");var D_=rF;g();var k_,nF=class nF{constructor({currentMapGetter:t}){G(this,k_);q(this,k_,t)}get currentMap(){return d(this,k_).call(this)}setFromStyleCollection(t){var r,n,i,s;for(let l in t)for(let c of((r=this.currentMap)==null?void 0:r.floors)||[]){if(t[l]==null||!c.layers.has(Zi))continue;let p=c.layers.get(Zi);if(p!=null&&p.layers.has(l)&&"color"in t[l]){let b=p.layers.get(l);b&&((n=this.currentMap)==null||n.renderer.setState(b,{color:t[l].color}))}if(p&&l===Gd&&!(Vc in t)){let b=p.layers.get(Vc);b&&"color"in t[l]&&((i=this.currentMap)==null||i.renderer.setState(b,{color:t[l].color}))}if(!c.layers.has(Rm))continue;let h=c.layers.get(Rm),y=c.facadesByStyleId.get(l);if(y&&y.length>0)for(let b of y){let _=h.layers.get("".concat(b,"-").concat(l));_&&"color"in t[l]&&((s=this.currentMap)==null||s.renderer.setState(_,{color:t[l].color}))}}}};k_=new WeakMap,o(nF,"Style");var N_=nF;g();var iF={opacity:1},Ys,R_,B_,Gh,dd,Ly,oF,Yoe,sF=class sF{constructor(t,r){G(this,Ly);G(this,Ys);G(this,R_,[]);G(this,B_,{opacity:"initial"});G(this,Gh,{opacity:new Map});G(this,dd,new Set);q(this,Ys,t),q(this,R_,r||[]);let n=d(this,Ys).map;n&&n.on("idle",()=>{d(this,Gh).opacity.size||ke(this,Ly,oF).call(this,n)})}setStyle(t){var r,n;if(d(this,Ys).map){(r=d(this,Ys).map)==null||r.setStyle(t),d(this,dd).size&&(d(this,dd).clear(),this.hide()),ke(this,Ly,Yoe).call(this),ke(this,Ly,oF).call(this,d(this,Ys).map),this.setOpacity(d(this,B_).opacity),(n=d(this,Ys).map)==null||n.moveLayer(TE);for(let[i,s,l]of d(this,R_)||[])d(this,Ys).hideOutdoorLayersIntersectingPolygons(i,s,l)}}get map(){return d(this,Ys).map}get enabled(){return!!d(this,Ys).map}get visible(){return d(this,dd).size===0}show(){let t=d(this,Ys).map;if(!t)return;let r=t.getStyle().layers;r&&(r.forEach(n=>{d(this,dd).has(n.id)&&t.setLayoutProperty(n.id,"visibility","visible")}),d(this,dd).clear())}hide(t=[]){let r=d(this,Ys).map;if(!r)return;let n=r.getStyle().layers;n&&n.forEach(i=>{let s=r.getLayoutProperty(i.id,"visibility");!t.includes(i.id)&&s!=="none"&&(r.setLayoutProperty(i.id,"visibility","none"),d(this,dd).add(i.id))})}setOpacity(t,r=[]){var s,l;let n=d(this,Ys).map;if(!n)return;let i=(l=(s=d(this,Ys).map)==null?void 0:s.getStyle())==null?void 0:l.layers;i&&n.once("idle",()=>{i.forEach(c=>{let p=n.getLayoutProperty(c.id,"visibility");if(!r.includes(c.id)&&p!=="none")try{let h=d(this,Gh).opacity.get(c.id);h!==void 0&&(c.id==="background"||(c.type==="symbol"?(n.setPaintProperty(c.id,"icon-opacity",t==="initial"?h[0]:t),n.setPaintProperty(c.id,"text-opacity",t==="initial"?h[1]:t)):n.setPaintProperty(c.id,"".concat(c.type,"-opacity"),t==="initial"?h[0]:t)),d(this,B_).opacity=t)}catch(h){ce.warn("Error setting opacity:",h)}})})}};Ys=new WeakMap,R_=new WeakMap,B_=new WeakMap,Gh=new WeakMap,dd=new WeakMap,Ly=new WeakSet,oF=o(function(t){let r=t.getStyle().layers;r&&r.forEach(n=>{var s,l,c;t.getLayoutProperty(n.id,"visibility")!=="none"&&(n.id==="background"||(n.type==="symbol"?d(this,Gh).opacity.set(n.id,[(s=t.getPaintProperty(n.id,"icon-opacity"))!=null?s:iF.opacity,(l=t.getPaintProperty(n.id,"text-opacity"))!=null?l:iF.opacity]):d(this,Gh).opacity.set(n.id,[(c=t.getPaintProperty(n.id,"".concat(n.type,"-opacity")))!=null?c:iF.opacity,void 0])))})},"#setInitialStyle"),Yoe=o(function(){Object.values(d(this,Gh)).forEach(t=>t.clear())},"#clearInitialStyle"),o(sF,"Outdoor");var Qv=sF;g();function Zoe(){z7(!1)}o(Zoe,"disableText3DWorker");var hd,md,Uh,aF=class aF{constructor({currentMapGetter:t}){G(this,hd);G(this,md,new Map);G(this,Uh,new Map);q(this,hd,t)}labelAll(t={}){var i,s;let r=[],n=new Set;return(s=(i=d(this,hd).call(this))==null?void 0:i.Text3D.labelAll(t))==null||s.forEach(({textInfo:l,target:c})=>{let p=l.id.toString(),h=d(this,Uh).get(p);if(h){n.has(p)||r.push(h.text3DView),n.add(p);return}n.add(p);let y=new Fh(p,c);d(this,md).set(y.id,{targetId:c.id,text3d:p,text3DView:y}),d(this,Uh).set(p,{text3DView:y}),r.push(y)}),r}label(t,r,n={}){var s;if(d(this,hd).call(this))if(wo.is(t)){let l=(s=d(this,hd).call(this))==null?void 0:s.Text3D.label(t,r,n);if(!l)return;let c=l.textInfo.id.toString(),p=d(this,Uh).get(c);if(p)return p.text3DView;let h=new Fh(c,l.target);return d(this,md).set(h.id,{targetId:l.target.id,text3d:c,text3DView:h}),d(this,Uh).set(c,{text3DView:h}),h}else throw new Error("Non-space target is not supported")}remove(t){var i;let r=typeof t=="string"?t:t.id,n=d(this,md).get(r);n&&((i=d(this,hd).call(this))==null||i.Text3D.remove(n.text3d),d(this,md).delete(r),d(this,Uh).delete(n.text3d))}removeAll(){d(this,md).forEach(t=>{var r;(r=d(this,hd).call(this))==null||r.Text3D.remove(t.text3d)}),d(this,md).clear()}};hd=new WeakMap,md=new WeakMap,Uh=new WeakMap,o(aF,"Text3D");var YT=aF;var ZT=.05,uF=class uF{constructor(t,r){x(this,"core");x(this,"mapObjects",[]);x(this,"id");x(this,"mapDataExternal",{});x(this,"mapsByFloorId",{});x(this,"mapData");x(this,"currentMap");x(this,"hiddenOutdoorGeometries",[]);x(this,"lastFacadeIntersected");x(this,"manualFloorVisibility",!1);x(this,"mapView");x(this,"Camera");x(this,"Labels");x(this,"Text3D");x(this,"Markers");x(this,"Models");x(this,"Paths");x(this,"Exporter");x(this,"Navigation");x(this,"Outdoor");x(this,"BlueDot");x(this,"Shapes");x(this,"Style");x(this,"Images");x(this,"update",o(()=>{this.core.render()},"update"));this.core=t,this.mapView=r,this.Camera=new i_(this),this.id=this.core.addGroupContainer("root").id.toString();let n=new v_("outdoors-container",void 0,void 0,this);this.mapObjects.push(n),this.currentMap=n,this.core.on("pre-render",()=>{this.mapView.publish("pre-render")}),this.core.on("post-render",()=>{this.mapView.publish("post-render")}),this.core.on("resize",()=>{this.mapView.publish("resize")}),this.core.on("geometry-in-focus",p=>{this.mapView.publish("facades-in-view-change",{facades:p.map(h=>{var y;return(y=this.getMapDataInternal())==null?void 0:y.facadesById[h]}).filter(h=>h!=null)})});let i=new e_(this.Camera);this.core.on("camera-change",()=>{this.mapView.publish("camera-change",i)});let s=o(p=>h=>{var X,Y,N;let y=[],b=[],_=[],C=[];h.labels.forEach(Z=>{let ae=this.Labels.getById(Z.toString());ae&&y.push(ae.label)}),h.markers.forEach(Z=>{let ae=this.Markers.getById(Z.toString())||this.Navigation.getMarkerById(Z.toString());ae&&b.push(ae.marker)}),h.models.forEach(Z=>{let ae=this.Models.getById(Z.toString());ae&&_.push(ae.model)}),h.paths.forEach(Z=>{let ae=this.Paths.getById(Z.toString())||this.Navigation.getPathById(Z.toString());ae&&C.push(ae.path)});let P=h.geometry.includes(XT),E=h.geometry.filter(Z=>Z!==XT)[0],T;E&&(T=(X=this.getMapDataInternal())==null?void 0:X.getById("space",E)),T||(T=(Y=this.getMapDataInternal())==null?void 0:Y.getById("object",E));let O=h.containers.reduce((Z,ae)=>{var U;let se=(U=this.getMapDataInternal())==null?void 0:U.getById("floor",ae);return se&&ua.is(se)&&Z.push(se),Z},[]),D,A=0;if(O.length>0){D=O[0].id;let Z=this.core.getState(D);A=h.coordinate[2]?h.coordinate[2]-Z.altitude:A}let R;this.lastFacadeIntersected&&this.lastFacadeIntersected.spaces.forEach(Z=>{this.core.setState(Z.id,{hovered:!1})}),T&&wo.is(T)&&(R=(N=this.getMapDataInternal())==null?void 0:N.facadesBySpaceId[E],R&&R.spaces.forEach(Z=>{this.core.setState(Z.id,{hovered:!0})})),this.lastFacadeIntersected=R;let j={coordinate:new Ct({latitude:h.coordinate[1],longitude:h.coordinate[0],floorId:D,verticalOffset:A}),spaces:T&&wo.is(T)?[T]:[],objects:T&&Oa.is(T)?[T]:[],markers:b,labels:y,models:_,paths:C,blueDot:P,floors:O,facades:R?[R]:[]};"pointerEvent"in h&&(j.pointerEvent=h.pointerEvent),this.mapView.publish(p,j)},"createHandler");this.core.on("hover",s("hover")),this.core.on("click",s("click")),this.core.on("user-interaction-start",()=>{this.mapView.publish("user-interaction-start")}),this.core.on("user-interaction-end",()=>{this.mapView.publish("user-interaction-end")});let l={currentMapGetter:o(()=>this.currentMap,"currentMapGetter")};this.Markers=new b_(l),this.Models=new S_(l),this.Labels=new a_(l),this.Text3D=new YT(l),this.Exporter=new s_(l),this.Paths=new w_(l),this.Navigation=new r_(this.core,this,l.currentMapGetter),this.BlueDot=new Jv(this.core,this),this.BlueDot.on("position-update",p=>{this.mapView.publish("blue-dot-position-update",p)}),this.BlueDot.on("state-change",p=>{this.mapView.publish("blue-dot-state-change",p)}),this.BlueDot.on("error",p=>{this.mapView.publish("blue-dot-error",p)}),this.BlueDot.on("follow-change",p=>{this.mapView.publish("blue-dot-follow-change",p)}),this.Outdoor=new Qv(this.core,this.hiddenOutdoorGeometries),this.Outdoor.enabled&&(this.core.on("outdoor-view-loaded",()=>{this.mapView.publish("outdoor-view-loaded")}),this.core.on("outdoor-style-loaded",()=>{this.mapView.publish("outdoor-style-loaded")})),this.Images=new I_(l),this.Shapes=new D_(l),this.Style=new N_(l);let c=new GT(r,this.mapDataExternal);this.auto=c.auto}get StackedMaps(){return this.currentMap.StackedMaps}preloadFloors(t){t.forEach(r=>{r instanceof ua&&this.core.setState(r.id,{preloadGeometry:!0})})}updateState(t,r){if(t==="interior-walls"){this.currentMap.floors.forEach(s=>{let l=s.layers.get(Zi);if(l){let c=l.layers.get(Gd);c&&this.core.setState(c,lF(r,this.core.getState(c)))}});return}else if(t==="exterior-walls"){this.currentMap.floors.forEach(s=>{let l=s.layers.get(Zi);if(l){let c=l.layers.get(Vc);c&&this.core.setState(c,lF(r,this.core.getState(c)))}});return}else if(t==="interior-doors"){this.currentMap.floors.forEach(s=>{let l=s.layers.get(Zi);if(l){let c=l.layers.get(k0);c&&this.core.setState(c,KT(r,this.core.getState(c)))}});return}else if(t==="exterior-doors"){this.currentMap.floors.forEach(s=>{let l=s.layers.get(Zi);if(l){let c=l.layers.get(R0);c&&this.core.setState(c,KT(r,this.core.getState(c)))}});return}let n=typeof t=="string"?this.getMapDataObject(t):t;if(n){if(Lh.is(n))return this.core.setState(n.id,Koe(re(k({},r),{type:"label"}),this.core.getState(n.id)));if(ed.is(n))return this.core.setState(n.id,Joe(re(k({},r),{type:"marker"}),this.core.getState(n.id)));if((wo.is(n)||Oa.is(n))&&this.core.setState(n.id,Qoe(re(k({},r),{type:"geometry"}),this.core.getState(n.id))),Au.is(n)&&this.core.setState(n.id,KT(re(k({},r),{type:"doors"}),this.core.getState(n.id))),Dh.is(n)&&this.core.setState(n.id,nl(r,["altitude","color","opacity"])),by.is(n)){let i=r,{position:s,scale:l}=i,p=ls(i,["position","scale"]);s&&(p.position=[s.longitude,s.latitude,s.verticalOffset]),l!=null&&(Array.isArray(l)?p.scale=l:p.scale=[l,l,l]),s&&n.updateTarget(s),this.core.setState(n.id,p)}if(ua.is(n)){let s=this.currentMap.floorsById.get(n.id);if(s==null)return;this.core.setState(n.id,nl(r,["visible","altitude"]));let l=s.layers.get(Zi);l!=null&&"geometry"in r&&this.core.setState(l.containerId,nl(r.geometry,["opacity","visible"]));let c=s.layers.get(pf);c!=null&&"labels"in r&&"enabled"in r.labels&&typeof r.labels.enabled=="boolean"&&c.setVisible(r.labels.enabled);let p=s.layers.get(zc);p!=null&&"markers"in r&&"enabled"in r.markers&&typeof r.markers.enabled=="boolean"&&p.setVisible(r.markers.enabled);let h=s.layers.get(px);h!=null&&"footprint"in r&&this.core.setState(h.containerId,nl(r.footprint,["visible","height","opacity","side","color","altitude"]));let y=s.layers.get(B0);y!=null&&"occlusion"in r&&"enabled"in r.occlusion&&typeof r.occlusion.enabled=="boolean"&&y.setVisible(r.occlusion.enabled)}if(Fl.is(n)){let s=this.core.getState(n.id);for(let l of s.children)l.type==="group-container"&&this.core.setState(l.id,nl(r,["opacity","visible"]))}if(Fh.is(n)&&this.core.setState(n.id,nl(r,$3)),ic.is(n))for(let s of n.segments)this.core.setState(s.id,nl(r,["color","nearRadius","farRadius","visible","completeFraction"]));jv.is(n)&&this.core.setState(n.id,nl(r,["color"]))}}getMapDataObject(t){var r;return(r=this.getMapDataInternal())==null?void 0:r.getMapDataById(t)}getMapDataInternal(){if(this.mapData)return kI(this.mapData)}getMapData(){return this.mapData}addMap(t,r){return new Promise(n=>{var b,_,C,P;let i;try{i=kI(t)}catch(E){ce.error("Error adding map",E),n(t);return}this.mapDataExternal[t.mapName]=t;let{mvf:s}=i,l=s["manifest.geojson"].features[0].geometry.coordinates;this.core.mode!=="outdoors-overlay"&&this.Camera.set({center:new Ct(l[1],l[0])});let c=s["manifest.geojson"].features[0].properties.name,p=new v_("mapObject-".concat(c),i,r,this),h=this.core.getBoundingArea(p.currentFloor.id);h==null&&ce.error("Could not determine bounding box for map:",p.currentFloor.id);let y=(_=(b=r==null?void 0:r.outdoorView)==null?void 0:b.layersHiddenByGeometry)!=null?_:[];if(y.length>0){let E,T=[];for(let O of p.floorStacksById.values())if(O.defaultFloor.footprint&&O.defaultFloor.footprint.geometry!=null&&((C=O.defaultFloor.footprint.geometry)==null?void 0:C.coordinates.length)>0){let D=O.defaultFloor.footprint,A=zT(D);E==null?E=A:tse(E,A),T.push(D)}T.length>0&&E!=null&&(this.core.hideOutdoorLayersIntersectingPolygons(E,T,y),this.hiddenOutdoorGeometries.push([E,T,y]))}if(this.mapObjects.push(p),i.getMVFFeatureByType("floor").forEach(E=>{this.mapsByFloorId[E.id]=p}),p.on("navigation-connection-click",E=>{this.mapView.publish("navigation-connection-click",E)}),p.on("navigation-active-path-change",E=>{this.mapView.publish("navigation-active-path-change",E)}),p.StackedMaps.on("stacked-maps-state-change",({state:E})=>{this.mapView.publish("stacked-maps-state-change",{state:E})}),p.on("floor-change-start",E=>{var T,O,D,A;this.mapView.publish("floor-change-start",{reason:E.reason,floor:(O=(T=this.getMapDataInternal())==null?void 0:T.getById("floor",E.floorId))!=null?O:this.currentFloor,previousFloor:(A=(D=this.getMapDataInternal())==null?void 0:D.getById("floor",E.previousFloorId))!=null?A:this.currentFloor})}),p.on("floor-change",E=>{var T,O;this.mapView.publish("floor-change",{reason:E.reason,floor:this.currentFloor,previousFloor:(O=(T=this.getMapDataInternal())==null?void 0:T.getById("floor",E.previousFloorId))!=null?O:this.currentFloor})}),this.currentMap=p,this.mapData=t,(r==null?void 0:r.zoomLevel)!=null)this.core.camera.setZoomLevel(r.zoomLevel),n(t);else if(this.core.mode!=="outdoors-overlay"&&h){let E=(P=r==null?void 0:r.screenOffsets)!=null?P:{top:ZT*this.core.canvasHeight,left:ZT*this.core.canvasWidth,right:ZT*this.core.canvasWidth,bottom:ZT*this.core.canvasHeight};this.core.camera.focusOn(h,{duration:iG,padding:E}).then(()=>{n(t)})}else n(t)})}setFloor(t,r){return this.currentMap.setFloor(Nb(t),r)}setFloorStack(t,r){return this.currentMap.setFloorStack(Nb(t),r)}updateWatermark(t){this.core.updateWatermark(t)}get currentFloorStack(){var n;let t=this.currentMap.currentFloorStack.id;if(!t)throw new Xs("Missing currentFloorStack.");let r=(n=this.mapData)==null?void 0:n.getById("floor-stack",t);if(!r)throw new Xs("FloorStack was not found in map data.");return r}get currentFloor(){var n;let t=this.currentMap.currentFloor.id;if(!t)throw new Xs("Missing currentFloor object from GeoJsonApi");let r=(n=this.mapData)==null?void 0:n.getById("floor",t);if(!r)throw new Xs("Missing currentFloor");return r}getState(t){var i,s,l,c,p,h,y,b,_,C,P,E,T,O,D,A,R,j,X,Y;typeof t=="object"&&ic.is(t)&&ce.warn("Cannot get state of a Path directly. Use getState() on individual segments within Path.segments[] instead.");let r=ese(t,this),n=this.core.getState(r);if(n)if(["interior-walls","exterior-walls"].includes(t)){let{color:N,topColor:Z,texture:ae,topTexture:se,visible:U,height:xe,opacity:ne}=n;return{type:"walls",visible:U,color:N,topColor:Z,texture:ae?{url:ae}:void 0,topTexture:se?{url:se}:void 0,height:xe,opacity:ne}}else if(["interior-doors","exterior-doors"].includes(t)){let{color:N,topColor:Z,texture:ae,topTexture:se,visible:U,opacity:xe}=n;return{type:"doors",visible:U,color:N,topColor:Z,opacity:xe,texture:ae?{url:ae}:void 0,topTexture:se?{url:se}:void 0}}else{if(n.type==="geometry")return{type:"geometry",interactive:n.interactive,hoverColor:n.hoverColor,color:n.color,visible:n.visible,opacity:n.opacity,height:n.height,texture:n.texture?{url:n.texture}:void 0,topTexture:n.topTexture?{url:n.topTexture}:void 0,flipImageToFaceCamera:n.flipImageToFaceCamera,topColor:n.topColor};if(n.type==="label"&&n.options.appearance&&n.options.rank!==void 0&&n.options.interactive!==void 0)return{type:"label",text:n.text,appearance:n.options.appearance,rank:n.options.rank,enabled:n.enabled,interactive:n.options.interactive};if(n.type==="marker"&&((i=n.options)==null?void 0:i.rank)!==void 0&&n.options.interactive!==void 0){let N=typeof n.parent=="object"?n.parent.id:n.parent,Z=this.Markers.getById(n.id.toString()),ae=Z!=null&&Z.marker.target?Z==null?void 0:Z.marker.target.anchorTarget:void 0;return ae==null&&(ae=new Ct(n.position[1],n.position[0],N.toString())),{type:"marker",rank:n.options.rank,interactive:n.options.interactive,enabled:n.enabled,element:n.element,anchor:n.anchor,zIndex:n.options.zIndex,dynamicResize:n.dynamicResize,lowPriorityPin:n.options.lowPriorityPin}}else if(n.type==="model"){let N=n!=null&&typeof n.parent=="object"?n.parent.id.toString():(s=n.parent)==null?void 0:s.toString();return delete n.parent,re(k({},n),{position:new Ct({latitude:n.position[1],longitude:n.position[0],verticalOffset:n.position[2],floorId:N}),type:"model"})}else{if(n.type==="image")return{type:"image"};if(n.type==="text3d")return n;if(n.type==="geometry-group"&&t&&typeof t!="string"&&Dh.is(t)){let[N]=n.children;if(N.type!=="geometry")throw new Error("expect shape first child to be geometry");return{type:"Shape",altitude:(l=n.altitude)!=null?l:0,visible:n.visible,color:n.color,height:N.height,opacity:n.opacity}}else{if(n.type==="path")return{type:"path",color:n.color,visible:n.visible,nearRadius:n.nearRadius,farRadius:n.farRadius,completeFraction:n.completeFraction};if(n.type==="group-container"&&typeof t!="string"&&ua.is(t)){let N=(c=this.currentMap.floorsById.get(t.id))==null?void 0:c.layers.get(Zi),Z=N?this.core.getState(N.containerId):void 0,ae=(p=this.currentMap.floorsById.get(t.id))==null?void 0:p.layers.get(pf),se=(h=this.currentMap.floorsById.get(t.id))==null?void 0:h.layers.get(zc),U=(y=this.currentMap.floorsById.get(t.id))==null?void 0:y.layers.get(px),xe=U?this.core.getState(U.containerId):void 0,ne=(b=this.currentMap.floorsById.get(t.id))==null?void 0:b.layers.get(B0),Pe=ne?this.core.getState(ne.containerId):void 0;return{type:"floor",geometry:{opacity:(_=Z==null?void 0:Z.opacity)!=null?_:0,visible:(C=Z==null?void 0:Z.visible)!=null?C:!0},labels:{enabled:(P=ae==null?void 0:ae.visible)!=null?P:!1},markers:{enabled:(E=se==null?void 0:se.visible)!=null?E:!1},footprint:{altitude:(T=xe==null?void 0:xe.altitude)!=null?T:0,visible:(O=xe==null?void 0:xe.visible)!=null?O:!1,height:(D=xe==null?void 0:xe.height)!=null?D:0,opacity:(A=xe==null?void 0:xe.opacity)!=null?A:0,side:(R=xe==null?void 0:xe.side)!=null?R:"double",color:(j=xe==null?void 0:xe.color)!=null?j:"white"},occlusion:{enabled:(X=Pe==null?void 0:Pe.visible)!=null?X:!1},visible:n.visible,altitude:(Y=n.altitude)!=null?Y:0}}else if(n.type==="group-container"&&n.children.length>0&&typeof t!="string"&&Fl.is(t)){let N=this.core.getState(n.children[0].id);return{type:"facade",opacity:N.opacity,visible:N.visible}}}}}}setHoverColor(t){this.core.setState({hoverColor:t})}getHoverColor(){let t=this.core.getState();return(t==null?void 0:t.type)==="map-view"?t.hoverColor:void 0}createCoordinateFromScreenCoordinate(t,r,n){var p;if(n!=null){let h=this.core.projectScreenXYToCoordinate(t,r,!0);return h?new Ct(h.coordinate[1],h.coordinate[0],n.id):void 0}let i=this.core.projectScreenXYToCoordinate(t,r);if(i==null||i.coordinate==null)return;let{coordinate:s,groupContainers:l}=i,c=(p=l==null?void 0:l.find(h=>{let y=h.userData.entityId.toString();return y.includes("f_")||y.includes("m_")}))==null?void 0:p.userData.entityId.toString();return new Ct(s[1],s[0],c)}getScreenCoordinateFromCoordinate(t){var n,i,s;let r=0;if(t.floorId!=null){let l=(n=this.mapData)==null?void 0:n.getById("floor",t.floorId);l!=null&&(r=(s=(i=this.getState(l))==null?void 0:i.altitude)!=null?s:0)}return this.core.projectCoordinateToScreenXY([t.longitude,t.latitude,r])}isInView(t){return this.core.isInView(typeof t=="string"?t:t.id)}auto(){return{labels:this.Labels.all()}}tween(t){let r=new Va(t);return this.core.getTweenGroup().add(r),this.core.render(),r}removeTween(t){this.core.getTweenGroup().remove(t)}get __core(){return this.core}clear(){this.Navigation.clear(),this.BlueDot.disable(),this.Shapes.removeAll(),this.Paths.removeAll(),this.Models.removeAll(),this.Markers.removeAll(),this.Images.removeAll(),this.Labels.removeAll()}destroy(){this.clear(),this.core.destroy()}};o(uF,"GeoJsonApi");var $_=uF;function rse(e){ZN("".concat(e,"/maplibre-worker.csp.js")),D9("".concat(e,"/collision-worker.csp.js"))}o(rse,"setWorkersUrl");g();g();var cF=class cF{constructor(t){x(this,"state");x(this,"update");this.update=t.Debug.update.bind(t.Debug),this.state=t.Debug.state}};o(cF,"Debug");var QT=cF;g();var nse=Ss.object({environment:Ss.union([Ss.literal("basic"),Ss.literal(!1)]).optional(),text3d:Ss.object({hoverColor:Ss.string().optional()}).optional(),geometry:Ss.object({hoverColor:Ss.string().optional()}).optional(),backgroundColor:Ss.string().optional(),backgroundAlpha:Ss.number().optional()}).strict();g();var pF=Pn(S7(),1);var ise=o(e=>{if(["#","rgb(","rgba(","hsl(","hsla("].some(r=>e.startsWith(r)))return!0;let t=console.warn;return console.warn=()=>{},e==="white"||fF(e).some(r=>r<1)?!0:(console.warn=t,!1)},"isProbablyColor"),fF=o(e=>{let t=new An(e);return[t.r,t.g,t.b]},"stringToRgbArray"),e9e=o(e=>{let t=new An;return t.setRGB(e[0],e[1],e[2],Xp),"#"+t.getHexString()},"rgbArrayToString"),t9e=o((e,t)=>{let r={},n=o((i,s,l)=>{for(let c in s){let p=i[c],h=s[c];typeof h=="object"&&!Array.isArray(h)&&h!==null&&typeof p=="object"&&!Array.isArray(p)&&p!==null?(l[c]={},n(p,h,l[c])):l[c]=p}},"processObject");return n(e,t,r),r},"extractProperties"),ose=o((e,t)=>{let r=t9e(e,t),n=(0,pF.default)({},r,t),i=o((s,l,c)=>{for(let p in l){let h=s[p],y=l[p];if(typeof y=="number"&&typeof h=="number")s[p]=h+(y-h)*c;else if(typeof y=="string"&&typeof h=="string"){if(ise(h)&&ise(y)){let b=fF(h),_=fF(y);b&&_?s[p]=e9e([b[0]+(_[0]-b[0])*c,b[1]+(_[1]-b[1])*c,b[2]+(_[2]-b[2])*c]):ce.warn('Color "'.concat(p,'" could not be animated!'))}}else typeof y=="object"&&y!==null&&typeof h=="object"&&h!==null?i(h,y,c):ce.warn('Value "'.concat(p,'" could not be animated!'))}},"interpolate");return s=>{if(s=Math.min(Math.max(s,0),1),s===0)return e;if(s===1)return n;let l=(0,pF.default)({},r);return i(l,t,s),l}},"animationFactory");var j_,ut,gd,dF=class dF extends Lt{constructor(r){super();G(this,j_,{});G(this,ut);G(this,gd);x(this,"Camera");x(this,"Labels");x(this,"Text3D");x(this,"Markers");x(this,"Images");x(this,"Models");x(this,"Paths");x(this,"Exporter");x(this,"Navigation");x(this,"BlueDot");x(this,"Style");x(this,"Shapes");x(this,"Outdoor");x(this,"update",o(()=>{d(this,ut).core.render()},"update"));x(this,"getDirections",o((r,n,i)=>{var s;return(s=d(this,ut).getMapData())==null?void 0:s.getDirections(r,n,i)},"getDirections"));x(this,"getDirectionsMultiDestination",o((r,n,i)=>{var s;return(s=d(this,ut).getMapData())==null?void 0:s.getDirectionsMultiDestination(r,n,i)},"getDirectionsMultiDestination"));x(this,"on",o((r,n)=>{super.on(r,n)},"on"));x(this,"off",o((r,n)=>{super.off(r,n)},"off"));x(this,"Debug");q(this,gd,r);let n=new $_(r,this);q(this,ut,n),this.Camera=d(this,ut).Camera,q(this,j_,d(this,ut).mapDataExternal),this.Markers=d(this,ut).Markers,this.Models=d(this,ut).Models,this.Labels=d(this,ut).Labels,this.Text3D=d(this,ut).Text3D,this.Exporter=d(this,ut).Exporter,this.Paths=d(this,ut).Paths,this.Navigation=d(this,ut).Navigation,this.BlueDot=d(this,ut).BlueDot,this.Shapes=d(this,ut).Shapes,this.Style=d(this,ut).Style,this.auto=d(this,ut).auto,this.Outdoor=d(this,ut).Outdoor,this.Images=d(this,ut).Images,d(this,gd).container.dataset.version=I.env.npm_package_version,this.Debug=new QT(d(this,ut).core)}get StackedMaps(){return d(this,ut).currentMap.StackedMaps}updateState(r,n){return d(this,ut).updateState(r,n)}animateState(r,n,i){var h;let s=d(this,ut).getState(r);if(s==null)return ce.warn("Cannot animate state of ".concat(r,".")),new Promise(b=>b());let l=ose(s,n),c=d(this,ut).tween({percent:0}).to({percent:1},(h=i==null?void 0:i.duration)!=null?h:1e3).onUpdate(({percent:y})=>{d(this,ut).updateState(r,l(y))});i!=null&&i.easing&&i.easing in Kf&&c.easing(Kf[i.easing]);let p=new Promise(y=>{c.onComplete(()=>{d(this,ut).removeTween(c),y()}).onStop(()=>{d(this,ut).removeTween(c),y()}),c.start()});return p.cancel=()=>{c.stop(),d(this,ut).updateState(r,l(0))},p}updateGlobalState(r){var n,i,s,l;try{nse.parse(r)}catch(c){ce.error("updateGlobalState",c);return}if(typeof r=="object"){let c={};if((n=r.text3d)!=null&&n.hoverColor&&(c.text3dHoverColor=r.text3d.hoverColor),(i=r.geometry)!=null&&i.hoverColor&&(c.hoverColor=r.geometry.hoverColor),r.backgroundColor||r.backgroundAlpha!==void 0){let p=(s=r.backgroundColor)!=null?s:d(this,ut).core.backgroundColor,h=(l=r.backgroundAlpha)!=null?l:d(this,ut).core.backgroundAlpha;d(this,ut).core.setBackgroundColor(p,h)}r.environment!=null&&d(this,ut).core.setEnvironment(r.environment),d(this,ut).core.setState(c)}}getGlobalState(){let r=d(this,ut).core.getState();return{backgroundColor:d(this,ut).core.backgroundColor,backgroundAlpha:d(this,ut).core.backgroundAlpha,environment:d(this,ut).core.getEnvironment(),geometry:{hoverColor:r.hoverColor},text3d:{hoverColor:r.text3dHoverColor}}}getMapData(){return d(this,j_)}getDimensions(){return{width:d(this,gd).canvasWidth,height:d(this,gd).canvasHeight}}expand(r){var n;return(n=d(this,ut).currentMap)==null?void 0:n.StackedMaps.expand(r)}collapse(r){var n;return(n=d(this,ut).currentMap)==null?void 0:n.StackedMaps.collapse(r)}addMap(r,n){return d(this,ut).addMap(r,n)}setFloor(r,n){return d(this,ut).setFloor(r,n==null?void 0:n.context)}setFloorStack(r,n){return d(this,ut).setFloorStack(r,n==null?void 0:n.context)}preloadFloors(r){d(this,ut).preloadFloors(r)}tween(r){return d(this,ut).tween(r)}removeTween(r){d(this,ut).removeTween(r)}get currentFloorStack(){return d(this,ut).currentFloorStack}get currentFloor(){return d(this,ut).currentFloor}updateWatermark(r){d(this,ut).updateWatermark(r)}getState(r){return d(this,ut).getState(r)}setHoverColor(r){d(this,ut).setHoverColor(r)}getHoverColor(){return d(this,ut).getHoverColor()}convertAltitudeToMercatorZoomLevel(r){return d(this,ut).core.getSystems().cameraSystem.convertAltitudeToZoomLevel(r)}convertMercatorZoomLevelToAltitude(r){return d(this,ut).core.getSystems().cameraSystem.convertZoomLevelToAltitude(r)}isInView(r){return d(this,ut).isInView(r)}getDistance(r,n){var i;return(i=d(this,ut).getMapData())==null?void 0:i.getDistance(r,n)}createCoordinate(r,n,i){return typeof r=="object"?new Ct(r):new Ct(r,n,i==null?void 0:i.id)}createCoordinateFromScreenCoordinate(r,n,i){return d(this,ut).createCoordinateFromScreenCoordinate(r,n,i)}getScreenCoordinateFromCoordinate(r){return d(this,ut).getScreenCoordinateFromCoordinate(r)}auto(){return{labels:this.Labels.all()}}get __core(){if(I.env.INTERNAL==="true")return d(this,ut).core;throw new Error("__core is not available.")}clear(){d(this,ut).clear()}destroy(){d(this,ut).destroy()}async enableDebug(r={}){let{Inspector:n}=await import("./inspector-U6M4QW4R.js");await new n(this,d(this,ut)).enable(r)}async takeScreenshot(){return await d(this,gd).renderSync(),d(this,gd).rendererDomElement.toDataURL("image/png")}get manualFloorVisibility(){return d(this,ut).manualFloorVisibility}set manualFloorVisibility(r){d(this,ut).manualFloorVisibility=r}};j_=new WeakMap,ut=new WeakMap,gd=new WeakMap,o(dF,"MapView");var eb=dF;g();g();var hF=class hF extends Lt{constructor(r){super();x(this,"gl");x(this,"el",document.createElement("div"));x(this,"core");x(this,"origin");x(this,"map");x(this,"layer");x(this,"handleStyleChange",o(()=>{!this.map||!this.layer||this.map.getLayer(this.layer.id)||(this.map.addLayer(this.layer),this.core.camera.setMinZoomLevel(this.map.getMinZoom()),this.core.camera.setMaxZoomLevel(this.map.getMaxZoom()),this.core.camera.setMinPitch(this.map.getMinPitch()),this.core.camera.setMaxPitch(this.map.getMaxPitch()))},"handleStyleChange"));x(this,"handleMove",o(()=>{if(!this.map)return;let[r,n]=this.map.getCenter().toArray();this.core.getSystems().cameraSystem.setCenter(r,n),this.core.getSystems().cameraSystem.setZoomLevel(this.map.getZoom()),this.core.getSystems().cameraSystem.setRotation(Yt.degToRad(this.map.getBearing())),this.core.getSystems().cameraSystem.setTilt(Yt.degToRad(this.map.getPitch()))},"handleMove"));x(this,"handleError",o(r=>{ce.warn(r)},"handleError"));this.origin=r}onAdd(r){this.origin=this.origin||r.getCenter().toArray(),this.gl=r.painter.context.gl,this.core=new X2(r._container,{center:this.origin,zoomLevel:r.getZoom(),pitch:r.getPitch(),bearing:r.getBearing(),gl:this.gl,map:r,mode:"outdoors-overlay"}),this.map=r,this.core.camera.setMinZoomLevel(r.getMinZoom()),this.core.camera.setMaxZoomLevel(r.getMaxZoom()),this.core.camera.setMinPitch(r.getMinPitch()),this.core.camera.setMaxPitch(r.getMaxPitch()),this.map.on("error",this.handleError);let n=XN.fromLngLat(this.origin,0);return this.layer=IS(n,this.core.viewCamera,this.core.camera,()=>{this.core.renderSync()}),this.map.on("styledata",this.handleStyleChange),this.map.on("move",this.handleMove),this.handleStyleChange(),this.el}onRemove(){this.map&&(this.map.off("styledata",this.handleStyleChange),this.map.off("move",this.handleMove),this.map.off("error",this.handleError),this.layer&&this.map.removeLayer(this.layer.id)),this.layer=void 0,this.map=void 0,this.core&&this.core.destroy(),this.core=void 0}};o(hF,"MapLibreOverlay");var eE=hF;var Ay,tb,Vh,Dy,G_=class G_ extends Lt{constructor(r,n,i){super();G(this,Ay);G(this,tb);G(this,Vh);G(this,Dy);x(this,"on",o((r,n)=>{super.on(r,n)},"on"));x(this,"off",o((r,n)=>{super.off(r,n)},"off"));q(this,Dy,new eE(r)),q(this,Ay,n),q(this,tb,i)}onAdd(r){var s,l;let n=d(this,Dy).onAdd(r),i=re(k(k({},km),(s=d(this,tb))!=null?s:{}),{outdoorView:k({token:d(this,Ay).outdoorViewToken},(l=d(this,tb))==null?void 0:l.outdoorView)});return q(this,Vh,new eb(d(this,Dy).core)),d(this,Vh).addMap(d(this,Ay),i).then(()=>{this.publish("loaded",{mapView:d(this,Vh),mapData:d(this,Ay)})}),n}onRemove(){d(this,Vh)&&d(this,Vh).clear(),G_.instance=null,d(this,Dy).onRemove()}};Ay=new WeakMap,tb=new WeakMap,Vh=new WeakMap,Dy=new WeakMap,o(G_,"MappedinMapLibreOverlay"),x(G_,"instance");var rb=G_;g();var r9e=1e3*60*60*2,zh,ib,oi,cc,pc,cu,fc,ob,sb,U_,Yn,mF,sse,ase,nb,tE,gF,yF,vF,bF=class bF{constructor(t,r){G(this,Yn);G(this,zh,new Lt);G(this,ib);G(this,oi);G(this,cc);G(this,pc);G(this,cu);G(this,fc);G(this,ob);G(this,sb);G(this,U_,o(()=>{"key"in d(this,oi)&&"secret"in d(this,oi)&&ke(this,Yn,nb).call(this),ke(this,Yn,tE).call(this)},"#handleWindowFocus"));x(this,"on",o((t,r)=>d(this,zh).on(t,r),"on"));x(this,"off",o((t,r)=>d(this,zh).off(t,r),"off"));q(this,ib,t),q(this,oi,r)}setMapIds(t){q(this,ib,t)}setEnterprise(t){d(this,oi).enterprise=t}async readySync(){if((!("key"in d(this,oi))||!("secret"in d(this,oi)))&&!("accessToken"in d(this,oi))){ce.error("No API keys or access token provided! Cannot preload tokens.");return}let t=[ke(this,Yn,nb).call(this),null];d(this,oi).enterprise||(t[1]=this.getSasTokensAsync());let[r,n]=await Promise.all(t);ke(this,Yn,vF).call(this),ke(this,Yn,gF).call(this,r),n!=null&&ke(this,Yn,yF).call(this,n),ke(this,Yn,mF).call(this)&&globalThis.addEventListener("focus",d(this,U_))}async refreshing(){let t=[];return d(this,cc)!=null&&t.push(d(this,cc)),d(this,pc)!=null&&t.push(d(this,pc)),Promise.all(t)}getAccessTokenAsync(){return ke(this,Yn,nb).call(this)}getSasTokensAsync(){return ke(this,Yn,tE).call(this)}getAccessToken(){return d(this,cu)==null?(ce.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):d(this,cu)}getSasToken(t){return this.isEnterpriseMode()?(ce.error("SAS tokens are not available in the enterprise mode!"),{token:""}):d(this,fc)==null?(ce.error("Tokens must be loaded before reading synchronously! Try awaiting readySync() first."),{token:""}):t in d(this,fc).tokens?d(this,fc).tokens[t]:(ce.error("SAS token for map ".concat(t," not found!")),{token:""})}isEnterpriseMode(){var t;return(t=d(this,oi).enterprise)!=null?t:!1}destroy(){ke(this,Yn,vF).call(this),d(this,zh).destroy(),ke(this,Yn,mF).call(this)&&globalThis.removeEventListener("focus",d(this,U_))}};zh=new WeakMap,ib=new WeakMap,oi=new WeakMap,cc=new WeakMap,pc=new WeakMap,cu=new WeakMap,fc=new WeakMap,ob=new WeakMap,sb=new WeakMap,U_=new WeakMap,Yn=new WeakSet,mF=o(function(){return typeof window<"u"&&window!==null},"#isBrowser"),sse=o(function(t){var n;let r=t.token!==((n=d(this,cu))==null?void 0:n.token);q(this,cu,t),r&&d(this,zh).publish("access-token-refreshed",{accessToken:t})},"#setAccessToken"),ase=o(function(t){var n;let r=JSON.stringify(t.tokens)!==JSON.stringify((n=d(this,fc))==null?void 0:n.tokens);q(this,fc,t),r&&d(this,zh).publish("sas-tokens-refreshed",{sasTokens:t.tokens})},"#setSasTokens"),nb=o(async function(t=!1){var r;if("accessToken"in d(this,oi)&&typeof d(this,oi).accessToken=="string"){let n={token:d(this,oi).accessToken,expires:Date.now()+72e5};return q(this,cu,n),n}if(!("key"in d(this,oi))||!("secret"in d(this,oi))||typeof d(this,oi).key!="string"||typeof d(this,oi).secret!="string")throw new Error("No API keys or access token provided!");return d(this,cc)!=null?d(this,cc):d(this,cu)!=null&&d(this,cu).expires!=null&&d(this,cu).expires>Date.now()&&!t?d(this,cu):(q(this,cc,MI(re(k({},d(this,oi)),{key:d(this,oi).key,secret:d(this,oi).secret}),(r=d(this,oi).enterprise)!=null?r:!1).then(n=>{let i={token:n.accessToken,expires:n.expiresTimestamp*1e3};return ke(this,Yn,sse).call(this,i),i})),d(this,cc).finally(()=>{q(this,cc,void 0)}),d(this,cc))},"#refreshAccessToken"),tE=o(async function(t=!1){return this.isEnterpriseMode()?{tokens:{},expires:1/0}:d(this,pc)!=null?d(this,pc):d(this,fc)!=null&&d(this,fc).expires>Date.now()&&!t?d(this,fc):(q(this,pc,new Promise((r,n)=>{ke(this,Yn,nb).call(this).then(i=>{let s={},l=d(this,ib).map(c=>f9(re(k({},d(this,oi)),{mapId:c}),i.token).then(p=>{s[c]={token:p.token,expires:p.expires}}).catch(p=>{ce.error("Error getting SAS token for map ".concat(c,":"),p)}));Promise.all(l).then(()=>{let c={tokens:s,expires:Math.min(...Object.values(s).map(p=>{var h;return(h=p.expires)!=null?h:1/0}))};ke(this,Yn,ase).call(this,c),r(c)})}).catch(i=>{n(i)})})),d(this,pc).catch(r=>{throw r}).finally(()=>{q(this,pc,void 0)}),d(this,pc))},"#refreshSasTokens"),gF=o(function(t){if(!("key"in d(this,oi))||!("secret"in d(this,oi)))return;let r=t.expires!=null?t.expires-Date.now():r9e;isFinite(r)&&q(this,ob,setTimeout(()=>{ke(this,Yn,nb).call(this,!0).then(n=>{ke(this,Yn,gF).call(this,n)})},r-Tte))},"#setAccessTokenRefresh"),yF=o(function(t){let r=t.expires-Date.now();isFinite(r)&&q(this,sb,setTimeout(()=>{ke(this,Yn,tE).call(this,!0).then(n=>{ke(this,Yn,yF).call(this,n)})},r-Ote))},"#setSasTokensRefresh"),vF=o(function(){d(this,ob)!=null&&clearTimeout(d(this,ob)),d(this,sb)!=null&&clearTimeout(d(this,sb))},"#stopRefreshing"),o(bF,"TokenManager");var ab=bF;g();var lse=o(async(e,t)=>{var C,P,E,T,O,D,A;let r=(E="mvfVersion"in(t!=null?t:{})?t==null?void 0:t.mvfVersion:void 0)!=null?E:"options"in e&&"version"in((C=e.options)!=null?C:{})?(P=e.options)==null?void 0:P.version:void 0,n=re(k({},t||{}),{mvfVersion:r}),i,s=fh();s.updateByUserOption(n);let l={};if("type"in e&&typeof e.type=="string"){if(l.enterprise=(T=e.options)==null?void 0:T.enterprise,e.type==="binary"&&e.main instanceof Uint8Array){i=await KP(e.main,n.mvfVersion),l.languagePacks=[];for(let R of(O=e.languagePacks)!=null?O:[])R.localePack instanceof Uint8Array&&l.languagePacks.push({language:R.language,localePack:await W1(R.localePack)})}else if(e.type==="json")i=e.main,l.languagePacks=(D=e.languagePacks)!=null?D:[];else throw new Error("Invalid backup type");e.type==="binary"&&e.main instanceof Uint8Array&&(l.binaryBundle=e.main)}else i=e,l.enterprise=i.enterprise!=null;let c=ZP(i),p=c.length>0?c:[n.mapId],h=new ab(p,re(k({},n),{enterprise:l.enterprise})),y;if("accessToken"in n)y=n.accessToken;else if("key"in n&&"secret"in n){n.baseAuthUri=s.getBaseAuthUri(l.enterprise);let R=await h.getAccessTokenAsync();y=(R==null?void 0:R.token)||""}l.outdoorViewToken=y,l.env=s,l.getMapDataOptions=n;try{await h.readySync()}catch(R){ce.error("Failed to ready token manager!",R)}let b=new Fy(i,l);y&&b.Analytics.init(re(k({accessToken:y,mapId:n.mapId,key:"key"in n?n.key:void 0,secret:"secret"in n?n.secret:void 0},n.analytics),{baseUri:s.getAnalyticsBaseUri(),context:(A=n.analytics)==null?void 0:A.context}));let _=new NI(b);if("language"in n)try{await _.changeLanguage(n.language)}catch(R){}return typeof(t==null?void 0:t.onMVFParsed)=="function"&&t.onMVFParsed(i),_},"hydrateMapData");g();var use=o((e,{id:t}={})=>{let r=Array.isArray(e)?e:[e];if(!r.every(s=>typeof s=="string"))return;let n=r.join(""),i=null;if(t){let s=document.getElementById(t);s instanceof HTMLStyleElement&&(i=s)}i==null&&(i=document.createElement("style")),t&&t!==""&&(i.id=t),i.textContent=n,document.head.appendChild(i)},"injectCSS");var cse=":root {\n --pin-shadow-hover-scale: 0.9;\n --pin-shadow-width: 12px;\n --pin-shadow-height: 5px;\n --pin-shadow-opacity: 0.35;\n --pin-drop-animation-duration-ms: 250ms;\n}\n\n@keyframes drop-pin {\n 0% {\n transform: translateY(-200%);\n }\n\n 100% {\n transform: translateY(0);\n }\n}\n\n@keyframes pin-shadow {\n 0% {\n transform: scale(var(--pin-shadow-hover-scale));\n }\n\n 100% {\n transform: scale(1);\n }\n}\n\n.mappedin-dropped-pin-wrapper {\n position: relative;\n\n width: fit-content;\n height: fit-content;\n width: 36px;\n height: 42px;\n\n & svg {\n position: absolute;\n left: calc(50% - var(--pin-shadow-width));\n animation: drop-pin var(--pin-drop-animation-duration-ms) ease-in;\n }\n\n & > .pin-shadow {\n position: absolute;\n left: calc(50% - (var(--pin-shadow-width) / 2));\n bottom: 0;\n\n height: var(--pin-shadow-height);\n width: var(--pin-shadow-width);\n border-radius: 100%;\n\n opacity: var(--pin-shadow-opacity);\n\n animation: pin-shadow 250ms ease-in;\n }\n}\n\n@keyframes bounce {\n 0% {\n transform: translateY(-10px);\n opacity: 0;\n }\n 12.5% {\n transform: translateY(0);\n opacity: 1;\n }\n 25% {\n transform: translateY(0);\n }\n 37.5% {\n transform: translateY(-10px);\n }\n 50% {\n transform: translateY(0);\n }\n 62.5% {\n transform: translateY(-10px);\n }\n 75% {\n transform: translateY(0);\n }\n 87.5% {\n transform: translateY(-10px);\n }\n 100% {\n transform: translateY(0);\n }\n}\n\n.mappedin-connection-marker {\n position: relative;\n display: flex;\n\n .bouncey {\n animation: bounce 2.5s linear;\n }\n\n .arrow--down {\n transform: rotate(180deg);\n }\n\n .connection-circle {\n display: flex;\n box-sizing: border-box;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n border: 2px solid white;\n box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.15);\n background: #595959;\n }\n}\n";var pse='.mappedin-marker {\n font-family: \'InterUI-Regular\', Helvetica, Arial, sans-serif;\n font-weight: normal;\n top: 0;\n position: absolute;\n font-weight: bold;\n color: black;\n display: flex;\n flex-direction: row;\n will-change: transform, opacity;\n transition: opacity 150ms ease-in-out;\n justify-content: center;\n opacity: 0;\n}\n\n/* Low priority pin strategy styles */\n\n/* Hide all content including text nodes by setting font-size to 0 */\n.mappedin-marker[data-anchor="low-priority-pin"] {\n font-size: 0;\n line-height: 0;\n}\n\n/* Hide child elements as well */\n.mappedin-marker[data-anchor="low-priority-pin"]>* {\n visibility: hidden;\n}\n\n/* Create the pin using ::before pseudo-element */\n.mappedin-marker[data-anchor="low-priority-pin"]::before {\n content: \'\';\n display: block;\n border-radius: 50%;\n position: relative;\n /* Default values - will be overridden by inline styles */\n width: var(--mappedin-pin-size, 2px);\n height: var(--mappedin-pin-size, 2px);\n background-color: var(--pin-color, #666);\n}\n';var fse=".mappedin__smart-collision-engine__container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n pointer-events: none;\n /* Enables colliders to use translate3D */\n transform-style: preserve-3d;\n font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;\n}\n\n.mappedin__smart-collision-engine-debug__container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n transition: opacity 300ms ease-in-out;\n pointer-events: none;\n will-change: opacity;\n &.interacting {\n opacity: 0.2;\n }\n}\n";var dse=".mappedin-map {\n .mappedin-interactive {\n cursor: grab;\n\n &:active {\n cursor: grabbing;\n }\n\n &.mappedin-interaction-hover {\n cursor: pointer;\n }\n }\n}\n";var hse=".mappedin-map {\n .mappedin-control-container {\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n pointer-events: none;\n font-family: 'InterUI-Regular', Helvetica, Arial, sans-serif;\n\n .mappedin-ctrl-top-left,\n .mappedin-ctrl-top-right,\n .mappedin-ctrl-bottom-left,\n .mappedin-ctrl-bottom-right {\n position: absolute;\n pointer-events: none;\n }\n\n .mappedin-ctrl-top-left {\n top: 0;\n left: 0;\n }\n\n .mappedin-ctrl-top-right {\n top: 0;\n right: 0;\n }\n\n .mappedin-ctrl-bottom-left {\n bottom: 0;\n left: 0;\n }\n\n .mappedin-ctrl-bottom-right {\n bottom: 0;\n right: 0;\n }\n\n .mappedin-ctrl-attrib {\n display: block;\n position: relative;\n pointer-events: auto;\n font: 9px/11px 'InterUI-Regular', Helvetica, Arial, sans-serif;\n padding: 3px 5px 1px 5px;\n background-color: rgba(255, 255, 255, 0.5);\n margin: 0;\n min-width: 11px;\n min-height: 11px;\n user-select: none;\n\n summary.mappedin-ctrl-attrib-button {\n appearance: none;\n list-style: none;\n }\n\n summary.mappedin-ctrl-attrib-button::-webkit-details-marker {\n display: none;\n }\n\n &.mappedin-compact .mappedin-ctrl-attrib-button,\n &.mappedin-compact-show .mappedin-ctrl-attrib-inner {\n display: inline-block;\n }\n\n &.mappedin-compact {\n background-color: transparent;\n }\n\n &.mappedin-compact-show {\n min-width: 15px;\n min-height: 15px;\n box-sizing: border-box;\n background-color: rgba(255, 255, 255, 0.5);\n }\n }\n\n .mappedin-ctrl-attrib-top-left {\n float: left;\n border-bottom-right-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-top-right {\n float: right;\n border-bottom-left-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-bottom-left {\n float: left;\n border-top-right-radius: 4px;\n }\n\n .mappedin-ctrl-attrib-bottom-right {\n float: right;\n border-top-left-radius: 4px;\n }\n .mappedin-ctrl-attrib-top-left,\n .mappedin-ctrl-attrib-bottom-left {\n padding: 3px 5px 1px 20px;\n }\n\n .mappedin-ctrl-attrib-inner {\n display: inline-block;\n margin-right: 12px;\n }\n\n .mappedin-ctrl-attrib-inner,\n .mappedin-ctrl-attrib-inner a {\n color: rgba(0, 0, 0, 0.75);\n text-decoration: none;\n }\n\n .mappedin-ctrl-attrib-inner-bold,\n .mappedin-ctrl-attrib-inner-bold a {\n font-weight: bold;\n }\n\n .mappedin-ctrl-attrib-inner a:hover {\n color: #017ef1;\n text-decoration: underline;\n cursor: pointer;\n }\n\n .mappedin-ctrl-attrib-button {\n display: none;\n cursor: pointer;\n position: absolute;\n width: 15px;\n height: 15px;\n box-sizing: border-box;\n border-radius: 50%;\n top: 0;\n right: 2px;\n border: 1px;\n }\n .mappedin-ctrl-attrib-top-left .mappedin-ctrl-attrib-button,\n .mappedin-ctrl-attrib-bottom-left .mappedin-ctrl-attrib-button {\n left: 2px;\n }\n }\n}\n";var mse='.maplibregl-map {\n font: 12px/20px "Helvetica Neue", Arial, Helvetica, sans-serif;\n overflow: hidden;\n position: relative;\n -webkit-tap-highlight-color: rgb(0 0 0 / 0%);\n}\n\n.maplibregl-canvas {\n position: absolute;\n left: 0;\n top: 0;\n}\n\n.maplibregl-map:fullscreen {\n width: 100%;\n height: 100%;\n}\n\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass {\n touch-action: none;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive,\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass {\n cursor: grab;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer {\n cursor: pointer;\n}\n\n.maplibregl-canvas-container.maplibregl-interactive:active,\n.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active {\n cursor: grabbing;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas {\n touch-action: pan-x pan-y;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-drag-pan,\n.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas {\n touch-action: pinch-zoom;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,\n.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas {\n touch-action: none;\n}\n\n.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,\n.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas {\n touch-action: pan-x pan-y;\n}\n\n.maplibregl-ctrl-top-left,\n.maplibregl-ctrl-top-right,\n.maplibregl-ctrl-bottom-left,\n.maplibregl-ctrl-bottom-right { position: absolute; pointer-events: none; z-index: 2; }\n\n.maplibregl-ctrl-top-left { top: 0; left: 0; }\n\n.maplibregl-ctrl-top-right { top: 0; right: 0; }\n\n.maplibregl-ctrl-bottom-left { bottom: 0; left: 0; }\n\n.maplibregl-ctrl-bottom-right { right: 0; bottom: 0; }\n\n.maplibregl-ctrl {\n clear: both;\n pointer-events: auto;\n\n /* workaround for a Safari bug https://github.com/mapbox/mapbox-gl-js/issues/8185 */\n transform: translate(0, 0);\n}\n\n.maplibregl-ctrl-top-left .maplibregl-ctrl { margin: 10px 0 0 10px; float: left; }\n\n.maplibregl-ctrl-top-right .maplibregl-ctrl { margin: 10px 10px 0 0; float: right; }\n\n.maplibregl-ctrl-bottom-left .maplibregl-ctrl { margin: 0 0 10px 10px; float: left; }\n\n.maplibregl-ctrl-bottom-right .maplibregl-ctrl { margin: 0 10px 10px 0; float: right; }\n\n.maplibregl-ctrl-group {\n border-radius: 4px;\n background: #fff;\n}\n\n.maplibregl-ctrl-group:not(:empty) {\n box-shadow: 0 0 0 2px rgb(0 0 0 / 10%);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl-group:not(:empty) {\n box-shadow: 0 0 0 2px ButtonText;\n }\n}\n\n.maplibregl-ctrl-group button {\n width: 29px;\n height: 29px;\n display: block;\n padding: 0;\n outline: none;\n border: 0;\n box-sizing: border-box;\n background-color: transparent;\n cursor: pointer;\n}\n\n.maplibregl-ctrl-group button + button {\n border-top: 1px solid #ddd;\n}\n\n.maplibregl-ctrl button .maplibregl-ctrl-icon {\n display: block;\n width: 100%;\n height: 100%;\n background-repeat: no-repeat;\n background-position: center center;\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl-icon {\n background-color: transparent;\n }\n\n .maplibregl-ctrl-group button + button {\n border-top: 1px solid ButtonText;\n }\n}\n\n/* https://bugzilla.mozilla.org/show_bug.cgi?id=140562 */\n.maplibregl-ctrl button::-moz-focus-inner {\n border: 0;\n padding: 0;\n}\n\n.maplibregl-ctrl-attrib-button:focus,\n.maplibregl-ctrl-group button:focus {\n box-shadow: 0 0 2px 2px rgb(0 150 255 / 100%);\n}\n\n.maplibregl-ctrl button:disabled {\n cursor: not-allowed;\n}\n\n.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon {\n opacity: 0.25;\n}\n\n.maplibregl-ctrl button:not(:disabled):hover {\n background-color: rgb(0 0 0 / 5%);\n}\n\n.maplibregl-ctrl-group button:focus:focus-visible {\n box-shadow: 0 0 2px 2px rgb(0 150 255 / 100%);\n}\n\n.maplibregl-ctrl-group button:focus:not(:focus-visible) {\n box-shadow: none;\n}\n\n.maplibregl-ctrl-group button:focus:first-child {\n border-radius: 4px 4px 0 0;\n}\n\n.maplibregl-ctrl-group button:focus:last-child {\n border-radius: 0 0 4px 4px;\n}\n\n.maplibregl-ctrl-group button:focus:only-child {\n border-radius: inherit;\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #333);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #333);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #fff);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #fff);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #000);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #000);\n }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #333);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg");\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #fff);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg", fill: #fff);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #000);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-shrink.svg", fill: #000);\n }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-compass.svg", fill: #333);\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n @svg-load ctrl-compass-white url("svg/maplibregl-ctrl-compass.svg") {\n fill: #fff;\n #south { fill: #999; }\n }\n\n background-image: svg-inline(ctrl-compass-white);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon {\n background-image: svg-load("svg/maplibregl-ctrl-compass.svg", fill: #000);\n }\n}\n\n@svg-load ctrl-terrain url("svg/maplibregl-ctrl-terrain.svg") {\n fill: #333;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-terrain-enabled url("svg/maplibregl-ctrl-terrain.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-terrain);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-terrain-enabled);\n}\n\n@svg-load ctrl-geolocate url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #333;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-white url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #fff;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-black url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #000;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-disabled url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #aaa;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-disabled-white url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #999;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-disabled-black url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #666;\n #stroke { fill: #f00; }\n}\n\n@svg-load ctrl-geolocate-active url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-active-error url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #e58978;\n #stroke { display: none; }\n}\n\n@svg-load ctrl-geolocate-background url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #33b5e5;\n #stroke { display: none; }\n #dot { display: none; }\n}\n\n@svg-load ctrl-geolocate-background-error url("svg/maplibregl-ctrl-geolocate.svg") {\n fill: #e54e33;\n #stroke { display: none; }\n #dot { display: none; }\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active-error);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background-error);\n}\n\n.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon {\n animation: maplibregl-spin 2s infinite linear;\n}\n\n@media (-ms-high-contrast: active) {\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-white);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled-white);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-active-error);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-background-error);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-black);\n }\n\n .maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon {\n background-image: svg-inline(ctrl-geolocate-disabled-black);\n }\n}\n\n@keyframes maplibregl-spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\na.maplibregl-ctrl-logo {\n width: 88px;\n height: 23px;\n margin: 0 0 -4px -4px;\n display: block;\n background-repeat: no-repeat;\n cursor: pointer;\n overflow: hidden;\n background-image: svg-load("svg/maplibregl-ctrl-logo.svg");\n}\n\na.maplibregl-ctrl-logo.maplibregl-compact {\n width: 14px;\n}\n\n@media (-ms-high-contrast: active) {\n a.maplibregl-ctrl-logo {\n @svg-load ctrl-logo-white url("svg/maplibregl-ctrl-logo.svg") {\n #outline { opacity: 1; }\n #fill { opacity: 1; }\n }\n\n background-color: transparent;\n background-image: svg-inline(ctrl-logo-white);\n }\n}\n\n@media (-ms-high-contrast: black-on-white) {\n a.maplibregl-ctrl-logo {\n @svg-load ctrl-logo-black url("svg/maplibregl-ctrl-logo.svg") {\n #outline { opacity: 1; fill: #fff; stroke: #fff; }\n #fill { opacity: 1; fill: #000; }\n }\n\n background-image: svg-inline(ctrl-logo-black);\n }\n}\n\n.maplibregl-ctrl.maplibregl-ctrl-attrib {\n padding: 0 5px;\n background-color: rgb(255 255 255 / 50%);\n margin: 0;\n}\n\n@media screen {\n .maplibregl-ctrl-attrib.maplibregl-compact {\n min-height: 20px;\n padding: 2px 24px 2px 0;\n margin: 10px;\n position: relative;\n background-color: #fff;\n color: #000;\n border-radius: 12px;\n box-sizing: content-box;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact-show {\n padding: 2px 28px 2px 8px;\n visibility: visible;\n }\n\n .maplibregl-ctrl-top-left > .maplibregl-ctrl-attrib.maplibregl-compact-show,\n .maplibregl-ctrl-bottom-left > .maplibregl-ctrl-attrib.maplibregl-compact-show {\n padding: 2px 8px 2px 28px;\n border-radius: 12px;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner {\n display: none;\n }\n\n .maplibregl-ctrl-attrib-button {\n display: none;\n cursor: pointer;\n position: absolute;\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg");\n background-color: rgb(255 255 255 / 50%);\n width: 24px;\n height: 24px;\n box-sizing: border-box;\n border-radius: 12px;\n outline: none;\n top: 0;\n right: 0;\n border: 0;\n }\n\n .maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button {\n appearance: none;\n list-style: none;\n }\n\n .maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker {\n display: none;\n }\n\n .maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button,\n .maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button {\n left: 0;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,\n .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner {\n display: block;\n }\n\n .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button {\n background-color: rgb(0 0 0 / 5%);\n }\n\n .maplibregl-ctrl-bottom-right > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n bottom: 0;\n right: 0;\n }\n\n .maplibregl-ctrl-top-right > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n top: 0;\n right: 0;\n }\n\n .maplibregl-ctrl-top-left > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n top: 0;\n left: 0;\n }\n\n .maplibregl-ctrl-bottom-left > .maplibregl-ctrl-attrib.maplibregl-compact::after {\n bottom: 0;\n left: 0;\n }\n}\n\n@media screen and (-ms-high-contrast: active) {\n .maplibregl-ctrl-attrib.maplibregl-compact::after {\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg", fill=#fff);\n }\n}\n\n@media screen and (-ms-high-contrast: black-on-white) {\n .maplibregl-ctrl-attrib.maplibregl-compact::after {\n background-image: svg-load("svg/maplibregl-ctrl-attrib.svg");\n }\n}\n\n.maplibregl-ctrl-attrib a {\n color: rgb(0 0 0 / 75%);\n text-decoration: none;\n}\n\n.maplibregl-ctrl-attrib a:hover {\n color: inherit;\n text-decoration: underline;\n}\n\n.maplibregl-attrib-empty {\n display: none;\n}\n\n.maplibregl-ctrl-scale {\n background-color: rgb(255 255 255 / 75%);\n font-size: 10px;\n border-width: medium 2px 2px;\n border-style: none solid solid;\n border-color: #333;\n padding: 0 5px;\n color: #333;\n box-sizing: border-box;\n}\n\n.maplibregl-popup {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n will-change: transform;\n pointer-events: none;\n}\n\n.maplibregl-popup-anchor-top,\n.maplibregl-popup-anchor-top-left,\n.maplibregl-popup-anchor-top-right {\n flex-direction: column;\n}\n\n.maplibregl-popup-anchor-bottom,\n.maplibregl-popup-anchor-bottom-left,\n.maplibregl-popup-anchor-bottom-right {\n flex-direction: column-reverse;\n}\n\n.maplibregl-popup-anchor-left {\n flex-direction: row;\n}\n\n.maplibregl-popup-anchor-right {\n flex-direction: row-reverse;\n}\n\n.maplibregl-popup-tip {\n width: 0;\n height: 0;\n border: 10px solid transparent;\n z-index: 1;\n}\n\n.maplibregl-popup-anchor-top .maplibregl-popup-tip {\n align-self: center;\n border-top: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-top-left .maplibregl-popup-tip {\n align-self: flex-start;\n border-top: none;\n border-left: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {\n align-self: flex-end;\n border-top: none;\n border-right: none;\n border-bottom-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {\n align-self: center;\n border-bottom: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip {\n align-self: flex-start;\n border-bottom: none;\n border-left: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {\n align-self: flex-end;\n border-bottom: none;\n border-right: none;\n border-top-color: #fff;\n}\n\n.maplibregl-popup-anchor-left .maplibregl-popup-tip {\n align-self: center;\n border-left: none;\n border-right-color: #fff;\n}\n\n.maplibregl-popup-anchor-right .maplibregl-popup-tip {\n align-self: center;\n border-right: none;\n border-left-color: #fff;\n}\n\n.maplibregl-popup-close-button {\n position: absolute;\n right: 0;\n top: 0;\n border: 0;\n border-radius: 0 3px 0 0;\n cursor: pointer;\n background-color: transparent;\n}\n\n.maplibregl-popup-close-button:hover {\n background-color: rgb(0 0 0 / 5%);\n}\n\n.maplibregl-popup-content {\n position: relative;\n background: #fff;\n border-radius: 3px;\n box-shadow: 0 1px 2px rgb(0 0 0 / 10%);\n padding: 15px 10px;\n pointer-events: auto;\n}\n\n.maplibregl-popup-anchor-top-left .maplibregl-popup-content {\n border-top-left-radius: 0;\n}\n\n.maplibregl-popup-anchor-top-right .maplibregl-popup-content {\n border-top-right-radius: 0;\n}\n\n.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content {\n border-bottom-left-radius: 0;\n}\n\n.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content {\n border-bottom-right-radius: 0;\n}\n\n.maplibregl-popup-track-pointer {\n display: none;\n}\n\n.maplibregl-popup-track-pointer * {\n pointer-events: none;\n user-select: none;\n}\n\n.maplibregl-map:hover .maplibregl-popup-track-pointer {\n display: flex;\n}\n\n.maplibregl-map:active .maplibregl-popup-track-pointer {\n display: none;\n}\n\n.maplibregl-marker {\n position: absolute;\n top: 0;\n left: 0;\n will-change: transform;\n transition: opacity 0.2s;\n}\n\n.maplibregl-user-location-dot {\n background-color: #1da1f2;\n width: 15px;\n height: 15px;\n border-radius: 50%;\n}\n\n.maplibregl-user-location-dot::before {\n background-color: #1da1f2;\n content: "";\n width: 15px;\n height: 15px;\n border-radius: 50%;\n position: absolute;\n animation: maplibregl-user-location-dot-pulse 2s infinite;\n}\n\n.maplibregl-user-location-dot::after {\n border-radius: 50%;\n border: 2px solid #fff;\n content: "";\n height: 19px;\n left: -2px;\n position: absolute;\n top: -2px;\n width: 19px;\n box-sizing: border-box;\n box-shadow: 0 0 3px rgb(0 0 0 / 35%);\n}\n\n@keyframes maplibregl-user-location-dot-pulse {\n 0% { transform: scale(1); opacity: 1; }\n 70% { transform: scale(3); opacity: 0; }\n 100% { transform: scale(1); opacity: 0; }\n}\n\n.maplibregl-user-location-dot-stale {\n background-color: #aaa;\n}\n\n.maplibregl-user-location-dot-stale::after {\n display: none;\n}\n\n.maplibregl-user-location-accuracy-circle {\n background-color: #1da1f233;\n width: 1px;\n height: 1px;\n border-radius: 100%;\n}\n\n.maplibregl-crosshair,\n.maplibregl-crosshair .maplibregl-interactive,\n.maplibregl-crosshair .maplibregl-interactive:active {\n cursor: crosshair;\n}\n\n.maplibregl-boxzoom {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n background: #fff;\n border: 2px dotted #202020;\n opacity: 0.5;\n}\n\n.maplibregl-cooperative-gesture-screen {\n background: rgba(0 0 0 / 40%);\n position: absolute;\n inset: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n color: white;\n padding: 1rem;\n font-size: 1.4em;\n line-height: 1.2;\n opacity: 0;\n pointer-events: none;\n transition: opacity 1s ease 1s;\n z-index: 99999;\n}\n\n.maplibregl-cooperative-gesture-screen.maplibregl-show {\n opacity: 1;\n transition: opacity 0.05s;\n}\n\n.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {\n display: none;\n}\n\n@media (hover: none), (width <= 480px) {\n .maplibregl-cooperative-gesture-screen .maplibregl-desktop-message {\n display: none;\n }\n\n .maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {\n display: block;\n }\n}\n\n.maplibregl-pseudo-fullscreen {\n position: fixed !important;\n width: 100% !important;\n height: 100% !important;\n top: 0 !important;\n left: 0 !important;\n z-index: 99999;\n}\n';var u9e=[cse,pse,fse,dse,hse,mse],gse;function c9e(e){gse=e}o(c9e,"__setWatermarkOnClickFn");var p9e=o(async(e,t)=>{let r,n=fh();t&&n.updateByUserOption(t);try{t&&(r=(await MI(re(k({},t),{baseAuthUri:n.getBaseAuthUri()}))).accessToken)}catch(l){ce.warn("Getting access token failed. Outdoor map disabled.",l)}let i=new Fy(e,{outdoorViewToken:r,languagePacks:t==null?void 0:t.languagePacks,env:n});return new NI(i)},"hydrateMapDataFromMVF"),yse=!1;function f9e(e){yse=e}o(f9e,"setUseEnterpriseAPI");var vse=o(async e=>{var E;let t=yse,r,n=fh();n.updateByUserOption(e);let i=k({},e),s=new ab([i.mapId],i);if("accessToken"in i){r=i.accessToken;let{aud:T,sub:O}=fS(r);(sG.some(D=>T.includes(D))||O&&O.startsWith("client"))&&(t=!0,s.setEnterprise(t))}else if("key"in i&&"secret"in i)i.key.startsWith("mik_")||(t=!0,s.setEnterprise(t)),i.baseAuthUri=n.getBaseAuthUri(t),r=(await s.getAccessTokenAsync()).token;else throw new Error("Missing key or secret.");i.layoutId!=null&&(t?i.layoutId!=="draft"&&ce.warn('Invalid layoutId! Use "draft" to load draft data or leave unspecified to load live data.'):ce.warn("layoutId is currently unsupported!")),i.baseUri=n.getBaseUri(t);let l=performance.now(),c,p;if(t){let T=re(k({},i),{venue:i.mapId,clientId:i.key,clientSecret:i.secret,version:"1.0.0",perspective:i.viewId,useDraftData:i.layoutId==="draft"}),O=await m9(T);c=O.compressed,p=O.localePacks}else c=await g9(i,r);let h=performance.now(),y=await KP(c,i.mvfVersion),b=performance.now();typeof e.onMVFParsed=="function"&&e.onMVFParsed(y);let _=ZP(y);_.length>0?s.setMapIds(_):s.setMapIds([i.mapId]);try{await s.readySync()}catch(T){ce.error("Failed to ready token manager!",T)}let C=new Fy(y,{env:n,outdoorViewToken:r,tokenManager:s,enterprise:t,localePacksUrls:p,binaryBundle:c,getMapDataOptions:i}),P=new NI(C,{search:e.search});if(C.Analytics.init(re(k({accessToken:r,mapId:i.mapId,key:"key"in i?i.key:void 0,secret:"secret"in i?i.secret:void 0},i.analytics),{baseUri:n.getAnalyticsBaseUri(),context:(E=i.analytics)==null?void 0:E.context})),C.Analytics.sendGetMapDataEvent({parseDuration:b-h,downloadDuration:h-l,viewId:i.viewId}),"language"in i)try{await P.changeLanguage(i.language)}catch(T){}return P},"getMapData"),d9e=vse,h9e=o((e,t)=>{rb.instance!=null&&ce.warn("Only a single map venue is supported at this time.");let r=new rb([e.mapCenter.longitude,e.mapCenter.latitude],e,t);return rb.instance=r,r},"createMapLibreOverlay"),bse=o(async(e,t,r)=>{var h,y,b,_,C,P,E,T,O,D,A,R,j,X,Y;let n=performance.now(),i=EO(r,t);i&&TO(i),((h=i.injectStyles)==null||h)&&use(u9e,{id:"mappedin__styles"});let s=lG((y=t.outdoorViewToken)!=null?y:""),l=kI(t);(b=i.outdoorView)!=null&&b.style&&l.envControl.updateTileServerBaseUrl((_=i.outdoorView)==null?void 0:_.style);let c=await doe(e,{center:[t.mapCenter.longitude,t.mapCenter.latitude],bearing:i.bearing,pitch:i.pitch,zoomLevel:i.zoomLevel,backgroundAlpha:(C=i.style)==null?void 0:C.backgroundAlpha,backgroundColor:(P=i.style)==null?void 0:P.backgroundColor,outdoorView:(E=i.outdoorView)!=null&&E.token?{headers:{"x-mappedin-tiles-key":(T=i.outdoorView)==null?void 0:T.token},style:t.getEnv().tileServerUri,enabled:!!((O=i.outdoorView)!=null&&O.enabled),lowDpi:(D=i.outdoorView)==null?void 0:D.lowDpi}:void 0,watermark:re(k({},i.watermark),{visible:(R=(A=i.watermark)==null?void 0:A.visible)!=null?R:!l.enterpriseMode&&!s.remove_watermark,onClick:gse||void 0}),attribution:i.attribution,antialias:typeof i.antialiasing=="boolean"?i.antialiasing:!!((j=i.antialiasing)!=null&&j.enabled),accessToken:t.outdoorViewToken,occlusionEnabled:(X=i.occlusion)==null?void 0:X.enabled,transformImageRequest:l.enterpriseMode?void 0:l.transformImageRequest,naturalBearing:t.naturalBearing,imagePlacementOptions:i.imagePlacementOptions,onWebGLContextCreationError:i.onWebGLContextCreationError,onWebGLContextLost:i.onWebGLContextLost,onWebGLContextRestored:i.onWebGLContextRestored,onWebGLRendererError:i.onWebGLRendererError,useStandaloneCamera:(Y=i.useStandaloneCamera)!=null?Y:!1}),p=new eb(c);return await p.addMap(t,i),l.Analytics.sendMapViewLoadedEvent({firstRenderDuration:performance.now()-n,dimension:p.getDimensions()}),p},"show3dMap"),m9e=bse;function uu(e){return e.verticalOffset===0?[e.longitude,e.latitude]:[e.longitude,e.latitude,e.verticalOffset]}o(uu,"convertCoordinateToPosition");function y9e(e){return new Map(e.map(t=>{let{properties:r}=t,{id:n}=r;return[n,t]}))}o(y9e,"getEntranceMap");var F8=o((e,t)=>{let r=y9e(t),n={entrances:{type:"FeatureCollection",features:[]},walls:{type:"Feature",properties:{id:e[0].properties.id},geometry:{type:"MultiLineString",coordinates:[]}}};for(let i of e){let s=[i.geometry.coordinates],l=(i.properties.entrances||[]).reduce((c,p)=>(r.has(p)&&c.push(r.get(p)),c),[]);if(l.length){let{entrances:c,obstructions:p}=E9(i,l);s=p.map(h=>h.geometry.coordinates),n.entrances.features.push(...c)}n.walls.geometry.coordinates.push(...s)}return n},"cutEntrancesFromLineStrings");function Koe(e,t){let r={options:{}};if(!r.options)throw new Error("options should exist");return e.text&&(r.text=e.text),e.appearance&&(r.options.appearance=e.appearance),e.rank!=null&&(e.rank==="initial"?r.options.rank=t.initialRank||2:r.options.rank=e.rank),e.enabled!==void 0&&(r.enabled=e.enabled),e.interactive!==null&&(r.options.interactive=e.interactive),e.enabled!==null&&(r.enabled=e.enabled),r}o(Koe,"translateLabelStateToGeojsonCore");function Joe(e,t){let r={options:{}};if(!r.options)throw new Error("options should exist");return e.rank!=null&&(e.rank==="initial"?r.options.rank=t.initialRank||2:r.options.rank=e.rank),e.enabled!=null&&(r.enabled=e.enabled),e.interactive!=null&&(r.options.interactive=e.interactive),e.enabled!==null&&(r.enabled=e.enabled),r}o(Joe,"translateMarkerStateToGeojsonCore");function KT(e,t){var n,i;let r={};return t==null||(e.color&&(e.color==="initial"?r.color=t.initialColor:r.color=e.color),e.topColor&&(e.topColor==="initial"?r.topColor=t.initialTopColor:r.topColor=e.topColor),e.visible!==void 0&&(r.visible=e.visible),((n=e.texture)==null?void 0:n.url)!==void 0&&(r.texture=e.texture.url),((i=e.topTexture)==null?void 0:i.url)!==void 0&&(r.topTexture=e.topTexture.url),e.opacity!==void 0&&(r.opacity=e.opacity)),r}o(KT,"translateDoorsStateToGeojsonCore");function lF(e,t){var n,i;let r={};return t==null||(e.color&&(e.color==="initial"?r.color=t.initialColor:r.color=e.color),e.topColor&&(e.topColor==="initial"?r.topColor=t.initialTopColor:r.topColor=e.topColor),e.visible!==void 0&&(r.visible=e.visible),((n=e.texture)==null?void 0:n.url)!==void 0&&(r.texture=e.texture.url),((i=e.topTexture)==null?void 0:i.url)!==void 0&&(r.topTexture=e.topTexture.url),e.height!==void 0&&(r.height=e.height),e.opacity!==void 0&&(r.opacity=e.opacity)),r}o(lF,"translateWallsStateToGeojsonCore");function Qoe(e,t){var n,i;let r={};return t==null||(e.color&&(e.color==="initial"?r.color=t.initialColor:r.color=e.color),e.topColor&&(e.topColor==="initial"?r.topColor=t.initialTopColor:r.topColor=e.topColor),e.visible!==void 0&&(r.visible=e.visible),((n=e.texture)==null?void 0:n.url)!==void 0&&(r.texture=e.texture.url),((i=e.topTexture)==null?void 0:i.url)!==void 0&&(r.topTexture=e.topTexture.url),e.hoverColor!==void 0&&(r.hoverColor=e.hoverColor),e.interactive!==void 0&&(r.interactive=e.interactive),e.height!==void 0&&(r.height=e.height),e.opacity!==void 0&&(r.opacity=e.opacity),e.flipImageToFaceCamera!==void 0&&(r.flipImageToFaceCamera=e.flipImageToFaceCamera)),r}o(Qoe,"translateSpaceStateToGeojsonCore");function xse(e,t){return((t-e+Math.PI)%(Math.PI*2)+Math.PI*2)%(Math.PI*2)-Math.PI}o(xse,"differenceBetweenAngles");function Ise(e,t){let r="Left";return e<=-Math.PI/4?r="Right":e<=-t?r="SlightRight":e<=t?r="Straight":e<=Math.PI/4?r="SlightLeft":r="Left",r}o(Ise,"getRelativeBearing");function Foe(e){let t={};for(let r in e){let n=e[r];if(n!=null){if(n.id=r,"polygons"in n)for(let i of n.polygons)t[i]=n;else if("lineStrings"in n)for(let i of n.lineStrings)t[i]=n;else if("points"in n)for(let i of n.points)t[i]=n}}return t}o(Foe,"extractStyleMap");function VT(e,t){return e.reduce((r,n)=>{let i=t[n.properties.id];if(i==null)return r;if("textures"in n.properties&&Array.isArray(n.properties.textures)&&n.properties.textures.length>0){let s=re(k({},i),{id:i.id+"-textures"});r.set(s,[n])}else r.has(i)||r.set(i,[]),r.get(i).push(n);return r},new Map)}o(VT,"groupGeometryByStyle");function Wv(e,t={}){var i,s,l,c,p,h,y;let r=re(k({},e),{flipImageToFaceCamera:(i=t==null?void 0:t.flipImagesToFaceCamera)!=null?i:!0}),n=(l=(s=t==null?void 0:t.style)==null?void 0:s.shading)!=null?l:t==null?void 0:t.shadingAndOutlines;if(n===!0?r.shading={start:.1,end:.15,intensity:.4}:typeof n=="object"&&(r.shading={start:n.start,end:n.end,intensity:n.intensity}),r.outline=(p=(c=t==null?void 0:t.style)==null?void 0:c.outlines)!=null?p:t==null?void 0:t.shadingAndOutlines,"lineStrings"in e){let b=(y=(h=t==null?void 0:t.style)==null?void 0:h.wallTopColor)!=null?y:t==null?void 0:t.wallTopColor;b!=null&&(r.topColor=b)}return r}o(Wv,"translateToCoreStyle");var ese=o((e,t)=>{var i;let n=((i=t.currentMap)==null?void 0:i.currentFloor).layers.get(Zi);switch(e){case"interior-walls":return n==null?void 0:n.layers.get(Gd);case"exterior-walls":return n==null?void 0:n.layers.get(Vc);case"interior-doors":return n==null?void 0:n.layers.get(k0);case"exterior-doors":return n==null?void 0:n.layers.get(R0);default:return typeof e=="string"?e:e.id}},"getTargetID");function H8(e){return new Promise(t=>{e.onComplete(t),e.onStop(t)})}o(H8,"tweenToPromise");function zT(e){return e.bbox?e.bbox:po(e)}o(zT,"getBoundingBox");function tse(e,t){return[Math.min(e[0],t[0]),Math.min(e[1],t[1]),Math.max(e[2],t[2]),Math.max(e[3],t[3])]}o(tse,"expandBbox");function _se(e){return[...new Set(e)]}o(_se,"unique");function W8(e,t,r){return e.floorId&&t.has(e.floorId)?t.get(e.floorId):r}o(W8,"getTargetFloorObject");function Hv(e){if(wo.is(e)||Oa.is(e))return e.id}o(Hv,"getAttachableGeometryId");function Noe(e,t,r){var s,l,c,p,h,y;let n=e.coordinates.length===2,i=!0;if(n&&e.coordinates[0].floorId!=null&&e.coordinates[1].floorId!=null){let b=t==null?void 0:t.getById("floor",e.coordinates[0].floorId),_=t==null?void 0:t.getById("floor",e.coordinates[1].floorId);b&&_&&(i=((l=(s=r.getState(b))==null?void 0:s.visible)!=null?l:!0)&&((p=(c=r.getState(_))==null?void 0:c.visible)!=null?p:!0))}else{let b=e.coordinates[0].floorId!=null?t==null?void 0:t.getById("floor",e.coordinates[0].floorId):void 0;i=b&&(y=(h=r.getState(b))==null?void 0:h.visible)!=null?y:!0}return i}o(Noe,"determineFloorVisibleBasedOnPath");var Sse=Math.PI*.1,to,Zs,Ca,Ny,ky,yd,Ry,ub,pu,Cse,lb,wse,xF=class xF{constructor(t,r,n,i){G(this,pu);G(this,to,{});G(this,Zs);G(this,Ca);G(this,Ny);G(this,ky);G(this,yd);G(this,Ry);G(this,ub);q(this,Zs,r),q(this,Ca,t.features),q(this,Ny,n),q(this,ky,i)}get path(){return d(this,Ca).map(t=>d(this,Zs).getById("node",t.properties.id)).filter(Boolean)}get departure(){if(d(this,to).departure)return d(this,to).departure;let t=d(this,Ca)[0].properties.id,r=d(this,Ny)[0];if(d(this,Ny).length>1){for(let n of d(this,Ny))if(V_(n,d(this,Zs)).includes(t)){r=n;break}}return d(this,to).departure=r,r}get destination(){if(d(this,to).destination)return d(this,to).destination;let t=d(this,Ca)[d(this,Ca).length-1].properties.id,r=d(this,ky)[0];if(d(this,ky).length>1){for(let n of d(this,ky))if(V_(n,d(this,Zs)).includes(t)){r=n;break}}return d(this,to).destination=r,r}get coordinates(){return d(this,to).coordinates?d(this,to).coordinates:(d(this,to).coordinates=d(this,Ca).map(t=>new Ct(t.geometry.coordinates[1],t.geometry.coordinates[0],t.properties.groupBy)),d(this,to).coordinates)}get distance(){return d(this,to).distance?d(this,to).distance:(d(this,to).distance=d(this,Ca).reduce((t,r)=>t+(r.properties.distance||0),0),d(this,to).distance)}get instructions(){if(d(this,Ca).length<2)return[];if(d(this,to).instructions)return d(this,to).instructions;let t=[],r=0;for(let n=0;n<d(this,Ca).length;n++){let i=d(this,Ca)[n],s=d(this,Ca)[n-1],l=d(this,Ca)[n+1],c=new Ct(i.geometry.coordinates[1],i.geometry.coordinates[0],i.properties.groupBy),p=ke(this,pu,Cse).call(this,{prevDirection:s,direction:i,nextDirection:l});r+=(s==null?void 0:s.properties.distance)||0;for(let h of p)h&&(t.push({action:h,distance:r,coordinate:c,node:d(this,Zs).getById("node",i.properties.id)}),r=0)}return d(this,to).instructions=t,d(this,to).instructions}};to=new WeakMap,Zs=new WeakMap,Ca=new WeakMap,Ny=new WeakMap,ky=new WeakMap,yd=new WeakMap,Ry=new WeakMap,ub=new WeakMap,pu=new WeakSet,Cse=o(function(t){var P,E;let{prevDirection:r,direction:n,nextDirection:i}=t,s=r&&d(this,Zs).getById("floor",r.properties.groupBy),l=d(this,Zs).getById("floor",n.properties.groupBy),c=i&&d(this,Zs).getById("floor",i.properties.groupBy),p=[];r||p.push({type:"Departure"});let h=d(this,Zs).getMVFFeatureByNodeId("connection",n.properties.id),y=h?d(this,Zs).getById("connection",h.id):void 0,b=h&&h.nodes.length>1,_=d(this,Zs).enterpriseMode&&(!n.properties.destination||!(h!=null&&h.nodes.includes(n.properties.destination))||!(h!=null&&h.nodes.includes(n.properties.id)));if(h&&!(!b||_))if(!d(this,yd)||d(this,yd)==="exit")p.push(ke(this,pu,lb).call(this,"TakeConnection",l,c,y,h)),q(this,yd,"take"),q(this,Ry,y),q(this,ub,h);else{let T=d(this,Zs).getMVFFeatureByNodeId("connection",(P=r==null?void 0:r.properties.id)!=null?P:""),O=d(this,Zs).getById("connection",(E=T==null?void 0:T.id)!=null?E:"");p.push(ke(this,pu,lb).call(this,"ExitConnection",l,s,O,T)),q(this,yd,"exit"),q(this,Ry,y),q(this,ub,h)}else d(this,yd)==="take"?(p.push(ke(this,pu,lb).call(this,"ExitConnection",l,s,d(this,Ry),d(this,ub))),q(this,yd,"exit"),q(this,Ry,y)):c&&l.id!==c.id?p.push(ke(this,pu,lb).call(this,"TakeConnection",l,c,y)):s&&s.id!==l.id?p.push(ke(this,pu,lb).call(this,"ExitConnection",l,s,y)):p.push(ke(this,pu,wse).call(this,r,n));return i||p.push({type:"Arrival"}),p},"#getActions"),lb=o(function(t,r,n,i,s){var p,h;let l="none";if(r.elevation!=null&&(n==null?void 0:n.elevation)!=null){let y=r.elevation-n.elevation;y>0?l="down":y<0&&(l="up")}let c=(h=(p=i==null?void 0:i.type)!=null?p:s==null?void 0:s.type)!=null?h:"stairs";return{type:t,fromFloor:r,toFloor:n,direction:l,connection:i,connectionType:c}},"#createConnectionAction"),wse=o(function(t,r){let n=r.properties.edges;if(!n||n.filter(l=>l.destination.properties.id!==(t==null?void 0:t.properties.id)&&l.destination.properties.id!==r.properties.destination).length===0)return null;let s=t?-xse(t.properties.angle,r.properties.angle):0;return Math.abs(s)>=Sse?{type:"Turn",bearing:Ise(s,Sse),referencePosition:"At"}:null},"#createTurnAction"),o(xF,"Directions");var JT=xF,IF=class IF{constructor({nodes:t,geojsonCollection:r,connections:n,groupBy:i,multiplicativeDistanceWeightScaling:s}){x(this,"navigator");x(this,"connections");x(this,"getDirections",o((t,r,n,i)=>{let{accessible:s,smoothing:{enabled:l,radius:c},connectionIdWeightMap:p}=n,h=t.flatMap(T=>V_(T,i)),y=r.flatMap(T=>V_(T,i)),b=this.getExcludedNodeIds(n.excludedConnections).filter(T=>!h.includes(T)&&!y.includes(T)),_=this.getDisabledConnectionNodeIds(s).filter(T=>!h.includes(T)&&!y.includes(T)),C=new Map;for(let T in p){let O=i.getMVFFeatureById("connection",T);if(!O)continue;let D=this.navigator.graph.edges[O.nodes[0]];if(D){let A=D.find(R=>R.destination.properties.id===O.nodes[1]);A&&C.set(A,p[T])}}let P=this.navigator.getDirections({zones:n.zones.map(T=>{var O;return{geometry:T.geometry,cost:T.cost,map:(O=T.floor)==null?void 0:O.id}}),originIds:h,destinationNodeIds:y,excludedNodeIds:b,disabledConnectionNodeIds:_,simplify:{enabled:l,bufferRadius:c},overrideEdgeWeights:C,multiplicativeDistanceWeightScaling:!i.enterpriseMode});this.addCoordinateDirections(P,t,r);let E=new JT(P,i,t,r);if(!(E.distance===0&&new Set([...h,...y]).size===h.length+y.length))return E},"getDirections"));x(this,"getExcludedNodeIds",o(t=>{if(t.length===0)return[];let r=new Set(t.map(n=>n.id));return this.connections.reduce((n,i)=>r.has(i.id)?n.concat(i.nodes):n,[])},"getExcludedNodeIds"));x(this,"getDisabledConnectionNodeIds",o(t=>t===!1?[]:this.connections.reduce((r,n)=>n.accessible?r:r.concat(n.nodes),[]),"getDisabledConnectionNodeIds"));x(this,"addCoordinateDirections",o((t,[r],[n])=>{if(t.features.length){if(Ct.is(r)){let i=this.createDirectionFeature(r,this.navigator.getAngle([r.longitude,r.latitude],t.features[0].geometry.coordinates),this.navigator.getDistance([r.longitude,r.latitude],t.features[0].geometry.coordinates));t.features.splice(0,0,i)}if(Ct.is(n)){let i=this.createDirectionFeature(n,0,0),s=t.features[t.features.length-1];s.properties.distance=this.navigator.getDistance(s.geometry.coordinates,[n.longitude,n.latitude]),s.properties.angle=this.navigator.getAngle(s.geometry.coordinates,[n.longitude,n.latitude]),t.features.push(i)}}},"addCoordinateDirections"));x(this,"createDirectionFeature",o((t,r,n)=>({type:"Feature",geometry:{type:"Point",coordinates:[t.longitude,t.latitude]},properties:{groupBy:t.floorId,id:t.id,angle:r,distance:n,edges:[]}}),"createDirectionFeature"));this.navigator=new X1({nodes:t,geojsonCollection:this.createCollection(r),groupBy:i,multiplicativeDistanceWeightScaling:s}),this.connections=n}createCollection(t){return{type:"FeatureCollection",features:Object.entries(t).reduce((r,[n,i])=>r.concat(i.features.map(s=>(s.properties.map=n,s))),[])}}};o(IF,"DirectionsInternal");var rE=IF;function V_(e,t){var r,n,i,s;if(Wm.is(e))return e.navigationTarget.flatMap(l=>V_(l,t));if(cf.is(e)){let l=t.Query.nearest(e,{types:["node"]});return(r=l==null?void 0:l[0])!=null&&r.feature.id?[l[0].feature.id]:[]}else if(Ct.is(e)){let l=t.Query.nearest(e,{types:["node"]});return(n=l==null?void 0:l[0])!=null&&n.feature.id?[l[0].feature.id]:[]}else if(uf.is(e)){let l=t.Query.nearest(e,{types:["node"]});return(i=l==null?void 0:l[0])!=null&&i.feature.id?[l[0].feature.id]:[]}else if(Au.is(e)){let l=t==null?void 0:t.getMVFFeatureById("entrance",e.id);return l!=null&&l.properties.node?[l==null?void 0:l.properties.node]:[]}else if(rf.is(e)){let l=t==null?void 0:t.getMVFFeatureById("area",e.id);return(s=l==null?void 0:l.properties.destinationNodes)!=null?s:[]}else if(wo.is(e)){let l=t==null?void 0:t.getMVFFeatureById("space",e.id);return l==null?[]:l.properties.destinationNodes}else{if(Vd.is(e))return e.coordinates.reduce((l,c)=>{var h;let p=t.Query.nearest(c,{types:["node"]});return(h=p==null?void 0:p[0])!=null&&h.feature.id&&l.push(p[0].feature.id),l},[]);if(Oa.is(e)){let l=t==null?void 0:t.objectEntranceNodeIdsByObstructionId[e.id];return l!=null?l:[]}else return Fl.is(e)?e.spaces.flatMap(l=>{var c,p;return(p=(c=t==null?void 0:t.getMVFFeatureById("space",l.id))==null?void 0:c.properties.destinationNodes)!=null?p:[]}).filter(l=>typeof l=="string"):Uc.is(e)?e.nodes.map(l=>l.id):Qp.is(e)?[e.id]:[]}}o(V_,"getNodesFromTarget");g();g();g();g();g();g();function _F(e){let t=+this._x.call(null,e),r=+this._y.call(null,e);return Pse(this.cover(t,r),t,r,e)}o(_F,"default");function Pse(e,t,r,n){if(isNaN(t)||isNaN(r))return e;var i,s=e._root,l={data:n},c=e._x0,p=e._y0,h=e._x1,y=e._y1,b,_,C,P,E,T,O,D;if(!s)return e._root=l,e;for(;s.length;)if((E=t>=(b=(c+h)/2))?c=b:h=b,(T=r>=(_=(p+y)/2))?p=_:y=_,i=s,!(s=s[O=T<<1|E]))return i[O]=l,e;if(C=+e._x.call(null,s.data),P=+e._y.call(null,s.data),t===C&&r===P)return l.next=s,i?i[O]=l:e._root=l,e;do i=i?i[O]=new Array(4):e._root=new Array(4),(E=t>=(b=(c+h)/2))?c=b:h=b,(T=r>=(_=(p+y)/2))?p=_:y=_;while((O=T<<1|E)===(D=(P>=_)<<1|C>=b));return i[D]=s,i[O]=l,e}o(Pse,"add");function Tse(e){var t,r,n=e.length,i,s,l=new Array(n),c=new Array(n),p=1/0,h=1/0,y=-1/0,b=-1/0;for(r=0;r<n;++r)isNaN(i=+this._x.call(null,t=e[r]))||isNaN(s=+this._y.call(null,t))||(l[r]=i,c[r]=s,i<p&&(p=i),i>y&&(y=i),s<h&&(h=s),s>b&&(b=s));if(p>y||h>b)return this;for(this.cover(p,h).cover(y,b),r=0;r<n;++r)Pse(this,l[r],c[r],e[r]);return this}o(Tse,"addAll");g();function SF(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var r=this._x0,n=this._y0,i=this._x1,s=this._y1;if(isNaN(r))i=(r=Math.floor(e))+1,s=(n=Math.floor(t))+1;else{for(var l=i-r||1,c=this._root,p,h;r>e||e>=i||n>t||t>=s;)switch(h=(t<n)<<1|e<r,p=new Array(4),p[h]=c,c=p,l*=2,h){case 0:i=r+l,s=n+l;break;case 1:r=i-l,s=n+l;break;case 2:i=r+l,n=s-l;break;case 3:r=i-l,n=s-l;break}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=i,this._y1=s,this}o(SF,"default");g();function CF(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}o(CF,"default");g();function wF(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}o(wF,"default");g();g();function ko(e,t,r,n,i){this.node=e,this.x0=t,this.y0=r,this.x1=n,this.y1=i}o(ko,"default");function PF(e,t,r){var n,i=this._x0,s=this._y0,l,c,p,h,y=this._x1,b=this._y1,_=[],C=this._root,P,E;for(C&&_.push(new ko(C,i,s,y,b)),r==null?r=1/0:(i=e-r,s=t-r,y=e+r,b=t+r,r*=r);P=_.pop();)if(!(!(C=P.node)||(l=P.x0)>y||(c=P.y0)>b||(p=P.x1)<i||(h=P.y1)<s))if(C.length){var T=(l+p)/2,O=(c+h)/2;_.push(new ko(C[3],T,O,p,h),new ko(C[2],l,O,T,h),new ko(C[1],T,c,p,O),new ko(C[0],l,c,T,O)),(E=(t>=O)<<1|e>=T)&&(P=_[_.length-1],_[_.length-1]=_[_.length-1-E],_[_.length-1-E]=P)}else{var D=e-+this._x.call(null,C.data),A=t-+this._y.call(null,C.data),R=D*D+A*A;if(R<r){var j=Math.sqrt(r=R);i=e-j,s=t-j,y=e+j,b=t+j,n=C.data}}return n}o(PF,"default");g();function TF(e){if(isNaN(y=+this._x.call(null,e))||isNaN(b=+this._y.call(null,e)))return this;var t,r=this._root,n,i,s,l=this._x0,c=this._y0,p=this._x1,h=this._y1,y,b,_,C,P,E,T,O;if(!r)return this;if(r.length)for(;;){if((P=y>=(_=(l+p)/2))?l=_:p=_,(E=b>=(C=(c+h)/2))?c=C:h=C,t=r,!(r=r[T=E<<1|P]))return this;if(!r.length)break;(t[T+1&3]||t[T+2&3]||t[T+3&3])&&(n=t,O=T)}for(;r.data!==e;)if(i=r,!(r=r.next))return this;return(s=r.next)&&delete r.next,i?(s?i.next=s:delete i.next,this):t?(s?t[T]=s:delete t[T],(r=t[0]||t[1]||t[2]||t[3])&&r===(t[3]||t[2]||t[1]||t[0])&&!r.length&&(n?n[O]=r:this._root=r),this):(this._root=s,this)}o(TF,"default");function Ese(e){for(var t=0,r=e.length;t<r;++t)this.remove(e[t]);return this}o(Ese,"removeAll");g();function EF(){return this._root}o(EF,"default");g();function MF(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}o(MF,"default");g();function OF(e){var t=[],r,n=this._root,i,s,l,c,p;for(n&&t.push(new ko(n,this._x0,this._y0,this._x1,this._y1));r=t.pop();)if(!e(n=r.node,s=r.x0,l=r.y0,c=r.x1,p=r.y1)&&n.length){var h=(s+c)/2,y=(l+p)/2;(i=n[3])&&t.push(new ko(i,h,y,c,p)),(i=n[2])&&t.push(new ko(i,s,y,h,p)),(i=n[1])&&t.push(new ko(i,h,l,c,y)),(i=n[0])&&t.push(new ko(i,s,l,h,y))}return this}o(OF,"default");g();function LF(e){var t=[],r=[],n;for(this._root&&t.push(new ko(this._root,this._x0,this._y0,this._x1,this._y1));n=t.pop();){var i=n.node;if(i.length){var s,l=n.x0,c=n.y0,p=n.x1,h=n.y1,y=(l+p)/2,b=(c+h)/2;(s=i[0])&&t.push(new ko(s,l,c,y,b)),(s=i[1])&&t.push(new ko(s,y,c,p,b)),(s=i[2])&&t.push(new ko(s,l,b,y,h)),(s=i[3])&&t.push(new ko(s,y,b,p,h))}r.push(n)}for(;n=r.pop();)e(n.node,n.x0,n.y0,n.x1,n.y1);return this}o(LF,"default");g();function Mse(e){return e[0]}o(Mse,"defaultX");function AF(e){return arguments.length?(this._x=e,this):this._x}o(AF,"default");g();function Ose(e){return e[1]}o(Ose,"defaultY");function DF(e){return arguments.length?(this._y=e,this):this._y}o(DF,"default");function z_(e,t,r){var n=new FF(t==null?Mse:t,r==null?Ose:r,NaN,NaN,NaN,NaN);return e==null?n:n.addAll(e)}o(z_,"quadtree");function FF(e,t,r,n,i,s){this._x=e,this._y=t,this._x0=r,this._y0=n,this._x1=i,this._y1=s,this._root=void 0}o(FF,"Quadtree");function Lse(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}o(Lse,"leaf_copy");var wa=z_.prototype=FF.prototype;wa.copy=function(){var e=new FF(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,r,n;if(!t)return e;if(!t.length)return e._root=Lse(t),e;for(r=[{source:t,target:e._root=new Array(4)}];t=r.pop();)for(var i=0;i<4;++i)(n=t.source[i])&&(n.length?r.push({source:n,target:t.target[i]=new Array(4)}):t.target[i]=Lse(n));return e};wa.add=_F;wa.addAll=Tse;wa.cover=SF;wa.data=CF;wa.extent=wF;wa.find=PF;wa.remove=TF;wa.removeAll=Ese;wa.root=EF;wa.size=MF;wa.visit=OF;wa.visitAfter=LF;wa.x=AF;wa.y=DF;var bl,qh,NF=class NF{constructor(t){G(this,bl,{});G(this,qh);q(this,qh,t)}getTreeByType(t,r,n){var l;if(d(this,bl)[t]||(d(this,bl)[t]={}),d(this,bl)[t][r]&&d(this,bl)[t][r][n])return d(this,bl)[t][r][n];d(this,bl)[t][r]||(d(this,bl)[t][r]={}),d(this,bl)[t][r][n]||(d(this,bl)[t][r][n]=z_());let i=d(this,bl)[t][r][n];i.x(c=>c.geometry.coordinates[1]),i.y(c=>c.geometry.coordinates[0]);let s=[];switch(t){case"node":s=((l=d(this,qh).directions.navigator.graph.nodesByGroup.get(n))==null?void 0:l.filter(c=>c.properties.neighbors.length>0))||[];break;case"point-of-interest":s=d(this,qh).mvfPoisByFloorId[n]||[];break;case"door":s=d(this,qh).mvfEntrancesByFloorId[n]||[];break;case"annotation":s=d(this,qh).mvfAnnotationsByFloorId[n]||[];break}return(s==null?void 0:s.length)>0&&i.addAll(s),i}};bl=new WeakMap,qh=new WeakMap,o(NF,"QueryCache");var nE=NF;var v9e=Ss.object({limit:Ss.enum(["same-floor","same-elevation"]).optional(),radius:Ss.number().optional(),types:Ss.array(Ss.enum(["node","point-of-interest"])).min(1)}),Fp,H_,kF=class kF{constructor(t){G(this,Fp);G(this,H_);q(this,Fp,t),q(this,H_,new nE(d(this,Fp)))}nearest(t,r){try{v9e.parse(r)}catch(l){ce.error(l);return}let n=cx(t);if(!n)return;let i=n.floorId?[n.floorId]:[];if(n.floorId==null)for(let l of d(this,Fp).getByType("floor-stack")){let c=l.defaultFloor;c&&i.push(c.id)}else if(r.limit==="same-elevation"){let l=d(this,Fp).floorsById[n.floorId];if(l){let c=l==null?void 0:l.elevation;c&&(i=d(this,Fp).getByType("floor-stack").map(p=>{var h;return(h=p.floors.find(y=>y.elevation===c))==null?void 0:h.id}).filter(Boolean))}}let s=[];for(let l of _se(r.types))for(let c of i){let p=d(this,H_).getTreeByType(l,d(this,Fp).mapName,c).find(n.latitude,n.longitude,r.radius);if(p){let h=d(this,Fp).getById(l,p==null?void 0:p.properties.id);h&&s.push({distance:Ju([n.longitude,n.latitude],p.geometry.coordinates),feature:h})}}return s.sort((l,c)=>l.distance-c.distance)}};Fp=new WeakMap,H_=new WeakMap,o(kF,"Query");var q_=kF;g();g();var W_,RF=class RF{constructor(t){G(this,W_);q(this,W_,t||[])}get raw(){return d(this,W_)}};W_=new WeakMap,o(RF,"OpeningHours");var iE=RF;var Ts,pt,Qn,By=class By extends Co{constructor(r,n){super(n.mvfData.id);x(this,"__type",By.__type);x(this,"id","loc_");x(this,"name","");x(this,"externalId");x(this,"description");x(this,"logo");x(this,"phone");x(this,"social",[]);x(this,"images",[]);x(this,"links",[]);x(this,"website");x(this,"icon");G(this,Ts);G(this,pt,{});G(this,Qn);q(this,Ts,r),q(this,Qn,n.mvfData);for(let i in n.mvfData)i==="links"?this.links=n.mvfData.links.map(s=>new Dd({mvfData:s})):i==="pictures"?this.images=n.mvfData.pictures.map(s=>{var l;return s.url?new Nd({mvfData:re(k({},s),{url:(l=s.url)!=null?l:""}),mapData:d(this,Ts)}):void 0}).filter(s=>s!=null):i==="website"?n.mvfData.website&&(this.website=new Dd({mvfData:n.mvfData.website})):i==="icon"?n.mvfData.icon&&(this.icon=new Nd({mvfData:{url:n.mvfData.icon},mapData:d(this,Ts)})):Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)||Object.defineProperty(this,i,{enumerable:!0,get(){return d(this,Qn)[i]}})}static is(r){return r.__type===By.__type}get spaces(){if(d(this,pt).spaces)return d(this,pt).spaces;if(d(this,Qn).spaces==null)return d(this,pt).spaces=[],d(this,pt).spaces;d(this,pt).spaces=[];for(let r=0;r<d(this,Qn).spaces.length;r++){let n=d(this,Ts).getById("space",d(this,Qn).spaces[r].id);n&&d(this,pt).spaces.push(n)}return d(this,pt).spaces}get points(){if(d(this,pt).points)return d(this,pt).points;if(d(this,Qn).spaces==null)return d(this,pt).points=[],d(this,pt).points;d(this,pt).points=[];for(let r=0;r<d(this,Qn).spaces.length;r++){let n=d(this,Ts).getById("point-of-interest",d(this,Qn).spaces[r].id);n&&d(this,pt).points.push(n)}return d(this,pt).points}get doors(){if(d(this,pt).doors)return d(this,pt).doors;if(d(this,Qn).entrances==null)return d(this,pt).doors=[],d(this,pt).doors;d(this,pt).doors=[];for(let r=0;r<d(this,Qn).entrances.length;r++){let n=d(this,Ts).getById("door",d(this,Qn).entrances[r].id);n&&d(this,pt).doors.push(n)}return d(this,pt).doors}get connections(){var n;if(d(this,pt).connections)return d(this,pt).connections;if(d(this,Qn).connections==null)return d(this,pt).connections=[],d(this,pt).connections;let r=new Set;for(let i=0;i<d(this,Qn).connections.length;i++){let s=d(this,Qn).connections[i],l=d(this,Ts).mvfConnectionsById[s],p=(l==null?[]:l.nodes).map(h=>d(this,Ts).getById("node",h)).filter(Boolean);for(let h of p){if(h==null)continue;let y=Dc([h.coordinate.longitude,h.coordinate.latitude]),_=((n=d(this,Ts).connectionSpaceIdsByLatLon[y])!=null?n:[]).map(C=>d(this,Ts).connectionsById[C]).filter(C=>C!=null);for(let C of _)r.add(C)}}return d(this,pt).connections=Array.from(r),d(this,pt).connections}get annotations(){if(d(this,pt).annotations)return d(this,pt).annotations;if(d(this,Qn).annotations==null)return d(this,pt).annotations=[],d(this,pt).annotations;d(this,pt).annotations=[];for(let r=0;r<d(this,Qn).annotations.length;r++){let n=d(this,Ts).getById("annotation",d(this,Qn).annotations[r].id);n&&d(this,pt).annotations.push(n)}return d(this,pt).annotations}get categories(){return d(this,pt).categories?d(this,pt).categories:d(this,Qn).categories==null?(d(this,pt).categories=[],d(this,pt).categories):(d(this,pt).categories=d(this,Qn).categories.map(r=>d(this,Ts).getById("location-category",r)).filter(r=>r!=null),d(this,pt).categories)}get mapObjects(){return d(this,pt).mapObjects?d(this,pt).mapObjects:d(this,Qn).obstructions==null?(d(this,pt).mapObjects=[],d(this,pt).mapObjects):(d(this,pt).mapObjects=d(this,Qn).obstructions.map(r=>d(this,Ts).getById("object",r.id)).filter(r=>r!=null),d(this,pt).mapObjects)}get areas(){return d(this,pt).areas?d(this,pt).areas:d(this,Qn).areas==null?(d(this,pt).areas=[],d(this,pt).areas):(d(this,pt).areas=d(this,Qn).areas.map(r=>d(this,Ts).getById("area",r.id)).filter(r=>r!=null),d(this,pt).areas)}get focusTarget(){if(d(this,pt).focusTarget)return d(this,pt).focusTarget;let r=[];for(let n of this.spaces)r.push(n);for(let n of this.connections)r.push(...n.coordinates);for(let n of this.doors)r.push(n.focusTarget);for(let n of this.mapObjects)r.push(n.focusTarget);for(let n of this.annotations)r.push(n.focusTarget);return d(this,pt).focusTarget=r,r}get openingHours(){var r;return d(this,pt).openingHours?d(this,pt).openingHours:(d(this,pt).openingHours=new iE((r=d(this,Qn).openingHoursSpecification)!=null?r:[]),d(this,pt).openingHours)}get navigationTarget(){if(d(this,pt).navigationTarget)return d(this,pt).navigationTarget;let r=[];for(let n of this.spaces)r.push(n);for(let n of this.connections)r.push(...n.coordinates);for(let n of this.doors)r.push(n.focusTarget);for(let n of this.mapObjects)r.push(n.focusTarget);for(let n of this.annotations)r.push(n.focusTarget);for(let n of this.points)r.push(n.focusTarget);return d(this,pt).navigationTarget=r,r}toJSON(){return{__type:By.__type,id:this.id,name:this.name}}};Ts=new WeakMap,pt=new WeakMap,Qn=new WeakMap,o(By,"LocationProfile"),x(By,"__type","location-profile");var BF=By,Wm=BF;g();var Hh,Xa,jy,$y=class $y extends Co{constructor(r,n){super(n.mvfData.id);x(this,"__type",$y.__type);x(this,"id","cat_");x(this,"name","");x(this,"icon","");G(this,Hh);G(this,Xa,{});G(this,jy);q(this,Hh,r),q(this,jy,n.mvfData);for(let i in n.mvfData)Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),i)||Object.defineProperty(this,i,{enumerable:!0,get(){return d(this,jy)[i]}})}static is(r){return r.__type===$y.__type}get parent(){return d(this,Xa).parent?d(this,Xa).parent:(d(this,Xa).parent=d(this,jy).parent?d(this,Hh).getById("location-category",d(this,jy).parent):void 0,d(this,Xa).parent)}get children(){return d(this,Xa).children?d(this,Xa).children:(d(this,Xa).children=d(this,Hh).locationCategoriesByParentId[this.id]||[],d(this,Xa).children)}get locationProfiles(){if(d(this,Xa).locationProfiles)return d(this,Xa).locationProfiles;let r=[];for(let n of d(this,Hh).locationProfilesByCategoryId[this.id]||[]){let i=d(this,Hh).getById("location-profile",n.id);i&&r.push(i)}return d(this,Xa).locationProfiles=r,r}toJSON(){return{__type:$y.__type,id:this.id,name:this.name}}};Hh=new WeakMap,Xa=new WeakMap,jy=new WeakMap,o($y,"LocationCategory"),x($y,"__type","location-category");var $F=$y,yx=$F;var St,oE,Ase,cb,jF=class jF extends Lt{constructor(r,n){var c,p,h,y,b;super();G(this,oE);x(this,"Analytics");G(this,St,{});x(this,"Query");x(this,"mvf");x(this,"outdoorViewToken");x(this,"spaceIdsByDestinationNodeId");x(this,"objectEntranceNodeIdsByObstructionId");x(this,"obstructionIdByEntranceId");x(this,"venue");x(this,"tokenManager");x(this,"directions");x(this,"enterpriseMode",!1);x(this,"nodesById");x(this,"spacesById");x(this,"floorsById");x(this,"floorStacksById");x(this,"facadesById");x(this,"facadesBySpaceId");x(this,"connectionsById");x(this,"objectsById");x(this,"doorsById");x(this,"pointsOfInterestById");x(this,"annotationsById");x(this,"areasById");x(this,"locationProfilesById");x(this,"locationCategoriesById");x(this,"locationProfilesByExternalId");x(this,"locationsById");x(this,"locationProfilesByCategoryId");x(this,"locationCategoriesByParentId");x(this,"categoriesById");x(this,"doorsByNodeId");x(this,"mvfLocationsBySpaceId");x(this,"locationIdsByNodeId");x(this,"spaceIdsByNodeId");x(this,"mvfAnnotationsById");x(this,"mvfConnectionsById");x(this,"mvfConnectionsByNodeId");x(this,"mvfConnectionIdsByLatLon");x(this,"mvfEntrancesById");x(this,"mvfNodesById");x(this,"mvfObstructionById");x(this,"mvfSpacesById");x(this,"mvfFloorsById");x(this,"mvfFloorStacksById");x(this,"mvfAreasById");x(this,"connectionSpaceIdsByLatLon");x(this,"locationProfilesByAttachedFeatureId");x(this,"spacesByExternalId");x(this,"nodesByExternalId");x(this,"objectsByExternalId");x(this,"poisByExternalId");x(this,"floorsByExternalId");x(this,"floorStacksByExternalId");x(this,"doorsByExternalId");x(this,"areasByExternalId");x(this,"connectionsByExternalId");x(this,"locationsByExternalId");x(this,"categoriesByExternalId");x(this,"mvfNodesByFloorId");x(this,"mvfSpacesByFloorId");x(this,"mvfPoisByFloorId");x(this,"mvfEntrancesByFloorId");x(this,"mvfAnnotationsByFloorId");x(this,"localePacksUrls");x(this,"currentLanguage");x(this,"languagePacks",{});x(this,"tilesets",{});x(this,"binaryBundle");x(this,"envControl");x(this,"getMapDataOptions");G(this,cb);x(this,"getDirectionsMultiDestination",o((r,n,i)=>this.getDirections(r,n,re(k({},i),{multiDestination:!0})),"getDirectionsMultiDestination"));x(this,"getDirections",o((r,n,i)=>{let{accessible:s=!1,smoothing:l=!0,multiDestination:c=!1}=i||{},p=typeof l=="object"?l.enabled:l,h=typeof l=="object"?l.radius:void 0,y=(i==null?void 0:i.zones)||[],b={accessible:s,zones:y,smoothing:{enabled:p!=null?p:!0,radius:h!=null?h:.75},excludedConnections:(i==null?void 0:i.excludedConnections)||[],connectionIdWeightMap:(i==null?void 0:i.connectionIdWeightMap)||{}};if(c&&Array.isArray(n)){let _=Array.isArray(r)?r:[r],C=[];for(let P of n){let E=Array.isArray(P)?P:[P],T=this.directions.getDirections(_,E,b,this);if(!T){ce.error("getDirections failed due to missing directions for one of the segments");return}_=E,C.push(T)}return C}else{let _=Array.isArray(r)?r:[r],C=Array.isArray(n)?n:[n];if(Array.isArray(C[0])){ce.error("getDirections does not support multi-destination without multisegment option");return}return _[0].id&&C[0].id&&this.Analytics.sendGetDirectionsEvent(_[0].id,C[0].id),this.directions.getDirections(_,C,b,this)}},"getDirections"));x(this,"transformImageRequest",o(async r=>{var i;if(this.enterpriseMode||!this.getMapDataOptions)return{url:r};if(!Bte(r))return{url:r};if($te(r))return{url:r};let n=SS(r);if(!n)return{url:r};try{let s=await((i=this.tokenManager)==null?void 0:i.getSasTokensAsync()),l=s==null?void 0:s[n.mapId];if(l==null)throw new Error("SAS token not found");let[c]=r.split("?");return{url:"".concat(c,"?").concat(l.token)}}catch(s){return ce.error("Failed to append SAS token to image request. Requests for private images may fail.",s),{url:r}}},"transformImageRequest"));let i=(c=n==null?void 0:n.env)!=null?c:fh();if(this.envControl=i,this.binaryBundle=n==null?void 0:n.binaryBundle,this.Analytics=new j0,this.localePacksUrls=(p=n==null?void 0:n.localePacksUrls)!=null?p:{},this.mvf=r,this.outdoorViewToken=n==null?void 0:n.outdoorViewToken,this.getMapDataOptions=n==null?void 0:n.getMapDataOptions,((h=r["tileset.json"])==null?void 0:h.default)!=null&&(this.tilesets[r["tileset.json"].default.key]=r["tileset.json"].default,i.updateTileServerBaseUrl(r["tileset.json"].default.url),r["tileset.json"].others!=null))for(let _ of r["tileset.json"].others)this.tilesets[_.key]=_;this.enterpriseMode=(y=n==null?void 0:n.enterprise)!=null?y:!1,this.tokenManager=n==null?void 0:n.tokenManager;let s=cG(r,this);this.nodesById=s.nodesById,this.spacesById=s.spacesById,this.floorsById=s.floorsById,this.floorStacksById=s.floorStacksById,this.facadesById=s.facadesById,this.facadesBySpaceId=s.facadesBySpaceId,this.connectionsById=s.connectionsById,this.objectsById=s.objectsById,this.doorsById=s.doorsById,this.pointsOfInterestById=s.poisById,this.annotationsById=s.annotationsById,this.areasById=s.areasById,this.locationProfilesById=s.locationProfilesById,this.locationCategoriesById=s.locationCategoriesById,this.locationProfilesByCategoryId=s.locationProfilesByCategoryId,this.locationCategoriesByParentId=s.locationCategoriesByParentId,this.spacesByExternalId=s.spacesByExternalId,this.nodesByExternalId=s.nodesByExternalId,this.objectsByExternalId=s.objectsByExternalId,this.floorsByExternalId=s.floorsByExternalId,this.locationProfilesByExternalId=s.locationProfilesByExternalId,this.floorStacksByExternalId=s.floorStacksByExternalId,this.poisByExternalId=s.poisByExternalId,this.doorsByExternalId=s.doorsByExternalId,this.areasByExternalId=s.areasByExternalId,this.mvfAnnotationsById=s.mvfAnnotationsById,this.mvfConnectionsById=s.mvfConnectionsById,this.mvfConnectionsByNodeId=s.mvfConnectionsByNodeId,this.mvfConnectionIdsByLatLon=s.mvfConnectionIdsByLatLon,this.mvfEntrancesById=s.mvfEntrancesById,this.mvfNodesById=s.mvfNodesById,this.mvfObstructionById=s.mvfObstructionById,this.mvfSpacesById=s.mvfSpacesById,this.mvfFloorsById=s.mvfFloorsById,this.mvfFloorStacksById=s.mvfFloorStacksById,this.mvfNodesByFloorId=s.mvfNodesByFloorId,this.mvfSpacesByFloorId=s.mvfSpacesByFloorId,this.mvfPoisByFloorId=s.mvfPoisByFloorId,this.mvfEntrancesByFloorId=s.mvfEntrancesByFloorId,this.mvfAnnotationsByFloorId=s.mvfAnnotationsByFloorId,this.mvfAreasById=s.mvfAreasById,this.doorsByNodeId=s.doorsByNodeId,this.spaceIdsByDestinationNodeId=s.spaceIdsByDestinationNodeId,this.objectEntranceNodeIdsByObstructionId=s.objectEntranceNodeIdsByObstructionId,this.obstructionIdByEntranceId=s.obstructionIdByEntranceId;let l=uG(r,this);if(this.locationsById=l.locationsById,this.categoriesById=l.categoriesById,this.mvfLocationsBySpaceId=l.mvfLocationsBySpaceId,this.locationIdsByNodeId=l.locationIdsByNodeId,this.connectionSpaceIdsByLatLon=s.connectionIdsByLatLon,this.locationProfilesByAttachedFeatureId=s.locationProfilesByAttachedFeatureId,this.spaceIdsByNodeId=l.spaceIdsByNodeId,this.connectionsByExternalId=l.connectionsByExternalId,this.locationsByExternalId=l.locationsByExternalId,this.categoriesByExternalId=l.categoriesByExternalId,l.venue.name!=null){this.venue=new TC(this,{mvfData:l.venue});let _={};for(let C in l.mvfLocationsById)_[C]=l.mvfLocationsById[C];for(let C in l.locationInstancesById)_[C]=l.locationInstancesById[C];this.languagePacks[this.venue.defaultLanguage.code]={type:"initial",optimized:{"enterprise-location":_,"enterprise-category":l.mvfCategoriesById,"floor-stack":s.mvfFloorStacksById,floor:s.mvfFloorsById}},(b=n==null?void 0:n.languagePacks)==null||b.forEach(({language:C,localePack:P})=>{this.languagePacks[C.code]=y9(P)}),this.currentLanguage=this.venue.defaultLanguage}this.Query=new q_(this),this.directions=new rE({nodes:r["node.geojson"],geojsonCollection:r.enterprise?r.space:r.obstruction,connections:r["connection.json"],groupBy:"map",multiplicativeDistanceWeightScaling:!this.enterpriseMode})}getEnv(){let r=this;return{get baseUri(){var n;return r.envControl.getBaseUri((n=r.enterpriseMode)!=null?n:!1)},get baseAuthUri(){return r.envControl.getBaseAuthUri()},get analyticsBaseUri(){return r.envControl.getAnalyticsBaseUri()},get tileServerUri(){return r.envControl.getTileServerUri()}}}get mapName(){return this.mvf["manifest.geojson"].features[0].properties.name}get organizationId(){var r;return(r=this.mvf["manifest.geojson"].features[0].properties.org_id)!=null?r:""}get mapCenter(){return new Ct(this.mvf["manifest.geojson"].features[0].geometry.coordinates[1],this.mvf["manifest.geojson"].features[0].geometry.coordinates[0])}get naturalBearing(){var r;return(r=this.mvf["manifest.geojson"].features[0].properties.naturalBearing)!=null?r:0}get spaces(){return d(this,St).spaces==null&&(d(this,St).spaces=globalThis.Object.values(this.spacesById)),d(this,St).spaces}get objects(){return d(this,St).objects==null&&(d(this,St).objects=globalThis.Object.values(this.objectsById)),d(this,St).objects}get connections(){return d(this,St).connections==null&&(d(this,St).connections=globalThis.Object.values(this.connectionsById)),d(this,St).connections}get floors(){return d(this,St).floors==null&&(d(this,St).floors=globalThis.Object.values(this.floorsById)),d(this,St).floors}get floorStacks(){return d(this,St).floorStacks==null&&(d(this,St).floorStacks=globalThis.Object.values(this.floorStacksById)),d(this,St).floorStacks}get facades(){return d(this,St).facades==null&&(d(this,St).facades=globalThis.Object.values(this.facadesById)),d(this,St).facades}get doors(){return d(this,St).doors==null&&(d(this,St).doors=globalThis.Object.values(this.doorsById)),d(this,St).doors}get pointsOfInterest(){return d(this,St).pointsOfInterest==null&&(d(this,St).pointsOfInterest=globalThis.Object.values(this.pointsOfInterestById)),d(this,St).pointsOfInterest}get annotations(){return d(this,St).annotations==null&&(d(this,St).annotations=globalThis.Object.values(this.annotationsById)),d(this,St).annotations}get areas(){return d(this,St).areas==null&&(d(this,St).areas=globalThis.Object.values(this.areasById)),d(this,St).areas}get nodes(){return d(this,St).nodes==null&&(d(this,St).nodes=globalThis.Object.values(this.nodesById)),d(this,St).nodes}get locations(){return d(this,St).locations==null&&(d(this,St).locations=globalThis.Object.values(this.locationsById)),globalThis.Object.values(this.locationsById)}get categories(){return d(this,St).categories==null&&(d(this,St).categories=globalThis.Object.values(this.categoriesById)),globalThis.Object.values(this.categoriesById)}get locationProfiles(){return d(this,St).locationProfiles==null&&(d(this,St).locationProfiles=globalThis.Object.values(this.locationProfilesById)),d(this,St).locationProfiles}get locationCategories(){return d(this,St).locationCategories==null&&(d(this,St).locationCategories=globalThis.Object.values(this.locationCategoriesById)),d(this,St).locationCategories}get mvfFloors(){return d(this,St).mvfFloors==null&&(d(this,St).mvfFloors=globalThis.Object.values(this.mvfFloorsById)),d(this,St).mvfFloors}get mvfFloorStacks(){return d(this,St).mvfFloorStacks==null&&(d(this,St).mvfFloorStacks=globalThis.Object.values(this.mvfFloorStacksById)),d(this,St).mvfFloorStacks}getByType(r){switch(r){case"location-profile":return this.locationProfiles;case"location-category":return this.locationCategories;case"area":return this.areas;case"node":return this.nodes;case"space":return this.spaces;case"door":return this.doors;case"floor":return this.floors;case"floor-stack":return this.floorStacks;case"connection":return this.connections;case"object":return this.objects;case"point-of-interest":return this.pointsOfInterest;case"annotation":return this.annotations;case"enterprise-location":return this.locations;case"enterprise-category":return this.categories;case"enterprise-venue":return this.venue;case"facade":return this.facades;default:return[]}}getById(r,n){switch(r){case"location-profile":return this.locationProfilesById[n];case"location-category":return this.locationCategoriesById[n];case"space":return this.spacesById[n];case"floor":return this.floorsById[n];case"floor-stack":return this.floorStacksById[n];case"facade":return this.facadesById[n];case"node":return this.nodesById[n];case"door":return this.doorsById[n];case"connection":let i=this.connectionsById[n];return i==null&&(i=ke(this,oE,Ase).call(this,this.mvfConnectionsById[n])),i;case"object":return this.objectsById[n];case"point-of-interest":return this.pointsOfInterestById[n];case"annotation":return this.annotationsById[n];case"area":return this.areasById[n];case"enterprise-location":return this.locationsById[n];case"enterprise-category":return this.categoriesById[n];default:return}}getByExternalId(r,n){var i,s,l,c,p,h,y,b,_,C,P,E;switch(r){case"location-profile":return(i=this.locationProfilesByExternalId[n])!=null?i:[];case"location-category":return[];case"space":return(s=this.spacesByExternalId[n])!=null?s:[];case"floor":return(l=this.floorsByExternalId[n])!=null?l:[];case"floor-stack":return(c=this.floorStacksByExternalId[n])!=null?c:[];case"node":return(p=this.nodesByExternalId[n])!=null?p:[];case"door":return(h=this.doorsByExternalId[n])!=null?h:[];case"connection":return(y=this.connectionsByExternalId[n])!=null?y:[];case"object":return(b=this.objectsByExternalId[n])!=null?b:[];case"point-of-interest":return(_=this.poisByExternalId[n])!=null?_:[];case"area":return(C=this.areasByExternalId[n])!=null?C:[];case"enterprise-location":return(P=this.locationsByExternalId[n])!=null?P:[];case"enterprise-category":return(E=this.categoriesByExternalId[n])!=null?E:[];default:return[]}}getMapDataById(r){var n,i,s,l,c,p,h,y,b,_;return(_=(b=(y=(h=(p=(c=(l=(s=(i=(n=this.spacesById[r])!=null?n:this.floorsById[r])!=null?i:this.floorStacksById[r])!=null?s:this.facadesById[r])!=null?l:this.nodesById[r])!=null?c:this.doorsById[r])!=null?p:this.connectionsById[r])!=null?h:this.objectsById[r])!=null?y:this.pointsOfInterestById[r])!=null?b:this.annotationsById[r])!=null?_:this.areasById[r]}getMVFFeatureById(r,n){switch(r){case"space":return this.mvfSpacesById[n];case"node":return this.mvfNodesById[n];case"obstruction":return this.mvfObstructionById[n];case"floor":return this.mvfFloorsById[n];case"floor-stack":return this.mvfFloorStacksById[n];case"connection":return this.mvfConnectionsById[n];case"entrance":return this.mvfEntrancesById[n];case"annotation":return this.mvfAnnotationsById[n];case"area":return this.mvfAreasById[n];default:throw new Error("Unknown MVF feature type: ".concat(r))}}getMVFFeatureByNodeId(r,n){switch(r){case"connection":return this.mvfConnectionsByNodeId[n];default:throw new Error("Unsupported MVF feature type: ".concat(r))}}getMVFFeatureByType(r){switch(r){case"floor-stack":return this.mvfFloorStacks;case"floor":return this.mvfFloors;default:throw new Error("Unsupported MVF feature type: ".concat(r))}}getPropTranslation(r,n,i,s){var p,h;if(!this.currentLanguage)return s;let{code:l}=this.currentLanguage,c=(h=(p=this.languagePacks[l])==null?void 0:p.optimized)==null?void 0:h[r];if(c){let y=c[i];if(y!=null&&y[n]!==void 0)return y[n]}return s}async changeLanguage(r){var c;let n=r.toLowerCase();if(!n){ce.error("language code must be defined");return}if(!this.currentLanguage){ce.error("languageCode feature is not supported");return}let i=this.currentLanguage.code,s=(c=this.venue)==null?void 0:c.languages.find(({code:p})=>p.toLowerCase()===n.toLowerCase());if(!s){ce.warn("language not found");return}if(i===s.code)return;let l=this.languagePacks[s.code];if(!l){let p=this.localePacksUrls[s.code];if(!p){ce.error("locale packs url not found for ".concat(s.code));return}d(this,cb)&&d(this,cb).abort();let h=new AbortController;q(this,cb,h);let y;try{y=await kte(p,{signal:h.signal})}catch(b){ce.error("failed downloading language pack",b);return}if(!y||h.signal.aborted)return;l=y9(y),this.languagePacks[s.code]=l}this.Analytics.sendChangeLanguageEvent({fromLanguage:this.currentLanguage.code}),this.currentLanguage=s,this.publish("language-change",this.currentLanguage)}getDistance(r,n){let i=cx(r),s=cx(n);return Ju([i.longitude,i.latitude],[s.longitude,s.latitude])}async toJSONBundle({downloadLanguagePacks:r=!0}={}){var i;let n=[];if(r&&this.enterpriseMode){let s=new AbortController;for(let l of((i=this.venue)==null?void 0:i.languages)||[])try{if(this.localePacksUrls[l.code]){let c=await h9(this.localePacksUrls[l.code],{signal:s.signal}),p=await W1(c);p&&n.push({language:{code:l.code,name:l.name},localePack:p})}}catch(c){ce.warn("failed downloading language pack",c)}}return{type:"json",options:{enterprise:this.enterpriseMode},languagePacks:n,main:this.mvf}}async toBinaryBundle({downloadLanguagePacks:r=!0}={}){var i;if(!this.binaryBundle){ce.error("binary bundle not found");return}let n=[];if(r&&this.enterpriseMode){let s=new AbortController;for(let l of((i=this.venue)==null?void 0:i.languages)||[])try{if(this.localePacksUrls[l.code]){let c=await h9(this.localePacksUrls[l.code],{signal:s.signal});c&&n.push({language:{code:l.code,name:l.name},localePack:c})}}catch(c){ce.warn("failed downloading language pack",c)}}return{type:"binary",options:{enterprise:this.enterpriseMode},languagePacks:n,main:this.binaryBundle}}destroy(){for(let r of globalThis.Object.keys(d(this,St)))d(this,St)[r]=null}};St=new WeakMap,oE=new WeakSet,Ase=o(function(r){var c;let n=(c=r==null?void 0:r.nodes)==null?void 0:c[0],i=this.getById("node",n);if(i==null)return;let s=Dc([i.coordinate.longitude,i.coordinate.latitude]),l=this.connectionSpaceIdsByLatLon[s];return l==null?void 0:l.map(p=>this.connectionsById[p]).find(p=>p!=null)},"#getConnectionFromMVFConnection"),cb=new WeakMap,o(jF,"MapDataInternal");var Fy=jF;var fb,Gy,X_,Np,pb=class pb extends Mu{constructor(r,n){super(n.mvfData.id,r);x(this,"__type",pb.__type);G(this,fb);G(this,Gy);G(this,X_);G(this,Np,{});q(this,fb,n.mvfData),q(this,Gy,r),q(this,X_,n.floorStackId)}static is(r){return r.__type===pb.__type}get floorStack(){return d(this,Gy).getById("floor-stack",d(this,X_))}get spaces(){if(!d(this,Np).spaces){d(this,Np).spaces=[];for(let r of d(this,fb).spaces){let n=d(this,Gy).getById("space",r.spaceId);n&&d(this,Np).spaces.push(n)}}return d(this,Np).spaces}get center(){if(!d(this,Np).center){let r={type:"FeatureCollection",features:[]};for(let i of this.spaces){let s=d(this,Gy).mvfSpacesById[i.id];s&&r.features.push(s)}if(r.features.length===0)throw new Error("No geometry found for facade!");let n=Nc(r);d(this,Np).center=new Ct(n.geometry.coordinates[1],n.geometry.coordinates[0],d(this,fb).spaces[0].floorId)}return d(this,Np).center}get focusTarget(){return this.spaces}get anchorTarget(){return this.center}};fb=new WeakMap,Gy=new WeakMap,X_=new WeakMap,Np=new WeakMap,o(pb,"Facade"),x(pb,"__type","facade");var GF=pb,Fl=GF;export{Ct as a,Qp as b,wo as c,Db as d,Fl as e,Uc as f,gx as g,le as h,B7 as i,MAe as j,vse as k,bse as l,g9e as m};