@aibee/crc-bmap 0.12.30 → 0.12.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";var OB=Object.create;var jt=Object.defineProperty;var YB=Object.getOwnPropertyDescriptor;var jB=Object.getOwnPropertyNames,Z0=Object.getOwnPropertySymbols,RB=Object.getPrototypeOf,k0=Object.prototype.hasOwnProperty,NB=Object.prototype.propertyIsEnumerable;var Qr=(t,g,I)=>g in t?jt(t,g,{enumerable:!0,configurable:!0,writable:!0,value:I}):t[g]=I,qr=(t,g)=>{for(var I in g||(g={}))k0.call(g,I)&&Qr(t,I,g[I]);if(Z0)for(var I of Z0(g))NB.call(g,I)&&Qr(t,I,g[I]);return t};var p=(t,g)=>()=>(g||t((g={exports:{}}).exports,g),g.exports),H0=(t,g)=>{for(var I in g)jt(t,I,{get:g[I],enumerable:!0})},L0=(t,g,I,A)=>{if(g&&typeof g=="object"||typeof g=="function")for(let C of jB(g))!k0.call(t,C)&&C!==I&&jt(t,C,{get:()=>g[C],enumerable:!(A=YB(g,C))||A.enumerable});return t};var l=(t,g,I)=>(I=t!=null?OB(RB(t)):{},L0(g||!t||!t.__esModule?jt(I,"default",{value:t,enumerable:!0}):I,t)),WB=t=>L0(jt({},"__esModule",{value:!0}),t);var Dg=(t,g,I)=>Qr(t,typeof g!="symbol"?g+"":g,I);var m=(t,g,I)=>new Promise((A,C)=>{var e=r=>{try{n(I.next(r))}catch(o){C(o)}},i=r=>{try{n(I.throw(r))}catch(o){C(o)}},n=r=>r.done?A(r.value):Promise.resolve(r.value).then(e,i);n((I=I.apply(t,g)).next())});var Z=p(($r,U0)=>{"use strict";var Rt=function(t){return t&&t.Math===Math&&t};U0.exports=Rt(typeof globalThis=="object"&&globalThis)||Rt(typeof window=="object"&&window)||Rt(typeof self=="object"&&self)||Rt(typeof global=="object"&&global)||Rt(typeof $r=="object"&&$r)||function(){return this}()||Function("return this")()});var H=p((sN,X0)=>{"use strict";X0.exports=function(t){try{return!!t()}catch(g){return!0}}});var eg=p((aN,V0)=>{"use strict";var FB=H();V0.exports=!FB(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var Nt=p((uN,z0)=>{"use strict";var ZB=H();z0.exports=!ZB(function(){var t=function(){}.bind();return typeof t!="function"||t.hasOwnProperty("prototype")})});var og=p((lN,J0)=>{"use strict";var kB=Nt(),mi=Function.prototype.call;J0.exports=kB?mi.bind(mi):function(){return mi.apply(mi,arguments)}});var go=p($0=>{"use strict";var Q0={}.propertyIsEnumerable,q0=Object.getOwnPropertyDescriptor,HB=q0&&!Q0.call({1:2},1);$0.f=HB?function(g){var I=q0(this,g);return!!I&&I.enumerable}:Q0});var WA=p((hN,gl)=>{"use strict";gl.exports=function(t,g){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:g}}});var F=p((pN,Cl)=>{"use strict";var Il=Nt(),Al=Function.prototype,Io=Al.call,LB=Il&&Al.bind.bind(Io,Io);Cl.exports=Il?LB:function(t){return function(){return Io.apply(t,arguments)}}});var sA=p((fN,el)=>{"use strict";var tl=F(),UB=tl({}.toString),XB=tl("".slice);el.exports=function(t){return XB(UB(t),8,-1)}});var Wt=p((dN,il)=>{"use strict";var VB=F(),zB=H(),JB=sA(),Ao=Object,QB=VB("".split);il.exports=zB(function(){return!Ao("z").propertyIsEnumerable(0)})?function(t){return JB(t)==="String"?QB(t,""):Ao(t)}:Ao});var Ft=p((mN,nl)=>{"use strict";nl.exports=function(t){return t==null}});var fC=p((yN,rl)=>{"use strict";var qB=Ft(),$B=TypeError;rl.exports=function(t){if(qB(t))throw new $B("Can't call method on "+t);return t}});var ZC=p((SN,ol)=>{"use strict";var gM=Wt(),IM=fC();ol.exports=function(t){return gM(IM(t))}});var ig=p((DN,sl)=>{"use strict";var Co=typeof document=="object"&&document.all;sl.exports=typeof Co=="undefined"&&Co!==void 0?function(t){return typeof t=="function"||t===Co}:function(t){return typeof t=="function"}});var Mg=p((wN,al)=>{"use strict";var AM=ig();al.exports=function(t){return typeof t=="object"?t!==null:AM(t)}});var xI=p((BN,ul)=>{"use strict";var to=Z(),CM=ig(),tM=function(t){return CM(t)?t:void 0};ul.exports=function(t,g){return arguments.length<2?tM(to[t]):to[t]&&to[t][g]}});var kC=p((MN,ll)=>{"use strict";var eM=F();ll.exports=eM({}.isPrototypeOf)});var HC=p((vN,pl)=>{"use strict";var iM=Z(),cl=iM.navigator,hl=cl&&cl.userAgent;pl.exports=hl?String(hl):""});var Zt=p((PN,Dl)=>{"use strict";var Sl=Z(),eo=HC(),fl=Sl.process,dl=Sl.Deno,ml=fl&&fl.versions||dl&&dl.version,yl=ml&&ml.v8,KI,yi;yl&&(KI=yl.split("."),yi=KI[0]>0&&KI[0]<4?1:+(KI[0]+KI[1]));!yi&&eo&&(KI=eo.match(/Edge\/(\d+)/),(!KI||KI[1]>=74)&&(KI=eo.match(/Chrome\/(\d+)/),KI&&(yi=+KI[1])));Dl.exports=yi});var Si=p((_N,Bl)=>{"use strict";var wl=Zt(),nM=H(),rM=Z(),oM=rM.String;Bl.exports=!!Object.getOwnPropertySymbols&&!nM(function(){var t=Symbol("symbol detection");return!oM(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&wl&&wl<41})});var io=p((EN,Ml)=>{"use strict";var sM=Si();Ml.exports=sM&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var kt=p((bN,vl)=>{"use strict";var aM=xI(),uM=ig(),lM=kC(),cM=io(),hM=Object;vl.exports=cM?function(t){return typeof t=="symbol"}:function(t){var g=aM("Symbol");return uM(g)&&lM(g.prototype,hM(t))}});var LC=p((xN,Pl)=>{"use strict";var pM=String;Pl.exports=function(t){try{return pM(t)}catch(g){return"Object"}}});var JI=p((KN,_l)=>{"use strict";var fM=ig(),dM=LC(),mM=TypeError;_l.exports=function(t){if(fM(t))return t;throw new mM(dM(t)+" is not a function")}});var Ht=p((GN,El)=>{"use strict";var yM=JI(),SM=Ft();El.exports=function(t,g){var I=t[g];return SM(I)?void 0:yM(I)}});var xl=p((TN,bl)=>{"use strict";var no=og(),ro=ig(),oo=Mg(),DM=TypeError;bl.exports=function(t,g){var I,A;if(g==="string"&&ro(I=t.toString)&&!oo(A=no(I,t))||ro(I=t.valueOf)&&!oo(A=no(I,t))||g!=="string"&&ro(I=t.toString)&&!oo(A=no(I,t)))return A;throw new DM("Can't convert object to primitive value")}});var FA=p((ON,Kl)=>{"use strict";Kl.exports=!1});var Di=p((YN,Tl)=>{"use strict";var Gl=Z(),wM=Object.defineProperty;Tl.exports=function(t,g){try{wM(Gl,t,{value:g,configurable:!0,writable:!0})}catch(I){Gl[t]=g}return g}});var wi=p((jN,jl)=>{"use strict";var BM=FA(),MM=Z(),vM=Di(),Ol="__core-js_shared__",Yl=jl.exports=MM[Ol]||vM(Ol,{});(Yl.versions||(Yl.versions=[])).push({version:"3.42.0",mode:BM?"pure":"global",copyright:"\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var Bi=p((RN,Nl)=>{"use strict";var Rl=wi();Nl.exports=function(t,g){return Rl[t]||(Rl[t]=g||{})}});var Zg=p((NN,Wl)=>{"use strict";var PM=fC(),_M=Object;Wl.exports=function(t){return _M(PM(t))}});var kg=p((WN,Fl)=>{"use strict";var EM=F(),bM=Zg(),xM=EM({}.hasOwnProperty);Fl.exports=Object.hasOwn||function(g,I){return xM(bM(g),I)}});var Mi=p((FN,Zl)=>{"use strict";var KM=F(),GM=0,TM=Math.random(),OM=KM(1 .toString);Zl.exports=function(t){return"Symbol("+(t===void 0?"":t)+")_"+OM(++GM+TM,36)}});var dg=p((ZN,Hl)=>{"use strict";var YM=Z(),jM=Bi(),kl=kg(),RM=Mi(),NM=Si(),WM=io(),UC=YM.Symbol,so=jM("wks"),FM=WM?UC.for||UC:UC&&UC.withoutSetter||RM;Hl.exports=function(t){return kl(so,t)||(so[t]=NM&&kl(UC,t)?UC[t]:FM("Symbol."+t)),so[t]}});var ao=p((kN,Xl)=>{"use strict";var ZM=og(),Ll=Mg(),Ul=kt(),kM=Ht(),HM=xl(),LM=dg(),UM=TypeError,XM=LM("toPrimitive");Xl.exports=function(t,g){if(!Ll(t)||Ul(t))return t;var I=kM(t,XM),A;if(I){if(g===void 0&&(g="default"),A=ZM(I,t,g),!Ll(A)||Ul(A))return A;throw new UM("Can't convert object to primitive value")}return g===void 0&&(g="number"),HM(t,g)}});var vi=p((HN,Vl)=>{"use strict";var VM=ao(),zM=kt();Vl.exports=function(t){var g=VM(t,"string");return zM(g)?g:g+""}});var Pi=p((LN,Jl)=>{"use strict";var JM=Z(),zl=Mg(),uo=JM.document,QM=zl(uo)&&zl(uo.createElement);Jl.exports=function(t){return QM?uo.createElement(t):{}}});var lo=p((UN,Ql)=>{"use strict";var qM=eg(),$M=H(),gv=Pi();Ql.exports=!qM&&!$M(function(){return Object.defineProperty(gv("div"),"a",{get:function(){return 7}}).a!==7})});var _i=p($l=>{"use strict";var Iv=eg(),Av=og(),Cv=go(),tv=WA(),ev=ZC(),iv=vi(),nv=kg(),rv=lo(),ql=Object.getOwnPropertyDescriptor;$l.f=Iv?ql:function(g,I){if(g=ev(g),I=iv(I),rv)try{return ql(g,I)}catch(A){}if(nv(g,I))return tv(!Av(Cv.f,g,I),g[I])}});var co=p((VN,gc)=>{"use strict";var ov=eg(),sv=H();gc.exports=ov&&sv(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var Ng=p((zN,Ic)=>{"use strict";var av=Mg(),uv=String,lv=TypeError;Ic.exports=function(t){if(av(t))return t;throw new lv(uv(t)+" is not an object")}});var pI=p(Cc=>{"use strict";var cv=eg(),hv=lo(),pv=co(),Ei=Ng(),Ac=vi(),fv=TypeError,ho=Object.defineProperty,dv=Object.getOwnPropertyDescriptor,po="enumerable",fo="configurable",mo="writable";Cc.f=cv?pv?function(g,I,A){if(Ei(g),I=Ac(I),Ei(A),typeof g=="function"&&I==="prototype"&&"value"in A&&mo in A&&!A[mo]){var C=dv(g,I);C&&C[mo]&&(g[I]=A.value,A={configurable:fo in A?A[fo]:C[fo],enumerable:po in A?A[po]:C[po],writable:!1})}return ho(g,I,A)}:ho:function(g,I,A){if(Ei(g),I=Ac(I),Ei(A),hv)try{return ho(g,I,A)}catch(C){}if("get"in A||"set"in A)throw new fv("Accessors not supported");return"value"in A&&(g[I]=A.value),g}});var fI=p((QN,tc)=>{"use strict";var mv=eg(),yv=pI(),Sv=WA();tc.exports=mv?function(t,g,I){return yv.f(t,g,Sv(1,I))}:function(t,g,I){return t[g]=I,t}});var Lt=p((qN,ic)=>{"use strict";var yo=eg(),Dv=kg(),ec=Function.prototype,wv=yo&&Object.getOwnPropertyDescriptor,So=Dv(ec,"name"),Bv=So&&function(){}.name==="something",Mv=So&&(!yo||yo&&wv(ec,"name").configurable);ic.exports={EXISTS:So,PROPER:Bv,CONFIGURABLE:Mv}});var wo=p(($N,nc)=>{"use strict";var vv=F(),Pv=ig(),Do=wi(),_v=vv(Function.toString);Pv(Do.inspectSource)||(Do.inspectSource=function(t){return _v(t)});nc.exports=Do.inspectSource});var sc=p((gW,oc)=>{"use strict";var Ev=Z(),bv=ig(),rc=Ev.WeakMap;oc.exports=bv(rc)&&/native code/.test(String(rc))});var bi=p((IW,uc)=>{"use strict";var xv=Bi(),Kv=Mi(),ac=xv("keys");uc.exports=function(t){return ac[t]||(ac[t]=Kv(t))}});var xi=p((AW,lc)=>{"use strict";lc.exports={}});var QI=p((CW,pc)=>{"use strict";var Gv=sc(),hc=Z(),Tv=Mg(),Ov=fI(),Bo=kg(),Mo=wi(),Yv=bi(),jv=xi(),cc="Object already initialized",vo=hc.TypeError,Rv=hc.WeakMap,Ki,Ut,Gi,Nv=function(t){return Gi(t)?Ut(t):Ki(t,{})},Wv=function(t){return function(g){var I;if(!Tv(g)||(I=Ut(g)).type!==t)throw new vo("Incompatible receiver, "+t+" required");return I}};Gv||Mo.state?(GI=Mo.state||(Mo.state=new Rv),GI.get=GI.get,GI.has=GI.has,GI.set=GI.set,Ki=function(t,g){if(GI.has(t))throw new vo(cc);return g.facade=t,GI.set(t,g),g},Ut=function(t){return GI.get(t)||{}},Gi=function(t){return GI.has(t)}):(dC=Yv("state"),jv[dC]=!0,Ki=function(t,g){if(Bo(t,dC))throw new vo(cc);return g.facade=t,Ov(t,dC,g),g},Ut=function(t){return Bo(t,dC)?t[dC]:{}},Gi=function(t){return Bo(t,dC)});var GI,dC;pc.exports={set:Ki,get:Ut,has:Gi,enforce:Nv,getterFor:Wv}});var Eo=p((tW,mc)=>{"use strict";var _o=F(),Fv=H(),Zv=ig(),Ti=kg(),Po=eg(),kv=Lt().CONFIGURABLE,Hv=wo(),dc=QI(),Lv=dc.enforce,Uv=dc.get,fc=String,Oi=Object.defineProperty,Xv=_o("".slice),Vv=_o("".replace),zv=_o([].join),Jv=Po&&!Fv(function(){return Oi(function(){},"length",{value:8}).length!==8}),Qv=String(String).split("String"),qv=mc.exports=function(t,g,I){Xv(fc(g),0,7)==="Symbol("&&(g="["+Vv(fc(g),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),I&&I.getter&&(g="get "+g),I&&I.setter&&(g="set "+g),(!Ti(t,"name")||kv&&t.name!==g)&&(Po?Oi(t,"name",{value:g,configurable:!0}):t.name=g),Jv&&I&&Ti(I,"arity")&&t.length!==I.arity&&Oi(t,"length",{value:I.arity});try{I&&Ti(I,"constructor")&&I.constructor?Po&&Oi(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(C){}var A=Lv(t);return Ti(A,"source")||(A.source=zv(Qv,typeof g=="string"?g:"")),t};Function.prototype.toString=qv(function(){return Zv(this)&&Uv(this).source||Hv(this)},"toString")});var dI=p((eW,yc)=>{"use strict";var $v=ig(),gP=pI(),IP=Eo(),AP=Di();yc.exports=function(t,g,I,A){A||(A={});var C=A.enumerable,e=A.name!==void 0?A.name:g;if($v(I)&&IP(I,e,A),A.global)C?t[g]=I:AP(g,I);else{try{A.unsafe?t[g]&&(C=!0):delete t[g]}catch(i){}C?t[g]=I:gP.f(t,g,{value:I,enumerable:!1,configurable:!A.nonConfigurable,writable:!A.nonWritable})}return t}});var Dc=p((iW,Sc)=>{"use strict";var CP=Math.ceil,tP=Math.floor;Sc.exports=Math.trunc||function(g){var I=+g;return(I>0?tP:CP)(I)}});var tI=p((nW,wc)=>{"use strict";var eP=Dc();wc.exports=function(t){var g=+t;return g!==g||g===0?0:eP(g)}});var Xt=p((rW,Bc)=>{"use strict";var iP=tI(),nP=Math.max,rP=Math.min;Bc.exports=function(t,g){var I=iP(t);return I<0?nP(I+g,0):rP(I,g)}});var mC=p((oW,Mc)=>{"use strict";var oP=tI(),sP=Math.min;Mc.exports=function(t){var g=oP(t);return g>0?sP(g,9007199254740991):0}});var bg=p((sW,vc)=>{"use strict";var aP=mC();vc.exports=function(t){return aP(t.length)}});var Ec=p((aW,_c)=>{"use strict";var uP=ZC(),lP=Xt(),cP=bg(),Pc=function(t){return function(g,I,A){var C=uP(g),e=cP(C);if(e===0)return!t&&-1;var i=lP(A,e),n;if(t&&I!==I){for(;e>i;)if(n=C[i++],n!==n)return!0}else for(;e>i;i++)if((t||i in C)&&C[i]===I)return t||i||0;return!t&&-1}};_c.exports={includes:Pc(!0),indexOf:Pc(!1)}});var xo=p((uW,xc)=>{"use strict";var hP=F(),bo=kg(),pP=ZC(),fP=Ec().indexOf,dP=xi(),bc=hP([].push);xc.exports=function(t,g){var I=pP(t),A=0,C=[],e;for(e in I)!bo(dP,e)&&bo(I,e)&&bc(C,e);for(;g.length>A;)bo(I,e=g[A++])&&(~fP(C,e)||bc(C,e));return C}});var Yi=p((lW,Kc)=>{"use strict";Kc.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Ko=p(Gc=>{"use strict";var mP=xo(),yP=Yi(),SP=yP.concat("length","prototype");Gc.f=Object.getOwnPropertyNames||function(g){return mP(g,SP)}});var Go=p(Tc=>{"use strict";Tc.f=Object.getOwnPropertySymbols});var Yc=p((pW,Oc)=>{"use strict";var DP=xI(),wP=F(),BP=Ko(),MP=Go(),vP=Ng(),PP=wP([].concat);Oc.exports=DP("Reflect","ownKeys")||function(g){var I=BP.f(vP(g)),A=MP.f;return A?PP(I,A(g)):I}});var ji=p((fW,Rc)=>{"use strict";var jc=kg(),_P=Yc(),EP=_i(),bP=pI();Rc.exports=function(t,g,I){for(var A=_P(g),C=bP.f,e=EP.f,i=0;i<A.length;i++){var n=A[i];!jc(t,n)&&!(I&&jc(I,n))&&C(t,n,e(g,n))}}});var Wc=p((dW,Nc)=>{"use strict";var xP=H(),KP=ig(),GP=/#|\.prototype\./,Vt=function(t,g){var I=OP[TP(t)];return I===jP?!0:I===YP?!1:KP(g)?xP(g):!!g},TP=Vt.normalize=function(t){return String(t).replace(GP,".").toLowerCase()},OP=Vt.data={},YP=Vt.NATIVE="N",jP=Vt.POLYFILL="P";Nc.exports=Vt});var V=p((mW,Fc)=>{"use strict";var Ri=Z(),RP=_i().f,NP=fI(),WP=dI(),FP=Di(),ZP=ji(),kP=Wc();Fc.exports=function(t,g){var I=t.target,A=t.global,C=t.stat,e,i,n,r,o,s;if(A?i=Ri:C?i=Ri[I]||FP(I,{}):i=Ri[I]&&Ri[I].prototype,i)for(n in g){if(o=g[n],t.dontCallGetSet?(s=RP(i,n),r=s&&s.value):r=i[n],e=kP(A?n:I+(C?".":"#")+n,t.forced),!e&&r!==void 0){if(typeof o==typeof r)continue;ZP(o,r)}(t.sham||r&&r.sham)&&NP(o,"sham",!0),WP(i,n,o,t)}}});var zt=p((yW,Zc)=>{"use strict";var HP=sA();Zc.exports=Array.isArray||function(g){return HP(g)==="Array"}});var To=p((SW,kc)=>{"use strict";var LP=eg(),UP=zt(),XP=TypeError,VP=Object.getOwnPropertyDescriptor,zP=LP&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();kc.exports=zP?function(t,g){if(UP(t)&&!VP(t,"length").writable)throw new XP("Cannot set read only .length");return t.length=g}:function(t,g){return t.length=g}});var Ni=p((DW,Hc)=>{"use strict";var JP=TypeError,QP=9007199254740991;Hc.exports=function(t){if(t>QP)throw JP("Maximum allowed index exceeded");return t}});var W=p(()=>{"use strict";var qP=V(),$P=Zg(),g_=bg(),I_=To(),A_=Ni(),C_=H(),t_=C_(function(){return[].push.call({length:4294967296},1)!==4294967297}),e_=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}},i_=t_||!e_();qP({target:"Array",proto:!0,arity:1,forced:i_},{push:function(g){var I=$P(this),A=g_(I),C=arguments.length;A_(A+C);for(var e=0;e<C;e++)I[A]=arguments[e],A++;return I_(I,A),A}})});var Uc=p((MW,Lc)=>{"use strict";Lc.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}});var zc=p((vW,Vc)=>{"use strict";var n_=Pi(),Oo=n_("span").classList,Xc=Oo&&Oo.constructor&&Oo.constructor.prototype;Vc.exports=Xc===Object.prototype?void 0:Xc});var Yo=p((PW,Jc)=>{"use strict";var r_=xo(),o_=Yi();Jc.exports=Object.keys||function(g){return r_(g,o_)}});var qc=p(Qc=>{"use strict";var s_=eg(),a_=co(),u_=pI(),l_=Ng(),c_=ZC(),h_=Yo();Qc.f=s_&&!a_?Object.defineProperties:function(g,I){l_(g);for(var A=c_(I),C=h_(I),e=C.length,i=0,n;e>i;)u_.f(g,n=C[i++],A[n]);return g}});var gh=p((EW,$c)=>{"use strict";var p_=xI();$c.exports=p_("document","documentElement")});var yC=p((bW,nh)=>{"use strict";var f_=Ng(),d_=qc(),Ih=Yi(),m_=xi(),y_=gh(),S_=Pi(),D_=bi(),Ah=">",Ch="<",Ro="prototype",No="script",eh=D_("IE_PROTO"),jo=function(){},ih=function(t){return Ch+No+Ah+t+Ch+"/"+No+Ah},th=function(t){t.write(ih("")),t.close();var g=t.parentWindow.Object;return t=null,g},w_=function(){var t=S_("iframe"),g="java"+No+":",I;return t.style.display="none",y_.appendChild(t),t.src=String(g),I=t.contentWindow.document,I.open(),I.write(ih("document.F=Object")),I.close(),I.F},Wi,Fi=function(){try{Wi=new ActiveXObject("htmlfile")}catch(g){}Fi=typeof document!="undefined"?document.domain&&Wi?th(Wi):w_():th(Wi);for(var t=Ih.length;t--;)delete Fi[Ro][Ih[t]];return Fi()};m_[eh]=!0;nh.exports=Object.create||function(g,I){var A;return g!==null?(jo[Ro]=f_(g),A=new jo,jo[Ro]=null,A[eh]=g):A=Fi(),I===void 0?A:d_.f(A,I)}});var Jt=p((xW,rh)=>{"use strict";var B_=dg(),M_=yC(),v_=pI().f,Wo=B_("unscopables"),Fo=Array.prototype;Fo[Wo]===void 0&&v_(Fo,Wo,{configurable:!0,value:M_(null)});rh.exports=function(t){Fo[Wo][t]=!0}});var XC=p((KW,oh)=>{"use strict";oh.exports={}});var ah=p((GW,sh)=>{"use strict";var P_=H();sh.exports=!P_(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})});var Qt=p((TW,lh)=>{"use strict";var __=kg(),E_=ig(),b_=Zg(),x_=bi(),K_=ah(),uh=x_("IE_PROTO"),Zo=Object,G_=Zo.prototype;lh.exports=K_?Zo.getPrototypeOf:function(t){var g=b_(t);if(__(g,uh))return g[uh];var I=g.constructor;return E_(I)&&g instanceof I?I.prototype:g instanceof Zo?G_:null}});var Uo=p((OW,ph)=>{"use strict";var T_=H(),O_=ig(),Y_=Mg(),j_=yC(),ch=Qt(),R_=dI(),N_=dg(),W_=FA(),Lo=N_("iterator"),hh=!1,aA,ko,Ho;[].keys&&(Ho=[].keys(),"next"in Ho?(ko=ch(ch(Ho)),ko!==Object.prototype&&(aA=ko)):hh=!0);var F_=!Y_(aA)||T_(function(){var t={};return aA[Lo].call(t)!==t});F_?aA={}:W_&&(aA=j_(aA));O_(aA[Lo])||R_(aA,Lo,function(){return this});ph.exports={IteratorPrototype:aA,BUGGY_SAFARI_ITERATORS:hh}});var ZA=p((YW,dh)=>{"use strict";var Z_=pI().f,k_=kg(),H_=dg(),fh=H_("toStringTag");dh.exports=function(t,g,I){t&&!I&&(t=t.prototype),t&&!k_(t,fh)&&Z_(t,fh,{configurable:!0,value:g})}});var Xo=p((jW,mh)=>{"use strict";var L_=Uo().IteratorPrototype,U_=yC(),X_=WA(),V_=ZA(),z_=XC(),J_=function(){return this};mh.exports=function(t,g,I,A){var C=g+" Iterator";return t.prototype=U_(L_,{next:X_(+!A,I)}),V_(t,C,!1,!0),z_[C]=J_,t}});var qt=p((RW,yh)=>{"use strict";var Q_=F(),q_=JI();yh.exports=function(t,g,I){try{return Q_(q_(Object.getOwnPropertyDescriptor(t,g)[I]))}catch(A){}}});var Dh=p((NW,Sh)=>{"use strict";var $_=Mg();Sh.exports=function(t){return $_(t)||t===null}});var Bh=p((WW,wh)=>{"use strict";var gE=Dh(),IE=String,AE=TypeError;wh.exports=function(t){if(gE(t))return t;throw new AE("Can't set "+IE(t)+" as a prototype")}});var SC=p((FW,Mh)=>{"use strict";var CE=qt(),tE=Mg(),eE=fC(),iE=Bh();Mh.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t=!1,g={},I;try{I=CE(Object.prototype,"__proto__","set"),I(g,[]),t=g instanceof Array}catch(A){}return function(C,e){return eE(C),iE(e),tE(C)&&(t?I(C,e):C.__proto__=e),C}}():void 0)});var zo=p((ZW,Oh)=>{"use strict";var nE=V(),rE=og(),Zi=FA(),Gh=Lt(),oE=ig(),sE=Xo(),vh=Qt(),Ph=SC(),aE=ZA(),uE=fI(),Vo=dI(),lE=dg(),_h=XC(),Th=Uo(),cE=Gh.PROPER,hE=Gh.CONFIGURABLE,Eh=Th.IteratorPrototype,ki=Th.BUGGY_SAFARI_ITERATORS,$t=lE("iterator"),bh="keys",ge="values",xh="entries",Kh=function(){return this};Oh.exports=function(t,g,I,A,C,e,i){sE(I,g,A);var n=function(S){if(S===C&&u)return u;if(!ki&&S&&S in s)return s[S];switch(S){case bh:return function(){return new I(this,S)};case ge:return function(){return new I(this,S)};case xh:return function(){return new I(this,S)}}return function(){return new I(this)}},r=g+" Iterator",o=!1,s=t.prototype,a=s[$t]||s["@@iterator"]||C&&s[C],u=!ki&&a||n(C),c=g==="Array"&&s.entries||a,h,f,d;if(c&&(h=vh(c.call(new t)),h!==Object.prototype&&h.next&&(!Zi&&vh(h)!==Eh&&(Ph?Ph(h,Eh):oE(h[$t])||Vo(h,$t,Kh)),aE(h,r,!0,!0),Zi&&(_h[r]=Kh))),cE&&C===ge&&a&&a.name!==ge&&(!Zi&&hE?uE(s,"name",ge):(o=!0,u=function(){return rE(a,this)})),C)if(f={values:n(ge),keys:e?u:n(bh),entries:n(xh)},i)for(d in f)(ki||o||!(d in s))&&Vo(s,d,f[d]);else nE({target:g,proto:!0,forced:ki||o},f);return(!Zi||i)&&s[$t]!==u&&Vo(s,$t,u,{name:C}),_h[g]=u,f}});var Hi=p((kW,Yh)=>{"use strict";Yh.exports=function(t,g){return{value:t,done:g}}});var Qo=p((HW,Fh)=>{"use strict";var pE=ZC(),Jo=Jt(),jh=XC(),Nh=QI(),fE=pI().f,dE=zo(),Li=Hi(),mE=FA(),yE=eg(),Wh="Array Iterator",SE=Nh.set,DE=Nh.getterFor(Wh);Fh.exports=dE(Array,"Array",function(t,g){SE(this,{type:Wh,target:pE(t),index:0,kind:g})},function(){var t=DE(this),g=t.target,I=t.index++;if(!g||I>=g.length)return t.target=null,Li(void 0,!0);switch(t.kind){case"keys":return Li(I,!1);case"values":return Li(g[I],!1)}return Li([I,g[I]],!1)},"values");var Rh=jh.Arguments=jh.Array;Jo("keys");Jo("values");Jo("entries");if(!mE&&yE&&Rh.name!=="values")try{fE(Rh,"name",{value:"values"})}catch(t){}});var _=p(()=>{"use strict";var Zh=Z(),Hh=Uc(),wE=zc(),Ie=Qo(),kh=fI(),BE=ZA(),ME=dg(),qo=ME("iterator"),$o=Ie.values,Lh=function(t,g){if(t){if(t[qo]!==$o)try{kh(t,qo,$o)}catch(A){t[qo]=$o}if(BE(t,g,!0),Hh[g]){for(var I in Ie)if(t[I]!==Ie[I])try{kh(t,I,Ie[I])}catch(A){t[I]=Ie[I]}}}};for(Ui in Hh)Lh(Zh[Ui]&&Zh[Ui].prototype,Ui);var Ui;Lh(wE,"DOMTokenList")});var Xi=p((XW,zh)=>{"use strict";var vE=Nt(),Vh=Function.prototype,Uh=Vh.apply,Xh=Vh.call;zh.exports=typeof Reflect=="object"&&Reflect.apply||(vE?Xh.bind(Uh):function(){return Xh.apply(Uh,arguments)})});var Ae=p((VW,Jh)=>{"use strict";var PE=F();Jh.exports=PE([].slice)});var $h=p((zW,qh)=>{"use strict";var _E=dg(),EE=_E("toStringTag"),Qh={};Qh[EE]="z";qh.exports=String(Qh)==="[object z]"});var uA=p((JW,gp)=>{"use strict";var bE=$h(),xE=ig(),Vi=sA(),KE=dg(),GE=KE("toStringTag"),TE=Object,OE=Vi(function(){return arguments}())==="Arguments",YE=function(t,g){try{return t[g]}catch(I){}};gp.exports=bE?Vi:function(t){var g,I,A;return t===void 0?"Undefined":t===null?"Null":typeof(I=YE(g=TE(t),GE))=="string"?I:OE?Vi(g):(A=Vi(g))==="Object"&&xE(g.callee)?"Arguments":A}});var eI=p((QW,Ip)=>{"use strict";var jE=uA(),RE=String;Ip.exports=function(t){if(jE(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return RE(t)}});var ip=p((qW,ep)=>{"use strict";var NE=F(),Ap=zt(),WE=ig(),Cp=sA(),FE=eI(),tp=NE([].push);ep.exports=function(t){if(WE(t))return t;if(Ap(t)){for(var g=t.length,I=[],A=0;A<g;A++){var C=t[A];typeof C=="string"?tp(I,C):(typeof C=="number"||Cp(C)==="Number"||Cp(C)==="String")&&tp(I,FE(C))}var e=I.length,i=!0;return function(n,r){if(i)return i=!1,r;if(Ap(this))return r;for(var o=0;o<e;o++)if(I[o]===n)return r}}}});var DC=p(()=>{"use strict";var ZE=V(),cp=xI(),hp=Xi(),kE=og(),Ce=F(),pp=H(),np=ig(),rp=kt(),fp=Ae(),HE=ip(),LE=Si(),UE=String,kA=cp("JSON","stringify"),zi=Ce(/./.exec),op=Ce("".charAt),XE=Ce("".charCodeAt),VE=Ce("".replace),zE=Ce(1 .toString),JE=/[\uD800-\uDFFF]/g,sp=/^[\uD800-\uDBFF]$/,ap=/^[\uDC00-\uDFFF]$/,up=!LE||pp(function(){var t=cp("Symbol")("stringify detection");return kA([t])!=="[null]"||kA({a:t})!=="{}"||kA(Object(t))!=="{}"}),lp=pp(function(){return kA("\uDF06\uD834")!=='"\\udf06\\ud834"'||kA("\uDEAD")!=='"\\udead"'}),QE=function(t,g){var I=fp(arguments),A=HE(g);if(!(!np(A)&&(t===void 0||rp(t))))return I[1]=function(C,e){if(np(A)&&(e=kE(A,this,UE(C),e)),!rp(e))return e},hp(kA,null,I)},qE=function(t,g,I){var A=op(I,g-1),C=op(I,g+1);return zi(sp,t)&&!zi(ap,C)||zi(ap,t)&&!zi(sp,A)?"\\u"+zE(XE(t,0),16):t};kA&&ZE({target:"JSON",stat:!0,arity:3,forced:up||lp},{stringify:function(g,I,A){var C=fp(arguments),e=hp(up?QE:kA,null,C);return lp&&typeof e=="string"?VE(e,JE,qE):e}})});var TI=p((IF,dp)=>{"use strict";var gs=F(),Ji=Set.prototype;dp.exports={Set,add:gs(Ji.add),has:gs(Ji.has),remove:gs(Ji.delete),proto:Ji}});var HA=p((AF,mp)=>{"use strict";var $E=TI().has;mp.exports=function(t){return $E(t),t}});var LA=p((CF,yp)=>{"use strict";var gb=og();yp.exports=function(t,g,I){for(var A=I?t:t.iterator,C=t.next,e,i;!(e=gb(C,A)).done;)if(i=g(e.value),i!==void 0)return i}});var VC=p((tF,Mp)=>{"use strict";var Sp=F(),Ib=LA(),Dp=TI(),Ab=Dp.Set,wp=Dp.proto,Cb=Sp(wp.forEach),Bp=Sp(wp.keys),tb=Bp(new Ab).next;Mp.exports=function(t,g,I){return I?Ib({iterator:Bp(t),next:tb},g):Cb(t,g)}});var Qi=p((eF,Pp)=>{"use strict";var vp=TI(),eb=VC(),ib=vp.Set,nb=vp.add;Pp.exports=function(t){var g=new ib;return eb(t,function(I){nb(g,I)}),g}});var zC=p((iF,_p)=>{"use strict";var rb=qt(),ob=TI();_p.exports=rb(ob.proto,"size","get")||function(t){return t.size}});var bp=p((nF,Ep)=>{"use strict";Ep.exports=function(t){return{iterator:t,next:t.next,done:!1}}});var UA=p((rF,Yp)=>{"use strict";var xp=JI(),Tp=Ng(),Kp=og(),sb=tI(),ab=bp(),Gp="Invalid size",ub=RangeError,lb=TypeError,cb=Math.max,Op=function(t,g){this.set=t,this.size=cb(g,0),this.has=xp(t.has),this.keys=xp(t.keys)};Op.prototype={getIterator:function(){return ab(Tp(Kp(this.keys,this.set)))},includes:function(t){return Kp(this.has,this.set,t)}};Yp.exports=function(t){Tp(t);var g=+t.size;if(g!==g)throw new lb(Gp);var I=sb(g);if(I<0)throw new ub(Gp);return new Op(t,I)}});var Wp=p((oF,Np)=>{"use strict";var hb=HA(),Rp=TI(),pb=Qi(),fb=zC(),db=UA(),mb=VC(),yb=LA(),Sb=Rp.has,jp=Rp.remove;Np.exports=function(g){var I=hb(this),A=db(g),C=pb(I);return fb(I)<=A.size?mb(I,function(e){A.includes(e)&&jp(C,e)}):yb(A.getIterator(),function(e){Sb(I,e)&&jp(C,e)}),C}});var XA=p((sF,kp)=>{"use strict";var Db=xI(),Fp=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},Zp=function(t){return{size:t,has:function(){return!0},keys:function(){throw new Error("e")}}};kp.exports=function(t,g){var I=Db("Set");try{new I()[t](Fp(0));try{return new I()[t](Fp(-1)),!1}catch(C){if(!g)return!0;try{return new I()[t](Zp(-1/0)),!1}catch(e){var A=new I;return A.add(1),A.add(2),g(A[t](Zp(1/0)))}}}catch(C){return!1}}});var OI=p(()=>{"use strict";var wb=V(),Bb=Wp(),Mb=XA(),vb=!Mb("difference",function(t){return t.size===0});wb({target:"Set",proto:!0,real:!0,forced:vb},{difference:Bb})});var Up=p((lF,Lp)=>{"use strict";var Pb=HA(),Is=TI(),_b=zC(),Eb=UA(),bb=VC(),xb=LA(),Kb=Is.Set,Hp=Is.add,Gb=Is.has;Lp.exports=function(g){var I=Pb(this),A=Eb(g),C=new Kb;return _b(I)>A.size?xb(A.getIterator(),function(e){Gb(I,e)&&Hp(C,e)}):bb(I,function(e){A.includes(e)&&Hp(C,e)}),C}});var YI=p(()=>{"use strict";var Tb=V(),Ob=H(),Yb=Up(),jb=XA(),Rb=!jb("intersection",function(t){return t.size===2&&t.has(1)&&t.has(2)})||Ob(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});Tb({target:"Set",proto:!0,real:!0,forced:Rb},{intersection:Yb})});var qi=p((pF,Vp)=>{"use strict";var Nb=og(),Xp=Ng(),Wb=Ht();Vp.exports=function(t,g,I){var A,C;Xp(t);try{if(A=Wb(t,"return"),!A){if(g==="throw")throw I;return I}A=Nb(A,t)}catch(e){C=!0,A=e}if(g==="throw")throw I;if(C)throw A;return Xp(A),I}});var Jp=p((fF,zp)=>{"use strict";var Fb=HA(),Zb=TI().has,kb=zC(),Hb=UA(),Lb=VC(),Ub=LA(),Xb=qi();zp.exports=function(g){var I=Fb(this),A=Hb(g);if(kb(I)<=A.size)return Lb(I,function(e){if(A.includes(e))return!1},!0)!==!1;var C=A.getIterator();return Ub(C,function(e){if(Zb(I,e))return Xb(C,"normal",!1)})!==!1}});var jI=p(()=>{"use strict";var Vb=V(),zb=Jp(),Jb=XA(),Qb=!Jb("isDisjointFrom",function(t){return!t});Vb({target:"Set",proto:!0,real:!0,forced:Qb},{isDisjointFrom:zb})});var qp=p((yF,Qp)=>{"use strict";var qb=HA(),$b=zC(),gx=VC(),Ix=UA();Qp.exports=function(g){var I=qb(this),A=Ix(g);return $b(I)>A.size?!1:gx(I,function(C){if(!A.includes(C))return!1},!0)!==!1}});var RI=p(()=>{"use strict";var Ax=V(),Cx=qp(),tx=XA(),ex=!tx("isSubsetOf",function(t){return t});Ax({target:"Set",proto:!0,real:!0,forced:ex},{isSubsetOf:Cx})});var gf=p((wF,$p)=>{"use strict";var ix=HA(),nx=TI().has,rx=zC(),ox=UA(),sx=LA(),ax=qi();$p.exports=function(g){var I=ix(this),A=ox(g);if(rx(I)<A.size)return!1;var C=A.getIterator();return sx(C,function(e){if(!nx(I,e))return ax(C,"normal",!1)})!==!1}});var NI=p(()=>{"use strict";var ux=V(),lx=gf(),cx=XA(),hx=!cx("isSupersetOf",function(t){return!t});ux({target:"Set",proto:!0,real:!0,forced:hx},{isSupersetOf:lx})});var Af=p((vF,If)=>{"use strict";var px=HA(),As=TI(),fx=Qi(),dx=UA(),mx=LA(),yx=As.add,Sx=As.has,Dx=As.remove;If.exports=function(g){var I=px(this),A=dx(g).getIterator(),C=fx(I);return mx(A,function(e){Sx(I,e)?Dx(C,e):yx(C,e)}),C}});var WI=p(()=>{"use strict";var wx=V(),Bx=Af(),Mx=XA();wx({target:"Set",proto:!0,real:!0,forced:!Mx("symmetricDifference")},{symmetricDifference:Bx})});var tf=p((EF,Cf)=>{"use strict";var vx=HA(),Px=TI().add,_x=Qi(),Ex=UA(),bx=LA();Cf.exports=function(g){var I=vx(this),A=Ex(g).getIterator(),C=_x(I);return bx(A,function(e){Px(C,e)}),C}});var FI=p(()=>{"use strict";var xx=V(),Kx=tf(),Gx=XA();xx({target:"Set",proto:!0,real:!0,forced:!Gx("union")},{union:Kx})});var nf=p((LF,ef)=>{"use strict";var Tx=Ng();ef.exports=function(){var t=Tx(this),g="";return t.hasIndices&&(g+="d"),t.global&&(g+="g"),t.ignoreCase&&(g+="i"),t.multiline&&(g+="m"),t.dotAll&&(g+="s"),t.unicode&&(g+="u"),t.unicodeSets&&(g+="v"),t.sticky&&(g+="y"),g}});var of=p((UF,rf)=>{"use strict";var es=H(),Ox=Z(),is=Ox.RegExp,ns=es(function(){var t=is("a","y");return t.lastIndex=2,t.exec("abcd")!==null}),Yx=ns||es(function(){return!is("a","y").sticky}),jx=ns||es(function(){var t=is("^r","gy");return t.lastIndex=2,t.exec("str")!==null});rf.exports={BROKEN_CARET:jx,MISSED_STICKY:Yx,UNSUPPORTED_Y:ns}});var af=p((XF,sf)=>{"use strict";var Rx=H(),Nx=Z(),Wx=Nx.RegExp;sf.exports=Rx(function(){var t=Wx(".","s");return!(t.dotAll&&t.test(`
2
2
  `)&&t.flags==="s")})});var lf=p((VF,uf)=>{"use strict";var Fx=H(),Zx=Z(),kx=Zx.RegExp;uf.exports=Fx(function(){var t=kx("(?<a>b)","g");return t.exec("b").groups.a!=="b"||"b".replace(t,"$<a>c")!=="bc"})});var In=p((zF,hf)=>{"use strict";var JC=og(),gn=F(),Hx=eI(),Lx=nf(),Ux=of(),Xx=Bi(),Vx=yC(),zx=QI().get,Jx=af(),Qx=lf(),qx=Xx("native-string-replace",String.prototype.replace),$i=RegExp.prototype.exec,os=$i,$x=gn("".charAt),gK=gn("".indexOf),IK=gn("".replace),rs=gn("".slice),ss=function(){var t=/a/,g=/b*/g;return JC($i,t,"a"),JC($i,g,"a"),t.lastIndex!==0||g.lastIndex!==0}(),cf=Ux.BROKEN_CARET,as=/()??/.exec("")[1]!==void 0,AK=ss||as||cf||Jx||Qx;AK&&(os=function(g){var I=this,A=zx(I),C=Hx(g),e=A.raw,i,n,r,o,s,a,u;if(e)return e.lastIndex=I.lastIndex,i=JC(os,e,C),I.lastIndex=e.lastIndex,i;var c=A.groups,h=cf&&I.sticky,f=JC(Lx,I),d=I.source,S=0,w=C;if(h&&(f=IK(f,"y",""),gK(f,"g")===-1&&(f+="g"),w=rs(C,I.lastIndex),I.lastIndex>0&&(!I.multiline||I.multiline&&$x(C,I.lastIndex-1)!==`
3
3
  `)&&(d="(?: "+d+")",w=" "+w,S++),n=new RegExp("^(?:"+d+")",f)),as&&(n=new RegExp("^"+d+"$(?!\\s)",f)),ss&&(r=I.lastIndex),o=JC($i,h?n:I,w),h?o?(o.input=rs(o.input,S),o[0]=rs(o[0],S),o.index=I.lastIndex,I.lastIndex+=o[0].length):I.lastIndex=0:ss&&o&&(I.lastIndex=I.global?o.index+o[0].length:r),as&&o&&o.length>1&&JC(qx,o[0],n,function(){for(s=1;s<arguments.length-2;s++)arguments[s]===void 0&&(o[s]=void 0)}),o&&c)for(o.groups=a=Vx(null),s=0;s<c.length;s++)u=c[s],a[u[0]]=o[u[1]];return o});hf.exports=os});var nI=p(()=>{"use strict";var CK=V(),pf=In();CK({target:"RegExp",proto:!0,forced:/./.exec!==pf},{exec:pf})});var ff=p(()=>{"use strict";var rK=V(),oK=Z(),sK=ZA();rK({global:!0},{Reflect:{}});sK(oK.Reflect,"Reflect",!0)});var mf=p((iZ,df)=>{"use strict";var aK=pI().f;df.exports=function(t,g,I){I in t||aK(t,I,{configurable:!0,get:function(){return g[I]},set:function(A){g[I]=A}})}});var An=p((nZ,Sf)=>{"use strict";var uK=ig(),lK=Mg(),yf=SC();Sf.exports=function(t,g,I){var A,C;return yf&&uK(A=g.constructor)&&A!==I&&lK(C=A.prototype)&&C!==I.prototype&&yf(t,C),t}});var wf=p((rZ,Df)=>{"use strict";var cK=eI();Df.exports=function(t,g){return t===void 0?arguments.length<2?"":g:cK(t)}});var Mf=p((oZ,Bf)=>{"use strict";var hK=Mg(),pK=fI();Bf.exports=function(t,g){hK(g)&&"cause"in g&&pK(t,"cause",g.cause)}});var Ef=p((sZ,_f)=>{"use strict";var fK=F(),vf=Error,dK=fK("".replace),mK=function(t){return String(new vf(t).stack)}("zxcasd"),Pf=/\n\s*at [^:]*:[^\n]*/,yK=Pf.test(mK);_f.exports=function(t,g){if(yK&&typeof t=="string"&&!vf.prepareStackTrace)for(;g--;)t=dK(t,Pf,"");return t}});var xf=p((aZ,bf)=>{"use strict";var SK=H(),DK=WA();bf.exports=!SK(function(){var t=new Error("a");return"stack"in t?(Object.defineProperty(t,"stack",DK(1,7)),t.stack!==7):!0})});var Tf=p((uZ,Gf)=>{"use strict";var wK=fI(),BK=Ef(),MK=xf(),Kf=Error.captureStackTrace;Gf.exports=function(t,g,I,A){MK&&(Kf?Kf(t,g):wK(t,"stack",BK(I,A)))}});var Zf=p((lZ,Ff)=>{"use strict";var Of=xI(),vK=kg(),Yf=fI(),PK=kC(),jf=SC(),Rf=ji(),Nf=mf(),_K=An(),EK=wf(),bK=Mf(),xK=Tf(),KK=eg(),Wf=FA();Ff.exports=function(t,g,I,A){var C="stackTraceLimit",e=A?2:1,i=t.split("."),n=i[i.length-1],r=Of.apply(null,i);if(r){var o=r.prototype;if(!Wf&&vK(o,"cause")&&delete o.cause,!I)return r;var s=Of("Error"),a=g(function(u,c){var h=EK(A?c:u,void 0),f=A?new r(u):new r;return h!==void 0&&Yf(f,"message",h),xK(f,a,f.stack,2),this&&PK(o,this)&&_K(f,this,a),arguments.length>e&&bK(f,arguments[e]),f});if(a.prototype=o,n!=="Error"?jf?jf(a,s):Rf(a,s,{name:!0}):KK&&C in r&&(Nf(a,r,C),Nf(a,r,"prepareStackTrace")),Rf(a,r),!Wf)try{o.name!==n&&Yf(o,"name",n),o.constructor=a}catch(u){}return a}}});var ps=p(()=>{"use strict";var Hf=V(),GK=Z(),$I=Xi(),Lf=Zf(),cs="WebAssembly",kf=GK[cs],Cn=new Error("e",{cause:7}).cause!==7,BC=function(t,g){var I={};I[t]=Lf(t,g,Cn),Hf({global:!0,constructor:!0,arity:1,forced:Cn},I)},hs=function(t,g){if(kf&&kf[t]){var I={};I[t]=Lf(cs+"."+t,g,Cn),Hf({target:cs,stat:!0,constructor:!0,arity:1,forced:Cn},I)}};BC("Error",function(t){return function(I){return $I(t,this,arguments)}});BC("EvalError",function(t){return function(I){return $I(t,this,arguments)}});BC("RangeError",function(t){return function(I){return $I(t,this,arguments)}});BC("ReferenceError",function(t){return function(I){return $I(t,this,arguments)}});BC("SyntaxError",function(t){return function(I){return $I(t,this,arguments)}});BC("TypeError",function(t){return function(I){return $I(t,this,arguments)}});BC("URIError",function(t){return function(I){return $I(t,this,arguments)}});hs("CompileError",function(t){return function(I){return $I(t,this,arguments)}});hs("LinkError",function(t){return function(I){return $I(t,this,arguments)}});hs("RuntimeError",function(t){return function(I){return $I(t,this,arguments)}})});var Qf=p((SZ,Jf)=>{"use strict";nI();var Uf=og(),Xf=dI(),TK=In(),Vf=H(),zf=dg(),OK=fI(),YK=zf("species"),ys=RegExp.prototype;Jf.exports=function(t,g,I,A){var C=zf(t),e=!Vf(function(){var o={};return o[C]=function(){return 7},""[t](o)!==7}),i=e&&!Vf(function(){var o=!1,s=/a/;return t==="split"&&(s={},s.constructor={},s.constructor[YK]=function(){return s},s.flags="",s[C]=/./[C]),s.exec=function(){return o=!0,null},s[C](""),!o});if(!e||!i||I){var n=/./[C],r=g(C,""[t],function(o,s,a,u,c){var h=s.exec;return h===TK||h===ys.exec?e&&!c?{done:!0,value:Uf(n,s,a,u)}:{done:!0,value:Uf(o,a,s,u)}:{done:!1}});Xf(String.prototype,t,r[0]),Xf(ys,C,r[1])}A&&OK(ys[C],"sham",!0)}});var en=p((DZ,gd)=>{"use strict";var Ss=F(),jK=tI(),RK=eI(),NK=fC(),WK=Ss("".charAt),qf=Ss("".charCodeAt),FK=Ss("".slice),$f=function(t){return function(g,I){var A=RK(NK(g)),C=jK(I),e=A.length,i,n;return C<0||C>=e?t?"":void 0:(i=qf(A,C),i<55296||i>56319||C+1===e||(n=qf(A,C+1))<56320||n>57343?t?WK(A,C):i:t?FK(A,C,C+2):(i-55296<<10)+(n-56320)+65536)}};gd.exports={codeAt:$f(!1),charAt:$f(!0)}});var Ad=p((wZ,Id)=>{"use strict";var ZK=en().charAt;Id.exports=function(t,g,I){return g+(I?ZK(t,g).length:1)}});var td=p((BZ,Cd)=>{"use strict";var Bs=F(),kK=Zg(),HK=Math.floor,Ds=Bs("".charAt),LK=Bs("".replace),ws=Bs("".slice),UK=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,XK=/\$([$&'`]|\d{1,2})/g;Cd.exports=function(t,g,I,A,C,e){var i=I+t.length,n=A.length,r=XK;return C!==void 0&&(C=kK(C),r=UK),LK(e,r,function(o,s){var a;switch(Ds(s,0)){case"$":return"$";case"&":return t;case"`":return ws(g,0,I);case"'":return ws(g,i);case"<":a=C[ws(s,1,-1)];break;default:var u=+s;if(u===0)return o;if(u>n){var c=HK(u/10);return c===0?o:c<=n?A[c-1]===void 0?Ds(s,1):A[c-1]+Ds(s,1):o}a=A[u-1]}return a===void 0?"":a})}});var nd=p((MZ,id)=>{"use strict";var ed=og(),VK=Ng(),zK=ig(),JK=sA(),QK=In(),qK=TypeError;id.exports=function(t,g){var I=t.exec;if(zK(I)){var A=ed(I,t,g);return A!==null&&VK(A),A}if(JK(t)==="RegExp")return ed(QK,t,g);throw new qK("RegExp#exec called on incompatible receiver")}});var oe=p(()=>{"use strict";var $K=Xi(),rd=og(),nn=F(),g6=Qf(),I6=H(),A6=Ng(),C6=ig(),t6=Mg(),e6=tI(),i6=mC(),$C=eI(),n6=fC(),r6=Ad(),o6=Ht(),s6=td(),a6=nd(),u6=dg(),vs=u6("replace"),l6=Math.max,c6=Math.min,h6=nn([].concat),Ms=nn([].push),od=nn("".indexOf),sd=nn("".slice),p6=function(t){return t===void 0?t:String(t)},f6=function(){return"a".replace(/./,"$0")==="$0"}(),ad=function(){return/./[vs]?/./[vs]("a","$0")==="":!1}(),d6=!I6(function(){var t=/./;return t.exec=function(){var g=[];return g.groups={a:"7"},g},"".replace(t,"$<a>")!=="7"});g6("replace",function(t,g,I){var A=ad?"$":"$0";return[function(e,i){var n=n6(this),r=t6(e)?o6(e,vs):void 0;return r?rd(r,e,n,i):rd(g,$C(n),e,i)},function(C,e){var i=A6(this),n=$C(C);if(typeof e=="string"&&od(e,A)===-1&&od(e,"$<")===-1){var r=I(g,i,n,e);if(r.done)return r.value}var o=C6(e);o||(e=$C(e));var s=i.global,a;s&&(a=i.unicode,i.lastIndex=0);for(var u=[],c;c=a6(i,n),!(c===null||(Ms(u,c),!s));){var h=$C(c[0]);h===""&&(i.lastIndex=r6(n,i6(i.lastIndex),a))}for(var f="",d=0,S=0;S<u.length;S++){c=u[S];for(var w=$C(c[0]),M=l6(c6(e6(c.index),n.length),0),K=[],O,N=1;N<c.length;N++)Ms(K,p6(c[N]));var v=c.groups;if(o){var Y=h6([w],K,M,n);v!==void 0&&Ms(Y,v),O=$C($K(e,void 0,Y))}else O=s6(w,n,M,K,v,e);M>=d&&(f+=sd(n,d,M)+O,d=M+w.length)}return f+sd(n,d)}]},!d6||!f6||ad)});var Ps=p((_Z,ud)=>{"use strict";ud.exports=`
4
- \v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`});var hd=p((EZ,cd)=>{"use strict";var m6=F(),y6=fC(),S6=eI(),Es=Ps(),ld=m6("".replace),D6=RegExp("^["+Es+"]+"),w6=RegExp("(^|[^"+Es+"])["+Es+"]+$"),_s=function(t){return function(g){var I=S6(y6(g));return t&1&&(I=ld(I,D6,"")),t&2&&(I=ld(I,w6,"$1")),I}};cd.exports={start:_s(1),end:_s(2),trim:_s(3)}});var md=p((bZ,dd)=>{"use strict";var B6=Lt().PROPER,M6=H(),pd=Ps(),fd="\u200B\x85\u180E";dd.exports=function(t){return M6(function(){return!!pd[t]()||fd[t]()!==fd||B6&&pd[t].name!==t})}});var rn=p(()=>{"use strict";var v6=V(),P6=hd().trim,_6=md();v6({target:"String",proto:!0,forced:_6("trim")},{trim:function(){return P6(this)}})});var Gs=p((QZ,Sd)=>{"use strict";var yd=LC(),K6=TypeError;Sd.exports=function(t,g){if(!delete t[g])throw new K6("Cannot delete property "+yd(g)+" of "+yd(t))}});var sn=p((qZ,wd)=>{"use strict";var Dd=Ae(),G6=Math.floor,Ts=function(t,g){var I=t.length;if(I<8)for(var A=1,C,e;A<I;){for(e=A,C=t[A];e&&g(t[e-1],C)>0;)t[e]=t[--e];e!==A++&&(t[e]=C)}else for(var i=G6(I/2),n=Ts(Dd(t,0,i),g),r=Ts(Dd(t,i),g),o=n.length,s=r.length,a=0,u=0;a<o||u<s;)t[a+u]=a<o&&u<s?g(n[a],r[u])<=0?n[a++]:r[u++]:a<o?n[a++]:r[u++];return t};wd.exports=Ts});var Md=p(($Z,Bd)=>{"use strict";var T6=H();Bd.exports=function(t,g){var I=[][t];return!!I&&T6(function(){I.call(null,g||function(){return 1},1)})}});var Os=p((gk,Pd)=>{"use strict";var O6=HC(),vd=O6.match(/firefox\/(\d+)/i);Pd.exports=!!vd&&+vd[1]});var Ys=p((Ik,_d)=>{"use strict";var Y6=HC();_d.exports=/MSIE|Trident/.test(Y6)});var js=p((Ak,bd)=>{"use strict";var j6=HC(),Ed=j6.match(/AppleWebKit\/(\d+)\./);bd.exports=!!Ed&&+Ed[1]});var PC=p(()=>{"use strict";var R6=V(),jd=F(),N6=JI(),W6=Zg(),xd=bg(),F6=Gs(),Kd=eI(),Rs=H(),Z6=sn(),k6=Md(),Gd=Os(),H6=Ys(),Td=Zt(),Od=js(),JA=[],Yd=jd(JA.sort),L6=jd(JA.push),U6=Rs(function(){JA.sort(void 0)}),X6=Rs(function(){JA.sort(null)}),V6=k6("sort"),Rd=!Rs(function(){if(Td)return Td<70;if(!(Gd&&Gd>3)){if(H6)return!0;if(Od)return Od<603;var t="",g,I,A,C;for(g=65;g<76;g++){switch(I=String.fromCharCode(g),g){case 66:case 69:case 70:case 72:A=3;break;case 68:case 71:A=4;break;default:A=2}for(C=0;C<47;C++)JA.push({k:I+C,v:A})}for(JA.sort(function(e,i){return i.v-e.v}),C=0;C<JA.length;C++)I=JA[C].k.charAt(0),t.charAt(t.length-1)!==I&&(t+=I);return t!=="DGBEFHACIJK"}}),z6=U6||!X6||!V6||!Rd,J6=function(t){return function(g,I){return I===void 0?-1:g===void 0?1:t!==void 0?+t(g,I)||0:Kd(g)>Kd(I)?1:-1}};R6({target:"Array",proto:!0,forced:z6},{sort:function(g){g!==void 0&&N6(g);var I=W6(this);if(Rd)return g===void 0?Yd(I):Yd(I,g);var A=[],C=xd(I),e,i;for(i=0;i<C;i++)i in I&&L6(A,I[i]);for(Z6(A,J6(g)),e=xd(A),i=0;i<e;)I[i]=A[i++];for(;i<C;)F6(I,i++);return I}})});var Wd=p((rk,Nd)=>{Nd.exports=function(g,I){return g[0]=I[0],g[1]=I[1],g}});var kd=p((ok,Zd)=>{var Fd=Wd();Zd.exports=function(t,g){Array.isArray(g)||(g=[]),t.length>0&&g.push(Fd([0,0],t[0]));for(var I=0;I<t.length-1;I++){var A=t[I],C=t[I+1],e=A[0],i=A[1],n=C[0],r=C[1],o=[.75*e+.25*n,.75*i+.25*r],s=[.25*e+.75*n,.25*i+.75*r];g.push(o),g.push(s)}return t.length>1&&g.push(Fd([0,0],t[t.length-1])),g}});var Vd=p((ck,Xd)=>{var Zs=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((g,I)=>g.priority-I.priority)}set(g,I){let A=Number(I);if(isNaN(A))throw new TypeError('"priority" must be a number');return this.keys.has(g)?this.queue.map(C=>(C.key===g&&Object.assign(C,{priority:A}),C)):(this.keys.add(g),this.queue.push({key:g,priority:A})),this.sort(),this.queue.length}next(){let g=this.queue.shift();return this.keys.delete(g.key),g}isEmpty(){return this.queue.length===0}has(g){return this.keys.has(g)}get(g){return this.queue.find(I=>I.key===g)}};Xd.exports=Zs});var Qd=p((hk,Jd)=>{function zd(t,g){let I=new Map;for(let[A,C]of t)A!==g&&C instanceof Map?I.set(A,zd(C,g)):A!==g&&I.set(A,C);return I}Jd.exports=zd});var gm=p((pk,$d)=>{function IG(t){let g=Number(t);return!(isNaN(g)||g<=0)}function qd(t){let g=new Map;return Object.keys(t).forEach(A=>{let C=t[A];if(C!==null&&typeof C=="object"&&!Array.isArray(C))return g.set(A,qd(C));if(!IG(C))throw new Error(`Could not add node at key "${A}", make sure it's a valid node`,C);return g.set(A,Number(C))}),g}$d.exports=qd});var Cm=p((fk,Am)=>{function Im(t){if(!(t instanceof Map))throw new Error(`Invalid graph: Expected Map instead found ${typeof t}`);t.forEach((g,I)=>{if(typeof g=="object"&&g instanceof Map){Im(g);return}if(typeof g!="number"||g<=0)throw new Error(`Values must be numbers greater than 0. Found value ${g} at ${I}`)})}Am.exports=Im});var Hs=p((dk,im)=>{var AG=Vd(),CG=Qd(),tm=gm(),em=Cm(),ks=class{constructor(g){g instanceof Map?(em(g),this.graph=g):g?this.graph=tm(g):this.graph=new Map}addNode(g,I){let A;return I instanceof Map?(em(I),A=I):A=tm(I),this.graph.set(g,A),this}addVertex(g,I){return this.addNode(g,I)}removeNode(g){return this.graph=CG(this.graph,g),this}path(g,I,A={}){if(!this.graph.size)return A.cost?{path:null,cost:0}:null;let C=new Set,e=new AG,i=new Map,n=[],r=0,o=[];if(A.avoid&&(o=[].concat(A.avoid)),o.includes(g))throw new Error(`Starting node (${g}) cannot be avoided`);if(o.includes(I))throw new Error(`Ending node (${I}) cannot be avoided`);for(e.set(g,0);!e.isEmpty();){let s=e.next();if(s.key===I){r=s.priority;let u=s.key;for(;i.has(u);)n.push(u),u=i.get(u);break}C.add(s.key),(this.graph.get(s.key)||new Map).forEach((u,c)=>{if(C.has(c)||o.includes(c))return null;if(!e.has(c))return i.set(c,s.key),e.set(c,s.priority+u);let h=e.get(c).priority,f=s.priority+u;return f<h?(i.set(c,s.key),e.set(c,f)):null})}return n.length?(A.trim?n.shift():n=n.concat([g]),A.reverse||(n=n.reverse()),A.cost?{path:n,cost:r}:n):A.cost?{path:null,cost:0}:null}shortestPath(...g){return this.path(...g)}};im.exports=ks});var ln=p((Mk,nm)=>{"use strict";var tG=sA(),eG=F();nm.exports=function(t){if(tG(t)==="Function")return eG(t)}});var QA=p((vk,om)=>{"use strict";var rm=ln(),iG=JI(),nG=Nt(),rG=rm(rm.bind);om.exports=function(t,g){return iG(t),g===void 0?t:nG?rG(t,g):function(){return t.apply(g,arguments)}}});var um=p((Pk,am)=>{"use strict";var oG=zt(),sG=bg(),aG=Ni(),uG=QA(),sm=function(t,g,I,A,C,e,i,n){for(var r=C,o=0,s=i?uG(i,n):!1,a,u;o<A;)o in I&&(a=s?s(I[o],o,g):I[o],e>0&&oG(a)?(u=sG(a),r=sm(t,g,a,u,r,e-1)-1):(aG(r+1),t[r]=a),r++),o++;return r};am.exports=sm});var cn=p((_k,fm)=>{"use strict";var lG=F(),cG=H(),lm=ig(),hG=uA(),pG=xI(),fG=wo(),cm=function(){},hm=pG("Reflect","construct"),Us=/^\s*(?:class|function)\b/,dG=lG(Us.exec),mG=!Us.test(cm),ae=function(g){if(!lm(g))return!1;try{return hm(cm,[],g),!0}catch(I){return!1}},pm=function(g){if(!lm(g))return!1;switch(hG(g)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return mG||!!dG(Us,fG(g))}catch(I){return!0}};pm.sham=!0;fm.exports=!hm||cG(function(){var t;return ae(ae.call)||!ae(Object)||!ae(function(){t=!0})||t})?pm:ae});var Sm=p((Ek,ym)=>{"use strict";var dm=zt(),yG=cn(),SG=Mg(),DG=dg(),wG=DG("species"),mm=Array;ym.exports=function(t){var g;return dm(t)&&(g=t.constructor,yG(g)&&(g===mm||dm(g.prototype))?g=void 0:SG(g)&&(g=g[wG],g===null&&(g=void 0))),g===void 0?mm:g}});var Xs=p((bk,Dm)=>{"use strict";var BG=Sm();Dm.exports=function(t,g){return new(BG(t))(g===0?0:g)}});var hn=p(()=>{"use strict";var MG=V(),vG=um(),PG=Zg(),_G=bg(),EG=tI(),bG=Xs();MG({target:"Array",proto:!0},{flat:function(){var g=arguments.length?arguments[0]:void 0,I=PG(this),A=_G(I),C=bG(I,0);return C.length=vG(C,I,I,A,0,g===void 0?1:EG(g)),C}})});var pn=p(()=>{"use strict";var xG=Jt();xG("flat")});var Gm=p((jH,Km)=>{"use strict";var OG=dg(),bm=OG("iterator"),xm=!1;try{Em=0,Js={next:function(){return{done:!!Em++}},return:function(){xm=!0}},Js[bm]=function(){return this},Array.from(Js,function(){throw 2})}catch(t){}var Em,Js;Km.exports=function(t,g){try{if(!g&&!xm)return!1}catch(C){return!1}var I=!1;try{var A={};A[bm]=function(){return{next:function(){return{done:I=!0}}}},t(A)}catch(C){}return I}});var dn=p((RH,Tm)=>{"use strict";Tm.exports=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"});var pA=p((NH,Ym)=>{"use strict";var Om=Eo(),YG=pI();Ym.exports=function(t,g,I){return I.get&&Om(I.get,g,{getter:!0}),I.set&&Om(I.set,g,{setter:!0}),YG.f(t,g,I)}});var qg=p((WH,Um)=>{"use strict";var jG=dn(),ga=eg(),Lg=Z(),Wm=ig(),Sn=Mg(),gC=kg(),Ia=uA(),RG=LC(),NG=fI(),Qs=dI(),WG=pA(),FG=kC(),Dn=Qt(),At=SC(),ZG=dg(),kG=Mi(),Fm=QI(),Zm=Fm.enforce,HG=Fm.get,mn=Lg.Int8Array,qs=mn&&mn.prototype,jm=Lg.Uint8ClampedArray,Rm=jm&&jm.prototype,CA=mn&&Dn(mn),kI=qs&&Dn(qs),LG=Object.prototype,Aa=Lg.TypeError,Nm=ZG("toStringTag"),$s=kG("TYPED_ARRAY_TAG"),yn="TypedArrayConstructor",fA=jG&&!!At&&Ia(Lg.opera)!=="Opera",km=!1,Qg,$A,It,dA={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Ca={BigInt64Array:8,BigUint64Array:8},UG=function(g){if(!Sn(g))return!1;var I=Ia(g);return I==="DataView"||gC(dA,I)||gC(Ca,I)},Hm=function(t){var g=Dn(t);if(Sn(g)){var I=HG(g);return I&&gC(I,yn)?I[yn]:Hm(g)}},Lm=function(t){if(!Sn(t))return!1;var g=Ia(t);return gC(dA,g)||gC(Ca,g)},XG=function(t){if(Lm(t))return t;throw new Aa("Target is not a typed array")},VG=function(t){if(Wm(t)&&(!At||FG(CA,t)))return t;throw new Aa(RG(t)+" is not a typed array constructor")},zG=function(t,g,I,A){if(ga){if(I)for(var C in dA){var e=Lg[C];if(e&&gC(e.prototype,t))try{delete e.prototype[t]}catch(i){try{e.prototype[t]=g}catch(n){}}}(!kI[t]||I)&&Qs(kI,t,I?g:fA&&qs[t]||g,A)}},JG=function(t,g,I){var A,C;if(ga){if(At){if(I){for(A in dA)if(C=Lg[A],C&&gC(C,t))try{delete C[t]}catch(e){}}if(!CA[t]||I)try{return Qs(CA,t,I?g:fA&&CA[t]||g)}catch(e){}else return}for(A in dA)C=Lg[A],C&&(!C[t]||I)&&Qs(C,t,g)}};for(Qg in dA)$A=Lg[Qg],It=$A&&$A.prototype,It?Zm(It)[yn]=$A:fA=!1;for(Qg in Ca)$A=Lg[Qg],It=$A&&$A.prototype,It&&(Zm(It)[yn]=$A);if((!fA||!Wm(CA)||CA===Function.prototype)&&(CA=function(){throw new Aa("Incorrect invocation")},fA))for(Qg in dA)Lg[Qg]&&At(Lg[Qg],CA);if((!fA||!kI||kI===LG)&&(kI=CA.prototype,fA))for(Qg in dA)Lg[Qg]&&At(Lg[Qg].prototype,kI);fA&&Dn(Rm)!==kI&&At(Rm,kI);if(ga&&!gC(kI,Nm)){km=!0,WG(kI,Nm,{configurable:!0,get:function(){return Sn(this)?this[$s]:void 0}});for(Qg in dA)Lg[Qg]&&NG(Lg[Qg],$s,Qg)}Um.exports={NATIVE_ARRAY_BUFFER_VIEWS:fA,TYPED_ARRAY_TAG:km&&$s,aTypedArray:XG,aTypedArrayConstructor:VG,exportTypedArrayMethod:zG,exportTypedArrayStaticMethod:JG,getTypedArrayConstructor:Hm,isView:UG,isTypedArray:Lm,TypedArray:CA,TypedArrayPrototype:kI}});var ea=p((FH,Vm)=>{"use strict";var Xm=Z(),ta=H(),QG=Gm(),qG=qg().NATIVE_ARRAY_BUFFER_VIEWS,$G=Xm.ArrayBuffer,KC=Xm.Int8Array;Vm.exports=!qG||!ta(function(){KC(1)})||!ta(function(){new KC(-1)})||!QG(function(t){new KC,new KC(null),new KC(1.5),new KC(t)},!0)||ta(function(){return new KC(new $G(2),1,void 0).length!==1})});var ia=p((ZH,zm)=>{"use strict";var g3=dI();zm.exports=function(t,g,I){for(var A in g)g3(t,A,g[A],I);return t}});var pe=p((kH,Jm)=>{"use strict";var I3=kC(),A3=TypeError;Jm.exports=function(t,g){if(I3(g,t))return t;throw new A3("Incorrect invocation")}});var wn=p((HH,Qm)=>{"use strict";var C3=tI(),t3=mC(),e3=RangeError;Qm.exports=function(t){if(t===void 0)return 0;var g=C3(t),I=t3(g);if(g!==I)throw new e3("Wrong length or index");return I}});var $m=p((LH,qm)=>{"use strict";qm.exports=Math.sign||function(g){var I=+g;return I===0||I!==I?I:I<0?-1:1}});var Ay=p((UH,Iy)=>{"use strict";var i3=2220446049250313e-31,gy=1/i3;Iy.exports=function(t){return t+gy-gy}});var ty=p((XH,Cy)=>{"use strict";var n3=$m(),r3=Ay(),o3=Math.abs,s3=2220446049250313e-31;Cy.exports=function(t,g,I,A){var C=+t,e=o3(C),i=n3(C);if(e<A)return i*r3(e/A/g)*A*g;var n=(1+g/s3)*e,r=n-(n-e);return r>I||r!==r?i*(1/0):i*r}});var iy=p((VH,ey)=>{"use strict";var a3=ty(),u3=11920928955078125e-23,l3=34028234663852886e22,c3=11754943508222875e-54;ey.exports=Math.fround||function(g){return a3(g,u3,l3,c3)}});var ry=p((zH,ny)=>{"use strict";var h3=Array,p3=Math.abs,mA=Math.pow,f3=Math.floor,d3=Math.log,m3=Math.LN2,y3=function(t,g,I){var A=h3(I),C=I*8-g-1,e=(1<<C)-1,i=e>>1,n=g===23?mA(2,-24)-mA(2,-77):0,r=t<0||t===0&&1/t<0?1:0,o=0,s,a,u;for(t=p3(t),t!==t||t===1/0?(a=t!==t?1:0,s=e):(s=f3(d3(t)/m3),u=mA(2,-s),t*u<1&&(s--,u*=2),s+i>=1?t+=n/u:t+=n*mA(2,1-i),t*u>=2&&(s++,u/=2),s+i>=e?(a=0,s=e):s+i>=1?(a=(t*u-1)*mA(2,g),s+=i):(a=t*mA(2,i-1)*mA(2,g),s=0));g>=8;)A[o++]=a&255,a/=256,g-=8;for(s=s<<g|a,C+=g;C>0;)A[o++]=s&255,s/=256,C-=8;return A[o-1]|=r*128,A},S3=function(t,g){var I=t.length,A=I*8-g-1,C=(1<<A)-1,e=C>>1,i=A-7,n=I-1,r=t[n--],o=r&127,s;for(r>>=7;i>0;)o=o*256+t[n--],i-=8;for(s=o&(1<<-i)-1,o>>=-i,i+=g;i>0;)s=s*256+t[n--],i-=8;if(o===0)o=1-e;else{if(o===C)return s?NaN:r?-1/0:1/0;s+=mA(2,g),o-=e}return(r?-1:1)*s*mA(2,o-g)};ny.exports={pack:y3,unpack:S3}});var na=p((JH,sy)=>{"use strict";var D3=Zg(),oy=Xt(),w3=bg();sy.exports=function(g){for(var I=D3(this),A=w3(I),C=arguments.length,e=oy(C>1?arguments[1]:void 0,A),i=C>2?arguments[2]:void 0,n=i===void 0?A:oy(i,A);n>e;)I[e++]=g;return I}});var bn=p((QH,Py)=>{"use strict";var _n=Z(),ua=F(),ra=eg(),B3=dn(),Dy=Lt(),M3=fI(),v3=pA(),ay=ia(),oa=H(),Bn=pe(),P3=tI(),_3=mC(),vn=wn(),E3=iy(),wy=ry(),b3=Qt(),uy=SC(),x3=na(),K3=Ae(),G3=An(),T3=ji(),By=ZA(),la=QI(),O3=Dy.PROPER,ly=Dy.CONFIGURABLE,tt="ArrayBuffer",En="DataView",et="prototype",Y3="Wrong length",My="Wrong index",cy=la.getterFor(tt),de=la.getterFor(En),hy=la.set,HI=_n[tt],oI=HI,Ct=oI&&oI[et],tA=_n[En],GC=tA&&tA[et],py=Object.prototype,j3=_n.Array,Pn=_n.RangeError,R3=ua(x3),N3=ua([].reverse),vy=wy.pack,fy=wy.unpack,dy=function(t){return[t&255]},my=function(t){return[t&255,t>>8&255]},yy=function(t){return[t&255,t>>8&255,t>>16&255,t>>24&255]},Sy=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},W3=function(t){return vy(E3(t),23,4)},F3=function(t){return vy(t,52,8)},Mn=function(t,g,I){v3(t[et],g,{configurable:!0,get:function(){return I(this)[g]}})},IC=function(t,g,I,A){var C=de(t),e=vn(I),i=!!A;if(e+g>C.byteLength)throw new Pn(My);var n=C.bytes,r=e+C.byteOffset,o=K3(n,r,r+g);return i?o:N3(o)},AC=function(t,g,I,A,C,e){var i=de(t),n=vn(I),r=A(+C),o=!!e;if(n+g>i.byteLength)throw new Pn(My);for(var s=i.bytes,a=n+i.byteOffset,u=0;u<g;u++)s[a+u]=r[o?u:g-u-1]};B3?(sa=O3&&HI.name!==tt,!oa(function(){HI(1)})||!oa(function(){new HI(-1)})||oa(function(){return new HI,new HI(1.5),new HI(NaN),HI.length!==1||sa&&!ly})?(oI=function(g){return Bn(this,Ct),G3(new HI(vn(g)),this,oI)},oI[et]=Ct,Ct.constructor=oI,T3(oI,HI)):sa&&ly&&M3(HI,"name",tt),uy&&b3(GC)!==py&&uy(GC,py),fe=new tA(new oI(2)),aa=ua(GC.setInt8),fe.setInt8(0,2147483648),fe.setInt8(1,2147483649),(fe.getInt8(0)||!fe.getInt8(1))&&ay(GC,{setInt8:function(g,I){aa(this,g,I<<24>>24)},setUint8:function(g,I){aa(this,g,I<<24>>24)}},{unsafe:!0})):(oI=function(g){Bn(this,Ct);var I=vn(g);hy(this,{type:tt,bytes:R3(j3(I),0),byteLength:I}),ra||(this.byteLength=I,this.detached=!1)},Ct=oI[et],tA=function(g,I,A){Bn(this,GC),Bn(g,Ct);var C=cy(g),e=C.byteLength,i=P3(I);if(i<0||i>e)throw new Pn("Wrong offset");if(A=A===void 0?e-i:_3(A),i+A>e)throw new Pn(Y3);hy(this,{type:En,buffer:g,byteLength:A,byteOffset:i,bytes:C.bytes}),ra||(this.buffer=g,this.byteLength=A,this.byteOffset=i)},GC=tA[et],ra&&(Mn(oI,"byteLength",cy),Mn(tA,"buffer",de),Mn(tA,"byteLength",de),Mn(tA,"byteOffset",de)),ay(GC,{getInt8:function(g){return IC(this,1,g)[0]<<24>>24},getUint8:function(g){return IC(this,1,g)[0]},getInt16:function(g){var I=IC(this,2,g,arguments.length>1?arguments[1]:!1);return(I[1]<<8|I[0])<<16>>16},getUint16:function(g){var I=IC(this,2,g,arguments.length>1?arguments[1]:!1);return I[1]<<8|I[0]},getInt32:function(g){return Sy(IC(this,4,g,arguments.length>1?arguments[1]:!1))},getUint32:function(g){return Sy(IC(this,4,g,arguments.length>1?arguments[1]:!1))>>>0},getFloat32:function(g){return fy(IC(this,4,g,arguments.length>1?arguments[1]:!1),23)},getFloat64:function(g){return fy(IC(this,8,g,arguments.length>1?arguments[1]:!1),52)},setInt8:function(g,I){AC(this,1,g,dy,I)},setUint8:function(g,I){AC(this,1,g,dy,I)},setInt16:function(g,I){AC(this,2,g,my,I,arguments.length>2?arguments[2]:!1)},setUint16:function(g,I){AC(this,2,g,my,I,arguments.length>2?arguments[2]:!1)},setInt32:function(g,I){AC(this,4,g,yy,I,arguments.length>2?arguments[2]:!1)},setUint32:function(g,I){AC(this,4,g,yy,I,arguments.length>2?arguments[2]:!1)},setFloat32:function(g,I){AC(this,4,g,W3,I,arguments.length>2?arguments[2]:!1)},setFloat64:function(g,I){AC(this,8,g,F3,I,arguments.length>2?arguments[2]:!1)}}));var sa,fe,aa;By(oI,tt);By(tA,En);Py.exports={ArrayBuffer:oI,DataView:tA}});var Ey=p((qH,_y)=>{"use strict";var Z3=Mg(),k3=Math.floor;_y.exports=Number.isInteger||function(g){return!Z3(g)&&isFinite(g)&&k3(g)===g}});var xy=p(($H,by)=>{"use strict";var H3=tI(),L3=RangeError;by.exports=function(t){var g=H3(t);if(g<0)throw new L3("The argument can't be less than 0");return g}});var ca=p((g9,Ky)=>{"use strict";var U3=xy(),X3=RangeError;Ky.exports=function(t,g){var I=U3(t);if(I%g)throw new X3("Wrong offset");return I}});var Ty=p((I9,Gy)=>{"use strict";var V3=Math.round;Gy.exports=function(t){var g=V3(t);return g<0?0:g>255?255:g&255}});var ha=p((A9,Oy)=>{"use strict";var z3=cn(),J3=LC(),Q3=TypeError;Oy.exports=function(t){if(z3(t))return t;throw new Q3(J3(t)+" is not a constructor")}});var me=p((C9,jy)=>{"use strict";var q3=uA(),Yy=Ht(),$3=Ft(),gT=XC(),IT=dg(),AT=IT("iterator");jy.exports=function(t){if(!$3(t))return Yy(t,AT)||Yy(t,"@@iterator")||gT[q3(t)]}});var xn=p((t9,Ry)=>{"use strict";var CT=og(),tT=JI(),eT=Ng(),iT=LC(),nT=me(),rT=TypeError;Ry.exports=function(t,g){var I=arguments.length<2?nT(t):g;if(tT(I))return eT(CT(I,t));throw new rT(iT(t)+" is not iterable")}});var pa=p((e9,Ny)=>{"use strict";var oT=dg(),sT=XC(),aT=oT("iterator"),uT=Array.prototype;Ny.exports=function(t){return t!==void 0&&(sT.Array===t||uT[aT]===t)}});var fa=p((i9,Wy)=>{"use strict";var lT=uA();Wy.exports=function(t){var g=lT(t);return g==="BigInt64Array"||g==="BigUint64Array"}});var Kn=p((n9,Fy)=>{"use strict";var cT=ao(),hT=TypeError;Fy.exports=function(t){var g=cT(t,"number");if(typeof g=="number")throw new hT("Can't convert number to bigint");return BigInt(g)}});var da=p((r9,Zy)=>{"use strict";var pT=QA(),fT=og(),dT=ha(),mT=Zg(),yT=bg(),ST=xn(),DT=me(),wT=pa(),BT=fa(),MT=qg().aTypedArrayConstructor,vT=Kn();Zy.exports=function(g){var I=dT(this),A=mT(g),C=arguments.length,e=C>1?arguments[1]:void 0,i=e!==void 0,n=DT(A),r,o,s,a,u,c,h,f;if(n&&!wT(n))for(h=ST(A,n),f=h.next,A=[];!(c=fT(f,h)).done;)A.push(c.value);for(i&&C>2&&(e=pT(e,arguments[2])),o=yT(A),s=new(MT(I))(o),a=BT(s),r=0;o>r;r++)u=i?e(A[r],r):A[r],s[r]=a?vT(u):+u;return s}});var Ly=p((o9,Hy)=>{"use strict";var PT=QA(),_T=F(),ET=Wt(),bT=Zg(),xT=bg(),KT=Xs(),ky=_T([].push),CC=function(t){var g=t===1,I=t===2,A=t===3,C=t===4,e=t===6,i=t===7,n=t===5||e;return function(r,o,s,a){for(var u=bT(r),c=ET(u),h=xT(c),f=PT(o,s),d=0,S=a||KT,w=g?S(r,h):I||i?S(r,0):void 0,M,K;h>d;d++)if((n||d in c)&&(M=c[d],K=f(M,d,u),t))if(g)w[d]=K;else if(K)switch(t){case 3:return!0;case 5:return M;case 6:return d;case 2:ky(w,M)}else switch(t){case 4:return!1;case 7:ky(w,M)}return e?-1:A||C?C:w}};Hy.exports={forEach:CC(0),map:CC(1),filter:CC(2),some:CC(3),every:CC(4),find:CC(5),findIndex:CC(6),filterReject:CC(7)}});var ma=p((s9,Xy)=>{"use strict";var GT=xI(),TT=pA(),OT=dg(),YT=eg(),Uy=OT("species");Xy.exports=function(t){var g=GT(t);YT&&g&&!g[Uy]&&TT(g,Uy,{configurable:!0,get:function(){return this}})}});var ya=p((a9,Vy)=>{"use strict";var jT=bg();Vy.exports=function(t,g,I){for(var A=0,C=arguments.length>2?I:jT(g),e=new t(C);C>A;)e[A]=g[A++];return e}});var tC=p((u9,Pa)=>{"use strict";var zy=V(),iS=Z(),Jy=og(),RT=eg(),NT=ea(),we=qg(),nS=bn(),Qy=pe(),WT=WA(),ye=fI(),FT=Ey(),ZT=mC(),qy=wn(),Sa=ca(),kT=Ty(),rS=vi(),Se=kg(),HT=uA(),Ba=Mg(),LT=kt(),UT=yC(),XT=kC(),Gn=SC(),VT=Ko().f,$y=da(),zT=Ly().forEach,JT=ma(),QT=pA(),oS=pI(),sS=_i(),gS=ya(),_a=QI(),qT=An(),Ma=_a.get,$T=_a.set,g1=_a.enforce,aS=oS.f,I1=sS.f,Da=iS.RangeError,uS=nS.ArrayBuffer,A1=uS.prototype,C1=nS.DataView,Tn=we.NATIVE_ARRAY_BUFFER_VIEWS,IS=we.TYPED_ARRAY_TAG,AS=we.TypedArray,De=we.TypedArrayPrototype,va=we.isTypedArray,On="BYTES_PER_ELEMENT",wa="Wrong length",Yn=function(t,g){QT(t,g,{configurable:!0,get:function(){return Ma(this)[g]}})},CS=function(t){var g;return XT(A1,t)||(g=HT(t))==="ArrayBuffer"||g==="SharedArrayBuffer"},lS=function(t,g){return va(t)&&!LT(g)&&g in t&&FT(+g)&&g>=0},tS=function(g,I){return I=rS(I),lS(g,I)?WT(2,g[I]):I1(g,I)},eS=function(g,I,A){return I=rS(I),lS(g,I)&&Ba(A)&&Se(A,"value")&&!Se(A,"get")&&!Se(A,"set")&&!A.configurable&&(!Se(A,"writable")||A.writable)&&(!Se(A,"enumerable")||A.enumerable)?(g[I]=A.value,g):aS(g,I,A)};RT?(Tn||(sS.f=tS,oS.f=eS,Yn(De,"buffer"),Yn(De,"byteOffset"),Yn(De,"byteLength"),Yn(De,"length")),zy({target:"Object",stat:!0,forced:!Tn},{getOwnPropertyDescriptor:tS,defineProperty:eS}),Pa.exports=function(t,g,I){var A=t.match(/\d+/)[0]/8,C=t+(I?"Clamped":"")+"Array",e="get"+t,i="set"+t,n=iS[C],r=n,o=r&&r.prototype,s={},a=function(f,d){var S=Ma(f);return S.view[e](d*A+S.byteOffset,!0)},u=function(f,d,S){var w=Ma(f);w.view[i](d*A+w.byteOffset,I?kT(S):S,!0)},c=function(f,d){aS(f,d,{get:function(){return a(this,d)},set:function(S){return u(this,d,S)},enumerable:!0})};Tn?NT&&(r=g(function(f,d,S,w){return Qy(f,o),qT(function(){return Ba(d)?CS(d)?w!==void 0?new n(d,Sa(S,A),w):S!==void 0?new n(d,Sa(S,A)):new n(d):va(d)?gS(r,d):Jy($y,r,d):new n(qy(d))}(),f,r)}),Gn&&Gn(r,AS),zT(VT(n),function(f){f in r||ye(r,f,n[f])}),r.prototype=o):(r=g(function(f,d,S,w){Qy(f,o);var M=0,K=0,O,N,v;if(!Ba(d))v=qy(d),N=v*A,O=new uS(N);else if(CS(d)){O=d,K=Sa(S,A);var Y=d.byteLength;if(w===void 0){if(Y%A)throw new Da(wa);if(N=Y-K,N<0)throw new Da(wa)}else if(N=ZT(w)*A,N+K>Y)throw new Da(wa);v=N/A}else return va(d)?gS(r,d):Jy($y,r,d);for($T(f,{buffer:O,byteOffset:K,byteLength:N,length:v,view:new C1(O)});M<v;)c(f,M++)}),Gn&&Gn(r,AS),o=r.prototype=UT(De)),o.constructor!==r&&ye(o,"constructor",r),g1(o).TypedArrayConstructor=r,IS&&ye(o,IS,C);var h=r!==n;s[C]=r,zy({global:!0,constructor:!0,forced:h,sham:!Tn},s),On in r||ye(r,On,A),On in o||ye(o,On,A),JT(C)}):Pa.exports=function(){}});var TC=p(()=>{"use strict";var t1=tC();t1("Float32",function(t){return function(I,A,C){return t(this,I,A,C)}})});var yA=p(()=>{"use strict";var cS=qg(),e1=bg(),i1=tI(),n1=cS.aTypedArray,r1=cS.exportTypedArrayMethod;r1("at",function(g){var I=n1(this),A=e1(I),C=i1(g),e=C>=0?C:A+C;return e<0||e>=A?void 0:I[e]})});var SA=p(()=>{"use strict";var hS=qg(),o1=na(),s1=Kn(),a1=uA(),u1=og(),l1=F(),c1=H(),h1=hS.aTypedArray,p1=hS.exportTypedArrayMethod,f1=l1("".slice),d1=c1(function(){var t=0;return new Int8Array(2).fill({valueOf:function(){return t++}}),t!==1});p1("fill",function(g){var I=arguments.length;h1(this);var A=f1(a1(this),0,3)==="Big"?s1(g):+g;return u1(o1,this,A,I>1?arguments[1]:void 0,I>2?arguments[2]:void 0)},d1)});var Be=p((m9,fS)=>{"use strict";var m1=QA(),y1=Wt(),S1=Zg(),D1=bg(),pS=function(t){var g=t===1;return function(I,A,C){for(var e=S1(I),i=y1(e),n=D1(i),r=m1(A,C),o,s;n-- >0;)if(o=i[n],s=r(o,n,e),s)switch(t){case 0:return o;case 1:return n}return g?-1:void 0}};fS.exports={findLast:pS(0),findLastIndex:pS(1)}});var DA=p(()=>{"use strict";var dS=qg(),w1=Be().findLast,B1=dS.aTypedArray,M1=dS.exportTypedArrayMethod;M1("findLast",function(g){return w1(B1(this),g,arguments.length>1?arguments[1]:void 0)})});var wA=p(()=>{"use strict";var mS=qg(),v1=Be().findLastIndex,P1=mS.aTypedArray,_1=mS.exportTypedArrayMethod;_1("findLastIndex",function(g){return v1(P1(this),g,arguments.length>1?arguments[1]:void 0)})});var BA=p(()=>{"use strict";var SS=Z(),DS=og(),xa=qg(),E1=bg(),b1=ca(),x1=Zg(),wS=H(),K1=SS.RangeError,Ea=SS.Int8Array,yS=Ea&&Ea.prototype,BS=yS&&yS.set,G1=xa.aTypedArray,T1=xa.exportTypedArrayMethod,ba=!wS(function(){var t=new Uint8ClampedArray(2);return DS(BS,t,{length:1,0:3},1),t[1]!==3}),O1=ba&&xa.NATIVE_ARRAY_BUFFER_VIEWS&&wS(function(){var t=new Ea(2);return t.set(1),t.set("2",1),t[0]!==0||t[1]!==2});T1("set",function(g){G1(this);var I=b1(arguments.length>1?arguments[1]:void 0,1),A=x1(g);if(ba)return DS(BS,this,A,I);var C=this.length,e=E1(A),i=0;if(e+I>C)throw new K1("Wrong length");for(;i<e;)this[I+i]=A[i++]},!ba||O1)});var MA=p(()=>{"use strict";var Y1=Z(),j1=ln(),Ka=H(),R1=JI(),N1=sn(),ES=qg(),MS=Os(),W1=Ys(),vS=Zt(),PS=js(),F1=ES.aTypedArray,Z1=ES.exportTypedArrayMethod,Me=Y1.Uint16Array,it=Me&&j1(Me.prototype.sort),k1=!!it&&!(Ka(function(){it(new Me(2),null)})&&Ka(function(){it(new Me(2),{})})),_S=!!it&&!Ka(function(){if(vS)return vS<74;if(MS)return MS<67;if(W1)return!0;if(PS)return PS<602;var t=new Me(516),g=Array(516),I,A;for(I=0;I<516;I++)A=I%4,t[I]=515-I,g[I]=I-2*A+3;for(it(t,function(C,e){return(C/4|0)-(e/4|0)}),I=0;I<516;I++)if(t[I]!==g[I])return!0}),H1=function(t){return function(g,I){return t!==void 0?+t(g,I)||0:I!==I?-1:g!==g?1:g===0&&I===0?1/g>0&&1/I<0?1:-1:g>I}};Z1("sort",function(g){return g!==void 0&&R1(g),_S?it(this,g):N1(F1(this),H1(g))},!_S||k1)});var xS=p((_9,bS)=>{"use strict";var L1=bg();bS.exports=function(t,g){for(var I=L1(t),A=new g(I),C=0;C<I;C++)A[C]=t[I-C-1];return A}});var vA=p(()=>{"use strict";var U1=xS(),Ga=qg(),X1=Ga.aTypedArray,V1=Ga.exportTypedArrayMethod,z1=Ga.getTypedArrayConstructor;V1("toReversed",function(){return U1(X1(this),z1(this))})});var PA=p(()=>{"use strict";var jn=qg(),J1=F(),Q1=JI(),q1=ya(),$1=jn.aTypedArray,gO=jn.getTypedArrayConstructor,IO=jn.exportTypedArrayMethod,AO=J1(jn.TypedArrayPrototype.sort);IO("toSorted",function(g){g!==void 0&&Q1(g);var I=$1(this),A=q1(gO(I),I);return AO(A,g)})});var GS=p((G9,KS)=>{"use strict";var CO=bg(),tO=tI(),eO=RangeError;KS.exports=function(t,g,I,A){var C=CO(t),e=tO(I),i=e<0?C+e:e;if(i>=C||i<0)throw new eO("Incorrect index");for(var n=new g(C),r=0;r<C;r++)n[r]=r===i?A:t[r];return n}});var _A=p(()=>{"use strict";var iO=GS(),Ta=qg(),nO=fa(),rO=tI(),oO=Kn(),sO=Ta.aTypedArray,aO=Ta.getTypedArrayConstructor,uO=Ta.exportTypedArrayMethod,lO=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(t){return t===8}}();uO("with",function(t,g){var I=sO(this),A=rO(t),C=nO(I)?oO(g):+g;return iO(I,aO(I),A,C)},!lO)});var EA=p(()=>{"use strict";var cO=V(),hO=Z(),pO=bn(),fO=ma(),Oa="ArrayBuffer",TS=pO[Oa],dO=hO[Oa];cO({global:!0,constructor:!0,forced:dO!==TS},{ArrayBuffer:TS});fO(Oa)});var bA=p(()=>{"use strict";var mO=V(),ja=ln(),yO=H(),RS=bn(),OS=Ng(),YS=Xt(),SO=mC(),Ra=RS.ArrayBuffer,Ya=RS.DataView,NS=Ya.prototype,jS=ja(Ra.prototype.slice),DO=ja(NS.getUint8),wO=ja(NS.setUint8),BO=yO(function(){return!new Ra(2).slice(1,void 0).byteLength});mO({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:BO},{slice:function(g,I){if(jS&&I===void 0)return jS(OS(this),g);for(var A=OS(this).byteLength,C=YS(g,A),e=YS(I===void 0?A:I,A),i=new Ra(SO(e-C)),n=new Ya(this),r=new Ya(i),o=0;C<e;)wO(r,o++,DO(n,C++));return i}})});var Na=p((W9,ZS)=>{"use strict";var FS=Z(),MO=qt(),vO=sA(),WS=FS.ArrayBuffer,PO=FS.TypeError;ZS.exports=WS&&MO(WS.prototype,"byteLength","get")||function(t){if(vO(t)!=="ArrayBuffer")throw new PO("ArrayBuffer expected");return t.byteLength}});var Wa=p((F9,kS)=>{"use strict";var _O=Z(),EO=dn(),bO=Na(),xO=_O.DataView;kS.exports=function(t){if(!EO||bO(t)!==0)return!1;try{return new xO(t),!1}catch(g){return!0}}});var xA=p(()=>{"use strict";var KO=eg(),GO=pA(),TO=Wa(),HS=ArrayBuffer.prototype;KO&&!("detached"in HS)&&GO(HS,"detached",{configurable:!0,get:function(){return TO(this)}})});var US=p((H9,LS)=>{"use strict";var OO=Wa(),YO=TypeError;LS.exports=function(t){if(OO(t))throw new YO("ArrayBuffer is detached");return t}});var Fa=p((L9,XS)=>{"use strict";var ve=Z(),jO=HC(),RO=sA(),Rn=function(t){return jO.slice(0,t.length)===t};XS.exports=function(){return Rn("Bun/")?"BUN":Rn("Cloudflare-Workers")?"CLOUDFLARE":Rn("Deno/")?"DENO":Rn("Node.js/")?"NODE":ve.Bun&&typeof Bun.version=="string"?"BUN":ve.Deno&&typeof Deno.version=="object"?"DENO":RO(ve.process)==="process"?"NODE":ve.window&&ve.document?"BROWSER":"REST"}()});var zS=p((U9,VS)=>{"use strict";var NO=Fa();VS.exports=NO==="NODE"});var QS=p((X9,JS)=>{"use strict";var WO=Z(),FO=zS();JS.exports=function(t){if(FO){try{return WO.process.getBuiltinModule(t)}catch(g){}try{return Function('return require("'+t+'")')()}catch(g){}}}});var Ha=p((V9,$S)=>{"use strict";var ZO=Z(),kO=H(),Za=Zt(),ka=Fa(),qS=ZO.structuredClone;$S.exports=!!qS&&!kO(function(){if(ka==="DENO"&&Za>92||ka==="NODE"&&Za>94||ka==="BROWSER"&&Za>97)return!1;var t=new ArrayBuffer(8),g=qS(t,{transfer:[t]});return t.byteLength!==0||g.byteLength!==8})});var CD=p((z9,AD)=>{"use strict";var Va=Z(),HO=QS(),LO=Ha(),UO=Va.structuredClone,gD=Va.ArrayBuffer,Nn=Va.MessageChannel,Xa=!1,La,ID,Wn,Ua;if(LO)Xa=function(t){UO(t,{transfer:[t]})};else if(gD)try{Nn||(La=HO("worker_threads"),La&&(Nn=La.MessageChannel)),Nn&&(ID=new Nn,Wn=new gD(2),Ua=function(t){ID.port1.postMessage(null,[t])},Wn.byteLength===2&&(Ua(Wn),Wn.byteLength===0&&(Xa=Ua)))}catch(t){}AD.exports=Xa});var gu=p((J9,sD)=>{"use strict";var Qa=Z(),qa=F(),nD=qt(),XO=wn(),VO=US(),zO=Na(),tD=CD(),za=Ha(),JO=Qa.structuredClone,rD=Qa.ArrayBuffer,Ja=Qa.DataView,QO=Math.min,$a=rD.prototype,oD=Ja.prototype,qO=qa($a.slice),eD=nD($a,"resizable","get"),iD=nD($a,"maxByteLength","get"),$O=qa(oD.getInt8),gY=qa(oD.setInt8);sD.exports=(za||tD)&&function(t,g,I){var A=zO(t),C=g===void 0?A:XO(g),e=!eD||!eD(t),i;if(VO(t),za&&(t=JO(t,{transfer:[t]}),A===C&&(I||e)))return t;if(A>=C&&(!I||e))i=qO(t,0,C);else{var n=I&&!e&&iD?{maxByteLength:iD(t)}:void 0;i=new rD(C,n);for(var r=new Ja(t),o=new Ja(i),s=QO(C,A),a=0;a<s;a++)gY(o,a,$O(r,a))}return za||tD(t),i}});var KA=p(()=>{"use strict";var IY=V(),aD=gu();aD&&IY({target:"ArrayBuffer",proto:!0},{transfer:function(){return aD(this,arguments.length?arguments[0]:void 0,!0)}})});var GA=p(()=>{"use strict";var AY=V(),uD=gu();uD&&AY({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return uD(this,arguments.length?arguments[0]:void 0,!1)}})});var Zn=p(()=>{"use strict";var tY=tC();tY("Uint8",function(t){return function(I,A,C){return t(this,I,A,C)}})});var Iu=p(()=>{"use strict";var eY=ea(),iY=qg().exportTypedArrayStaticMethod,nY=da();iY("from",nY,eY)});var SD=p(()=>{"use strict";var rY=en().charAt,oY=eI(),mD=QI(),sY=zo(),dD=Hi(),yD="String Iterator",aY=mD.set,uY=mD.getterFor(yD);sY(String,"String",function(t){aY(this,{type:yD,string:oY(t),index:0})},function(){var g=uY(this),I=g.string,A=g.index,C;return A>=I.length?dD(void 0,!0):(C=rY(I,A),g.index+=C.length,dD(C,!1))})});var tu=p((uU,wD)=>{"use strict";var lY=H(),cY=dg(),hY=eg(),DD=FA(),pY=cY("iterator");wD.exports=!lY(function(){var t=new URL("b?a=1&b=2&c=3","https://a"),g=t.searchParams,I=new URLSearchParams("a=1&a=2&b=3"),A="";return t.pathname="c%20d",g.forEach(function(C,e){g.delete("b"),A+=e+C}),I.delete("a",2),I.delete("b",void 0),DD&&(!t.toJSON||!I.has("a",1)||I.has("a",2)||!I.has("a",void 0)||I.has("b"))||!g.size&&(DD||!hY)||!g.sort||t.href!=="https://a/c%20d?a=1&c=3"||g.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!g[pY]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("https://\u0442\u0435\u0441\u0442").host!=="xn--e1aybc"||new URL("https://a#\u0431").hash!=="#%D0%B1"||A!=="a1c3"||new URL("https://x",void 0).host!=="x"})});var PD=p((lU,vD)=>{"use strict";var BD=eg(),fY=F(),dY=og(),mY=H(),eu=Yo(),yY=Go(),SY=go(),DY=Zg(),wY=Wt(),nt=Object.assign,MD=Object.defineProperty,BY=fY([].concat);vD.exports=!nt||mY(function(){if(BD&&nt({b:1},nt(MD({},"a",{enumerable:!0,get:function(){MD(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var t={},g={},I=Symbol("assign detection"),A="abcdefghijklmnopqrst";return t[I]=7,A.split("").forEach(function(C){g[C]=C}),nt({},t)[I]!==7||eu(nt({},g)).join("")!==A})?function(g,I){for(var A=DY(g),C=arguments.length,e=1,i=yY.f,n=SY.f;C>e;)for(var r=wY(arguments[e++]),o=i?BY(eu(r),i(r)):eu(r),s=o.length,a=0,u;s>a;)u=o[a++],(!BD||dY(n,r,u))&&(A[u]=r[u]);return A}:nt});var ED=p((cU,_D)=>{"use strict";var MY=Ng(),vY=qi();_D.exports=function(t,g,I,A){try{return A?g(MY(I)[0],I[1]):g(I)}catch(C){vY(t,"throw",C)}}});var xD=p((hU,bD)=>{"use strict";var PY=eg(),_Y=pI(),EY=WA();bD.exports=function(t,g,I){PY?_Y.f(t,g,EY(0,I)):t[g]=I}});var OD=p((pU,TD)=>{"use strict";var bY=QA(),xY=og(),KY=Zg(),GY=ED(),TY=pa(),OY=cn(),YY=bg(),KD=xD(),jY=xn(),RY=me(),GD=Array;TD.exports=function(g){var I=KY(g),A=OY(this),C=arguments.length,e=C>1?arguments[1]:void 0,i=e!==void 0;i&&(e=bY(e,C>2?arguments[2]:void 0));var n=RY(I),r=0,o,s,a,u,c,h;if(n&&!(this===GD&&TY(n)))for(s=A?new this:[],u=jY(I,n),c=u.next;!(a=xY(c,u)).done;r++)h=i?GY(u,e,[a.value,r],!0):a.value,KD(s,r,h);else for(o=YY(I),s=A?new this(o):GD(o);o>r;r++)h=i?e(I[r],r):I[r],KD(s,r,h);return s.length=r,s}});var HD=p((fU,kD)=>{"use strict";var OC=F(),iu=2147483647,_e=36,WD=1,ou=26,NY=38,WY=700,FY=72,ZY=128,kY="-",HY=/[^\0-\u007E]/,FD=/[.\u3002\uFF0E\uFF61]/g,YD="Overflow: input needs wider integers to process",nu=_e-WD,jD=RangeError,LY=OC(FD.exec),rt=Math.floor,ru=String.fromCharCode,RD=OC("".charCodeAt),ZD=OC([].join),eC=OC([].push),UY=OC("".replace),XY=OC("".split),VY=OC("".toLowerCase),zY=function(t){for(var g=[],I=0,A=t.length;I<A;){var C=RD(t,I++);if(C>=55296&&C<=56319&&I<A){var e=RD(t,I++);(e&64512)===56320?eC(g,((C&1023)<<10)+(e&1023)+65536):(eC(g,C),I--)}else eC(g,C)}return g},ND=function(t){return t+22+75*(t<26)},JY=function(t,g,I){var A=0;for(t=I?rt(t/WY):t>>1,t+=rt(t/g);t>nu*ou>>1;)t=rt(t/nu),A+=_e;return rt(A+(nu+1)*t/(t+NY))},QY=function(t){var g=[];t=zY(t);var I=t.length,A=ZY,C=0,e=FY,i,n;for(i=0;i<t.length;i++)n=t[i],n<128&&eC(g,ru(n));var r=g.length,o=r;for(r&&eC(g,kY);o<I;){var s=iu;for(i=0;i<t.length;i++)n=t[i],n>=A&&n<s&&(s=n);var a=o+1;if(s-A>rt((iu-C)/a))throw new jD(YD);for(C+=(s-A)*a,A=s,i=0;i<t.length;i++){if(n=t[i],n<A&&++C>iu)throw new jD(YD);if(n===A){for(var u=C,c=_e;;){var h=c<=e?WD:c>=e+ou?ou:c-e;if(u<h)break;var f=u-h,d=_e-h;eC(g,ru(ND(h+f%d))),u=rt(f/d),c+=_e}eC(g,ru(ND(u))),e=JY(C,a,o===r),C=0,o++}}C++,A++}return ZD(g,"")};kD.exports=function(t){var g=[],I=XY(UY(VY(t),FD,"."),"."),A,C;for(A=0;A<I.length;A++)C=I[A],eC(g,LY(HY,C)?"xn--"+QY(C):C);return ZD(g,".")}});var Ee=p((dU,LD)=>{"use strict";var qY=TypeError;LD.exports=function(t,g){if(t<g)throw new qY("Not enough arguments");return t}});var VD=p(()=>{"use strict";var $Y=V(),gj=F(),Ij=Xt(),Aj=RangeError,UD=String.fromCharCode,XD=String.fromCodePoint,Cj=gj([].join),tj=!!XD&&XD.length!==1;$Y({target:"String",stat:!0,arity:1,forced:tj},{fromCodePoint:function(g){for(var I=[],A=arguments.length,C=0,e;A>C;){if(e=+arguments[C++],Ij(e,1114111)!==e)throw new Aj(e+" is not a valid code point");I[C]=e<65536?UD(e):UD(((e-=65536)>>10)+55296,e%1024+56320)}return Cj(I,"")}})});var QD=p((SU,JD)=>{"use strict";var zD=Z(),ej=eg(),ij=Object.getOwnPropertyDescriptor;JD.exports=function(t){if(!ej)return zD[t];var g=ij(zD,t);return g&&g.value}});var du=p((DU,yw)=>{"use strict";Qo();VD();var hu=V(),sw=Z(),pu=QD(),nj=xI(),Ln=og(),LI=F(),be=eg(),aw=tu(),uw=dI(),rj=pA(),oj=ia(),sj=ZA(),aj=Xo(),fu=QI(),lw=pe(),su=ig(),uj=kg(),lj=QA(),cj=uA(),hj=Ng(),cw=Mg(),Xg=eI(),pj=yC(),qD=WA(),$D=xn(),fj=me(),Un=Hi(),ot=Ee(),dj=dg(),mj=sn(),yj=dj("iterator"),at="URLSearchParams",hw=at+"Iterator",pw=fu.set,DI=fu.getterFor(at),Sj=fu.getterFor(hw),gw=pu("fetch"),zn=pu("Request"),xe=pu("Headers"),au=zn&&zn.prototype,Iw=xe&&xe.prototype,Dj=sw.TypeError,wj=sw.encodeURIComponent,Bj=String.fromCharCode,Mj=nj("String","fromCodePoint"),vj=parseInt,Vn=LI("".charAt),Aw=LI([].join),iC=LI([].push),fw=LI("".replace),Pj=LI([].shift),Cw=LI([].splice),tw=LI("".split),dw=LI("".slice),_j=LI(/./.exec),Ej=/\+/g,uu="\uFFFD",bj=/^[0-9a-f]+$/i,ew=function(t,g){var I=dw(t,g,g+2);return _j(bj,I)?vj(I,16):NaN},xj=function(t){for(var g=0,I=128;I>0&&t&I;I>>=1)g++;return g},Kj=function(t){var g=null;switch(t.length){case 1:g=t[0];break;case 2:g=(t[0]&31)<<6|t[1]&63;break;case 3:g=(t[0]&15)<<12|(t[1]&63)<<6|t[2]&63;break;case 4:g=(t[0]&7)<<18|(t[1]&63)<<12|(t[2]&63)<<6|t[3]&63;break}return g>1114111?null:g},iw=function(t){t=fw(t,Ej," ");for(var g=t.length,I="",A=0;A<g;){var C=Vn(t,A);if(C==="%"){if(Vn(t,A+1)==="%"||A+3>g){I+="%",A++;continue}var e=ew(t,A+1);if(e!==e){I+=C,A++;continue}A+=2;var i=xj(e);if(i===0)C=Bj(e);else{if(i===1||i>4){I+=uu,A++;continue}for(var n=[e],r=1;r<i&&(A++,!(A+3>g||Vn(t,A)!=="%"));){var o=ew(t,A+1);if(o!==o){A+=3;break}if(o>191||o<128)break;iC(n,o),A+=2,r++}if(n.length!==i){I+=uu;continue}var s=Kj(n);s===null?I+=uu:C=Mj(s)}}I+=C,A++}return I},Gj=/[!'()~]|%20/g,Tj={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Oj=function(t){return Tj[t]},nw=function(t){return fw(wj(t),Gj,Oj)},lu=aj(function(g,I){pw(this,{type:hw,target:DI(g).entries,index:0,kind:I})},at,function(){var g=Sj(this),I=g.target,A=g.index++;if(!I||A>=I.length)return g.target=null,Un(void 0,!0);var C=I[A];switch(g.kind){case"keys":return Un(C.key,!1);case"values":return Un(C.value,!1)}return Un([C.key,C.value],!1)},!0),mw=function(t){this.entries=[],this.url=null,t!==void 0&&(cw(t)?this.parseObject(t):this.parseQuery(typeof t=="string"?Vn(t,0)==="?"?dw(t,1):t:Xg(t)))};mw.prototype={type:at,bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var g=this.entries,I=fj(t),A,C,e,i,n,r,o;if(I)for(A=$D(t,I),C=A.next;!(e=Ln(C,A)).done;){if(i=$D(hj(e.value)),n=i.next,(r=Ln(n,i)).done||(o=Ln(n,i)).done||!Ln(n,i).done)throw new Dj("Expected sequence with length 2");iC(g,{key:Xg(r.value),value:Xg(o.value)})}else for(var s in t)uj(t,s)&&iC(g,{key:s,value:Xg(t[s])})},parseQuery:function(t){if(t)for(var g=this.entries,I=tw(t,"&"),A=0,C,e;A<I.length;)C=I[A++],C.length&&(e=tw(C,"="),iC(g,{key:iw(Pj(e)),value:iw(Aw(e,"="))}))},serialize:function(){for(var t=this.entries,g=[],I=0,A;I<t.length;)A=t[I++],iC(g,nw(A.key)+"="+nw(A.value));return Aw(g,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Jn=function(){lw(this,st);var g=arguments.length>0?arguments[0]:void 0,I=pw(this,new mw(g));be||(this.size=I.entries.length)},st=Jn.prototype;oj(st,{append:function(g,I){var A=DI(this);ot(arguments.length,2),iC(A.entries,{key:Xg(g),value:Xg(I)}),be||this.length++,A.updateURL()},delete:function(t){for(var g=DI(this),I=ot(arguments.length,1),A=g.entries,C=Xg(t),e=I<2?void 0:arguments[1],i=e===void 0?e:Xg(e),n=0;n<A.length;){var r=A[n];if(r.key===C&&(i===void 0||r.value===i)){if(Cw(A,n,1),i!==void 0)break}else n++}be||(this.size=A.length),g.updateURL()},get:function(g){var I=DI(this).entries;ot(arguments.length,1);for(var A=Xg(g),C=0;C<I.length;C++)if(I[C].key===A)return I[C].value;return null},getAll:function(g){var I=DI(this).entries;ot(arguments.length,1);for(var A=Xg(g),C=[],e=0;e<I.length;e++)I[e].key===A&&iC(C,I[e].value);return C},has:function(g){for(var I=DI(this).entries,A=ot(arguments.length,1),C=Xg(g),e=A<2?void 0:arguments[1],i=e===void 0?e:Xg(e),n=0;n<I.length;){var r=I[n++];if(r.key===C&&(i===void 0||r.value===i))return!0}return!1},set:function(g,I){var A=DI(this);ot(arguments.length,1);for(var C=A.entries,e=!1,i=Xg(g),n=Xg(I),r=0,o;r<C.length;r++)o=C[r],o.key===i&&(e?Cw(C,r--,1):(e=!0,o.value=n));e||iC(C,{key:i,value:n}),be||(this.size=C.length),A.updateURL()},sort:function(){var g=DI(this);mj(g.entries,function(I,A){return I.key>A.key?1:-1}),g.updateURL()},forEach:function(g){for(var I=DI(this).entries,A=lj(g,arguments.length>1?arguments[1]:void 0),C=0,e;C<I.length;)e=I[C++],A(e.value,e.key,this)},keys:function(){return new lu(this,"keys")},values:function(){return new lu(this,"values")},entries:function(){return new lu(this,"entries")}},{enumerable:!0});uw(st,yj,st.entries,{name:"entries"});uw(st,"toString",function(){return DI(this).serialize()},{enumerable:!0});be&&rj(st,"size",{get:function(){return DI(this).entries.length},configurable:!0,enumerable:!0});sj(Jn,at);hu({global:!0,constructor:!0,forced:!aw},{URLSearchParams:Jn});!aw&&su(xe)&&(rw=LI(Iw.has),ow=LI(Iw.set),cu=function(t){if(cw(t)){var g=t.body,I;if(cj(g)===at)return I=t.headers?new xe(t.headers):new xe,rw(I,"content-type")||ow(I,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),pj(t,{body:qD(0,Xg(g)),headers:qD(0,I)})}return t},su(gw)&&hu({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(g){return gw(g,arguments.length>1?cu(arguments[1]):{})}}),su(zn)&&(Xn=function(g){return lw(this,au),new zn(g,arguments.length>1?cu(arguments[1]):{})},au.constructor=Xn,Xn.prototype=au,hu({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Xn})));var rw,ow,cu,Xn;yw.exports={URLSearchParams:Jn,getState:DI}});var Rw=p(()=>{"use strict";SD();var Yj=V(),Ou=eg(),jj=tu(),Yu=Z(),Sw=QA(),PI=F(),Ir=dI(),wI=pA(),Rj=pe(),Ku=kg(),ju=PD(),ut=OD(),UI=Ae(),Nj=en().codeAt,Wj=HD(),YA=eI(),Fj=ZA(),Zj=Ee(),Kw=du(),Gw=QI(),kj=Gw.set,Ar=Gw.getterFor("URL"),Hj=Kw.URLSearchParams,Lj=Kw.getState,Ke=Yu.URL,Gu=Yu.TypeError,Cr=Yu.parseInt,Uj=Math.floor,Dw=Math.pow,vI=PI("".charAt),XI=PI(/./.exec),Te=PI([].join),Xj=PI(1 .toString),Vj=PI([].pop),ct=PI([].push),mu=PI("".replace),zj=PI([].shift),Jj=PI("".split),Ye=PI("".slice),tr=PI("".toLowerCase),Qj=PI([].unshift),qj="Invalid authority",yu="Invalid scheme",YC="Invalid host",ww="Invalid port",Tw=/[a-z]/i,$j=/[\d+-.a-z]/i,Tu=/\d/,gR=/^0x/i,IR=/^[0-7]+$/,AR=/^\d+$/,Ow=/^[\da-f]+$/i,CR=/[\0\t\n\r #%/:<>?@[\\\]^|]/,tR=/[\0\t\n\r #/:<>?@[\\\]^|]/,eR=/^[\u0000-\u0020]+/,iR=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,nR=/[\t\n\r]/g,BI,rR=function(t){var g=Jj(t,"."),I,A,C,e,i,n,r;if(g.length&&g[g.length-1]===""&&g.length--,I=g.length,I>4)return t;for(A=[],C=0;C<I;C++){if(e=g[C],e==="")return t;if(i=10,e.length>1&&vI(e,0)==="0"&&(i=XI(gR,e)?16:8,e=Ye(e,i===8?1:2)),e==="")n=0;else{if(!XI(i===10?AR:i===8?IR:Ow,e))return t;n=Cr(e,i)}ct(A,n)}for(C=0;C<I;C++)if(n=A[C],C===I-1){if(n>=Dw(256,5-I))return null}else if(n>255)return null;for(r=Vj(A),C=0;C<A.length;C++)r+=A[C]*Dw(256,3-C);return r},oR=function(t){var g=[0,0,0,0,0,0,0,0],I=0,A=null,C=0,e,i,n,r,o,s,a,u=function(){return vI(t,C)};if(u()===":"){if(vI(t,1)!==":")return;C+=2,I++,A=I}for(;u();){if(I===8)return;if(u()===":"){if(A!==null)return;C++,I++,A=I;continue}for(e=i=0;i<4&&XI(Ow,u());)e=e*16+Cr(u(),16),C++,i++;if(u()==="."){if(i===0||(C-=i,I>6))return;for(n=0;u();){if(r=null,n>0)if(u()==="."&&n<4)C++;else return;if(!XI(Tu,u()))return;for(;XI(Tu,u());){if(o=Cr(u(),10),r===null)r=o;else{if(r===0)return;r=r*10+o}if(r>255)return;C++}g[I]=g[I]*256+r,n++,(n===2||n===4)&&I++}if(n!==4)return;break}else if(u()===":"){if(C++,!u())return}else if(u())return;g[I++]=e}if(A!==null)for(s=I-A,I=7;I!==0&&s>0;)a=g[I],g[I--]=g[A+s-1],g[A+--s]=a;else if(I!==8)return;return g},sR=function(t){for(var g=null,I=1,A=null,C=0,e=0;e<8;e++)t[e]!==0?(C>I&&(g=A,I=C),A=null,C=0):(A===null&&(A=e),++C);return C>I?A:g},Ge=function(t){var g,I,A,C;if(typeof t=="number"){for(g=[],I=0;I<4;I++)Qj(g,t%256),t=Uj(t/256);return Te(g,".")}if(typeof t=="object"){for(g="",A=sR(t),I=0;I<8;I++)C&&t[I]===0||(C&&(C=!1),A===I?(g+=I?":":"::",C=!0):(g+=Xj(t[I],16),I<7&&(g+=":")));return"["+g+"]"}return t},gr={},Yw=ju({},gr,{" ":1,'"':1,"<":1,">":1,"`":1}),jw=ju({},Yw,{"#":1,"?":1,"{":1,"}":1}),Su=ju({},jw,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),nC=function(t,g){var I=Nj(t,0);return I>32&&I<127&&!Ku(g,t)?t:encodeURIComponent(t)},Qn={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Oe=function(t,g){var I;return t.length===2&&XI(Tw,vI(t,0))&&((I=vI(t,1))===":"||!g&&I==="|")},Bw=function(t){var g;return t.length>1&&Oe(Ye(t,0,2))&&(t.length===2||(g=vI(t,2))==="/"||g==="\\"||g==="?"||g==="#")},aR=function(t){return t==="."||tr(t)==="%2e"},uR=function(t){return t=tr(t),t===".."||t==="%2e."||t===".%2e"||t==="%2e%2e"},Du={},Mw={},wu={},vw={},Pw={},Bu={},_w={},Ew={},qn={},$n={},Mu={},vu={},Pu={},_u={},bw={},Eu={},lt={},iA={},xw={},jC={},OA={},Ru=function(t,g,I){var A=YA(t),C,e,i;if(g){if(e=this.parse(A),e)throw new Gu(e);this.searchParams=null}else{if(I!==void 0&&(C=new Ru(I,!0)),e=this.parse(A,null,C),e)throw new Gu(e);i=Lj(new Hj),i.bindURL(this),this.searchParams=i}};Ru.prototype={type:"URL",parse:function(t,g,I){var A=this,C=g||Du,e=0,i="",n=!1,r=!1,o=!1,s,a,u,c;for(t=YA(t),g||(A.scheme="",A.username="",A.password="",A.host=null,A.port=null,A.path=[],A.query=null,A.fragment=null,A.cannotBeABaseURL=!1,t=mu(t,eR,""),t=mu(t,iR,"$1")),t=mu(t,nR,""),s=ut(t);e<=s.length;){switch(a=s[e],C){case Du:if(a&&XI(Tw,a))i+=tr(a),C=Mw;else{if(g)return yu;C=wu;continue}break;case Mw:if(a&&(XI($j,a)||a==="+"||a==="-"||a==="."))i+=tr(a);else if(a===":"){if(g&&(A.isSpecial()!==Ku(Qn,i)||i==="file"&&(A.includesCredentials()||A.port!==null)||A.scheme==="file"&&!A.host))return;if(A.scheme=i,g){A.isSpecial()&&Qn[A.scheme]===A.port&&(A.port=null);return}i="",A.scheme==="file"?C=_u:A.isSpecial()&&I&&I.scheme===A.scheme?C=vw:A.isSpecial()?C=Ew:s[e+1]==="/"?(C=Pw,e++):(A.cannotBeABaseURL=!0,ct(A.path,""),C=xw)}else{if(g)return yu;i="",C=wu,e=0;continue}break;case wu:if(!I||I.cannotBeABaseURL&&a!=="#")return yu;if(I.cannotBeABaseURL&&a==="#"){A.scheme=I.scheme,A.path=UI(I.path),A.query=I.query,A.fragment="",A.cannotBeABaseURL=!0,C=OA;break}C=I.scheme==="file"?_u:Bu;continue;case vw:if(a==="/"&&s[e+1]==="/")C=qn,e++;else{C=Bu;continue}break;case Pw:if(a==="/"){C=$n;break}else{C=iA;continue}case Bu:if(A.scheme=I.scheme,a===BI)A.username=I.username,A.password=I.password,A.host=I.host,A.port=I.port,A.path=UI(I.path),A.query=I.query;else if(a==="/"||a==="\\"&&A.isSpecial())C=_w;else if(a==="?")A.username=I.username,A.password=I.password,A.host=I.host,A.port=I.port,A.path=UI(I.path),A.query="",C=jC;else if(a==="#")A.username=I.username,A.password=I.password,A.host=I.host,A.port=I.port,A.path=UI(I.path),A.query=I.query,A.fragment="",C=OA;else{A.username=I.username,A.password=I.password,A.host=I.host,A.port=I.port,A.path=UI(I.path),A.path.length--,C=iA;continue}break;case _w:if(A.isSpecial()&&(a==="/"||a==="\\"))C=qn;else if(a==="/")C=$n;else{A.username=I.username,A.password=I.password,A.host=I.host,A.port=I.port,C=iA;continue}break;case Ew:if(C=qn,a!=="/"||vI(i,e+1)!=="/")continue;e++;break;case qn:if(a!=="/"&&a!=="\\"){C=$n;continue}break;case $n:if(a==="@"){n&&(i="%40"+i),n=!0,u=ut(i);for(var h=0;h<u.length;h++){var f=u[h];if(f===":"&&!o){o=!0;continue}var d=nC(f,Su);o?A.password+=d:A.username+=d}i=""}else if(a===BI||a==="/"||a==="?"||a==="#"||a==="\\"&&A.isSpecial()){if(n&&i==="")return qj;e-=ut(i).length+1,i="",C=Mu}else i+=a;break;case Mu:case vu:if(g&&A.scheme==="file"){C=Eu;continue}else if(a===":"&&!r){if(i==="")return YC;if(c=A.parseHost(i),c)return c;if(i="",C=Pu,g===vu)return}else if(a===BI||a==="/"||a==="?"||a==="#"||a==="\\"&&A.isSpecial()){if(A.isSpecial()&&i==="")return YC;if(g&&i===""&&(A.includesCredentials()||A.port!==null))return;if(c=A.parseHost(i),c)return c;if(i="",C=lt,g)return;continue}else a==="["?r=!0:a==="]"&&(r=!1),i+=a;break;case Pu:if(XI(Tu,a))i+=a;else if(a===BI||a==="/"||a==="?"||a==="#"||a==="\\"&&A.isSpecial()||g){if(i!==""){var S=Cr(i,10);if(S>65535)return ww;A.port=A.isSpecial()&&S===Qn[A.scheme]?null:S,i=""}if(g)return;C=lt;continue}else return ww;break;case _u:if(A.scheme="file",a==="/"||a==="\\")C=bw;else if(I&&I.scheme==="file")switch(a){case BI:A.host=I.host,A.path=UI(I.path),A.query=I.query;break;case"?":A.host=I.host,A.path=UI(I.path),A.query="",C=jC;break;case"#":A.host=I.host,A.path=UI(I.path),A.query=I.query,A.fragment="",C=OA;break;default:Bw(Te(UI(s,e),""))||(A.host=I.host,A.path=UI(I.path),A.shortenPath()),C=iA;continue}else{C=iA;continue}break;case bw:if(a==="/"||a==="\\"){C=Eu;break}I&&I.scheme==="file"&&!Bw(Te(UI(s,e),""))&&(Oe(I.path[0],!0)?ct(A.path,I.path[0]):A.host=I.host),C=iA;continue;case Eu:if(a===BI||a==="/"||a==="\\"||a==="?"||a==="#"){if(!g&&Oe(i))C=iA;else if(i===""){if(A.host="",g)return;C=lt}else{if(c=A.parseHost(i),c)return c;if(A.host==="localhost"&&(A.host=""),g)return;i="",C=lt}continue}else i+=a;break;case lt:if(A.isSpecial()){if(C=iA,a!=="/"&&a!=="\\")continue}else if(!g&&a==="?")A.query="",C=jC;else if(!g&&a==="#")A.fragment="",C=OA;else if(a!==BI&&(C=iA,a!=="/"))continue;break;case iA:if(a===BI||a==="/"||a==="\\"&&A.isSpecial()||!g&&(a==="?"||a==="#")){if(uR(i)?(A.shortenPath(),a!=="/"&&!(a==="\\"&&A.isSpecial())&&ct(A.path,"")):aR(i)?a!=="/"&&!(a==="\\"&&A.isSpecial())&&ct(A.path,""):(A.scheme==="file"&&!A.path.length&&Oe(i)&&(A.host&&(A.host=""),i=vI(i,0)+":"),ct(A.path,i)),i="",A.scheme==="file"&&(a===BI||a==="?"||a==="#"))for(;A.path.length>1&&A.path[0]==="";)zj(A.path);a==="?"?(A.query="",C=jC):a==="#"&&(A.fragment="",C=OA)}else i+=nC(a,jw);break;case xw:a==="?"?(A.query="",C=jC):a==="#"?(A.fragment="",C=OA):a!==BI&&(A.path[0]+=nC(a,gr));break;case jC:!g&&a==="#"?(A.fragment="",C=OA):a!==BI&&(a==="'"&&A.isSpecial()?A.query+="%27":a==="#"?A.query+="%23":A.query+=nC(a,gr));break;case OA:a!==BI&&(A.fragment+=nC(a,Yw));break}e++}},parseHost:function(t){var g,I,A;if(vI(t,0)==="["){if(vI(t,t.length-1)!=="]"||(g=oR(Ye(t,1,-1)),!g))return YC;this.host=g}else if(this.isSpecial()){if(t=Wj(t),XI(CR,t)||(g=rR(t),g===null))return YC;this.host=g}else{if(XI(tR,t))return YC;for(g="",I=ut(t),A=0;A<I.length;A++)g+=nC(I[A],gr);this.host=g}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return Ku(Qn,this.scheme)},shortenPath:function(){var t=this.path,g=t.length;g&&(this.scheme!=="file"||g!==1||!Oe(t[0],!0))&&t.length--},serialize:function(){var t=this,g=t.scheme,I=t.username,A=t.password,C=t.host,e=t.port,i=t.path,n=t.query,r=t.fragment,o=g+":";return C!==null?(o+="//",t.includesCredentials()&&(o+=I+(A?":"+A:"")+"@"),o+=Ge(C),e!==null&&(o+=":"+e)):g==="file"&&(o+="//"),o+=t.cannotBeABaseURL?i[0]:i.length?"/"+Te(i,"/"):"",n!==null&&(o+="?"+n),r!==null&&(o+="#"+r),o},setHref:function(t){var g=this.parse(t);if(g)throw new Gu(g);this.searchParams.update()},getOrigin:function(){var t=this.scheme,g=this.port;if(t==="blob")try{return new ht(t.path[0]).origin}catch(I){return"null"}return t==="file"||!this.isSpecial()?"null":t+"://"+Ge(this.host)+(g!==null?":"+g:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(t){this.parse(YA(t)+":",Du)},getUsername:function(){return this.username},setUsername:function(t){var g=ut(YA(t));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var I=0;I<g.length;I++)this.username+=nC(g[I],Su)}},getPassword:function(){return this.password},setPassword:function(t){var g=ut(YA(t));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var I=0;I<g.length;I++)this.password+=nC(g[I],Su)}},getHost:function(){var t=this.host,g=this.port;return t===null?"":g===null?Ge(t):Ge(t)+":"+g},setHost:function(t){this.cannotBeABaseURL||this.parse(t,Mu)},getHostname:function(){var t=this.host;return t===null?"":Ge(t)},setHostname:function(t){this.cannotBeABaseURL||this.parse(t,vu)},getPort:function(){var t=this.port;return t===null?"":YA(t)},setPort:function(t){this.cannotHaveUsernamePasswordPort()||(t=YA(t),t===""?this.port=null:this.parse(t,Pu))},getPathname:function(){var t=this.path;return this.cannotBeABaseURL?t[0]:t.length?"/"+Te(t,"/"):""},setPathname:function(t){this.cannotBeABaseURL||(this.path=[],this.parse(t,lt))},getSearch:function(){var t=this.query;return t?"?"+t:""},setSearch:function(t){t=YA(t),t===""?this.query=null:(vI(t,0)==="?"&&(t=Ye(t,1)),this.query="",this.parse(t,jC)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var t=this.fragment;return t?"#"+t:""},setHash:function(t){if(t=YA(t),t===""){this.fragment=null;return}vI(t,0)==="#"&&(t=Ye(t,1)),this.fragment="",this.parse(t,OA)},update:function(){this.query=this.searchParams.serialize()||null}};var ht=function(g){var I=Rj(this,Vg),A=Zj(arguments.length,1)>1?arguments[1]:void 0,C=kj(I,new Ru(g,!1,A));Ou||(I.href=C.serialize(),I.origin=C.getOrigin(),I.protocol=C.getProtocol(),I.username=C.getUsername(),I.password=C.getPassword(),I.host=C.getHost(),I.hostname=C.getHostname(),I.port=C.getPort(),I.pathname=C.getPathname(),I.search=C.getSearch(),I.searchParams=C.getSearchParams(),I.hash=C.getHash())},Vg=ht.prototype,MI=function(t,g){return{get:function(){return Ar(this)[t]()},set:g&&function(I){return Ar(this)[g](I)},configurable:!0,enumerable:!0}};Ou&&(wI(Vg,"href",MI("serialize","setHref")),wI(Vg,"origin",MI("getOrigin")),wI(Vg,"protocol",MI("getProtocol","setProtocol")),wI(Vg,"username",MI("getUsername","setUsername")),wI(Vg,"password",MI("getPassword","setPassword")),wI(Vg,"host",MI("getHost","setHost")),wI(Vg,"hostname",MI("getHostname","setHostname")),wI(Vg,"port",MI("getPort","setPort")),wI(Vg,"pathname",MI("getPathname","setPathname")),wI(Vg,"search",MI("getSearch","setSearch")),wI(Vg,"searchParams",MI("getSearchParams")),wI(Vg,"hash",MI("getHash","setHash")));Ir(Vg,"toJSON",function(){return Ar(this).serialize()},{enumerable:!0});Ir(Vg,"toString",function(){return Ar(this).serialize()},{enumerable:!0});Ke&&(bu=Ke.createObjectURL,xu=Ke.revokeObjectURL,bu&&Ir(ht,"createObjectURL",Sw(bu,Ke)),xu&&Ir(ht,"revokeObjectURL",Sw(xu,Ke)));var bu,xu;Fj(ht,"URL");Yj({global:!0,constructor:!0,forced:!jj,sham:!Ou},{URL:ht})});var Nw=p(()=>{"use strict";Rw()});var Ww=p(()=>{"use strict";var lR=V(),cR=og();lR({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return cR(URL.prototype.toString,this)}})});var Nu=p(()=>{"use strict";du()});var Fu=p(()=>{"use strict";var hR=dI(),er=F(),Fw=eI(),pR=Ee(),kw=URLSearchParams,ir=kw.prototype,fR=er(ir.append),Zw=er(ir.delete),dR=er(ir.forEach),mR=er([].push),Wu=new kw("a=1&a=2&b=3");Wu.delete("a",1);Wu.delete("b",void 0);Wu+""!="a=2"&&hR(ir,"delete",function(t){var g=arguments.length,I=g<2?void 0:arguments[1];if(g&&I===void 0)return Zw(this,t);var A=[];dR(this,function(a,u){mR(A,{key:u,value:a})}),pR(g,1);for(var C=Fw(t),e=Fw(I),i=0,n=0,r=!1,o=A.length,s;i<o;)s=A[i++],r||s.key===C?(r=!0,Zw(this,s.key)):n++;for(;n<o;)s=A[n++],s.key===C&&s.value===e||fR(this,s.key,s.value)},{enumerable:!0,unsafe:!0})});var ku=p(()=>{"use strict";var yR=dI(),Lw=F(),SR=eI(),DR=Ee(),Uw=URLSearchParams,Zu=Uw.prototype,wR=Lw(Zu.getAll),BR=Lw(Zu.has),Hw=new Uw("a=1");(Hw.has("a",2)||!Hw.has("a",void 0))&&yR(Zu,"has",function(g){var I=arguments.length,A=I<2?void 0:arguments[1];if(I&&A===void 0)return BR(this,g);var C=wR(this,g);DR(I,1);for(var e=SR(A),i=0;i<C.length;)if(C[i++]===e)return!0;return!1},{enumerable:!0,unsafe:!0})});var Lu=p(()=>{"use strict";var MR=eg(),vR=F(),PR=pA(),Hu=URLSearchParams.prototype,_R=vR(Hu.forEach);MR&&!("size"in Hu)&&PR(Hu,"size",{get:function(){var g=0;return _R(this,function(){g++}),g},configurable:!0,enumerable:!0})});var Xw=p(()=>{"use strict";var ER=tC();ER("Int8",function(t){return function(I,A,C){return t(this,I,A,C)}})});var Vw=p(()=>{"use strict";var bR=tC();bR("Uint32",function(t){return function(I,A,C){return t(this,I,A,C)}})});var zw=p(()=>{"use strict";var xR=tC();xR("Int16",function(t){return function(I,A,C){return t(this,I,A,C)}})});var Jw=p(()=>{"use strict";var KR=tC();KR("Int32",function(t){return function(I,A,C){return t(this,I,A,C)}})});var Uu=p(()=>{"use strict";var GR=tC();GR("Uint16",function(t){return function(I,A,C){return t(this,I,A,C)}})});var cr=p(()=>{"use strict";var zR=V(),JR=Zg(),QR=bg(),qR=To(),$R=Gs(),g4=Ni(),I4=[].unshift(0)!==1,A4=function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(t){return t instanceof TypeError}},C4=I4||!A4();zR({target:"Array",proto:!0,arity:1,forced:C4},{unshift:function(g){var I=JR(this),A=QR(I),C=arguments.length;if(C){g4(A+C);for(var e=A;e--;){var i=e+C;e in I?I[i]=I[e]:$R(I,i)}for(var n=0;n<C;n++)I[n]=arguments[n]}return qR(I,A+C)}})});var Y2=p((I8,O2)=>{"use strict";var i4=Z();O2.exports=i4.Promise});var N2=p((A8,R2)=>{"use strict";var j2=Ng(),n4=ha(),r4=Ft(),o4=dg(),s4=o4("species");R2.exports=function(t,g){var I=j2(t).constructor,A;return I===void 0||r4(A=j2(I)[s4])?g:n4(A)}});var Z2=p((C8,F2)=>{"use strict";var W2=JI(),a4=TypeError,u4=function(t){var g,I;this.promise=new t(function(A,C){if(g!==void 0||I!==void 0)throw new a4("Bad Promise constructor");g=A,I=C}),this.resolve=W2(g),this.reject=W2(I)};F2.exports.f=function(t){return new u4(t)}});var H2=p((t8,k2)=>{"use strict";var l4=Ng(),c4=Mg(),h4=Z2();k2.exports=function(t,g){if(l4(t),c4(g)&&g.constructor===t)return g;var I=h4.f(t),A=I.resolve;return A(g),I.promise}});var t0=p(()=>{"use strict";var p4=V(),f4=FA(),wr=Y2(),d4=H(),U2=xI(),X2=ig(),m4=N2(),L2=H2(),y4=dI(),C0=wr&&wr.prototype,S4=!!wr&&d4(function(){C0.finally.call({then:function(){}},function(){})});p4({target:"Promise",proto:!0,real:!0,forced:S4},{finally:function(t){var g=m4(this,U2("Promise")),I=X2(t);return this.then(I?function(A){return L2(g,t()).then(function(){return A})}:t,I?function(A){return L2(g,t()).then(function(){throw A})}:t)}});!f4&&X2(wr)&&(A0=U2("Promise").prototype.finally,C0.finally!==A0&&y4(C0,"finally",A0,{unsafe:!0}));var A0});var pB=p(()=>{"use strict";var V4=V(),z4=Be().findLastIndex,J4=Jt();V4({target:"Array",proto:!0},{findLastIndex:function(g){return z4(this,g,arguments.length>1?arguments[1]:void 0)}});J4("findLastIndex")});var fB=p(()=>{"use strict";var Q4=V(),q4=Be().findLast,$4=Jt();Q4({target:"Array",proto:!0},{findLast:function(g){return q4(this,g,arguments.length>1?arguments[1]:void 0)}});$4("findLast")});var nN={};H0(nN,{AibeeLoader:()=>FC,BMap:()=>c0,BMapSelect:()=>D0,BaseSvg:()=>aI,CarInertialPosition:()=>pi,ClickHelper:()=>le,Context:()=>ni,CrLoader:()=>l0,CrNavPath:()=>S0,Equipment:()=>h0,EventDispatcher:()=>hg,Events:()=>Ks,Floor:()=>sI,GlbModel:()=>qu,Graphic:()=>Bg,GraphicLayer:()=>Fe,GroundTexture:()=>sC,HeatmapElement:()=>Ne,HighlightPoi:()=>x0,HooksName:()=>xg,HoverHelper:()=>ei,InstancedModel:()=>Ue,InstancedParkingSpace:()=>pt,KalmanFilter:()=>he,Lane:()=>gi,Layer:()=>pg,LineElement:()=>yt,MapTypePolar:()=>W4,MergeAttributeGraphic:()=>uC,MergeAttributeGroundTexture:()=>aC,MergeAttributeLane:()=>Ci,MergeAttributeWall:()=>Ai,MergeGraphic:()=>$u,MergeParkingSpace:()=>He,MergedGraphicLayer:()=>Je,MergedModelLayer:()=>Le,Model:()=>We,MulFloorNavigation:()=>w0,MulFloorSelect:()=>B0,MulFloors:()=>d0,NavPath:()=>oi,Navigation:()=>f0,Overlay:()=>RC,ParkingLayer:()=>ke,ParkingType:()=>F4,PathDirection:()=>IA,PdrPosition:()=>ui,Poi:()=>oC,Poi2:()=>ug,PoiLayer:()=>Ze,PoiLayer2:()=>NC,Position:()=>E0,RENDER_VERSION:()=>Bt,RecommendParkingSpace:()=>v0,RoadNetwork:()=>Ls,RoadNetwork2:()=>Vs,SENSOR_TYPE:()=>J,SelectBox:()=>Qu,Selection:()=>ti,Sensor:()=>si,Shadow:()=>Re,Socket:()=>Kt,SortByDistance:()=>K0,SvgLine:()=>Qe,SvgPolygon:()=>qe,TaskQueue:()=>xC,TextTexture:()=>Ii,Timer:()=>tg,TweenUtil:()=>hA,UA:()=>bs,UseMyPosition:()=>b0,Wall:()=>$e,WorkerPool:()=>ce,addAlphaToHexColor:()=>b6,calc_angle:()=>ie,calc_direction:()=>an,calculateInstantaneousSpeed:()=>AN,calculateLineDirection:()=>ci,convertToSnakeCase:()=>zs,createCircle:()=>qC,createLine:()=>re,createRect:()=>cA,createSvg:()=>fs,createSvgElement:()=>ne,createThreeBox:()=>TG,createThreeLine:()=>GG,darkenColor:()=>gA,defaultConfig:()=>q2,defaultGraphicOptions:()=>rC,defaultOptions:()=>mr,defaultTextTextureOptions:()=>_2,deviceToVector3:()=>tK,dispose:()=>U,distancePointToSegment:()=>Ws,generatorKeyByObj:()=>_C,getAngle:()=>Ld,getBorderPoints:()=>Fn,getCenter:()=>ee,getConfig:()=>n0,getDirectPath:()=>gG,getDirectionByAngle:()=>un,getDistanceByPathPos:()=>Fs,getLength:()=>z,getLongestSideDir:()=>eK,getMinEdgeSquare:()=>iK,getPathLength:()=>Hg,getPointEdgeIndex:()=>qI,getPosByPathDistance:()=>EC,hasChinese:()=>us,hexToRgb:()=>on,initDirectionalLight:()=>ts,initLight:()=>Cs,initShape:()=>te,isAndroid:()=>x6,isContain:()=>lA,isControl:()=>vC,isIphone:()=>zA,isMac:()=>MC,isPointInPolygon:()=>ls,loadBuildingGround:()=>a0,loadExternalStreet:()=>R4,loadGraphics:()=>u0,mergeGraphicGeometries:()=>CY,mergeGraphicLineGeometries:()=>cD,moveOnRoute:()=>$6,predictFuturePosition:()=>xt,predictFutureSpeed:()=>CN,proxyOptions:()=>wC,removeOutliers:()=>tN,removeWeightPath:()=>Ud,setCirclePosition:()=>VA,setLineStartEnd:()=>mI,setRectPosition:()=>Wg,simplifyPath:()=>se,sleepByRf:()=>ms,sleepOnePromise:()=>ds,sleepOneRf:()=>tn,smoothPath:()=>Ns,strToNumber:()=>E6,timeoutPromise:()=>rI,toWebWorker:()=>KG,transformGraphicData:()=>ue,transformSpeed:()=>Ur,translatePosToCenter:()=>bC,triggerWorker:()=>ng,vector3ToDevice:()=>j,xhrGet:()=>Q6});module.exports=WB(nN);function D(){return D=Object.assign||function(g){for(var I=1;I<arguments.length;I++){var A=arguments[I];for(var C in A)Object.prototype.hasOwnProperty.call(A,C)&&(g[C]=A[C])}return g},D.apply(this,arguments)}var l5=l(W(),1),c5=l(_(),1),h5=l(DC(),1),cI=require("three");var D8=l(_(),1);var KF=l(OI(),1),GF=l(YI(),1),TF=l(jI(),1),OF=l(RI(),1),YF=l(NI(),1),jF=l(WI(),1),RF=l(FI(),1),NF=l(_(),1),tg=class{requestAnimationFrame(g){let I=window.requestAnimationFrame(()=>{this.tasks.requestAnimation.delete(I),g()});return this.tasks.requestAnimation.add(I),I}cancelAnimationFrame(g){this.tasks.requestAnimation.delete(g),window.cancelAnimationFrame(g)}setTimeout(g,I){let A=window.setTimeout(()=>{this.tasks.timeout.delete(A),g()},I);return this.tasks.timeout.add(A),A}clearTimeout(g){this.tasks.timeout.delete(g),window.clearTimeout(g)}setInterval(g,I){let A=window.setInterval(()=>{g()},I);return this.tasks.interval.add(A),A}clearInterval(g){this.tasks.interval.delete(g),window.clearInterval(g)}requestIdleCallback(g,I){let A=window.requestIdleCallback(C=>{this.tasks.requestIdleCallback.delete(A),g(C)},I);return this.tasks.requestIdleCallback.add(A),A}cancelIdleCallback(g){this.tasks.requestIdleCallback.delete(g),window.cancelIdleCallback(g)}dispose(){this.tasks.requestAnimation.forEach(g=>{window.cancelAnimationFrame(g)}),this.tasks.requestAnimation.clear(),this.tasks.requestIdleCallback.forEach(g=>{window.cancelIdleCallback(g)}),this.tasks.requestIdleCallback.clear(),this.tasks.timeout.forEach(g=>{window.clearTimeout(g)}),this.tasks.timeout.clear(),this.tasks.interval.forEach(g=>{window.clearInterval(g)}),this.tasks.interval.clear()}constructor(){this.tasks={requestAnimation:new Set,requestIdleCallback:new Set,timeout:new Set,interval:new Set}}};var FF=l(_(),1),ZF=l(W(),1),iI=require("three");function Cs(){let t=new iI.Group,g=new iI.AmbientLight(16777215,2.6);return t.add(g),t}function te(t,g){g===void 0&&(g=[]);let I=new iI.Shape(t.map(A=>new iI.Vector2(...A)));return g.length&&g.forEach(A=>{var C=new iI.Path(A.map(e=>new iI.Vector2(...e)));I.holes.push(C)}),I}function ts(t,g){t===void 0&&(t=16777215),g===void 0&&(g=1);let I=new iI.DirectionalLight(t,g);return I.castShadow=!0,I.shadow.radius=8,I.shadow.bias=-.001,I.shadow.mapSize.set(256,256),I.shadow.camera.left=-200,I.shadow.camera.right=200,I.shadow.camera.top=200,I.shadow.camera.bottom=-200,I}function U(t,g){if(g&&t.children&&t.children.length&&t.children.forEach(I=>{U(I,g)}),t.isMesh){let I=t;I.geometry&&I.geometry.dispose(),I.material&&(Array.isArray(I.material)?I.material.forEach(A=>{A.dispose()}):I.material.dispose())}t.isLight&&(t.dispose==null||t.dispose.call(t))}var qF=l(nI(),1);function us(t){return/[\u4E00-\u9FA5]+/g.test(t)}var gZ=l(_(),1),mg=require("three"),QC=require("@turf/turf");function j(t,g,I,A){let C=t.clone().project(g),e=I/2,i=A/2,n=Math.round(C.x*e+e),r=Math.round(-C.y*i+i);return{x:n,y:r}}function tK(t,g,I,A,C){if(!C)return null;I=Math.min(1,I),A=Math.min(1,A);let e=t/I*2-1,i=1-g/A*2;return new mg.Vector3(e,i,0).unproject(C)}function ee(t){let g=(0,QC.featureCollection)(t.map(A=>(0,QC.point)(A)));return(0,QC.center)(g).geometry.coordinates}function lA(t,g,I){return t.x>=g.x&&t.x<=I.x&&t.y>=g.y&&t.y<=I.y}function eK(t){let g=0,I=new mg.Vector3;for(let A=1;A<t.length;A++){let C=new mg.Vector3(t[A-1][0],t[A-1][1],0),e=new mg.Vector3(t[A][0],t[A][1],0),i=e.distanceTo(C);i>g&&(g=i,I=e.clone().sub(C).normalize())}return I}function z(t,g){return Math.sqrt((g[0]-t[0])**2+(g[1]-t[1])**2)}function Hg(t){let g=0;for(let I=0;I<t.length-1;I++)g+=z(t[I],t[I+1]);return g}function ie(t,g,I){let A=new mg.Vector2(g[0]-t[0],g[1]-t[1]),C=new mg.Vector2(g[0]-I[0],g[1]-I[1]),i=A.angleTo(C)*180/Math.PI,n=new mg.Vector2(g[0]-t[0],g[1]-t[1]);return new mg.Vector2(I[0]-t[0],I[1]-t[1]).cross(n)>0?i:-i}function iK(t,g){let I=Math.min(z(t[0][0],t[0][1]),z(t[0][2],t[0][1]))-1;g||(g=ee(t[0]));let A=nK(g,I),C=new mg.Vector2(t[0][0][0],t[0][0][1]),e=new mg.Vector2(t[0][1][0],t[0][1][1]),i=new mg.Vector2(t[0][2][0],t[0][2][1]),r=(C.distanceTo(e)>e.distanceTo(i)?e.clone().sub(C):i.clone().sub(e)).angleTo(new mg.Vector2(0,1)),o=new mg.Matrix3;return o.multiply(new mg.Matrix3().translate(g[0],g[1])).multiply(new mg.Matrix3().rotate(r)).multiply(new mg.Matrix3().translate(-g[0],-g[1])),[A.map(s=>{let a=new mg.Vector2(s[0],s[1]).applyMatrix3(o);return[a.x,a.y]})]}function nK(t,g){let I=g/2;return[[t[0]-I,t[1]+I],[t[0]+I,t[1]+I],[t[0]+I,t[1]-I],[t[0]-I,t[1]-I],[t[0]-I,t[1]+I]]}function qI(t,g){let I=0,A=1/0,[C,e]=g;for(let i=0;i<t.length-1;i++){let[n,r]=t[i],[o,s]=t[i+1],a=Math.min(n,o)<=C&&C<=Math.max(n,o),u=Math.min(r,s)<=e&&e<=Math.max(r,s);if(a&&u){let c=Math.abs((o-n)*(e-r)-(s-r)*(C-n));c<A&&(A=c,I=i)}}return I}function ls(t,g){let I=t[0],A=t[1],C=!1;for(let e=0,i=g.length-1;e<g.length;i=e++){let n=g[e][0],r=g[e][1],o=g[i][0],s=g[i][1];r>A!=s>A&&I<(o-n)*(A-r)/(s-r)+n&&(C=!C)}return C}var tZ=l(ff(),1);function wC(t,g){return new Proxy(t,{get:(I,A,C)=>Reflect.get(I,A,C),set:(I,A,C,e)=>{let i=Reflect.get(I,A,e),n=Reflect.set(I,A,C,e);return i!==C&&g.dispatchEvent({type:"change-"+A,value:C}),n}})}var pZ=l(_(),1),fZ=l(ps(),1);function rI(t,g){return Promise.race([t,new Promise((I,A)=>{setTimeout(()=>A(new Error("Promise timeout")),g)})])}function ne(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function fs(t,g){let I=ne("svg");return I.setAttribute("width",t),I.setAttribute("height",g),I.style.cssText="position: absolute; left: 0; top: 0; pointer-events: none;",I}function qC(t,g){t===void 0&&(t="2");let I=ne("circle");return I.setAttribute("r",t),I.setAttribute("fill",g),I}function re(t){let g=ne("line");return g.setAttribute("stroke",t),g}function cA(t,g){let I=ne("rect");return I.setAttribute("stroke",t),I.setAttribute("fill",g),I}function VA(t,g,I){t.setAttribute("cx",""+g),t.setAttribute("cy",""+I)}function mI(t,g,I){g&&(t.setAttribute("x1",""+g.x),t.setAttribute("y1",""+g.y)),I&&(t.setAttribute("x2",""+I.x),t.setAttribute("y2",""+I.y))}function Wg(t,g,I,A,C){t.setAttribute("x",""+g),t.setAttribute("y",""+I),t.setAttribute("width",""+A),t.setAttribute("height",""+C)}function ds(){return Promise.resolve()}function tn(){return new Promise(t=>{requestAnimationFrame(t)})}function ms(t){return t===void 0&&(t=1),new Promise(g=>{function I(){t<=0?g(!0):(t--,window.requestAnimationFrame(I))}window.requestAnimationFrame(I)})}var GZ=l(oe(),1),TZ=l(nI(),1),OZ=l(rn(),1);function E6(t){return parseInt(t.replace("#","0x"),16)}function b6(t,g){let I=parseInt(t.substring(1,3),16),A=parseInt(t.substring(3,5),16),C=parseInt(t.substring(5,7),16),e=Math.round(I*g),i=Math.round(A*g),n=Math.round(C*g);return"#"+(1<<24|e<<16|i<<8|n).toString(16).slice(1)}function gA(t,g){g===void 0&&(g=.85);let I,A,C;if(t.startsWith("#"))I=parseInt(t.substring(1,3),16),A=parseInt(t.substring(3,5),16),C=parseInt(t.substring(5,7),16);else{let i=t.slice(4,-1).split(",");I=parseInt(i[0].trim()),A=parseInt(i[1].trim()),C=parseInt(i[2].trim())}return I=Math.min(Math.floor(I*g),255),A=Math.min(Math.floor(A*g),255),C=Math.min(Math.floor(C*g),255),"#"+((1<<24)+(I<<16)+(A<<8)+C).toString(16).slice(1)}function on(t,g){t=t.replace(/^#/,"");let I=parseInt(t.substring(0,2),16),A=parseInt(t.substring(2,4),16),C=parseInt(t.substring(4,6),16);return g!==void 0?"rgba("+I+", "+A+", "+C+", "+g+")":"rgb("+I+", "+A+", "+C+")"}var jZ=l(nI(),1),MC=navigator.userAgent.toUpperCase().indexOf("MAC")>=0,bs=(navigator.userAgent||"").toLocaleLowerCase(),zA=/ios|iphone/i.test(bs),x6=/android|adr|linux/gi.test(bs);function vC(t){return MC?t==="Meta":t==="Control"}var FZ=l(OI(),1),ZZ=l(YI(),1),kZ=l(jI(),1),HZ=l(RI(),1),LZ=l(NI(),1),UZ=l(WI(),1),XZ=l(FI(),1),VZ=l(_(),1),xs="__once__",Ks=class{on(g,I){if(typeof I!="function")return;let A=this.events.get(g);return A?A.add(I):this.events.set(g,new Set([I]))}once(g,I){if(typeof I!="function")return;let A=""+xs+g,C=this.events.get(A);return C?C.add(I):this.events.set(A,new Set([I]))}off(g,I){let A=this.events.get(g),C=this.events.get(""+xs+g);!A&&!C||(I===void 0&&(A==null||A.clear(),C==null||C.clear()),A!=null&&A.has(I)&&A.delete(I),C!=null&&C.has(I)&&C.delete(I))}offAll(){this.events.clear()}emit(g){for(var I=arguments.length,A=new Array(I>1?I-1:0),C=1;C<I;C++)A[C-1]=arguments[C];let e=this.events.get(g),i=this.events.get(""+xs+g);!e&&!i||(e==null||e.forEach(n=>{typeof n=="function"&&n(...A)}),i==null||i.forEach(n=>{typeof n=="function"&&n(...A)}),i==null||i.clear())}constructor(){this.events=new Map}};var xg=function(t){return t.SWITCH_FLOOR_BEFORE="switch_floor_before",t.SWITCH_FLOOR_GROUND="switch_floor_ground",t.SWITCH_FLOOR_AFTER="switch_floor_after",t}({});var ek=l(PC(),1);function _C(t){return Object.keys(t).sort().map(g=>g+"="+t[g]).join("&")}function Q6(t,g){return new Promise((I,A)=>{let C=new XMLHttpRequest;C.open("GET",t,!0),Object.keys(g.headers||{}).forEach(e=>{C.setRequestHeader(e,g.headers[e])}),g.responseType&&(C.responseType=g.responseType),C.onload=()=>{if(C.status>=200&&C.status<300)if(g.responseType==="arraybuffer")I(C.response);else try{let e=JSON.parse(C.responseText);I(e)}catch(e){A(e)}else A(C.statusText)},C.onerror=()=>{A(C.statusText)},C.send()})}var sk=l(_(),1),ak=l(W(),1),gt=require("three"),Hd=l(kd(),1);function Ld(t,g){let I=t.clone().normalize(),A=g.clone().normalize();return Math.acos(I.dot(A))}function q6(t){let g=0;return t.reduce((I,A)=>{let[C,e]=I,[i,n]=A;return g+=Math.sqrt((i-C)**2+(n-e)**2),[i,n]}),g/t.length}function Ns(t,g){if(g===void 0&&(g=.25),q6(t)<g)return t;let I=(0,Hd.default)(t);return Ns(I,g)}function se(t,g,I,A,C,e){g===void 0&&(g=!1),I===void 0&&(I=!0),A===void 0&&(A=5),C===void 0&&(C=150),e===void 0&&(e=3);let i=[],n=!g;if(i.push(t[0]),t.length<2)return i;for(let o=0;o<t.length-2;o+=1){let s=t[o],a=t[o+1],u=t[o+2],c=new gt.Vector2(s[0]-a[0],s[1]-a[1]),h=new gt.Vector2(u[0]-a[0],u[1]-a[1]),f=Ld(c,h)/Math.PI*180,d=c.length()+h.length();(!n||f<C&&d>.01||d>A)&&(i.push(t[o+1]),n=!0)}if(i.push(t[t.length-1]),!I)return i;let r=[];r.push(i[0]);for(let o=0;o<i.length-2;o+=1){let s=new gt.Vector2(i[o][0],i[o][1]),a=new gt.Vector2(i[o+1][0],i[o+1][1]),u=new gt.Vector2(i[o+2][0],i[o+2][1]),c=s.distanceTo(a)/2,h=u.distanceTo(a)/2,f=a.clone(),d=a.clone();f.add(s.clone().sub(a).normalize().multiplyScalar(c>e?e/2:c)),d.add(u.clone().sub(a).normalize().multiplyScalar(h>e?e/2:h));let S=[[f.x,f.y],[a.x,a.y],[d.x,d.y]];r.push(...Ns(S,e/25))}return r.push(i[i.length-1]),Ud(r)}function Ud(t){if(t.length<=1)return t;let g=[],I;return t.forEach(A=>{let[C,e]=A;I?C===I[0]&&e===I[1]||(I=[C,e],g.push([C,e])):(I=[C,e],g.push([C,e]))}),g}function Ws(t,g,I){let A=Math.sqrt((I[0]-g[0])**2+(I[1]-g[1])**2);if(A===0)return{distance:Math.sqrt((t[0]-g[0])**2+(t[1]-g[1])**2),closestPoint:g.slice(0)};let C=Math.max(0,Math.min(1,((t[0]-g[0])*(I[0]-g[0])+(t[1]-g[1])*(I[1]-g[1]))/A**2)),e=[g[0]+C*(I[0]-g[0]),g[1]+C*(I[1]-g[1])];return{distance:Math.sqrt((t[0]-e[0])**2+(t[1]-e[1])**2),closestPoint:e}}function $6(t,g,I){let[A,C]=t,[e,i]=g,n=Math.sqrt(Math.pow(e-A,2)+Math.pow(i-C,2));if(n===0||n<I)return[...g];let r=I/n,o=A+(e-A)*r,s=C+(i-C)*r;return[o,s]}var IA=function(t){return t.START="start",t.END="end",t.FRONT="front",t.RIGHT="right",t.LEFT="left",t.RIGHT_FRONT="right_front",t.LEFT_FRONT="left_front",t.RIGHT_BACK="right_back",t.LEFT_BACK="left_back",t}({});function an(t,g,I){let A=ie(t,g,I);return un(A)}function un(t){return 180-Math.abs(t)<15?"front":t>135?"right_front":t<-135?"left_front":t<=135&&t>=60?"right":t>=-135&&t<=-60?"left":t<60&&t>0?"right_back":t>-60&&t<0?"left_back":"front"}function gG(t){if(!t.length)return[];if(t.length===1)return[{direction:"start",distance:0,points:t}];let g=[{direction:"start",distance:z(t[0],t[1]),points:[t[0],t[1]]}];for(let I=2;I<t.length;I++){let A=an(t[I-2],t[I-1],t[I]);if(A==="front"){let C=g[g.length-1],e=z(t[I-1],t[I]);C.distance+=e,I!==2&&C.points.push(t[I-1])}else g.push({direction:A,distance:z(t[I-1],t[I]),points:[t[I-1],t[I]]})}return g.push({direction:"end",distance:0,points:[t[t.length-1]]}),g}function Fs(t,g){if(t.length<2)return-1;let I=0;for(let A=1;A<t.length;A++){let C=t[A-1],e=t[A],i=[g[0]-C[0],g[1]-C[1]],n=[e[0]-C[0],e[1]-C[1]],r=Math.min(e[0],C[0])<=g[0]&&g[0]<=Math.max(e[0],C[0]),o=Math.min(e[1],C[1])<=g[1]&&g[1]<=Math.max(e[1],C[1]);if(r&&o){let s=i[0]*n[1]-i[1]*n[0];if(Math.abs(s)<1e-6){let a=Math.sqrt((g[0]-C[0])**2+(g[1]-C[1])**2);return I+a}}I+=Math.sqrt((e[0]-C[0])**2+(e[1]-C[1])**2)}return-1}function EC(t,g){if(t.length<2){var I;return(I=t[0])!=null?I:null}let A=0;for(let C=1;C<t.length;C++){let e=t[C-1],i=t[C],n=Math.sqrt((i[0]-e[0])**2+(i[1]-e[1])**2);if(A+=n,A>=g){let r=(g-(A-n))/n,o=e[0]+(i[0]-e[0])*r,s=e[1]+(i[1]-e[1])*r;return[o,s]}}return null}var yk=l(W(),1),Sk=l(_(),1),Dk=l(nI(),1),AA=l(Hs(),1);var yI="___",Ls=class{initRoute(g){this.clear(),this.roadInfo=g,g.length&&(g.forEach(I=>{I.points.forEach(A=>{let C=""+I.floor+yI+A.id;if(this.pointMap.set(C,A),this.nodeMap.set(""+A.floor+yI+A.nodeId,C),A.type==="straightLadder"){let e=this.straightLadderMap.get(A.name)||[];e.push(D({},A)),this.straightLadderMap.set(A.name,e)}if(A.type==="staircase"){let e=this.staircaseMap.get(A.name)||[];e.push(D({},A)),this.staircaseMap.set(A.name,e)}if(A.type==="escalator"){let e=this.escalatorMap.get(A.name)||{};A.escalatorDirection==="exit"?e.end={floor:A.floor,id:A.id}:e.start={floor:A.floor,id:A.id},this.escalatorMap.set(A.name,e)}if(A.type==="facility"){let e=this.facilityMap.get(A.targetId)||[];e.push(D({},A)),this.facilityMap.set(A.targetId,e)}}),I.lines.filter(A=>A.direction!=="no").forEach(A=>{var C,e;let i=""+I.floor+yI+A.from,n=""+I.floor+yI+A.to,r=(C=this.pointMap.get(i))==null?void 0:C.cds,o=(e=this.pointMap.get(n))==null?void 0:e.cds;if(r!=null&&r.length&&(o!=null&&o.length)){let s=z(r,o);this.addLineItem(i,n,s),A.direction==="double"&&this.addLineItem(n,i,s)}})}),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute())}addLineItem(g,I,A,C){C===void 0&&(C=this.lineMap);let e=C.get(g)||new Map;e.set(I,A),C.set(g,e)}addFacilityToLineMap(g,I,A,C){[...this.straightLadderMap,...this.staircaseMap].forEach(e=>{let[i,n]=e;if(!(n.length<2))for(let s=0;s<n.length;s++){let a=""+n[s].floor+yI+n[s].id;for(let u=0;u<n.length;u++)if(s!==u){var r,o;let c=""+n[u].floor+yI+n[u].id,h=(r=this.pointMap.get(a))==null?void 0:r.cds,f=(o=this.pointMap.get(c))==null?void 0:o.cds;if(h!=null&&h.length&&(f!=null&&f.length))if(n[s].type==="straightLadder"){let d=I;this.addLineItem(a,c,d,C)}else{let d=A;this.addLineItem(a,c,d,C)}}}}),this.escalatorMap.forEach((e,i)=>{if(e.start&&e.end){var n,r;let o=""+e.start.floor+yI+e.start.id,s=""+e.end.floor+yI+e.end.id,a=(n=this.pointMap.get(o))==null?void 0:n.cds,u=(r=this.pointMap.get(s))==null?void 0:r.cds;if(a!=null&&a.length&&(u!=null&&u.length)){let c=g;this.addLineItem(o,s,c,C)}}})}initBaseRoute(){let g=new Map([...this.lineMap]);this.addFacilityToLineMap(1,this.lift_priority,3e4,g),this.baseRoute=new AA.default(g)}initEscalatorRoute(){let g=new Map([...this.lineMap]),I=1e4;this.addFacilityToLineMap(1*I,this.lift_priority*I,3e4*I,g),this.escalatorRoute=new AA.default(g)}initStraightLadderRoute(){let g=new Map([...this.lineMap]),I=1e4;this.addFacilityToLineMap(3*I,1*I,3e4*I,g),this.straightLadderRoute=new AA.default(g)}checkStart(g){return!(!g.floor||!g.nodeId&&(!g.coord||g.coord.length<2))}checkEnd(g){return g.facility?!0:this.checkStart(g)}transformStart(g){var I;if(g.nodeId){let A=this.nodeMap.get(""+g.floor+yI+g.nodeId);if(A){let[C,e]=A.split(yI);return{floor:C,id:e}}}if((I=g.coord)!=null&&I.length){let A=this.roadInfo.find(e=>e.floor===g.floor);if(!A)return null;let C=A.points.reduce((e,i)=>{let n=z(g.coord,i.cds);return n<e.min&&(e.min=n,e.point=i),e},{min:1/0,point:A.points[0]});return{floor:C.point.floor,id:C.point.id}}return null}transformEnd(g){if(g.floor){let I=this.transformStart(g);if(I)return I}if(g.facility){let I=this.facilityMap.get(g.facility);if(I!=null&&I.length)return{floor:g.floor,facility:g.facility}}return null}getPath(g,I,A){if(A===void 0&&(A=""),!this.checkStart(g))return"start-error";if(!this.checkEnd(I))return"end-error";let C=this.transformStart(g);if(!C)return"no-start";let e=this.transformEnd(I);if(!e)return"no-end";let i=this.getBasePath.bind(this);switch(A){case"escalator":i=this.getEscalatorPath.bind(this);break;case"straightLadder":i=this.getStraightLadderPath.bind(this);break;default:i=this.getBasePath.bind(this);break}if(e.id)return i(C,e);if(e.facility){let n=this.facilityMap.get(e.facility).filter(o=>e.floor?o.floor===e.floor:!0);if(!n.length)return null;let r=n.map(o=>i(C,{floor:o.floor,id:o.id})).filter(o=>!!o);return r.reduce((o,s)=>{let a=s.reduce((u,c)=>u+Hg(c.points),0);return a<o.distance&&(o.distance=a,o.path=s),o},{distance:1/0,path:r[0]}).path}}getRoutePath(g,I,A){let C=""+g.floor+yI+g.id,e=""+I.floor+yI+I.id,i=A.path(C,e);if(!i)return null;let n=[];return i.map(r=>{let o=this.pointMap.get(r);if(o){var s;let{floor:a}=o;if(((s=n[n.length-1])==null?void 0:s.floor)===a){let u=n[n.length-1];u.points.push(o.cds),u.endType=o.type,u.destId=o.nodeId,u.distance=Hg(u.points)}else n.push({floor:a,points:[o.cds],endType:o.type,destId:o.nodeId,distance:0})}}),n}getBasePath(g,I){return this.getRoutePath(g,I,this.baseRoute)}getEscalatorPath(g,I){return this.getRoutePath(g,I,this.escalatorRoute)}getStraightLadderPath(g,I){return this.getRoutePath(g,I,this.straightLadderRoute)}clear(){this.roadInfo=[],this.pointMap.clear(),this.nodeMap.clear(),this.facilityMap.clear(),this.straightLadderMap.clear(),this.escalatorMap.clear(),this.staircaseMap.clear(),this.lineMap.clear(),this.baseRoute=new AA.default,this.escalatorRoute=new AA.default,this.straightLadderRoute=new AA.default}constructor(g=3){this.lift_priority=g,this.roadInfo=[],this.pointMap=new Map,this.nodeMap=new Map,this.facilityMap=new Map,this.straightLadderMap=new Map,this.escalatorMap=new Map,this.staircaseMap=new Map,this.lineMap=new Map,this.baseRoute=new AA.default,this.escalatorRoute=new AA.default,this.straightLadderRoute=new AA.default}};var Yk=l(_(),1),jk=l(nI(),1),Rk=l(W(),1),Nk=l(OI(),1),Wk=l(YI(),1),Fk=l(jI(),1),Zk=l(RI(),1),kk=l(NI(),1),Hk=l(WI(),1),Lk=l(FI(),1),Uk=l(hn(),1),Xk=l(pn(),1),Kg=l(Hs(),1);var Jg=require("lodash"),fn=require("three"),k="___",Vs=class{isFacilityByType(g){return["facility","escalator","straightLadder","staircase","ramp","connectionPoint"].includes(g)}initFacilities(g){this.facilities=g.map(I=>{let A=[];try{A=JSON.parse(I.entry_end_floor)}catch(e){A=[]}let C=[];try{C=JSON.parse(I.entry_start_floor)}catch(e){C=[]}return D({},I,{entry_start_floor:C,entry_end_floor:A})})}getParkingSpaceInfo(g,I){let A=""+g+k+I;var C;return(C=this.parkingMap.get(A))!=null?C:null}getNodeInfo(g,I){let A=""+g+k+I,C=this.nodeMap.get(A);if(!(C!=null&&C.length))return null;let e=this.pointMap.get(C[0]);return e!=null?e:null}initRoute(g,I){this.clear(),this.roadInfo=g,this.initFacilities(I);let A=new Date,C=A.getHours()*60+A.getMinutes();g.length&&(g.forEach(e=>{let i=(e.points||[]).filter(n=>!(0,Jg.isNil)(n.passWeight)&&n.passWeight!==1&&!(0,Jg.isNil)(n.coverageArea)&&n.coverageArea!==0);(e.points||[]).filter(n=>n.openStatus!==!1).filter(n=>{if(!n.startTime||!n.endTime)return!0;let[r,o]=n.startTime.split(":").map(h=>+h),[s,a]=n.endTime.split(":").map(h=>+h),u=r*60+o,c=s*60+a;return C>=u&&C<=c}).forEach(n=>{n.floor=e.floor;let r=""+e.floor+k+n.id,o=""+e.floor+k+n.nodeId,s=this.nodeMap.get(o)||[];if(s.push(""+e.floor+k+(n.relatedId||n.id)),this.nodeMap.set(""+e.floor+k+n.nodeId,s),this.pointMap.set(r,n),this.isFacilityByType(n.type)){let a=this.facilities.find(u=>u.id===+n.targetId);if(a){switch(a.entry_infra_type){case"straightLadder":if(a.entry_end_floor.find(f=>f.floor===e.floor)&&a.entry_start_floor.find(f=>f.floor===e.floor)){let f=this.straightLadderMap.get(n.targetId)||[];f.push(D({},n)),this.straightLadderMap.set(n.targetId,f)}break;case"staircase":if(a.entry_end_floor.find(f=>f.floor===e.floor)&&a.entry_start_floor.find(f=>f.floor===e.floor)){let f=this.staircaseMap.get(n.targetId)||[];f.push(D({},n)),this.staircaseMap.set(n.targetId,f)}break;case"escalator":let c=this.escalatorMap.get(n.targetId)||[];if(a.entry_start_floor.find(f=>f.floor===e.floor)){let f=c.find(d=>{var S;return((S=d.end)==null?void 0:S.floor)!==e.floor&&!d.start});f?f.start=n:c.push({start:n})}if(a.entry_end_floor.find(f=>f.floor===e.floor)){let f=c.find(d=>{var S;return((S=d.start)==null?void 0:S.floor)!==e.floor&&!d.end});f?f.end=n:c.push({end:n})}this.escalatorMap.set(n.targetId,c);break;case"ramp":let h=this.rampMap.get(n.targetId)||[];if(a.entry_start_floor.find(f=>f.floor===e.floor)){let f=h.find(d=>{var S;return((S=d.end)==null?void 0:S.floor)!==e.floor&&!d.start});f?f.start=n:h.push({start:n})}if(a.entry_end_floor.find(f=>f.floor===e.floor)){let f=h.find(d=>{var S;return((S=d.start)==null?void 0:S.floor)!==e.floor&&!d.end});f?f.end=n:h.push({end:n})}this.rampMap.set(n.targetId,h);break;case"connectionPoint":if(a.entry_end_floor.find(f=>f.floor===e.floor)&&a.entry_start_floor.find(f=>f.floor===e.floor)){let f=this.connectionPointMap.get(n.targetId)||[];f.push(D({},n)),this.connectionPointMap.set(n.targetId,f)}break}let u=this.facilityMap.get(n.targetId)||[];u.push(D({},n)),this.facilityMap.set(n.targetId,u)}}n.type==="parkingSpace"&&n.name.split(/[,,]/).forEach(u=>{this.parkingMap.set(""+e.floor+k+u,n)})}),(e.lines||[]).filter(n=>n.to!==n.from).forEach(n=>{let r=""+e.floor+k+n.from,o=""+e.floor+k+n.to,s=this.pointMap.get(r),a=this.pointMap.get(o);if(!s||!a)return;let u=s.cds,c=a.cds,h=z(u,c);if(i.forEach(f=>{(f.id===n.from||f.id===n.to)&&(h=h/f.passWeight);let d=z(u,f.cds)<=f.coverageArea,S=z(c,f.cds)<=f.coverageArea;(d||S)&&(h=h/f.passWeight)}),!s.permission&&!a.permission){switch(this.addLineItem(r,o,h),this.addLineItem(o,r,h),n.direction){case"double":this.addLineItem(r,o,h,this.forwardLineMap),this.addLineItem(o,r,h,this.forwardLineMap);break;case"single":this.addLineItem(r,o,h,this.forwardLineMap);break;case"back":this.addLineItem(o,r,h,this.forwardLineMap);break}(s.type==="parkingSpace"||a.type==="parkingSpace")&&n.direction==="noDir"&&(this.addLineItem(r,o,h,this.forwardLineMap),this.addLineItem(o,r,h,this.forwardLineMap))}else s.permission&&(this.setPermissionLine(r,o,s.permission,h,""),this.setPermissionLine(o,r,s.permission,h,"")),a.permission&&a.permission!==s.permission&&(this.setPermissionLine(r,o,a.permission,h,""),this.setPermissionLine(o,r,a.permission,h,""))})}),this.addPermissionFacility(),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute(),this.initForwardRoute())}getPermissionMap(g){return this["permission_"+g]||(this["permission_"+g]=new Set),this["permission_"+g]}setPermissionLine(g,I,A,C,e){this.getPermissionMap(A).add({fromKey:g,toKey:I,distance:C,type:e})}addPermissionFacility(){this.straightLadderMap.forEach((g,I)=>{if(g.length<2){this.straightLadderMap.delete(I);return}for(let A=0;A<g.length;A++){let C=""+g[A].floor+k+g[A].id,e=this.pointMap.get(C);if(e){for(let i=0;i<g.length;i++)if(A!==i){let n=""+g[i].floor+k+g[i].id,r=this.pointMap.get(n);if(!r)continue;e.permission&&this.setPermissionLine(C,n,e.permission,1,"straightLadder"),r.permission&&r.permission!==e.permission&&this.setPermissionLine(C,n,r.permission,1,"straightLadder")}}}}),this.staircaseMap.forEach((g,I)=>{if(g.length<2){this.staircaseMap.delete(I);return}for(let A=0;A<g.length;A++){let C=""+g[A].floor+k+g[A].id,e=this.pointMap.get(C);if(e){for(let i=0;i<g.length;i++)if(A!==i){let n=""+g[i].floor+k+g[i].id,r=this.pointMap.get(n);if(!r)continue;e.permission&&this.setPermissionLine(C,n,e.permission,1,"staircase"),r.permission&&r.permission!==e.permission&&this.setPermissionLine(C,n,r.permission,1,"staircase")}}}}),this.escalatorMap.forEach((g,I)=>{g.forEach(A=>{if(A.start&&A.end){let C=""+A.start.floor+k+A.start.id,e=""+A.end.floor+k+A.end.id,i=this.pointMap.get(C),n=this.pointMap.get(e);i&&n&&(i.permission&&this.setPermissionLine(C,e,i.permission,1,"escalator"),n.permission&&n.permission!==i.permission&&this.setPermissionLine(C,e,n.permission,1,"escalator"))}})}),this.rampMap.forEach((g,I)=>{g.forEach(A=>{if(A.start&&A.end){let C=""+A.start.floor+k+A.start.id,e=""+A.end.floor+k+A.end.id,i=this.pointMap.get(C),n=this.pointMap.get(e);i&&n&&(i.permission&&this.setPermissionLine(C,e,i.permission,10,"ramp"),n.permission&&n.permission!==i.permission&&this.setPermissionLine(C,e,n.permission,10,"ramp"))}})}),this.connectionPointMap.forEach((g,I)=>{if(g.length<2){this.connectionPointMap.delete(I);return}for(let A=0;A<g.length;A++){let C=""+g[A].floor+k+g[A].id,e=this.pointMap.get(C);if(e){for(let i=0;i<g.length;i++)if(A!==i){let n=""+g[i].floor+k+g[i].id,r=this.pointMap.get(n);if(!r)continue;e.permission&&this.setPermissionLine(C,n,e.permission,1,"connectionPoint"),r.permission&&r.permission!==e.permission&&this.setPermissionLine(C,n,r.permission,1,"connectionPoint")}}}})}addPermissionLineToMap(g,I,A,C){this.getPermissionMap(g).forEach(i=>{I.includes(i.type)&&(i.type===""?this.addLineItem(i.fromKey,i.toKey,i.distance,A):this.addLineItem(i.fromKey,i.toKey,C.get(i.type),A))})}addLineItem(g,I,A,C){C===void 0&&(C=this.lineMap);let e=C.get(g)||new Map;e.set(I,A),C.set(g,e)}addFacilityToLineMap(g,I,A,C){[...this.straightLadderMap,...this.staircaseMap].forEach(e=>{let[i,n]=e;if(!(n.length<2))for(let r=0;r<n.length;r++){let o=""+n[r].floor+k+n[r].id,s=this.pointMap.get(o);if(!(!s||s.permission)){for(let a=0;a<n.length;a++)if(r!==a){let u=""+n[a].floor+k+n[a].id,c=this.pointMap.get(u);if(!c||c.permission)continue;if(n[r].type==="straightLadder"){let h=I;this.addLineItem(o,u,h,C)}else{let h=A;this.addLineItem(o,u,h,C)}}}}}),this.escalatorMap.forEach((e,i)=>{e.forEach(n=>{if(n.start&&n.end){let r=""+n.start.floor+k+n.start.id,o=""+n.end.floor+k+n.end.id,s=this.pointMap.get(r),a=this.pointMap.get(o);if(s&&a&&!s.permission&&!a.permission){let u=g;this.addLineItem(r,o,u,C)}}})}),this.connectionPointMap.forEach((e,i)=>{if(!(e.length<2))for(let n=0;n<e.length;n++){let r=""+e[n].floor+k+e[n].id,o=this.pointMap.get(r);if(!(!o||o.permission)){for(let s=0;s<e.length;s++)if(n!==s){let a=""+e[s].floor+k+e[s].id,u=this.pointMap.get(a);if(!u||u.permission)continue;this.addLineItem(r,a,100,C)}}}})}initBaseRoute(){let g=new Map((0,Jg.cloneDeep)([...this.lineMap]));this.addFacilityToLineMap(100,100+this.lift_priority,3e4,g),this.baseRoute=new Kg.default(g)}initEscalatorRoute(){let g=new Map((0,Jg.cloneDeep)([...this.lineMap])),I=1e4;this.addFacilityToLineMap(1*I,this.lift_priority*I,3e4*I,g),this.escalatorRoute=new Kg.default(g)}initStraightLadderRoute(){let g=new Map((0,Jg.cloneDeep)([...this.lineMap])),I=1e4;this.addFacilityToLineMap(3*I,1*I,3e4*I,g),this.straightLadderRoute=new Kg.default(g)}initForwardRoute(){this.rampMap.forEach((g,I)=>{g.forEach(A=>{if(A.start&&A.end){let C=""+A.start.floor+k+A.start.id,e=""+A.end.floor+k+A.end.id,i=this.pointMap.get(C),n=this.pointMap.get(e);i&&n&&!i.permission&&!n.permission&&this.addLineItem(C,e,10,this.forwardLineMap)}})}),this.connectionPointMap.forEach((g,I)=>{if(!(g.length<2))for(let A=0;A<g.length;A++){let C=""+g[A].floor+k+g[A].id,e=this.pointMap.get(C);if(!(!e||e.permission)){for(let i=0;i<g.length;i++)if(A!==i){let n=""+g[i].floor+k+g[i].id,r=this.pointMap.get(n);if(!r||r.permission)continue;this.addLineItem(C,n,100,this.forwardLineMap)}}}}),this.forwardRoute=new Kg.default(this.forwardLineMap)}checkStart(g){return!(!g.floor||!g.nodeId&&(!g.coord||g.coord.length<2))}checkEnd(g){return g.facility||g.parkingSpace&&g.floor?!0:this.checkStart(g)}transformStart(g,I,A){A===void 0&&(A={});var C;if(g.nodeId){let e=this.nodeMap.get(""+g.floor+k+g.nodeId);if(e!=null&&e.length)return e.map(i=>{let[n,r]=i.split(k);return{floor:n,id:r}})}if((C=g.coord)!=null&&C.length){let e=this.roadInfo.find(o=>o.floor===g.floor);if(!e)return null;let i=e.points.filter(o=>o.isStarted),n=e.points.filter(o=>{let s=""+o.floor+k+o.id;if(I==="forward"){if(!this.forwardLineMap.has(s)||A.adsorptionIntersection&&i.length&&!o.isStarted)return!1}else if(!this.lineMap.has(s))return!1;return!0});if(!n.length)return null;let r=n.reduce((o,s)=>{if(s.relatedId)return o;let a=z(g.coord,s.cds);return a<o.min&&(o.min=a,o.point=s),o},{min:1/0,point:n[0]});return[{floor:e.floor,id:r.point.id}]}return null}transformEnd(g,I){if(g.floor){if(g.parkingSpace){let C=this.parkingMap.get(""+g.floor+k+g.parkingSpace);if(C)return[{floor:g.floor,id:C.id}]}let A=this.transformStart(g,I);if(A)return A}if(g.facility){let C=this.facilities.filter(e=>+e.type_id==+g.facility).map(e=>e.id).map(e=>this.facilityMap.get(""+e)).flat(2);if(C!=null&&C.length)return{floor:g.floor,facility:g.facility}}return null}getPath(g,I,A,C,e,i){if(A===void 0&&(A=""),i===void 0&&(i={}),!this.checkStart(g))return"start-error";if(!this.checkEnd(I))return"end-error";let n=this.transformStart(g,A,i);if(!n)return"no-start";let r=this.transformEnd(I,A);if(!r)return"no-end";let o=[];if(Array.isArray(r))for(let u=0;u<n.length;u++){let c=n[u];for(let h=0;h<r.length;h++){let f=r[h];if(c.floor===f.floor&&c.id===f.id)return"near"}}else{o=this.facilities.filter(c=>+c.type_id==+I.facility).map(c=>c.id).map(c=>this.facilityMap.get(""+c)).flat(2).filter(c=>c).filter(c=>r.floor?c.floor===r.floor:!0);for(let c=0;c<n.length;c++){let h=n[c];for(let f=0;f<o.length;f++){let d=o[f];if(h.floor===d.floor&&h.id===d.id)return"near"}}}let s;switch(A){case"escalator":s=this.getEscalatorPath.bind(this);break;case"straightLadder":s=this.getStraightLadderPath.bind(this);break;case"forward":s=this.getForwardPath.bind(this);break;default:s=this.getBasePath.bind(this);break}let a=null;return n.forEach(u=>{if(Array.isArray(r))r.forEach(c=>{let h=s(u,c,C,e);h&&h&&(!a||h[0].consume<a[0].consume)&&(a=h)});else{if(!o.length)return null;let c=o.map(h=>s(u,{floor:h.floor,id:h.id},C,e)).filter(h=>!!h);a=c.reduce((h,f)=>{let d=f[0].consume;return d<h.distance&&(h.distance=d,h.path=f),h},{distance:1/0,path:c[0]}).path}}),a}getRoutePath(g,I,A){let C=""+g.floor+k+g.id,e=""+I.floor+k+I.id,i=A.path(C,e);if(!i)return null;let n=[],r=i.reduce((o,s,a,u)=>{if(a===0)return 0;let c=u[a-1],h=A.graph.get(c).get(s);return o+h},0);return i.map(o=>{let s=this.pointMap.get(o);if(s){var a;let{floor:u}=s,c=s.type;if(this.isFacilityByType(s.type)){let h=this.facilities.find(f=>f.id===+s.targetId);h&&(c=h.entry_infra_type)}if(((a=n[n.length-1])==null?void 0:a.floor)===u){let h=n[n.length-1];h.points.push(s.cds),h.pointInfos.push(s),h.endType=c,h.destId=s.nodeId,h.distance=Hg(h.points)}else n.push({floor:u,points:[s.cds],pointInfos:[s],endType:c,destId:s.nodeId,distance:0,consume:r})}}),n}getBasePath(g,I,A){if(!A)return this.getRoutePath(g,I,this.baseRoute);let C=(0,Jg.cloneDeep)(this.baseRoute.graph);this.addPermissionLineToMap(A,["","escalator","staircase","straightLadder","connectionPoint"],C,new Map([["escalator",100],["connectionPoint",100],["straightLadder",100+this.lift_priority],["staircase",3e4]]));let e=new Kg.default(C);return this.getRoutePath(g,I,e)}getEscalatorPath(g,I,A){if(!A)return this.getRoutePath(g,I,this.escalatorRoute);let C=(0,Jg.cloneDeep)(this.escalatorRoute.graph),e=1e4;this.addPermissionLineToMap(A,["","escalator","staircase","straightLadder","connectionPoint"],C,new Map([["escalator",1*e],["connectionPoint",100],["straightLadder",this.lift_priority*e],["staircase",3e4*e]]));let i=new Kg.default(C);return this.getRoutePath(g,I,i)}getStraightLadderPath(g,I,A){if(!A)return this.getRoutePath(g,I,this.straightLadderRoute);let C=(0,Jg.cloneDeep)(this.straightLadderRoute.graph),e=1e4;this.addPermissionLineToMap(A,["","escalator","staircase","straightLadder","connectionPoint"],C,new Map([["escalator",3*e],["connectionPoint",100],["straightLadder",1*e],["staircase",3e4*e]]));let i=new Kg.default(C);return this.getRoutePath(g,I,i)}getForwardPath(g,I,A,C){let e=new Map,i=u=>{let c=this.forwardRoute.graph.get(r);u.forEach(h=>{let f=c.get(h);(0,Jg.isNil)(f)||(e.set(h,f),c.delete(h))})},n=()=>{let u=this.forwardRoute.graph.get(r);e.forEach((c,h)=>{u.set(h,c)})},r=""+g.floor+k+g.id;if(!(0,Jg.isNil)(C)){let u=this.forwardLineMap.get(r),c=this.pointMap.get(r);if(c&&(u!=null&&u.size)&&u.size>1){let h=new fn.Vector2(c.cds[0],c.cds[1]),f=new Map;u.forEach((S,w)=>{let M=this.pointMap.get(w);if(M){let K=new fn.Vector2(M.cds[0],M.cds[1]),N=360-(new fn.Vector2().subVectors(K,h).angle()/Math.PI*180-90+360)%360;f.set(w,N)}});let d=Array.from(f).filter(S=>{let[w,M]=S;return Math.abs(M-C)<=60}).map(S=>{let[w]=S;return w});if(d.length)d.forEach(S=>f.delete(S)),i([...f.keys()]);else{let S=Array.from(f).reduce((w,M)=>{let K=Math.abs(M[1]-C);return K<w.diff?{diff:K,key:M[0]}:w},{diff:1/0,key:""});f.delete(S.key),i([...f.keys()])}}}if(!A){let u=this.getRoutePath(g,I,this.forwardRoute);return n(),u||this.getRoutePath(g,I,this.forwardRoute)}let o=(0,Jg.cloneDeep)(this.forwardRoute.graph);this.addPermissionLineToMap(A,["","ramp"],o,new Map([["ramp",10]]));let s=new Kg.default(o),a=this.getRoutePath(g,I,s);if(n(),a)return a;{let u=(0,Jg.cloneDeep)(this.forwardRoute.graph);this.addPermissionLineToMap(A,["","ramp"],u,new Map([["ramp",10]]));let c=new Kg.default(u);return this.getRoutePath(g,I,c)}}clear(){this.roadInfo=[],this.pointMap.clear(),this.nodeMap.clear(),this.facilityMap.clear(),this.straightLadderMap.clear(),this.escalatorMap.clear(),this.staircaseMap.clear(),this.lineMap.clear(),this.baseRoute=new Kg.default,this.escalatorRoute=new Kg.default,this.straightLadderRoute=new Kg.default}constructor(g=3){this.lift_priority=g,this.roadInfo=[],this.facilities=[],this.pointMap=new Map,this.nodeMap=new Map,this.facilityMap=new Map,this.straightLadderMap=new Map,this.escalatorMap=new Map,this.rampMap=new Map,this.staircaseMap=new Map,this.connectionPointMap=new Map,this.parkingMap=new Map,this.lineMap=new Map,this.baseRoute=new Kg.default,this.escalatorRoute=new Kg.default,this.straightLadderRoute=new Kg.default,this.forwardLineMap=new Map,this.forwardRoute=new Kg.default}};var Jk=l(OI(),1),Qk=l(YI(),1),qk=l(jI(),1),$k=l(RI(),1),gH=l(NI(),1),IH=l(WI(),1),AH=l(FI(),1),CH=l(_(),1),qA=class{static createKey(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}static genUniqueKey(){let g=this.createKey();for(;this.keySet.has(g);)g=this.createKey();return g}static removeKey(g){this.keySet.delete(g)}static dispose(){this.keySet.clear()}};qA.keySet=new Set;var eH=l(oe(),1),iH=l(nI(),1);function zs(t){return t.replace(/[A-Z]/g,g=>"_"+g.toLowerCase()).replace(/^_/,"")}function ng(t,g,I){return new Promise((A,C)=>{let e=qA.genUniqueKey(),i=n=>{let{data:r}=n;r.type===""+g+"_result"&&r.key===e&&(qA.removeKey(e),self.removeEventListener("message",i),r.error?C(r.error):A(r.data))};t.addEventListener("message",i),t.postMessage({type:g,key:e,data:I})})}function KG(t){let g={};for(let A in t)A.startsWith("on")&&(g[zs(A.slice(2))]=t[A]);let I=A=>m(this,null,function*(){let{data:C}=A;if(g[C.type])try{let e=yield g[C.type](C.data);if(e!=null&&e.$transfer&&Array.isArray(e.$transfer)){let i=e.$transfer;delete e.$transfer,self.postMessage({type:""+C.type+"_result",key:C.key,data:e},i)}else self.postMessage({type:""+C.type+"_result",key:C.key,data:e})}catch(e){self.postMessage({type:""+C.type+"_result",key:C.key,error:e})}else self.postMessage({type:""+C.type+"_result",key:C.key,error:"no_event"})});return self.addEventListener("message",I),()=>{self.removeEventListener("message",I)}}var ZI=require("three");function GG(t,g){g===void 0&&(g=16711680);let I=new ZI.LineBasicMaterial({color:g}),A=new ZI.BufferGeometry().setFromPoints(t);return new ZI.Line(A,I)}function TG(t,g){g===void 0&&(g=16711680);let I=new ZI.LineBasicMaterial({color:g}),A=new ZI.BoxGeometry(1,1,1),C=new ZI.Mesh(A,I);return C.position.copy(t),C}var lH=l(DC(),1),cH=l(_(),1);function ue(t,g,I){I===void 0&&(I=0),t.forEach(A=>{if(A.geometry.coords=JSON.parse(JSON.stringify(A.geometry.cds)),A.geometry.type==="polygon"){var C;A.geometry.coords.map(e=>{Array.isArray(e)&&e.forEach(i=>{i[0]-=g[0],i[1]-=g[1]})}),A.geometry.otherCds&&(A.geometry.otherCoords=A.geometry.otherCds.map(e=>e.map(i=>bC(i,g)))),(C=A.doors)!=null&&C.length&&A.doors.map(e=>{e.coord=bC(e.coordinate,g)}),A.center&&(A.centerCoords=bC(A.center,g))}else A.geometry.coords=bC(A.geometry.cds,g),A.center&&(A.centerCoords=bC(A.center,g));if(A.center_x&&A.center_y){let[e,i]=bC([A.center_x,A.center_y],g);A.center_coord_x=e,A.center_coord_y=i}});for(let A=0;A<t.length;A++){let C=t[A];C.deltaHeight=1e-5*(I+A+1)}}function bC(t,g){return[t[0]-g[0],t[1]-g[1]]}var pH=l(OI(),1),fH=l(YI(),1),dH=l(jI(),1),mH=l(RI(),1),yH=l(NI(),1),SH=l(WI(),1),DH=l(FI(),1),wH=l(_(),1),wm=require("@tweenjs/tween.js"),hA=class{update(){this.group.update()}pause(){this.pauseTween=!0,this.getAll().forEach(g=>{this.tweenStore.add(g),g.pause()})}continue(){this.pauseTween&&(this.tweenStore.forEach(g=>{g.resume()}),this.tweenStore.clear(),this.pauseTween=!1)}remove(g){this.group.remove(g)}getAll(){return this.group.getAll()}clear(){this.getAll().forEach(g=>g.stop()),this.group.removeAll()}dispose(){this.clear()}constructor(){this.pauseTween=!1,this.tweenStore=new Set,this.group=new wm.Group}};var Bm=require("three"),le=class extends Bm.EventDispatcher{registryEvent(){this.ctn.addEventListener("pointerdown",this._pointerDown),this.ctn.addEventListener("pointerup",this._pointerUp)}unRegistryEvent(){this.ctn.removeEventListener("pointerdown",this._pointerDown),this.ctn.removeEventListener("pointerup",this._pointerUp)}dispose(){this.unRegistryEvent()}constructor(g){super(),this.ctn=g,this._pointerDown=I=>{this.point={x:I.offsetX,y:I.offsetY}},this._pointerUp=I=>{if(!this.point)return;let{offsetX:A,offsetY:C}=I,{x:e,y:i}=this.point;Math.hypot(e-A+(i-C))>3||this.dispatchEvent({type:"click",e:I})},this.registryEvent()}};var PH=l(_(),1),_H=l(W(),1),EH=l(oe(),1),bH=l(nI(),1),Mm=require("lodash"),vm=require("three");var xC=class extends vm.EventDispatcher{_isEffectiveTask(g){return g&&typeof g.run=="function"}_getIndexByTid(g){return this._task.findIndex(I=>I.tid===g)}_createTask(g){return this._isEffectiveTask(g)?D({},g,{tid:++this._id,meta:g.meta||{}}):!1}get task(){return[...this._task]}getTasks(){return[...this._task]}add(g){if(this._isEffectiveTask(g)){let I=this._createTask(g);return this._task.push(I),this.started&&!this.activeTask&&this.start(),I.tid}return!1}replace(g,I){if(!this._isEffectiveTask(I))return console.warn("[TaskQueue] replace\u65B9\u6CD5\u4F20\u5165\u7684task\u53C2\u6570\u683C\u5F0F\u4E0D\u6B63\u786E"),!1;let A=this._getIndexByTid(g);if(A===-1)return console.warn("[TaskQueue] \u6CA1\u6709\u627E\u5230id="+g+"\u7684\u4EFB\u52A1"),!1;let C=this._createTask(I);return this._task.splice(A,1,C),C.tid}replaceByMetaType(g){var I;let A=(I=g.meta)==null?void 0:I.type;if((0,Mm.isNil)(A))return this.add(g);{let C=this._task.find(e=>e.meta.type===A);return C?this.replace(C.tid,g):this.add(g)}}remove(g){let I=this._getIndexByTid(g);return I===-1?(console.warn("[TaskQueue] remove\u65B9\u6CD5\u4F20\u5165\u7684id\uFF1A"+g+"\u627E\u4E0D\u5230\u5BF9\u5E94\u7684task"),!1):(this._task.splice(I,1),!0)}clear(){this._task.length=0}start(){this.started=!0,!this.activeTask&&this._task.length&&this.exec()}stop(){this.started=!1}exec(){return m(this,null,function*(){if(!this.started||!this._task.length)return!1;let g=this._task.shift();this.activeTask=g,this.dispatchEvent({type:"active-task-start",task:g});let I;try{I=yield g.run()}catch(A){console.warn("[task run err]",A,g)}return this.activeTask=null,this.dispatchEvent({type:"active-task-end",task:g,res:I}),this.exec()})}constructor(g=!0){super(),this._task=[],this.started=!1,this.activeTask=null,this._id=0,g&&this.start()}};var GH=l(W(),1),Pm=require("three"),ce=class extends Pm.EventDispatcher{getWorker(){return new Promise(g=>{let I=this.pool.find(C=>C.state==="leisure");if(I){I.state="used",g(I.worker);return}if(this.pool.length<this.max&&this.workerConstructor){let C=this.workerConstructor();this.pool.push({worker:C,state:"used"}),g(C);return}let A=()=>{let C=this.pool.find(e=>e.state==="leisure");C&&(this.removeEventListener("release",A),C.state="used",g(C.worker))};this.addEventListener("release",A)})}releaseWorker(g){let I=this.pool.find(A=>A.worker===g);I&&(I.state="leisure",this.dispatchEvent({type:"release",worker:g}))}dispose(){this._listeners={},this.pool.forEach(g=>{g.worker.terminate()}),this.pool=[]}constructor(g=10,I){super(),this.max=10,this.pool=[],this.max=g,this.workerConstructor=I}};var _m=require("three"),hg=class extends _m.EventDispatcher{dispose(){this._listeners={}}};var he=class{filter(g){let I=this.estimate,A=this.errorEstimate+this.processNoise,C=A/(A+this.measurementNoise);return this.estimate=I+C*(g-I),this.errorEstimate=(1-C)*A,this.estimate}constructor(g={}){this.estimate=0,this.errorEstimate=1,this.processNoise=.1,this.measurementNoise=1,this.measurementNoise=g.measurementNoise||1,this.processNoise=g.processNoise||.1,this.errorEstimate=g.errorEstimate||1}};var IL=l(TC(),1),AL=l(yA(),1),CL=l(SA(),1),tL=l(DA(),1),eL=l(wA(),1),iL=l(BA(),1),nL=l(MA(),1),rL=l(vA(),1),oL=l(PA(),1),sL=l(_A(),1),aL=l(EA(),1),uL=l(bA(),1),lL=l(xA(),1),cL=l(KA(),1),hL=l(GA(),1),pL=l(W(),1),Gg=require("three");var lD=require("three/examples/jsm/utils/BufferGeometryUtils.js");function CY(t,g,I){g===void 0&&(g=!0),I===void 0&&(I=!1);let A=t.filter(n=>n.geometry.type==="polygon");if(!A.length)return null;let C=A.map(n=>{var r;let o=n.geometry.coords,s=te(o[0],o.slice(1)),a=new Gg.ExtrudeGeometry(s,{steps:1,bevelEnabled:!1,depth:n.height,curveSegments:4});(r=n).deltaHeight||(r.deltaHeight=0),a.translate(0,0,n.airHeight+n.deltaHeight);let u=a.attributes.position.count,c=new Float32Array(u).fill(n.height+n.airHeight+n.deltaHeight);if(a.setAttribute("maxZ",new Gg.BufferAttribute(c,1)),a.setAttribute("opacity",new Gg.BufferAttribute(new Float32Array(u).fill(n.fillOpacity),1)),I){let d=new Float32Array(u).fill(n.airHeight+n.deltaHeight);a.setAttribute("minZ",new Gg.BufferAttribute(d,1))}let h=new Gg.Color(n.fillColor).convertLinearToSRGB(),f=new Float32Array(u*3);for(let d=0;d<u;d++)f[d*3]=h.r,f[d*3+1]=h.g,f[d*3+2]=h.b;return a.setAttribute("color",new Gg.BufferAttribute(f,3)),a}),e=(0,lD.mergeGeometries)(C);C.forEach(n=>n.dispose());let i={geometry:e};return e.dispose(),g&&(i.lineGeometry=cD(A)||void 0),i}function cD(t){let{points:g,colors:I,opacities:A}=Fn(t);if(!g.length)return null;let C=new Gg.BufferGeometry().setFromPoints(g);return C.setAttribute("color",new Gg.BufferAttribute(new Float32Array(I),3)),C.setAttribute("opacity",new Gg.BufferAttribute(new Float32Array(A),1)),C}function Fn(t){let g=[],I=[],A=[];return t.filter(C=>C.strokeOpacity>0).map(C=>{let e=C.height+(C.deltaHeight||0)+C.airHeight,{coords:i}=C.geometry,{strokeColor:n,strokeOpacity:r}=C,o=new Gg.Color(n).convertLinearToSRGB();for(let s=0;s<i.length;s++){let a=i[s];for(let u=0;u<a.length;u++){let c=a[u],h=u+1===a.length?a[0]:a[u+1];g.push(new Gg.Vector3(c[0],c[1],e)),g.push(new Gg.Vector3(h[0],h[1],e)),I.push(o.r,o.g,o.b),I.push(o.r,o.g,o.b),A.push(r),A.push(r)}}}),{points:g,colors:I,opacities:A}}var q=require("three");var _Q=l(_(),1),EQ=l(OI(),1),bQ=l(YI(),1),xQ=l(jI(),1),KQ=l(RI(),1),GQ=l(NI(),1),TQ=l(WI(),1),OQ=l(FI(),1),YQ=l(W(),1),T2=require("three");var nV=l(_(),1),rV=l(W(),1),T=require("three");var mL=l(_(),1),pD=require("three/examples/jsm/lines/LineMaterial.js"),sg=require("three");function hD(t){return t.x+"-"+t.y+"-"+t.z}var R=class{static generateLineMaterialKey(g){let{color:I,opacity:A}=g;return I+"-"+A}static createLineMaterial(g){let{color:I,opacity:A,vertexColors:C}=g,e=this.generateLineMaterialKey({color:I,opacity:A,vertexColors:C});if(this.lineMaterialMap.has(e))return this.lineMaterialMap.get(e);let i=new sg.LineBasicMaterial({color:new sg.Color(I).convertLinearToSRGB(),transparent:!0,opacity:A,vertexColors:C!=null?C:!1});return this.lineMaterialMap.set(e,i),i}static createMeshStandardMaterial(g){let{color:I,opacity:A}=g,C=I+"-"+A;if(this.meshStandardMaterialMap.has(C))return this.meshStandardMaterialMap.get(C);let e=new sg.MeshStandardMaterial({color:new sg.Color(I).convertLinearToSRGB(),roughness:1,transparent:!0,opacity:A,depthWrite:!0});return this.meshStandardMaterialMap.set(C,e),e}static createMeshBasicMaterial(g){let{color:I,opacity:A,vertexColors:C}=g,e=I+"-"+A+"-"+C;if(this.meshBasicMaterialMap.has(e))return this.meshBasicMaterialMap.get(e);let i=new sg.MeshBasicMaterial({color:I,transparent:!0,opacity:A,depthWrite:!0,vertexColors:C!=null?C:!1});return this.meshBasicMaterialMap.set(e,i),i}static createShaderMaterial(g){let{gradualColor:I,center:A,maxValue:C,opacity:e,direction:i,max:n,min:r}=g,o=I.toString()+"-"+hD(A)+"-"+C+"-"+e+"-"+hD(i);if(this.shaderMaterialMap.has(o))return this.shaderMaterialMap.get(o);let s=`
4
+ \v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`});var hd=p((EZ,cd)=>{"use strict";var m6=F(),y6=fC(),S6=eI(),Es=Ps(),ld=m6("".replace),D6=RegExp("^["+Es+"]+"),w6=RegExp("(^|[^"+Es+"])["+Es+"]+$"),_s=function(t){return function(g){var I=S6(y6(g));return t&1&&(I=ld(I,D6,"")),t&2&&(I=ld(I,w6,"$1")),I}};cd.exports={start:_s(1),end:_s(2),trim:_s(3)}});var md=p((bZ,dd)=>{"use strict";var B6=Lt().PROPER,M6=H(),pd=Ps(),fd="\u200B\x85\u180E";dd.exports=function(t){return M6(function(){return!!pd[t]()||fd[t]()!==fd||B6&&pd[t].name!==t})}});var rn=p(()=>{"use strict";var v6=V(),P6=hd().trim,_6=md();v6({target:"String",proto:!0,forced:_6("trim")},{trim:function(){return P6(this)}})});var Gs=p((QZ,Sd)=>{"use strict";var yd=LC(),K6=TypeError;Sd.exports=function(t,g){if(!delete t[g])throw new K6("Cannot delete property "+yd(g)+" of "+yd(t))}});var sn=p((qZ,wd)=>{"use strict";var Dd=Ae(),G6=Math.floor,Ts=function(t,g){var I=t.length;if(I<8)for(var A=1,C,e;A<I;){for(e=A,C=t[A];e&&g(t[e-1],C)>0;)t[e]=t[--e];e!==A++&&(t[e]=C)}else for(var i=G6(I/2),n=Ts(Dd(t,0,i),g),r=Ts(Dd(t,i),g),o=n.length,s=r.length,a=0,u=0;a<o||u<s;)t[a+u]=a<o&&u<s?g(n[a],r[u])<=0?n[a++]:r[u++]:a<o?n[a++]:r[u++];return t};wd.exports=Ts});var Md=p(($Z,Bd)=>{"use strict";var T6=H();Bd.exports=function(t,g){var I=[][t];return!!I&&T6(function(){I.call(null,g||function(){return 1},1)})}});var Os=p((gk,Pd)=>{"use strict";var O6=HC(),vd=O6.match(/firefox\/(\d+)/i);Pd.exports=!!vd&&+vd[1]});var Ys=p((Ik,_d)=>{"use strict";var Y6=HC();_d.exports=/MSIE|Trident/.test(Y6)});var js=p((Ak,bd)=>{"use strict";var j6=HC(),Ed=j6.match(/AppleWebKit\/(\d+)\./);bd.exports=!!Ed&&+Ed[1]});var PC=p(()=>{"use strict";var R6=V(),jd=F(),N6=JI(),W6=Zg(),xd=bg(),F6=Gs(),Kd=eI(),Rs=H(),Z6=sn(),k6=Md(),Gd=Os(),H6=Ys(),Td=Zt(),Od=js(),JA=[],Yd=jd(JA.sort),L6=jd(JA.push),U6=Rs(function(){JA.sort(void 0)}),X6=Rs(function(){JA.sort(null)}),V6=k6("sort"),Rd=!Rs(function(){if(Td)return Td<70;if(!(Gd&&Gd>3)){if(H6)return!0;if(Od)return Od<603;var t="",g,I,A,C;for(g=65;g<76;g++){switch(I=String.fromCharCode(g),g){case 66:case 69:case 70:case 72:A=3;break;case 68:case 71:A=4;break;default:A=2}for(C=0;C<47;C++)JA.push({k:I+C,v:A})}for(JA.sort(function(e,i){return i.v-e.v}),C=0;C<JA.length;C++)I=JA[C].k.charAt(0),t.charAt(t.length-1)!==I&&(t+=I);return t!=="DGBEFHACIJK"}}),z6=U6||!X6||!V6||!Rd,J6=function(t){return function(g,I){return I===void 0?-1:g===void 0?1:t!==void 0?+t(g,I)||0:Kd(g)>Kd(I)?1:-1}};R6({target:"Array",proto:!0,forced:z6},{sort:function(g){g!==void 0&&N6(g);var I=W6(this);if(Rd)return g===void 0?Yd(I):Yd(I,g);var A=[],C=xd(I),e,i;for(i=0;i<C;i++)i in I&&L6(A,I[i]);for(Z6(A,J6(g)),e=xd(A),i=0;i<e;)I[i]=A[i++];for(;i<C;)F6(I,i++);return I}})});var Wd=p((rk,Nd)=>{Nd.exports=function(g,I){return g[0]=I[0],g[1]=I[1],g}});var kd=p((ok,Zd)=>{var Fd=Wd();Zd.exports=function(t,g){Array.isArray(g)||(g=[]),t.length>0&&g.push(Fd([0,0],t[0]));for(var I=0;I<t.length-1;I++){var A=t[I],C=t[I+1],e=A[0],i=A[1],n=C[0],r=C[1],o=[.75*e+.25*n,.75*i+.25*r],s=[.25*e+.75*n,.25*i+.75*r];g.push(o),g.push(s)}return t.length>1&&g.push(Fd([0,0],t[t.length-1])),g}});var Vd=p((ck,Xd)=>{var Zs=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((g,I)=>g.priority-I.priority)}set(g,I){let A=Number(I);if(isNaN(A))throw new TypeError('"priority" must be a number');return this.keys.has(g)?this.queue.map(C=>(C.key===g&&Object.assign(C,{priority:A}),C)):(this.keys.add(g),this.queue.push({key:g,priority:A})),this.sort(),this.queue.length}next(){let g=this.queue.shift();return this.keys.delete(g.key),g}isEmpty(){return this.queue.length===0}has(g){return this.keys.has(g)}get(g){return this.queue.find(I=>I.key===g)}};Xd.exports=Zs});var Qd=p((hk,Jd)=>{function zd(t,g){let I=new Map;for(let[A,C]of t)A!==g&&C instanceof Map?I.set(A,zd(C,g)):A!==g&&I.set(A,C);return I}Jd.exports=zd});var gm=p((pk,$d)=>{function IG(t){let g=Number(t);return!(isNaN(g)||g<=0)}function qd(t){let g=new Map;return Object.keys(t).forEach(A=>{let C=t[A];if(C!==null&&typeof C=="object"&&!Array.isArray(C))return g.set(A,qd(C));if(!IG(C))throw new Error(`Could not add node at key "${A}", make sure it's a valid node`,C);return g.set(A,Number(C))}),g}$d.exports=qd});var Cm=p((fk,Am)=>{function Im(t){if(!(t instanceof Map))throw new Error(`Invalid graph: Expected Map instead found ${typeof t}`);t.forEach((g,I)=>{if(typeof g=="object"&&g instanceof Map){Im(g);return}if(typeof g!="number"||g<=0)throw new Error(`Values must be numbers greater than 0. Found value ${g} at ${I}`)})}Am.exports=Im});var Hs=p((dk,im)=>{var AG=Vd(),CG=Qd(),tm=gm(),em=Cm(),ks=class{constructor(g){g instanceof Map?(em(g),this.graph=g):g?this.graph=tm(g):this.graph=new Map}addNode(g,I){let A;return I instanceof Map?(em(I),A=I):A=tm(I),this.graph.set(g,A),this}addVertex(g,I){return this.addNode(g,I)}removeNode(g){return this.graph=CG(this.graph,g),this}path(g,I,A={}){if(!this.graph.size)return A.cost?{path:null,cost:0}:null;let C=new Set,e=new AG,i=new Map,n=[],r=0,o=[];if(A.avoid&&(o=[].concat(A.avoid)),o.includes(g))throw new Error(`Starting node (${g}) cannot be avoided`);if(o.includes(I))throw new Error(`Ending node (${I}) cannot be avoided`);for(e.set(g,0);!e.isEmpty();){let s=e.next();if(s.key===I){r=s.priority;let u=s.key;for(;i.has(u);)n.push(u),u=i.get(u);break}C.add(s.key),(this.graph.get(s.key)||new Map).forEach((u,c)=>{if(C.has(c)||o.includes(c))return null;if(!e.has(c))return i.set(c,s.key),e.set(c,s.priority+u);let h=e.get(c).priority,f=s.priority+u;return f<h?(i.set(c,s.key),e.set(c,f)):null})}return n.length?(A.trim?n.shift():n=n.concat([g]),A.reverse||(n=n.reverse()),A.cost?{path:n,cost:r}:n):A.cost?{path:null,cost:0}:null}shortestPath(...g){return this.path(...g)}};im.exports=ks});var ln=p((Mk,nm)=>{"use strict";var tG=sA(),eG=F();nm.exports=function(t){if(tG(t)==="Function")return eG(t)}});var QA=p((vk,om)=>{"use strict";var rm=ln(),iG=JI(),nG=Nt(),rG=rm(rm.bind);om.exports=function(t,g){return iG(t),g===void 0?t:nG?rG(t,g):function(){return t.apply(g,arguments)}}});var um=p((Pk,am)=>{"use strict";var oG=zt(),sG=bg(),aG=Ni(),uG=QA(),sm=function(t,g,I,A,C,e,i,n){for(var r=C,o=0,s=i?uG(i,n):!1,a,u;o<A;)o in I&&(a=s?s(I[o],o,g):I[o],e>0&&oG(a)?(u=sG(a),r=sm(t,g,a,u,r,e-1)-1):(aG(r+1),t[r]=a),r++),o++;return r};am.exports=sm});var cn=p((_k,fm)=>{"use strict";var lG=F(),cG=H(),lm=ig(),hG=uA(),pG=xI(),fG=wo(),cm=function(){},hm=pG("Reflect","construct"),Us=/^\s*(?:class|function)\b/,dG=lG(Us.exec),mG=!Us.test(cm),ae=function(g){if(!lm(g))return!1;try{return hm(cm,[],g),!0}catch(I){return!1}},pm=function(g){if(!lm(g))return!1;switch(hG(g)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return mG||!!dG(Us,fG(g))}catch(I){return!0}};pm.sham=!0;fm.exports=!hm||cG(function(){var t;return ae(ae.call)||!ae(Object)||!ae(function(){t=!0})||t})?pm:ae});var Sm=p((Ek,ym)=>{"use strict";var dm=zt(),yG=cn(),SG=Mg(),DG=dg(),wG=DG("species"),mm=Array;ym.exports=function(t){var g;return dm(t)&&(g=t.constructor,yG(g)&&(g===mm||dm(g.prototype))?g=void 0:SG(g)&&(g=g[wG],g===null&&(g=void 0))),g===void 0?mm:g}});var Xs=p((bk,Dm)=>{"use strict";var BG=Sm();Dm.exports=function(t,g){return new(BG(t))(g===0?0:g)}});var hn=p(()=>{"use strict";var MG=V(),vG=um(),PG=Zg(),_G=bg(),EG=tI(),bG=Xs();MG({target:"Array",proto:!0},{flat:function(){var g=arguments.length?arguments[0]:void 0,I=PG(this),A=_G(I),C=bG(I,0);return C.length=vG(C,I,I,A,0,g===void 0?1:EG(g)),C}})});var pn=p(()=>{"use strict";var xG=Jt();xG("flat")});var Gm=p((jH,Km)=>{"use strict";var OG=dg(),bm=OG("iterator"),xm=!1;try{Em=0,Js={next:function(){return{done:!!Em++}},return:function(){xm=!0}},Js[bm]=function(){return this},Array.from(Js,function(){throw 2})}catch(t){}var Em,Js;Km.exports=function(t,g){try{if(!g&&!xm)return!1}catch(C){return!1}var I=!1;try{var A={};A[bm]=function(){return{next:function(){return{done:I=!0}}}},t(A)}catch(C){}return I}});var dn=p((RH,Tm)=>{"use strict";Tm.exports=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"});var pA=p((NH,Ym)=>{"use strict";var Om=Eo(),YG=pI();Ym.exports=function(t,g,I){return I.get&&Om(I.get,g,{getter:!0}),I.set&&Om(I.set,g,{setter:!0}),YG.f(t,g,I)}});var qg=p((WH,Um)=>{"use strict";var jG=dn(),ga=eg(),Lg=Z(),Wm=ig(),Sn=Mg(),gC=kg(),Ia=uA(),RG=LC(),NG=fI(),Qs=dI(),WG=pA(),FG=kC(),Dn=Qt(),At=SC(),ZG=dg(),kG=Mi(),Fm=QI(),Zm=Fm.enforce,HG=Fm.get,mn=Lg.Int8Array,qs=mn&&mn.prototype,jm=Lg.Uint8ClampedArray,Rm=jm&&jm.prototype,CA=mn&&Dn(mn),kI=qs&&Dn(qs),LG=Object.prototype,Aa=Lg.TypeError,Nm=ZG("toStringTag"),$s=kG("TYPED_ARRAY_TAG"),yn="TypedArrayConstructor",fA=jG&&!!At&&Ia(Lg.opera)!=="Opera",km=!1,Qg,$A,It,dA={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Ca={BigInt64Array:8,BigUint64Array:8},UG=function(g){if(!Sn(g))return!1;var I=Ia(g);return I==="DataView"||gC(dA,I)||gC(Ca,I)},Hm=function(t){var g=Dn(t);if(Sn(g)){var I=HG(g);return I&&gC(I,yn)?I[yn]:Hm(g)}},Lm=function(t){if(!Sn(t))return!1;var g=Ia(t);return gC(dA,g)||gC(Ca,g)},XG=function(t){if(Lm(t))return t;throw new Aa("Target is not a typed array")},VG=function(t){if(Wm(t)&&(!At||FG(CA,t)))return t;throw new Aa(RG(t)+" is not a typed array constructor")},zG=function(t,g,I,A){if(ga){if(I)for(var C in dA){var e=Lg[C];if(e&&gC(e.prototype,t))try{delete e.prototype[t]}catch(i){try{e.prototype[t]=g}catch(n){}}}(!kI[t]||I)&&Qs(kI,t,I?g:fA&&qs[t]||g,A)}},JG=function(t,g,I){var A,C;if(ga){if(At){if(I){for(A in dA)if(C=Lg[A],C&&gC(C,t))try{delete C[t]}catch(e){}}if(!CA[t]||I)try{return Qs(CA,t,I?g:fA&&CA[t]||g)}catch(e){}else return}for(A in dA)C=Lg[A],C&&(!C[t]||I)&&Qs(C,t,g)}};for(Qg in dA)$A=Lg[Qg],It=$A&&$A.prototype,It?Zm(It)[yn]=$A:fA=!1;for(Qg in Ca)$A=Lg[Qg],It=$A&&$A.prototype,It&&(Zm(It)[yn]=$A);if((!fA||!Wm(CA)||CA===Function.prototype)&&(CA=function(){throw new Aa("Incorrect invocation")},fA))for(Qg in dA)Lg[Qg]&&At(Lg[Qg],CA);if((!fA||!kI||kI===LG)&&(kI=CA.prototype,fA))for(Qg in dA)Lg[Qg]&&At(Lg[Qg].prototype,kI);fA&&Dn(Rm)!==kI&&At(Rm,kI);if(ga&&!gC(kI,Nm)){km=!0,WG(kI,Nm,{configurable:!0,get:function(){return Sn(this)?this[$s]:void 0}});for(Qg in dA)Lg[Qg]&&NG(Lg[Qg],$s,Qg)}Um.exports={NATIVE_ARRAY_BUFFER_VIEWS:fA,TYPED_ARRAY_TAG:km&&$s,aTypedArray:XG,aTypedArrayConstructor:VG,exportTypedArrayMethod:zG,exportTypedArrayStaticMethod:JG,getTypedArrayConstructor:Hm,isView:UG,isTypedArray:Lm,TypedArray:CA,TypedArrayPrototype:kI}});var ea=p((FH,Vm)=>{"use strict";var Xm=Z(),ta=H(),QG=Gm(),qG=qg().NATIVE_ARRAY_BUFFER_VIEWS,$G=Xm.ArrayBuffer,KC=Xm.Int8Array;Vm.exports=!qG||!ta(function(){KC(1)})||!ta(function(){new KC(-1)})||!QG(function(t){new KC,new KC(null),new KC(1.5),new KC(t)},!0)||ta(function(){return new KC(new $G(2),1,void 0).length!==1})});var ia=p((ZH,zm)=>{"use strict";var g3=dI();zm.exports=function(t,g,I){for(var A in g)g3(t,A,g[A],I);return t}});var pe=p((kH,Jm)=>{"use strict";var I3=kC(),A3=TypeError;Jm.exports=function(t,g){if(I3(g,t))return t;throw new A3("Incorrect invocation")}});var wn=p((HH,Qm)=>{"use strict";var C3=tI(),t3=mC(),e3=RangeError;Qm.exports=function(t){if(t===void 0)return 0;var g=C3(t),I=t3(g);if(g!==I)throw new e3("Wrong length or index");return I}});var $m=p((LH,qm)=>{"use strict";qm.exports=Math.sign||function(g){var I=+g;return I===0||I!==I?I:I<0?-1:1}});var Ay=p((UH,Iy)=>{"use strict";var i3=2220446049250313e-31,gy=1/i3;Iy.exports=function(t){return t+gy-gy}});var ty=p((XH,Cy)=>{"use strict";var n3=$m(),r3=Ay(),o3=Math.abs,s3=2220446049250313e-31;Cy.exports=function(t,g,I,A){var C=+t,e=o3(C),i=n3(C);if(e<A)return i*r3(e/A/g)*A*g;var n=(1+g/s3)*e,r=n-(n-e);return r>I||r!==r?i*(1/0):i*r}});var iy=p((VH,ey)=>{"use strict";var a3=ty(),u3=11920928955078125e-23,l3=34028234663852886e22,c3=11754943508222875e-54;ey.exports=Math.fround||function(g){return a3(g,u3,l3,c3)}});var ry=p((zH,ny)=>{"use strict";var h3=Array,p3=Math.abs,mA=Math.pow,f3=Math.floor,d3=Math.log,m3=Math.LN2,y3=function(t,g,I){var A=h3(I),C=I*8-g-1,e=(1<<C)-1,i=e>>1,n=g===23?mA(2,-24)-mA(2,-77):0,r=t<0||t===0&&1/t<0?1:0,o=0,s,a,u;for(t=p3(t),t!==t||t===1/0?(a=t!==t?1:0,s=e):(s=f3(d3(t)/m3),u=mA(2,-s),t*u<1&&(s--,u*=2),s+i>=1?t+=n/u:t+=n*mA(2,1-i),t*u>=2&&(s++,u/=2),s+i>=e?(a=0,s=e):s+i>=1?(a=(t*u-1)*mA(2,g),s+=i):(a=t*mA(2,i-1)*mA(2,g),s=0));g>=8;)A[o++]=a&255,a/=256,g-=8;for(s=s<<g|a,C+=g;C>0;)A[o++]=s&255,s/=256,C-=8;return A[o-1]|=r*128,A},S3=function(t,g){var I=t.length,A=I*8-g-1,C=(1<<A)-1,e=C>>1,i=A-7,n=I-1,r=t[n--],o=r&127,s;for(r>>=7;i>0;)o=o*256+t[n--],i-=8;for(s=o&(1<<-i)-1,o>>=-i,i+=g;i>0;)s=s*256+t[n--],i-=8;if(o===0)o=1-e;else{if(o===C)return s?NaN:r?-1/0:1/0;s+=mA(2,g),o-=e}return(r?-1:1)*s*mA(2,o-g)};ny.exports={pack:y3,unpack:S3}});var na=p((JH,sy)=>{"use strict";var D3=Zg(),oy=Xt(),w3=bg();sy.exports=function(g){for(var I=D3(this),A=w3(I),C=arguments.length,e=oy(C>1?arguments[1]:void 0,A),i=C>2?arguments[2]:void 0,n=i===void 0?A:oy(i,A);n>e;)I[e++]=g;return I}});var bn=p((QH,Py)=>{"use strict";var _n=Z(),ua=F(),ra=eg(),B3=dn(),Dy=Lt(),M3=fI(),v3=pA(),ay=ia(),oa=H(),Bn=pe(),P3=tI(),_3=mC(),vn=wn(),E3=iy(),wy=ry(),b3=Qt(),uy=SC(),x3=na(),K3=Ae(),G3=An(),T3=ji(),By=ZA(),la=QI(),O3=Dy.PROPER,ly=Dy.CONFIGURABLE,tt="ArrayBuffer",En="DataView",et="prototype",Y3="Wrong length",My="Wrong index",cy=la.getterFor(tt),de=la.getterFor(En),hy=la.set,HI=_n[tt],oI=HI,Ct=oI&&oI[et],tA=_n[En],GC=tA&&tA[et],py=Object.prototype,j3=_n.Array,Pn=_n.RangeError,R3=ua(x3),N3=ua([].reverse),vy=wy.pack,fy=wy.unpack,dy=function(t){return[t&255]},my=function(t){return[t&255,t>>8&255]},yy=function(t){return[t&255,t>>8&255,t>>16&255,t>>24&255]},Sy=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},W3=function(t){return vy(E3(t),23,4)},F3=function(t){return vy(t,52,8)},Mn=function(t,g,I){v3(t[et],g,{configurable:!0,get:function(){return I(this)[g]}})},IC=function(t,g,I,A){var C=de(t),e=vn(I),i=!!A;if(e+g>C.byteLength)throw new Pn(My);var n=C.bytes,r=e+C.byteOffset,o=K3(n,r,r+g);return i?o:N3(o)},AC=function(t,g,I,A,C,e){var i=de(t),n=vn(I),r=A(+C),o=!!e;if(n+g>i.byteLength)throw new Pn(My);for(var s=i.bytes,a=n+i.byteOffset,u=0;u<g;u++)s[a+u]=r[o?u:g-u-1]};B3?(sa=O3&&HI.name!==tt,!oa(function(){HI(1)})||!oa(function(){new HI(-1)})||oa(function(){return new HI,new HI(1.5),new HI(NaN),HI.length!==1||sa&&!ly})?(oI=function(g){return Bn(this,Ct),G3(new HI(vn(g)),this,oI)},oI[et]=Ct,Ct.constructor=oI,T3(oI,HI)):sa&&ly&&M3(HI,"name",tt),uy&&b3(GC)!==py&&uy(GC,py),fe=new tA(new oI(2)),aa=ua(GC.setInt8),fe.setInt8(0,2147483648),fe.setInt8(1,2147483649),(fe.getInt8(0)||!fe.getInt8(1))&&ay(GC,{setInt8:function(g,I){aa(this,g,I<<24>>24)},setUint8:function(g,I){aa(this,g,I<<24>>24)}},{unsafe:!0})):(oI=function(g){Bn(this,Ct);var I=vn(g);hy(this,{type:tt,bytes:R3(j3(I),0),byteLength:I}),ra||(this.byteLength=I,this.detached=!1)},Ct=oI[et],tA=function(g,I,A){Bn(this,GC),Bn(g,Ct);var C=cy(g),e=C.byteLength,i=P3(I);if(i<0||i>e)throw new Pn("Wrong offset");if(A=A===void 0?e-i:_3(A),i+A>e)throw new Pn(Y3);hy(this,{type:En,buffer:g,byteLength:A,byteOffset:i,bytes:C.bytes}),ra||(this.buffer=g,this.byteLength=A,this.byteOffset=i)},GC=tA[et],ra&&(Mn(oI,"byteLength",cy),Mn(tA,"buffer",de),Mn(tA,"byteLength",de),Mn(tA,"byteOffset",de)),ay(GC,{getInt8:function(g){return IC(this,1,g)[0]<<24>>24},getUint8:function(g){return IC(this,1,g)[0]},getInt16:function(g){var I=IC(this,2,g,arguments.length>1?arguments[1]:!1);return(I[1]<<8|I[0])<<16>>16},getUint16:function(g){var I=IC(this,2,g,arguments.length>1?arguments[1]:!1);return I[1]<<8|I[0]},getInt32:function(g){return Sy(IC(this,4,g,arguments.length>1?arguments[1]:!1))},getUint32:function(g){return Sy(IC(this,4,g,arguments.length>1?arguments[1]:!1))>>>0},getFloat32:function(g){return fy(IC(this,4,g,arguments.length>1?arguments[1]:!1),23)},getFloat64:function(g){return fy(IC(this,8,g,arguments.length>1?arguments[1]:!1),52)},setInt8:function(g,I){AC(this,1,g,dy,I)},setUint8:function(g,I){AC(this,1,g,dy,I)},setInt16:function(g,I){AC(this,2,g,my,I,arguments.length>2?arguments[2]:!1)},setUint16:function(g,I){AC(this,2,g,my,I,arguments.length>2?arguments[2]:!1)},setInt32:function(g,I){AC(this,4,g,yy,I,arguments.length>2?arguments[2]:!1)},setUint32:function(g,I){AC(this,4,g,yy,I,arguments.length>2?arguments[2]:!1)},setFloat32:function(g,I){AC(this,4,g,W3,I,arguments.length>2?arguments[2]:!1)},setFloat64:function(g,I){AC(this,8,g,F3,I,arguments.length>2?arguments[2]:!1)}}));var sa,fe,aa;By(oI,tt);By(tA,En);Py.exports={ArrayBuffer:oI,DataView:tA}});var Ey=p((qH,_y)=>{"use strict";var Z3=Mg(),k3=Math.floor;_y.exports=Number.isInteger||function(g){return!Z3(g)&&isFinite(g)&&k3(g)===g}});var xy=p(($H,by)=>{"use strict";var H3=tI(),L3=RangeError;by.exports=function(t){var g=H3(t);if(g<0)throw new L3("The argument can't be less than 0");return g}});var ca=p((g9,Ky)=>{"use strict";var U3=xy(),X3=RangeError;Ky.exports=function(t,g){var I=U3(t);if(I%g)throw new X3("Wrong offset");return I}});var Ty=p((I9,Gy)=>{"use strict";var V3=Math.round;Gy.exports=function(t){var g=V3(t);return g<0?0:g>255?255:g&255}});var ha=p((A9,Oy)=>{"use strict";var z3=cn(),J3=LC(),Q3=TypeError;Oy.exports=function(t){if(z3(t))return t;throw new Q3(J3(t)+" is not a constructor")}});var me=p((C9,jy)=>{"use strict";var q3=uA(),Yy=Ht(),$3=Ft(),gT=XC(),IT=dg(),AT=IT("iterator");jy.exports=function(t){if(!$3(t))return Yy(t,AT)||Yy(t,"@@iterator")||gT[q3(t)]}});var xn=p((t9,Ry)=>{"use strict";var CT=og(),tT=JI(),eT=Ng(),iT=LC(),nT=me(),rT=TypeError;Ry.exports=function(t,g){var I=arguments.length<2?nT(t):g;if(tT(I))return eT(CT(I,t));throw new rT(iT(t)+" is not iterable")}});var pa=p((e9,Ny)=>{"use strict";var oT=dg(),sT=XC(),aT=oT("iterator"),uT=Array.prototype;Ny.exports=function(t){return t!==void 0&&(sT.Array===t||uT[aT]===t)}});var fa=p((i9,Wy)=>{"use strict";var lT=uA();Wy.exports=function(t){var g=lT(t);return g==="BigInt64Array"||g==="BigUint64Array"}});var Kn=p((n9,Fy)=>{"use strict";var cT=ao(),hT=TypeError;Fy.exports=function(t){var g=cT(t,"number");if(typeof g=="number")throw new hT("Can't convert number to bigint");return BigInt(g)}});var da=p((r9,Zy)=>{"use strict";var pT=QA(),fT=og(),dT=ha(),mT=Zg(),yT=bg(),ST=xn(),DT=me(),wT=pa(),BT=fa(),MT=qg().aTypedArrayConstructor,vT=Kn();Zy.exports=function(g){var I=dT(this),A=mT(g),C=arguments.length,e=C>1?arguments[1]:void 0,i=e!==void 0,n=DT(A),r,o,s,a,u,c,h,f;if(n&&!wT(n))for(h=ST(A,n),f=h.next,A=[];!(c=fT(f,h)).done;)A.push(c.value);for(i&&C>2&&(e=pT(e,arguments[2])),o=yT(A),s=new(MT(I))(o),a=BT(s),r=0;o>r;r++)u=i?e(A[r],r):A[r],s[r]=a?vT(u):+u;return s}});var Ly=p((o9,Hy)=>{"use strict";var PT=QA(),_T=F(),ET=Wt(),bT=Zg(),xT=bg(),KT=Xs(),ky=_T([].push),CC=function(t){var g=t===1,I=t===2,A=t===3,C=t===4,e=t===6,i=t===7,n=t===5||e;return function(r,o,s,a){for(var u=bT(r),c=ET(u),h=xT(c),f=PT(o,s),d=0,S=a||KT,w=g?S(r,h):I||i?S(r,0):void 0,M,K;h>d;d++)if((n||d in c)&&(M=c[d],K=f(M,d,u),t))if(g)w[d]=K;else if(K)switch(t){case 3:return!0;case 5:return M;case 6:return d;case 2:ky(w,M)}else switch(t){case 4:return!1;case 7:ky(w,M)}return e?-1:A||C?C:w}};Hy.exports={forEach:CC(0),map:CC(1),filter:CC(2),some:CC(3),every:CC(4),find:CC(5),findIndex:CC(6),filterReject:CC(7)}});var ma=p((s9,Xy)=>{"use strict";var GT=xI(),TT=pA(),OT=dg(),YT=eg(),Uy=OT("species");Xy.exports=function(t){var g=GT(t);YT&&g&&!g[Uy]&&TT(g,Uy,{configurable:!0,get:function(){return this}})}});var ya=p((a9,Vy)=>{"use strict";var jT=bg();Vy.exports=function(t,g,I){for(var A=0,C=arguments.length>2?I:jT(g),e=new t(C);C>A;)e[A]=g[A++];return e}});var tC=p((u9,Pa)=>{"use strict";var zy=V(),iS=Z(),Jy=og(),RT=eg(),NT=ea(),we=qg(),nS=bn(),Qy=pe(),WT=WA(),ye=fI(),FT=Ey(),ZT=mC(),qy=wn(),Sa=ca(),kT=Ty(),rS=vi(),Se=kg(),HT=uA(),Ba=Mg(),LT=kt(),UT=yC(),XT=kC(),Gn=SC(),VT=Ko().f,$y=da(),zT=Ly().forEach,JT=ma(),QT=pA(),oS=pI(),sS=_i(),gS=ya(),_a=QI(),qT=An(),Ma=_a.get,$T=_a.set,g1=_a.enforce,aS=oS.f,I1=sS.f,Da=iS.RangeError,uS=nS.ArrayBuffer,A1=uS.prototype,C1=nS.DataView,Tn=we.NATIVE_ARRAY_BUFFER_VIEWS,IS=we.TYPED_ARRAY_TAG,AS=we.TypedArray,De=we.TypedArrayPrototype,va=we.isTypedArray,On="BYTES_PER_ELEMENT",wa="Wrong length",Yn=function(t,g){QT(t,g,{configurable:!0,get:function(){return Ma(this)[g]}})},CS=function(t){var g;return XT(A1,t)||(g=HT(t))==="ArrayBuffer"||g==="SharedArrayBuffer"},lS=function(t,g){return va(t)&&!LT(g)&&g in t&&FT(+g)&&g>=0},tS=function(g,I){return I=rS(I),lS(g,I)?WT(2,g[I]):I1(g,I)},eS=function(g,I,A){return I=rS(I),lS(g,I)&&Ba(A)&&Se(A,"value")&&!Se(A,"get")&&!Se(A,"set")&&!A.configurable&&(!Se(A,"writable")||A.writable)&&(!Se(A,"enumerable")||A.enumerable)?(g[I]=A.value,g):aS(g,I,A)};RT?(Tn||(sS.f=tS,oS.f=eS,Yn(De,"buffer"),Yn(De,"byteOffset"),Yn(De,"byteLength"),Yn(De,"length")),zy({target:"Object",stat:!0,forced:!Tn},{getOwnPropertyDescriptor:tS,defineProperty:eS}),Pa.exports=function(t,g,I){var A=t.match(/\d+/)[0]/8,C=t+(I?"Clamped":"")+"Array",e="get"+t,i="set"+t,n=iS[C],r=n,o=r&&r.prototype,s={},a=function(f,d){var S=Ma(f);return S.view[e](d*A+S.byteOffset,!0)},u=function(f,d,S){var w=Ma(f);w.view[i](d*A+w.byteOffset,I?kT(S):S,!0)},c=function(f,d){aS(f,d,{get:function(){return a(this,d)},set:function(S){return u(this,d,S)},enumerable:!0})};Tn?NT&&(r=g(function(f,d,S,w){return Qy(f,o),qT(function(){return Ba(d)?CS(d)?w!==void 0?new n(d,Sa(S,A),w):S!==void 0?new n(d,Sa(S,A)):new n(d):va(d)?gS(r,d):Jy($y,r,d):new n(qy(d))}(),f,r)}),Gn&&Gn(r,AS),zT(VT(n),function(f){f in r||ye(r,f,n[f])}),r.prototype=o):(r=g(function(f,d,S,w){Qy(f,o);var M=0,K=0,O,N,v;if(!Ba(d))v=qy(d),N=v*A,O=new uS(N);else if(CS(d)){O=d,K=Sa(S,A);var Y=d.byteLength;if(w===void 0){if(Y%A)throw new Da(wa);if(N=Y-K,N<0)throw new Da(wa)}else if(N=ZT(w)*A,N+K>Y)throw new Da(wa);v=N/A}else return va(d)?gS(r,d):Jy($y,r,d);for($T(f,{buffer:O,byteOffset:K,byteLength:N,length:v,view:new C1(O)});M<v;)c(f,M++)}),Gn&&Gn(r,AS),o=r.prototype=UT(De)),o.constructor!==r&&ye(o,"constructor",r),g1(o).TypedArrayConstructor=r,IS&&ye(o,IS,C);var h=r!==n;s[C]=r,zy({global:!0,constructor:!0,forced:h,sham:!Tn},s),On in r||ye(r,On,A),On in o||ye(o,On,A),JT(C)}):Pa.exports=function(){}});var TC=p(()=>{"use strict";var t1=tC();t1("Float32",function(t){return function(I,A,C){return t(this,I,A,C)}})});var yA=p(()=>{"use strict";var cS=qg(),e1=bg(),i1=tI(),n1=cS.aTypedArray,r1=cS.exportTypedArrayMethod;r1("at",function(g){var I=n1(this),A=e1(I),C=i1(g),e=C>=0?C:A+C;return e<0||e>=A?void 0:I[e]})});var SA=p(()=>{"use strict";var hS=qg(),o1=na(),s1=Kn(),a1=uA(),u1=og(),l1=F(),c1=H(),h1=hS.aTypedArray,p1=hS.exportTypedArrayMethod,f1=l1("".slice),d1=c1(function(){var t=0;return new Int8Array(2).fill({valueOf:function(){return t++}}),t!==1});p1("fill",function(g){var I=arguments.length;h1(this);var A=f1(a1(this),0,3)==="Big"?s1(g):+g;return u1(o1,this,A,I>1?arguments[1]:void 0,I>2?arguments[2]:void 0)},d1)});var Be=p((m9,fS)=>{"use strict";var m1=QA(),y1=Wt(),S1=Zg(),D1=bg(),pS=function(t){var g=t===1;return function(I,A,C){for(var e=S1(I),i=y1(e),n=D1(i),r=m1(A,C),o,s;n-- >0;)if(o=i[n],s=r(o,n,e),s)switch(t){case 0:return o;case 1:return n}return g?-1:void 0}};fS.exports={findLast:pS(0),findLastIndex:pS(1)}});var DA=p(()=>{"use strict";var dS=qg(),w1=Be().findLast,B1=dS.aTypedArray,M1=dS.exportTypedArrayMethod;M1("findLast",function(g){return w1(B1(this),g,arguments.length>1?arguments[1]:void 0)})});var wA=p(()=>{"use strict";var mS=qg(),v1=Be().findLastIndex,P1=mS.aTypedArray,_1=mS.exportTypedArrayMethod;_1("findLastIndex",function(g){return v1(P1(this),g,arguments.length>1?arguments[1]:void 0)})});var BA=p(()=>{"use strict";var SS=Z(),DS=og(),xa=qg(),E1=bg(),b1=ca(),x1=Zg(),wS=H(),K1=SS.RangeError,Ea=SS.Int8Array,yS=Ea&&Ea.prototype,BS=yS&&yS.set,G1=xa.aTypedArray,T1=xa.exportTypedArrayMethod,ba=!wS(function(){var t=new Uint8ClampedArray(2);return DS(BS,t,{length:1,0:3},1),t[1]!==3}),O1=ba&&xa.NATIVE_ARRAY_BUFFER_VIEWS&&wS(function(){var t=new Ea(2);return t.set(1),t.set("2",1),t[0]!==0||t[1]!==2});T1("set",function(g){G1(this);var I=b1(arguments.length>1?arguments[1]:void 0,1),A=x1(g);if(ba)return DS(BS,this,A,I);var C=this.length,e=E1(A),i=0;if(e+I>C)throw new K1("Wrong length");for(;i<e;)this[I+i]=A[i++]},!ba||O1)});var MA=p(()=>{"use strict";var Y1=Z(),j1=ln(),Ka=H(),R1=JI(),N1=sn(),ES=qg(),MS=Os(),W1=Ys(),vS=Zt(),PS=js(),F1=ES.aTypedArray,Z1=ES.exportTypedArrayMethod,Me=Y1.Uint16Array,it=Me&&j1(Me.prototype.sort),k1=!!it&&!(Ka(function(){it(new Me(2),null)})&&Ka(function(){it(new Me(2),{})})),_S=!!it&&!Ka(function(){if(vS)return vS<74;if(MS)return MS<67;if(W1)return!0;if(PS)return PS<602;var t=new Me(516),g=Array(516),I,A;for(I=0;I<516;I++)A=I%4,t[I]=515-I,g[I]=I-2*A+3;for(it(t,function(C,e){return(C/4|0)-(e/4|0)}),I=0;I<516;I++)if(t[I]!==g[I])return!0}),H1=function(t){return function(g,I){return t!==void 0?+t(g,I)||0:I!==I?-1:g!==g?1:g===0&&I===0?1/g>0&&1/I<0?1:-1:g>I}};Z1("sort",function(g){return g!==void 0&&R1(g),_S?it(this,g):N1(F1(this),H1(g))},!_S||k1)});var xS=p((_9,bS)=>{"use strict";var L1=bg();bS.exports=function(t,g){for(var I=L1(t),A=new g(I),C=0;C<I;C++)A[C]=t[I-C-1];return A}});var vA=p(()=>{"use strict";var U1=xS(),Ga=qg(),X1=Ga.aTypedArray,V1=Ga.exportTypedArrayMethod,z1=Ga.getTypedArrayConstructor;V1("toReversed",function(){return U1(X1(this),z1(this))})});var PA=p(()=>{"use strict";var jn=qg(),J1=F(),Q1=JI(),q1=ya(),$1=jn.aTypedArray,gO=jn.getTypedArrayConstructor,IO=jn.exportTypedArrayMethod,AO=J1(jn.TypedArrayPrototype.sort);IO("toSorted",function(g){g!==void 0&&Q1(g);var I=$1(this),A=q1(gO(I),I);return AO(A,g)})});var GS=p((G9,KS)=>{"use strict";var CO=bg(),tO=tI(),eO=RangeError;KS.exports=function(t,g,I,A){var C=CO(t),e=tO(I),i=e<0?C+e:e;if(i>=C||i<0)throw new eO("Incorrect index");for(var n=new g(C),r=0;r<C;r++)n[r]=r===i?A:t[r];return n}});var _A=p(()=>{"use strict";var iO=GS(),Ta=qg(),nO=fa(),rO=tI(),oO=Kn(),sO=Ta.aTypedArray,aO=Ta.getTypedArrayConstructor,uO=Ta.exportTypedArrayMethod,lO=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(t){return t===8}}();uO("with",function(t,g){var I=sO(this),A=rO(t),C=nO(I)?oO(g):+g;return iO(I,aO(I),A,C)},!lO)});var EA=p(()=>{"use strict";var cO=V(),hO=Z(),pO=bn(),fO=ma(),Oa="ArrayBuffer",TS=pO[Oa],dO=hO[Oa];cO({global:!0,constructor:!0,forced:dO!==TS},{ArrayBuffer:TS});fO(Oa)});var bA=p(()=>{"use strict";var mO=V(),ja=ln(),yO=H(),RS=bn(),OS=Ng(),YS=Xt(),SO=mC(),Ra=RS.ArrayBuffer,Ya=RS.DataView,NS=Ya.prototype,jS=ja(Ra.prototype.slice),DO=ja(NS.getUint8),wO=ja(NS.setUint8),BO=yO(function(){return!new Ra(2).slice(1,void 0).byteLength});mO({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:BO},{slice:function(g,I){if(jS&&I===void 0)return jS(OS(this),g);for(var A=OS(this).byteLength,C=YS(g,A),e=YS(I===void 0?A:I,A),i=new Ra(SO(e-C)),n=new Ya(this),r=new Ya(i),o=0;C<e;)wO(r,o++,DO(n,C++));return i}})});var Na=p((W9,ZS)=>{"use strict";var FS=Z(),MO=qt(),vO=sA(),WS=FS.ArrayBuffer,PO=FS.TypeError;ZS.exports=WS&&MO(WS.prototype,"byteLength","get")||function(t){if(vO(t)!=="ArrayBuffer")throw new PO("ArrayBuffer expected");return t.byteLength}});var Wa=p((F9,kS)=>{"use strict";var _O=Z(),EO=dn(),bO=Na(),xO=_O.DataView;kS.exports=function(t){if(!EO||bO(t)!==0)return!1;try{return new xO(t),!1}catch(g){return!0}}});var xA=p(()=>{"use strict";var KO=eg(),GO=pA(),TO=Wa(),HS=ArrayBuffer.prototype;KO&&!("detached"in HS)&&GO(HS,"detached",{configurable:!0,get:function(){return TO(this)}})});var US=p((H9,LS)=>{"use strict";var OO=Wa(),YO=TypeError;LS.exports=function(t){if(OO(t))throw new YO("ArrayBuffer is detached");return t}});var Fa=p((L9,XS)=>{"use strict";var ve=Z(),jO=HC(),RO=sA(),Rn=function(t){return jO.slice(0,t.length)===t};XS.exports=function(){return Rn("Bun/")?"BUN":Rn("Cloudflare-Workers")?"CLOUDFLARE":Rn("Deno/")?"DENO":Rn("Node.js/")?"NODE":ve.Bun&&typeof Bun.version=="string"?"BUN":ve.Deno&&typeof Deno.version=="object"?"DENO":RO(ve.process)==="process"?"NODE":ve.window&&ve.document?"BROWSER":"REST"}()});var zS=p((U9,VS)=>{"use strict";var NO=Fa();VS.exports=NO==="NODE"});var QS=p((X9,JS)=>{"use strict";var WO=Z(),FO=zS();JS.exports=function(t){if(FO){try{return WO.process.getBuiltinModule(t)}catch(g){}try{return Function('return require("'+t+'")')()}catch(g){}}}});var Ha=p((V9,$S)=>{"use strict";var ZO=Z(),kO=H(),Za=Zt(),ka=Fa(),qS=ZO.structuredClone;$S.exports=!!qS&&!kO(function(){if(ka==="DENO"&&Za>92||ka==="NODE"&&Za>94||ka==="BROWSER"&&Za>97)return!1;var t=new ArrayBuffer(8),g=qS(t,{transfer:[t]});return t.byteLength!==0||g.byteLength!==8})});var CD=p((z9,AD)=>{"use strict";var Va=Z(),HO=QS(),LO=Ha(),UO=Va.structuredClone,gD=Va.ArrayBuffer,Nn=Va.MessageChannel,Xa=!1,La,ID,Wn,Ua;if(LO)Xa=function(t){UO(t,{transfer:[t]})};else if(gD)try{Nn||(La=HO("worker_threads"),La&&(Nn=La.MessageChannel)),Nn&&(ID=new Nn,Wn=new gD(2),Ua=function(t){ID.port1.postMessage(null,[t])},Wn.byteLength===2&&(Ua(Wn),Wn.byteLength===0&&(Xa=Ua)))}catch(t){}AD.exports=Xa});var gu=p((J9,sD)=>{"use strict";var Qa=Z(),qa=F(),nD=qt(),XO=wn(),VO=US(),zO=Na(),tD=CD(),za=Ha(),JO=Qa.structuredClone,rD=Qa.ArrayBuffer,Ja=Qa.DataView,QO=Math.min,$a=rD.prototype,oD=Ja.prototype,qO=qa($a.slice),eD=nD($a,"resizable","get"),iD=nD($a,"maxByteLength","get"),$O=qa(oD.getInt8),gY=qa(oD.setInt8);sD.exports=(za||tD)&&function(t,g,I){var A=zO(t),C=g===void 0?A:XO(g),e=!eD||!eD(t),i;if(VO(t),za&&(t=JO(t,{transfer:[t]}),A===C&&(I||e)))return t;if(A>=C&&(!I||e))i=qO(t,0,C);else{var n=I&&!e&&iD?{maxByteLength:iD(t)}:void 0;i=new rD(C,n);for(var r=new Ja(t),o=new Ja(i),s=QO(C,A),a=0;a<s;a++)gY(o,a,$O(r,a))}return za||tD(t),i}});var KA=p(()=>{"use strict";var IY=V(),aD=gu();aD&&IY({target:"ArrayBuffer",proto:!0},{transfer:function(){return aD(this,arguments.length?arguments[0]:void 0,!0)}})});var GA=p(()=>{"use strict";var AY=V(),uD=gu();uD&&AY({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return uD(this,arguments.length?arguments[0]:void 0,!1)}})});var Zn=p(()=>{"use strict";var tY=tC();tY("Uint8",function(t){return function(I,A,C){return t(this,I,A,C)}})});var Iu=p(()=>{"use strict";var eY=ea(),iY=qg().exportTypedArrayStaticMethod,nY=da();iY("from",nY,eY)});var SD=p(()=>{"use strict";var rY=en().charAt,oY=eI(),mD=QI(),sY=zo(),dD=Hi(),yD="String Iterator",aY=mD.set,uY=mD.getterFor(yD);sY(String,"String",function(t){aY(this,{type:yD,string:oY(t),index:0})},function(){var g=uY(this),I=g.string,A=g.index,C;return A>=I.length?dD(void 0,!0):(C=rY(I,A),g.index+=C.length,dD(C,!1))})});var tu=p((uU,wD)=>{"use strict";var lY=H(),cY=dg(),hY=eg(),DD=FA(),pY=cY("iterator");wD.exports=!lY(function(){var t=new URL("b?a=1&b=2&c=3","https://a"),g=t.searchParams,I=new URLSearchParams("a=1&a=2&b=3"),A="";return t.pathname="c%20d",g.forEach(function(C,e){g.delete("b"),A+=e+C}),I.delete("a",2),I.delete("b",void 0),DD&&(!t.toJSON||!I.has("a",1)||I.has("a",2)||!I.has("a",void 0)||I.has("b"))||!g.size&&(DD||!hY)||!g.sort||t.href!=="https://a/c%20d?a=1&c=3"||g.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!g[pY]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("https://\u0442\u0435\u0441\u0442").host!=="xn--e1aybc"||new URL("https://a#\u0431").hash!=="#%D0%B1"||A!=="a1c3"||new URL("https://x",void 0).host!=="x"})});var PD=p((lU,vD)=>{"use strict";var BD=eg(),fY=F(),dY=og(),mY=H(),eu=Yo(),yY=Go(),SY=go(),DY=Zg(),wY=Wt(),nt=Object.assign,MD=Object.defineProperty,BY=fY([].concat);vD.exports=!nt||mY(function(){if(BD&&nt({b:1},nt(MD({},"a",{enumerable:!0,get:function(){MD(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var t={},g={},I=Symbol("assign detection"),A="abcdefghijklmnopqrst";return t[I]=7,A.split("").forEach(function(C){g[C]=C}),nt({},t)[I]!==7||eu(nt({},g)).join("")!==A})?function(g,I){for(var A=DY(g),C=arguments.length,e=1,i=yY.f,n=SY.f;C>e;)for(var r=wY(arguments[e++]),o=i?BY(eu(r),i(r)):eu(r),s=o.length,a=0,u;s>a;)u=o[a++],(!BD||dY(n,r,u))&&(A[u]=r[u]);return A}:nt});var ED=p((cU,_D)=>{"use strict";var MY=Ng(),vY=qi();_D.exports=function(t,g,I,A){try{return A?g(MY(I)[0],I[1]):g(I)}catch(C){vY(t,"throw",C)}}});var xD=p((hU,bD)=>{"use strict";var PY=eg(),_Y=pI(),EY=WA();bD.exports=function(t,g,I){PY?_Y.f(t,g,EY(0,I)):t[g]=I}});var OD=p((pU,TD)=>{"use strict";var bY=QA(),xY=og(),KY=Zg(),GY=ED(),TY=pa(),OY=cn(),YY=bg(),KD=xD(),jY=xn(),RY=me(),GD=Array;TD.exports=function(g){var I=KY(g),A=OY(this),C=arguments.length,e=C>1?arguments[1]:void 0,i=e!==void 0;i&&(e=bY(e,C>2?arguments[2]:void 0));var n=RY(I),r=0,o,s,a,u,c,h;if(n&&!(this===GD&&TY(n)))for(s=A?new this:[],u=jY(I,n),c=u.next;!(a=xY(c,u)).done;r++)h=i?GY(u,e,[a.value,r],!0):a.value,KD(s,r,h);else for(o=YY(I),s=A?new this(o):GD(o);o>r;r++)h=i?e(I[r],r):I[r],KD(s,r,h);return s.length=r,s}});var HD=p((fU,kD)=>{"use strict";var OC=F(),iu=2147483647,_e=36,WD=1,ou=26,NY=38,WY=700,FY=72,ZY=128,kY="-",HY=/[^\0-\u007E]/,FD=/[.\u3002\uFF0E\uFF61]/g,YD="Overflow: input needs wider integers to process",nu=_e-WD,jD=RangeError,LY=OC(FD.exec),rt=Math.floor,ru=String.fromCharCode,RD=OC("".charCodeAt),ZD=OC([].join),eC=OC([].push),UY=OC("".replace),XY=OC("".split),VY=OC("".toLowerCase),zY=function(t){for(var g=[],I=0,A=t.length;I<A;){var C=RD(t,I++);if(C>=55296&&C<=56319&&I<A){var e=RD(t,I++);(e&64512)===56320?eC(g,((C&1023)<<10)+(e&1023)+65536):(eC(g,C),I--)}else eC(g,C)}return g},ND=function(t){return t+22+75*(t<26)},JY=function(t,g,I){var A=0;for(t=I?rt(t/WY):t>>1,t+=rt(t/g);t>nu*ou>>1;)t=rt(t/nu),A+=_e;return rt(A+(nu+1)*t/(t+NY))},QY=function(t){var g=[];t=zY(t);var I=t.length,A=ZY,C=0,e=FY,i,n;for(i=0;i<t.length;i++)n=t[i],n<128&&eC(g,ru(n));var r=g.length,o=r;for(r&&eC(g,kY);o<I;){var s=iu;for(i=0;i<t.length;i++)n=t[i],n>=A&&n<s&&(s=n);var a=o+1;if(s-A>rt((iu-C)/a))throw new jD(YD);for(C+=(s-A)*a,A=s,i=0;i<t.length;i++){if(n=t[i],n<A&&++C>iu)throw new jD(YD);if(n===A){for(var u=C,c=_e;;){var h=c<=e?WD:c>=e+ou?ou:c-e;if(u<h)break;var f=u-h,d=_e-h;eC(g,ru(ND(h+f%d))),u=rt(f/d),c+=_e}eC(g,ru(ND(u))),e=JY(C,a,o===r),C=0,o++}}C++,A++}return ZD(g,"")};kD.exports=function(t){var g=[],I=XY(UY(VY(t),FD,"."),"."),A,C;for(A=0;A<I.length;A++)C=I[A],eC(g,LY(HY,C)?"xn--"+QY(C):C);return ZD(g,".")}});var Ee=p((dU,LD)=>{"use strict";var qY=TypeError;LD.exports=function(t,g){if(t<g)throw new qY("Not enough arguments");return t}});var VD=p(()=>{"use strict";var $Y=V(),gj=F(),Ij=Xt(),Aj=RangeError,UD=String.fromCharCode,XD=String.fromCodePoint,Cj=gj([].join),tj=!!XD&&XD.length!==1;$Y({target:"String",stat:!0,arity:1,forced:tj},{fromCodePoint:function(g){for(var I=[],A=arguments.length,C=0,e;A>C;){if(e=+arguments[C++],Ij(e,1114111)!==e)throw new Aj(e+" is not a valid code point");I[C]=e<65536?UD(e):UD(((e-=65536)>>10)+55296,e%1024+56320)}return Cj(I,"")}})});var QD=p((SU,JD)=>{"use strict";var zD=Z(),ej=eg(),ij=Object.getOwnPropertyDescriptor;JD.exports=function(t){if(!ej)return zD[t];var g=ij(zD,t);return g&&g.value}});var du=p((DU,yw)=>{"use strict";Qo();VD();var hu=V(),sw=Z(),pu=QD(),nj=xI(),Ln=og(),LI=F(),be=eg(),aw=tu(),uw=dI(),rj=pA(),oj=ia(),sj=ZA(),aj=Xo(),fu=QI(),lw=pe(),su=ig(),uj=kg(),lj=QA(),cj=uA(),hj=Ng(),cw=Mg(),Xg=eI(),pj=yC(),qD=WA(),$D=xn(),fj=me(),Un=Hi(),ot=Ee(),dj=dg(),mj=sn(),yj=dj("iterator"),at="URLSearchParams",hw=at+"Iterator",pw=fu.set,DI=fu.getterFor(at),Sj=fu.getterFor(hw),gw=pu("fetch"),zn=pu("Request"),xe=pu("Headers"),au=zn&&zn.prototype,Iw=xe&&xe.prototype,Dj=sw.TypeError,wj=sw.encodeURIComponent,Bj=String.fromCharCode,Mj=nj("String","fromCodePoint"),vj=parseInt,Vn=LI("".charAt),Aw=LI([].join),iC=LI([].push),fw=LI("".replace),Pj=LI([].shift),Cw=LI([].splice),tw=LI("".split),dw=LI("".slice),_j=LI(/./.exec),Ej=/\+/g,uu="\uFFFD",bj=/^[0-9a-f]+$/i,ew=function(t,g){var I=dw(t,g,g+2);return _j(bj,I)?vj(I,16):NaN},xj=function(t){for(var g=0,I=128;I>0&&t&I;I>>=1)g++;return g},Kj=function(t){var g=null;switch(t.length){case 1:g=t[0];break;case 2:g=(t[0]&31)<<6|t[1]&63;break;case 3:g=(t[0]&15)<<12|(t[1]&63)<<6|t[2]&63;break;case 4:g=(t[0]&7)<<18|(t[1]&63)<<12|(t[2]&63)<<6|t[3]&63;break}return g>1114111?null:g},iw=function(t){t=fw(t,Ej," ");for(var g=t.length,I="",A=0;A<g;){var C=Vn(t,A);if(C==="%"){if(Vn(t,A+1)==="%"||A+3>g){I+="%",A++;continue}var e=ew(t,A+1);if(e!==e){I+=C,A++;continue}A+=2;var i=xj(e);if(i===0)C=Bj(e);else{if(i===1||i>4){I+=uu,A++;continue}for(var n=[e],r=1;r<i&&(A++,!(A+3>g||Vn(t,A)!=="%"));){var o=ew(t,A+1);if(o!==o){A+=3;break}if(o>191||o<128)break;iC(n,o),A+=2,r++}if(n.length!==i){I+=uu;continue}var s=Kj(n);s===null?I+=uu:C=Mj(s)}}I+=C,A++}return I},Gj=/[!'()~]|%20/g,Tj={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Oj=function(t){return Tj[t]},nw=function(t){return fw(wj(t),Gj,Oj)},lu=aj(function(g,I){pw(this,{type:hw,target:DI(g).entries,index:0,kind:I})},at,function(){var g=Sj(this),I=g.target,A=g.index++;if(!I||A>=I.length)return g.target=null,Un(void 0,!0);var C=I[A];switch(g.kind){case"keys":return Un(C.key,!1);case"values":return Un(C.value,!1)}return Un([C.key,C.value],!1)},!0),mw=function(t){this.entries=[],this.url=null,t!==void 0&&(cw(t)?this.parseObject(t):this.parseQuery(typeof t=="string"?Vn(t,0)==="?"?dw(t,1):t:Xg(t)))};mw.prototype={type:at,bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var g=this.entries,I=fj(t),A,C,e,i,n,r,o;if(I)for(A=$D(t,I),C=A.next;!(e=Ln(C,A)).done;){if(i=$D(hj(e.value)),n=i.next,(r=Ln(n,i)).done||(o=Ln(n,i)).done||!Ln(n,i).done)throw new Dj("Expected sequence with length 2");iC(g,{key:Xg(r.value),value:Xg(o.value)})}else for(var s in t)uj(t,s)&&iC(g,{key:s,value:Xg(t[s])})},parseQuery:function(t){if(t)for(var g=this.entries,I=tw(t,"&"),A=0,C,e;A<I.length;)C=I[A++],C.length&&(e=tw(C,"="),iC(g,{key:iw(Pj(e)),value:iw(Aw(e,"="))}))},serialize:function(){for(var t=this.entries,g=[],I=0,A;I<t.length;)A=t[I++],iC(g,nw(A.key)+"="+nw(A.value));return Aw(g,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Jn=function(){lw(this,st);var g=arguments.length>0?arguments[0]:void 0,I=pw(this,new mw(g));be||(this.size=I.entries.length)},st=Jn.prototype;oj(st,{append:function(g,I){var A=DI(this);ot(arguments.length,2),iC(A.entries,{key:Xg(g),value:Xg(I)}),be||this.length++,A.updateURL()},delete:function(t){for(var g=DI(this),I=ot(arguments.length,1),A=g.entries,C=Xg(t),e=I<2?void 0:arguments[1],i=e===void 0?e:Xg(e),n=0;n<A.length;){var r=A[n];if(r.key===C&&(i===void 0||r.value===i)){if(Cw(A,n,1),i!==void 0)break}else n++}be||(this.size=A.length),g.updateURL()},get:function(g){var I=DI(this).entries;ot(arguments.length,1);for(var A=Xg(g),C=0;C<I.length;C++)if(I[C].key===A)return I[C].value;return null},getAll:function(g){var I=DI(this).entries;ot(arguments.length,1);for(var A=Xg(g),C=[],e=0;e<I.length;e++)I[e].key===A&&iC(C,I[e].value);return C},has:function(g){for(var I=DI(this).entries,A=ot(arguments.length,1),C=Xg(g),e=A<2?void 0:arguments[1],i=e===void 0?e:Xg(e),n=0;n<I.length;){var r=I[n++];if(r.key===C&&(i===void 0||r.value===i))return!0}return!1},set:function(g,I){var A=DI(this);ot(arguments.length,1);for(var C=A.entries,e=!1,i=Xg(g),n=Xg(I),r=0,o;r<C.length;r++)o=C[r],o.key===i&&(e?Cw(C,r--,1):(e=!0,o.value=n));e||iC(C,{key:i,value:n}),be||(this.size=C.length),A.updateURL()},sort:function(){var g=DI(this);mj(g.entries,function(I,A){return I.key>A.key?1:-1}),g.updateURL()},forEach:function(g){for(var I=DI(this).entries,A=lj(g,arguments.length>1?arguments[1]:void 0),C=0,e;C<I.length;)e=I[C++],A(e.value,e.key,this)},keys:function(){return new lu(this,"keys")},values:function(){return new lu(this,"values")},entries:function(){return new lu(this,"entries")}},{enumerable:!0});uw(st,yj,st.entries,{name:"entries"});uw(st,"toString",function(){return DI(this).serialize()},{enumerable:!0});be&&rj(st,"size",{get:function(){return DI(this).entries.length},configurable:!0,enumerable:!0});sj(Jn,at);hu({global:!0,constructor:!0,forced:!aw},{URLSearchParams:Jn});!aw&&su(xe)&&(rw=LI(Iw.has),ow=LI(Iw.set),cu=function(t){if(cw(t)){var g=t.body,I;if(cj(g)===at)return I=t.headers?new xe(t.headers):new xe,rw(I,"content-type")||ow(I,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),pj(t,{body:qD(0,Xg(g)),headers:qD(0,I)})}return t},su(gw)&&hu({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(g){return gw(g,arguments.length>1?cu(arguments[1]):{})}}),su(zn)&&(Xn=function(g){return lw(this,au),new zn(g,arguments.length>1?cu(arguments[1]):{})},au.constructor=Xn,Xn.prototype=au,hu({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Xn})));var rw,ow,cu,Xn;yw.exports={URLSearchParams:Jn,getState:DI}});var Rw=p(()=>{"use strict";SD();var Yj=V(),Ou=eg(),jj=tu(),Yu=Z(),Sw=QA(),PI=F(),Ir=dI(),wI=pA(),Rj=pe(),Ku=kg(),ju=PD(),ut=OD(),UI=Ae(),Nj=en().codeAt,Wj=HD(),YA=eI(),Fj=ZA(),Zj=Ee(),Kw=du(),Gw=QI(),kj=Gw.set,Ar=Gw.getterFor("URL"),Hj=Kw.URLSearchParams,Lj=Kw.getState,Ke=Yu.URL,Gu=Yu.TypeError,Cr=Yu.parseInt,Uj=Math.floor,Dw=Math.pow,vI=PI("".charAt),XI=PI(/./.exec),Te=PI([].join),Xj=PI(1 .toString),Vj=PI([].pop),ct=PI([].push),mu=PI("".replace),zj=PI([].shift),Jj=PI("".split),Ye=PI("".slice),tr=PI("".toLowerCase),Qj=PI([].unshift),qj="Invalid authority",yu="Invalid scheme",YC="Invalid host",ww="Invalid port",Tw=/[a-z]/i,$j=/[\d+-.a-z]/i,Tu=/\d/,gR=/^0x/i,IR=/^[0-7]+$/,AR=/^\d+$/,Ow=/^[\da-f]+$/i,CR=/[\0\t\n\r #%/:<>?@[\\\]^|]/,tR=/[\0\t\n\r #/:<>?@[\\\]^|]/,eR=/^[\u0000-\u0020]+/,iR=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,nR=/[\t\n\r]/g,BI,rR=function(t){var g=Jj(t,"."),I,A,C,e,i,n,r;if(g.length&&g[g.length-1]===""&&g.length--,I=g.length,I>4)return t;for(A=[],C=0;C<I;C++){if(e=g[C],e==="")return t;if(i=10,e.length>1&&vI(e,0)==="0"&&(i=XI(gR,e)?16:8,e=Ye(e,i===8?1:2)),e==="")n=0;else{if(!XI(i===10?AR:i===8?IR:Ow,e))return t;n=Cr(e,i)}ct(A,n)}for(C=0;C<I;C++)if(n=A[C],C===I-1){if(n>=Dw(256,5-I))return null}else if(n>255)return null;for(r=Vj(A),C=0;C<A.length;C++)r+=A[C]*Dw(256,3-C);return r},oR=function(t){var g=[0,0,0,0,0,0,0,0],I=0,A=null,C=0,e,i,n,r,o,s,a,u=function(){return vI(t,C)};if(u()===":"){if(vI(t,1)!==":")return;C+=2,I++,A=I}for(;u();){if(I===8)return;if(u()===":"){if(A!==null)return;C++,I++,A=I;continue}for(e=i=0;i<4&&XI(Ow,u());)e=e*16+Cr(u(),16),C++,i++;if(u()==="."){if(i===0||(C-=i,I>6))return;for(n=0;u();){if(r=null,n>0)if(u()==="."&&n<4)C++;else return;if(!XI(Tu,u()))return;for(;XI(Tu,u());){if(o=Cr(u(),10),r===null)r=o;else{if(r===0)return;r=r*10+o}if(r>255)return;C++}g[I]=g[I]*256+r,n++,(n===2||n===4)&&I++}if(n!==4)return;break}else if(u()===":"){if(C++,!u())return}else if(u())return;g[I++]=e}if(A!==null)for(s=I-A,I=7;I!==0&&s>0;)a=g[I],g[I--]=g[A+s-1],g[A+--s]=a;else if(I!==8)return;return g},sR=function(t){for(var g=null,I=1,A=null,C=0,e=0;e<8;e++)t[e]!==0?(C>I&&(g=A,I=C),A=null,C=0):(A===null&&(A=e),++C);return C>I?A:g},Ge=function(t){var g,I,A,C;if(typeof t=="number"){for(g=[],I=0;I<4;I++)Qj(g,t%256),t=Uj(t/256);return Te(g,".")}if(typeof t=="object"){for(g="",A=sR(t),I=0;I<8;I++)C&&t[I]===0||(C&&(C=!1),A===I?(g+=I?":":"::",C=!0):(g+=Xj(t[I],16),I<7&&(g+=":")));return"["+g+"]"}return t},gr={},Yw=ju({},gr,{" ":1,'"':1,"<":1,">":1,"`":1}),jw=ju({},Yw,{"#":1,"?":1,"{":1,"}":1}),Su=ju({},jw,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),nC=function(t,g){var I=Nj(t,0);return I>32&&I<127&&!Ku(g,t)?t:encodeURIComponent(t)},Qn={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Oe=function(t,g){var I;return t.length===2&&XI(Tw,vI(t,0))&&((I=vI(t,1))===":"||!g&&I==="|")},Bw=function(t){var g;return t.length>1&&Oe(Ye(t,0,2))&&(t.length===2||(g=vI(t,2))==="/"||g==="\\"||g==="?"||g==="#")},aR=function(t){return t==="."||tr(t)==="%2e"},uR=function(t){return t=tr(t),t===".."||t==="%2e."||t===".%2e"||t==="%2e%2e"},Du={},Mw={},wu={},vw={},Pw={},Bu={},_w={},Ew={},qn={},$n={},Mu={},vu={},Pu={},_u={},bw={},Eu={},lt={},iA={},xw={},jC={},OA={},Ru=function(t,g,I){var A=YA(t),C,e,i;if(g){if(e=this.parse(A),e)throw new Gu(e);this.searchParams=null}else{if(I!==void 0&&(C=new Ru(I,!0)),e=this.parse(A,null,C),e)throw new Gu(e);i=Lj(new Hj),i.bindURL(this),this.searchParams=i}};Ru.prototype={type:"URL",parse:function(t,g,I){var A=this,C=g||Du,e=0,i="",n=!1,r=!1,o=!1,s,a,u,c;for(t=YA(t),g||(A.scheme="",A.username="",A.password="",A.host=null,A.port=null,A.path=[],A.query=null,A.fragment=null,A.cannotBeABaseURL=!1,t=mu(t,eR,""),t=mu(t,iR,"$1")),t=mu(t,nR,""),s=ut(t);e<=s.length;){switch(a=s[e],C){case Du:if(a&&XI(Tw,a))i+=tr(a),C=Mw;else{if(g)return yu;C=wu;continue}break;case Mw:if(a&&(XI($j,a)||a==="+"||a==="-"||a==="."))i+=tr(a);else if(a===":"){if(g&&(A.isSpecial()!==Ku(Qn,i)||i==="file"&&(A.includesCredentials()||A.port!==null)||A.scheme==="file"&&!A.host))return;if(A.scheme=i,g){A.isSpecial()&&Qn[A.scheme]===A.port&&(A.port=null);return}i="",A.scheme==="file"?C=_u:A.isSpecial()&&I&&I.scheme===A.scheme?C=vw:A.isSpecial()?C=Ew:s[e+1]==="/"?(C=Pw,e++):(A.cannotBeABaseURL=!0,ct(A.path,""),C=xw)}else{if(g)return yu;i="",C=wu,e=0;continue}break;case wu:if(!I||I.cannotBeABaseURL&&a!=="#")return yu;if(I.cannotBeABaseURL&&a==="#"){A.scheme=I.scheme,A.path=UI(I.path),A.query=I.query,A.fragment="",A.cannotBeABaseURL=!0,C=OA;break}C=I.scheme==="file"?_u:Bu;continue;case vw:if(a==="/"&&s[e+1]==="/")C=qn,e++;else{C=Bu;continue}break;case Pw:if(a==="/"){C=$n;break}else{C=iA;continue}case Bu:if(A.scheme=I.scheme,a===BI)A.username=I.username,A.password=I.password,A.host=I.host,A.port=I.port,A.path=UI(I.path),A.query=I.query;else if(a==="/"||a==="\\"&&A.isSpecial())C=_w;else if(a==="?")A.username=I.username,A.password=I.password,A.host=I.host,A.port=I.port,A.path=UI(I.path),A.query="",C=jC;else if(a==="#")A.username=I.username,A.password=I.password,A.host=I.host,A.port=I.port,A.path=UI(I.path),A.query=I.query,A.fragment="",C=OA;else{A.username=I.username,A.password=I.password,A.host=I.host,A.port=I.port,A.path=UI(I.path),A.path.length--,C=iA;continue}break;case _w:if(A.isSpecial()&&(a==="/"||a==="\\"))C=qn;else if(a==="/")C=$n;else{A.username=I.username,A.password=I.password,A.host=I.host,A.port=I.port,C=iA;continue}break;case Ew:if(C=qn,a!=="/"||vI(i,e+1)!=="/")continue;e++;break;case qn:if(a!=="/"&&a!=="\\"){C=$n;continue}break;case $n:if(a==="@"){n&&(i="%40"+i),n=!0,u=ut(i);for(var h=0;h<u.length;h++){var f=u[h];if(f===":"&&!o){o=!0;continue}var d=nC(f,Su);o?A.password+=d:A.username+=d}i=""}else if(a===BI||a==="/"||a==="?"||a==="#"||a==="\\"&&A.isSpecial()){if(n&&i==="")return qj;e-=ut(i).length+1,i="",C=Mu}else i+=a;break;case Mu:case vu:if(g&&A.scheme==="file"){C=Eu;continue}else if(a===":"&&!r){if(i==="")return YC;if(c=A.parseHost(i),c)return c;if(i="",C=Pu,g===vu)return}else if(a===BI||a==="/"||a==="?"||a==="#"||a==="\\"&&A.isSpecial()){if(A.isSpecial()&&i==="")return YC;if(g&&i===""&&(A.includesCredentials()||A.port!==null))return;if(c=A.parseHost(i),c)return c;if(i="",C=lt,g)return;continue}else a==="["?r=!0:a==="]"&&(r=!1),i+=a;break;case Pu:if(XI(Tu,a))i+=a;else if(a===BI||a==="/"||a==="?"||a==="#"||a==="\\"&&A.isSpecial()||g){if(i!==""){var S=Cr(i,10);if(S>65535)return ww;A.port=A.isSpecial()&&S===Qn[A.scheme]?null:S,i=""}if(g)return;C=lt;continue}else return ww;break;case _u:if(A.scheme="file",a==="/"||a==="\\")C=bw;else if(I&&I.scheme==="file")switch(a){case BI:A.host=I.host,A.path=UI(I.path),A.query=I.query;break;case"?":A.host=I.host,A.path=UI(I.path),A.query="",C=jC;break;case"#":A.host=I.host,A.path=UI(I.path),A.query=I.query,A.fragment="",C=OA;break;default:Bw(Te(UI(s,e),""))||(A.host=I.host,A.path=UI(I.path),A.shortenPath()),C=iA;continue}else{C=iA;continue}break;case bw:if(a==="/"||a==="\\"){C=Eu;break}I&&I.scheme==="file"&&!Bw(Te(UI(s,e),""))&&(Oe(I.path[0],!0)?ct(A.path,I.path[0]):A.host=I.host),C=iA;continue;case Eu:if(a===BI||a==="/"||a==="\\"||a==="?"||a==="#"){if(!g&&Oe(i))C=iA;else if(i===""){if(A.host="",g)return;C=lt}else{if(c=A.parseHost(i),c)return c;if(A.host==="localhost"&&(A.host=""),g)return;i="",C=lt}continue}else i+=a;break;case lt:if(A.isSpecial()){if(C=iA,a!=="/"&&a!=="\\")continue}else if(!g&&a==="?")A.query="",C=jC;else if(!g&&a==="#")A.fragment="",C=OA;else if(a!==BI&&(C=iA,a!=="/"))continue;break;case iA:if(a===BI||a==="/"||a==="\\"&&A.isSpecial()||!g&&(a==="?"||a==="#")){if(uR(i)?(A.shortenPath(),a!=="/"&&!(a==="\\"&&A.isSpecial())&&ct(A.path,"")):aR(i)?a!=="/"&&!(a==="\\"&&A.isSpecial())&&ct(A.path,""):(A.scheme==="file"&&!A.path.length&&Oe(i)&&(A.host&&(A.host=""),i=vI(i,0)+":"),ct(A.path,i)),i="",A.scheme==="file"&&(a===BI||a==="?"||a==="#"))for(;A.path.length>1&&A.path[0]==="";)zj(A.path);a==="?"?(A.query="",C=jC):a==="#"&&(A.fragment="",C=OA)}else i+=nC(a,jw);break;case xw:a==="?"?(A.query="",C=jC):a==="#"?(A.fragment="",C=OA):a!==BI&&(A.path[0]+=nC(a,gr));break;case jC:!g&&a==="#"?(A.fragment="",C=OA):a!==BI&&(a==="'"&&A.isSpecial()?A.query+="%27":a==="#"?A.query+="%23":A.query+=nC(a,gr));break;case OA:a!==BI&&(A.fragment+=nC(a,Yw));break}e++}},parseHost:function(t){var g,I,A;if(vI(t,0)==="["){if(vI(t,t.length-1)!=="]"||(g=oR(Ye(t,1,-1)),!g))return YC;this.host=g}else if(this.isSpecial()){if(t=Wj(t),XI(CR,t)||(g=rR(t),g===null))return YC;this.host=g}else{if(XI(tR,t))return YC;for(g="",I=ut(t),A=0;A<I.length;A++)g+=nC(I[A],gr);this.host=g}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return Ku(Qn,this.scheme)},shortenPath:function(){var t=this.path,g=t.length;g&&(this.scheme!=="file"||g!==1||!Oe(t[0],!0))&&t.length--},serialize:function(){var t=this,g=t.scheme,I=t.username,A=t.password,C=t.host,e=t.port,i=t.path,n=t.query,r=t.fragment,o=g+":";return C!==null?(o+="//",t.includesCredentials()&&(o+=I+(A?":"+A:"")+"@"),o+=Ge(C),e!==null&&(o+=":"+e)):g==="file"&&(o+="//"),o+=t.cannotBeABaseURL?i[0]:i.length?"/"+Te(i,"/"):"",n!==null&&(o+="?"+n),r!==null&&(o+="#"+r),o},setHref:function(t){var g=this.parse(t);if(g)throw new Gu(g);this.searchParams.update()},getOrigin:function(){var t=this.scheme,g=this.port;if(t==="blob")try{return new ht(t.path[0]).origin}catch(I){return"null"}return t==="file"||!this.isSpecial()?"null":t+"://"+Ge(this.host)+(g!==null?":"+g:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(t){this.parse(YA(t)+":",Du)},getUsername:function(){return this.username},setUsername:function(t){var g=ut(YA(t));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var I=0;I<g.length;I++)this.username+=nC(g[I],Su)}},getPassword:function(){return this.password},setPassword:function(t){var g=ut(YA(t));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var I=0;I<g.length;I++)this.password+=nC(g[I],Su)}},getHost:function(){var t=this.host,g=this.port;return t===null?"":g===null?Ge(t):Ge(t)+":"+g},setHost:function(t){this.cannotBeABaseURL||this.parse(t,Mu)},getHostname:function(){var t=this.host;return t===null?"":Ge(t)},setHostname:function(t){this.cannotBeABaseURL||this.parse(t,vu)},getPort:function(){var t=this.port;return t===null?"":YA(t)},setPort:function(t){this.cannotHaveUsernamePasswordPort()||(t=YA(t),t===""?this.port=null:this.parse(t,Pu))},getPathname:function(){var t=this.path;return this.cannotBeABaseURL?t[0]:t.length?"/"+Te(t,"/"):""},setPathname:function(t){this.cannotBeABaseURL||(this.path=[],this.parse(t,lt))},getSearch:function(){var t=this.query;return t?"?"+t:""},setSearch:function(t){t=YA(t),t===""?this.query=null:(vI(t,0)==="?"&&(t=Ye(t,1)),this.query="",this.parse(t,jC)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var t=this.fragment;return t?"#"+t:""},setHash:function(t){if(t=YA(t),t===""){this.fragment=null;return}vI(t,0)==="#"&&(t=Ye(t,1)),this.fragment="",this.parse(t,OA)},update:function(){this.query=this.searchParams.serialize()||null}};var ht=function(g){var I=Rj(this,Vg),A=Zj(arguments.length,1)>1?arguments[1]:void 0,C=kj(I,new Ru(g,!1,A));Ou||(I.href=C.serialize(),I.origin=C.getOrigin(),I.protocol=C.getProtocol(),I.username=C.getUsername(),I.password=C.getPassword(),I.host=C.getHost(),I.hostname=C.getHostname(),I.port=C.getPort(),I.pathname=C.getPathname(),I.search=C.getSearch(),I.searchParams=C.getSearchParams(),I.hash=C.getHash())},Vg=ht.prototype,MI=function(t,g){return{get:function(){return Ar(this)[t]()},set:g&&function(I){return Ar(this)[g](I)},configurable:!0,enumerable:!0}};Ou&&(wI(Vg,"href",MI("serialize","setHref")),wI(Vg,"origin",MI("getOrigin")),wI(Vg,"protocol",MI("getProtocol","setProtocol")),wI(Vg,"username",MI("getUsername","setUsername")),wI(Vg,"password",MI("getPassword","setPassword")),wI(Vg,"host",MI("getHost","setHost")),wI(Vg,"hostname",MI("getHostname","setHostname")),wI(Vg,"port",MI("getPort","setPort")),wI(Vg,"pathname",MI("getPathname","setPathname")),wI(Vg,"search",MI("getSearch","setSearch")),wI(Vg,"searchParams",MI("getSearchParams")),wI(Vg,"hash",MI("getHash","setHash")));Ir(Vg,"toJSON",function(){return Ar(this).serialize()},{enumerable:!0});Ir(Vg,"toString",function(){return Ar(this).serialize()},{enumerable:!0});Ke&&(bu=Ke.createObjectURL,xu=Ke.revokeObjectURL,bu&&Ir(ht,"createObjectURL",Sw(bu,Ke)),xu&&Ir(ht,"revokeObjectURL",Sw(xu,Ke)));var bu,xu;Fj(ht,"URL");Yj({global:!0,constructor:!0,forced:!jj,sham:!Ou},{URL:ht})});var Nw=p(()=>{"use strict";Rw()});var Ww=p(()=>{"use strict";var lR=V(),cR=og();lR({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return cR(URL.prototype.toString,this)}})});var Nu=p(()=>{"use strict";du()});var Fu=p(()=>{"use strict";var hR=dI(),er=F(),Fw=eI(),pR=Ee(),kw=URLSearchParams,ir=kw.prototype,fR=er(ir.append),Zw=er(ir.delete),dR=er(ir.forEach),mR=er([].push),Wu=new kw("a=1&a=2&b=3");Wu.delete("a",1);Wu.delete("b",void 0);Wu+""!="a=2"&&hR(ir,"delete",function(t){var g=arguments.length,I=g<2?void 0:arguments[1];if(g&&I===void 0)return Zw(this,t);var A=[];dR(this,function(a,u){mR(A,{key:u,value:a})}),pR(g,1);for(var C=Fw(t),e=Fw(I),i=0,n=0,r=!1,o=A.length,s;i<o;)s=A[i++],r||s.key===C?(r=!0,Zw(this,s.key)):n++;for(;n<o;)s=A[n++],s.key===C&&s.value===e||fR(this,s.key,s.value)},{enumerable:!0,unsafe:!0})});var ku=p(()=>{"use strict";var yR=dI(),Lw=F(),SR=eI(),DR=Ee(),Uw=URLSearchParams,Zu=Uw.prototype,wR=Lw(Zu.getAll),BR=Lw(Zu.has),Hw=new Uw("a=1");(Hw.has("a",2)||!Hw.has("a",void 0))&&yR(Zu,"has",function(g){var I=arguments.length,A=I<2?void 0:arguments[1];if(I&&A===void 0)return BR(this,g);var C=wR(this,g);DR(I,1);for(var e=SR(A),i=0;i<C.length;)if(C[i++]===e)return!0;return!1},{enumerable:!0,unsafe:!0})});var Lu=p(()=>{"use strict";var MR=eg(),vR=F(),PR=pA(),Hu=URLSearchParams.prototype,_R=vR(Hu.forEach);MR&&!("size"in Hu)&&PR(Hu,"size",{get:function(){var g=0;return _R(this,function(){g++}),g},configurable:!0,enumerable:!0})});var Xw=p(()=>{"use strict";var ER=tC();ER("Int8",function(t){return function(I,A,C){return t(this,I,A,C)}})});var Vw=p(()=>{"use strict";var bR=tC();bR("Uint32",function(t){return function(I,A,C){return t(this,I,A,C)}})});var zw=p(()=>{"use strict";var xR=tC();xR("Int16",function(t){return function(I,A,C){return t(this,I,A,C)}})});var Jw=p(()=>{"use strict";var KR=tC();KR("Int32",function(t){return function(I,A,C){return t(this,I,A,C)}})});var Uu=p(()=>{"use strict";var GR=tC();GR("Uint16",function(t){return function(I,A,C){return t(this,I,A,C)}})});var cr=p(()=>{"use strict";var zR=V(),JR=Zg(),QR=bg(),qR=To(),$R=Gs(),g4=Ni(),I4=[].unshift(0)!==1,A4=function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(t){return t instanceof TypeError}},C4=I4||!A4();zR({target:"Array",proto:!0,arity:1,forced:C4},{unshift:function(g){var I=JR(this),A=QR(I),C=arguments.length;if(C){g4(A+C);for(var e=A;e--;){var i=e+C;e in I?I[i]=I[e]:$R(I,i)}for(var n=0;n<C;n++)I[n]=arguments[n]}return qR(I,A+C)}})});var Y2=p((I8,O2)=>{"use strict";var i4=Z();O2.exports=i4.Promise});var N2=p((A8,R2)=>{"use strict";var j2=Ng(),n4=ha(),r4=Ft(),o4=dg(),s4=o4("species");R2.exports=function(t,g){var I=j2(t).constructor,A;return I===void 0||r4(A=j2(I)[s4])?g:n4(A)}});var Z2=p((C8,F2)=>{"use strict";var W2=JI(),a4=TypeError,u4=function(t){var g,I;this.promise=new t(function(A,C){if(g!==void 0||I!==void 0)throw new a4("Bad Promise constructor");g=A,I=C}),this.resolve=W2(g),this.reject=W2(I)};F2.exports.f=function(t){return new u4(t)}});var H2=p((t8,k2)=>{"use strict";var l4=Ng(),c4=Mg(),h4=Z2();k2.exports=function(t,g){if(l4(t),c4(g)&&g.constructor===t)return g;var I=h4.f(t),A=I.resolve;return A(g),I.promise}});var t0=p(()=>{"use strict";var p4=V(),f4=FA(),wr=Y2(),d4=H(),U2=xI(),X2=ig(),m4=N2(),L2=H2(),y4=dI(),C0=wr&&wr.prototype,S4=!!wr&&d4(function(){C0.finally.call({then:function(){}},function(){})});p4({target:"Promise",proto:!0,real:!0,forced:S4},{finally:function(t){var g=m4(this,U2("Promise")),I=X2(t);return this.then(I?function(A){return L2(g,t()).then(function(){return A})}:t,I?function(A){return L2(g,t()).then(function(){throw A})}:t)}});!f4&&X2(wr)&&(A0=U2("Promise").prototype.finally,C0.finally!==A0&&y4(C0,"finally",A0,{unsafe:!0}));var A0});var pB=p(()=>{"use strict";var V4=V(),z4=Be().findLastIndex,J4=Jt();V4({target:"Array",proto:!0},{findLastIndex:function(g){return z4(this,g,arguments.length>1?arguments[1]:void 0)}});J4("findLastIndex")});var fB=p(()=>{"use strict";var Q4=V(),q4=Be().findLast,$4=Jt();Q4({target:"Array",proto:!0},{findLast:function(g){return q4(this,g,arguments.length>1?arguments[1]:void 0)}});$4("findLast")});var nN={};H0(nN,{AibeeLoader:()=>FC,BMap:()=>c0,BMapSelect:()=>D0,BaseSvg:()=>aI,CarInertialPosition:()=>pi,ClickHelper:()=>le,Context:()=>ni,CrLoader:()=>l0,CrNavPath:()=>S0,Equipment:()=>h0,EventDispatcher:()=>hg,Events:()=>Ks,Floor:()=>sI,GlbModel:()=>qu,Graphic:()=>Bg,GraphicLayer:()=>Fe,GroundTexture:()=>sC,HeatmapElement:()=>Ne,HighlightPoi:()=>x0,HooksName:()=>xg,HoverHelper:()=>ei,InstancedModel:()=>Ue,InstancedParkingSpace:()=>pt,KalmanFilter:()=>he,Lane:()=>gi,Layer:()=>pg,LineElement:()=>yt,MapTypePolar:()=>W4,MergeAttributeGraphic:()=>uC,MergeAttributeGroundTexture:()=>aC,MergeAttributeLane:()=>Ci,MergeAttributeWall:()=>Ai,MergeGraphic:()=>$u,MergeParkingSpace:()=>He,MergedGraphicLayer:()=>Je,MergedModelLayer:()=>Le,Model:()=>We,MulFloorNavigation:()=>w0,MulFloorSelect:()=>B0,MulFloors:()=>d0,NavPath:()=>oi,Navigation:()=>f0,Overlay:()=>RC,ParkingLayer:()=>ke,ParkingType:()=>F4,PathDirection:()=>IA,PdrPosition:()=>ui,Poi:()=>oC,Poi2:()=>ug,PoiLayer:()=>Ze,PoiLayer2:()=>NC,Position:()=>E0,RENDER_VERSION:()=>Bt,RecommendParkingSpace:()=>v0,RoadNetwork:()=>Ls,RoadNetwork2:()=>Vs,SENSOR_TYPE:()=>J,SelectBox:()=>Qu,Selection:()=>ti,Sensor:()=>si,Shadow:()=>Re,Socket:()=>Kt,SortByDistance:()=>K0,SvgLine:()=>Qe,SvgPolygon:()=>qe,TaskQueue:()=>xC,TextTexture:()=>Ii,Timer:()=>tg,TweenUtil:()=>hA,UA:()=>bs,UseMyPosition:()=>b0,Wall:()=>$e,WorkerPool:()=>ce,addAlphaToHexColor:()=>b6,calc_angle:()=>ie,calc_direction:()=>an,calculateInstantaneousSpeed:()=>AN,calculateLineDirection:()=>ci,convertToSnakeCase:()=>zs,createCircle:()=>qC,createLine:()=>re,createRect:()=>cA,createSvg:()=>fs,createSvgElement:()=>ne,createThreeBox:()=>TG,createThreeLine:()=>GG,darkenColor:()=>gA,defaultConfig:()=>q2,defaultGraphicOptions:()=>rC,defaultOptions:()=>mr,defaultTextTextureOptions:()=>_2,deviceToVector3:()=>tK,dispose:()=>U,distancePointToSegment:()=>Ws,generatorKeyByObj:()=>_C,getAngle:()=>Ld,getBorderPoints:()=>Fn,getCenter:()=>ee,getConfig:()=>n0,getDirectPath:()=>gG,getDirectionByAngle:()=>un,getDistanceByPathPos:()=>Fs,getLength:()=>z,getLongestSideDir:()=>eK,getMinEdgeSquare:()=>iK,getPathLength:()=>Hg,getPointEdgeIndex:()=>qI,getPosByPathDistance:()=>EC,hasChinese:()=>us,hexToRgb:()=>on,initDirectionalLight:()=>ts,initLight:()=>Cs,initShape:()=>te,isAndroid:()=>x6,isContain:()=>lA,isControl:()=>vC,isIphone:()=>zA,isMac:()=>MC,isPointInPolygon:()=>ls,loadBuildingGround:()=>a0,loadExternalStreet:()=>R4,loadGraphics:()=>u0,mergeGraphicGeometries:()=>CY,mergeGraphicLineGeometries:()=>cD,moveOnRoute:()=>$6,predictFuturePosition:()=>xt,predictFutureSpeed:()=>CN,proxyOptions:()=>wC,removeOutliers:()=>tN,removeWeightPath:()=>Ud,setCirclePosition:()=>VA,setLineStartEnd:()=>mI,setRectPosition:()=>Wg,simplifyPath:()=>se,sleepByRf:()=>ms,sleepOnePromise:()=>ds,sleepOneRf:()=>tn,smoothPath:()=>Ns,strToNumber:()=>E6,timeoutPromise:()=>rI,toWebWorker:()=>KG,transformGraphicData:()=>ue,transformSpeed:()=>Ur,translatePosToCenter:()=>bC,triggerWorker:()=>ng,vector3ToDevice:()=>j,xhrGet:()=>Q6});module.exports=WB(nN);function D(){return D=Object.assign||function(g){for(var I=1;I<arguments.length;I++){var A=arguments[I];for(var C in A)Object.prototype.hasOwnProperty.call(A,C)&&(g[C]=A[C])}return g},D.apply(this,arguments)}var l5=l(W(),1),c5=l(_(),1),h5=l(DC(),1),cI=require("three");var D8=l(_(),1);var KF=l(OI(),1),GF=l(YI(),1),TF=l(jI(),1),OF=l(RI(),1),YF=l(NI(),1),jF=l(WI(),1),RF=l(FI(),1),NF=l(_(),1),tg=class{requestAnimationFrame(g){let I=window.requestAnimationFrame(()=>{this.tasks.requestAnimation.delete(I),g()});return this.tasks.requestAnimation.add(I),I}cancelAnimationFrame(g){this.tasks.requestAnimation.delete(g),window.cancelAnimationFrame(g)}setTimeout(g,I){let A=window.setTimeout(()=>{this.tasks.timeout.delete(A),g()},I);return this.tasks.timeout.add(A),A}clearTimeout(g){this.tasks.timeout.delete(g),window.clearTimeout(g)}setInterval(g,I){let A=window.setInterval(()=>{g()},I);return this.tasks.interval.add(A),A}clearInterval(g){this.tasks.interval.delete(g),window.clearInterval(g)}requestIdleCallback(g,I){let A=window.requestIdleCallback(C=>{this.tasks.requestIdleCallback.delete(A),g(C)},I);return this.tasks.requestIdleCallback.add(A),A}cancelIdleCallback(g){this.tasks.requestIdleCallback.delete(g),window.cancelIdleCallback(g)}dispose(){this.tasks.requestAnimation.forEach(g=>{window.cancelAnimationFrame(g)}),this.tasks.requestAnimation.clear(),this.tasks.requestIdleCallback.forEach(g=>{window.cancelIdleCallback(g)}),this.tasks.requestIdleCallback.clear(),this.tasks.timeout.forEach(g=>{window.clearTimeout(g)}),this.tasks.timeout.clear(),this.tasks.interval.forEach(g=>{window.clearInterval(g)}),this.tasks.interval.clear()}constructor(){this.tasks={requestAnimation:new Set,requestIdleCallback:new Set,timeout:new Set,interval:new Set}}};var FF=l(_(),1),ZF=l(W(),1),iI=require("three");function Cs(){let t=new iI.Group,g=new iI.AmbientLight(16777215,2.6);return t.add(g),t}function te(t,g){g===void 0&&(g=[]);let I=new iI.Shape(t.map(A=>new iI.Vector2(...A)));return g.length&&g.forEach(A=>{var C=new iI.Path(A.map(e=>new iI.Vector2(...e)));I.holes.push(C)}),I}function ts(t,g){t===void 0&&(t=16777215),g===void 0&&(g=1);let I=new iI.DirectionalLight(t,g);return I.castShadow=!0,I.shadow.radius=8,I.shadow.bias=-.001,I.shadow.mapSize.set(256,256),I.shadow.camera.left=-200,I.shadow.camera.right=200,I.shadow.camera.top=200,I.shadow.camera.bottom=-200,I}function U(t,g){if(g&&t.children&&t.children.length&&t.children.forEach(I=>{U(I,g)}),t.isMesh){let I=t;I.geometry&&I.geometry.dispose(),I.material&&(Array.isArray(I.material)?I.material.forEach(A=>{A.dispose()}):I.material.dispose())}t.isLight&&(t.dispose==null||t.dispose.call(t))}var qF=l(nI(),1);function us(t){return/[\u4E00-\u9FA5]+/g.test(t)}var gZ=l(_(),1),mg=require("three"),QC=require("@turf/turf");function j(t,g,I,A){let C=t.clone().project(g),e=I/2,i=A/2,n=Math.round(C.x*e+e),r=Math.round(-C.y*i+i);return{x:n,y:r}}function tK(t,g,I,A,C){if(!C)return null;I=Math.min(1,I),A=Math.min(1,A);let e=t/I*2-1,i=1-g/A*2;return new mg.Vector3(e,i,0).unproject(C)}function ee(t){let g=(0,QC.featureCollection)(t.map(A=>(0,QC.point)(A)));return(0,QC.center)(g).geometry.coordinates}function lA(t,g,I){return t.x>=g.x&&t.x<=I.x&&t.y>=g.y&&t.y<=I.y}function eK(t){let g=0,I=new mg.Vector3;for(let A=1;A<t.length;A++){let C=new mg.Vector3(t[A-1][0],t[A-1][1],0),e=new mg.Vector3(t[A][0],t[A][1],0),i=e.distanceTo(C);i>g&&(g=i,I=e.clone().sub(C).normalize())}return I}function z(t,g){return Math.sqrt((g[0]-t[0])**2+(g[1]-t[1])**2)}function Hg(t){let g=0;for(let I=0;I<t.length-1;I++)g+=z(t[I],t[I+1]);return g}function ie(t,g,I){let A=new mg.Vector2(g[0]-t[0],g[1]-t[1]),C=new mg.Vector2(g[0]-I[0],g[1]-I[1]),i=A.angleTo(C)*180/Math.PI,n=new mg.Vector2(g[0]-t[0],g[1]-t[1]);return new mg.Vector2(I[0]-t[0],I[1]-t[1]).cross(n)>0?i:-i}function iK(t,g){let I=Math.min(z(t[0][0],t[0][1]),z(t[0][2],t[0][1]))-1;g||(g=ee(t[0]));let A=nK(g,I),C=new mg.Vector2(t[0][0][0],t[0][0][1]),e=new mg.Vector2(t[0][1][0],t[0][1][1]),i=new mg.Vector2(t[0][2][0],t[0][2][1]),r=(C.distanceTo(e)>e.distanceTo(i)?e.clone().sub(C):i.clone().sub(e)).angleTo(new mg.Vector2(0,1)),o=new mg.Matrix3;return o.multiply(new mg.Matrix3().translate(g[0],g[1])).multiply(new mg.Matrix3().rotate(r)).multiply(new mg.Matrix3().translate(-g[0],-g[1])),[A.map(s=>{let a=new mg.Vector2(s[0],s[1]).applyMatrix3(o);return[a.x,a.y]})]}function nK(t,g){let I=g/2;return[[t[0]-I,t[1]+I],[t[0]+I,t[1]+I],[t[0]+I,t[1]-I],[t[0]-I,t[1]-I],[t[0]-I,t[1]+I]]}function qI(t,g){let I=0,A=1/0,[C,e]=g;for(let i=0;i<t.length-1;i++){let[n,r]=t[i],[o,s]=t[i+1],a=Math.min(n,o)<=C&&C<=Math.max(n,o),u=Math.min(r,s)<=e&&e<=Math.max(r,s);if(a&&u){let c=Math.abs((o-n)*(e-r)-(s-r)*(C-n));c<A&&(A=c,I=i)}}return I}function ls(t,g){let I=t[0],A=t[1],C=!1;for(let e=0,i=g.length-1;e<g.length;i=e++){let n=g[e][0],r=g[e][1],o=g[i][0],s=g[i][1];r>A!=s>A&&I<(o-n)*(A-r)/(s-r)+n&&(C=!C)}return C}var tZ=l(ff(),1);function wC(t,g){return new Proxy(t,{get:(I,A,C)=>Reflect.get(I,A,C),set:(I,A,C,e)=>{let i=Reflect.get(I,A,e),n=Reflect.set(I,A,C,e);return i!==C&&g.dispatchEvent({type:"change-"+A,value:C}),n}})}var pZ=l(_(),1),fZ=l(ps(),1);function rI(t,g){return Promise.race([t,new Promise((I,A)=>{setTimeout(()=>A(new Error("Promise timeout")),g)})])}function ne(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function fs(t,g){let I=ne("svg");return I.setAttribute("width",t),I.setAttribute("height",g),I.style.cssText="position: absolute; left: 0; top: 0; pointer-events: none;",I}function qC(t,g){t===void 0&&(t="2");let I=ne("circle");return I.setAttribute("r",t),I.setAttribute("fill",g),I}function re(t){let g=ne("line");return g.setAttribute("stroke",t),g}function cA(t,g){let I=ne("rect");return I.setAttribute("stroke",t),I.setAttribute("fill",g),I}function VA(t,g,I){t.setAttribute("cx",""+g),t.setAttribute("cy",""+I)}function mI(t,g,I){g&&(t.setAttribute("x1",""+g.x),t.setAttribute("y1",""+g.y)),I&&(t.setAttribute("x2",""+I.x),t.setAttribute("y2",""+I.y))}function Wg(t,g,I,A,C){t.setAttribute("x",""+g),t.setAttribute("y",""+I),t.setAttribute("width",""+A),t.setAttribute("height",""+C)}function ds(){return Promise.resolve()}function tn(){return new Promise(t=>{requestAnimationFrame(t)})}function ms(t){return t===void 0&&(t=1),new Promise(g=>{function I(){t<=0?g(!0):(t--,window.requestAnimationFrame(I))}window.requestAnimationFrame(I)})}var GZ=l(oe(),1),TZ=l(nI(),1),OZ=l(rn(),1);function E6(t){return parseInt(t.replace("#","0x"),16)}function b6(t,g){let I=parseInt(t.substring(1,3),16),A=parseInt(t.substring(3,5),16),C=parseInt(t.substring(5,7),16),e=Math.round(I*g),i=Math.round(A*g),n=Math.round(C*g);return"#"+(1<<24|e<<16|i<<8|n).toString(16).slice(1)}function gA(t,g){g===void 0&&(g=.85);let I,A,C;if(t.startsWith("#"))I=parseInt(t.substring(1,3),16),A=parseInt(t.substring(3,5),16),C=parseInt(t.substring(5,7),16);else{let i=t.slice(4,-1).split(",");I=parseInt(i[0].trim()),A=parseInt(i[1].trim()),C=parseInt(i[2].trim())}return I=Math.min(Math.floor(I*g),255),A=Math.min(Math.floor(A*g),255),C=Math.min(Math.floor(C*g),255),"#"+((1<<24)+(I<<16)+(A<<8)+C).toString(16).slice(1)}function on(t,g){t=t.replace(/^#/,"");let I=parseInt(t.substring(0,2),16),A=parseInt(t.substring(2,4),16),C=parseInt(t.substring(4,6),16);return g!==void 0?"rgba("+I+", "+A+", "+C+", "+g+")":"rgb("+I+", "+A+", "+C+")"}var jZ=l(nI(),1),MC=navigator.userAgent.toUpperCase().indexOf("MAC")>=0,bs=(navigator.userAgent||"").toLocaleLowerCase(),zA=/ios|iphone/i.test(bs),x6=/android|adr|linux/gi.test(bs);function vC(t){return MC?t==="Meta":t==="Control"}var FZ=l(OI(),1),ZZ=l(YI(),1),kZ=l(jI(),1),HZ=l(RI(),1),LZ=l(NI(),1),UZ=l(WI(),1),XZ=l(FI(),1),VZ=l(_(),1),xs="__once__",Ks=class{on(g,I){if(typeof I!="function")return;let A=this.events.get(g);return A?A.add(I):this.events.set(g,new Set([I]))}once(g,I){if(typeof I!="function")return;let A=""+xs+g,C=this.events.get(A);return C?C.add(I):this.events.set(A,new Set([I]))}off(g,I){let A=this.events.get(g),C=this.events.get(""+xs+g);!A&&!C||(I===void 0&&(A==null||A.clear(),C==null||C.clear()),A!=null&&A.has(I)&&A.delete(I),C!=null&&C.has(I)&&C.delete(I))}offAll(){this.events.clear()}emit(g){for(var I=arguments.length,A=new Array(I>1?I-1:0),C=1;C<I;C++)A[C-1]=arguments[C];let e=this.events.get(g),i=this.events.get(""+xs+g);!e&&!i||(e==null||e.forEach(n=>{typeof n=="function"&&n(...A)}),i==null||i.forEach(n=>{typeof n=="function"&&n(...A)}),i==null||i.clear())}constructor(){this.events=new Map}};var xg=function(t){return t.SWITCH_FLOOR_BEFORE="switch_floor_before",t.SWITCH_FLOOR_GROUND="switch_floor_ground",t.SWITCH_FLOOR_AFTER="switch_floor_after",t}({});var ek=l(PC(),1);function _C(t){return Object.keys(t).sort().map(g=>g+"="+t[g]).join("&")}function Q6(t,g){return new Promise((I,A)=>{let C=new XMLHttpRequest;C.open("GET",t,!0),Object.keys(g.headers||{}).forEach(e=>{C.setRequestHeader(e,g.headers[e])}),g.responseType&&(C.responseType=g.responseType),C.onload=()=>{if(C.status>=200&&C.status<300)if(g.responseType==="arraybuffer")I(C.response);else try{let e=JSON.parse(C.responseText);I(e)}catch(e){A(e)}else A(C.statusText)},C.onerror=()=>{A(C.statusText)},C.send()})}var sk=l(_(),1),ak=l(W(),1),gt=require("three"),Hd=l(kd(),1);function Ld(t,g){let I=t.clone().normalize(),A=g.clone().normalize();return Math.acos(I.dot(A))}function q6(t){let g=0;return t.reduce((I,A)=>{let[C,e]=I,[i,n]=A;return g+=Math.sqrt((i-C)**2+(n-e)**2),[i,n]}),g/t.length}function Ns(t,g){if(g===void 0&&(g=.25),q6(t)<g)return t;let I=(0,Hd.default)(t);return Ns(I,g)}function se(t,g,I,A,C,e){g===void 0&&(g=!1),I===void 0&&(I=!0),A===void 0&&(A=5),C===void 0&&(C=150),e===void 0&&(e=3);let i=[],n=!g;if(i.push(t[0]),t.length<2)return i;for(let o=0;o<t.length-2;o+=1){let s=t[o],a=t[o+1],u=t[o+2],c=new gt.Vector2(s[0]-a[0],s[1]-a[1]),h=new gt.Vector2(u[0]-a[0],u[1]-a[1]),f=Ld(c,h)/Math.PI*180,d=c.length()+h.length();(!n||f<C&&d>.01||d>A)&&(i.push(t[o+1]),n=!0)}if(i.push(t[t.length-1]),!I)return i;let r=[];r.push(i[0]);for(let o=0;o<i.length-2;o+=1){let s=new gt.Vector2(i[o][0],i[o][1]),a=new gt.Vector2(i[o+1][0],i[o+1][1]),u=new gt.Vector2(i[o+2][0],i[o+2][1]),c=s.distanceTo(a)/2,h=u.distanceTo(a)/2,f=a.clone(),d=a.clone();f.add(s.clone().sub(a).normalize().multiplyScalar(c>e?e/2:c)),d.add(u.clone().sub(a).normalize().multiplyScalar(h>e?e/2:h));let S=[[f.x,f.y],[a.x,a.y],[d.x,d.y]];r.push(...Ns(S,e/25))}return r.push(i[i.length-1]),Ud(r)}function Ud(t){if(t.length<=1)return t;let g=[],I;return t.forEach(A=>{let[C,e]=A;I?C===I[0]&&e===I[1]||(I=[C,e],g.push([C,e])):(I=[C,e],g.push([C,e]))}),g}function Ws(t,g,I){let A=Math.sqrt((I[0]-g[0])**2+(I[1]-g[1])**2);if(A===0)return{distance:Math.sqrt((t[0]-g[0])**2+(t[1]-g[1])**2),closestPoint:g.slice(0)};let C=Math.max(0,Math.min(1,((t[0]-g[0])*(I[0]-g[0])+(t[1]-g[1])*(I[1]-g[1]))/A**2)),e=[g[0]+C*(I[0]-g[0]),g[1]+C*(I[1]-g[1])];return{distance:Math.sqrt((t[0]-e[0])**2+(t[1]-e[1])**2),closestPoint:e}}function $6(t,g,I){let[A,C]=t,[e,i]=g,n=Math.sqrt(Math.pow(e-A,2)+Math.pow(i-C,2));if(n===0||n<I)return[...g];let r=I/n,o=A+(e-A)*r,s=C+(i-C)*r;return[o,s]}var IA=function(t){return t.START="start",t.END="end",t.FRONT="front",t.RIGHT="right",t.LEFT="left",t.RIGHT_FRONT="right_front",t.LEFT_FRONT="left_front",t.RIGHT_BACK="right_back",t.LEFT_BACK="left_back",t}({});function an(t,g,I){let A=ie(t,g,I);return un(A)}function un(t){return 180-Math.abs(t)<15?"front":t>135?"right_front":t<-135?"left_front":t<=135&&t>=60?"right":t>=-135&&t<=-60?"left":t<60&&t>0?"right_back":t>-60&&t<0?"left_back":"front"}function gG(t){if(!t.length)return[];if(t.length===1)return[{direction:"start",distance:0,points:t}];let g=[{direction:"start",distance:z(t[0],t[1]),points:[t[0],t[1]]}];for(let I=2;I<t.length;I++){let A=an(t[I-2],t[I-1],t[I]);if(A==="front"){let C=g[g.length-1],e=z(t[I-1],t[I]);C.distance+=e,I!==2&&C.points.push(t[I-1])}else g.push({direction:A,distance:z(t[I-1],t[I]),points:[t[I-1],t[I]]})}return g.push({direction:"end",distance:0,points:[t[t.length-1]]}),g}function Fs(t,g){if(t.length<2)return-1;let I=0;for(let A=1;A<t.length;A++){let C=t[A-1],e=t[A],i=[g[0]-C[0],g[1]-C[1]],n=[e[0]-C[0],e[1]-C[1]],r=Math.min(e[0],C[0])<=g[0]&&g[0]<=Math.max(e[0],C[0]),o=Math.min(e[1],C[1])<=g[1]&&g[1]<=Math.max(e[1],C[1]);if(r&&o){let s=i[0]*n[1]-i[1]*n[0];if(Math.abs(s)<1e-6){let a=Math.sqrt((g[0]-C[0])**2+(g[1]-C[1])**2);return I+a}}I+=Math.sqrt((e[0]-C[0])**2+(e[1]-C[1])**2)}return-1}function EC(t,g){if(t.length<2){var I;return(I=t[0])!=null?I:null}let A=0;for(let C=1;C<t.length;C++){let e=t[C-1],i=t[C],n=Math.sqrt((i[0]-e[0])**2+(i[1]-e[1])**2);if(A+=n,A>=g){let r=(g-(A-n))/n,o=e[0]+(i[0]-e[0])*r,s=e[1]+(i[1]-e[1])*r;return[o,s]}}return null}var yk=l(W(),1),Sk=l(_(),1),Dk=l(nI(),1),AA=l(Hs(),1);var yI="___",Ls=class{initRoute(g){this.clear(),this.roadInfo=g,g.length&&(g.forEach(I=>{I.points.forEach(A=>{let C=""+I.floor+yI+A.id;if(this.pointMap.set(C,A),this.nodeMap.set(""+A.floor+yI+A.nodeId,C),A.type==="straightLadder"){let e=this.straightLadderMap.get(A.name)||[];e.push(D({},A)),this.straightLadderMap.set(A.name,e)}if(A.type==="staircase"){let e=this.staircaseMap.get(A.name)||[];e.push(D({},A)),this.staircaseMap.set(A.name,e)}if(A.type==="escalator"){let e=this.escalatorMap.get(A.name)||{};A.escalatorDirection==="exit"?e.end={floor:A.floor,id:A.id}:e.start={floor:A.floor,id:A.id},this.escalatorMap.set(A.name,e)}if(A.type==="facility"){let e=this.facilityMap.get(A.targetId)||[];e.push(D({},A)),this.facilityMap.set(A.targetId,e)}}),I.lines.filter(A=>A.direction!=="no").forEach(A=>{var C,e;let i=""+I.floor+yI+A.from,n=""+I.floor+yI+A.to,r=(C=this.pointMap.get(i))==null?void 0:C.cds,o=(e=this.pointMap.get(n))==null?void 0:e.cds;if(r!=null&&r.length&&(o!=null&&o.length)){let s=z(r,o);this.addLineItem(i,n,s),A.direction==="double"&&this.addLineItem(n,i,s)}})}),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute())}addLineItem(g,I,A,C){C===void 0&&(C=this.lineMap);let e=C.get(g)||new Map;e.set(I,A),C.set(g,e)}addFacilityToLineMap(g,I,A,C){[...this.straightLadderMap,...this.staircaseMap].forEach(e=>{let[i,n]=e;if(!(n.length<2))for(let s=0;s<n.length;s++){let a=""+n[s].floor+yI+n[s].id;for(let u=0;u<n.length;u++)if(s!==u){var r,o;let c=""+n[u].floor+yI+n[u].id,h=(r=this.pointMap.get(a))==null?void 0:r.cds,f=(o=this.pointMap.get(c))==null?void 0:o.cds;if(h!=null&&h.length&&(f!=null&&f.length))if(n[s].type==="straightLadder"){let d=I;this.addLineItem(a,c,d,C)}else{let d=A;this.addLineItem(a,c,d,C)}}}}),this.escalatorMap.forEach((e,i)=>{if(e.start&&e.end){var n,r;let o=""+e.start.floor+yI+e.start.id,s=""+e.end.floor+yI+e.end.id,a=(n=this.pointMap.get(o))==null?void 0:n.cds,u=(r=this.pointMap.get(s))==null?void 0:r.cds;if(a!=null&&a.length&&(u!=null&&u.length)){let c=g;this.addLineItem(o,s,c,C)}}})}initBaseRoute(){let g=new Map([...this.lineMap]);this.addFacilityToLineMap(1,this.lift_priority,3e4,g),this.baseRoute=new AA.default(g)}initEscalatorRoute(){let g=new Map([...this.lineMap]),I=1e4;this.addFacilityToLineMap(1*I,this.lift_priority*I,3e4*I,g),this.escalatorRoute=new AA.default(g)}initStraightLadderRoute(){let g=new Map([...this.lineMap]),I=1e4;this.addFacilityToLineMap(3*I,1*I,3e4*I,g),this.straightLadderRoute=new AA.default(g)}checkStart(g){return!(!g.floor||!g.nodeId&&(!g.coord||g.coord.length<2))}checkEnd(g){return g.facility?!0:this.checkStart(g)}transformStart(g){var I;if(g.nodeId){let A=this.nodeMap.get(""+g.floor+yI+g.nodeId);if(A){let[C,e]=A.split(yI);return{floor:C,id:e}}}if((I=g.coord)!=null&&I.length){let A=this.roadInfo.find(e=>e.floor===g.floor);if(!A)return null;let C=A.points.reduce((e,i)=>{let n=z(g.coord,i.cds);return n<e.min&&(e.min=n,e.point=i),e},{min:1/0,point:A.points[0]});return{floor:C.point.floor,id:C.point.id}}return null}transformEnd(g){if(g.floor){let I=this.transformStart(g);if(I)return I}if(g.facility){let I=this.facilityMap.get(g.facility);if(I!=null&&I.length)return{floor:g.floor,facility:g.facility}}return null}getPath(g,I,A){if(A===void 0&&(A=""),!this.checkStart(g))return"start-error";if(!this.checkEnd(I))return"end-error";let C=this.transformStart(g);if(!C)return"no-start";let e=this.transformEnd(I);if(!e)return"no-end";let i=this.getBasePath.bind(this);switch(A){case"escalator":i=this.getEscalatorPath.bind(this);break;case"straightLadder":i=this.getStraightLadderPath.bind(this);break;default:i=this.getBasePath.bind(this);break}if(e.id)return i(C,e);if(e.facility){let n=this.facilityMap.get(e.facility).filter(o=>e.floor?o.floor===e.floor:!0);if(!n.length)return null;let r=n.map(o=>i(C,{floor:o.floor,id:o.id})).filter(o=>!!o);return r.reduce((o,s)=>{let a=s.reduce((u,c)=>u+Hg(c.points),0);return a<o.distance&&(o.distance=a,o.path=s),o},{distance:1/0,path:r[0]}).path}}getRoutePath(g,I,A){let C=""+g.floor+yI+g.id,e=""+I.floor+yI+I.id,i=A.path(C,e);if(!i)return null;let n=[];return i.map(r=>{let o=this.pointMap.get(r);if(o){var s;let{floor:a}=o;if(((s=n[n.length-1])==null?void 0:s.floor)===a){let u=n[n.length-1];u.points.push(o.cds),u.endType=o.type,u.destId=o.nodeId,u.distance=Hg(u.points)}else n.push({floor:a,points:[o.cds],endType:o.type,destId:o.nodeId,distance:0})}}),n}getBasePath(g,I){return this.getRoutePath(g,I,this.baseRoute)}getEscalatorPath(g,I){return this.getRoutePath(g,I,this.escalatorRoute)}getStraightLadderPath(g,I){return this.getRoutePath(g,I,this.straightLadderRoute)}clear(){this.roadInfo=[],this.pointMap.clear(),this.nodeMap.clear(),this.facilityMap.clear(),this.straightLadderMap.clear(),this.escalatorMap.clear(),this.staircaseMap.clear(),this.lineMap.clear(),this.baseRoute=new AA.default,this.escalatorRoute=new AA.default,this.straightLadderRoute=new AA.default}constructor(g=3){this.lift_priority=g,this.roadInfo=[],this.pointMap=new Map,this.nodeMap=new Map,this.facilityMap=new Map,this.straightLadderMap=new Map,this.escalatorMap=new Map,this.staircaseMap=new Map,this.lineMap=new Map,this.baseRoute=new AA.default,this.escalatorRoute=new AA.default,this.straightLadderRoute=new AA.default}};var Yk=l(_(),1),jk=l(nI(),1),Rk=l(W(),1),Nk=l(OI(),1),Wk=l(YI(),1),Fk=l(jI(),1),Zk=l(RI(),1),kk=l(NI(),1),Hk=l(WI(),1),Lk=l(FI(),1),Uk=l(hn(),1),Xk=l(pn(),1),Kg=l(Hs(),1);var Jg=require("lodash"),fn=require("three"),k="___",Vs=class{isFacilityByType(g){return["facility","escalator","straightLadder","staircase","ramp","connectionPoint"].includes(g)}initFacilities(g){this.facilities=g.map(I=>{let A=[];try{A=JSON.parse(I.entry_end_floor)}catch(e){A=[]}let C=[];try{C=JSON.parse(I.entry_start_floor)}catch(e){C=[]}return D({},I,{entry_start_floor:C,entry_end_floor:A})})}getParkingSpaceInfo(g,I){let A=""+g+k+I;var C;return(C=this.parkingMap.get(A))!=null?C:null}getNodeInfo(g,I){let A=""+g+k+I,C=this.nodeMap.get(A);if(!(C!=null&&C.length))return null;let e=this.pointMap.get(C[0]);return e!=null?e:null}initRoute(g,I){this.clear(),this.roadInfo=g,this.initFacilities(I);let A=new Date,C=A.getHours()*60+A.getMinutes();g.length&&(g.forEach(e=>{let i=(e.points||[]).filter(n=>!(0,Jg.isNil)(n.passWeight)&&n.passWeight!==1&&!(0,Jg.isNil)(n.coverageArea)&&n.coverageArea!==0);(e.points||[]).filter(n=>n.openStatus!==!1).filter(n=>{if(!n.startTime||!n.endTime)return!0;let[r,o]=n.startTime.split(":").map(h=>+h),[s,a]=n.endTime.split(":").map(h=>+h),u=r*60+o,c=s*60+a;return C>=u&&C<=c}).forEach(n=>{n.floor=e.floor;let r=""+e.floor+k+n.id,o=""+e.floor+k+n.nodeId,s=this.nodeMap.get(o)||[];if(s.push(""+e.floor+k+(n.relatedId||n.id)),this.nodeMap.set(""+e.floor+k+n.nodeId,s),this.pointMap.set(r,n),this.isFacilityByType(n.type)){let a=this.facilities.find(u=>u.id===+n.targetId);if(a){switch(a.entry_infra_type){case"straightLadder":if(a.entry_end_floor.find(f=>f.floor===e.floor)&&a.entry_start_floor.find(f=>f.floor===e.floor)){let f=this.straightLadderMap.get(n.targetId)||[];f.push(D({},n)),this.straightLadderMap.set(n.targetId,f)}break;case"staircase":if(a.entry_end_floor.find(f=>f.floor===e.floor)&&a.entry_start_floor.find(f=>f.floor===e.floor)){let f=this.staircaseMap.get(n.targetId)||[];f.push(D({},n)),this.staircaseMap.set(n.targetId,f)}break;case"escalator":let c=this.escalatorMap.get(n.targetId)||[];if(a.entry_start_floor.find(f=>f.floor===e.floor)){let f=c.find(d=>{var S;return((S=d.end)==null?void 0:S.floor)!==e.floor&&!d.start});f?f.start=n:c.push({start:n})}if(a.entry_end_floor.find(f=>f.floor===e.floor)){let f=c.find(d=>{var S;return((S=d.start)==null?void 0:S.floor)!==e.floor&&!d.end});f?f.end=n:c.push({end:n})}this.escalatorMap.set(n.targetId,c);break;case"ramp":let h=this.rampMap.get(n.targetId)||[];if(a.entry_start_floor.find(f=>f.floor===e.floor)){let f=h.find(d=>{var S;return((S=d.end)==null?void 0:S.floor)!==e.floor&&!d.start});f?f.start=n:h.push({start:n})}if(a.entry_end_floor.find(f=>f.floor===e.floor)){let f=h.find(d=>{var S;return((S=d.start)==null?void 0:S.floor)!==e.floor&&!d.end});f?f.end=n:h.push({end:n})}this.rampMap.set(n.targetId,h);break;case"connectionPoint":if(a.entry_end_floor.find(f=>f.floor===e.floor)&&a.entry_start_floor.find(f=>f.floor===e.floor)){let f=this.connectionPointMap.get(n.targetId)||[];f.push(D({},n)),this.connectionPointMap.set(n.targetId,f)}break}let u=this.facilityMap.get(n.targetId)||[];u.push(D({},n)),this.facilityMap.set(n.targetId,u)}}n.type==="parkingSpace"&&n.name.split(/[,,]/).forEach(u=>{this.parkingMap.set(""+e.floor+k+u,n)})}),(e.lines||[]).filter(n=>n.to!==n.from).forEach(n=>{let r=""+e.floor+k+n.from,o=""+e.floor+k+n.to,s=this.pointMap.get(r),a=this.pointMap.get(o);if(!s||!a)return;let u=s.cds,c=a.cds,h=z(u,c);if(i.forEach(f=>{(f.id===n.from||f.id===n.to)&&(h=h/f.passWeight);let d=z(u,f.cds)<=f.coverageArea,S=z(c,f.cds)<=f.coverageArea;(d||S)&&(h=h/f.passWeight)}),!s.permission&&!a.permission){switch(this.addLineItem(r,o,h),this.addLineItem(o,r,h),n.direction){case"double":this.addLineItem(r,o,h,this.forwardLineMap),this.addLineItem(o,r,h,this.forwardLineMap);break;case"single":this.addLineItem(r,o,h,this.forwardLineMap);break;case"back":this.addLineItem(o,r,h,this.forwardLineMap);break}(s.type==="parkingSpace"||a.type==="parkingSpace")&&n.direction==="noDir"&&(this.addLineItem(r,o,h,this.forwardLineMap),this.addLineItem(o,r,h,this.forwardLineMap))}else s.permission&&(this.setPermissionLine(r,o,s.permission,h,""),this.setPermissionLine(o,r,s.permission,h,"")),a.permission&&a.permission!==s.permission&&(this.setPermissionLine(r,o,a.permission,h,""),this.setPermissionLine(o,r,a.permission,h,""))})}),this.addPermissionFacility(),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute(),this.initForwardRoute())}getPermissionMap(g){return this["permission_"+g]||(this["permission_"+g]=new Set),this["permission_"+g]}setPermissionLine(g,I,A,C,e){this.getPermissionMap(A).add({fromKey:g,toKey:I,distance:C,type:e})}addPermissionFacility(){this.straightLadderMap.forEach((g,I)=>{if(g.length<2){this.straightLadderMap.delete(I);return}for(let A=0;A<g.length;A++){let C=""+g[A].floor+k+g[A].id,e=this.pointMap.get(C);if(e){for(let i=0;i<g.length;i++)if(A!==i){let n=""+g[i].floor+k+g[i].id,r=this.pointMap.get(n);if(!r)continue;e.permission&&this.setPermissionLine(C,n,e.permission,1,"straightLadder"),r.permission&&r.permission!==e.permission&&this.setPermissionLine(C,n,r.permission,1,"straightLadder")}}}}),this.staircaseMap.forEach((g,I)=>{if(g.length<2){this.staircaseMap.delete(I);return}for(let A=0;A<g.length;A++){let C=""+g[A].floor+k+g[A].id,e=this.pointMap.get(C);if(e){for(let i=0;i<g.length;i++)if(A!==i){let n=""+g[i].floor+k+g[i].id,r=this.pointMap.get(n);if(!r)continue;e.permission&&this.setPermissionLine(C,n,e.permission,1,"staircase"),r.permission&&r.permission!==e.permission&&this.setPermissionLine(C,n,r.permission,1,"staircase")}}}}),this.escalatorMap.forEach((g,I)=>{g.forEach(A=>{if(A.start&&A.end){let C=""+A.start.floor+k+A.start.id,e=""+A.end.floor+k+A.end.id,i=this.pointMap.get(C),n=this.pointMap.get(e);i&&n&&(i.permission&&this.setPermissionLine(C,e,i.permission,1,"escalator"),n.permission&&n.permission!==i.permission&&this.setPermissionLine(C,e,n.permission,1,"escalator"))}})}),this.rampMap.forEach((g,I)=>{g.forEach(A=>{if(A.start&&A.end){let C=""+A.start.floor+k+A.start.id,e=""+A.end.floor+k+A.end.id,i=this.pointMap.get(C),n=this.pointMap.get(e);i&&n&&(i.permission&&this.setPermissionLine(C,e,i.permission,10,"ramp"),n.permission&&n.permission!==i.permission&&this.setPermissionLine(C,e,n.permission,10,"ramp"))}})}),this.connectionPointMap.forEach((g,I)=>{if(g.length<2){this.connectionPointMap.delete(I);return}for(let A=0;A<g.length;A++){let C=""+g[A].floor+k+g[A].id,e=this.pointMap.get(C);if(e){for(let i=0;i<g.length;i++)if(A!==i){let n=""+g[i].floor+k+g[i].id,r=this.pointMap.get(n);if(!r)continue;e.permission&&this.setPermissionLine(C,n,e.permission,1,"connectionPoint"),r.permission&&r.permission!==e.permission&&this.setPermissionLine(C,n,r.permission,1,"connectionPoint")}}}})}addPermissionLineToMap(g,I,A,C){this.getPermissionMap(g).forEach(i=>{I.includes(i.type)&&(i.type===""?this.addLineItem(i.fromKey,i.toKey,i.distance,A):this.addLineItem(i.fromKey,i.toKey,C.get(i.type),A))})}addLineItem(g,I,A,C){C===void 0&&(C=this.lineMap);let e=C.get(g)||new Map;e.set(I,A),C.set(g,e)}addFacilityToLineMap(g,I,A,C){[...this.straightLadderMap,...this.staircaseMap].forEach(e=>{let[i,n]=e;if(!(n.length<2))for(let r=0;r<n.length;r++){let o=""+n[r].floor+k+n[r].id,s=this.pointMap.get(o);if(!(!s||s.permission)){for(let a=0;a<n.length;a++)if(r!==a){let u=""+n[a].floor+k+n[a].id,c=this.pointMap.get(u);if(!c||c.permission)continue;if(n[r].type==="straightLadder"){let h=I;this.addLineItem(o,u,h,C)}else{let h=A;this.addLineItem(o,u,h,C)}}}}}),this.escalatorMap.forEach((e,i)=>{e.forEach(n=>{if(n.start&&n.end){let r=""+n.start.floor+k+n.start.id,o=""+n.end.floor+k+n.end.id,s=this.pointMap.get(r),a=this.pointMap.get(o);if(s&&a&&!s.permission&&!a.permission){let u=g;this.addLineItem(r,o,u,C)}}})}),this.connectionPointMap.forEach((e,i)=>{if(!(e.length<2))for(let n=0;n<e.length;n++){let r=""+e[n].floor+k+e[n].id,o=this.pointMap.get(r);if(!(!o||o.permission)){for(let s=0;s<e.length;s++)if(n!==s){let a=""+e[s].floor+k+e[s].id,u=this.pointMap.get(a);if(!u||u.permission)continue;this.addLineItem(r,a,100,C)}}}})}initBaseRoute(){let g=new Map((0,Jg.cloneDeep)([...this.lineMap]));this.addFacilityToLineMap(100,100*this.lift_priority,3e4,g),this.baseRoute=new Kg.default(g)}initEscalatorRoute(){let g=new Map((0,Jg.cloneDeep)([...this.lineMap])),I=1e4;this.addFacilityToLineMap(1*I,this.lift_priority*I,3e4*I,g),this.escalatorRoute=new Kg.default(g)}initStraightLadderRoute(){let g=new Map((0,Jg.cloneDeep)([...this.lineMap])),I=1e4;this.addFacilityToLineMap(3*I,1*I,3e4*I,g),this.straightLadderRoute=new Kg.default(g)}initForwardRoute(){this.rampMap.forEach((g,I)=>{g.forEach(A=>{if(A.start&&A.end){let C=""+A.start.floor+k+A.start.id,e=""+A.end.floor+k+A.end.id,i=this.pointMap.get(C),n=this.pointMap.get(e);i&&n&&!i.permission&&!n.permission&&this.addLineItem(C,e,10,this.forwardLineMap)}})}),this.connectionPointMap.forEach((g,I)=>{if(!(g.length<2))for(let A=0;A<g.length;A++){let C=""+g[A].floor+k+g[A].id,e=this.pointMap.get(C);if(!(!e||e.permission)){for(let i=0;i<g.length;i++)if(A!==i){let n=""+g[i].floor+k+g[i].id,r=this.pointMap.get(n);if(!r||r.permission)continue;this.addLineItem(C,n,100,this.forwardLineMap)}}}}),this.forwardRoute=new Kg.default(this.forwardLineMap)}checkStart(g){return!(!g.floor||!g.nodeId&&(!g.coord||g.coord.length<2))}checkEnd(g){return g.facility||g.parkingSpace&&g.floor?!0:this.checkStart(g)}transformStart(g,I,A){A===void 0&&(A={});var C;if(g.nodeId){let e=this.nodeMap.get(""+g.floor+k+g.nodeId);if(e!=null&&e.length)return e.map(i=>{let[n,r]=i.split(k);return{floor:n,id:r}})}if((C=g.coord)!=null&&C.length){let e=this.roadInfo.find(o=>o.floor===g.floor);if(!e)return null;let i=e.points.filter(o=>o.isStarted),n=e.points.filter(o=>{let s=""+o.floor+k+o.id;if(I==="forward"){if(!this.forwardLineMap.has(s)||A.adsorptionIntersection&&i.length&&!o.isStarted)return!1}else if(!this.lineMap.has(s))return!1;return!0});if(!n.length)return null;let r=n.reduce((o,s)=>{if(s.relatedId)return o;let a=z(g.coord,s.cds);return a<o.min&&(o.min=a,o.point=s),o},{min:1/0,point:n[0]});return[{floor:e.floor,id:r.point.id}]}return null}transformEnd(g,I){if(g.floor){if(g.parkingSpace){let C=this.parkingMap.get(""+g.floor+k+g.parkingSpace);if(C)return[{floor:g.floor,id:C.id}]}let A=this.transformStart(g,I);if(A)return A}if(g.facility){let C=this.facilities.filter(e=>+e.type_id==+g.facility).map(e=>e.id).map(e=>this.facilityMap.get(""+e)).flat(2);if(C!=null&&C.length)return{floor:g.floor,facility:g.facility}}return null}getPath(g,I,A,C,e,i){if(A===void 0&&(A=""),i===void 0&&(i={}),!this.checkStart(g))return"start-error";if(!this.checkEnd(I))return"end-error";let n=this.transformStart(g,A,i);if(!n)return"no-start";let r=this.transformEnd(I,A);if(!r)return"no-end";let o=[];if(Array.isArray(r))for(let u=0;u<n.length;u++){let c=n[u];for(let h=0;h<r.length;h++){let f=r[h];if(c.floor===f.floor&&c.id===f.id)return"near"}}else{o=this.facilities.filter(c=>+c.type_id==+I.facility).map(c=>c.id).map(c=>this.facilityMap.get(""+c)).flat(2).filter(c=>c).filter(c=>r.floor?c.floor===r.floor:!0);for(let c=0;c<n.length;c++){let h=n[c];for(let f=0;f<o.length;f++){let d=o[f];if(h.floor===d.floor&&h.id===d.id)return"near"}}}let s;switch(A){case"escalator":s=this.getEscalatorPath.bind(this);break;case"straightLadder":s=this.getStraightLadderPath.bind(this);break;case"forward":s=this.getForwardPath.bind(this);break;default:s=this.getBasePath.bind(this);break}let a=null;return n.forEach(u=>{if(Array.isArray(r))r.forEach(c=>{let h=s(u,c,C,e);h&&h&&(!a||h[0].consume<a[0].consume)&&(a=h)});else{if(!o.length)return null;let c=o.map(h=>s(u,{floor:h.floor,id:h.id},C,e)).filter(h=>!!h);a=c.reduce((h,f)=>{let d=f[0].consume;return d<h.distance&&(h.distance=d,h.path=f),h},{distance:1/0,path:c[0]}).path}}),a}getRoutePath(g,I,A){let C=""+g.floor+k+g.id,e=""+I.floor+k+I.id,i=A.path(C,e);if(!i)return null;let n=[],r=i.reduce((o,s,a,u)=>{if(a===0)return 0;let c=u[a-1],h=A.graph.get(c).get(s);return o+h},0);return i.map(o=>{let s=this.pointMap.get(o);if(s){var a;let{floor:u}=s,c=s.type;if(this.isFacilityByType(s.type)){let h=this.facilities.find(f=>f.id===+s.targetId);h&&(c=h.entry_infra_type)}if(((a=n[n.length-1])==null?void 0:a.floor)===u){let h=n[n.length-1];h.points.push(s.cds),h.pointInfos.push(s),h.endType=c,h.destId=s.nodeId,h.distance=Hg(h.points)}else n.push({floor:u,points:[s.cds],pointInfos:[s],endType:c,destId:s.nodeId,distance:0,consume:r})}}),n}getBasePath(g,I,A){if(!A)return this.getRoutePath(g,I,this.baseRoute);let C=(0,Jg.cloneDeep)(this.baseRoute.graph);this.addPermissionLineToMap(A,["","escalator","staircase","straightLadder","connectionPoint"],C,new Map([["escalator",100],["connectionPoint",100],["straightLadder",100*this.lift_priority],["staircase",3e4]]));let e=new Kg.default(C);return this.getRoutePath(g,I,e)}getEscalatorPath(g,I,A){if(!A)return this.getRoutePath(g,I,this.escalatorRoute);let C=(0,Jg.cloneDeep)(this.escalatorRoute.graph),e=1e4;this.addPermissionLineToMap(A,["","escalator","staircase","straightLadder","connectionPoint"],C,new Map([["escalator",1*e],["connectionPoint",100],["straightLadder",this.lift_priority*e],["staircase",3e4*e]]));let i=new Kg.default(C);return this.getRoutePath(g,I,i)}getStraightLadderPath(g,I,A){if(!A)return this.getRoutePath(g,I,this.straightLadderRoute);let C=(0,Jg.cloneDeep)(this.straightLadderRoute.graph),e=1e4;this.addPermissionLineToMap(A,["","escalator","staircase","straightLadder","connectionPoint"],C,new Map([["escalator",3*e],["connectionPoint",100],["straightLadder",1*e],["staircase",3e4*e]]));let i=new Kg.default(C);return this.getRoutePath(g,I,i)}getForwardPath(g,I,A,C){let e=new Map,i=u=>{let c=this.forwardRoute.graph.get(r);u.forEach(h=>{let f=c.get(h);(0,Jg.isNil)(f)||(e.set(h,f),c.delete(h))})},n=()=>{let u=this.forwardRoute.graph.get(r);e.forEach((c,h)=>{u.set(h,c)})},r=""+g.floor+k+g.id;if(!(0,Jg.isNil)(C)){let u=this.forwardLineMap.get(r),c=this.pointMap.get(r);if(c&&(u!=null&&u.size)&&u.size>1){let h=new fn.Vector2(c.cds[0],c.cds[1]),f=new Map;u.forEach((S,w)=>{let M=this.pointMap.get(w);if(M){let K=new fn.Vector2(M.cds[0],M.cds[1]),N=360-(new fn.Vector2().subVectors(K,h).angle()/Math.PI*180-90+360)%360;f.set(w,N)}});let d=Array.from(f).filter(S=>{let[w,M]=S;return Math.abs(M-C)<=60}).map(S=>{let[w]=S;return w});if(d.length)d.forEach(S=>f.delete(S)),i([...f.keys()]);else{let S=Array.from(f).reduce((w,M)=>{let K=Math.abs(M[1]-C);return K<w.diff?{diff:K,key:M[0]}:w},{diff:1/0,key:""});f.delete(S.key),i([...f.keys()])}}}if(!A){let u=this.getRoutePath(g,I,this.forwardRoute);return n(),u||this.getRoutePath(g,I,this.forwardRoute)}let o=(0,Jg.cloneDeep)(this.forwardRoute.graph);this.addPermissionLineToMap(A,["","ramp"],o,new Map([["ramp",10]]));let s=new Kg.default(o),a=this.getRoutePath(g,I,s);if(n(),a)return a;{let u=(0,Jg.cloneDeep)(this.forwardRoute.graph);this.addPermissionLineToMap(A,["","ramp"],u,new Map([["ramp",10]]));let c=new Kg.default(u);return this.getRoutePath(g,I,c)}}clear(){this.roadInfo=[],this.pointMap.clear(),this.nodeMap.clear(),this.facilityMap.clear(),this.straightLadderMap.clear(),this.escalatorMap.clear(),this.staircaseMap.clear(),this.lineMap.clear(),this.baseRoute=new Kg.default,this.escalatorRoute=new Kg.default,this.straightLadderRoute=new Kg.default}constructor(g=3){this.lift_priority=g,this.roadInfo=[],this.facilities=[],this.pointMap=new Map,this.nodeMap=new Map,this.facilityMap=new Map,this.straightLadderMap=new Map,this.escalatorMap=new Map,this.rampMap=new Map,this.staircaseMap=new Map,this.connectionPointMap=new Map,this.parkingMap=new Map,this.lineMap=new Map,this.baseRoute=new Kg.default,this.escalatorRoute=new Kg.default,this.straightLadderRoute=new Kg.default,this.forwardLineMap=new Map,this.forwardRoute=new Kg.default}};var Jk=l(OI(),1),Qk=l(YI(),1),qk=l(jI(),1),$k=l(RI(),1),gH=l(NI(),1),IH=l(WI(),1),AH=l(FI(),1),CH=l(_(),1),qA=class{static createKey(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}static genUniqueKey(){let g=this.createKey();for(;this.keySet.has(g);)g=this.createKey();return g}static removeKey(g){this.keySet.delete(g)}static dispose(){this.keySet.clear()}};qA.keySet=new Set;var eH=l(oe(),1),iH=l(nI(),1);function zs(t){return t.replace(/[A-Z]/g,g=>"_"+g.toLowerCase()).replace(/^_/,"")}function ng(t,g,I){return new Promise((A,C)=>{let e=qA.genUniqueKey(),i=n=>{let{data:r}=n;r.type===""+g+"_result"&&r.key===e&&(qA.removeKey(e),self.removeEventListener("message",i),r.error?C(r.error):A(r.data))};t.addEventListener("message",i),t.postMessage({type:g,key:e,data:I})})}function KG(t){let g={};for(let A in t)A.startsWith("on")&&(g[zs(A.slice(2))]=t[A]);let I=A=>m(this,null,function*(){let{data:C}=A;if(g[C.type])try{let e=yield g[C.type](C.data);if(e!=null&&e.$transfer&&Array.isArray(e.$transfer)){let i=e.$transfer;delete e.$transfer,self.postMessage({type:""+C.type+"_result",key:C.key,data:e},i)}else self.postMessage({type:""+C.type+"_result",key:C.key,data:e})}catch(e){self.postMessage({type:""+C.type+"_result",key:C.key,error:e})}else self.postMessage({type:""+C.type+"_result",key:C.key,error:"no_event"})});return self.addEventListener("message",I),()=>{self.removeEventListener("message",I)}}var ZI=require("three");function GG(t,g){g===void 0&&(g=16711680);let I=new ZI.LineBasicMaterial({color:g}),A=new ZI.BufferGeometry().setFromPoints(t);return new ZI.Line(A,I)}function TG(t,g){g===void 0&&(g=16711680);let I=new ZI.LineBasicMaterial({color:g}),A=new ZI.BoxGeometry(1,1,1),C=new ZI.Mesh(A,I);return C.position.copy(t),C}var lH=l(DC(),1),cH=l(_(),1);function ue(t,g,I){I===void 0&&(I=0),t.forEach(A=>{if(A.geometry.coords=JSON.parse(JSON.stringify(A.geometry.cds)),A.geometry.type==="polygon"){var C;A.geometry.coords.map(e=>{Array.isArray(e)&&e.forEach(i=>{i[0]-=g[0],i[1]-=g[1]})}),A.geometry.otherCds&&(A.geometry.otherCoords=A.geometry.otherCds.map(e=>e.map(i=>bC(i,g)))),(C=A.doors)!=null&&C.length&&A.doors.map(e=>{e.coord=bC(e.coordinate,g)}),A.center&&(A.centerCoords=bC(A.center,g))}else A.geometry.coords=bC(A.geometry.cds,g),A.center&&(A.centerCoords=bC(A.center,g));if(A.center_x&&A.center_y){let[e,i]=bC([A.center_x,A.center_y],g);A.center_coord_x=e,A.center_coord_y=i}});for(let A=0;A<t.length;A++){let C=t[A];C.deltaHeight=1e-5*(I+A+1)}}function bC(t,g){return[t[0]-g[0],t[1]-g[1]]}var pH=l(OI(),1),fH=l(YI(),1),dH=l(jI(),1),mH=l(RI(),1),yH=l(NI(),1),SH=l(WI(),1),DH=l(FI(),1),wH=l(_(),1),wm=require("@tweenjs/tween.js"),hA=class{update(){this.group.update()}pause(){this.pauseTween=!0,this.getAll().forEach(g=>{this.tweenStore.add(g),g.pause()})}continue(){this.pauseTween&&(this.tweenStore.forEach(g=>{g.resume()}),this.tweenStore.clear(),this.pauseTween=!1)}remove(g){this.group.remove(g)}getAll(){return this.group.getAll()}clear(){this.getAll().forEach(g=>g.stop()),this.group.removeAll()}dispose(){this.clear()}constructor(){this.pauseTween=!1,this.tweenStore=new Set,this.group=new wm.Group}};var Bm=require("three"),le=class extends Bm.EventDispatcher{registryEvent(){this.ctn.addEventListener("pointerdown",this._pointerDown),this.ctn.addEventListener("pointerup",this._pointerUp)}unRegistryEvent(){this.ctn.removeEventListener("pointerdown",this._pointerDown),this.ctn.removeEventListener("pointerup",this._pointerUp)}dispose(){this.unRegistryEvent()}constructor(g){super(),this.ctn=g,this._pointerDown=I=>{this.point={x:I.offsetX,y:I.offsetY}},this._pointerUp=I=>{if(!this.point)return;let{offsetX:A,offsetY:C}=I,{x:e,y:i}=this.point;Math.hypot(e-A+(i-C))>3||this.dispatchEvent({type:"click",e:I})},this.registryEvent()}};var PH=l(_(),1),_H=l(W(),1),EH=l(oe(),1),bH=l(nI(),1),Mm=require("lodash"),vm=require("three");var xC=class extends vm.EventDispatcher{_isEffectiveTask(g){return g&&typeof g.run=="function"}_getIndexByTid(g){return this._task.findIndex(I=>I.tid===g)}_createTask(g){return this._isEffectiveTask(g)?D({},g,{tid:++this._id,meta:g.meta||{}}):!1}get task(){return[...this._task]}getTasks(){return[...this._task]}add(g){if(this._isEffectiveTask(g)){let I=this._createTask(g);return this._task.push(I),this.started&&!this.activeTask&&this.start(),I.tid}return!1}replace(g,I){if(!this._isEffectiveTask(I))return console.warn("[TaskQueue] replace\u65B9\u6CD5\u4F20\u5165\u7684task\u53C2\u6570\u683C\u5F0F\u4E0D\u6B63\u786E"),!1;let A=this._getIndexByTid(g);if(A===-1)return console.warn("[TaskQueue] \u6CA1\u6709\u627E\u5230id="+g+"\u7684\u4EFB\u52A1"),!1;let C=this._createTask(I);return this._task.splice(A,1,C),C.tid}replaceByMetaType(g){var I;let A=(I=g.meta)==null?void 0:I.type;if((0,Mm.isNil)(A))return this.add(g);{let C=this._task.find(e=>e.meta.type===A);return C?this.replace(C.tid,g):this.add(g)}}remove(g){let I=this._getIndexByTid(g);return I===-1?(console.warn("[TaskQueue] remove\u65B9\u6CD5\u4F20\u5165\u7684id\uFF1A"+g+"\u627E\u4E0D\u5230\u5BF9\u5E94\u7684task"),!1):(this._task.splice(I,1),!0)}clear(){this._task.length=0}start(){this.started=!0,!this.activeTask&&this._task.length&&this.exec()}stop(){this.started=!1}exec(){return m(this,null,function*(){if(!this.started||!this._task.length)return!1;let g=this._task.shift();this.activeTask=g,this.dispatchEvent({type:"active-task-start",task:g});let I;try{I=yield g.run()}catch(A){console.warn("[task run err]",A,g)}return this.activeTask=null,this.dispatchEvent({type:"active-task-end",task:g,res:I}),this.exec()})}constructor(g=!0){super(),this._task=[],this.started=!1,this.activeTask=null,this._id=0,g&&this.start()}};var GH=l(W(),1),Pm=require("three"),ce=class extends Pm.EventDispatcher{getWorker(){return new Promise(g=>{let I=this.pool.find(C=>C.state==="leisure");if(I){I.state="used",g(I.worker);return}if(this.pool.length<this.max&&this.workerConstructor){let C=this.workerConstructor();this.pool.push({worker:C,state:"used"}),g(C);return}let A=()=>{let C=this.pool.find(e=>e.state==="leisure");C&&(this.removeEventListener("release",A),C.state="used",g(C.worker))};this.addEventListener("release",A)})}releaseWorker(g){let I=this.pool.find(A=>A.worker===g);I&&(I.state="leisure",this.dispatchEvent({type:"release",worker:g}))}dispose(){this._listeners={},this.pool.forEach(g=>{g.worker.terminate()}),this.pool=[]}constructor(g=10,I){super(),this.max=10,this.pool=[],this.max=g,this.workerConstructor=I}};var _m=require("three"),hg=class extends _m.EventDispatcher{dispose(){this._listeners={}}};var he=class{filter(g){let I=this.estimate,A=this.errorEstimate+this.processNoise,C=A/(A+this.measurementNoise);return this.estimate=I+C*(g-I),this.errorEstimate=(1-C)*A,this.estimate}constructor(g={}){this.estimate=0,this.errorEstimate=1,this.processNoise=.1,this.measurementNoise=1,this.measurementNoise=g.measurementNoise||1,this.processNoise=g.processNoise||.1,this.errorEstimate=g.errorEstimate||1}};var IL=l(TC(),1),AL=l(yA(),1),CL=l(SA(),1),tL=l(DA(),1),eL=l(wA(),1),iL=l(BA(),1),nL=l(MA(),1),rL=l(vA(),1),oL=l(PA(),1),sL=l(_A(),1),aL=l(EA(),1),uL=l(bA(),1),lL=l(xA(),1),cL=l(KA(),1),hL=l(GA(),1),pL=l(W(),1),Gg=require("three");var lD=require("three/examples/jsm/utils/BufferGeometryUtils.js");function CY(t,g,I){g===void 0&&(g=!0),I===void 0&&(I=!1);let A=t.filter(n=>n.geometry.type==="polygon");if(!A.length)return null;let C=A.map(n=>{var r;let o=n.geometry.coords,s=te(o[0],o.slice(1)),a=new Gg.ExtrudeGeometry(s,{steps:1,bevelEnabled:!1,depth:n.height,curveSegments:4});(r=n).deltaHeight||(r.deltaHeight=0),a.translate(0,0,n.airHeight+n.deltaHeight);let u=a.attributes.position.count,c=new Float32Array(u).fill(n.height+n.airHeight+n.deltaHeight);if(a.setAttribute("maxZ",new Gg.BufferAttribute(c,1)),a.setAttribute("opacity",new Gg.BufferAttribute(new Float32Array(u).fill(n.fillOpacity),1)),I){let d=new Float32Array(u).fill(n.airHeight+n.deltaHeight);a.setAttribute("minZ",new Gg.BufferAttribute(d,1))}let h=new Gg.Color(n.fillColor).convertLinearToSRGB(),f=new Float32Array(u*3);for(let d=0;d<u;d++)f[d*3]=h.r,f[d*3+1]=h.g,f[d*3+2]=h.b;return a.setAttribute("color",new Gg.BufferAttribute(f,3)),a}),e=(0,lD.mergeGeometries)(C);C.forEach(n=>n.dispose());let i={geometry:e};return e.dispose(),g&&(i.lineGeometry=cD(A)||void 0),i}function cD(t){let{points:g,colors:I,opacities:A}=Fn(t);if(!g.length)return null;let C=new Gg.BufferGeometry().setFromPoints(g);return C.setAttribute("color",new Gg.BufferAttribute(new Float32Array(I),3)),C.setAttribute("opacity",new Gg.BufferAttribute(new Float32Array(A),1)),C}function Fn(t){let g=[],I=[],A=[];return t.filter(C=>C.strokeOpacity>0).map(C=>{let e=C.height+(C.deltaHeight||0)+C.airHeight,{coords:i}=C.geometry,{strokeColor:n,strokeOpacity:r}=C,o=new Gg.Color(n).convertLinearToSRGB();for(let s=0;s<i.length;s++){let a=i[s];for(let u=0;u<a.length;u++){let c=a[u],h=u+1===a.length?a[0]:a[u+1];g.push(new Gg.Vector3(c[0],c[1],e)),g.push(new Gg.Vector3(h[0],h[1],e)),I.push(o.r,o.g,o.b),I.push(o.r,o.g,o.b),A.push(r),A.push(r)}}}),{points:g,colors:I,opacities:A}}var q=require("three");var _Q=l(_(),1),EQ=l(OI(),1),bQ=l(YI(),1),xQ=l(jI(),1),KQ=l(RI(),1),GQ=l(NI(),1),TQ=l(WI(),1),OQ=l(FI(),1),YQ=l(W(),1),T2=require("three");var nV=l(_(),1),rV=l(W(),1),T=require("three");var mL=l(_(),1),pD=require("three/examples/jsm/lines/LineMaterial.js"),sg=require("three");function hD(t){return t.x+"-"+t.y+"-"+t.z}var R=class{static generateLineMaterialKey(g){let{color:I,opacity:A}=g;return I+"-"+A}static createLineMaterial(g){let{color:I,opacity:A,vertexColors:C}=g,e=this.generateLineMaterialKey({color:I,opacity:A,vertexColors:C});if(this.lineMaterialMap.has(e))return this.lineMaterialMap.get(e);let i=new sg.LineBasicMaterial({color:new sg.Color(I).convertLinearToSRGB(),transparent:!0,opacity:A,vertexColors:C!=null?C:!1});return this.lineMaterialMap.set(e,i),i}static createMeshStandardMaterial(g){let{color:I,opacity:A}=g,C=I+"-"+A;if(this.meshStandardMaterialMap.has(C))return this.meshStandardMaterialMap.get(C);let e=new sg.MeshStandardMaterial({color:new sg.Color(I).convertLinearToSRGB(),roughness:1,transparent:!0,opacity:A,depthWrite:!0});return this.meshStandardMaterialMap.set(C,e),e}static createMeshBasicMaterial(g){let{color:I,opacity:A,vertexColors:C}=g,e=I+"-"+A+"-"+C;if(this.meshBasicMaterialMap.has(e))return this.meshBasicMaterialMap.get(e);let i=new sg.MeshBasicMaterial({color:I,transparent:!0,opacity:A,depthWrite:!0,vertexColors:C!=null?C:!1});return this.meshBasicMaterialMap.set(e,i),i}static createShaderMaterial(g){let{gradualColor:I,center:A,maxValue:C,opacity:e,direction:i,max:n,min:r}=g,o=I.toString()+"-"+hD(A)+"-"+C+"-"+e+"-"+hD(i);if(this.shaderMaterialMap.has(o))return this.shaderMaterialMap.get(o);let s=`
5
5
  uniform vec3 uColor;
6
6
  uniform vec3 uGradualColor;
7
7
  uniform vec3 center;
@@ -15642,7 +15642,7 @@ void main() {
15642
15642
  }
15643
15643
 
15644
15644
  }\`,pv=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,o){if(this.texture===null){let s=new Us,c=t.properties.get(s);c.__webglTexture=e.texture,(e.depthNear!=o.depthNear||e.depthFar!=o.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=s}}render(t,e){if(this.texture!==null){if(this.mesh===null){let o=e.cameras[0].viewport,s=new Pa({extensions:{fragDepth:!0},vertexShader:uX,fragmentShader:lX,uniforms:{depthColor:{value:this.texture},depthWidth:{value:o.z},depthHeight:{value:o.w}}});this.mesh=new ra(new zd(20,20),s)}t.render(this.mesh,e)}}reset(){this.texture=null,this.mesh=null}},dv=class extends Ku{constructor(t,e){super();let o=this,s=null,c=1,p=null,h="local-floor",g=1,m=null,_=null,w=null,x=null,b=null,T=null,I=new pv,S=e.getContextAttributes(),E=null,R=null,C=[],F=[],W=new ze,X=null,q=new gs;q.layers.enable(1),q.viewport=new ji;let D=new gs;D.layers.enable(2),D.viewport=new ji;let xt=[q,D],B=new hv;B.layers.enable(1),B.layers.enable(2);let j=null,J=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ut){let Ut=C[ut];return Ut===void 0&&(Ut=new ih,C[ut]=Ut),Ut.getTargetRaySpace()},this.getControllerGrip=function(ut){let Ut=C[ut];return Ut===void 0&&(Ut=new ih,C[ut]=Ut),Ut.getGripSpace()},this.getHand=function(ut){let Ut=C[ut];return Ut===void 0&&(Ut=new ih,C[ut]=Ut),Ut.getHandSpace()};function Dt(ut){let Ut=F.indexOf(ut.inputSource);if(Ut===-1)return;let jt=C[Ut];jt!==void 0&&(jt.update(ut.inputSource,ut.frame,m||p),jt.dispatchEvent({type:ut.type,data:ut.inputSource}))}function Q(){s.removeEventListener("select",Dt),s.removeEventListener("selectstart",Dt),s.removeEventListener("selectend",Dt),s.removeEventListener("squeeze",Dt),s.removeEventListener("squeezestart",Dt),s.removeEventListener("squeezeend",Dt),s.removeEventListener("end",Q),s.removeEventListener("inputsourceschange",At);for(let ut=0;ut<C.length;ut++){let Ut=F[ut];Ut!==null&&(F[ut]=null,C[ut].disconnect(Ut))}j=null,J=null,I.reset(),t.setRenderTarget(E),b=null,x=null,w=null,s=null,R=null,ae.stop(),o.isPresenting=!1,t.setPixelRatio(X),t.setSize(W.width,W.height,!1),o.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(ut){c=ut,o.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(ut){h=ut,o.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return m||p},this.setReferenceSpace=function(ut){m=ut},this.getBaseLayer=function(){return x!==null?x:b},this.getBinding=function(){return w},this.getFrame=function(){return T},this.getSession=function(){return s},this.setSession=function(ut){return pp(this,null,function*(){if(s=ut,s!==null){if(E=t.getRenderTarget(),s.addEventListener("select",Dt),s.addEventListener("selectstart",Dt),s.addEventListener("selectend",Dt),s.addEventListener("squeeze",Dt),s.addEventListener("squeezestart",Dt),s.addEventListener("squeezeend",Dt),s.addEventListener("end",Q),s.addEventListener("inputsourceschange",At),S.xrCompatible!==!0&&(yield e.makeXRCompatible()),X=t.getPixelRatio(),t.getSize(W),s.renderState.layers===void 0||t.capabilities.isWebGL2===!1){let Ut={antialias:s.renderState.layers===void 0?S.antialias:!0,alpha:!0,depth:S.depth,stencil:S.stencil,framebufferScaleFactor:c};b=new XRWebGLLayer(s,e,Ut),s.updateRenderState({baseLayer:b}),t.setPixelRatio(1),t.setSize(b.framebufferWidth,b.framebufferHeight,!1),R=new du(b.framebufferWidth,b.framebufferHeight,{format:na,type:$u,colorSpace:t.outputColorSpace,stencilBuffer:S.stencil})}else{let Ut=null,jt=null,ce=null;S.depth&&(ce=S.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,Ut=S.stencil?Vc:Dl,jt=S.stencil?Ol:Wu);let te={colorFormat:e.RGBA8,depthFormat:ce,scaleFactor:c};w=new XRWebGLBinding(s,e),x=w.createProjectionLayer(te),s.updateRenderState({layers:[x]}),t.setPixelRatio(1),t.setSize(x.textureWidth,x.textureHeight,!1),R=new du(x.textureWidth,x.textureHeight,{format:na,type:$u,depthTexture:new kd(x.textureWidth,x.textureHeight,jt,void 0,void 0,void 0,void 0,void 0,void 0,Ut),stencilBuffer:S.stencil,colorSpace:t.outputColorSpace,samples:S.antialias?4:0});let $t=t.properties.get(R);$t.__ignoreDepthValues=x.ignoreDepthValues}R.isXRRenderTarget=!0,this.setFoveation(g),m=null,p=yield s.requestReferenceSpace(h),ae.setContext(s),ae.start(),o.isPresenting=!0,o.dispatchEvent({type:"sessionstart"})}})},this.getEnvironmentBlendMode=function(){if(s!==null)return s.environmentBlendMode};function At(ut){for(let Ut=0;Ut<ut.removed.length;Ut++){let jt=ut.removed[Ut],ce=F.indexOf(jt);ce>=0&&(F[ce]=null,C[ce].disconnect(jt))}for(let Ut=0;Ut<ut.added.length;Ut++){let jt=ut.added[Ut],ce=F.indexOf(jt);if(ce===-1){for(let $t=0;$t<C.length;$t++)if($t>=F.length){F.push(jt),ce=$t;break}else if(F[$t]===null){F[$t]=jt,ce=$t;break}if(ce===-1)break}let te=C[ce];te&&te.connect(jt)}}let Mt=new Pt,Lt=new Pt;function pt(ut,Ut,jt){Mt.setFromMatrixPosition(Ut.matrixWorld),Lt.setFromMatrixPosition(jt.matrixWorld);let ce=Mt.distanceTo(Lt),te=Ut.projectionMatrix.elements,$t=jt.projectionMatrix.elements,qt=te[14]/(te[10]-1),xe=te[14]/(te[10]+1),ft=(te[9]+1)/te[5],Xe=(te[9]-1)/te[5],ee=(te[8]-1)/te[0],ge=($t[8]+1)/$t[0],fe=qt*ee,Te=qt*ge,be=ce/(-ee+ge),Wt=be*-ee;Ut.matrixWorld.decompose(ut.position,ut.quaternion,ut.scale),ut.translateX(Wt),ut.translateZ(be),ut.matrixWorld.compose(ut.position,ut.quaternion,ut.scale),ut.matrixWorldInverse.copy(ut.matrixWorld).invert();let Me=qt+be,tt=xe+be,z=fe-Wt,It=Te+(ce-Wt),Ot=ft*xe/tt*Me,dt=Xe*xe/tt*Me;ut.projectionMatrix.makePerspective(z,It,Ot,dt,Me,tt),ut.projectionMatrixInverse.copy(ut.projectionMatrix).invert()}function yt(ut,Ut){Ut===null?ut.matrixWorld.copy(ut.matrix):ut.matrixWorld.multiplyMatrices(Ut.matrixWorld,ut.matrix),ut.matrixWorldInverse.copy(ut.matrixWorld).invert()}this.updateCamera=function(ut){if(s===null)return;I.texture!==null&&(ut.near=I.depthNear,ut.far=I.depthFar),B.near=D.near=q.near=ut.near,B.far=D.far=q.far=ut.far,(j!==B.near||J!==B.far)&&(s.updateRenderState({depthNear:B.near,depthFar:B.far}),j=B.near,J=B.far,q.near=j,q.far=J,D.near=j,D.far=J,q.updateProjectionMatrix(),D.updateProjectionMatrix(),ut.updateProjectionMatrix());let Ut=ut.parent,jt=B.cameras;yt(B,Ut);for(let ce=0;ce<jt.length;ce++)yt(jt[ce],Ut);jt.length===2?pt(B,q,D):B.projectionMatrix.copy(q.projectionMatrix),K(ut,B,Ut)};function K(ut,Ut,jt){jt===null?ut.matrix.copy(Ut.matrixWorld):(ut.matrix.copy(jt.matrixWorld),ut.matrix.invert(),ut.matrix.multiply(Ut.matrixWorld)),ut.matrix.decompose(ut.position,ut.quaternion,ut.scale),ut.updateMatrixWorld(!0),ut.projectionMatrix.copy(Ut.projectionMatrix),ut.projectionMatrixInverse.copy(Ut.projectionMatrixInverse),ut.isPerspectiveCamera&&(ut.fov=Jy*2*Math.atan(1/ut.projectionMatrix.elements[5]),ut.zoom=1)}this.getCamera=function(){return B},this.getFoveation=function(){if(!(x===null&&b===null))return g},this.setFoveation=function(ut){g=ut,x!==null&&(x.fixedFoveation=ut),b!==null&&b.fixedFoveation!==void 0&&(b.fixedFoveation=ut)},this.hasDepthSensing=function(){return I.texture!==null};let Bt=null;function Gt(ut,Ut){if(_=Ut.getViewerPose(m||p),T=Ut,_!==null){let jt=_.views;b!==null&&(t.setRenderTargetFramebuffer(R,b.framebuffer),t.setRenderTarget(R));let ce=!1;jt.length!==B.cameras.length&&(B.cameras.length=0,ce=!0);for(let $t=0;$t<jt.length;$t++){let qt=jt[$t],xe=null;if(b!==null)xe=b.getViewport(qt);else{let Xe=w.getViewSubImage(x,qt);xe=Xe.viewport,$t===0&&(t.setRenderTargetTextures(R,Xe.colorTexture,x.ignoreDepthValues?void 0:Xe.depthStencilTexture),t.setRenderTarget(R))}let ft=xt[$t];ft===void 0&&(ft=new gs,ft.layers.enable($t),ft.viewport=new ji,xt[$t]=ft),ft.matrix.fromArray(qt.transform.matrix),ft.matrix.decompose(ft.position,ft.quaternion,ft.scale),ft.projectionMatrix.fromArray(qt.projectionMatrix),ft.projectionMatrixInverse.copy(ft.projectionMatrix).invert(),ft.viewport.set(xe.x,xe.y,xe.width,xe.height),$t===0&&(B.matrix.copy(ft.matrix),B.matrix.decompose(B.position,B.quaternion,B.scale)),ce===!0&&B.cameras.push(ft)}let te=s.enabledFeatures;if(te&&te.includes("depth-sensing")){let $t=w.getDepthInformation(jt[0]);$t&&$t.isValid&&$t.texture&&I.init(t,$t,s.renderState)}}for(let jt=0;jt<C.length;jt++){let ce=F[jt],te=C[jt];ce!==null&&te!==void 0&&te.update(ce,Ut,m||p)}I.render(t,B),Bt&&Bt(ut,Ut),Ut.detectedPlanes&&o.dispatchEvent({type:"planesdetected",data:Ut}),T=null}let ae=new _C;ae.setAnimationLoop(Gt),this.setAnimationLoop=function(ut){Bt=ut},this.dispose=function(){}}},Cl=new Ul,cX=new vi;function fX(n,t){function e(S,E){S.matrixAutoUpdate===!0&&S.updateMatrix(),E.value.copy(S.matrix)}function o(S,E){E.color.getRGB(S.fogColor.value,vC(n)),E.isFog?(S.fogNear.value=E.near,S.fogFar.value=E.far):E.isFogExp2&&(S.fogDensity.value=E.density)}function s(S,E,R,C,F){E.isMeshBasicMaterial||E.isMeshLambertMaterial?c(S,E):E.isMeshToonMaterial?(c(S,E),w(S,E)):E.isMeshPhongMaterial?(c(S,E),_(S,E)):E.isMeshStandardMaterial?(c(S,E),x(S,E),E.isMeshPhysicalMaterial&&b(S,E,F)):E.isMeshMatcapMaterial?(c(S,E),T(S,E)):E.isMeshDepthMaterial?c(S,E):E.isMeshDistanceMaterial?(c(S,E),I(S,E)):E.isMeshNormalMaterial?c(S,E):E.isLineBasicMaterial?(p(S,E),E.isLineDashedMaterial&&h(S,E)):E.isPointsMaterial?g(S,E,R,C):E.isSpriteMaterial?m(S,E):E.isShadowMaterial?(S.color.value.copy(E.color),S.opacity.value=E.opacity):E.isShaderMaterial&&(E.uniformsNeedUpdate=!1)}function c(S,E){S.opacity.value=E.opacity,E.color&&S.diffuse.value.copy(E.color),E.emissive&&S.emissive.value.copy(E.emissive).multiplyScalar(E.emissiveIntensity),E.map&&(S.map.value=E.map,e(E.map,S.mapTransform)),E.alphaMap&&(S.alphaMap.value=E.alphaMap,e(E.alphaMap,S.alphaMapTransform)),E.bumpMap&&(S.bumpMap.value=E.bumpMap,e(E.bumpMap,S.bumpMapTransform),S.bumpScale.value=E.bumpScale,E.side===$o&&(S.bumpScale.value*=-1)),E.normalMap&&(S.normalMap.value=E.normalMap,e(E.normalMap,S.normalMapTransform),S.normalScale.value.copy(E.normalScale),E.side===$o&&S.normalScale.value.negate()),E.displacementMap&&(S.displacementMap.value=E.displacementMap,e(E.displacementMap,S.displacementMapTransform),S.displacementScale.value=E.displacementScale,S.displacementBias.value=E.displacementBias),E.emissiveMap&&(S.emissiveMap.value=E.emissiveMap,e(E.emissiveMap,S.emissiveMapTransform)),E.specularMap&&(S.specularMap.value=E.specularMap,e(E.specularMap,S.specularMapTransform)),E.alphaTest>0&&(S.alphaTest.value=E.alphaTest);let R=t.get(E),C=R.envMap,F=R.envMapRotation;if(C&&(S.envMap.value=C,Cl.copy(F),Cl.x*=-1,Cl.y*=-1,Cl.z*=-1,C.isCubeTexture&&C.isRenderTargetTexture===!1&&(Cl.y*=-1,Cl.z*=-1),S.envMapRotation.value.setFromMatrix4(cX.makeRotationFromEuler(Cl)),S.flipEnvMap.value=C.isCubeTexture&&C.isRenderTargetTexture===!1?-1:1,S.reflectivity.value=E.reflectivity,S.ior.value=E.ior,S.refractionRatio.value=E.refractionRatio),E.lightMap){S.lightMap.value=E.lightMap;let W=n._useLegacyLights===!0?Math.PI:1;S.lightMapIntensity.value=E.lightMapIntensity*W,e(E.lightMap,S.lightMapTransform)}E.aoMap&&(S.aoMap.value=E.aoMap,S.aoMapIntensity.value=E.aoMapIntensity,e(E.aoMap,S.aoMapTransform))}function p(S,E){S.diffuse.value.copy(E.color),S.opacity.value=E.opacity,E.map&&(S.map.value=E.map,e(E.map,S.mapTransform))}function h(S,E){S.dashSize.value=E.dashSize,S.totalSize.value=E.dashSize+E.gapSize,S.scale.value=E.scale}function g(S,E,R,C){S.diffuse.value.copy(E.color),S.opacity.value=E.opacity,S.size.value=E.size*R,S.scale.value=C*.5,E.map&&(S.map.value=E.map,e(E.map,S.uvTransform)),E.alphaMap&&(S.alphaMap.value=E.alphaMap,e(E.alphaMap,S.alphaMapTransform)),E.alphaTest>0&&(S.alphaTest.value=E.alphaTest)}function m(S,E){S.diffuse.value.copy(E.color),S.opacity.value=E.opacity,S.rotation.value=E.rotation,E.map&&(S.map.value=E.map,e(E.map,S.mapTransform)),E.alphaMap&&(S.alphaMap.value=E.alphaMap,e(E.alphaMap,S.alphaMapTransform)),E.alphaTest>0&&(S.alphaTest.value=E.alphaTest)}function _(S,E){S.specular.value.copy(E.specular),S.shininess.value=Math.max(E.shininess,1e-4)}function w(S,E){E.gradientMap&&(S.gradientMap.value=E.gradientMap)}function x(S,E){S.metalness.value=E.metalness,E.metalnessMap&&(S.metalnessMap.value=E.metalnessMap,e(E.metalnessMap,S.metalnessMapTransform)),S.roughness.value=E.roughness,E.roughnessMap&&(S.roughnessMap.value=E.roughnessMap,e(E.roughnessMap,S.roughnessMapTransform)),t.get(E).envMap&&(S.envMapIntensity.value=E.envMapIntensity)}function b(S,E,R){S.ior.value=E.ior,E.sheen>0&&(S.sheenColor.value.copy(E.sheenColor).multiplyScalar(E.sheen),S.sheenRoughness.value=E.sheenRoughness,E.sheenColorMap&&(S.sheenColorMap.value=E.sheenColorMap,e(E.sheenColorMap,S.sheenColorMapTransform)),E.sheenRoughnessMap&&(S.sheenRoughnessMap.value=E.sheenRoughnessMap,e(E.sheenRoughnessMap,S.sheenRoughnessMapTransform))),E.clearcoat>0&&(S.clearcoat.value=E.clearcoat,S.clearcoatRoughness.value=E.clearcoatRoughness,E.clearcoatMap&&(S.clearcoatMap.value=E.clearcoatMap,e(E.clearcoatMap,S.clearcoatMapTransform)),E.clearcoatRoughnessMap&&(S.clearcoatRoughnessMap.value=E.clearcoatRoughnessMap,e(E.clearcoatRoughnessMap,S.clearcoatRoughnessMapTransform)),E.clearcoatNormalMap&&(S.clearcoatNormalMap.value=E.clearcoatNormalMap,e(E.clearcoatNormalMap,S.clearcoatNormalMapTransform),S.clearcoatNormalScale.value.copy(E.clearcoatNormalScale),E.side===$o&&S.clearcoatNormalScale.value.negate())),E.iridescence>0&&(S.iridescence.value=E.iridescence,S.iridescenceIOR.value=E.iridescenceIOR,S.iridescenceThicknessMinimum.value=E.iridescenceThicknessRange[0],S.iridescenceThicknessMaximum.value=E.iridescenceThicknessRange[1],E.iridescenceMap&&(S.iridescenceMap.value=E.iridescenceMap,e(E.iridescenceMap,S.iridescenceMapTransform)),E.iridescenceThicknessMap&&(S.iridescenceThicknessMap.value=E.iridescenceThicknessMap,e(E.iridescenceThicknessMap,S.iridescenceThicknessMapTransform))),E.transmission>0&&(S.transmission.value=E.transmission,S.transmissionSamplerMap.value=R.texture,S.transmissionSamplerSize.value.set(R.width,R.height),E.transmissionMap&&(S.transmissionMap.value=E.transmissionMap,e(E.transmissionMap,S.transmissionMapTransform)),S.thickness.value=E.thickness,E.thicknessMap&&(S.thicknessMap.value=E.thicknessMap,e(E.thicknessMap,S.thicknessMapTransform)),S.attenuationDistance.value=E.attenuationDistance,S.attenuationColor.value.copy(E.attenuationColor)),E.anisotropy>0&&(S.anisotropyVector.value.set(E.anisotropy*Math.cos(E.anisotropyRotation),E.anisotropy*Math.sin(E.anisotropyRotation)),E.anisotropyMap&&(S.anisotropyMap.value=E.anisotropyMap,e(E.anisotropyMap,S.anisotropyMapTransform))),S.specularIntensity.value=E.specularIntensity,S.specularColor.value.copy(E.specularColor),E.specularColorMap&&(S.specularColorMap.value=E.specularColorMap,e(E.specularColorMap,S.specularColorMapTransform)),E.specularIntensityMap&&(S.specularIntensityMap.value=E.specularIntensityMap,e(E.specularIntensityMap,S.specularIntensityMapTransform))}function T(S,E){E.matcap&&(S.matcap.value=E.matcap)}function I(S,E){let R=t.get(E).light;S.referencePosition.value.setFromMatrixPosition(R.matrixWorld),S.nearDistance.value=R.shadow.camera.near,S.farDistance.value=R.shadow.camera.far}return{refreshFogUniforms:o,refreshMaterialUniforms:s}}function hX(n,t,e,o){let s={},c={},p=[],h=e.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function g(R,C){let F=C.program;o.uniformBlockBinding(R,F)}function m(R,C){let F=s[R.id];F===void 0&&(T(R),F=_(R),s[R.id]=F,R.addEventListener("dispose",S));let W=C.program;o.updateUBOMapping(R,W);let X=t.render.frame;c[R.id]!==X&&(x(R),c[R.id]=X)}function _(R){let C=w();R.__bindingPointIndex=C;let F=n.createBuffer(),W=R.__size,X=R.usage;return n.bindBuffer(n.UNIFORM_BUFFER,F),n.bufferData(n.UNIFORM_BUFFER,W,X),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,C,F),F}function w(){for(let R=0;R<h;R++)if(p.indexOf(R)===-1)return p.push(R),R;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function x(R){let C=s[R.id],F=R.uniforms,W=R.__cache;n.bindBuffer(n.UNIFORM_BUFFER,C);for(let X=0,q=F.length;X<q;X++){let D=Array.isArray(F[X])?F[X]:[F[X]];for(let xt=0,B=D.length;xt<B;xt++){let j=D[xt];if(b(j,X,xt,W)===!0){let J=j.__offset,Dt=Array.isArray(j.value)?j.value:[j.value],Q=0;for(let At=0;At<Dt.length;At++){let Mt=Dt[At],Lt=I(Mt);typeof Mt=="number"||typeof Mt=="boolean"?(j.__data[0]=Mt,n.bufferSubData(n.UNIFORM_BUFFER,J+Q,j.__data)):Mt.isMatrix3?(j.__data[0]=Mt.elements[0],j.__data[1]=Mt.elements[1],j.__data[2]=Mt.elements[2],j.__data[3]=0,j.__data[4]=Mt.elements[3],j.__data[5]=Mt.elements[4],j.__data[6]=Mt.elements[5],j.__data[7]=0,j.__data[8]=Mt.elements[6],j.__data[9]=Mt.elements[7],j.__data[10]=Mt.elements[8],j.__data[11]=0):(Mt.toArray(j.__data,Q),Q+=Lt.storage/Float32Array.BYTES_PER_ELEMENT)}n.bufferSubData(n.UNIFORM_BUFFER,J,j.__data)}}}n.bindBuffer(n.UNIFORM_BUFFER,null)}function b(R,C,F,W){let X=R.value,q=C+"_"+F;if(W[q]===void 0)return typeof X=="number"||typeof X=="boolean"?W[q]=X:W[q]=X.clone(),!0;{let D=W[q];if(typeof X=="number"||typeof X=="boolean"){if(D!==X)return W[q]=X,!0}else if(D.equals(X)===!1)return D.copy(X),!0}return!1}function T(R){let C=R.uniforms,F=0,W=16;for(let q=0,D=C.length;q<D;q++){let xt=Array.isArray(C[q])?C[q]:[C[q]];for(let B=0,j=xt.length;B<j;B++){let J=xt[B],Dt=Array.isArray(J.value)?J.value:[J.value];for(let Q=0,At=Dt.length;Q<At;Q++){let Mt=Dt[Q],Lt=I(Mt),pt=F%W;pt!==0&&W-pt<Lt.boundary&&(F+=W-pt),J.__data=new Float32Array(Lt.storage/Float32Array.BYTES_PER_ELEMENT),J.__offset=F,F+=Lt.storage}}}let X=F%W;return X>0&&(F+=W-X),R.__size=F,R.__cache={},this}function I(R){let C={boundary:0,storage:0};return typeof R=="number"||typeof R=="boolean"?(C.boundary=4,C.storage=4):R.isVector2?(C.boundary=8,C.storage=8):R.isVector3||R.isColor?(C.boundary=16,C.storage=12):R.isVector4?(C.boundary=16,C.storage=16):R.isMatrix3?(C.boundary=48,C.storage=48):R.isMatrix4?(C.boundary=64,C.storage=64):R.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",R),C}function S(R){let C=R.target;C.removeEventListener("dispose",S);let F=p.indexOf(C.__bindingPointIndex);p.splice(F,1),n.deleteBuffer(s[C.id]),delete s[C.id],delete c[C.id]}function E(){for(let R in s)n.deleteBuffer(s[R]);p=[],s={},c={}}return{bind:g,update:m,dispose:E}}var gv=class{constructor(t={}){let{canvas:e=m6(),context:o=null,depth:s=!0,stencil:c=!0,alpha:p=!1,antialias:h=!1,premultipliedAlpha:g=!0,preserveDrawingBuffer:m=!1,powerPreference:_="default",failIfMajorPerformanceCaveat:w=!1}=t;this.isWebGLRenderer=!0;let x;o!==null?x=o.getContextAttributes().alpha:x=p;let b=new Uint32Array(4),T=new Int32Array(4),I=null,S=null,E=[],R=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Aa,this._useLegacyLights=!1,this.toneMapping=Yu,this.toneMappingExposure=1;let C=this,F=!1,W=0,X=0,q=null,D=-1,xt=null,B=new ji,j=new ji,J=null,Dt=new ar(0),Q=0,At=e.width,Mt=e.height,Lt=1,pt=null,yt=null,K=new ji(0,0,At,Mt),Bt=new ji(0,0,At,Mt),Gt=!1,ae=new Bd,ut=!1,Ut=!1,jt=null,ce=new vi,te=new ze,$t=new Pt,qt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function xe(){return q===null?Lt:1}let ft=o;function Xe(Z,mt){for(let Rt=0;Rt<Z.length;Rt++){let St=Z[Rt],vt=e.getContext(St,mt);if(vt!==null)return vt}return null}try{let Z={alpha:!0,depth:s,stencil:c,antialias:h,premultipliedAlpha:g,preserveDrawingBuffer:m,powerPreference:_,failIfMajorPerformanceCaveat:w};if("setAttribute"in e&&e.setAttribute("data-engine",\`three.js r\${Iv}\`),e.addEventListener("webglcontextlost",Et,!1),e.addEventListener("webglcontextrestored",G,!1),e.addEventListener("webglcontextcreationerror",st,!1),ft===null){let mt=["webgl2","webgl","experimental-webgl"];if(C.isWebGL1Renderer===!0&&mt.shift(),ft=Xe(mt,Z),ft===null)throw Xe(mt)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}typeof WebGLRenderingContext!="undefined"&&ft instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),ft.getShaderPrecisionFormat===void 0&&(ft.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(Z){throw console.error("THREE.WebGLRenderer: "+Z.message),Z}let ee,ge,fe,Te,be,Wt,Me,tt,z,It,Ot,dt,Ht,Ce,Vt,Zt,ne,rt,P,N,k,$,V,ht;function at(){ee=new CW(ft),ge=new wW(ft,ee,t),ee.init(ge),$=new sX(ft,ee,ge),fe=new iX(ft,ee,ge),Te=new RW(ft),be=new X9,Wt=new oX(ft,ee,fe,be,ge,$,Te),Me=new MW(C),tt=new TW(C),z=new U6(ft,ge),V=new xW(ft,ee,z,ge),It=new PW(ft,z,Te,V),Ot=new DW(ft,It,z,Te),P=new OW(ft,ge,Wt),Zt=new SW(be),dt=new W9(C,Me,tt,ee,ge,V,Zt),Ht=new fX(C,be),Ce=new $9,Vt=new tX(ee,ge),rt=new _W(C,Me,tt,fe,Ot,x,g),ne=new rX(C,Ot,ge),ht=new hX(ft,Te,ge,fe),N=new EW(ft,ee,Te,ge),k=new IW(ft,ee,Te,ge),Te.programs=dt.programs,C.capabilities=ge,C.extensions=ee,C.properties=be,C.renderLists=Ce,C.shadowMap=ne,C.state=fe,C.info=Te}at();let wt=new dv(C,ft);this.xr=wt,this.getContext=function(){return ft},this.getContextAttributes=function(){return ft.getContextAttributes()},this.forceContextLoss=function(){let Z=ee.get("WEBGL_lose_context");Z&&Z.loseContext()},this.forceContextRestore=function(){let Z=ee.get("WEBGL_lose_context");Z&&Z.restoreContext()},this.getPixelRatio=function(){return Lt},this.setPixelRatio=function(Z){Z!==void 0&&(Lt=Z,this.setSize(At,Mt,!1))},this.getSize=function(Z){return Z.set(At,Mt)},this.setSize=function(Z,mt,Rt=!0){if(wt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}At=Z,Mt=mt,e.width=Math.floor(Z*Lt),e.height=Math.floor(mt*Lt),Rt===!0&&(e.style.width=Z+"px",e.style.height=mt+"px"),this.setViewport(0,0,Z,mt)},this.getDrawingBufferSize=function(Z){return Z.set(At*Lt,Mt*Lt).floor()},this.setDrawingBufferSize=function(Z,mt,Rt){At=Z,Mt=mt,Lt=Rt,e.width=Math.floor(Z*Rt),e.height=Math.floor(mt*Rt),this.setViewport(0,0,Z,mt)},this.getCurrentViewport=function(Z){return Z.copy(B)},this.getViewport=function(Z){return Z.copy(K)},this.setViewport=function(Z,mt,Rt,St){Z.isVector4?K.set(Z.x,Z.y,Z.z,Z.w):K.set(Z,mt,Rt,St),fe.viewport(B.copy(K).multiplyScalar(Lt).round())},this.getScissor=function(Z){return Z.copy(Bt)},this.setScissor=function(Z,mt,Rt,St){Z.isVector4?Bt.set(Z.x,Z.y,Z.z,Z.w):Bt.set(Z,mt,Rt,St),fe.scissor(j.copy(Bt).multiplyScalar(Lt).round())},this.getScissorTest=function(){return Gt},this.setScissorTest=function(Z){fe.setScissorTest(Gt=Z)},this.setOpaqueSort=function(Z){pt=Z},this.setTransparentSort=function(Z){yt=Z},this.getClearColor=function(Z){return Z.copy(rt.getClearColor())},this.setClearColor=function(){rt.setClearColor.apply(rt,arguments)},this.getClearAlpha=function(){return rt.getClearAlpha()},this.setClearAlpha=function(){rt.setClearAlpha.apply(rt,arguments)},this.clear=function(Z=!0,mt=!0,Rt=!0){let St=0;if(Z){let vt=!1;if(q!==null){let he=q.texture.format;vt=he===hC||he===fC||he===cC}if(vt){let he=q.texture.type,ue=he===$u||he===Wu||he===Rv||he===Ol||he===uC||he===lC,we=rt.getClearColor(),de=rt.getClearAlpha(),Be=we.r,Ae=we.g,Pe=we.b;ue?(b[0]=Be,b[1]=Ae,b[2]=Pe,b[3]=de,ft.clearBufferuiv(ft.COLOR,0,b)):(T[0]=Be,T[1]=Ae,T[2]=Pe,T[3]=de,ft.clearBufferiv(ft.COLOR,0,T))}else St|=ft.COLOR_BUFFER_BIT}mt&&(St|=ft.DEPTH_BUFFER_BIT),Rt&&(St|=ft.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),ft.clear(St)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",Et,!1),e.removeEventListener("webglcontextrestored",G,!1),e.removeEventListener("webglcontextcreationerror",st,!1),Ce.dispose(),Vt.dispose(),be.dispose(),Me.dispose(),tt.dispose(),Ot.dispose(),V.dispose(),ht.dispose(),dt.dispose(),ne.dispose(),wt.dispose(),wt.removeEventListener("sessionstart",He),wt.removeEventListener("sessionend",Ue),jt&&(jt.dispose(),jt=null),Ye.stop()};function Et(Z){Z.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),F=!0}function G(){console.log("THREE.WebGLRenderer: Context Restored."),F=!1;let Z=Te.autoReset,mt=ne.enabled,Rt=ne.autoUpdate,St=ne.needsUpdate,vt=ne.type;at(),Te.autoReset=Z,ne.enabled=mt,ne.autoUpdate=Rt,ne.needsUpdate=St,ne.type=vt}function st(Z){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",Z.statusMessage)}function et(Z){let mt=Z.target;mt.removeEventListener("dispose",et),lt(mt)}function lt(Z){Ft(Z),be.remove(Z)}function Ft(Z){let mt=be.get(Z).programs;mt!==void 0&&(mt.forEach(function(Rt){dt.releaseProgram(Rt)}),Z.isShaderMaterial&&dt.releaseShaderCache(Z))}this.renderBufferDirect=function(Z,mt,Rt,St,vt,he){mt===null&&(mt=qt);let ue=vt.isMesh&&vt.matrixWorld.determinant()<0,we=Qn(Z,mt,Rt,St,vt);fe.setMaterial(St,ue);let de=Rt.index,Be=1;if(St.wireframe===!0){if(de=It.getWireframeAttribute(Rt),de===void 0)return;Be=2}let Ae=Rt.drawRange,Pe=Rt.attributes.position,nn=Ae.start*Be,si=(Ae.start+Ae.count)*Be;he!==null&&(nn=Math.max(nn,he.start*Be),si=Math.min(si,(he.start+he.count)*Be)),de!==null?(nn=Math.max(nn,0),si=Math.min(si,de.count)):Pe!=null&&(nn=Math.max(nn,0),si=Math.min(si,Pe.count));let br=si-nn;if(br<0||br===1/0)return;V.setup(vt,St,we,Rt,de);let Vi,sr=N;if(de!==null&&(Vi=z.get(de),sr=k,sr.setIndex(Vi)),vt.isMesh)St.wireframe===!0?(fe.setLineWidth(St.wireframeLinewidth*xe()),sr.setMode(ft.LINES)):sr.setMode(ft.TRIANGLES);else if(vt.isLine){let ye=St.linewidth;ye===void 0&&(ye=1),fe.setLineWidth(ye*xe()),vt.isLineSegments?sr.setMode(ft.LINES):vt.isLineLoop?sr.setMode(ft.LINE_LOOP):sr.setMode(ft.LINE_STRIP)}else vt.isPoints?sr.setMode(ft.POINTS):vt.isSprite&&sr.setMode(ft.TRIANGLES);if(vt.isBatchedMesh)sr.renderMultiDraw(vt._multiDrawStarts,vt._multiDrawCounts,vt._multiDrawCount);else if(vt.isInstancedMesh)sr.renderInstances(nn,br,vt.count);else if(Rt.isInstancedBufferGeometry){let ye=Rt._maxInstanceCount!==void 0?Rt._maxInstanceCount:1/0,Ua=Math.min(Rt.instanceCount,ye);sr.renderInstances(nn,br,Ua)}else sr.render(nn,br)};function Kt(Z,mt,Rt){Z.transparent===!0&&Z.side===cu&&Z.forceSinglePass===!1?(Z.side=$o,Z.needsUpdate=!0,rr(Z,mt,Rt),Z.side=Ju,Z.needsUpdate=!0,rr(Z,mt,Rt),Z.side=cu):rr(Z,mt,Rt)}this.compile=function(Z,mt,Rt=null){Rt===null&&(Rt=Z),S=Vt.get(Rt),S.init(),R.push(S),Rt.traverseVisible(function(vt){vt.isLight&&vt.layers.test(mt.layers)&&(S.pushLight(vt),vt.castShadow&&S.pushShadow(vt))}),Z!==Rt&&Z.traverseVisible(function(vt){vt.isLight&&vt.layers.test(mt.layers)&&(S.pushLight(vt),vt.castShadow&&S.pushShadow(vt))}),S.setupLights(C._useLegacyLights);let St=new Set;return Z.traverse(function(vt){let he=vt.material;if(he)if(Array.isArray(he))for(let ue=0;ue<he.length;ue++){let we=he[ue];Kt(we,Rt,vt),St.add(we)}else Kt(he,Rt,vt),St.add(he)}),R.pop(),S=null,St},this.compileAsync=function(Z,mt,Rt=null){let St=this.compile(Z,mt,Rt);return new Promise(vt=>{function he(){if(St.forEach(function(ue){be.get(ue).currentProgram.isReady()&&St.delete(ue)}),St.size===0){vt(Z);return}setTimeout(he,10)}ee.get("KHR_parallel_shader_compile")!==null?he():setTimeout(he,10)})};let me=null;function ve(Z){me&&me(Z)}function He(){Ye.stop()}function Ue(){Ye.start()}let Ye=new _C;Ye.setAnimationLoop(ve),typeof self!="undefined"&&Ye.setContext(self),this.setAnimationLoop=function(Z){me=Z,wt.setAnimationLoop(Z),Z===null?Ye.stop():Ye.start()},wt.addEventListener("sessionstart",He),wt.addEventListener("sessionend",Ue),this.render=function(Z,mt){if(mt!==void 0&&mt.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(F===!0)return;Z.matrixWorldAutoUpdate===!0&&Z.updateMatrixWorld(),mt.parent===null&&mt.matrixWorldAutoUpdate===!0&&mt.updateMatrixWorld(),wt.enabled===!0&&wt.isPresenting===!0&&(wt.cameraAutoUpdate===!0&&wt.updateCamera(mt),mt=wt.getCamera()),Z.isScene===!0&&Z.onBeforeRender(C,Z,mt,q),S=Vt.get(Z,R.length),S.init(),R.push(S),ce.multiplyMatrices(mt.projectionMatrix,mt.matrixWorldInverse),ae.setFromProjectionMatrix(ce),Ut=this.localClippingEnabled,ut=Zt.init(this.clippingPlanes,Ut),I=Ce.get(Z,E.length),I.init(),E.push(I),je(Z,mt,0,C.sortObjects),I.finish(),C.sortObjects===!0&&I.sort(pt,yt),this.info.render.frame++,ut===!0&&Zt.beginShadows();let Rt=S.state.shadowsArray;if(ne.render(Rt,Z,mt),ut===!0&&Zt.endShadows(),this.info.autoReset===!0&&this.info.reset(),(wt.enabled===!1||wt.isPresenting===!1||wt.hasDepthSensing()===!1)&&rt.render(I,Z),S.setupLights(C._useLegacyLights),mt.isArrayCamera){let St=mt.cameras;for(let vt=0,he=St.length;vt<he;vt++){let ue=St[vt];wr(I,Z,ue,ue.viewport)}}else wr(I,Z,mt);q!==null&&(Wt.updateMultisampleRenderTarget(q),Wt.updateRenderTargetMipmap(q)),Z.isScene===!0&&Z.onAfterRender(C,Z,mt),V.resetDefaultState(),D=-1,xt=null,R.pop(),R.length>0?S=R[R.length-1]:S=null,E.pop(),E.length>0?I=E[E.length-1]:I=null};function je(Z,mt,Rt,St){if(Z.visible===!1)return;if(Z.layers.test(mt.layers)){if(Z.isGroup)Rt=Z.renderOrder;else if(Z.isLOD)Z.autoUpdate===!0&&Z.update(mt);else if(Z.isLight)S.pushLight(Z),Z.castShadow&&S.pushShadow(Z);else if(Z.isSprite){if(!Z.frustumCulled||ae.intersectsSprite(Z)){St&&$t.setFromMatrixPosition(Z.matrixWorld).applyMatrix4(ce);let ue=Ot.update(Z),we=Z.material;we.visible&&I.push(Z,ue,we,Rt,$t.z,null)}}else if((Z.isMesh||Z.isLine||Z.isPoints)&&(!Z.frustumCulled||ae.intersectsObject(Z))){let ue=Ot.update(Z),we=Z.material;if(St&&(Z.boundingSphere!==void 0?(Z.boundingSphere===null&&Z.computeBoundingSphere(),$t.copy(Z.boundingSphere.center)):(ue.boundingSphere===null&&ue.computeBoundingSphere(),$t.copy(ue.boundingSphere.center)),$t.applyMatrix4(Z.matrixWorld).applyMatrix4(ce)),Array.isArray(we)){let de=ue.groups;for(let Be=0,Ae=de.length;Be<Ae;Be++){let Pe=de[Be],nn=we[Pe.materialIndex];nn&&nn.visible&&I.push(Z,ue,nn,Rt,$t.z,Pe)}}else we.visible&&I.push(Z,ue,we,Rt,$t.z,null)}}let he=Z.children;for(let ue=0,we=he.length;ue<we;ue++)je(he[ue],mt,Rt,St)}function wr(Z,mt,Rt,St){let vt=Z.opaque,he=Z.transmissive,ue=Z.transparent;S.setupLightsView(Rt),ut===!0&&Zt.setGlobalState(C.clippingPlanes,Rt),he.length>0&&Jr(vt,he,mt,Rt),St&&fe.viewport(B.copy(St)),vt.length>0&&nr(vt,mt,Rt),he.length>0&&nr(he,mt,Rt),ue.length>0&&nr(ue,mt,Rt),fe.buffers.depth.setTest(!0),fe.buffers.depth.setMask(!0),fe.buffers.color.setMask(!0),fe.setPolygonOffset(!1)}function Jr(Z,mt,Rt,St){if((Rt.isScene===!0?Rt.overrideMaterial:null)!==null)return;let he=ge.isWebGL2;jt===null&&(jt=new du(1,1,{generateMipmaps:!0,type:ee.has("EXT_color_buffer_half_float")?oh:$u,minFilter:Ll,samples:he?4:0})),C.getDrawingBufferSize(te),he?jt.setSize(te.x,te.y):jt.setSize(Ky(te.x),Ky(te.y));let ue=C.getRenderTarget();C.setRenderTarget(jt),C.getClearColor(Dt),Q=C.getClearAlpha(),Q<1&&C.setClearColor(16777215,.5),C.clear();let we=C.toneMapping;C.toneMapping=Yu,nr(Z,Rt,St),Wt.updateMultisampleRenderTarget(jt),Wt.updateRenderTargetMipmap(jt);let de=!1;for(let Be=0,Ae=mt.length;Be<Ae;Be++){let Pe=mt[Be],nn=Pe.object,si=Pe.geometry,br=Pe.material,Vi=Pe.group;if(br.side===cu&&nn.layers.test(St.layers)){let sr=br.side;br.side=$o,br.needsUpdate=!0,Ie(nn,Rt,St,si,br,Vi),br.side=sr,br.needsUpdate=!0,de=!0}}de===!0&&(Wt.updateMultisampleRenderTarget(jt),Wt.updateRenderTargetMipmap(jt)),C.setRenderTarget(ue),C.setClearColor(Dt,Q),C.toneMapping=we}function nr(Z,mt,Rt){let St=mt.isScene===!0?mt.overrideMaterial:null;for(let vt=0,he=Z.length;vt<he;vt++){let ue=Z[vt],we=ue.object,de=ue.geometry,Be=St===null?ue.material:St,Ae=ue.group;we.layers.test(Rt.layers)&&Ie(we,mt,Rt,de,Be,Ae)}}function Ie(Z,mt,Rt,St,vt,he){Z.onBeforeRender(C,mt,Rt,St,vt,he),Z.modelViewMatrix.multiplyMatrices(Rt.matrixWorldInverse,Z.matrixWorld),Z.normalMatrix.getNormalMatrix(Z.modelViewMatrix),vt.onBeforeRender(C,mt,Rt,St,Z,he),vt.transparent===!0&&vt.side===cu&&vt.forceSinglePass===!1?(vt.side=$o,vt.needsUpdate=!0,C.renderBufferDirect(Rt,mt,St,vt,Z,he),vt.side=Ju,vt.needsUpdate=!0,C.renderBufferDirect(Rt,mt,St,vt,Z,he),vt.side=cu):C.renderBufferDirect(Rt,mt,St,vt,Z,he),Z.onAfterRender(C,mt,Rt,St,vt,he)}function rr(Z,mt,Rt){mt.isScene!==!0&&(mt=qt);let St=be.get(Z),vt=S.state.lights,he=S.state.shadowsArray,ue=vt.state.version,we=dt.getParameters(Z,vt.state,he,mt,Rt),de=dt.getProgramCacheKey(we),Be=St.programs;St.environment=Z.isMeshStandardMaterial?mt.environment:null,St.fog=mt.fog,St.envMap=(Z.isMeshStandardMaterial?tt:Me).get(Z.envMap||St.environment),St.envMapRotation=St.environment!==null&&Z.envMap===null?mt.environmentRotation:Z.envMapRotation,Be===void 0&&(Z.addEventListener("dispose",et),Be=new Map,St.programs=Be);let Ae=Be.get(de);if(Ae!==void 0){if(St.currentProgram===Ae&&St.lightsStateVersion===ue)return ur(Z,we),Ae}else we.uniforms=dt.getUniforms(Z),Z.onBuild(Rt,we,C),Z.onBeforeCompile(we,C),Ae=dt.acquireProgram(we,de),Be.set(de,Ae),St.uniforms=we.uniforms;let Pe=St.uniforms;return(!Z.isShaderMaterial&&!Z.isRawShaderMaterial||Z.clipping===!0)&&(Pe.clippingPlanes=Zt.uniform),ur(Z,we),St.needsLights=oi(Z),St.lightsStateVersion=ue,St.needsLights&&(Pe.ambientLightColor.value=vt.state.ambient,Pe.lightProbe.value=vt.state.probe,Pe.directionalLights.value=vt.state.directional,Pe.directionalLightShadows.value=vt.state.directionalShadow,Pe.spotLights.value=vt.state.spot,Pe.spotLightShadows.value=vt.state.spotShadow,Pe.rectAreaLights.value=vt.state.rectArea,Pe.ltc_1.value=vt.state.rectAreaLTC1,Pe.ltc_2.value=vt.state.rectAreaLTC2,Pe.pointLights.value=vt.state.point,Pe.pointLightShadows.value=vt.state.pointShadow,Pe.hemisphereLights.value=vt.state.hemi,Pe.directionalShadowMap.value=vt.state.directionalShadowMap,Pe.directionalShadowMatrix.value=vt.state.directionalShadowMatrix,Pe.spotShadowMap.value=vt.state.spotShadowMap,Pe.spotLightMatrix.value=vt.state.spotLightMatrix,Pe.spotLightMap.value=vt.state.spotLightMap,Pe.pointShadowMap.value=vt.state.pointShadowMap,Pe.pointShadowMatrix.value=vt.state.pointShadowMatrix),St.currentProgram=Ae,St.uniformsList=null,Ae}function pr(Z){if(Z.uniformsList===null){let mt=Z.currentProgram.getUniforms();Z.uniformsList=kc.seqWithValue(mt.seq,Z.uniforms)}return Z.uniformsList}function ur(Z,mt){let Rt=be.get(Z);Rt.outputColorSpace=mt.outputColorSpace,Rt.batching=mt.batching,Rt.instancing=mt.instancing,Rt.instancingColor=mt.instancingColor,Rt.instancingMorph=mt.instancingMorph,Rt.skinning=mt.skinning,Rt.morphTargets=mt.morphTargets,Rt.morphNormals=mt.morphNormals,Rt.morphColors=mt.morphColors,Rt.morphTargetsCount=mt.morphTargetsCount,Rt.numClippingPlanes=mt.numClippingPlanes,Rt.numIntersection=mt.numClipIntersection,Rt.vertexAlphas=mt.vertexAlphas,Rt.vertexTangents=mt.vertexTangents,Rt.toneMapping=mt.toneMapping}function Qn(Z,mt,Rt,St,vt){mt.isScene!==!0&&(mt=qt),Wt.resetTextureUnits();let he=mt.fog,ue=St.isMeshStandardMaterial?mt.environment:null,we=q===null?C.outputColorSpace:q.isXRRenderTarget===!0?q.texture.colorSpace:tl,de=(St.isMeshStandardMaterial?tt:Me).get(St.envMap||ue),Be=St.vertexColors===!0&&!!Rt.attributes.color&&Rt.attributes.color.itemSize===4,Ae=!!Rt.attributes.tangent&&(!!St.normalMap||St.anisotropy>0),Pe=!!Rt.morphAttributes.position,nn=!!Rt.morphAttributes.normal,si=!!Rt.morphAttributes.color,br=Yu;St.toneMapped&&(q===null||q.isXRRenderTarget===!0)&&(br=C.toneMapping);let Vi=Rt.morphAttributes.position||Rt.morphAttributes.normal||Rt.morphAttributes.color,sr=Vi!==void 0?Vi.length:0,ye=be.get(St),Ua=S.state.lights;if(ut===!0&&(Ut===!0||Z!==xt)){let Ai=Z===xt&&St.id===D;Zt.setState(St,Z,Ai)}let rn=!1;St.version===ye.__version?(ye.needsLights&&ye.lightsStateVersion!==Ua.state.version||ye.outputColorSpace!==we||vt.isBatchedMesh&&ye.batching===!1||!vt.isBatchedMesh&&ye.batching===!0||vt.isInstancedMesh&&ye.instancing===!1||!vt.isInstancedMesh&&ye.instancing===!0||vt.isSkinnedMesh&&ye.skinning===!1||!vt.isSkinnedMesh&&ye.skinning===!0||vt.isInstancedMesh&&ye.instancingColor===!0&&vt.instanceColor===null||vt.isInstancedMesh&&ye.instancingColor===!1&&vt.instanceColor!==null||vt.isInstancedMesh&&ye.instancingMorph===!0&&vt.morphTexture===null||vt.isInstancedMesh&&ye.instancingMorph===!1&&vt.morphTexture!==null||ye.envMap!==de||St.fog===!0&&ye.fog!==he||ye.numClippingPlanes!==void 0&&(ye.numClippingPlanes!==Zt.numPlanes||ye.numIntersection!==Zt.numIntersection)||ye.vertexAlphas!==Be||ye.vertexTangents!==Ae||ye.morphTargets!==Pe||ye.morphNormals!==nn||ye.morphColors!==si||ye.toneMapping!==br||ge.isWebGL2===!0&&ye.morphTargetsCount!==sr)&&(rn=!0):(rn=!0,ye.__version=St.version);let fo=ye.currentProgram;rn===!0&&(fo=rr(St,mt,vt));let ul=!1,Ge=!1,vs=!1,ir=fo.getUniforms(),Qo=ye.uniforms;if(fe.useProgram(fo.program)&&(ul=!0,Ge=!0,vs=!0),St.id!==D&&(D=St.id,Ge=!0),ul||xt!==Z){ir.setValue(ft,"projectionMatrix",Z.projectionMatrix),ir.setValue(ft,"viewMatrix",Z.matrixWorldInverse);let Ai=ir.map.cameraPosition;Ai!==void 0&&Ai.setValue(ft,$t.setFromMatrixPosition(Z.matrixWorld)),ge.logarithmicDepthBuffer&&ir.setValue(ft,"logDepthBufFC",2/(Math.log(Z.far+1)/Math.LN2)),(St.isMeshPhongMaterial||St.isMeshToonMaterial||St.isMeshLambertMaterial||St.isMeshBasicMaterial||St.isMeshStandardMaterial||St.isShaderMaterial)&&ir.setValue(ft,"isOrthographic",Z.isOrthographicCamera===!0),xt!==Z&&(xt=Z,Ge=!0,vs=!0)}if(vt.isSkinnedMesh){ir.setOptional(ft,vt,"bindMatrix"),ir.setOptional(ft,vt,"bindMatrixInverse");let Ai=vt.skeleton;Ai&&(ge.floatVertexTextures?(Ai.boneTexture===null&&Ai.computeBoneTexture(),ir.setValue(ft,"boneTexture",Ai.boneTexture,Wt)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}vt.isBatchedMesh&&(ir.setOptional(ft,vt,"batchingTexture"),ir.setValue(ft,"batchingTexture",vt._matricesTexture,Wt));let Le=Rt.morphAttributes;if((Le.position!==void 0||Le.normal!==void 0||Le.color!==void 0&&ge.isWebGL2===!0)&&P.update(vt,Rt,fo),(Ge||ye.receiveShadow!==vt.receiveShadow)&&(ye.receiveShadow=vt.receiveShadow,ir.setValue(ft,"receiveShadow",vt.receiveShadow)),St.isMeshGouraudMaterial&&St.envMap!==null&&(Qo.envMap.value=de,Qo.flipEnvMap.value=de.isCubeTexture&&de.isRenderTargetTexture===!1?-1:1),Ge&&(ir.setValue(ft,"toneMappingExposure",C.toneMappingExposure),ye.needsLights&&bi(Qo,vs),he&&St.fog===!0&&Ht.refreshFogUniforms(Qo,he),Ht.refreshMaterialUniforms(Qo,St,Lt,Mt,jt),kc.upload(ft,pr(ye),Qo,Wt)),St.isShaderMaterial&&St.uniformsNeedUpdate===!0&&(kc.upload(ft,pr(ye),Qo,Wt),St.uniformsNeedUpdate=!1),St.isSpriteMaterial&&ir.setValue(ft,"center",vt.center),ir.setValue(ft,"modelViewMatrix",vt.modelViewMatrix),ir.setValue(ft,"normalMatrix",vt.normalMatrix),ir.setValue(ft,"modelMatrix",vt.matrixWorld),St.isShaderMaterial||St.isRawShaderMaterial){let Ai=St.uniformsGroups;for(let Ba=0,mu=Ai.length;Ba<mu;Ba++)if(ge.isWebGL2){let Ti=Ai[Ba];ht.update(Ti,fo),ht.bind(Ti,fo)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return fo}function bi(Z,mt){Z.ambientLightColor.needsUpdate=mt,Z.lightProbe.needsUpdate=mt,Z.directionalLights.needsUpdate=mt,Z.directionalLightShadows.needsUpdate=mt,Z.pointLights.needsUpdate=mt,Z.pointLightShadows.needsUpdate=mt,Z.spotLights.needsUpdate=mt,Z.spotLightShadows.needsUpdate=mt,Z.rectAreaLights.needsUpdate=mt,Z.hemisphereLights.needsUpdate=mt}function oi(Z){return Z.isMeshLambertMaterial||Z.isMeshToonMaterial||Z.isMeshPhongMaterial||Z.isMeshStandardMaterial||Z.isShadowMaterial||Z.isShaderMaterial&&Z.lights===!0}this.getActiveCubeFace=function(){return W},this.getActiveMipmapLevel=function(){return X},this.getRenderTarget=function(){return q},this.setRenderTargetTextures=function(Z,mt,Rt){be.get(Z.texture).__webglTexture=mt,be.get(Z.depthTexture).__webglTexture=Rt;let St=be.get(Z);St.__hasExternalTextures=!0,St.__autoAllocateDepthBuffer=Rt===void 0,St.__autoAllocateDepthBuffer||ee.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),St.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(Z,mt){let Rt=be.get(Z);Rt.__webglFramebuffer=mt,Rt.__useDefaultFramebuffer=mt===void 0},this.setRenderTarget=function(Z,mt=0,Rt=0){q=Z,W=mt,X=Rt;let St=!0,vt=null,he=!1,ue=!1;if(Z){let de=be.get(Z);de.__useDefaultFramebuffer!==void 0?(fe.bindFramebuffer(ft.FRAMEBUFFER,null),St=!1):de.__webglFramebuffer===void 0?Wt.setupRenderTarget(Z):de.__hasExternalTextures&&Wt.rebindTextures(Z,be.get(Z.texture).__webglTexture,be.get(Z.depthTexture).__webglTexture);let Be=Z.texture;(Be.isData3DTexture||Be.isDataArrayTexture||Be.isCompressedArrayTexture)&&(ue=!0);let Ae=be.get(Z).__webglFramebuffer;Z.isWebGLCubeRenderTarget?(Array.isArray(Ae[mt])?vt=Ae[mt][Rt]:vt=Ae[mt],he=!0):ge.isWebGL2&&Z.samples>0&&Wt.useMultisampledRTT(Z)===!1?vt=be.get(Z).__webglMultisampledFramebuffer:Array.isArray(Ae)?vt=Ae[Rt]:vt=Ae,B.copy(Z.viewport),j.copy(Z.scissor),J=Z.scissorTest}else B.copy(K).multiplyScalar(Lt).floor(),j.copy(Bt).multiplyScalar(Lt).floor(),J=Gt;if(fe.bindFramebuffer(ft.FRAMEBUFFER,vt)&&ge.drawBuffers&&St&&fe.drawBuffers(Z,vt),fe.viewport(B),fe.scissor(j),fe.setScissorTest(J),he){let de=be.get(Z.texture);ft.framebufferTexture2D(ft.FRAMEBUFFER,ft.COLOR_ATTACHMENT0,ft.TEXTURE_CUBE_MAP_POSITIVE_X+mt,de.__webglTexture,Rt)}else if(ue){let de=be.get(Z.texture),Be=mt||0;ft.framebufferTextureLayer(ft.FRAMEBUFFER,ft.COLOR_ATTACHMENT0,de.__webglTexture,Rt||0,Be)}D=-1},this.readRenderTargetPixels=function(Z,mt,Rt,St,vt,he,ue){if(!(Z&&Z.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let we=be.get(Z).__webglFramebuffer;if(Z.isWebGLCubeRenderTarget&&ue!==void 0&&(we=we[ue]),we){fe.bindFramebuffer(ft.FRAMEBUFFER,we);try{let de=Z.texture,Be=de.format,Ae=de.type;if(Be!==na&&$.convert(Be)!==ft.getParameter(ft.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let Pe=Ae===oh&&(ee.has("EXT_color_buffer_half_float")||ge.isWebGL2&&ee.has("EXT_color_buffer_float"));if(Ae!==$u&&$.convert(Ae)!==ft.getParameter(ft.IMPLEMENTATION_COLOR_READ_TYPE)&&!(Ae===fu&&(ge.isWebGL2||ee.has("OES_texture_float")||ee.has("WEBGL_color_buffer_float")))&&!Pe){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}mt>=0&&mt<=Z.width-St&&Rt>=0&&Rt<=Z.height-vt&&ft.readPixels(mt,Rt,St,vt,$.convert(Be),$.convert(Ae),he)}finally{let de=q!==null?be.get(q).__webglFramebuffer:null;fe.bindFramebuffer(ft.FRAMEBUFFER,de)}}},this.copyFramebufferToTexture=function(Z,mt,Rt=0){let St=Math.pow(2,-Rt),vt=Math.floor(mt.image.width*St),he=Math.floor(mt.image.height*St);Wt.setTexture2D(mt,0),ft.copyTexSubImage2D(ft.TEXTURE_2D,Rt,0,0,Z.x,Z.y,vt,he),fe.unbindTexture()},this.copyTextureToTexture=function(Z,mt,Rt,St=0){let vt=mt.image.width,he=mt.image.height,ue=$.convert(Rt.format),we=$.convert(Rt.type);Wt.setTexture2D(Rt,0),ft.pixelStorei(ft.UNPACK_FLIP_Y_WEBGL,Rt.flipY),ft.pixelStorei(ft.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Rt.premultiplyAlpha),ft.pixelStorei(ft.UNPACK_ALIGNMENT,Rt.unpackAlignment),mt.isDataTexture?ft.texSubImage2D(ft.TEXTURE_2D,St,Z.x,Z.y,vt,he,ue,we,mt.image.data):mt.isCompressedTexture?ft.compressedTexSubImage2D(ft.TEXTURE_2D,St,Z.x,Z.y,mt.mipmaps[0].width,mt.mipmaps[0].height,ue,mt.mipmaps[0].data):ft.texSubImage2D(ft.TEXTURE_2D,St,Z.x,Z.y,ue,we,mt.image),St===0&&Rt.generateMipmaps&&ft.generateMipmap(ft.TEXTURE_2D),fe.unbindTexture()},this.copyTextureToTexture3D=function(Z,mt,Rt,St,vt=0){if(C.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let he=Math.round(Z.max.x-Z.min.x),ue=Math.round(Z.max.y-Z.min.y),we=Z.max.z-Z.min.z+1,de=$.convert(St.format),Be=$.convert(St.type),Ae;if(St.isData3DTexture)Wt.setTexture3D(St,0),Ae=ft.TEXTURE_3D;else if(St.isDataArrayTexture||St.isCompressedArrayTexture)Wt.setTexture2DArray(St,0),Ae=ft.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}ft.pixelStorei(ft.UNPACK_FLIP_Y_WEBGL,St.flipY),ft.pixelStorei(ft.UNPACK_PREMULTIPLY_ALPHA_WEBGL,St.premultiplyAlpha),ft.pixelStorei(ft.UNPACK_ALIGNMENT,St.unpackAlignment);let Pe=ft.getParameter(ft.UNPACK_ROW_LENGTH),nn=ft.getParameter(ft.UNPACK_IMAGE_HEIGHT),si=ft.getParameter(ft.UNPACK_SKIP_PIXELS),br=ft.getParameter(ft.UNPACK_SKIP_ROWS),Vi=ft.getParameter(ft.UNPACK_SKIP_IMAGES),sr=Rt.isCompressedTexture?Rt.mipmaps[vt]:Rt.image;ft.pixelStorei(ft.UNPACK_ROW_LENGTH,sr.width),ft.pixelStorei(ft.UNPACK_IMAGE_HEIGHT,sr.height),ft.pixelStorei(ft.UNPACK_SKIP_PIXELS,Z.min.x),ft.pixelStorei(ft.UNPACK_SKIP_ROWS,Z.min.y),ft.pixelStorei(ft.UNPACK_SKIP_IMAGES,Z.min.z),Rt.isDataTexture||Rt.isData3DTexture?ft.texSubImage3D(Ae,vt,mt.x,mt.y,mt.z,he,ue,we,de,Be,sr.data):St.isCompressedArrayTexture?ft.compressedTexSubImage3D(Ae,vt,mt.x,mt.y,mt.z,he,ue,we,de,sr.data):ft.texSubImage3D(Ae,vt,mt.x,mt.y,mt.z,he,ue,we,de,Be,sr),ft.pixelStorei(ft.UNPACK_ROW_LENGTH,Pe),ft.pixelStorei(ft.UNPACK_IMAGE_HEIGHT,nn),ft.pixelStorei(ft.UNPACK_SKIP_PIXELS,si),ft.pixelStorei(ft.UNPACK_SKIP_ROWS,br),ft.pixelStorei(ft.UNPACK_SKIP_IMAGES,Vi),vt===0&&St.generateMipmaps&&ft.generateMipmap(Ae),fe.unbindTexture()},this.initTexture=function(Z){Z.isCubeTexture?Wt.setTextureCube(Z,0):Z.isData3DTexture?Wt.setTexture3D(Z,0):Z.isDataArrayTexture||Z.isCompressedArrayTexture?Wt.setTexture2DArray(Z,0):Wt.setTexture2D(Z,0),fe.unbindTexture()},this.resetState=function(){W=0,X=0,q=null,fe.reset(),V.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return hu}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;let e=this.getContext();e.drawingBufferColorSpace=t===Lv?"display-p3":"srgb",e.unpackColorSpace=xr.workingColorSpace===Vd?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}},mv=class extends gv{};mv.prototype.isWebGL1Renderer=!0;var yv=class{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=$y,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Zu()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return mC("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,o){t*=this.stride,o*=e.stride;for(let s=0,c=this.stride;s<c;s++)this.array[t+s]=e.array[o+s];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Zu()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),o=new this.constructor(e,this.stride);return o.setUsage(this.usage),o}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Zu()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}},wo=new Pt,qd=class n{constructor(t,e,o,s=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=o,this.normalized=s}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,o=this.data.count;e<o;e++)wo.fromBufferAttribute(this,e),wo.applyMatrix4(t),this.setXYZ(e,wo.x,wo.y,wo.z);return this}applyNormalMatrix(t){for(let e=0,o=this.count;e<o;e++)wo.fromBufferAttribute(this,e),wo.applyNormalMatrix(t),this.setXYZ(e,wo.x,wo.y,wo.z);return this}transformDirection(t){for(let e=0,o=this.count;e<o;e++)wo.fromBufferAttribute(this,e),wo.transformDirection(t),this.setXYZ(e,wo.x,wo.y,wo.z);return this}getComponent(t,e){let o=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(o=Ca(o,this.array)),o}setComponent(t,e,o){return this.normalized&&(o=_r(o,this.array)),this.data.array[t*this.data.stride+this.offset+e]=o,this}setX(t,e){return this.normalized&&(e=_r(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=_r(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=_r(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=_r(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=Ca(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=Ca(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=Ca(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=Ca(e,this.array)),e}setXY(t,e,o){return t=t*this.data.stride+this.offset,this.normalized&&(e=_r(e,this.array),o=_r(o,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=o,this}setXYZ(t,e,o,s){return t=t*this.data.stride+this.offset,this.normalized&&(e=_r(e,this.array),o=_r(o,this.array),s=_r(s,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=o,this.data.array[t+2]=s,this}setXYZW(t,e,o,s,c){return t=t*this.data.stride+this.offset,this.normalized&&(e=_r(e,this.array),o=_r(o,this.array),s=_r(s,this.array),c=_r(c,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=o,this.data.array[t+2]=s,this.data.array[t+3]=c,this}clone(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let o=0;o<this.count;o++){let s=o*this.data.stride+this.offset;for(let c=0;c<this.itemSize;c++)e.push(this.data.array[s+c])}return new ms(new this.array.constructor(e),this.itemSize,this.normalized)}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new n(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let o=0;o<this.count;o++){let s=o*this.data.stride+this.offset;for(let c=0;c<this.itemSize;c++)e.push(this.data.array[s+c])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}},vv=class extends Bl{constructor(t){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new ar(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}},Hu,eh=new Pt,Nc=new Pt,Oc=new Pt,Dc=new ze,nh=new ze,bC=new vi,yd=new Pt,rh=new Pt,vd=new Pt,nC=new ze,ky=new ze,rC=new ze,_v=class extends ia{constructor(t=new vv){if(super(),this.isSprite=!0,this.type="Sprite",Hu===void 0){Hu=new Qu;let e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),o=new yv(e,5);Hu.setIndex([0,1,2,0,2,3]),Hu.setAttribute("position",new qd(o,3,0,!1)),Hu.setAttribute("uv",new qd(o,2,3,!1))}this.geometry=Hu,this.material=t,this.center=new ze(.5,.5)}raycast(t,e){t.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Nc.setFromMatrixScale(this.matrixWorld),bC.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),Oc.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Nc.multiplyScalar(-Oc.z);let o=this.material.rotation,s,c;o!==0&&(c=Math.cos(o),s=Math.sin(o));let p=this.center;_d(yd.set(-.5,-.5,0),Oc,p,Nc,s,c),_d(rh.set(.5,-.5,0),Oc,p,Nc,s,c),_d(vd.set(.5,.5,0),Oc,p,Nc,s,c),nC.set(0,0),ky.set(1,0),rC.set(1,1);let h=t.ray.intersectTriangle(yd,rh,vd,!1,eh);if(h===null&&(_d(rh.set(-.5,.5,0),Oc,p,Nc,s,c),ky.set(0,1),h=t.ray.intersectTriangle(yd,vd,rh,!1,eh),h===null))return;let g=t.ray.origin.distanceTo(eh);g<t.near||g>t.far||e.push({distance:g,point:eh.clone(),uv:Nl.getInterpolation(eh,yd,rh,vd,nC,ky,rC,new ze),face:null,object:this})}copy(t,e){return super.copy(t,e),t.center!==void 0&&this.center.copy(t.center),this.material=t.material,this}};_v.Dispose=function(){Hu.dispose(),Hu=void 0};function _d(n,t,e,o,s,c){Dc.subVectors(n,e).addScalar(.5).multiply(o),s!==void 0?(nh.x=c*Dc.x-s*Dc.y,nh.y=s*Dc.x+c*Dc.y):nh.copy(Dc),n.copy(t),n.x+=nh.x,n.y+=nh.y,n.applyMatrix4(bC)}function xd(n,t,e){return!n||!e&&n.constructor===t?n:typeof t.BYTES_PER_ELEMENT=="number"?new t(n):Array.prototype.slice.call(n)}function pX(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}var Xc=class{constructor(t,e,o,s){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=s!==void 0?s:new e.constructor(o),this.sampleValues=e,this.valueSize=o,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,o=this._cachedIndex,s=e[o],c=e[o-1];t:{e:{let p;n:{r:if(!(t<s)){for(let h=o+2;;){if(s===void 0){if(t<c)break r;return o=e.length,this._cachedIndex=o,this.copySampleValue_(o-1)}if(o===h)break;if(c=s,s=e[++o],t<s)break e}p=e.length;break n}if(!(t>=c)){let h=e[1];t<h&&(o=2,c=h);for(let g=o-2;;){if(c===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(o===g)break;if(s=c,c=e[--o-1],t>=c)break e}p=o,o=0;break n}break t}for(;o<p;){let h=o+p>>>1;t<e[h]?p=h:o=h+1}if(s=e[o],c=e[o-1],c===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(s===void 0)return o=e.length,this._cachedIndex=o,this.copySampleValue_(o-1)}this._cachedIndex=o,this.intervalChanged_(o,c,s)}return this.interpolate_(o,c,t,s)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,o=this.sampleValues,s=this.valueSize,c=t*s;for(let p=0;p!==s;++p)e[p]=o[c+p];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},xv=class extends Xc{constructor(t,e,o,s){super(t,e,o,s),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:fT,endingEnd:fT}}intervalChanged_(t,e,o){let s=this.parameterPositions,c=t-2,p=t+1,h=s[c],g=s[p];if(h===void 0)switch(this.getSettings_().endingStart){case hT:c=t,h=2*e-o;break;case pT:c=s.length-2,h=e+s[c]-s[c+1];break;default:c=t,h=o}if(g===void 0)switch(this.getSettings_().endingEnd){case hT:p=t,g=2*o-e;break;case pT:p=1,g=o+s[1]-s[0];break;default:p=t-1,g=e}let m=(o-e)*.5,_=this.valueSize;this._weightPrev=m/(e-h),this._weightNext=m/(g-o),this._offsetPrev=c*_,this._offsetNext=p*_}interpolate_(t,e,o,s){let c=this.resultBuffer,p=this.sampleValues,h=this.valueSize,g=t*h,m=g-h,_=this._offsetPrev,w=this._offsetNext,x=this._weightPrev,b=this._weightNext,T=(o-e)/(s-e),I=T*T,S=I*T,E=-x*S+2*x*I-x*T,R=(1+x)*S+(-1.5-2*x)*I+(-.5+x)*T+1,C=(-1-b)*S+(1.5+b)*I+.5*T,F=b*S-b*I;for(let W=0;W!==h;++W)c[W]=E*p[_+W]+R*p[m+W]+C*p[g+W]+F*p[w+W];return c}},Ev=class extends Xc{constructor(t,e,o,s){super(t,e,o,s)}interpolate_(t,e,o,s){let c=this.resultBuffer,p=this.sampleValues,h=this.valueSize,g=t*h,m=g-h,_=(o-e)/(s-e),w=1-_;for(let x=0;x!==h;++x)c[x]=p[m+x]*w+p[g+x]*_;return c}},wv=class extends Xc{constructor(t,e,o,s){super(t,e,o,s)}interpolate_(t){return this.copySampleValue_(t-1)}},oa=class{constructor(t,e,o,s){if(t===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(e===void 0||e.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=xd(e,this.TimeBufferType),this.values=xd(o,this.ValueBufferType),this.setInterpolation(s||this.DefaultInterpolation)}static toJSON(t){let e=t.constructor,o;if(e.toJSON!==this.toJSON)o=e.toJSON(t);else{o={name:t.name,times:xd(t.times,Array),values:xd(t.values,Array)};let s=t.getInterpolation();s!==t.DefaultInterpolation&&(o.interpolation=s)}return o.type=t.ValueTypeName,o}InterpolantFactoryMethodDiscrete(t){return new wv(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new Ev(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new xv(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case wd:e=this.InterpolantFactoryMethodDiscrete;break;case Sd:e=this.InterpolantFactoryMethodLinear;break;case dy:e=this.InterpolantFactoryMethodSmooth;break}if(e===void 0){let o="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(o);return console.warn("THREE.KeyframeTrack:",o),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return wd;case this.InterpolantFactoryMethodLinear:return Sd;case this.InterpolantFactoryMethodSmooth:return dy}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){let e=this.times;for(let o=0,s=e.length;o!==s;++o)e[o]+=t}return this}scale(t){if(t!==1){let e=this.times;for(let o=0,s=e.length;o!==s;++o)e[o]*=t}return this}trim(t,e){let o=this.times,s=o.length,c=0,p=s-1;for(;c!==s&&o[c]<t;)++c;for(;p!==-1&&o[p]>e;)--p;if(++p,c!==0||p!==s){c>=p&&(p=Math.max(p,1),c=p-1);let h=this.getValueSize();this.times=o.slice(c,p),this.values=this.values.slice(c*h,p*h)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);let o=this.times,s=this.values,c=o.length;c===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let p=null;for(let h=0;h!==c;h++){let g=o[h];if(typeof g=="number"&&isNaN(g)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,h,g),t=!1;break}if(p!==null&&p>g){console.error("THREE.KeyframeTrack: Out of order keys.",this,h,g,p),t=!1;break}p=g}if(s!==void 0&&pX(s))for(let h=0,g=s.length;h!==g;++h){let m=s[h];if(isNaN(m)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,h,m),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),o=this.getValueSize(),s=this.getInterpolation()===dy,c=t.length-1,p=1;for(let h=1;h<c;++h){let g=!1,m=t[h],_=t[h+1];if(m!==_&&(h!==1||m!==t[0]))if(s)g=!0;else{let w=h*o,x=w-o,b=w+o;for(let T=0;T!==o;++T){let I=e[w+T];if(I!==e[x+T]||I!==e[b+T]){g=!0;break}}}if(g){if(h!==p){t[p]=t[h];let w=h*o,x=p*o;for(let b=0;b!==o;++b)e[x+b]=e[w+b]}++p}}if(c>0){t[p]=t[c];for(let h=c*o,g=p*o,m=0;m!==o;++m)e[g+m]=e[h+m];++p}return p!==t.length?(this.times=t.slice(0,p),this.values=e.slice(0,p*o)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),o=this.constructor,s=new o(this.name,t,e);return s.createInterpolant=this.createInterpolant,s}};oa.prototype.TimeBufferType=Float32Array;oa.prototype.ValueBufferType=Float32Array;oa.prototype.DefaultInterpolation=Sd;var zl=class extends oa{};zl.prototype.ValueTypeName="bool";zl.prototype.ValueBufferType=Array;zl.prototype.DefaultInterpolation=wd;zl.prototype.InterpolantFactoryMethodLinear=void 0;zl.prototype.InterpolantFactoryMethodSmooth=void 0;var Sv=class extends oa{};Sv.prototype.ValueTypeName="color";var Mv=class extends oa{};Mv.prototype.ValueTypeName="number";var bv=class extends Xc{constructor(t,e,o,s){super(t,e,o,s)}interpolate_(t,e,o,s){let c=this.resultBuffer,p=this.sampleValues,h=this.valueSize,g=(o-e)/(s-e),m=t*h;for(let _=m+h;m!==_;m+=4)ju.slerpFlat(c,0,p,m-h,p,m,g);return c}},uh=class extends oa{InterpolantFactoryMethodLinear(t){return new bv(this.times,this.values,this.getValueSize(),t)}};uh.prototype.ValueTypeName="quaternion";uh.prototype.DefaultInterpolation=Sd;uh.prototype.InterpolantFactoryMethodSmooth=void 0;var Gl=class extends oa{};Gl.prototype.ValueTypeName="string";Gl.prototype.ValueBufferType=Array;Gl.prototype.DefaultInterpolation=wd;Gl.prototype.InterpolantFactoryMethodLinear=void 0;Gl.prototype.InterpolantFactoryMethodSmooth=void 0;var Av=class extends oa{};Av.prototype.ValueTypeName="vector";var Tv=class{constructor(t,e,o){let s=this,c=!1,p=0,h=0,g,m=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=o,this.itemStart=function(_){h++,c===!1&&s.onStart!==void 0&&s.onStart(_,p,h),c=!0},this.itemEnd=function(_){p++,s.onProgress!==void 0&&s.onProgress(_,p,h),p===h&&(c=!1,s.onLoad!==void 0&&s.onLoad())},this.itemError=function(_){s.onError!==void 0&&s.onError(_)},this.resolveURL=function(_){return g?g(_):_},this.setURLModifier=function(_){return g=_,this},this.addHandler=function(_,w){return m.push(_,w),this},this.removeHandler=function(_){let w=m.indexOf(_);return w!==-1&&m.splice(w,2),this},this.getHandler=function(_){for(let w=0,x=m.length;w<x;w+=2){let b=m[w],T=m[w+1];if(b.global&&(b.lastIndex=0),b.test(_))return T}return null}}},dX=new Tv,Cv=class{constructor(t){this.manager=t!==void 0?t:dX,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){let o=this;return new Promise(function(s,c){o.load(t,s,e,c)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}};Cv.DEFAULT_MATERIAL_NAME="__DEFAULT";var Ov="\\\\[\\\\]\\\\.:\\\\/",gX=new RegExp("["+Ov+"]","g"),Dv="[^"+Ov+"]",mX="[^"+Ov.replace("\\\\.","")+"]",yX=/((?:WC+[\\/:])*)/.source.replace("WC",Dv),vX=/(WCOD+)?/.source.replace("WCOD",mX),_X=/(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace("WC",Dv),xX=/\\.(WC+)(?:\\[(.+)\\])?/.source.replace("WC",Dv),EX=new RegExp("^"+yX+vX+_X+xX+"$"),wX=["material","materials","bones","map"],Pv=class{constructor(t,e,o){let s=o||Or.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,s)}getValue(t,e){this.bind();let o=this._targetGroup.nCachedObjects_,s=this._bindings[o];s!==void 0&&s.getValue(t,e)}setValue(t,e){let o=this._bindings;for(let s=this._targetGroup.nCachedObjects_,c=o.length;s!==c;++s)o[s].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,o=t.length;e!==o;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,o=t.length;e!==o;++e)t[e].unbind()}},Or=class n{constructor(t,e,o){this.path=e,this.parsedPath=o||n.parseTrackName(e),this.node=n.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,o){return t&&t.isAnimationObjectGroup?new n.Composite(t,e,o):new n(t,e,o)}static sanitizeNodeName(t){return t.replace(/\\s/g,"_").replace(gX,"")}static parseTrackName(t){let e=EX.exec(t);if(e===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);let o={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},s=o.nodeName&&o.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){let c=o.nodeName.substring(s+1);wX.indexOf(c)!==-1&&(o.nodeName=o.nodeName.substring(0,s),o.objectName=c)}if(o.propertyName===null||o.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return o}static findNode(t,e){if(e===void 0||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){let o=t.skeleton.getBoneByName(e);if(o!==void 0)return o}if(t.children){let o=function(c){for(let p=0;p<c.length;p++){let h=c[p];if(h.name===e||h.uuid===e)return h;let g=o(h.children);if(g)return g}return null},s=o(t.children);if(s)return s}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){let o=this.resolvedProperty;for(let s=0,c=o.length;s!==c;++s)t[e++]=o[s]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){let o=this.resolvedProperty;for(let s=0,c=o.length;s!==c;++s)o[s]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let o=this.resolvedProperty;for(let s=0,c=o.length;s!==c;++s)o[s]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let o=this.resolvedProperty;for(let s=0,c=o.length;s!==c;++s)o[s]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node,e=this.parsedPath,o=e.objectName,s=e.propertyName,c=e.propertyIndex;if(t||(t=n.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(o){let m=e.objectIndex;switch(o){case"materials":if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}t=t.material.materials;break;case"bones":if(!t.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}t=t.skeleton.bones;for(let _=0;_<t.length;_++)if(t[_].name===m){m=_;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}t=t.material.map;break;default:if(t[o]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}t=t[o]}if(m!==void 0){if(t[m]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);return}t=t[m]}}let p=t[s];if(p===void 0){let m=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+m+"."+s+" but it wasn't found.",t);return}let h=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?h=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(h=this.Versioning.MatrixWorldNeedsUpdate);let g=this.BindingType.Direct;if(c!==void 0){if(s==="morphTargetInfluences"){if(!t.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!t.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}t.morphTargetDictionary[c]!==void 0&&(c=t.morphTargetDictionary[c])}g=this.BindingType.ArrayElement,this.resolvedProperty=p,this.propertyIndex=c}else p.fromArray!==void 0&&p.toArray!==void 0?(g=this.BindingType.HasFromToArray,this.resolvedProperty=p):Array.isArray(p)?(g=this.BindingType.EntireArray,this.resolvedProperty=p):this.propertyName=s;this.getValue=this.GetterByBindingType[g],this.setValue=this.SetterByBindingTypeAndVersioning[g][h]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};Or.Composite=Pv;Or.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Or.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Or.prototype.GetterByBindingType=[Or.prototype._getValue_direct,Or.prototype._getValue_array,Or.prototype._getValue_arrayElement,Or.prototype._getValue_toArray];Or.prototype.SetterByBindingTypeAndVersioning=[[Or.prototype._setValue_direct,Or.prototype._setValue_direct_setNeedsUpdate,Or.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Or.prototype._setValue_array,Or.prototype._setValue_array_setNeedsUpdate,Or.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Or.prototype._setValue_arrayElement,Or.prototype._setValue_arrayElement_setNeedsUpdate,Or.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Or.prototype._setValue_fromArray,Or.prototype._setValue_fromArray_setNeedsUpdate,Or.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var Ytt=new Float32Array(1);typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Iv}}));typeof window!="undefined"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Iv);var zi=63710088e-1,Jtt={centimeters:zi*100,centimetres:zi*100,degrees:zi/111325,feet:zi*3.28084,inches:zi*39.37,kilometers:zi/1e3,kilometres:zi/1e3,meters:zi,metres:zi,miles:zi/1609.344,millimeters:zi*1e3,millimetres:zi*1e3,nauticalmiles:zi/1852,radians:1,yards:zi*1.0936},Ktt={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/zi,yards:1.0936133};function bo(n,t,e){e===void 0&&(e={});var o={type:"Feature"};return(e.id===0||e.id)&&(o.id=e.id),e.bbox&&(o.bbox=e.bbox),o.properties=t||{},o.geometry=n,o}function Pr(n,t,e){if(e===void 0&&(e={}),!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ia(n[0])||!Ia(n[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:n};return bo(o,t,e)}function Dr(n,t,e){e===void 0&&(e={});for(var o=0,s=n;o<s.length;o++){var c=s[o];if(c.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var p=0;p<c[c.length-1].length;p++)if(c[c.length-1][p]!==c[0][p])throw new Error("First and last Position are not equivalent.")}var h={type:"Polygon",coordinates:n};return bo(h,t,e)}function Gi(n,t,e){if(e===void 0&&(e={}),n.length<2)throw new Error("coordinates must be an array of two or more positions");var o={type:"LineString",coordinates:n};return bo(o,t,e)}function Fv(n,t,e){e===void 0&&(e={});var o={type:"MultiPoint",coordinates:n};return bo(o,t,e)}function Ia(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}function Ei(n,t,e){if(n!==null)for(var o,s,c,p,h,g,m,_=0,w=0,x,b=n.type,T=b==="FeatureCollection",I=b==="Feature",S=T?n.features.length:1,E=0;E<S;E++){m=T?n.features[E].geometry:I?n.geometry:n,x=m?m.type==="GeometryCollection":!1,h=x?m.geometries.length:1;for(var R=0;R<h;R++){var C=0,F=0;if(p=x?m.geometries[R]:m,p!==null){g=p.coordinates;var W=p.type;switch(_=e&&(W==="Polygon"||W==="MultiPolygon")?1:0,W){case null:break;case"Point":if(t(g,w,E,C,F)===!1)return!1;w++,C++;break;case"LineString":case"MultiPoint":for(o=0;o<g.length;o++){if(t(g[o],w,E,C,F)===!1)return!1;w++,W==="MultiPoint"&&C++}W==="LineString"&&C++;break;case"Polygon":case"MultiLineString":for(o=0;o<g.length;o++){for(s=0;s<g[o].length-_;s++){if(t(g[o][s],w,E,C,F)===!1)return!1;w++}W==="MultiLineString"&&C++,W==="Polygon"&&F++}W==="Polygon"&&C++;break;case"MultiPolygon":for(o=0;o<g.length;o++){for(F=0,s=0;s<g[o].length;s++){for(c=0;c<g[o][s].length-_;c++){if(t(g[o][s][c],w,E,C,F)===!1)return!1;w++}F++}C++}break;case"GeometryCollection":for(o=0;o<p.geometries.length;o++)if(Ei(p.geometries[o],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function AC(n,t,e,o){var s=e;return Ei(n,function(c,p,h,g,m){p===0&&e===void 0?s=c:s=t(s,c,p,h,g,m)},o),s}function el(n,t){var e,o,s,c,p,h,g,m,_,w,x=0,b=n.type==="FeatureCollection",T=n.type==="Feature",I=b?n.features.length:1;for(e=0;e<I;e++){for(h=b?n.features[e].geometry:T?n.geometry:n,m=b?n.features[e].properties:T?n.properties:{},_=b?n.features[e].bbox:T?n.bbox:void 0,w=b?n.features[e].id:T?n.id:void 0,g=h?h.type==="GeometryCollection":!1,p=g?h.geometries.length:1,s=0;s<p;s++){if(c=g?h.geometries[s]:h,c===null){if(t(null,x,m,_,w)===!1)return!1;continue}switch(c.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(c,x,m,_,w)===!1)return!1;break}case"GeometryCollection":{for(o=0;o<c.geometries.length;o++)if(t(c.geometries[o],x,m,_,w)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}x++}}function ys(n,t){el(n,function(e,o,s,c,p){var h=e===null?null:e.type;switch(h){case null:case"Point":case"LineString":case"Polygon":return t(bo(e,s,{bbox:c,id:p}),o,0)===!1?!1:void 0}var g;switch(h){case"MultiPoint":g="Point";break;case"MultiLineString":g="LineString";break;case"MultiPolygon":g="Polygon";break}for(var m=0;m<e.coordinates.length;m++){var _=e.coordinates[m],w={type:g,coordinates:_};if(t(bo(w,s),o,m)===!1)return!1}})}function Uv(n){var t=[1/0,1/0,-1/0,-1/0];return Ei(n,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}Uv.default=Uv;var Ao=Uv;function Qi(n){if(!n)throw new Error("coord is required");if(!Array.isArray(n)){if(n.type==="Feature"&&n.geometry!==null&&n.geometry.type==="Point")return n.geometry.coordinates;if(n.type==="Point")return n.coordinates}if(Array.isArray(n)&&n.length>=2&&!Array.isArray(n[0])&&!Array.isArray(n[1]))return n;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Bv(n,t,e){if(!n)throw new Error("No feature passed");if(!e)throw new Error(".featureOf() requires a name");if(!n||n.type!=="Feature"||!n.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!n.geometry||n.geometry.type!==t)throw new Error("Invalid input to "+e+": must be a "+t+", given "+n.geometry.type)}function to(n){return n.type==="Feature"?n.geometry:n}var IX=Je(Xd(),1);var GX=Je(VC(),1);function ki(n,t,e){if(e===void 0&&(e={}),!n)throw new Error("point is required");if(!t)throw new Error("polygon is required");var o=Qi(n),s=to(t),c=s.type,p=t.bbox,h=s.coordinates;if(p&&kX(o,p)===!1)return!1;c==="Polygon"&&(h=[h]);for(var g=!1,m=0;m<h.length&&!g;m++)if(WC(o,h[m][0],e.ignoreBoundary)){for(var _=!1,w=1;w<h[m].length&&!_;)WC(o,h[m][w],!e.ignoreBoundary)&&(_=!0),w++;_||(g=!0)}return g}function WC(n,t,e){var o=!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 s=0,c=t.length-1;s<t.length;c=s++){var p=t[s][0],h=t[s][1],g=t[c][0],m=t[c][1],_=n[1]*(p-g)+h*(g-n[0])+m*(n[0]-p)===0&&(p-n[0])*(g-n[0])<=0&&(h-n[1])*(m-n[1])<=0;if(_)return!e;var w=h>n[1]!=m>n[1]&&n[0]<(g-p)*(n[1]-h)/(m-h)+p;w&&(o=!o)}return o}function kX(n,t){return t[0]<=n[0]&&t[1]<=n[1]&&t[2]>=n[0]&&t[3]>=n[1]}var $C=new ArrayBuffer(16),Cnt=new Float64Array($C),Pnt=new Uint32Array($C);var n7=Je(t_(),1);var eit=function(){function n(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 e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(var e=0;e<this.length-1;e++){var o=this.points[e],s=this.points[e+1];this.centers.push({x:(o.x+s.x)/2,y:(o.y+s.y)/2,z:(o.z+s.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var e=0;e<this.centers.length-1;e++){var c=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,p=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,h=this.points[e+1].z-(this.centers[e].y+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+c),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+p),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+h)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+c),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+p),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+h)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}return n.prototype.cacheSteps=function(t){var e=[],o=this.pos(0);e.push(0);for(var s=0;s<this.duration;s+=10){var c=this.pos(s),p=Math.sqrt((c.x-o.x)*(c.x-o.x)+(c.y-o.y)*(c.y-o.y)+(c.z-o.z)*(c.z-o.z));p>t&&(e.push(s),o=c)}return e},n.prototype.vector=function(t){var e=this.pos(t+10),o=this.pos(t-10);return{angle:180*Math.atan2(e.y-o.y,e.x-o.x)/3.14,speed:Math.sqrt((o.x-e.x)*(o.x-e.x)+(o.y-e.y)*(o.y-e.y)+(o.z-e.z)*(o.z-e.z))}},n.prototype.pos=function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var o=e/this.duration;if(o>=1)return this.points[this.length-1];var s=Math.floor((this.points.length-1)*o),c=(this.length-1)*o-s;return r7(c,this.points[s],this.controls[s][1],this.controls[s+1][0],this.points[s+1])},n}();function r7(n,t,e,o,s){var c=i7(n),p={x:s.x*c[0]+o.x*c[1]+e.x*c[2]+t.x*c[3],y:s.y*c[0]+o.y*c[1]+e.y*c[2]+t.y*c[3],z:s.z*c[0]+o.z*c[1]+e.z*c[2]+t.z*c[3]};return p}function i7(n){var t=n*n,e=t*n;return[e,3*t*(1-n),3*n*(1-n)*(1-n),(1-n)*(1-n)*(1-n)]}function hh(n,t){t===void 0&&(t={});var e=Number(n[0]),o=Number(n[1]),s=Number(n[2]),c=Number(n[3]);if(n.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var p=[e,o],h=[e,c],g=[s,c],m=[s,o];return Dr([[p,m,g,h,p]],t.properties,{bbox:n,id:t.id})}function o7(n){return hh(Ao(n))}var e_=o7;var w7=Je(oP(),1);var Z7=Je(lg(),1);var K7=Je(Xd(),1);var tY=Je(t_(),1);var SP=Math.PI/180,MP=180/Math.PI,_h=function(n,t){this.lon=n,this.lat=t,this.x=SP*n,this.y=SP*t};_h.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)};_h.prototype.antipode=function(){var n=-1*this.lat,t=this.lon<0?180+this.lon:(180-this.lon)*-1;return new _h(t,n)};var bP=function(){this.coords=[],this.length=0};bP.prototype.move_to=function(n){this.length++,this.coords.push(n)};var E_=function(n){this.properties=n||{},this.geometries=[]};E_.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 n=[],t=0;t<this.geometries.length;t++)n.push(this.geometries[t].coords);return{geometry:{type:"MultiLineString",coordinates:n},type:"Feature",properties:this.properties}};E_.prototype.wkt=function(){for(var n="",t="LINESTRING(",e=function(c){t+=c[0]+" "+c[1]+","},o=0;o<this.geometries.length;o++){if(this.geometries[o].coords.length===0)return"LINESTRING(empty)";var s=this.geometries[o].coords;s.forEach(e),n+=t.substring(0,t.length-1)+")"}return n};var AP=function(n,t,e){if(!n||n.x===void 0||n.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 _h(n.x,n.y),this.end=new _h(t.x,t.y),this.properties=e||{};var o=this.start.x-this.end.x,s=this.start.y-this.end.y,c=Math.pow(Math.sin(s/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(o/2),2);if(this.g=2*Math.asin(Math.sqrt(c)),this.g===Math.PI)throw new Error("it appears "+n.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 "+n+" and "+t)};AP.prototype.interpolate=function(n){var t=Math.sin((1-n)*this.g)/Math.sin(this.g),e=Math.sin(n*this.g)/Math.sin(this.g),o=t*Math.cos(this.start.y)*Math.cos(this.start.x)+e*Math.cos(this.end.y)*Math.cos(this.end.x),s=t*Math.cos(this.start.y)*Math.sin(this.start.x)+e*Math.cos(this.end.y)*Math.sin(this.end.x),c=t*Math.sin(this.start.y)+e*Math.sin(this.end.y),p=MP*Math.atan2(c,Math.sqrt(Math.pow(o,2)+Math.pow(s,2))),h=MP*Math.atan2(s,o);return[h,p]};AP.prototype.Arc=function(n,t){var e=[];if(!n||n<=2)e.push([this.start.lon,this.start.lat]),e.push([this.end.lon,this.end.lat]);else for(var o=1/(n-1),s=0;s<n;++s){var c=o*s,p=this.interpolate(c);e.push(p)}for(var h=!1,g=0,m=t&&t.offset?t.offset:10,_=180-m,w=-180+m,x=360-m,b=1;b<e.length;++b){var T=e[b-1][0],I=e[b][0],S=Math.abs(I-T);S>x&&(I>_&&T<w||T>_&&I<w)?h=!0:S>g&&(g=S)}var E=[];if(h&&g<m){var R=[];E.push(R);for(var C=0;C<e.length;++C){var F=parseFloat(e[C][0]);if(C>0&&Math.abs(F-e[C-1][0])>x){var W=parseFloat(e[C-1][0]),X=parseFloat(e[C-1][1]),q=parseFloat(e[C][0]),D=parseFloat(e[C][1]);if(W>-180&&W<w&&q===180&&C+1<e.length&&e[C-1][0]>-180&&e[C-1][0]<w){R.push([-180,e[C][1]]),C++,R.push([e[C][0],e[C][1]]);continue}else if(W>_&&W<180&&q===-180&&C+1<e.length&&e[C-1][0]>_&&e[C-1][0]<180){R.push([180,e[C][1]]),C++,R.push([e[C][0],e[C][1]]);continue}if(W<w&&q>_){var xt=W;W=q,q=xt;var B=X;X=D,D=B}if(W>_&&q<w&&(q+=360),W<=180&&q>=180&&W<q){var j=(180-W)/(q-W),J=j*D+(1-j)*X;R.push([e[C-1][0]>_?180:-180,J]),R=[],R.push([e[C-1][0]>_?-180:180,J]),E.push(R)}else R=[],E.push(R);R.push([F,e[C][1]])}else R.push([e[C][0],e[C][1]])}}else{var Dt=[];E.push(Dt);for(var Q=0;Q<e.length;++Q)Dt.push([e[Q][0],e[Q][1]])}for(var At=new E_(this.properties),Mt=0;Mt<E.length;++Mt){var Lt=new bP;At.geometries.push(Lt);for(var pt=E[Mt],yt=0;yt<pt.length;++yt)Lt.move_to(pt[yt])}return At};var rY=Je(lg(),1);var nZ=Je(lg(),1);var rZ=Je(Z_(),1);var sZ=Je(Xd(),1);var ln=[],cn=[],fn=[],hn=[],pn=[],dn=[],gn=[],mn=[],yn=[],vn=[],_n=[],xn=[],En=[],wn=[],Sn=[],Mn=[],bn=[],An=[],Tn=[],Cn=[],Pn=[],In=[],Rn=[],Ln=[];gn[85]=vn[85]=-1;mn[85]=_n[85]=0;yn[85]=xn[85]=1;Tn[85]=In[85]=1;Cn[85]=Rn[85]=0;Pn[85]=Ln[85]=1;ln[85]=hn[85]=0;cn[85]=pn[85]=-1;fn[85]=Sn[85]=0;Mn[85]=En[85]=0;bn[85]=wn[85]=1;dn[85]=An[85]=1;In[1]=In[169]=0;Rn[1]=Rn[169]=-1;Ln[1]=Ln[169]=0;En[1]=En[169]=-1;wn[1]=wn[169]=0;Sn[1]=Sn[169]=0;vn[4]=vn[166]=0;_n[4]=_n[166]=-1;xn[4]=xn[166]=1;Mn[4]=Mn[166]=1;bn[4]=bn[166]=0;An[4]=An[166]=0;gn[16]=gn[154]=0;mn[16]=mn[154]=1;yn[16]=yn[154]=1;hn[16]=hn[154]=1;pn[16]=pn[154]=0;dn[16]=dn[154]=1;Tn[64]=Tn[106]=0;Cn[64]=Cn[106]=1;Pn[64]=Pn[106]=0;ln[64]=ln[106]=-1;cn[64]=cn[106]=0;fn[64]=fn[106]=1;Tn[2]=Tn[168]=0;Cn[2]=Cn[168]=-1;Pn[2]=Pn[168]=1;In[2]=In[168]=0;Rn[2]=Rn[168]=-1;Ln[2]=Ln[168]=0;En[2]=En[168]=-1;wn[2]=wn[168]=0;Sn[2]=Sn[168]=0;Mn[2]=Mn[168]=-1;bn[2]=bn[168]=0;An[2]=An[168]=1;gn[8]=gn[162]=0;mn[8]=mn[162]=-1;yn[8]=yn[162]=0;vn[8]=vn[162]=0;_n[8]=_n[162]=-1;xn[8]=xn[162]=1;En[8]=En[162]=1;wn[8]=wn[162]=0;Sn[8]=Sn[162]=1;Mn[8]=Mn[162]=1;bn[8]=bn[162]=0;An[8]=An[162]=0;gn[32]=gn[138]=0;mn[32]=mn[138]=1;yn[32]=yn[138]=1;vn[32]=vn[138]=0;_n[32]=_n[138]=1;xn[32]=xn[138]=0;ln[32]=ln[138]=1;cn[32]=cn[138]=0;fn[32]=fn[138]=0;hn[32]=hn[138]=1;pn[32]=pn[138]=0;dn[32]=dn[138]=1;In[128]=In[42]=0;Rn[128]=Rn[42]=1;Ln[128]=Ln[42]=1;Tn[128]=Tn[42]=0;Cn[128]=Cn[42]=1;Pn[128]=Pn[42]=0;ln[128]=ln[42]=-1;cn[128]=cn[42]=0;fn[128]=fn[42]=1;hn[128]=hn[42]=-1;pn[128]=pn[42]=0;dn[128]=dn[42]=0;vn[5]=vn[165]=-1;_n[5]=_n[165]=0;xn[5]=xn[165]=0;In[5]=In[165]=1;Rn[5]=Rn[165]=0;Ln[5]=Ln[165]=0;Mn[20]=Mn[150]=0;bn[20]=bn[150]=1;An[20]=An[150]=1;hn[20]=hn[150]=0;pn[20]=pn[150]=-1;dn[20]=dn[150]=1;gn[80]=gn[90]=-1;mn[80]=mn[90]=0;yn[80]=yn[90]=1;Tn[80]=Tn[90]=1;Cn[80]=Cn[90]=0;Pn[80]=Pn[90]=1;En[65]=En[105]=0;wn[65]=wn[105]=1;Sn[65]=Sn[105]=0;ln[65]=ln[105]=0;cn[65]=cn[105]=-1;fn[65]=fn[105]=0;gn[160]=gn[10]=-1;mn[160]=mn[10]=0;yn[160]=yn[10]=1;vn[160]=vn[10]=-1;_n[160]=_n[10]=0;xn[160]=xn[10]=0;In[160]=In[10]=1;Rn[160]=Rn[10]=0;Ln[160]=Ln[10]=0;Tn[160]=Tn[10]=1;Cn[160]=Cn[10]=0;Pn[160]=Pn[10]=1;Mn[130]=Mn[40]=0;bn[130]=bn[40]=1;An[130]=An[40]=1;En[130]=En[40]=0;wn[130]=wn[40]=1;Sn[130]=Sn[40]=0;ln[130]=ln[40]=0;cn[130]=cn[40]=-1;fn[130]=fn[40]=0;hn[130]=hn[40]=0;pn[130]=pn[40]=-1;dn[130]=dn[40]=1;vn[37]=vn[133]=0;_n[37]=_n[133]=1;xn[37]=xn[133]=1;In[37]=In[133]=0;Rn[37]=Rn[133]=1;Ln[37]=Ln[133]=0;ln[37]=ln[133]=-1;cn[37]=cn[133]=0;fn[37]=fn[133]=0;hn[37]=hn[133]=1;pn[37]=pn[133]=0;dn[37]=dn[133]=0;Mn[148]=Mn[22]=-1;bn[148]=bn[22]=0;An[148]=An[22]=0;In[148]=In[22]=0;Rn[148]=Rn[22]=-1;Ln[148]=Ln[22]=1;Tn[148]=Tn[22]=0;Cn[148]=Cn[22]=1;Pn[148]=Pn[22]=1;hn[148]=hn[22]=-1;pn[148]=pn[22]=0;dn[148]=dn[22]=1;gn[82]=gn[88]=0;mn[82]=mn[88]=-1;yn[82]=yn[88]=1;Mn[82]=Mn[88]=1;bn[82]=bn[88]=0;An[82]=An[88]=1;En[82]=En[88]=-1;wn[82]=wn[88]=0;Sn[82]=Sn[88]=1;Tn[82]=Tn[88]=0;Cn[82]=Cn[88]=-1;Pn[82]=Pn[88]=0;gn[73]=gn[97]=0;mn[73]=mn[97]=1;yn[73]=yn[97]=0;vn[73]=vn[97]=0;_n[73]=_n[97]=-1;xn[73]=xn[97]=0;En[73]=En[97]=1;wn[73]=wn[97]=0;Sn[73]=Sn[97]=0;ln[73]=ln[97]=1;cn[73]=cn[97]=0;fn[73]=fn[97]=1;gn[145]=gn[25]=0;mn[145]=mn[25]=-1;yn[145]=yn[25]=0;En[145]=En[25]=1;wn[145]=wn[25]=0;Sn[145]=Sn[25]=1;In[145]=In[25]=0;Rn[145]=Rn[25]=1;Ln[145]=Ln[25]=1;hn[145]=hn[25]=-1;pn[145]=pn[25]=0;dn[145]=dn[25]=0;vn[70]=vn[100]=0;_n[70]=_n[100]=1;xn[70]=xn[100]=0;Mn[70]=Mn[100]=-1;bn[70]=bn[100]=0;An[70]=An[100]=1;Tn[70]=Tn[100]=0;Cn[70]=Cn[100]=-1;Pn[70]=Pn[100]=1;ln[70]=ln[100]=1;cn[70]=cn[100]=0;fn[70]=fn[100]=0;vn[101]=vn[69]=0;_n[101]=_n[69]=1;xn[101]=xn[69]=0;ln[101]=ln[69]=1;cn[101]=cn[69]=0;fn[101]=fn[69]=0;In[149]=In[21]=0;Rn[149]=Rn[21]=1;Ln[149]=Ln[21]=1;hn[149]=hn[21]=-1;pn[149]=pn[21]=0;dn[149]=dn[21]=0;Mn[86]=Mn[84]=-1;bn[86]=bn[84]=0;An[86]=An[84]=1;Tn[86]=Tn[84]=0;Cn[86]=Cn[84]=-1;Pn[86]=Pn[84]=1;gn[89]=gn[81]=0;mn[89]=mn[81]=-1;yn[89]=yn[81]=0;En[89]=En[81]=1;wn[89]=wn[81]=0;Sn[89]=Sn[81]=1;gn[96]=gn[74]=0;mn[96]=mn[74]=1;yn[96]=yn[74]=0;vn[96]=vn[74]=-1;_n[96]=_n[74]=0;xn[96]=xn[74]=1;Tn[96]=Tn[74]=1;Cn[96]=Cn[74]=0;Pn[96]=Pn[74]=0;ln[96]=ln[74]=1;cn[96]=cn[74]=0;fn[96]=fn[74]=1;gn[24]=gn[146]=0;mn[24]=mn[146]=-1;yn[24]=yn[146]=1;Mn[24]=Mn[146]=1;bn[24]=bn[146]=0;An[24]=An[146]=1;En[24]=En[146]=0;wn[24]=wn[146]=1;Sn[24]=Sn[146]=1;hn[24]=hn[146]=0;pn[24]=pn[146]=-1;dn[24]=dn[146]=0;vn[6]=vn[164]=-1;_n[6]=_n[164]=0;xn[6]=xn[164]=1;Mn[6]=Mn[164]=-1;bn[6]=bn[164]=0;An[6]=An[164]=0;In[6]=In[164]=0;Rn[6]=Rn[164]=-1;Ln[6]=Ln[164]=1;Tn[6]=Tn[164]=1;Cn[6]=Cn[164]=0;Pn[6]=Pn[164]=0;En[129]=En[41]=0;wn[129]=wn[41]=1;Sn[129]=Sn[41]=1;In[129]=In[41]=0;Rn[129]=Rn[41]=1;Ln[129]=Ln[41]=0;ln[129]=ln[41]=-1;cn[129]=cn[41]=0;fn[129]=fn[41]=0;hn[129]=hn[41]=0;pn[129]=pn[41]=-1;dn[129]=dn[41]=0;Mn[66]=Mn[104]=0;bn[66]=bn[104]=1;An[66]=An[104]=0;En[66]=En[104]=-1;wn[66]=wn[104]=0;Sn[66]=Sn[104]=1;Tn[66]=Tn[104]=0;Cn[66]=Cn[104]=-1;Pn[66]=Pn[104]=0;ln[66]=ln[104]=0;cn[66]=cn[104]=-1;fn[66]=fn[104]=1;gn[144]=gn[26]=-1;mn[144]=mn[26]=0;yn[144]=yn[26]=0;In[144]=In[26]=1;Rn[144]=Rn[26]=0;Ln[144]=Ln[26]=1;Tn[144]=Tn[26]=0;Cn[144]=Cn[26]=1;Pn[144]=Pn[26]=1;hn[144]=hn[26]=-1;pn[144]=pn[26]=0;dn[144]=dn[26]=1;vn[36]=vn[134]=0;_n[36]=_n[134]=1;xn[36]=xn[134]=1;Mn[36]=Mn[134]=0;bn[36]=bn[134]=1;An[36]=An[134]=0;ln[36]=ln[134]=0;cn[36]=cn[134]=-1;fn[36]=fn[134]=1;hn[36]=hn[134]=1;pn[36]=pn[134]=0;dn[36]=dn[134]=0;gn[9]=gn[161]=-1;mn[9]=mn[161]=0;yn[9]=yn[161]=0;vn[9]=vn[161]=0;_n[9]=_n[161]=-1;xn[9]=xn[161]=0;En[9]=En[161]=1;wn[9]=wn[161]=0;Sn[9]=Sn[161]=0;In[9]=In[161]=1;Rn[9]=Rn[161]=0;Ln[9]=Ln[161]=1;gn[136]=0;mn[136]=1;yn[136]=1;vn[136]=0;_n[136]=1;xn[136]=0;Mn[136]=-1;bn[136]=0;An[136]=1;En[136]=-1;wn[136]=0;Sn[136]=0;In[136]=0;Rn[136]=-1;Ln[136]=0;Tn[136]=0;Cn[136]=-1;Pn[136]=1;ln[136]=1;cn[136]=0;fn[136]=0;hn[136]=1;pn[136]=0;dn[136]=1;gn[34]=0;mn[34]=-1;yn[34]=0;vn[34]=0;_n[34]=-1;xn[34]=1;Mn[34]=1;bn[34]=0;An[34]=0;En[34]=1;wn[34]=0;Sn[34]=1;In[34]=0;Rn[34]=1;Ln[34]=1;Tn[34]=0;Cn[34]=1;Pn[34]=0;ln[34]=-1;cn[34]=0;fn[34]=1;hn[34]=-1;pn[34]=0;dn[34]=0;gn[35]=0;mn[35]=1;yn[35]=1;vn[35]=0;_n[35]=-1;xn[35]=1;Mn[35]=1;bn[35]=0;An[35]=0;En[35]=-1;wn[35]=0;Sn[35]=0;In[35]=0;Rn[35]=-1;Ln[35]=0;Tn[35]=0;Cn[35]=1;Pn[35]=0;ln[35]=-1;cn[35]=0;fn[35]=1;hn[35]=1;pn[35]=0;dn[35]=1;gn[153]=0;mn[153]=1;yn[153]=1;En[153]=-1;wn[153]=0;Sn[153]=0;In[153]=0;Rn[153]=-1;Ln[153]=0;hn[153]=1;pn[153]=0;dn[153]=1;vn[102]=0;_n[102]=-1;xn[102]=1;Mn[102]=1;bn[102]=0;An[102]=0;Tn[102]=0;Cn[102]=1;Pn[102]=0;ln[102]=-1;cn[102]=0;fn[102]=1;gn[155]=0;mn[155]=-1;yn[155]=0;En[155]=1;wn[155]=0;Sn[155]=1;In[155]=0;Rn[155]=1;Ln[155]=1;hn[155]=-1;pn[155]=0;dn[155]=0;vn[103]=0;_n[103]=1;xn[103]=0;Mn[103]=-1;bn[103]=0;An[103]=1;Tn[103]=0;Cn[103]=-1;Pn[103]=1;ln[103]=1;cn[103]=0;fn[103]=0;gn[152]=0;mn[152]=1;yn[152]=1;Mn[152]=-1;bn[152]=0;An[152]=1;En[152]=-1;wn[152]=0;Sn[152]=0;In[152]=0;Rn[152]=-1;Ln[152]=0;Tn[152]=0;Cn[152]=-1;Pn[152]=1;hn[152]=1;pn[152]=0;dn[152]=1;gn[156]=0;mn[156]=-1;yn[156]=1;Mn[156]=1;bn[156]=0;An[156]=1;En[156]=-1;wn[156]=0;Sn[156]=0;In[156]=0;Rn[156]=-1;Ln[156]=0;Tn[156]=0;Cn[156]=1;Pn[156]=1;hn[156]=-1;pn[156]=0;dn[156]=1;gn[137]=0;mn[137]=1;yn[137]=1;vn[137]=0;_n[137]=1;xn[137]=0;En[137]=-1;wn[137]=0;Sn[137]=0;In[137]=0;Rn[137]=-1;Ln[137]=0;ln[137]=1;cn[137]=0;fn[137]=0;hn[137]=1;pn[137]=0;dn[137]=1;gn[139]=0;mn[139]=1;yn[139]=1;vn[139]=0;_n[139]=-1;xn[139]=0;En[139]=1;wn[139]=0;Sn[139]=0;In[139]=0;Rn[139]=1;Ln[139]=0;ln[139]=-1;cn[139]=0;fn[139]=0;hn[139]=1;pn[139]=0;dn[139]=1;gn[98]=0;mn[98]=-1;yn[98]=0;vn[98]=0;_n[98]=-1;xn[98]=1;Mn[98]=1;bn[98]=0;An[98]=0;En[98]=1;wn[98]=0;Sn[98]=1;Tn[98]=0;Cn[98]=1;Pn[98]=0;ln[98]=-1;cn[98]=0;fn[98]=1;gn[99]=0;mn[99]=1;yn[99]=0;vn[99]=0;_n[99]=-1;xn[99]=1;Mn[99]=1;bn[99]=0;An[99]=0;En[99]=-1;wn[99]=0;Sn[99]=1;Tn[99]=0;Cn[99]=-1;Pn[99]=0;ln[99]=1;cn[99]=0;fn[99]=1;vn[38]=0;_n[38]=-1;xn[38]=1;Mn[38]=1;bn[38]=0;An[38]=0;In[38]=0;Rn[38]=1;Ln[38]=1;Tn[38]=0;Cn[38]=1;Pn[38]=0;ln[38]=-1;cn[38]=0;fn[38]=1;hn[38]=-1;pn[38]=0;dn[38]=0;vn[39]=0;_n[39]=1;xn[39]=1;Mn[39]=-1;bn[39]=0;An[39]=0;In[39]=0;Rn[39]=-1;Ln[39]=1;Tn[39]=0;Cn[39]=1;Pn[39]=0;ln[39]=-1;cn[39]=0;fn[39]=1;hn[39]=1;pn[39]=0;dn[39]=0;var J_=function(n){return[[n.bottomleft,0],[0,0],[0,n.leftbottom]]},K_=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0]]},j_=function(n){return[[n.topright,1],[1,1],[1,n.righttop]]},Q_=function(n){return[[0,n.lefttop],[0,1],[n.topleft,1]]},t1=function(n){return[[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop]]},e1=function(n){return[[n.bottomright,0],[n.bottomleft,0],[1,n.righttop],[1,n.rightbottom]]},n1=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.topleft,1],[n.topright,1]]},r1=function(n){return[[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},aZ=function(n){return[[0,0],[0,n.leftbottom],[1,n.rightbottom],[1,0]]},uZ=function(n){return[[1,0],[n.bottomright,0],[n.topright,1],[1,1]]},lZ=function(n){return[[1,1],[1,n.righttop],[0,n.lefttop],[0,1]]},cZ=function(n){return[[n.bottomleft,0],[0,0],[0,1],[n.topleft,1]]},fZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[0,n.leftbottom],[0,n.lefttop]]},hZ=function(n){return[[n.topleft,1],[n.topright,1],[n.bottomright,0],[n.bottomleft,0]]},pZ=function(){return[[0,0],[0,1],[1,1],[1,0]]},dZ=function(n){return[[1,n.rightbottom],[1,0],[0,0],[0,1],[n.topleft,1]]},gZ=function(n){return[[n.topright,1],[1,1],[1,0],[0,0],[0,n.leftbottom]]},mZ=function(n){return[[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[1,1]]},yZ=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,1]]},vZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[0,n.lefttop],[0,1],[n.topleft,1]]},_Z=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[n.topright,1]]},xZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop]]},EZ=function(n){return[[n.topright,1],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topleft,1]]},wZ=function(n){return[[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1],[n.topleft,1]]},SZ=function(n){return[[1,1],[1,n.righttop],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},MZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[n.topleft,1],[n.topright,1]]},bZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,n.leftbottom]]},AZ=function(n){return[[1,n.rightbottom],[1,0],[0,0],[0,n.leftbottom],[n.topleft,1],[n.topright,1]]},TZ=function(n){return[[1,1],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},CZ=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1]]},PZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,1],[n.topleft,1]]},IZ=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topright,1]]},RZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[n.topleft,1]]},LZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},NZ=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topright,1]]},OZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[n.topleft,1]]},DZ=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},FZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topleft,1],[n.topright,1]]},UZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1],[n.topleft,1]]},BZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},Un=[],Bn=[],zn=[],Gn=[],kn=[],qn=[],Hn=[],Vn=[];Gn[1]=kn[1]=18;Gn[169]=kn[169]=18;zn[4]=Bn[4]=12;zn[166]=Bn[166]=12;Un[16]=Vn[16]=4;Un[154]=Vn[154]=4;qn[64]=Hn[64]=22;qn[106]=Hn[106]=22;zn[2]=qn[2]=17;Gn[2]=kn[2]=18;zn[168]=qn[168]=17;Gn[168]=kn[168]=18;Un[8]=Gn[8]=9;Bn[8]=zn[8]=12;Un[162]=Gn[162]=9;Bn[162]=zn[162]=12;Un[32]=Vn[32]=4;Bn[32]=Hn[32]=1;Un[138]=Vn[138]=4;Bn[138]=Hn[138]=1;kn[128]=Vn[128]=21;qn[128]=Hn[128]=22;kn[42]=Vn[42]=21;qn[42]=Hn[42]=22;Bn[5]=kn[5]=14;Bn[165]=kn[165]=14;zn[20]=Vn[20]=6;zn[150]=Vn[150]=6;Un[80]=qn[80]=11;Un[90]=qn[90]=11;Gn[65]=Hn[65]=3;Gn[105]=Hn[105]=3;Un[160]=qn[160]=11;Bn[160]=kn[160]=14;Un[10]=qn[10]=11;Bn[10]=kn[10]=14;zn[130]=Vn[130]=6;Gn[130]=Hn[130]=3;zn[40]=Vn[40]=6;Gn[40]=Hn[40]=3;Bn[101]=Hn[101]=1;Bn[69]=Hn[69]=1;kn[149]=Vn[149]=21;kn[21]=Vn[21]=21;zn[86]=qn[86]=17;zn[84]=qn[84]=17;Un[89]=Gn[89]=9;Un[81]=Gn[81]=9;Un[96]=Hn[96]=0;Bn[96]=qn[96]=15;Un[74]=Hn[74]=0;Bn[74]=qn[74]=15;Un[24]=zn[24]=8;Gn[24]=Vn[24]=7;Un[146]=zn[146]=8;Gn[146]=Vn[146]=7;Bn[6]=qn[6]=15;zn[6]=kn[6]=16;Bn[164]=qn[164]=15;zn[164]=kn[164]=16;Gn[129]=Vn[129]=7;kn[129]=Hn[129]=20;Gn[41]=Vn[41]=7;kn[41]=Hn[41]=20;zn[66]=Hn[66]=2;Gn[66]=qn[66]=19;zn[104]=Hn[104]=2;Gn[104]=qn[104]=19;Un[144]=kn[144]=10;qn[144]=Vn[144]=23;Un[26]=kn[26]=10;qn[26]=Vn[26]=23;Bn[36]=Vn[36]=5;zn[36]=Hn[36]=2;Bn[134]=Vn[134]=5;zn[134]=Hn[134]=2;Un[9]=kn[9]=10;Bn[9]=Gn[9]=13;Un[161]=kn[161]=10;Bn[161]=Gn[161]=13;Bn[37]=Vn[37]=5;kn[37]=Hn[37]=20;Bn[133]=Vn[133]=5;kn[133]=Hn[133]=20;zn[148]=kn[148]=16;qn[148]=Vn[148]=23;zn[22]=kn[22]=16;qn[22]=Vn[22]=23;Un[82]=zn[82]=8;Gn[82]=qn[82]=19;Un[88]=zn[88]=8;Gn[88]=qn[88]=19;Un[73]=Hn[73]=0;Bn[73]=Gn[73]=13;Un[97]=Hn[97]=0;Bn[97]=Gn[97]=13;Un[145]=Gn[145]=9;kn[145]=Vn[145]=21;Un[25]=Gn[25]=9;kn[25]=Vn[25]=21;Bn[70]=Hn[70]=1;zn[70]=qn[70]=17;Bn[100]=Hn[100]=1;zn[100]=qn[100]=17;Un[34]=Gn[34]=9;Bn[34]=zn[34]=12;kn[34]=Vn[34]=21;qn[34]=Hn[34]=22;Un[136]=Vn[136]=4;Bn[136]=Hn[136]=1;zn[136]=qn[136]=17;Gn[136]=kn[136]=18;Un[35]=Vn[35]=4;Bn[35]=zn[35]=12;Gn[35]=kn[35]=18;qn[35]=Hn[35]=22;Un[153]=Vn[153]=4;Gn[153]=kn[153]=18;Bn[102]=zn[102]=12;qn[102]=Hn[102]=22;Un[155]=Gn[155]=9;kn[155]=Vn[155]=23;Bn[103]=Hn[103]=1;zn[103]=qn[103]=17;Un[152]=Vn[152]=4;zn[152]=qn[152]=17;Gn[152]=kn[152]=18;Un[156]=zn[156]=8;Gn[156]=kn[156]=18;qn[156]=Vn[156]=23;Un[137]=Vn[137]=4;Bn[137]=Hn[137]=1;Gn[137]=kn[137]=18;Un[139]=Vn[139]=4;Bn[139]=Gn[139]=13;kn[139]=Hn[139]=20;Un[98]=Gn[98]=9;Bn[98]=zn[98]=12;qn[98]=Hn[98]=22;Un[99]=Hn[99]=0;Bn[99]=zn[99]=12;Gn[99]=qn[99]=19;Bn[38]=zn[38]=12;kn[38]=Vn[38]=21;qn[38]=Hn[38]=22;Bn[39]=Vn[39]=5;zn[39]=kn[39]=16;qn[39]=Hn[39]=22;var re=[];re[1]=re[169]=J_;re[4]=re[166]=K_;re[16]=re[154]=j_;re[64]=re[106]=Q_;re[168]=re[2]=t1;re[162]=re[8]=e1;re[138]=re[32]=n1;re[42]=re[128]=r1;re[5]=re[165]=aZ;re[20]=re[150]=uZ;re[80]=re[90]=lZ;re[65]=re[105]=cZ;re[160]=re[10]=fZ;re[130]=re[40]=hZ;re[85]=pZ;re[101]=re[69]=dZ;re[149]=re[21]=gZ;re[86]=re[84]=mZ;re[89]=re[81]=yZ;re[96]=re[74]=vZ;re[24]=re[146]=_Z;re[6]=re[164]=xZ;re[129]=re[41]=EZ;re[66]=re[104]=wZ;re[144]=re[26]=SZ;re[36]=re[134]=MZ;re[9]=re[161]=bZ;re[37]=re[133]=AZ;re[148]=re[22]=TZ;re[82]=re[88]=CZ;re[73]=re[97]=PZ;re[145]=re[25]=IZ;re[70]=re[100]=RZ;re[34]=function(n){return[r1(n),e1(n)]};re[35]=LZ;re[136]=function(n){return[n1(n),t1(n)]};re[153]=function(n){return[j_(n),J_(n)]};re[102]=function(n){return[K_(n),Q_(n)]};re[155]=NZ;re[103]=OZ;re[152]=function(n){return[j_(n),t1(n)]};re[156]=DZ;re[137]=function(n){return[n1(n),J_(n)]};re[139]=FZ;re[98]=function(n){return[e1(n),Q_(n)]};re[99]=UZ;re[38]=function(n){return[K_(n),r1(n)]};re[39]=BZ;function GZ(n){return(n>0)-(n<0)||+n}function cf(n,t,e){var o=t[0]-n[0],s=t[1]-n[1],c=e[0]-t[0],p=e[1]-t[1];return GZ(o*p-c*s)}function pL(n,t){var e=n.geometry.coordinates[0].map(function(p){return p[0]}),o=n.geometry.coordinates[0].map(function(p){return p[1]}),s=t.geometry.coordinates[0].map(function(p){return p[0]}),c=t.geometry.coordinates[0].map(function(p){return p[1]});return Math.max.apply(null,e)===Math.max.apply(null,s)&&Math.max.apply(null,o)===Math.max.apply(null,c)&&Math.min.apply(null,e)===Math.min.apply(null,s)&&Math.min.apply(null,o)===Math.min.apply(null,c)}function i1(n,t){return t.geometry.coordinates[0].every(function(e){return ki(Pr(e),n)})}function dL(n,t){return n[0]===t[0]&&n[1]===t[1]}var kZ=function(){function n(t){this.id=n.buildId(t),this.coordinates=t,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return n.buildId=function(t){return t.join(",")},n.prototype.removeInnerEdge=function(t){this.innerEdges=this.innerEdges.filter(function(e){return e.from.id!==t.from.id})},n.prototype.removeOuterEdge=function(t){this.outerEdges=this.outerEdges.filter(function(e){return e.to.id!==t.to.id})},n.prototype.addOuterEdge=function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1},n.prototype.sortOuterEdges=function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort(function(e,o){var s=e.to,c=o.to;if(s.coordinates[0]-t.coordinates[0]>=0&&c.coordinates[0]-t.coordinates[0]<0)return 1;if(s.coordinates[0]-t.coordinates[0]<0&&c.coordinates[0]-t.coordinates[0]>=0)return-1;if(s.coordinates[0]-t.coordinates[0]===0&&c.coordinates[0]-t.coordinates[0]===0)return s.coordinates[1]-t.coordinates[1]>=0||c.coordinates[1]-t.coordinates[1]>=0?s.coordinates[1]-c.coordinates[1]:c.coordinates[1]-s.coordinates[1];var p=cf(t.coordinates,s.coordinates,c.coordinates);if(p<0)return 1;if(p>0)return-1;var h=Math.pow(s.coordinates[0]-t.coordinates[0],2)+Math.pow(s.coordinates[1]-t.coordinates[1],2),g=Math.pow(c.coordinates[0]-t.coordinates[0],2)+Math.pow(c.coordinates[1]-t.coordinates[1],2);return h-g}),this.outerEdgesSorted=!0)},n.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},n.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},n.prototype.addInnerEdge=function(t){this.innerEdges.push(t)},n}(),o1=kZ;var qZ=function(){function n(t,e){this.from=t,this.to=e,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 n.prototype.getSymetric=function(){return this.symetric||(this.symetric=new n(this.to,this.from),this.symetric.symetric=this),this.symetric},n.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},n.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},n.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},n.prototype.toLineString=function(){return Gi([this.from.coordinates,this.to.coordinates])},n.prototype.compareTo=function(t){return cf(t.from.coordinates,t.to.coordinates,this.to.coordinates)},n}(),gL=qZ;var HZ=function(){function n(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return n.prototype.push=function(t){this.edges.push(t),this.polygon=this.envelope=void 0},n.prototype.get=function(t){return this.edges[t]},Object.defineProperty(n.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),n.prototype.forEach=function(t){this.edges.forEach(t)},n.prototype.map=function(t){return this.edges.map(t)},n.prototype.some=function(t){return this.edges.some(t)},n.prototype.isValid=function(){return!0},n.prototype.isHole=function(){var t=this,e=this.edges.reduce(function(p,h,g){return h.from.coordinates[1]>t.edges[p].from.coordinates[1]&&(p=g),p},0),o=(e===0?this.length:e)-1,s=(e+1)%this.length,c=cf(this.edges[o].from.coordinates,this.edges[e].from.coordinates,this.edges[s].from.coordinates);return c===0?this.edges[o].from.coordinates[0]>this.edges[s].from.coordinates[0]:c>0},n.prototype.toMultiPoint=function(){return Fv(this.edges.map(function(t){return t.from.coordinates}))},n.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map(function(e){return e.from.coordinates});return t.push(this.edges[0].from.coordinates),this.polygon=Dr([t])},n.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=e_(this.toPolygon())},n.findEdgeRingContaining=function(t,e){var o=t.getEnvelope(),s,c;return e.forEach(function(p){var h=p.getEnvelope();if(c&&(s=c.getEnvelope()),!pL(h,o)&&i1(h,o)){for(var g=t.map(function(T){return T.from.coordinates}),m=void 0,_=function(T){p.some(function(I){return dL(T,I.from.coordinates)})||(m=T)},w=0,x=g;w<x.length;w++){var b=x[w];_(b)}m&&p.inside(Pr(m))&&(!c||i1(s,h))&&(c=p)}}),c},n.prototype.inside=function(t){return ki(t,this.toPolygon())},n}(),s1=HZ;function VZ(n){if(!n)throw new Error("No geojson passed");if(n.type!=="FeatureCollection"&&n.type!=="GeometryCollection"&&n.type!=="MultiLineString"&&n.type!=="LineString"&&n.type!=="Feature")throw new Error("Invalid input type '"+n.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}var lct=function(){function n(){this.edges=[],this.nodes={}}return n.fromGeoJson=function(t){VZ(t);var e=new n;return ys(t,function(o){Bv(o,"LineString","Graph::fromGeoJson"),AC(o,function(s,c){if(s){var p=e.getNode(s),h=e.getNode(c);e.addEdge(p,h)}return c})}),e},n.prototype.getNode=function(t){var e=o1.buildId(t),o=this.nodes[e];return o||(o=this.nodes[e]=new o1(t)),o},n.prototype.addEdge=function(t,e){var o=new gL(t,e),s=o.getSymetric();this.edges.push(o),this.edges.push(s)},n.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map(function(e){return t.nodes[e]}).forEach(function(e){return t._removeIfDangle(e)})},n.prototype._removeIfDangle=function(t){var e=this;if(t.innerEdges.length<=1){var o=t.getOuterEdges().map(function(s){return s.to});this.removeNode(t),o.forEach(function(s){return e._removeIfDangle(s)})}},n.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))})},n.prototype._computeNextCWEdges=function(t){var e=this;typeof t=="undefined"?Object.keys(this.nodes).forEach(function(o){return e._computeNextCWEdges(e.nodes[o])}):t.getOuterEdges().forEach(function(o,s){t.getOuterEdge((s===0?t.getOuterEdges().length:s)-1).symetric.next=o})},n.prototype._computeNextCCWEdges=function(t,e){for(var o=t.getOuterEdges(),s,c,p=o.length-1;p>=0;--p){var h=o[p],g=h.symetric,m=void 0,_=void 0;h.label===e&&(m=h),g.label===e&&(_=g),!(!m||!_)&&(_&&(c=_),m&&(c&&(c.next=m,c=void 0),s||(s=m)))}c&&(c.next=s)},n.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach(function(o){if(!(o.label>=0)){t.push(o);var s=o;do s.label=e,s=s.next;while(!o.isEqual(s));e++}}),t},n.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach(function(o){o.label=void 0}),this._findLabeledEdgeRings().forEach(function(o){t._findIntersectionNodes(o).forEach(function(s){t._computeNextCCWEdges(s,o.label)})});var e=[];return this.edges.forEach(function(o){o.ring||e.push(t._findEdgeRing(o))}),e},n.prototype._findIntersectionNodes=function(t){var e=[],o=t,s=function(){var c=0;o.from.getOuterEdges().forEach(function(p){p.label===t.label&&++c}),c>1&&e.push(o.from),o=o.next};do s();while(!t.isEqual(o));return e},n.prototype._findEdgeRing=function(t){var e=t,o=new s1;do o.push(e),e.ring=o,e=e.next;while(!t.isEqual(e));return o},n.prototype.removeNode=function(t){var e=this;t.getOuterEdges().forEach(function(o){return e.removeEdge(o)}),t.innerEdges.forEach(function(o){return e.removeEdge(o)}),delete this.nodes[t.id]},n.prototype.removeEdge=function(t){this.edges=this.edges.filter(function(e){return!e.isEqual(t)}),t.deleteEdge()},n}();var $Z=Je(a1(),1);var ZZ=Je(a1(),1);var KZ=Je(ML(),1);var iJ=Je(OL(),1);function FL(n){for(var t=n,e=[];t.parent;)e.unshift(t),t=t.parent;return e}function sJ(){return new UL(function(n){return n.f})}var f1={search:function(n,t,e,o){n.cleanDirty(),o=o||{};var s=o.heuristic||f1.heuristics.manhattan,c=o.closest||!1,p=sJ(),h=t;for(t.h=s(t,e),p.push(t);p.size()>0;){var g=p.pop();if(g===e)return FL(g);g.closed=!0;for(var m=n.neighbors(g),_=0,w=m.length;_<w;++_){var x=m[_];if(!(x.closed||x.isWall())){var b=g.g+x.getCost(g),T=x.visited;(!T||b<x.g)&&(x.visited=!0,x.parent=g,x.h=x.h||s(x,e),x.g=b,x.f=x.g+x.h,n.markDirty(x),c&&(x.h<h.h||x.h===h.h&&x.g<h.g)&&(h=x),T?p.rescoreElement(x):p.push(x))}}}return c?FL(h):[]},heuristics:{manhattan:function(n,t){var e=Math.abs(t.x-n.x),o=Math.abs(t.y-n.y);return e+o},diagonal:function(n,t){var e=1,o=Math.sqrt(2),s=Math.abs(t.x-n.x),c=Math.abs(t.y-n.y);return e*(s+c)+(o-2*e)*Math.min(s,c)}},cleanNode:function(n){n.f=0,n.g=0,n.h=0,n.visited=!1,n.closed=!1,n.parent=null}};function Ch(n,t){t=t||{},this.nodes=[],this.diagonal=!!t.diagonal,this.grid=[];for(var e=0;e<n.length;e++){this.grid[e]=[];for(var o=0,s=n[e];o<s.length;o++){var c=new Fg(e,o,s[o]);this.grid[e][o]=c,this.nodes.push(c)}}this.init()}Ch.prototype.init=function(){this.dirtyNodes=[];for(var n=0;n<this.nodes.length;n++)f1.cleanNode(this.nodes[n])};Ch.prototype.cleanDirty=function(){for(var n=0;n<this.dirtyNodes.length;n++)f1.cleanNode(this.dirtyNodes[n]);this.dirtyNodes=[]};Ch.prototype.markDirty=function(n){this.dirtyNodes.push(n)};Ch.prototype.neighbors=function(n){var t=[],e=n.x,o=n.y,s=this.grid;return s[e-1]&&s[e-1][o]&&t.push(s[e-1][o]),s[e+1]&&s[e+1][o]&&t.push(s[e+1][o]),s[e]&&s[e][o-1]&&t.push(s[e][o-1]),s[e]&&s[e][o+1]&&t.push(s[e][o+1]),this.diagonal&&(s[e-1]&&s[e-1][o-1]&&t.push(s[e-1][o-1]),s[e+1]&&s[e+1][o-1]&&t.push(s[e+1][o-1]),s[e-1]&&s[e-1][o+1]&&t.push(s[e-1][o+1]),s[e+1]&&s[e+1][o+1]&&t.push(s[e+1][o+1])),t};Ch.prototype.toString=function(){for(var n=[],t=this.grid,e,o,s,c,p=0,h=t.length;p<h;p++){for(e=[],o=t[p],s=0,c=o.length;s<c;s++)e.push(o[s].weight);n.push(e.join(" "))}return n.join(\`
15645
- \`)};function Fg(n,t,e){this.x=n,this.y=t,this.weight=e}Fg.prototype.toString=function(){return"["+this.x+" "+this.y+"]"};Fg.prototype.getCost=function(n){return n&&n.x!==this.x&&n.y!==this.y?this.weight*1.41421:this.weight};Fg.prototype.isWall=function(){return this.weight===0};function UL(n){this.content=[],this.scoreFunction=n}UL.prototype={push:function(n){this.content.push(n),this.sinkDown(this.content.length-1)},pop:function(){var n=this.content[0],t=this.content.pop();return this.content.length>0&&(this.content[0]=t,this.bubbleUp(0)),n},remove:function(n){var t=this.content.indexOf(n),e=this.content.pop();t!==this.content.length-1&&(this.content[t]=e,this.scoreFunction(e)<this.scoreFunction(n)?this.sinkDown(t):this.bubbleUp(t))},size:function(){return this.content.length},rescoreElement:function(n){this.sinkDown(this.content.indexOf(n))},sinkDown:function(n){for(var t=this.content[n];n>0;){var e=(n+1>>1)-1,o=this.content[e];if(this.scoreFunction(t)<this.scoreFunction(o))this.content[e]=t,this.content[n]=o,n=e;else break}},bubbleUp:function(n){for(var t=this.content.length,e=this.content[n],o=this.scoreFunction(e);;){var s=n+1<<1,c=s-1,p=null,h;if(c<t){var g=this.content[c];h=this.scoreFunction(g),h<o&&(p=c)}if(s<t){var m=this.content[s],_=this.scoreFunction(m);_<(p===null?o:h)&&(p=s)}if(p!==null)this.content[n]=this.content[p],this.content[p]=e,n=p;else break}}};function h1(){this._=null}function hf(n){n.U=n.C=n.L=n.R=n.P=n.N=null}h1.prototype={constructor:h1,insert:function(n,t){var e,o,s;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=BL(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)o=e.U,e===o.L?(s=o.R,s&&s.C?(e.C=s.C=!1,o.C=!0,n=o):(n===e.R&&(Ph(this,e),n=e,e=n.U),e.C=!1,o.C=!0,Ih(this,o))):(s=o.L,s&&s.C?(e.C=s.C=!1,o.C=!0,n=o):(n===e.L&&(Ih(this,e),n=e,e=n.U),e.C=!1,o.C=!0,Ph(this,o))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t=n.U,e,o=n.L,s=n.R,c,p;if(o?s?c=BL(s):c=o:c=s,t?t.L===n?t.L=c:t.R=c:this._=c,o&&s?(p=c.C,c.C=n.C,c.L=o,o.U=c,c!==s?(t=c.U,c.U=n.U,n=c.R,t.L=n,c.R=s,s.U=c):(c.U=t,t=c,n=c.R)):(p=n.C,n=c),n&&(n.U=t),!p){if(n&&n.C){n.C=!1;return}do{if(n===this._)break;if(n===t.L){if(e=t.R,e.C&&(e.C=!1,t.C=!0,Ph(this,t),e=t.R),e.L&&e.L.C||e.R&&e.R.C){(!e.R||!e.R.C)&&(e.L.C=!1,e.C=!0,Ih(this,e),e=t.R),e.C=t.C,t.C=e.R.C=!1,Ph(this,t),n=this._;break}}else if(e=t.L,e.C&&(e.C=!1,t.C=!0,Ih(this,t),e=t.L),e.L&&e.L.C||e.R&&e.R.C){(!e.L||!e.L.C)&&(e.R.C=!1,e.C=!0,Ph(this,e),e=t.L),e.C=t.C,t.C=e.L.C=!1,Ih(this,t),n=this._;break}e.C=!0,n=t,t=t.U}while(!n.C);n&&(n.C=!1)}}};function Ph(n,t){var e=t,o=t.R,s=e.U;s?s.L===e?s.L=o:s.R=o:n._=o,o.U=s,e.U=o,e.R=o.L,e.R&&(e.R.U=e),o.L=e}function Ih(n,t){var e=t,o=t.L,s=e.U;s?s.L===e?s.L=o:s.R=o:n._=o,o.U=s,e.U=o,e.L=o.R,e.L&&(e.L.U=e),o.R=e}function BL(n){for(;n.L;)n=n.L;return n}var p1=h1;function pf(n,t,e,o){var s=[null,null],c=Hi.push(s)-1;return s.left=n,s.right=t,e&&Rh(s,n,t,e),o&&Rh(s,t,n,o),To[n.index].halfedges.push(c),To[t.index].halfedges.push(c),s}function df(n,t,e){var o=[t,e];return o.left=n,o}function Rh(n,t,e,o){!n[0]&&!n[1]?(n[0]=o,n.left=t,n.right=e):n.left===e?n[1]=o:n[0]=o}function aJ(n,t,e,o,s){var c=n[0],p=n[1],h=c[0],g=c[1],m=p[0],_=p[1],w=0,x=1,b=m-h,T=_-g,I;if(I=t-h,!(!b&&I>0)){if(I/=b,b<0){if(I<w)return;I<x&&(x=I)}else if(b>0){if(I>x)return;I>w&&(w=I)}if(I=o-h,!(!b&&I<0)){if(I/=b,b<0){if(I>x)return;I>w&&(w=I)}else if(b>0){if(I<w)return;I<x&&(x=I)}if(I=e-g,!(!T&&I>0)){if(I/=T,T<0){if(I<w)return;I<x&&(x=I)}else if(T>0){if(I>x)return;I>w&&(w=I)}if(I=s-g,!(!T&&I<0)){if(I/=T,T<0){if(I>x)return;I>w&&(w=I)}else if(T>0){if(I<w)return;I<x&&(x=I)}return!(w>0)&&!(x<1)||(w>0&&(n[0]=[h+w*b,g+w*T]),x<1&&(n[1]=[h+x*b,g+x*T])),!0}}}}}function uJ(n,t,e,o,s){var c=n[1];if(c)return!0;var p=n[0],h=n.left,g=n.right,m=h[0],_=h[1],w=g[0],x=g[1],b=(m+w)/2,T=(_+x)/2,I,S;if(x===_){if(b<t||b>=o)return;if(m>w){if(!p)p=[b,e];else if(p[1]>=s)return;c=[b,s]}else{if(!p)p=[b,s];else if(p[1]<e)return;c=[b,e]}}else if(I=(m-w)/(x-_),S=T-I*b,I<-1||I>1)if(m>w){if(!p)p=[(e-S)/I,e];else if(p[1]>=s)return;c=[(s-S)/I,s]}else{if(!p)p=[(s-S)/I,s];else if(p[1]<e)return;c=[(e-S)/I,e]}else if(_<x){if(!p)p=[t,I*t+S];else if(p[0]>=o)return;c=[o,I*o+S]}else{if(!p)p=[o,I*o+S];else if(p[0]<t)return;c=[t,I*t+S]}return n[0]=p,n[1]=c,!0}function zL(n,t,e,o){for(var s=Hi.length,c;s--;)(!uJ(c=Hi[s],n,t,e,o)||!aJ(c,n,t,e,o)||!(Math.abs(c[0][0]-c[1][0])>Er||Math.abs(c[0][1]-c[1][1])>Er))&&delete Hi[s]}function GL(n){return To[n.index]={site:n,halfedges:[]}}function lJ(n,t){var e=n.site,o=t.left,s=t.right;return e===s&&(s=o,o=e),s?Math.atan2(s[1]-o[1],s[0]-o[0]):(e===o?(o=t[1],s=t[0]):(o=t[0],s=t[1]),Math.atan2(o[0]-s[0],s[1]-o[1]))}function d1(n,t){return t[+(t.left!==n.site)]}function cJ(n,t){return t[+(t.left===n.site)]}function kL(){for(var n=0,t=To.length,e,o,s,c;n<t;++n)if((e=To[n])&&(c=(o=e.halfedges).length)){var p=new Array(c),h=new Array(c);for(s=0;s<c;++s)p[s]=s,h[s]=lJ(e,Hi[o[s]]);for(p.sort(function(g,m){return h[m]-h[g]}),s=0;s<c;++s)h[s]=o[p[s]];for(s=0;s<c;++s)o[s]=h[s]}}function qL(n,t,e,o){var s=To.length,c,p,h,g,m,_,w,x,b,T,I,S,E=!0;for(c=0;c<s;++c)if(p=To[c]){for(h=p.site,m=p.halfedges,g=m.length;g--;)Hi[m[g]]||m.splice(g,1);for(g=0,_=m.length;g<_;)T=cJ(p,Hi[m[g]]),I=T[0],S=T[1],w=d1(p,Hi[m[++g%_]]),x=w[0],b=w[1],(Math.abs(I-x)>Er||Math.abs(S-b)>Er)&&(m.splice(g,0,Hi.push(df(h,T,Math.abs(I-n)<Er&&o-S>Er?[n,Math.abs(x-n)<Er?b:o]:Math.abs(S-o)<Er&&e-I>Er?[Math.abs(b-o)<Er?x:e,o]:Math.abs(I-e)<Er&&S-t>Er?[e,Math.abs(x-e)<Er?b:t]:Math.abs(S-t)<Er&&I-n>Er?[Math.abs(b-t)<Er?x:n,t]:null))-1),++_);_&&(E=!1)}if(E){var R,C,F,W=1/0;for(c=0,E=null;c<s;++c)(p=To[c])&&(h=p.site,R=h[0]-n,C=h[1]-t,F=R*R+C*C,F<W&&(W=F,E=p));if(E){var X=[n,t],q=[n,o],D=[e,o],xt=[e,t];E.halfedges.push(Hi.push(df(h=E.site,X,q))-1,Hi.push(df(h,q,D))-1,Hi.push(df(h,D,xt))-1,Hi.push(df(h,xt,X))-1)}}for(c=0;c<s;++c)(p=To[c])&&(p.halfedges.length||delete To[c])}var HL=[],Ug;function fJ(){hf(this),this.x=this.y=this.arc=this.site=this.cy=null}function Wl(n){var t=n.P,e=n.N;if(!(!t||!e)){var o=t.site,s=n.site,c=e.site;if(o!==c){var p=s[0],h=s[1],g=o[0]-p,m=o[1]-h,_=c[0]-p,w=c[1]-h,x=2*(g*w-m*_);if(!(x>=-VL)){var b=g*g+m*m,T=_*_+w*w,I=(w*b-m*T)/x,S=(g*T-_*b)/x,E=HL.pop()||new fJ;E.arc=n,E.site=s,E.x=I+p,E.y=(E.cy=S+h)+Math.sqrt(I*I+S*S),n.circle=E;for(var R=null,C=gf._;C;)if(E.y<C.y||E.y===C.y&&E.x<=C.x)if(C.L)C=C.L;else{R=C.P;break}else if(C.R)C=C.R;else{R=C;break}gf.insert(R,E),R||(Ug=E)}}}}function Xl(n){var t=n.circle;t&&(t.P||(Ug=t.N),gf.remove(t),HL.push(t),hf(t),n.circle=null)}var XL=[];function hJ(){hf(this),this.edge=this.site=this.circle=null}function WL(n){var t=XL.pop()||new hJ;return t.site=n,t}function g1(n){Xl(n),Yl.remove(n),XL.push(n),hf(n)}function YL(n){var t=n.circle,e=t.x,o=t.cy,s=[e,o],c=n.P,p=n.N,h=[n];g1(n);for(var g=c;g.circle&&Math.abs(e-g.circle.x)<Er&&Math.abs(o-g.circle.cy)<Er;)c=g.P,h.unshift(g),g1(g),g=c;h.unshift(g),Xl(g);for(var m=p;m.circle&&Math.abs(e-m.circle.x)<Er&&Math.abs(o-m.circle.cy)<Er;)p=m.N,h.push(m),g1(m),m=p;h.push(m),Xl(m);var _=h.length,w;for(w=1;w<_;++w)m=h[w],g=h[w-1],Rh(m.edge,g.site,m.site,s);g=h[0],m=h[_-1],m.edge=pf(g.site,m.site,null,s),Wl(g),Wl(m)}function $L(n){for(var t=n[0],e=n[1],o,s,c,p,h=Yl._;h;)if(c=ZL(h,e)-t,c>Er)h=h.L;else if(p=t-pJ(h,e),p>Er){if(!h.R){o=h;break}h=h.R}else{c>-Er?(o=h.P,s=h):p>-Er?(o=h,s=h.N):o=s=h;break}GL(n);var g=WL(n);if(Yl.insert(o,g),!(!o&&!s)){if(o===s){Xl(o),s=WL(o.site),Yl.insert(g,s),g.edge=s.edge=pf(o.site,g.site),Wl(o),Wl(s);return}if(!s){g.edge=pf(o.site,g.site);return}Xl(o),Xl(s);var m=o.site,_=m[0],w=m[1],x=n[0]-_,b=n[1]-w,T=s.site,I=T[0]-_,S=T[1]-w,E=2*(x*S-b*I),R=x*x+b*b,C=I*I+S*S,F=[(S*R-b*C)/E+_,(x*C-I*R)/E+w];Rh(s.edge,m,T,F),g.edge=pf(m,n,null,F),s.edge=pf(n,T,null,F),Wl(o),Wl(s)}}function ZL(n,t){var e=n.site,o=e[0],s=e[1],c=s-t;if(!c)return o;var p=n.P;if(!p)return-1/0;e=p.site;var h=e[0],g=e[1],m=g-t;if(!m)return h;var _=h-o,w=1/c-1/m,x=_/m;return w?(-x+Math.sqrt(x*x-2*w*(_*_/(-2*m)-g+m/2+s-c/2)))/w+o:(o+h)/2}function pJ(n,t){var e=n.N;if(e)return ZL(e,t);var o=n.site;return o[1]===t?o[0]:1/0}var Er=1e-6,VL=1e-12,Yl,To,gf,Hi;function dJ(n,t,e){return(n[0]-e[0])*(t[1]-n[1])-(n[0]-t[0])*(e[1]-n[1])}function gJ(n,t){return t[1]-n[1]||t[0]-n[0]}function Bg(n,t){var e=n.sort(gJ).pop(),o,s,c;for(Hi=[],To=new Array(n.length),Yl=new p1,gf=new p1;;)if(c=Ug,e&&(!c||e[1]<c.y||e[1]===c.y&&e[0]<c.x))(e[0]!==o||e[1]!==s)&&($L(e),o=e[0],s=e[1]),e=n.pop();else if(c)YL(c.arc);else break;if(kL(),t){var p=+t[0][0],h=+t[0][1],g=+t[1][0],m=+t[1][1];zL(p,h,g,m),qL(p,h,g,m)}this.edges=Hi,this.cells=To,Yl=gf=Hi=To=null}Bg.prototype={constructor:Bg,polygons:function(){var n=this.edges;return this.cells.map(function(t){var e=t.halfedges.map(function(o){return d1(t,n[o])});return e.data=t.site.data,e})},triangles:function(){var n=[],t=this.edges;return this.cells.forEach(function(e,o){if(h=(c=e.halfedges).length)for(var s=e.site,c,p=-1,h,g,m=t[c[h-1]],_=m.left===s?m.right:m.left;++p<h;)g=_,m=t[c[p]],_=m.left===s?m.right:m.left,g&&_&&o<g.index&&o<_.index&&dJ(s,g,_)<0&&n.push([s.data,g.data,_.data])}),n},links:function(){return this.edges.filter(function(n){return n.right}).map(function(n){return{source:n.left.data,target:n.right.data}})},find:function(n,t,e){for(var o=this,s,c=o._found||0,p=o.cells.length,h;!(h=o.cells[c]);)if(++c>=p)return null;var g=n-h.site[0],m=t-h.site[1],_=g*g+m*m;do h=o.cells[s=c],c=null,h.halfedges.forEach(function(w){var x=o.edges[w],b=x.left;if(!((b===h.site||!b)&&!(b=x.right))){var T=n-b[0],I=t-b[1],S=T*T+I*I;S<_&&(_=S,c=b.index)}});while(c!==null);return o._found=s,e==null||_<=e*e?h.site:null}};var SJ=Je(mf(),1);var I1=Je(QL(),1);function Zo(){return new kg}function kg(){this.reset()}kg.prototype={constructor:kg,reset:function(){this.s=this.t=0},add:function(n){tN(Gg,n,this.t),tN(this,Gg.s,this.s),this.s?this.t+=Gg.t:this.s=Gg.t},valueOf:function(){return this.s}};var Gg=new kg;function tN(n,t,e){var o=n.s=t+e,s=o-t,c=o-s;n.t=t-c+(e-s)}var er=1e-6;var gr=Math.PI,Mi=gr/2,qg=gr/4,Oa=gr*2,$l=180/gr,Jo=gr/180,Zr=Math.abs,aa=Math.atan,Ko=Math.atan2,Wn=Math.cos;var Hg=Math.exp;var Lh=Math.log;var an=Math.sin;var no=Math.sqrt,Nh=Math.tan;function v1(n){return n>1?0:n<-1?gr:Math.acos(n)}function Co(n){return n>1?Mi:n<-1?-Mi:Math.asin(n)}function ua(){}var MJ=Zo(),rpt=Zo();function Zl(n){var t=n[0],e=n[1],o=Wn(e);return[o*Wn(t),o*an(t),an(e)]}function Oh(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function Dh(n){var t=no(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}var ppt=Zo();function nN(n,t){return[n>gr?n-Oa:n<-gr?n+Oa:n,t]}nN.invert=nN;function _1(){var n=[],t;return{point:function(e,o){t.push([e,o])},lineStart:function(){n.push(t=[])},lineEnd:ua,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function x1(n,t){return Zr(n[0]-t[0])<er&&Zr(n[1]-t[1])<er}function Vg(n,t,e,o){this.x=n,this.z=t,this.o=e,this.e=o,this.v=!1,this.n=this.p=null}function E1(n,t,e,o,s){var c=[],p=[],h,g;if(n.forEach(function(T){if(!((I=T.length-1)<=0)){var I,S=T[0],E=T[I],R;if(x1(S,E)){for(s.lineStart(),h=0;h<I;++h)s.point((S=T[h])[0],S[1]);s.lineEnd();return}c.push(R=new Vg(S,T,null,!0)),p.push(R.o=new Vg(S,null,R,!1)),c.push(R=new Vg(E,T,null,!1)),p.push(R.o=new Vg(E,null,R,!0))}}),!!c.length){for(p.sort(t),rN(c),rN(p),h=0,g=p.length;h<g;++h)p[h].e=e=!e;for(var m=c[0],_,w;;){for(var x=m,b=!0;x.v;)if((x=x.n)===m)return;_=x.z,s.lineStart();do{if(x.v=x.o.v=!0,x.e){if(b)for(h=0,g=_.length;h<g;++h)s.point((w=_[h])[0],w[1]);else o(x.x,x.n.x,1,s);x=x.n}else{if(b)for(_=x.p.z,h=_.length-1;h>=0;--h)s.point((w=_[h])[0],w[1]);else o(x.x,x.p.x,-1,s);x=x.p}x=x.o,_=x.z,b=!b}while(!x.v);s.lineEnd()}}}function rN(n){if(t=n.length){for(var t,e=0,o=n[0],s;++e<t;)o.n=s=n[e],s.p=o,o=s;o.n=s=n[0],s.p=o}}function sl(n,t){return n<t?-1:n>t?1:n>=t?0:NaN}function w1(n){return n.length===1&&(n=TJ(n)),{left:function(t,e,o,s){for(o==null&&(o=0),s==null&&(s=t.length);o<s;){var c=o+s>>>1;n(t[c],e)<0?o=c+1:s=c}return o},right:function(t,e,o,s){for(o==null&&(o=0),s==null&&(s=t.length);o<s;){var c=o+s>>>1;n(t[c],e)>0?s=c:o=c+1}return o}}}function TJ(n){return function(t,e){return sl(n(t),e)}}var iN=w1(sl),CJ=iN.right,PJ=iN.left;var oN=Array.prototype,RJ=oN.slice,LJ=oN.map;var odt=Math.sqrt(50),sdt=Math.sqrt(10),adt=Math.sqrt(2);function Xg(n){for(var t=n.length,e,o=-1,s=0,c,p;++o<t;)s+=n[o].length;for(c=new Array(s);--t>=0;)for(p=n[t],e=p.length;--e>=0;)c[--s]=p[e];return c}var GJ=1e9,Vgt=-GJ;var S1=Zo();function M1(n,t){var e=t[0],o=t[1],s=[an(e),-Wn(e),0],c=0,p=0;S1.reset();for(var h=0,g=n.length;h<g;++h)if(_=(m=n[h]).length)for(var m,_,w=m[_-1],x=w[0],b=w[1]/2+qg,T=an(b),I=Wn(b),S=0;S<_;++S,x=R,T=F,I=W,w=E){var E=m[S],R=E[0],C=E[1]/2+qg,F=an(C),W=Wn(C),X=R-x,q=X>=0?1:-1,D=q*X,xt=D>gr,B=T*F;if(S1.add(Ko(B*q*an(D),I*W+B*Wn(D))),c+=xt?X+q*Oa:X,xt^x>=e^R>=e){var j=Oh(Zl(w),Zl(E));Dh(j);var J=Oh(s,j);Dh(J);var Dt=(xt^X>=0?-1:1)*Co(J[2]);(o>Dt||o===Dt&&(j[0]||j[1]))&&(p+=xt^X>=0?1:-1)}}return(c<-er||c<er&&S1<-er)^p&1}var tmt=Zo();var _mt=Zo(),xmt=Zo();var HJ=1/0;var Smt=-HJ;function b1(n){this._context=n}b1.prototype={_radius:4.5,pointRadius:function(n){return this._radius=n,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(n,t){switch(this._point){case 0:{this._context.moveTo(n,t),this._point=1;break}case 1:{this._context.lineTo(n,t);break}default:{this._context.moveTo(n+this._radius,t),this._context.arc(n,t,this._radius,0,Oa);break}}},result:ua};var Nmt=Zo();function A1(){this._string=[]}A1.prototype={_radius:4.5,_circle:uN(4.5),pointRadius:function(n){return(n=+n)!==this._radius&&(this._radius=n,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(n,t){switch(this._point){case 0:{this._string.push("M",n,",",t),this._point=1;break}case 1:{this._string.push("L",n,",",t);break}default:{this._circle==null&&(this._circle=uN(this._radius)),this._string.push("M",n,",",t,this._circle);break}}},result:function(){if(this._string.length){var n=this._string.join("");return this._string=[],n}else return null}};function uN(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function T1(n,t,e,o){return function(s,c){var p=t(c),h=s.invert(o[0],o[1]),g=_1(),m=t(g),_=!1,w,x,b,T={point:I,lineStart:E,lineEnd:R,polygonStart:function(){T.point=C,T.lineStart=F,T.lineEnd=W,x=[],w=[]},polygonEnd:function(){T.point=I,T.lineStart=E,T.lineEnd=R,x=Xg(x);var X=M1(w,h);x.length?(_||(c.polygonStart(),_=!0),E1(x,XJ,X,e,c)):X&&(_||(c.polygonStart(),_=!0),c.lineStart(),e(null,null,1,c),c.lineEnd()),_&&(c.polygonEnd(),_=!1),x=w=null},sphere:function(){c.polygonStart(),c.lineStart(),e(null,null,1,c),c.lineEnd(),c.polygonEnd()}};function I(X,q){var D=s(X,q);n(X=D[0],q=D[1])&&c.point(X,q)}function S(X,q){var D=s(X,q);p.point(D[0],D[1])}function E(){T.point=S,p.lineStart()}function R(){T.point=I,p.lineEnd()}function C(X,q){b.push([X,q]);var D=s(X,q);m.point(D[0],D[1])}function F(){m.lineStart(),b=[]}function W(){C(b[0][0],b[0][1]),m.lineEnd();var X=m.clean(),q=g.result(),D,xt=q.length,B,j,J;if(b.pop(),w.push(b),b=null,!!xt){if(X&1){if(j=q[0],(B=j.length-1)>0){for(_||(c.polygonStart(),_=!0),c.lineStart(),D=0;D<B;++D)c.point((J=j[D])[0],J[1]);c.lineEnd()}return}xt>1&&X&2&&q.push(q.pop().concat(q.shift())),x.push(q.filter(WJ))}}return T}}function WJ(n){return n.length>1}function XJ(n,t){return((n=n.x)[0]<0?n[1]-Mi-er:Mi-n[1])-((t=t.x)[0]<0?t[1]-Mi-er:Mi-t[1])}var YJ=T1(function(){return!0},$J,JJ,[-gr,-Mi]);function $J(n){var t=NaN,e=NaN,o=NaN,s;return{lineStart:function(){n.lineStart(),s=1},point:function(c,p){var h=c>0?gr:-gr,g=Zr(c-t);Zr(g-gr)<er?(n.point(t,e=(e+p)/2>0?Mi:-Mi),n.point(o,e),n.lineEnd(),n.lineStart(),n.point(h,e),n.point(c,e),s=0):o!==h&&g>=gr&&(Zr(t-o)<er&&(t-=o*er),Zr(c-h)<er&&(c-=h*er),e=ZJ(t,e,c,p),n.point(o,e),n.lineEnd(),n.lineStart(),n.point(h,e),s=0),n.point(t=c,e=p),o=h},lineEnd:function(){n.lineEnd(),t=e=NaN},clean:function(){return 2-s}}}function ZJ(n,t,e,o){var s,c,p=an(n-e);return Zr(p)>er?aa((an(t)*(c=Wn(o))*an(e)-an(o)*(s=Wn(t))*an(n))/(s*c*p)):(t+o)/2}function JJ(n,t,e,o){var s;if(n==null)s=e*Mi,o.point(-gr,s),o.point(0,s),o.point(gr,s),o.point(gr,0),o.point(gr,-s),o.point(0,-s),o.point(-gr,-s),o.point(-gr,0),o.point(-gr,s);else if(Zr(n[0]-t[0])>er){var c=n[0]<t[0]?gr:-gr;s=e*c/2,o.point(-c,s),o.point(0,s),o.point(c,s)}else o.point(t[0],t[1])}function Yg(n){return function(t){var e=new C1;for(var o in n)e[o]=n[o];return e.stream=t,e}}function C1(){}C1.prototype={constructor:C1,point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var x0t=Wn(30*Jo);var O0t=Yg({point:function(n,t){this.stream.point(n*Jo,t*Jo)}});function $g(n){return function(t,e){var o=Wn(t),s=Wn(e),c=n(o*s);return[c*s*an(t),c*an(e)]}}function Da(n){return function(t,e){var o=no(t*t+e*e),s=n(o),c=an(s),p=Wn(s);return[Ko(t*c,o*p),Co(o&&e*c/o)]}}var gN=$g(function(n){return no(2/(1+n))});gN.invert=Da(function(n){return 2*Co(n/2)});var mN=$g(function(n){return(n=v1(n))&&n/an(n)});mN.invert=Da(function(n){return n});function P1(n,t){return[n,Lh(Nh((Mi+t)/2))]}P1.invert=function(n,t){return[n,2*aa(Hg(t))-Mi]};function Zg(n,t){return[n,t]}Zg.invert=Zg;function yN(n,t){var e=Wn(t),o=Wn(n)*e;return[e*an(n)/o,an(t)/o]}yN.invert=Da(aa);function vN(n,t){var e=t*t,o=e*e;return[n*(.8707-.131979*e+o*(-.013791+o*(.003971*e-.001529*o))),t*(1.007226+e*(.015085+o*(-.044475+.028874*e-.005916*o)))]}vN.invert=function(n,t){var e=t,o=25,s;do{var c=e*e,p=c*c;e-=s=(e*(1.007226+c*(.015085+p*(-.044475+.028874*c-.005916*p)))-t)/(1.007226+c*(.015085*3+p*(-.044475*7+.028874*9*c-.005916*11*p)))}while(Zr(s)>er&&--o>0);return[n/(.8707+(c=e*e)*(-.131979+c*(-.013791+c*c*c*(.003971-.001529*c)))),e]};function _N(n,t){return[Wn(t)*an(n),an(t)]}_N.invert=Da(Co);function xN(n,t){var e=Wn(t),o=1+Wn(n)*e;return[e*an(n)/o,an(t)/o]}xN.invert=Da(function(n){return 2*aa(n)});function EN(n,t){return[Lh(Nh((Mi+t)/2)),-n]}EN.invert=function(n,t){return[-t,2*aa(Hg(n))-Mi]};var nK=Je(mf(),1);var rK=Je(mf(),1);var oK=Je(mf(),1);var sK=Je(mf(),1);function Fa(n,t){return Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2)}function SN(n){let t=0;for(let e=0;e<n.length-1;e++)t+=Fa(n[e],n[e+1]);return t}function MN(n,t,e){let o=new ze(t[0]-n[0],t[1]-n[1]),s=new ze(t[0]-e[0],t[1]-e[1]),p=o.angleTo(s)*180/Math.PI,h=new ze(t[0]-n[0],t[1]-n[1]);return new ze(e[0]-n[0],e[1]-n[1]).cross(h)>0?p:-p}var jo=Je(bN(),1);var Xn="___",Jg=class{isFacilityByType(t){return["facility","escalator","straightLadder","staircase","ramp","connectionPoint"].includes(t)}initFacilities(t){this.facilities=t.map(e=>{let o=[];try{o=JSON.parse(e.entry_end_floor)}catch(c){o=[]}let s=[];try{s=JSON.parse(e.entry_start_floor)}catch(c){s=[]}return Ru({},e,{entry_start_floor:s,entry_end_floor:o})})}getParkingSpaceInfo(t,e){let o=""+t+Xn+e;var s;return(s=this.parkingMap.get(o))!=null?s:null}getNodeInfo(t,e){let o=""+t+Xn+e,s=this.nodeMap.get(o);if(!(s!=null&&s.length))return null;let c=this.pointMap.get(s[0]);return c!=null?c:null}initRoute(t,e){this.clear(),this.roadInfo=t,this.initFacilities(e);let o=new Date,s=o.getHours()*60+o.getMinutes();t.length&&(t.forEach(c=>{let p=(c.points||[]).filter(h=>!(0,jo.isNil)(h.passWeight)&&h.passWeight!==1&&!(0,jo.isNil)(h.coverageArea)&&h.coverageArea!==0);(c.points||[]).filter(h=>h.openStatus!==!1).filter(h=>{if(!h.startTime||!h.endTime)return!0;let[g,m]=h.startTime.split(":").map(T=>+T),[_,w]=h.endTime.split(":").map(T=>+T),x=g*60+m,b=_*60+w;return s>=x&&s<=b}).forEach(h=>{h.floor=c.floor;let g=""+c.floor+Xn+h.id,m=""+c.floor+Xn+h.nodeId,_=this.nodeMap.get(m)||[];if(_.push(""+c.floor+Xn+(h.relatedId||h.id)),this.nodeMap.set(""+c.floor+Xn+h.nodeId,_),this.pointMap.set(g,h),this.isFacilityByType(h.type)){let w=this.facilities.find(x=>x.id===+h.targetId);if(w){switch(w.entry_infra_type){case"straightLadder":if(w.entry_end_floor.find(I=>I.floor===c.floor)&&w.entry_start_floor.find(I=>I.floor===c.floor)){let I=this.straightLadderMap.get(h.targetId)||[];I.push(Ru({},h)),this.straightLadderMap.set(h.targetId,I)}break;case"staircase":if(w.entry_end_floor.find(I=>I.floor===c.floor)&&w.entry_start_floor.find(I=>I.floor===c.floor)){let I=this.staircaseMap.get(h.targetId)||[];I.push(Ru({},h)),this.staircaseMap.set(h.targetId,I)}break;case"escalator":let b=this.escalatorMap.get(h.targetId)||[];if(w.entry_start_floor.find(I=>I.floor===c.floor)){let I=b.find(S=>{var E;return((E=S.end)==null?void 0:E.floor)!==c.floor&&!S.start});I?I.start=h:b.push({start:h})}if(w.entry_end_floor.find(I=>I.floor===c.floor)){let I=b.find(S=>{var E;return((E=S.start)==null?void 0:E.floor)!==c.floor&&!S.end});I?I.end=h:b.push({end:h})}this.escalatorMap.set(h.targetId,b);break;case"ramp":let T=this.rampMap.get(h.targetId)||[];if(w.entry_start_floor.find(I=>I.floor===c.floor)){let I=T.find(S=>{var E;return((E=S.end)==null?void 0:E.floor)!==c.floor&&!S.start});I?I.start=h:T.push({start:h})}if(w.entry_end_floor.find(I=>I.floor===c.floor)){let I=T.find(S=>{var E;return((E=S.start)==null?void 0:E.floor)!==c.floor&&!S.end});I?I.end=h:T.push({end:h})}this.rampMap.set(h.targetId,T);break;case"connectionPoint":if(w.entry_end_floor.find(I=>I.floor===c.floor)&&w.entry_start_floor.find(I=>I.floor===c.floor)){let I=this.connectionPointMap.get(h.targetId)||[];I.push(Ru({},h)),this.connectionPointMap.set(h.targetId,I)}break}let x=this.facilityMap.get(h.targetId)||[];x.push(Ru({},h)),this.facilityMap.set(h.targetId,x)}}h.type==="parkingSpace"&&h.name.split(/[,\uFF0C]/).forEach(x=>{this.parkingMap.set(""+c.floor+Xn+x,h)})}),(c.lines||[]).filter(h=>h.to!==h.from).forEach(h=>{let g=""+c.floor+Xn+h.from,m=""+c.floor+Xn+h.to,_=this.pointMap.get(g),w=this.pointMap.get(m);if(!_||!w)return;let x=_.cds,b=w.cds,T=Fa(x,b);if(p.forEach(I=>{(I.id===h.from||I.id===h.to)&&(T=T/I.passWeight);let S=Fa(x,I.cds)<=I.coverageArea,E=Fa(b,I.cds)<=I.coverageArea;(S||E)&&(T=T/I.passWeight)}),!_.permission&&!w.permission){switch(this.addLineItem(g,m,T),this.addLineItem(m,g,T),h.direction){case"double":this.addLineItem(g,m,T,this.forwardLineMap),this.addLineItem(m,g,T,this.forwardLineMap);break;case"single":this.addLineItem(g,m,T,this.forwardLineMap);break;case"back":this.addLineItem(m,g,T,this.forwardLineMap);break}(_.type==="parkingSpace"||w.type==="parkingSpace")&&h.direction==="noDir"&&(this.addLineItem(g,m,T,this.forwardLineMap),this.addLineItem(m,g,T,this.forwardLineMap))}else _.permission&&(this.setPermissionLine(g,m,_.permission,T,""),this.setPermissionLine(m,g,_.permission,T,"")),w.permission&&w.permission!==_.permission&&(this.setPermissionLine(g,m,w.permission,T,""),this.setPermissionLine(m,g,w.permission,T,""))})}),this.addPermissionFacility(),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute(),this.initForwardRoute())}getPermissionMap(t){return this["permission_"+t]||(this["permission_"+t]=new Set),this["permission_"+t]}setPermissionLine(t,e,o,s,c){this.getPermissionMap(o).add({fromKey:t,toKey:e,distance:s,type:c})}addPermissionFacility(){this.straightLadderMap.forEach((t,e)=>{if(t.length<2){this.straightLadderMap.delete(e);return}for(let o=0;o<t.length;o++){let s=""+t[o].floor+Xn+t[o].id,c=this.pointMap.get(s);if(c){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Xn+t[p].id,g=this.pointMap.get(h);if(!g)continue;c.permission&&this.setPermissionLine(s,h,c.permission,1,"straightLadder"),g.permission&&g.permission!==c.permission&&this.setPermissionLine(s,h,g.permission,1,"straightLadder")}}}}),this.staircaseMap.forEach((t,e)=>{if(t.length<2){this.staircaseMap.delete(e);return}for(let o=0;o<t.length;o++){let s=""+t[o].floor+Xn+t[o].id,c=this.pointMap.get(s);if(c){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Xn+t[p].id,g=this.pointMap.get(h);if(!g)continue;c.permission&&this.setPermissionLine(s,h,c.permission,1,"staircase"),g.permission&&g.permission!==c.permission&&this.setPermissionLine(s,h,g.permission,1,"staircase")}}}}),this.escalatorMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Xn+o.start.id,c=""+o.end.floor+Xn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(c);p&&h&&(p.permission&&this.setPermissionLine(s,c,p.permission,1,"escalator"),h.permission&&h.permission!==p.permission&&this.setPermissionLine(s,c,h.permission,1,"escalator"))}})}),this.rampMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Xn+o.start.id,c=""+o.end.floor+Xn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(c);p&&h&&(p.permission&&this.setPermissionLine(s,c,p.permission,10,"ramp"),h.permission&&h.permission!==p.permission&&this.setPermissionLine(s,c,h.permission,10,"ramp"))}})}),this.connectionPointMap.forEach((t,e)=>{if(t.length<2){this.connectionPointMap.delete(e);return}for(let o=0;o<t.length;o++){let s=""+t[o].floor+Xn+t[o].id,c=this.pointMap.get(s);if(c){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Xn+t[p].id,g=this.pointMap.get(h);if(!g)continue;c.permission&&this.setPermissionLine(s,h,c.permission,1,"connectionPoint"),g.permission&&g.permission!==c.permission&&this.setPermissionLine(s,h,g.permission,1,"connectionPoint")}}}})}addPermissionLineToMap(t,e,o,s){this.getPermissionMap(t).forEach(p=>{e.includes(p.type)&&(p.type===""?this.addLineItem(p.fromKey,p.toKey,p.distance,o):this.addLineItem(p.fromKey,p.toKey,s.get(p.type),o))})}addLineItem(t,e,o,s){s===void 0&&(s=this.lineMap);let c=s.get(t)||new Map;c.set(e,o),s.set(t,c)}addFacilityToLineMap(t,e,o,s){[...this.straightLadderMap,...this.staircaseMap].forEach(c=>{let[p,h]=c;if(!(h.length<2))for(let g=0;g<h.length;g++){let m=""+h[g].floor+Xn+h[g].id,_=this.pointMap.get(m);if(!(!_||_.permission)){for(let w=0;w<h.length;w++)if(g!==w){let x=""+h[w].floor+Xn+h[w].id,b=this.pointMap.get(x);if(!b||b.permission)continue;if(h[g].type==="straightLadder"){let T=e;this.addLineItem(m,x,T,s)}else{let T=o;this.addLineItem(m,x,T,s)}}}}}),this.escalatorMap.forEach((c,p)=>{c.forEach(h=>{if(h.start&&h.end){let g=""+h.start.floor+Xn+h.start.id,m=""+h.end.floor+Xn+h.end.id,_=this.pointMap.get(g),w=this.pointMap.get(m);if(_&&w&&!_.permission&&!w.permission){let x=t;this.addLineItem(g,m,x,s)}}})}),this.connectionPointMap.forEach((c,p)=>{if(!(c.length<2))for(let h=0;h<c.length;h++){let g=""+c[h].floor+Xn+c[h].id,m=this.pointMap.get(g);if(!(!m||m.permission)){for(let _=0;_<c.length;_++)if(h!==_){let w=""+c[_].floor+Xn+c[_].id,x=this.pointMap.get(w);if(!x||x.permission)continue;this.addLineItem(g,w,100,s)}}}})}initBaseRoute(){let t=new Map((0,jo.cloneDeep)([...this.lineMap]));this.addFacilityToLineMap(100,100+this.lift_priority,3e4,t),this.baseRoute=new ro.default(t)}initEscalatorRoute(){let t=new Map((0,jo.cloneDeep)([...this.lineMap])),e=1e4;this.addFacilityToLineMap(1*e,this.lift_priority*e,3e4*e,t),this.escalatorRoute=new ro.default(t)}initStraightLadderRoute(){let t=new Map((0,jo.cloneDeep)([...this.lineMap])),e=1e4;this.addFacilityToLineMap(3*e,1*e,3e4*e,t),this.straightLadderRoute=new ro.default(t)}initForwardRoute(){this.rampMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Xn+o.start.id,c=""+o.end.floor+Xn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(c);p&&h&&!p.permission&&!h.permission&&this.addLineItem(s,c,10,this.forwardLineMap)}})}),this.connectionPointMap.forEach((t,e)=>{if(!(t.length<2))for(let o=0;o<t.length;o++){let s=""+t[o].floor+Xn+t[o].id,c=this.pointMap.get(s);if(!(!c||c.permission)){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Xn+t[p].id,g=this.pointMap.get(h);if(!g||g.permission)continue;this.addLineItem(s,h,100,this.forwardLineMap)}}}}),this.forwardRoute=new ro.default(this.forwardLineMap)}checkStart(t){return!(!t.floor||!t.nodeId&&(!t.coord||t.coord.length<2))}checkEnd(t){return t.facility||t.parkingSpace&&t.floor?!0:this.checkStart(t)}transformStart(t,e,o){o===void 0&&(o={});var s;if(t.nodeId){let c=this.nodeMap.get(""+t.floor+Xn+t.nodeId);if(c!=null&&c.length)return c.map(p=>{let[h,g]=p.split(Xn);return{floor:h,id:g}})}if((s=t.coord)!=null&&s.length){let c=this.roadInfo.find(m=>m.floor===t.floor);if(!c)return null;let p=c.points.filter(m=>m.isStarted),h=c.points.filter(m=>{let _=""+m.floor+Xn+m.id;if(e==="forward"){if(!this.forwardLineMap.has(_)||o.adsorptionIntersection&&p.length&&!m.isStarted)return!1}else if(!this.lineMap.has(_))return!1;return!0});if(!h.length)return null;let g=h.reduce((m,_)=>{if(_.relatedId)return m;let w=Fa(t.coord,_.cds);return w<m.min&&(m.min=w,m.point=_),m},{min:1/0,point:h[0]});return[{floor:c.floor,id:g.point.id}]}return null}transformEnd(t,e){if(t.floor){if(t.parkingSpace){let s=this.parkingMap.get(""+t.floor+Xn+t.parkingSpace);if(s)return[{floor:t.floor,id:s.id}]}let o=this.transformStart(t,e);if(o)return o}if(t.facility){let s=this.facilities.filter(c=>+c.type_id==+t.facility).map(c=>c.id).map(c=>this.facilityMap.get(""+c)).flat(2);if(s!=null&&s.length)return{floor:t.floor,facility:t.facility}}return null}getPath(t,e,o,s,c,p){if(o===void 0&&(o=""),p===void 0&&(p={}),!this.checkStart(t))return"start-error";if(!this.checkEnd(e))return"end-error";let h=this.transformStart(t,o,p);if(!h)return"no-start";let g=this.transformEnd(e,o);if(!g)return"no-end";let m=[];if(Array.isArray(g))for(let x=0;x<h.length;x++){let b=h[x];for(let T=0;T<g.length;T++){let I=g[T];if(b.floor===I.floor&&b.id===I.id)return"near"}}else{m=this.facilities.filter(b=>+b.type_id==+e.facility).map(b=>b.id).map(b=>this.facilityMap.get(""+b)).flat(2).filter(b=>b).filter(b=>g.floor?b.floor===g.floor:!0);for(let b=0;b<h.length;b++){let T=h[b];for(let I=0;I<m.length;I++){let S=m[I];if(T.floor===S.floor&&T.id===S.id)return"near"}}}let _;switch(o){case"escalator":_=this.getEscalatorPath.bind(this);break;case"straightLadder":_=this.getStraightLadderPath.bind(this);break;case"forward":_=this.getForwardPath.bind(this);break;default:_=this.getBasePath.bind(this);break}let w=null;return h.forEach(x=>{if(Array.isArray(g))g.forEach(b=>{let T=_(x,b,s,c);T&&T&&(!w||T[0].consume<w[0].consume)&&(w=T)});else{if(!m.length)return null;let b=m.map(T=>_(x,{floor:T.floor,id:T.id},s,c)).filter(T=>!!T);w=b.reduce((T,I)=>{let S=I[0].consume;return S<T.distance&&(T.distance=S,T.path=I),T},{distance:1/0,path:b[0]}).path}}),w}getRoutePath(t,e,o){let s=""+t.floor+Xn+t.id,c=""+e.floor+Xn+e.id,p=o.path(s,c);if(!p)return null;let h=[],g=p.reduce((m,_,w,x)=>{if(w===0)return 0;let b=x[w-1],T=o.graph.get(b).get(_);return m+T},0);return p.map(m=>{let _=this.pointMap.get(m);if(_){var w;let{floor:x}=_,b=_.type;if(this.isFacilityByType(_.type)){let T=this.facilities.find(I=>I.id===+_.targetId);T&&(b=T.entry_infra_type)}if(((w=h[h.length-1])==null?void 0:w.floor)===x){let T=h[h.length-1];T.points.push(_.cds),T.pointInfos.push(_),T.endType=b,T.destId=_.nodeId,T.distance=SN(T.points)}else h.push({floor:x,points:[_.cds],pointInfos:[_],endType:b,destId:_.nodeId,distance:0,consume:g})}}),h}getBasePath(t,e,o){if(!o)return this.getRoutePath(t,e,this.baseRoute);let s=(0,jo.cloneDeep)(this.baseRoute.graph);this.addPermissionLineToMap(o,["","escalator","staircase","straightLadder","connectionPoint"],s,new Map([["escalator",100],["connectionPoint",100],["straightLadder",100+this.lift_priority],["staircase",3e4]]));let c=new ro.default(s);return this.getRoutePath(t,e,c)}getEscalatorPath(t,e,o){if(!o)return this.getRoutePath(t,e,this.escalatorRoute);let s=(0,jo.cloneDeep)(this.escalatorRoute.graph),c=1e4;this.addPermissionLineToMap(o,["","escalator","staircase","straightLadder","connectionPoint"],s,new Map([["escalator",1*c],["connectionPoint",100],["straightLadder",this.lift_priority*c],["staircase",3e4*c]]));let p=new ro.default(s);return this.getRoutePath(t,e,p)}getStraightLadderPath(t,e,o){if(!o)return this.getRoutePath(t,e,this.straightLadderRoute);let s=(0,jo.cloneDeep)(this.straightLadderRoute.graph),c=1e4;this.addPermissionLineToMap(o,["","escalator","staircase","straightLadder","connectionPoint"],s,new Map([["escalator",3*c],["connectionPoint",100],["straightLadder",1*c],["staircase",3e4*c]]));let p=new ro.default(s);return this.getRoutePath(t,e,p)}getForwardPath(t,e,o,s){let c=new Map,p=x=>{let b=this.forwardRoute.graph.get(g);x.forEach(T=>{let I=b.get(T);(0,jo.isNil)(I)||(c.set(T,I),b.delete(T))})},h=()=>{let x=this.forwardRoute.graph.get(g);c.forEach((b,T)=>{x.set(T,b)})},g=""+t.floor+Xn+t.id;if(!(0,jo.isNil)(s)){let x=this.forwardLineMap.get(g),b=this.pointMap.get(g);if(b&&(x!=null&&x.size)&&x.size>1){let T=new ze(b.cds[0],b.cds[1]),I=new Map;x.forEach((E,R)=>{let C=this.pointMap.get(R);if(C){let F=new ze(C.cds[0],C.cds[1]),X=360-(new ze().subVectors(F,T).angle()/Math.PI*180-90+360)%360;I.set(R,X)}});let S=Array.from(I).filter(E=>{let[R,C]=E;return Math.abs(C-s)<=60}).map(E=>{let[R]=E;return R});if(S.length)S.forEach(E=>I.delete(E)),p([...I.keys()]);else{let E=Array.from(I).reduce((R,C)=>{let F=Math.abs(C[1]-s);return F<R.diff?{diff:F,key:C[0]}:R},{diff:1/0,key:""});I.delete(E.key),p([...I.keys()])}}}if(!o){let x=this.getRoutePath(t,e,this.forwardRoute);return h(),x||this.getRoutePath(t,e,this.forwardRoute)}let m=(0,jo.cloneDeep)(this.forwardRoute.graph);this.addPermissionLineToMap(o,["","ramp"],m,new Map([["ramp",10]]));let _=new ro.default(m),w=this.getRoutePath(t,e,_);if(h(),w)return w;{let x=(0,jo.cloneDeep)(this.forwardRoute.graph);this.addPermissionLineToMap(o,["","ramp"],x,new Map([["ramp",10]]));let b=new ro.default(x);return this.getRoutePath(t,e,b)}}clear(){this.roadInfo=[],this.pointMap.clear(),this.nodeMap.clear(),this.facilityMap.clear(),this.straightLadderMap.clear(),this.escalatorMap.clear(),this.staircaseMap.clear(),this.lineMap.clear(),this.baseRoute=new ro.default,this.escalatorRoute=new ro.default,this.straightLadderRoute=new ro.default}constructor(t=3){this.lift_priority=t,this.roadInfo=[],this.facilities=[],this.pointMap=new Map,this.nodeMap=new Map,this.facilityMap=new Map,this.straightLadderMap=new Map,this.escalatorMap=new Map,this.rampMap=new Map,this.staircaseMap=new Map,this.connectionPointMap=new Map,this.parkingMap=new Map,this.lineMap=new Map,this.baseRoute=new ro.default,this.escalatorRoute=new ro.default,this.straightLadderRoute=new ro.default,this.forwardLineMap=new Map,this.forwardRoute=new ro.default}};var rwt=Je(Gp(),1),iwt=Je(ty(),1);var gK=Je(IN(),1);function mK(n,t,e){let o=MN(n,t,e);return yK(o)}function yK(n){return 180-Math.abs(n)<15?"front":n>135?"right_front":n<-135?"left_front":n<=135&&n>=60?"right":n>=-135&&n<=-60?"left":n<60&&n>0?"right_back":n>-60&&n<0?"left_back":"front"}function RN(n){if(!n.length)return[];if(n.length===1)return[{direction:"start",distance:0,points:n}];let t=[{direction:"start",distance:Fa(n[0],n[1]),points:[n[0],n[1]]}];for(let e=2;e<n.length;e++){let o=mK(n[e-2],n[e-1],n[e]);if(o==="front"){let s=t[t.length-1],c=Fa(n[e-1],n[e]);s.distance+=c,e!==2&&s.points.push(n[e-1])}else t.push({direction:o,distance:Fa(n[e-1],n[e]),points:[n[e-1],n[e]]})}return t.push({direction:"end",distance:0,points:[n[n.length-1]]}),t}var gwt=Je(i2(),1),mwt=Je(Xp(),1);function o2(n){return n.replace(/[A-Z]/g,t=>"_"+t.toLowerCase()).replace(/^_/,"")}function s2(n){let t={};for(let o in n)o.startsWith("on")&&(t[o2(o.slice(2))]=n[o]);let e=o=>pp(this,null,function*(){let{data:s}=o;if(t[s.type])try{let c=yield t[s.type](s.data);if(c!=null&&c.$transfer&&Array.isArray(c.$transfer)){let p=c.$transfer;delete c.$transfer,self.postMessage({type:""+s.type+"_result",key:s.key,data:c},p)}else self.postMessage({type:""+s.type+"_result",key:s.key,data:c})}catch(c){self.postMessage({type:""+s.type+"_result",key:s.key,error:c})}else self.postMessage({type:""+s.type+"_result",key:s.key,error:"no_event"})});return self.addEventListener("message",e),()=>{self.removeEventListener("message",e)}}var B1=new Jg;s2({onSetRoadInfo(n){let{roadData:t,facilities:e}=n;B1.initRoute(t,e)},onGetPath(n){let{start:t,end:e,type:o,permission:s,travelDirection:c,options:p}=n;return B1.getPath(t,e,o,s,c,p)},onGetDirectionPath(n){return RN(n)},onClear(){B1.clear()}});
15645
+ \`)};function Fg(n,t,e){this.x=n,this.y=t,this.weight=e}Fg.prototype.toString=function(){return"["+this.x+" "+this.y+"]"};Fg.prototype.getCost=function(n){return n&&n.x!==this.x&&n.y!==this.y?this.weight*1.41421:this.weight};Fg.prototype.isWall=function(){return this.weight===0};function UL(n){this.content=[],this.scoreFunction=n}UL.prototype={push:function(n){this.content.push(n),this.sinkDown(this.content.length-1)},pop:function(){var n=this.content[0],t=this.content.pop();return this.content.length>0&&(this.content[0]=t,this.bubbleUp(0)),n},remove:function(n){var t=this.content.indexOf(n),e=this.content.pop();t!==this.content.length-1&&(this.content[t]=e,this.scoreFunction(e)<this.scoreFunction(n)?this.sinkDown(t):this.bubbleUp(t))},size:function(){return this.content.length},rescoreElement:function(n){this.sinkDown(this.content.indexOf(n))},sinkDown:function(n){for(var t=this.content[n];n>0;){var e=(n+1>>1)-1,o=this.content[e];if(this.scoreFunction(t)<this.scoreFunction(o))this.content[e]=t,this.content[n]=o,n=e;else break}},bubbleUp:function(n){for(var t=this.content.length,e=this.content[n],o=this.scoreFunction(e);;){var s=n+1<<1,c=s-1,p=null,h;if(c<t){var g=this.content[c];h=this.scoreFunction(g),h<o&&(p=c)}if(s<t){var m=this.content[s],_=this.scoreFunction(m);_<(p===null?o:h)&&(p=s)}if(p!==null)this.content[n]=this.content[p],this.content[p]=e,n=p;else break}}};function h1(){this._=null}function hf(n){n.U=n.C=n.L=n.R=n.P=n.N=null}h1.prototype={constructor:h1,insert:function(n,t){var e,o,s;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=BL(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)o=e.U,e===o.L?(s=o.R,s&&s.C?(e.C=s.C=!1,o.C=!0,n=o):(n===e.R&&(Ph(this,e),n=e,e=n.U),e.C=!1,o.C=!0,Ih(this,o))):(s=o.L,s&&s.C?(e.C=s.C=!1,o.C=!0,n=o):(n===e.L&&(Ih(this,e),n=e,e=n.U),e.C=!1,o.C=!0,Ph(this,o))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t=n.U,e,o=n.L,s=n.R,c,p;if(o?s?c=BL(s):c=o:c=s,t?t.L===n?t.L=c:t.R=c:this._=c,o&&s?(p=c.C,c.C=n.C,c.L=o,o.U=c,c!==s?(t=c.U,c.U=n.U,n=c.R,t.L=n,c.R=s,s.U=c):(c.U=t,t=c,n=c.R)):(p=n.C,n=c),n&&(n.U=t),!p){if(n&&n.C){n.C=!1;return}do{if(n===this._)break;if(n===t.L){if(e=t.R,e.C&&(e.C=!1,t.C=!0,Ph(this,t),e=t.R),e.L&&e.L.C||e.R&&e.R.C){(!e.R||!e.R.C)&&(e.L.C=!1,e.C=!0,Ih(this,e),e=t.R),e.C=t.C,t.C=e.R.C=!1,Ph(this,t),n=this._;break}}else if(e=t.L,e.C&&(e.C=!1,t.C=!0,Ih(this,t),e=t.L),e.L&&e.L.C||e.R&&e.R.C){(!e.L||!e.L.C)&&(e.R.C=!1,e.C=!0,Ph(this,e),e=t.L),e.C=t.C,t.C=e.L.C=!1,Ih(this,t),n=this._;break}e.C=!0,n=t,t=t.U}while(!n.C);n&&(n.C=!1)}}};function Ph(n,t){var e=t,o=t.R,s=e.U;s?s.L===e?s.L=o:s.R=o:n._=o,o.U=s,e.U=o,e.R=o.L,e.R&&(e.R.U=e),o.L=e}function Ih(n,t){var e=t,o=t.L,s=e.U;s?s.L===e?s.L=o:s.R=o:n._=o,o.U=s,e.U=o,e.L=o.R,e.L&&(e.L.U=e),o.R=e}function BL(n){for(;n.L;)n=n.L;return n}var p1=h1;function pf(n,t,e,o){var s=[null,null],c=Hi.push(s)-1;return s.left=n,s.right=t,e&&Rh(s,n,t,e),o&&Rh(s,t,n,o),To[n.index].halfedges.push(c),To[t.index].halfedges.push(c),s}function df(n,t,e){var o=[t,e];return o.left=n,o}function Rh(n,t,e,o){!n[0]&&!n[1]?(n[0]=o,n.left=t,n.right=e):n.left===e?n[1]=o:n[0]=o}function aJ(n,t,e,o,s){var c=n[0],p=n[1],h=c[0],g=c[1],m=p[0],_=p[1],w=0,x=1,b=m-h,T=_-g,I;if(I=t-h,!(!b&&I>0)){if(I/=b,b<0){if(I<w)return;I<x&&(x=I)}else if(b>0){if(I>x)return;I>w&&(w=I)}if(I=o-h,!(!b&&I<0)){if(I/=b,b<0){if(I>x)return;I>w&&(w=I)}else if(b>0){if(I<w)return;I<x&&(x=I)}if(I=e-g,!(!T&&I>0)){if(I/=T,T<0){if(I<w)return;I<x&&(x=I)}else if(T>0){if(I>x)return;I>w&&(w=I)}if(I=s-g,!(!T&&I<0)){if(I/=T,T<0){if(I>x)return;I>w&&(w=I)}else if(T>0){if(I<w)return;I<x&&(x=I)}return!(w>0)&&!(x<1)||(w>0&&(n[0]=[h+w*b,g+w*T]),x<1&&(n[1]=[h+x*b,g+x*T])),!0}}}}}function uJ(n,t,e,o,s){var c=n[1];if(c)return!0;var p=n[0],h=n.left,g=n.right,m=h[0],_=h[1],w=g[0],x=g[1],b=(m+w)/2,T=(_+x)/2,I,S;if(x===_){if(b<t||b>=o)return;if(m>w){if(!p)p=[b,e];else if(p[1]>=s)return;c=[b,s]}else{if(!p)p=[b,s];else if(p[1]<e)return;c=[b,e]}}else if(I=(m-w)/(x-_),S=T-I*b,I<-1||I>1)if(m>w){if(!p)p=[(e-S)/I,e];else if(p[1]>=s)return;c=[(s-S)/I,s]}else{if(!p)p=[(s-S)/I,s];else if(p[1]<e)return;c=[(e-S)/I,e]}else if(_<x){if(!p)p=[t,I*t+S];else if(p[0]>=o)return;c=[o,I*o+S]}else{if(!p)p=[o,I*o+S];else if(p[0]<t)return;c=[t,I*t+S]}return n[0]=p,n[1]=c,!0}function zL(n,t,e,o){for(var s=Hi.length,c;s--;)(!uJ(c=Hi[s],n,t,e,o)||!aJ(c,n,t,e,o)||!(Math.abs(c[0][0]-c[1][0])>Er||Math.abs(c[0][1]-c[1][1])>Er))&&delete Hi[s]}function GL(n){return To[n.index]={site:n,halfedges:[]}}function lJ(n,t){var e=n.site,o=t.left,s=t.right;return e===s&&(s=o,o=e),s?Math.atan2(s[1]-o[1],s[0]-o[0]):(e===o?(o=t[1],s=t[0]):(o=t[0],s=t[1]),Math.atan2(o[0]-s[0],s[1]-o[1]))}function d1(n,t){return t[+(t.left!==n.site)]}function cJ(n,t){return t[+(t.left===n.site)]}function kL(){for(var n=0,t=To.length,e,o,s,c;n<t;++n)if((e=To[n])&&(c=(o=e.halfedges).length)){var p=new Array(c),h=new Array(c);for(s=0;s<c;++s)p[s]=s,h[s]=lJ(e,Hi[o[s]]);for(p.sort(function(g,m){return h[m]-h[g]}),s=0;s<c;++s)h[s]=o[p[s]];for(s=0;s<c;++s)o[s]=h[s]}}function qL(n,t,e,o){var s=To.length,c,p,h,g,m,_,w,x,b,T,I,S,E=!0;for(c=0;c<s;++c)if(p=To[c]){for(h=p.site,m=p.halfedges,g=m.length;g--;)Hi[m[g]]||m.splice(g,1);for(g=0,_=m.length;g<_;)T=cJ(p,Hi[m[g]]),I=T[0],S=T[1],w=d1(p,Hi[m[++g%_]]),x=w[0],b=w[1],(Math.abs(I-x)>Er||Math.abs(S-b)>Er)&&(m.splice(g,0,Hi.push(df(h,T,Math.abs(I-n)<Er&&o-S>Er?[n,Math.abs(x-n)<Er?b:o]:Math.abs(S-o)<Er&&e-I>Er?[Math.abs(b-o)<Er?x:e,o]:Math.abs(I-e)<Er&&S-t>Er?[e,Math.abs(x-e)<Er?b:t]:Math.abs(S-t)<Er&&I-n>Er?[Math.abs(b-t)<Er?x:n,t]:null))-1),++_);_&&(E=!1)}if(E){var R,C,F,W=1/0;for(c=0,E=null;c<s;++c)(p=To[c])&&(h=p.site,R=h[0]-n,C=h[1]-t,F=R*R+C*C,F<W&&(W=F,E=p));if(E){var X=[n,t],q=[n,o],D=[e,o],xt=[e,t];E.halfedges.push(Hi.push(df(h=E.site,X,q))-1,Hi.push(df(h,q,D))-1,Hi.push(df(h,D,xt))-1,Hi.push(df(h,xt,X))-1)}}for(c=0;c<s;++c)(p=To[c])&&(p.halfedges.length||delete To[c])}var HL=[],Ug;function fJ(){hf(this),this.x=this.y=this.arc=this.site=this.cy=null}function Wl(n){var t=n.P,e=n.N;if(!(!t||!e)){var o=t.site,s=n.site,c=e.site;if(o!==c){var p=s[0],h=s[1],g=o[0]-p,m=o[1]-h,_=c[0]-p,w=c[1]-h,x=2*(g*w-m*_);if(!(x>=-VL)){var b=g*g+m*m,T=_*_+w*w,I=(w*b-m*T)/x,S=(g*T-_*b)/x,E=HL.pop()||new fJ;E.arc=n,E.site=s,E.x=I+p,E.y=(E.cy=S+h)+Math.sqrt(I*I+S*S),n.circle=E;for(var R=null,C=gf._;C;)if(E.y<C.y||E.y===C.y&&E.x<=C.x)if(C.L)C=C.L;else{R=C.P;break}else if(C.R)C=C.R;else{R=C;break}gf.insert(R,E),R||(Ug=E)}}}}function Xl(n){var t=n.circle;t&&(t.P||(Ug=t.N),gf.remove(t),HL.push(t),hf(t),n.circle=null)}var XL=[];function hJ(){hf(this),this.edge=this.site=this.circle=null}function WL(n){var t=XL.pop()||new hJ;return t.site=n,t}function g1(n){Xl(n),Yl.remove(n),XL.push(n),hf(n)}function YL(n){var t=n.circle,e=t.x,o=t.cy,s=[e,o],c=n.P,p=n.N,h=[n];g1(n);for(var g=c;g.circle&&Math.abs(e-g.circle.x)<Er&&Math.abs(o-g.circle.cy)<Er;)c=g.P,h.unshift(g),g1(g),g=c;h.unshift(g),Xl(g);for(var m=p;m.circle&&Math.abs(e-m.circle.x)<Er&&Math.abs(o-m.circle.cy)<Er;)p=m.N,h.push(m),g1(m),m=p;h.push(m),Xl(m);var _=h.length,w;for(w=1;w<_;++w)m=h[w],g=h[w-1],Rh(m.edge,g.site,m.site,s);g=h[0],m=h[_-1],m.edge=pf(g.site,m.site,null,s),Wl(g),Wl(m)}function $L(n){for(var t=n[0],e=n[1],o,s,c,p,h=Yl._;h;)if(c=ZL(h,e)-t,c>Er)h=h.L;else if(p=t-pJ(h,e),p>Er){if(!h.R){o=h;break}h=h.R}else{c>-Er?(o=h.P,s=h):p>-Er?(o=h,s=h.N):o=s=h;break}GL(n);var g=WL(n);if(Yl.insert(o,g),!(!o&&!s)){if(o===s){Xl(o),s=WL(o.site),Yl.insert(g,s),g.edge=s.edge=pf(o.site,g.site),Wl(o),Wl(s);return}if(!s){g.edge=pf(o.site,g.site);return}Xl(o),Xl(s);var m=o.site,_=m[0],w=m[1],x=n[0]-_,b=n[1]-w,T=s.site,I=T[0]-_,S=T[1]-w,E=2*(x*S-b*I),R=x*x+b*b,C=I*I+S*S,F=[(S*R-b*C)/E+_,(x*C-I*R)/E+w];Rh(s.edge,m,T,F),g.edge=pf(m,n,null,F),s.edge=pf(n,T,null,F),Wl(o),Wl(s)}}function ZL(n,t){var e=n.site,o=e[0],s=e[1],c=s-t;if(!c)return o;var p=n.P;if(!p)return-1/0;e=p.site;var h=e[0],g=e[1],m=g-t;if(!m)return h;var _=h-o,w=1/c-1/m,x=_/m;return w?(-x+Math.sqrt(x*x-2*w*(_*_/(-2*m)-g+m/2+s-c/2)))/w+o:(o+h)/2}function pJ(n,t){var e=n.N;if(e)return ZL(e,t);var o=n.site;return o[1]===t?o[0]:1/0}var Er=1e-6,VL=1e-12,Yl,To,gf,Hi;function dJ(n,t,e){return(n[0]-e[0])*(t[1]-n[1])-(n[0]-t[0])*(e[1]-n[1])}function gJ(n,t){return t[1]-n[1]||t[0]-n[0]}function Bg(n,t){var e=n.sort(gJ).pop(),o,s,c;for(Hi=[],To=new Array(n.length),Yl=new p1,gf=new p1;;)if(c=Ug,e&&(!c||e[1]<c.y||e[1]===c.y&&e[0]<c.x))(e[0]!==o||e[1]!==s)&&($L(e),o=e[0],s=e[1]),e=n.pop();else if(c)YL(c.arc);else break;if(kL(),t){var p=+t[0][0],h=+t[0][1],g=+t[1][0],m=+t[1][1];zL(p,h,g,m),qL(p,h,g,m)}this.edges=Hi,this.cells=To,Yl=gf=Hi=To=null}Bg.prototype={constructor:Bg,polygons:function(){var n=this.edges;return this.cells.map(function(t){var e=t.halfedges.map(function(o){return d1(t,n[o])});return e.data=t.site.data,e})},triangles:function(){var n=[],t=this.edges;return this.cells.forEach(function(e,o){if(h=(c=e.halfedges).length)for(var s=e.site,c,p=-1,h,g,m=t[c[h-1]],_=m.left===s?m.right:m.left;++p<h;)g=_,m=t[c[p]],_=m.left===s?m.right:m.left,g&&_&&o<g.index&&o<_.index&&dJ(s,g,_)<0&&n.push([s.data,g.data,_.data])}),n},links:function(){return this.edges.filter(function(n){return n.right}).map(function(n){return{source:n.left.data,target:n.right.data}})},find:function(n,t,e){for(var o=this,s,c=o._found||0,p=o.cells.length,h;!(h=o.cells[c]);)if(++c>=p)return null;var g=n-h.site[0],m=t-h.site[1],_=g*g+m*m;do h=o.cells[s=c],c=null,h.halfedges.forEach(function(w){var x=o.edges[w],b=x.left;if(!((b===h.site||!b)&&!(b=x.right))){var T=n-b[0],I=t-b[1],S=T*T+I*I;S<_&&(_=S,c=b.index)}});while(c!==null);return o._found=s,e==null||_<=e*e?h.site:null}};var SJ=Je(mf(),1);var I1=Je(QL(),1);function Zo(){return new kg}function kg(){this.reset()}kg.prototype={constructor:kg,reset:function(){this.s=this.t=0},add:function(n){tN(Gg,n,this.t),tN(this,Gg.s,this.s),this.s?this.t+=Gg.t:this.s=Gg.t},valueOf:function(){return this.s}};var Gg=new kg;function tN(n,t,e){var o=n.s=t+e,s=o-t,c=o-s;n.t=t-c+(e-s)}var er=1e-6;var gr=Math.PI,Mi=gr/2,qg=gr/4,Oa=gr*2,$l=180/gr,Jo=gr/180,Zr=Math.abs,aa=Math.atan,Ko=Math.atan2,Wn=Math.cos;var Hg=Math.exp;var Lh=Math.log;var an=Math.sin;var no=Math.sqrt,Nh=Math.tan;function v1(n){return n>1?0:n<-1?gr:Math.acos(n)}function Co(n){return n>1?Mi:n<-1?-Mi:Math.asin(n)}function ua(){}var MJ=Zo(),rpt=Zo();function Zl(n){var t=n[0],e=n[1],o=Wn(e);return[o*Wn(t),o*an(t),an(e)]}function Oh(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function Dh(n){var t=no(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}var ppt=Zo();function nN(n,t){return[n>gr?n-Oa:n<-gr?n+Oa:n,t]}nN.invert=nN;function _1(){var n=[],t;return{point:function(e,o){t.push([e,o])},lineStart:function(){n.push(t=[])},lineEnd:ua,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function x1(n,t){return Zr(n[0]-t[0])<er&&Zr(n[1]-t[1])<er}function Vg(n,t,e,o){this.x=n,this.z=t,this.o=e,this.e=o,this.v=!1,this.n=this.p=null}function E1(n,t,e,o,s){var c=[],p=[],h,g;if(n.forEach(function(T){if(!((I=T.length-1)<=0)){var I,S=T[0],E=T[I],R;if(x1(S,E)){for(s.lineStart(),h=0;h<I;++h)s.point((S=T[h])[0],S[1]);s.lineEnd();return}c.push(R=new Vg(S,T,null,!0)),p.push(R.o=new Vg(S,null,R,!1)),c.push(R=new Vg(E,T,null,!1)),p.push(R.o=new Vg(E,null,R,!0))}}),!!c.length){for(p.sort(t),rN(c),rN(p),h=0,g=p.length;h<g;++h)p[h].e=e=!e;for(var m=c[0],_,w;;){for(var x=m,b=!0;x.v;)if((x=x.n)===m)return;_=x.z,s.lineStart();do{if(x.v=x.o.v=!0,x.e){if(b)for(h=0,g=_.length;h<g;++h)s.point((w=_[h])[0],w[1]);else o(x.x,x.n.x,1,s);x=x.n}else{if(b)for(_=x.p.z,h=_.length-1;h>=0;--h)s.point((w=_[h])[0],w[1]);else o(x.x,x.p.x,-1,s);x=x.p}x=x.o,_=x.z,b=!b}while(!x.v);s.lineEnd()}}}function rN(n){if(t=n.length){for(var t,e=0,o=n[0],s;++e<t;)o.n=s=n[e],s.p=o,o=s;o.n=s=n[0],s.p=o}}function sl(n,t){return n<t?-1:n>t?1:n>=t?0:NaN}function w1(n){return n.length===1&&(n=TJ(n)),{left:function(t,e,o,s){for(o==null&&(o=0),s==null&&(s=t.length);o<s;){var c=o+s>>>1;n(t[c],e)<0?o=c+1:s=c}return o},right:function(t,e,o,s){for(o==null&&(o=0),s==null&&(s=t.length);o<s;){var c=o+s>>>1;n(t[c],e)>0?s=c:o=c+1}return o}}}function TJ(n){return function(t,e){return sl(n(t),e)}}var iN=w1(sl),CJ=iN.right,PJ=iN.left;var oN=Array.prototype,RJ=oN.slice,LJ=oN.map;var odt=Math.sqrt(50),sdt=Math.sqrt(10),adt=Math.sqrt(2);function Xg(n){for(var t=n.length,e,o=-1,s=0,c,p;++o<t;)s+=n[o].length;for(c=new Array(s);--t>=0;)for(p=n[t],e=p.length;--e>=0;)c[--s]=p[e];return c}var GJ=1e9,Vgt=-GJ;var S1=Zo();function M1(n,t){var e=t[0],o=t[1],s=[an(e),-Wn(e),0],c=0,p=0;S1.reset();for(var h=0,g=n.length;h<g;++h)if(_=(m=n[h]).length)for(var m,_,w=m[_-1],x=w[0],b=w[1]/2+qg,T=an(b),I=Wn(b),S=0;S<_;++S,x=R,T=F,I=W,w=E){var E=m[S],R=E[0],C=E[1]/2+qg,F=an(C),W=Wn(C),X=R-x,q=X>=0?1:-1,D=q*X,xt=D>gr,B=T*F;if(S1.add(Ko(B*q*an(D),I*W+B*Wn(D))),c+=xt?X+q*Oa:X,xt^x>=e^R>=e){var j=Oh(Zl(w),Zl(E));Dh(j);var J=Oh(s,j);Dh(J);var Dt=(xt^X>=0?-1:1)*Co(J[2]);(o>Dt||o===Dt&&(j[0]||j[1]))&&(p+=xt^X>=0?1:-1)}}return(c<-er||c<er&&S1<-er)^p&1}var tmt=Zo();var _mt=Zo(),xmt=Zo();var HJ=1/0;var Smt=-HJ;function b1(n){this._context=n}b1.prototype={_radius:4.5,pointRadius:function(n){return this._radius=n,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(n,t){switch(this._point){case 0:{this._context.moveTo(n,t),this._point=1;break}case 1:{this._context.lineTo(n,t);break}default:{this._context.moveTo(n+this._radius,t),this._context.arc(n,t,this._radius,0,Oa);break}}},result:ua};var Nmt=Zo();function A1(){this._string=[]}A1.prototype={_radius:4.5,_circle:uN(4.5),pointRadius:function(n){return(n=+n)!==this._radius&&(this._radius=n,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(n,t){switch(this._point){case 0:{this._string.push("M",n,",",t),this._point=1;break}case 1:{this._string.push("L",n,",",t);break}default:{this._circle==null&&(this._circle=uN(this._radius)),this._string.push("M",n,",",t,this._circle);break}}},result:function(){if(this._string.length){var n=this._string.join("");return this._string=[],n}else return null}};function uN(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function T1(n,t,e,o){return function(s,c){var p=t(c),h=s.invert(o[0],o[1]),g=_1(),m=t(g),_=!1,w,x,b,T={point:I,lineStart:E,lineEnd:R,polygonStart:function(){T.point=C,T.lineStart=F,T.lineEnd=W,x=[],w=[]},polygonEnd:function(){T.point=I,T.lineStart=E,T.lineEnd=R,x=Xg(x);var X=M1(w,h);x.length?(_||(c.polygonStart(),_=!0),E1(x,XJ,X,e,c)):X&&(_||(c.polygonStart(),_=!0),c.lineStart(),e(null,null,1,c),c.lineEnd()),_&&(c.polygonEnd(),_=!1),x=w=null},sphere:function(){c.polygonStart(),c.lineStart(),e(null,null,1,c),c.lineEnd(),c.polygonEnd()}};function I(X,q){var D=s(X,q);n(X=D[0],q=D[1])&&c.point(X,q)}function S(X,q){var D=s(X,q);p.point(D[0],D[1])}function E(){T.point=S,p.lineStart()}function R(){T.point=I,p.lineEnd()}function C(X,q){b.push([X,q]);var D=s(X,q);m.point(D[0],D[1])}function F(){m.lineStart(),b=[]}function W(){C(b[0][0],b[0][1]),m.lineEnd();var X=m.clean(),q=g.result(),D,xt=q.length,B,j,J;if(b.pop(),w.push(b),b=null,!!xt){if(X&1){if(j=q[0],(B=j.length-1)>0){for(_||(c.polygonStart(),_=!0),c.lineStart(),D=0;D<B;++D)c.point((J=j[D])[0],J[1]);c.lineEnd()}return}xt>1&&X&2&&q.push(q.pop().concat(q.shift())),x.push(q.filter(WJ))}}return T}}function WJ(n){return n.length>1}function XJ(n,t){return((n=n.x)[0]<0?n[1]-Mi-er:Mi-n[1])-((t=t.x)[0]<0?t[1]-Mi-er:Mi-t[1])}var YJ=T1(function(){return!0},$J,JJ,[-gr,-Mi]);function $J(n){var t=NaN,e=NaN,o=NaN,s;return{lineStart:function(){n.lineStart(),s=1},point:function(c,p){var h=c>0?gr:-gr,g=Zr(c-t);Zr(g-gr)<er?(n.point(t,e=(e+p)/2>0?Mi:-Mi),n.point(o,e),n.lineEnd(),n.lineStart(),n.point(h,e),n.point(c,e),s=0):o!==h&&g>=gr&&(Zr(t-o)<er&&(t-=o*er),Zr(c-h)<er&&(c-=h*er),e=ZJ(t,e,c,p),n.point(o,e),n.lineEnd(),n.lineStart(),n.point(h,e),s=0),n.point(t=c,e=p),o=h},lineEnd:function(){n.lineEnd(),t=e=NaN},clean:function(){return 2-s}}}function ZJ(n,t,e,o){var s,c,p=an(n-e);return Zr(p)>er?aa((an(t)*(c=Wn(o))*an(e)-an(o)*(s=Wn(t))*an(n))/(s*c*p)):(t+o)/2}function JJ(n,t,e,o){var s;if(n==null)s=e*Mi,o.point(-gr,s),o.point(0,s),o.point(gr,s),o.point(gr,0),o.point(gr,-s),o.point(0,-s),o.point(-gr,-s),o.point(-gr,0),o.point(-gr,s);else if(Zr(n[0]-t[0])>er){var c=n[0]<t[0]?gr:-gr;s=e*c/2,o.point(-c,s),o.point(0,s),o.point(c,s)}else o.point(t[0],t[1])}function Yg(n){return function(t){var e=new C1;for(var o in n)e[o]=n[o];return e.stream=t,e}}function C1(){}C1.prototype={constructor:C1,point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var x0t=Wn(30*Jo);var O0t=Yg({point:function(n,t){this.stream.point(n*Jo,t*Jo)}});function $g(n){return function(t,e){var o=Wn(t),s=Wn(e),c=n(o*s);return[c*s*an(t),c*an(e)]}}function Da(n){return function(t,e){var o=no(t*t+e*e),s=n(o),c=an(s),p=Wn(s);return[Ko(t*c,o*p),Co(o&&e*c/o)]}}var gN=$g(function(n){return no(2/(1+n))});gN.invert=Da(function(n){return 2*Co(n/2)});var mN=$g(function(n){return(n=v1(n))&&n/an(n)});mN.invert=Da(function(n){return n});function P1(n,t){return[n,Lh(Nh((Mi+t)/2))]}P1.invert=function(n,t){return[n,2*aa(Hg(t))-Mi]};function Zg(n,t){return[n,t]}Zg.invert=Zg;function yN(n,t){var e=Wn(t),o=Wn(n)*e;return[e*an(n)/o,an(t)/o]}yN.invert=Da(aa);function vN(n,t){var e=t*t,o=e*e;return[n*(.8707-.131979*e+o*(-.013791+o*(.003971*e-.001529*o))),t*(1.007226+e*(.015085+o*(-.044475+.028874*e-.005916*o)))]}vN.invert=function(n,t){var e=t,o=25,s;do{var c=e*e,p=c*c;e-=s=(e*(1.007226+c*(.015085+p*(-.044475+.028874*c-.005916*p)))-t)/(1.007226+c*(.015085*3+p*(-.044475*7+.028874*9*c-.005916*11*p)))}while(Zr(s)>er&&--o>0);return[n/(.8707+(c=e*e)*(-.131979+c*(-.013791+c*c*c*(.003971-.001529*c)))),e]};function _N(n,t){return[Wn(t)*an(n),an(t)]}_N.invert=Da(Co);function xN(n,t){var e=Wn(t),o=1+Wn(n)*e;return[e*an(n)/o,an(t)/o]}xN.invert=Da(function(n){return 2*aa(n)});function EN(n,t){return[Lh(Nh((Mi+t)/2)),-n]}EN.invert=function(n,t){return[-t,2*aa(Hg(n))-Mi]};var nK=Je(mf(),1);var rK=Je(mf(),1);var oK=Je(mf(),1);var sK=Je(mf(),1);function Fa(n,t){return Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2)}function SN(n){let t=0;for(let e=0;e<n.length-1;e++)t+=Fa(n[e],n[e+1]);return t}function MN(n,t,e){let o=new ze(t[0]-n[0],t[1]-n[1]),s=new ze(t[0]-e[0],t[1]-e[1]),p=o.angleTo(s)*180/Math.PI,h=new ze(t[0]-n[0],t[1]-n[1]);return new ze(e[0]-n[0],e[1]-n[1]).cross(h)>0?p:-p}var jo=Je(bN(),1);var Xn="___",Jg=class{isFacilityByType(t){return["facility","escalator","straightLadder","staircase","ramp","connectionPoint"].includes(t)}initFacilities(t){this.facilities=t.map(e=>{let o=[];try{o=JSON.parse(e.entry_end_floor)}catch(c){o=[]}let s=[];try{s=JSON.parse(e.entry_start_floor)}catch(c){s=[]}return Ru({},e,{entry_start_floor:s,entry_end_floor:o})})}getParkingSpaceInfo(t,e){let o=""+t+Xn+e;var s;return(s=this.parkingMap.get(o))!=null?s:null}getNodeInfo(t,e){let o=""+t+Xn+e,s=this.nodeMap.get(o);if(!(s!=null&&s.length))return null;let c=this.pointMap.get(s[0]);return c!=null?c:null}initRoute(t,e){this.clear(),this.roadInfo=t,this.initFacilities(e);let o=new Date,s=o.getHours()*60+o.getMinutes();t.length&&(t.forEach(c=>{let p=(c.points||[]).filter(h=>!(0,jo.isNil)(h.passWeight)&&h.passWeight!==1&&!(0,jo.isNil)(h.coverageArea)&&h.coverageArea!==0);(c.points||[]).filter(h=>h.openStatus!==!1).filter(h=>{if(!h.startTime||!h.endTime)return!0;let[g,m]=h.startTime.split(":").map(T=>+T),[_,w]=h.endTime.split(":").map(T=>+T),x=g*60+m,b=_*60+w;return s>=x&&s<=b}).forEach(h=>{h.floor=c.floor;let g=""+c.floor+Xn+h.id,m=""+c.floor+Xn+h.nodeId,_=this.nodeMap.get(m)||[];if(_.push(""+c.floor+Xn+(h.relatedId||h.id)),this.nodeMap.set(""+c.floor+Xn+h.nodeId,_),this.pointMap.set(g,h),this.isFacilityByType(h.type)){let w=this.facilities.find(x=>x.id===+h.targetId);if(w){switch(w.entry_infra_type){case"straightLadder":if(w.entry_end_floor.find(I=>I.floor===c.floor)&&w.entry_start_floor.find(I=>I.floor===c.floor)){let I=this.straightLadderMap.get(h.targetId)||[];I.push(Ru({},h)),this.straightLadderMap.set(h.targetId,I)}break;case"staircase":if(w.entry_end_floor.find(I=>I.floor===c.floor)&&w.entry_start_floor.find(I=>I.floor===c.floor)){let I=this.staircaseMap.get(h.targetId)||[];I.push(Ru({},h)),this.staircaseMap.set(h.targetId,I)}break;case"escalator":let b=this.escalatorMap.get(h.targetId)||[];if(w.entry_start_floor.find(I=>I.floor===c.floor)){let I=b.find(S=>{var E;return((E=S.end)==null?void 0:E.floor)!==c.floor&&!S.start});I?I.start=h:b.push({start:h})}if(w.entry_end_floor.find(I=>I.floor===c.floor)){let I=b.find(S=>{var E;return((E=S.start)==null?void 0:E.floor)!==c.floor&&!S.end});I?I.end=h:b.push({end:h})}this.escalatorMap.set(h.targetId,b);break;case"ramp":let T=this.rampMap.get(h.targetId)||[];if(w.entry_start_floor.find(I=>I.floor===c.floor)){let I=T.find(S=>{var E;return((E=S.end)==null?void 0:E.floor)!==c.floor&&!S.start});I?I.start=h:T.push({start:h})}if(w.entry_end_floor.find(I=>I.floor===c.floor)){let I=T.find(S=>{var E;return((E=S.start)==null?void 0:E.floor)!==c.floor&&!S.end});I?I.end=h:T.push({end:h})}this.rampMap.set(h.targetId,T);break;case"connectionPoint":if(w.entry_end_floor.find(I=>I.floor===c.floor)&&w.entry_start_floor.find(I=>I.floor===c.floor)){let I=this.connectionPointMap.get(h.targetId)||[];I.push(Ru({},h)),this.connectionPointMap.set(h.targetId,I)}break}let x=this.facilityMap.get(h.targetId)||[];x.push(Ru({},h)),this.facilityMap.set(h.targetId,x)}}h.type==="parkingSpace"&&h.name.split(/[,\uFF0C]/).forEach(x=>{this.parkingMap.set(""+c.floor+Xn+x,h)})}),(c.lines||[]).filter(h=>h.to!==h.from).forEach(h=>{let g=""+c.floor+Xn+h.from,m=""+c.floor+Xn+h.to,_=this.pointMap.get(g),w=this.pointMap.get(m);if(!_||!w)return;let x=_.cds,b=w.cds,T=Fa(x,b);if(p.forEach(I=>{(I.id===h.from||I.id===h.to)&&(T=T/I.passWeight);let S=Fa(x,I.cds)<=I.coverageArea,E=Fa(b,I.cds)<=I.coverageArea;(S||E)&&(T=T/I.passWeight)}),!_.permission&&!w.permission){switch(this.addLineItem(g,m,T),this.addLineItem(m,g,T),h.direction){case"double":this.addLineItem(g,m,T,this.forwardLineMap),this.addLineItem(m,g,T,this.forwardLineMap);break;case"single":this.addLineItem(g,m,T,this.forwardLineMap);break;case"back":this.addLineItem(m,g,T,this.forwardLineMap);break}(_.type==="parkingSpace"||w.type==="parkingSpace")&&h.direction==="noDir"&&(this.addLineItem(g,m,T,this.forwardLineMap),this.addLineItem(m,g,T,this.forwardLineMap))}else _.permission&&(this.setPermissionLine(g,m,_.permission,T,""),this.setPermissionLine(m,g,_.permission,T,"")),w.permission&&w.permission!==_.permission&&(this.setPermissionLine(g,m,w.permission,T,""),this.setPermissionLine(m,g,w.permission,T,""))})}),this.addPermissionFacility(),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute(),this.initForwardRoute())}getPermissionMap(t){return this["permission_"+t]||(this["permission_"+t]=new Set),this["permission_"+t]}setPermissionLine(t,e,o,s,c){this.getPermissionMap(o).add({fromKey:t,toKey:e,distance:s,type:c})}addPermissionFacility(){this.straightLadderMap.forEach((t,e)=>{if(t.length<2){this.straightLadderMap.delete(e);return}for(let o=0;o<t.length;o++){let s=""+t[o].floor+Xn+t[o].id,c=this.pointMap.get(s);if(c){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Xn+t[p].id,g=this.pointMap.get(h);if(!g)continue;c.permission&&this.setPermissionLine(s,h,c.permission,1,"straightLadder"),g.permission&&g.permission!==c.permission&&this.setPermissionLine(s,h,g.permission,1,"straightLadder")}}}}),this.staircaseMap.forEach((t,e)=>{if(t.length<2){this.staircaseMap.delete(e);return}for(let o=0;o<t.length;o++){let s=""+t[o].floor+Xn+t[o].id,c=this.pointMap.get(s);if(c){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Xn+t[p].id,g=this.pointMap.get(h);if(!g)continue;c.permission&&this.setPermissionLine(s,h,c.permission,1,"staircase"),g.permission&&g.permission!==c.permission&&this.setPermissionLine(s,h,g.permission,1,"staircase")}}}}),this.escalatorMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Xn+o.start.id,c=""+o.end.floor+Xn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(c);p&&h&&(p.permission&&this.setPermissionLine(s,c,p.permission,1,"escalator"),h.permission&&h.permission!==p.permission&&this.setPermissionLine(s,c,h.permission,1,"escalator"))}})}),this.rampMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Xn+o.start.id,c=""+o.end.floor+Xn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(c);p&&h&&(p.permission&&this.setPermissionLine(s,c,p.permission,10,"ramp"),h.permission&&h.permission!==p.permission&&this.setPermissionLine(s,c,h.permission,10,"ramp"))}})}),this.connectionPointMap.forEach((t,e)=>{if(t.length<2){this.connectionPointMap.delete(e);return}for(let o=0;o<t.length;o++){let s=""+t[o].floor+Xn+t[o].id,c=this.pointMap.get(s);if(c){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Xn+t[p].id,g=this.pointMap.get(h);if(!g)continue;c.permission&&this.setPermissionLine(s,h,c.permission,1,"connectionPoint"),g.permission&&g.permission!==c.permission&&this.setPermissionLine(s,h,g.permission,1,"connectionPoint")}}}})}addPermissionLineToMap(t,e,o,s){this.getPermissionMap(t).forEach(p=>{e.includes(p.type)&&(p.type===""?this.addLineItem(p.fromKey,p.toKey,p.distance,o):this.addLineItem(p.fromKey,p.toKey,s.get(p.type),o))})}addLineItem(t,e,o,s){s===void 0&&(s=this.lineMap);let c=s.get(t)||new Map;c.set(e,o),s.set(t,c)}addFacilityToLineMap(t,e,o,s){[...this.straightLadderMap,...this.staircaseMap].forEach(c=>{let[p,h]=c;if(!(h.length<2))for(let g=0;g<h.length;g++){let m=""+h[g].floor+Xn+h[g].id,_=this.pointMap.get(m);if(!(!_||_.permission)){for(let w=0;w<h.length;w++)if(g!==w){let x=""+h[w].floor+Xn+h[w].id,b=this.pointMap.get(x);if(!b||b.permission)continue;if(h[g].type==="straightLadder"){let T=e;this.addLineItem(m,x,T,s)}else{let T=o;this.addLineItem(m,x,T,s)}}}}}),this.escalatorMap.forEach((c,p)=>{c.forEach(h=>{if(h.start&&h.end){let g=""+h.start.floor+Xn+h.start.id,m=""+h.end.floor+Xn+h.end.id,_=this.pointMap.get(g),w=this.pointMap.get(m);if(_&&w&&!_.permission&&!w.permission){let x=t;this.addLineItem(g,m,x,s)}}})}),this.connectionPointMap.forEach((c,p)=>{if(!(c.length<2))for(let h=0;h<c.length;h++){let g=""+c[h].floor+Xn+c[h].id,m=this.pointMap.get(g);if(!(!m||m.permission)){for(let _=0;_<c.length;_++)if(h!==_){let w=""+c[_].floor+Xn+c[_].id,x=this.pointMap.get(w);if(!x||x.permission)continue;this.addLineItem(g,w,100,s)}}}})}initBaseRoute(){let t=new Map((0,jo.cloneDeep)([...this.lineMap]));this.addFacilityToLineMap(100,100*this.lift_priority,3e4,t),this.baseRoute=new ro.default(t)}initEscalatorRoute(){let t=new Map((0,jo.cloneDeep)([...this.lineMap])),e=1e4;this.addFacilityToLineMap(1*e,this.lift_priority*e,3e4*e,t),this.escalatorRoute=new ro.default(t)}initStraightLadderRoute(){let t=new Map((0,jo.cloneDeep)([...this.lineMap])),e=1e4;this.addFacilityToLineMap(3*e,1*e,3e4*e,t),this.straightLadderRoute=new ro.default(t)}initForwardRoute(){this.rampMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Xn+o.start.id,c=""+o.end.floor+Xn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(c);p&&h&&!p.permission&&!h.permission&&this.addLineItem(s,c,10,this.forwardLineMap)}})}),this.connectionPointMap.forEach((t,e)=>{if(!(t.length<2))for(let o=0;o<t.length;o++){let s=""+t[o].floor+Xn+t[o].id,c=this.pointMap.get(s);if(!(!c||c.permission)){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Xn+t[p].id,g=this.pointMap.get(h);if(!g||g.permission)continue;this.addLineItem(s,h,100,this.forwardLineMap)}}}}),this.forwardRoute=new ro.default(this.forwardLineMap)}checkStart(t){return!(!t.floor||!t.nodeId&&(!t.coord||t.coord.length<2))}checkEnd(t){return t.facility||t.parkingSpace&&t.floor?!0:this.checkStart(t)}transformStart(t,e,o){o===void 0&&(o={});var s;if(t.nodeId){let c=this.nodeMap.get(""+t.floor+Xn+t.nodeId);if(c!=null&&c.length)return c.map(p=>{let[h,g]=p.split(Xn);return{floor:h,id:g}})}if((s=t.coord)!=null&&s.length){let c=this.roadInfo.find(m=>m.floor===t.floor);if(!c)return null;let p=c.points.filter(m=>m.isStarted),h=c.points.filter(m=>{let _=""+m.floor+Xn+m.id;if(e==="forward"){if(!this.forwardLineMap.has(_)||o.adsorptionIntersection&&p.length&&!m.isStarted)return!1}else if(!this.lineMap.has(_))return!1;return!0});if(!h.length)return null;let g=h.reduce((m,_)=>{if(_.relatedId)return m;let w=Fa(t.coord,_.cds);return w<m.min&&(m.min=w,m.point=_),m},{min:1/0,point:h[0]});return[{floor:c.floor,id:g.point.id}]}return null}transformEnd(t,e){if(t.floor){if(t.parkingSpace){let s=this.parkingMap.get(""+t.floor+Xn+t.parkingSpace);if(s)return[{floor:t.floor,id:s.id}]}let o=this.transformStart(t,e);if(o)return o}if(t.facility){let s=this.facilities.filter(c=>+c.type_id==+t.facility).map(c=>c.id).map(c=>this.facilityMap.get(""+c)).flat(2);if(s!=null&&s.length)return{floor:t.floor,facility:t.facility}}return null}getPath(t,e,o,s,c,p){if(o===void 0&&(o=""),p===void 0&&(p={}),!this.checkStart(t))return"start-error";if(!this.checkEnd(e))return"end-error";let h=this.transformStart(t,o,p);if(!h)return"no-start";let g=this.transformEnd(e,o);if(!g)return"no-end";let m=[];if(Array.isArray(g))for(let x=0;x<h.length;x++){let b=h[x];for(let T=0;T<g.length;T++){let I=g[T];if(b.floor===I.floor&&b.id===I.id)return"near"}}else{m=this.facilities.filter(b=>+b.type_id==+e.facility).map(b=>b.id).map(b=>this.facilityMap.get(""+b)).flat(2).filter(b=>b).filter(b=>g.floor?b.floor===g.floor:!0);for(let b=0;b<h.length;b++){let T=h[b];for(let I=0;I<m.length;I++){let S=m[I];if(T.floor===S.floor&&T.id===S.id)return"near"}}}let _;switch(o){case"escalator":_=this.getEscalatorPath.bind(this);break;case"straightLadder":_=this.getStraightLadderPath.bind(this);break;case"forward":_=this.getForwardPath.bind(this);break;default:_=this.getBasePath.bind(this);break}let w=null;return h.forEach(x=>{if(Array.isArray(g))g.forEach(b=>{let T=_(x,b,s,c);T&&T&&(!w||T[0].consume<w[0].consume)&&(w=T)});else{if(!m.length)return null;let b=m.map(T=>_(x,{floor:T.floor,id:T.id},s,c)).filter(T=>!!T);w=b.reduce((T,I)=>{let S=I[0].consume;return S<T.distance&&(T.distance=S,T.path=I),T},{distance:1/0,path:b[0]}).path}}),w}getRoutePath(t,e,o){let s=""+t.floor+Xn+t.id,c=""+e.floor+Xn+e.id,p=o.path(s,c);if(!p)return null;let h=[],g=p.reduce((m,_,w,x)=>{if(w===0)return 0;let b=x[w-1],T=o.graph.get(b).get(_);return m+T},0);return p.map(m=>{let _=this.pointMap.get(m);if(_){var w;let{floor:x}=_,b=_.type;if(this.isFacilityByType(_.type)){let T=this.facilities.find(I=>I.id===+_.targetId);T&&(b=T.entry_infra_type)}if(((w=h[h.length-1])==null?void 0:w.floor)===x){let T=h[h.length-1];T.points.push(_.cds),T.pointInfos.push(_),T.endType=b,T.destId=_.nodeId,T.distance=SN(T.points)}else h.push({floor:x,points:[_.cds],pointInfos:[_],endType:b,destId:_.nodeId,distance:0,consume:g})}}),h}getBasePath(t,e,o){if(!o)return this.getRoutePath(t,e,this.baseRoute);let s=(0,jo.cloneDeep)(this.baseRoute.graph);this.addPermissionLineToMap(o,["","escalator","staircase","straightLadder","connectionPoint"],s,new Map([["escalator",100],["connectionPoint",100],["straightLadder",100*this.lift_priority],["staircase",3e4]]));let c=new ro.default(s);return this.getRoutePath(t,e,c)}getEscalatorPath(t,e,o){if(!o)return this.getRoutePath(t,e,this.escalatorRoute);let s=(0,jo.cloneDeep)(this.escalatorRoute.graph),c=1e4;this.addPermissionLineToMap(o,["","escalator","staircase","straightLadder","connectionPoint"],s,new Map([["escalator",1*c],["connectionPoint",100],["straightLadder",this.lift_priority*c],["staircase",3e4*c]]));let p=new ro.default(s);return this.getRoutePath(t,e,p)}getStraightLadderPath(t,e,o){if(!o)return this.getRoutePath(t,e,this.straightLadderRoute);let s=(0,jo.cloneDeep)(this.straightLadderRoute.graph),c=1e4;this.addPermissionLineToMap(o,["","escalator","staircase","straightLadder","connectionPoint"],s,new Map([["escalator",3*c],["connectionPoint",100],["straightLadder",1*c],["staircase",3e4*c]]));let p=new ro.default(s);return this.getRoutePath(t,e,p)}getForwardPath(t,e,o,s){let c=new Map,p=x=>{let b=this.forwardRoute.graph.get(g);x.forEach(T=>{let I=b.get(T);(0,jo.isNil)(I)||(c.set(T,I),b.delete(T))})},h=()=>{let x=this.forwardRoute.graph.get(g);c.forEach((b,T)=>{x.set(T,b)})},g=""+t.floor+Xn+t.id;if(!(0,jo.isNil)(s)){let x=this.forwardLineMap.get(g),b=this.pointMap.get(g);if(b&&(x!=null&&x.size)&&x.size>1){let T=new ze(b.cds[0],b.cds[1]),I=new Map;x.forEach((E,R)=>{let C=this.pointMap.get(R);if(C){let F=new ze(C.cds[0],C.cds[1]),X=360-(new ze().subVectors(F,T).angle()/Math.PI*180-90+360)%360;I.set(R,X)}});let S=Array.from(I).filter(E=>{let[R,C]=E;return Math.abs(C-s)<=60}).map(E=>{let[R]=E;return R});if(S.length)S.forEach(E=>I.delete(E)),p([...I.keys()]);else{let E=Array.from(I).reduce((R,C)=>{let F=Math.abs(C[1]-s);return F<R.diff?{diff:F,key:C[0]}:R},{diff:1/0,key:""});I.delete(E.key),p([...I.keys()])}}}if(!o){let x=this.getRoutePath(t,e,this.forwardRoute);return h(),x||this.getRoutePath(t,e,this.forwardRoute)}let m=(0,jo.cloneDeep)(this.forwardRoute.graph);this.addPermissionLineToMap(o,["","ramp"],m,new Map([["ramp",10]]));let _=new ro.default(m),w=this.getRoutePath(t,e,_);if(h(),w)return w;{let x=(0,jo.cloneDeep)(this.forwardRoute.graph);this.addPermissionLineToMap(o,["","ramp"],x,new Map([["ramp",10]]));let b=new ro.default(x);return this.getRoutePath(t,e,b)}}clear(){this.roadInfo=[],this.pointMap.clear(),this.nodeMap.clear(),this.facilityMap.clear(),this.straightLadderMap.clear(),this.escalatorMap.clear(),this.staircaseMap.clear(),this.lineMap.clear(),this.baseRoute=new ro.default,this.escalatorRoute=new ro.default,this.straightLadderRoute=new ro.default}constructor(t=3){this.lift_priority=t,this.roadInfo=[],this.facilities=[],this.pointMap=new Map,this.nodeMap=new Map,this.facilityMap=new Map,this.straightLadderMap=new Map,this.escalatorMap=new Map,this.rampMap=new Map,this.staircaseMap=new Map,this.connectionPointMap=new Map,this.parkingMap=new Map,this.lineMap=new Map,this.baseRoute=new ro.default,this.escalatorRoute=new ro.default,this.straightLadderRoute=new ro.default,this.forwardLineMap=new Map,this.forwardRoute=new ro.default}};var rwt=Je(Gp(),1),iwt=Je(ty(),1);var gK=Je(IN(),1);function mK(n,t,e){let o=MN(n,t,e);return yK(o)}function yK(n){return 180-Math.abs(n)<15?"front":n>135?"right_front":n<-135?"left_front":n<=135&&n>=60?"right":n>=-135&&n<=-60?"left":n<60&&n>0?"right_back":n>-60&&n<0?"left_back":"front"}function RN(n){if(!n.length)return[];if(n.length===1)return[{direction:"start",distance:0,points:n}];let t=[{direction:"start",distance:Fa(n[0],n[1]),points:[n[0],n[1]]}];for(let e=2;e<n.length;e++){let o=mK(n[e-2],n[e-1],n[e]);if(o==="front"){let s=t[t.length-1],c=Fa(n[e-1],n[e]);s.distance+=c,e!==2&&s.points.push(n[e-1])}else t.push({direction:o,distance:Fa(n[e-1],n[e]),points:[n[e-1],n[e]]})}return t.push({direction:"end",distance:0,points:[n[n.length-1]]}),t}var gwt=Je(i2(),1),mwt=Je(Xp(),1);function o2(n){return n.replace(/[A-Z]/g,t=>"_"+t.toLowerCase()).replace(/^_/,"")}function s2(n){let t={};for(let o in n)o.startsWith("on")&&(t[o2(o.slice(2))]=n[o]);let e=o=>pp(this,null,function*(){let{data:s}=o;if(t[s.type])try{let c=yield t[s.type](s.data);if(c!=null&&c.$transfer&&Array.isArray(c.$transfer)){let p=c.$transfer;delete c.$transfer,self.postMessage({type:""+s.type+"_result",key:s.key,data:c},p)}else self.postMessage({type:""+s.type+"_result",key:s.key,data:c})}catch(c){self.postMessage({type:""+s.type+"_result",key:s.key,error:c})}else self.postMessage({type:""+s.type+"_result",key:s.key,error:"no_event"})});return self.addEventListener("message",e),()=>{self.removeEventListener("message",e)}}var B1=new Jg;s2({onSetRoadInfo(n){let{roadData:t,facilities:e}=n;B1.initRoute(t,e)},onGetPath(n){let{start:t,end:e,type:o,permission:s,travelDirection:c,options:p}=n;return B1.getPath(t,e,o,s,c,p)},onGetDirectionPath(n){return RN(n)},onClear(){B1.clear()}});
15646
15646
  `],{type:"text/javascript"}),g=URL.createObjectURL(t),I=new Worker(g);return URL.revokeObjectURL(g),I}var oi=class extends nB.EventDispatcher{loaded(){return new Promise(g=>{if(this.initRoadStatus)g(!0);else{let I=A=>{let{status:C}=A;C&&(this.removeEventListener("init-road-status",I),g(!0))};this.addEventListener("init-road-status",I)}})}setRoadData(g,I){return m(this,null,function*(){this.initRoadStatus=!1,this.dispatchEvent({type:"init-road-status",status:!1}),yield ng(this.worker,"set_road_info",{roadData:g,facilities:I}),this.initRoadStatus=!0,this.dispatchEvent({type:"init-road-status",status:!0})})}getPath(g,I,A,C,e,i){return m(this,null,function*(){return A===void 0&&(A=""),new Promise((n,r)=>{let o=()=>{ng(this.worker,"get_path",{start:g,end:I,type:A,permission:C,travelDirection:e,options:i}).then(s=>{s?typeof s=="string"?r(s):n(s):r("no-path")})};if(this.initRoadStatus)o();else{let s=a=>{let{status:u}=a;u&&(this.removeEventListener("init-road-status",s),o())};this.addEventListener("init-road-status",s)}})})}getDirectionPath(g){return ng(this.worker,"get_direction_path",g)}dispose(){return m(this,null,function*(){ng(this.worker,"clear",""),this.worker.terminate()})}constructor(){super(),this.worker=m0(),this.initRoadStatus=!1}};var rB=require("three");function y0(){let t=new Blob([`var rC=Object.create;var Ey=Object.defineProperty;var iC=Object.getOwnPropertyDescriptor;var oC=Object.getOwnPropertyNames;var sC=Object.getPrototypeOf,aC=Object.prototype.hasOwnProperty;var nt=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports);var uC=(r,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of oC(t))!aC.call(r,a)&&a!==e&&Ey(r,a,{get:()=>t[a],enumerable:!(o=iC(t,a))||o.enumerable});return r};var yn=(r,t,e)=>(e=r!=null?rC(sC(r)):{},uC(t||!r||!r.__esModule?Ey(e,"default",{value:r,enumerable:!0}):e,r));var gc=(r,t,e)=>new Promise((o,a)=>{var l=p=>{try{f(e.next(p))}catch(d){a(d)}},h=p=>{try{f(e.throw(p))}catch(d){a(d)}},f=p=>p.done?o(p.value):Promise.resolve(p.value).then(l,h);f((e=e.apply(r,t)).next())});var Zr=nt((hp,My)=>{"use strict";var hl=function(r){return r&&r.Math===Math&&r};My.exports=hl(typeof globalThis=="object"&&globalThis)||hl(typeof window=="object"&&window)||hl(typeof self=="object"&&self)||hl(typeof global=="object"&&global)||hl(typeof hp=="object"&&hp)||function(){return this}()||Function("return this")()});var Ur=nt((Sq,Sy)=>{"use strict";Sy.exports=function(r){try{return!!r()}catch(t){return!0}}});var ro=nt((wq,wy)=>{"use strict";var lC=Ur();wy.exports=!lC(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var yc=nt((bq,by)=>{"use strict";var cC=Ur();by.exports=!cC(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")})});var Zo=nt((Tq,Ty)=>{"use strict";var fC=yc(),vc=Function.prototype.call;Ty.exports=fC?vc.bind(vc):function(){return vc.apply(vc,arguments)}});var Iy=nt(Py=>{"use strict";var Ay={}.propertyIsEnumerable,Cy=Object.getOwnPropertyDescriptor,hC=Cy&&!Ay.call({1:2},1);Py.f=hC?function(t){var e=Cy(this,t);return!!e&&e.enumerable}:Ay});var _c=nt((Cq,Ry)=>{"use strict";Ry.exports=function(r,t){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:t}}});var li=nt((Pq,Oy)=>{"use strict";var Ly=yc(),Ny=Function.prototype,pp=Ny.call,pC=Ly&&Ny.bind.bind(pp,pp);Oy.exports=Ly?pC:function(r){return function(){return pp.apply(r,arguments)}}});var pl=nt((Iq,Fy)=>{"use strict";var Dy=li(),dC=Dy({}.toString),mC=Dy("".slice);Fy.exports=function(r){return mC(dC(r),8,-1)}});var By=nt((Rq,Uy)=>{"use strict";var gC=li(),yC=Ur(),vC=pl(),dp=Object,_C=gC("".split);Uy.exports=yC(function(){return!dp("z").propertyIsEnumerable(0)})?function(r){return vC(r)==="String"?_C(r,""):dp(r)}:dp});var mp=nt((Lq,zy)=>{"use strict";zy.exports=function(r){return r==null}});var Ya=nt((Nq,Gy)=>{"use strict";var xC=mp(),EC=TypeError;Gy.exports=function(r){if(xC(r))throw new EC("Can't call method on "+r);return r}});var $a=nt((Oq,ky)=>{"use strict";var MC=By(),SC=Ya();ky.exports=function(r){return MC(SC(r))}});var Br=nt((Dq,qy)=>{"use strict";var gp=typeof document=="object"&&document.all;qy.exports=typeof gp=="undefined"&&gp!==void 0?function(r){return typeof r=="function"||r===gp}:function(r){return typeof r=="function"}});var bo=nt((Fq,Vy)=>{"use strict";var wC=Br();Vy.exports=function(r){return typeof r=="object"?r!==null:wC(r)}});var xc=nt((Uq,Hy)=>{"use strict";var yp=Zr(),bC=Br(),TC=function(r){return bC(r)?r:void 0};Hy.exports=function(r,t){return arguments.length<2?TC(yp[r]):yp[r]&&yp[r][t]}});var Xy=nt((Bq,Wy)=>{"use strict";var AC=li();Wy.exports=AC({}.isPrototypeOf)});var Jy=nt((zq,Zy)=>{"use strict";var CC=Zr(),Yy=CC.navigator,$y=Yy&&Yy.userAgent;Zy.exports=$y?String($y):""});var rv=nt((Gq,nv)=>{"use strict";var ev=Zr(),vp=Jy(),Ky=ev.process,jy=ev.Deno,Qy=Ky&&Ky.versions||jy&&jy.version,tv=Qy&&Qy.v8,io,Ec;tv&&(io=tv.split("."),Ec=io[0]>0&&io[0]<4?1:+(io[0]+io[1]));!Ec&&vp&&(io=vp.match(/Edge\\/(\\d+)/),(!io||io[1]>=74)&&(io=vp.match(/Chrome\\/(\\d+)/),io&&(Ec=+io[1])));nv.exports=Ec});var _p=nt((kq,ov)=>{"use strict";var iv=rv(),PC=Ur(),IC=Zr(),RC=IC.String;ov.exports=!!Object.getOwnPropertySymbols&&!PC(function(){var r=Symbol("symbol detection");return!RC(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&iv&&iv<41})});var xp=nt((qq,sv)=>{"use strict";var LC=_p();sv.exports=LC&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Ep=nt((Vq,av)=>{"use strict";var NC=xc(),OC=Br(),DC=Xy(),FC=xp(),UC=Object;av.exports=FC?function(r){return typeof r=="symbol"}:function(r){var t=NC("Symbol");return OC(t)&&DC(t.prototype,UC(r))}});var lv=nt((Hq,uv)=>{"use strict";var BC=String;uv.exports=function(r){try{return BC(r)}catch(t){return"Object"}}});var Mp=nt((Wq,cv)=>{"use strict";var zC=Br(),GC=lv(),kC=TypeError;cv.exports=function(r){if(zC(r))return r;throw new kC(GC(r)+" is not a function")}});var Sp=nt((Xq,fv)=>{"use strict";var qC=Mp(),VC=mp();fv.exports=function(r,t){var e=r[t];return VC(e)?void 0:qC(e)}});var pv=nt((Yq,hv)=>{"use strict";var wp=Zo(),bp=Br(),Tp=bo(),HC=TypeError;hv.exports=function(r,t){var e,o;if(t==="string"&&bp(e=r.toString)&&!Tp(o=wp(e,r))||bp(e=r.valueOf)&&!Tp(o=wp(e,r))||t!=="string"&&bp(e=r.toString)&&!Tp(o=wp(e,r)))return o;throw new HC("Can't convert object to primitive value")}});var dl=nt(($q,dv)=>{"use strict";dv.exports=!1});var Mc=nt((Zq,gv)=>{"use strict";var mv=Zr(),WC=Object.defineProperty;gv.exports=function(r,t){try{WC(mv,r,{value:t,configurable:!0,writable:!0})}catch(e){mv[r]=t}return t}});var Sc=nt((Jq,_v)=>{"use strict";var XC=dl(),YC=Zr(),$C=Mc(),yv="__core-js_shared__",vv=_v.exports=YC[yv]||$C(yv,{});(vv.versions||(vv.versions=[])).push({version:"3.42.0",mode:XC?"pure":"global",copyright:"\\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var wc=nt((Kq,Ev)=>{"use strict";var xv=Sc();Ev.exports=function(r,t){return xv[r]||(xv[r]=t||{})}});var ml=nt((jq,Mv)=>{"use strict";var ZC=Ya(),JC=Object;Mv.exports=function(r){return JC(ZC(r))}});var To=nt((Qq,Sv)=>{"use strict";var KC=li(),jC=ml(),QC=KC({}.hasOwnProperty);Sv.exports=Object.hasOwn||function(t,e){return QC(jC(t),e)}});var Ap=nt((tV,wv)=>{"use strict";var tP=li(),eP=0,nP=Math.random(),rP=tP(1 .toString);wv.exports=function(r){return"Symbol("+(r===void 0?"":r)+")_"+rP(++eP+nP,36)}});var oo=nt((eV,Tv)=>{"use strict";var iP=Zr(),oP=wc(),bv=To(),sP=Ap(),aP=_p(),uP=xp(),Za=iP.Symbol,Cp=oP("wks"),lP=uP?Za.for||Za:Za&&Za.withoutSetter||sP;Tv.exports=function(r){return bv(Cp,r)||(Cp[r]=aP&&bv(Za,r)?Za[r]:lP("Symbol."+r)),Cp[r]}});var Iv=nt((nV,Pv)=>{"use strict";var cP=Zo(),Av=bo(),Cv=Ep(),fP=Sp(),hP=pv(),pP=oo(),dP=TypeError,mP=pP("toPrimitive");Pv.exports=function(r,t){if(!Av(r)||Cv(r))return r;var e=fP(r,mP),o;if(e){if(t===void 0&&(t="default"),o=cP(e,r,t),!Av(o)||Cv(o))return o;throw new dP("Can't convert object to primitive value")}return t===void 0&&(t="number"),hP(r,t)}});var Pp=nt((rV,Rv)=>{"use strict";var gP=Iv(),yP=Ep();Rv.exports=function(r){var t=gP(r,"string");return yP(t)?t:t+""}});var bc=nt((iV,Nv)=>{"use strict";var vP=Zr(),Lv=bo(),Ip=vP.document,_P=Lv(Ip)&&Lv(Ip.createElement);Nv.exports=function(r){return _P?Ip.createElement(r):{}}});var Rp=nt((oV,Ov)=>{"use strict";var xP=ro(),EP=Ur(),MP=bc();Ov.exports=!xP&&!EP(function(){return Object.defineProperty(MP("div"),"a",{get:function(){return 7}}).a!==7})});var Lp=nt(Fv=>{"use strict";var SP=ro(),wP=Zo(),bP=Iy(),TP=_c(),AP=$a(),CP=Pp(),PP=To(),IP=Rp(),Dv=Object.getOwnPropertyDescriptor;Fv.f=SP?Dv:function(t,e){if(t=AP(t),e=CP(e),IP)try{return Dv(t,e)}catch(o){}if(PP(t,e))return TP(!wP(bP.f,t,e),t[e])}});var Np=nt((aV,Uv)=>{"use strict";var RP=ro(),LP=Ur();Uv.exports=RP&&LP(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var _s=nt((uV,Bv)=>{"use strict";var NP=bo(),OP=String,DP=TypeError;Bv.exports=function(r){if(NP(r))return r;throw new DP(OP(r)+" is not an object")}});var xs=nt(Gv=>{"use strict";var FP=ro(),UP=Rp(),BP=Np(),Tc=_s(),zv=Pp(),zP=TypeError,Op=Object.defineProperty,GP=Object.getOwnPropertyDescriptor,Dp="enumerable",Fp="configurable",Up="writable";Gv.f=FP?BP?function(t,e,o){if(Tc(t),e=zv(e),Tc(o),typeof t=="function"&&e==="prototype"&&"value"in o&&Up in o&&!o[Up]){var a=GP(t,e);a&&a[Up]&&(t[e]=o.value,o={configurable:Fp in o?o[Fp]:a[Fp],enumerable:Dp in o?o[Dp]:a[Dp],writable:!1})}return Op(t,e,o)}:Op:function(t,e,o){if(Tc(t),e=zv(e),Tc(o),UP)try{return Op(t,e,o)}catch(a){}if("get"in o||"set"in o)throw new zP("Accessors not supported");return"value"in o&&(t[e]=o.value),t}});var Ja=nt((cV,kv)=>{"use strict";var kP=ro(),qP=xs(),VP=_c();kv.exports=kP?function(r,t,e){return qP.f(r,t,VP(1,e))}:function(r,t,e){return r[t]=e,r}});var Gp=nt((fV,Vv)=>{"use strict";var Bp=ro(),HP=To(),qv=Function.prototype,WP=Bp&&Object.getOwnPropertyDescriptor,zp=HP(qv,"name"),XP=zp&&function(){}.name==="something",YP=zp&&(!Bp||Bp&&WP(qv,"name").configurable);Vv.exports={EXISTS:zp,PROPER:XP,CONFIGURABLE:YP}});var Wv=nt((hV,Hv)=>{"use strict";var $P=li(),ZP=Br(),kp=Sc(),JP=$P(Function.toString);ZP(kp.inspectSource)||(kp.inspectSource=function(r){return JP(r)});Hv.exports=kp.inspectSource});var $v=nt((pV,Yv)=>{"use strict";var KP=Zr(),jP=Br(),Xv=KP.WeakMap;Yv.exports=jP(Xv)&&/native code/.test(String(Xv))});var Ac=nt((dV,Jv)=>{"use strict";var QP=wc(),tI=Ap(),Zv=QP("keys");Jv.exports=function(r){return Zv[r]||(Zv[r]=tI(r))}});var Cc=nt((mV,Kv)=>{"use strict";Kv.exports={}});var Rc=nt((gV,t_)=>{"use strict";var eI=$v(),Qv=Zr(),nI=bo(),rI=Ja(),qp=To(),Vp=Sc(),iI=Ac(),oI=Cc(),jv="Object already initialized",Hp=Qv.TypeError,sI=Qv.WeakMap,Pc,gl,Ic,aI=function(r){return Ic(r)?gl(r):Pc(r,{})},uI=function(r){return function(t){var e;if(!nI(t)||(e=gl(t)).type!==r)throw new Hp("Incompatible receiver, "+r+" required");return e}};eI||Vp.state?(so=Vp.state||(Vp.state=new sI),so.get=so.get,so.has=so.has,so.set=so.set,Pc=function(r,t){if(so.has(r))throw new Hp(jv);return t.facade=r,so.set(r,t),t},gl=function(r){return so.get(r)||{}},Ic=function(r){return so.has(r)}):(oa=iI("state"),oI[oa]=!0,Pc=function(r,t){if(qp(r,oa))throw new Hp(jv);return t.facade=r,rI(r,oa,t),t},gl=function(r){return qp(r,oa)?r[oa]:{}},Ic=function(r){return qp(r,oa)});var so,oa;t_.exports={set:Pc,get:gl,has:Ic,enforce:aI,getterFor:uI}});var i_=nt((yV,r_)=>{"use strict";var Xp=li(),lI=Ur(),cI=Br(),Lc=To(),Wp=ro(),fI=Gp().CONFIGURABLE,hI=Wv(),n_=Rc(),pI=n_.enforce,dI=n_.get,e_=String,Nc=Object.defineProperty,mI=Xp("".slice),gI=Xp("".replace),yI=Xp([].join),vI=Wp&&!lI(function(){return Nc(function(){},"length",{value:8}).length!==8}),_I=String(String).split("String"),xI=r_.exports=function(r,t,e){mI(e_(t),0,7)==="Symbol("&&(t="["+gI(e_(t),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!Lc(r,"name")||fI&&r.name!==t)&&(Wp?Nc(r,"name",{value:t,configurable:!0}):r.name=t),vI&&e&&Lc(e,"arity")&&r.length!==e.arity&&Nc(r,"length",{value:e.arity});try{e&&Lc(e,"constructor")&&e.constructor?Wp&&Nc(r,"prototype",{writable:!1}):r.prototype&&(r.prototype=void 0)}catch(a){}var o=pI(r);return Lc(o,"source")||(o.source=yI(_I,typeof t=="string"?t:"")),r};Function.prototype.toString=xI(function(){return cI(this)&&dI(this).source||hI(this)},"toString")});var yl=nt((vV,o_)=>{"use strict";var EI=Br(),MI=xs(),SI=i_(),wI=Mc();o_.exports=function(r,t,e,o){o||(o={});var a=o.enumerable,l=o.name!==void 0?o.name:t;if(EI(e)&&SI(e,l,o),o.global)a?r[t]=e:wI(t,e);else{try{o.unsafe?r[t]&&(a=!0):delete r[t]}catch(h){}a?r[t]=e:MI.f(r,t,{value:e,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return r}});var a_=nt((_V,s_)=>{"use strict";var bI=Math.ceil,TI=Math.floor;s_.exports=Math.trunc||function(t){var e=+t;return(e>0?TI:bI)(e)}});var vl=nt((xV,u_)=>{"use strict";var AI=a_();u_.exports=function(r){var t=+r;return t!==t||t===0?0:AI(t)}});var c_=nt((EV,l_)=>{"use strict";var CI=vl(),PI=Math.max,II=Math.min;l_.exports=function(r,t){var e=CI(r);return e<0?PI(e+t,0):II(e,t)}});var Yp=nt((MV,f_)=>{"use strict";var RI=vl(),LI=Math.min;f_.exports=function(r){var t=RI(r);return t>0?LI(t,9007199254740991):0}});var $p=nt((SV,h_)=>{"use strict";var NI=Yp();h_.exports=function(r){return NI(r.length)}});var m_=nt((wV,d_)=>{"use strict";var OI=$a(),DI=c_(),FI=$p(),p_=function(r){return function(t,e,o){var a=OI(t),l=FI(a);if(l===0)return!r&&-1;var h=DI(o,l),f;if(r&&e!==e){for(;l>h;)if(f=a[h++],f!==f)return!0}else for(;l>h;h++)if((r||h in a)&&a[h]===e)return r||h||0;return!r&&-1}};d_.exports={includes:p_(!0),indexOf:p_(!1)}});var Jp=nt((bV,y_)=>{"use strict";var UI=li(),Zp=To(),BI=$a(),zI=m_().indexOf,GI=Cc(),g_=UI([].push);y_.exports=function(r,t){var e=BI(r),o=0,a=[],l;for(l in e)!Zp(GI,l)&&Zp(e,l)&&g_(a,l);for(;t.length>o;)Zp(e,l=t[o++])&&(~zI(a,l)||g_(a,l));return a}});var Oc=nt((TV,v_)=>{"use strict";v_.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var x_=nt(__=>{"use strict";var kI=Jp(),qI=Oc(),VI=qI.concat("length","prototype");__.f=Object.getOwnPropertyNames||function(t){return kI(t,VI)}});var M_=nt(E_=>{"use strict";E_.f=Object.getOwnPropertySymbols});var w_=nt((PV,S_)=>{"use strict";var HI=xc(),WI=li(),XI=x_(),YI=M_(),$I=_s(),ZI=WI([].concat);S_.exports=HI("Reflect","ownKeys")||function(t){var e=XI.f($I(t)),o=YI.f;return o?ZI(e,o(t)):e}});var A_=nt((IV,T_)=>{"use strict";var b_=To(),JI=w_(),KI=Lp(),jI=xs();T_.exports=function(r,t,e){for(var o=JI(t),a=jI.f,l=KI.f,h=0;h<o.length;h++){var f=o[h];!b_(r,f)&&!(e&&b_(e,f))&&a(r,f,l(t,f))}}});var P_=nt((RV,C_)=>{"use strict";var QI=Ur(),tR=Br(),eR=/#|\\.prototype\\./,_l=function(r,t){var e=rR[nR(r)];return e===oR?!0:e===iR?!1:tR(t)?QI(t):!!t},nR=_l.normalize=function(r){return String(r).replace(eR,".").toLowerCase()},rR=_l.data={},iR=_l.NATIVE="N",oR=_l.POLYFILL="P";C_.exports=_l});var Fc=nt((LV,I_)=>{"use strict";var Dc=Zr(),sR=Lp().f,aR=Ja(),uR=yl(),lR=Mc(),cR=A_(),fR=P_();I_.exports=function(r,t){var e=r.target,o=r.global,a=r.stat,l,h,f,p,d,g;if(o?h=Dc:a?h=Dc[e]||lR(e,{}):h=Dc[e]&&Dc[e].prototype,h)for(f in t){if(d=t[f],r.dontCallGetSet?(g=sR(h,f),p=g&&g.value):p=h[f],l=fR(o?f:e+(a?".":"#")+f,r.forced),!l&&p!==void 0){if(typeof d==typeof p)continue;cR(d,p)}(r.sham||p&&p.sham)&&aR(d,"sham",!0),uR(h,f,d,r)}}});var L_=nt((NV,R_)=>{"use strict";var hR=pl();R_.exports=Array.isArray||function(t){return hR(t)==="Array"}});var O_=nt((OV,N_)=>{"use strict";var pR=ro(),dR=L_(),mR=TypeError,gR=Object.getOwnPropertyDescriptor,yR=pR&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(r){return r instanceof TypeError}}();N_.exports=yR?function(r,t){if(dR(r)&&!gR(r,"length").writable)throw new mR("Cannot set read only .length");return r.length=t}:function(r,t){return r.length=t}});var F_=nt((DV,D_)=>{"use strict";var vR=TypeError,_R=9007199254740991;D_.exports=function(r){if(r>_R)throw vR("Maximum allowed index exceeded");return r}});var Kp=nt(()=>{"use strict";var xR=Fc(),ER=ml(),MR=$p(),SR=O_(),wR=F_(),bR=Ur(),TR=bR(function(){return[].push.call({length:4294967296},1)!==4294967297}),AR=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(r){return r instanceof TypeError}},CR=TR||!AR();xR({target:"Array",proto:!0,arity:1,forced:CR},{push:function(t){var e=ER(this),o=MR(e),a=arguments.length;wR(o+a);for(var l=0;l<a;l++)e[o]=arguments[l],o++;return SR(e,o),o}})});var B_=nt((BV,U_)=>{"use strict";U_.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}});var k_=nt((zV,G_)=>{"use strict";var PR=bc(),jp=PR("span").classList,z_=jp&&jp.constructor&&jp.constructor.prototype;G_.exports=z_===Object.prototype?void 0:z_});var V_=nt((GV,q_)=>{"use strict";var IR=Jp(),RR=Oc();q_.exports=Object.keys||function(t){return IR(t,RR)}});var W_=nt(H_=>{"use strict";var LR=ro(),NR=Np(),OR=xs(),DR=_s(),FR=$a(),UR=V_();H_.f=LR&&!NR?Object.defineProperties:function(t,e){DR(t);for(var o=FR(e),a=UR(e),l=a.length,h=0,f;l>h;)OR.f(t,f=a[h++],o[f]);return t}});var Y_=nt((qV,X_)=>{"use strict";var BR=xc();X_.exports=BR("document","documentElement")});var xl=nt((VV,tx)=>{"use strict";var zR=_s(),GR=W_(),$_=Oc(),kR=Cc(),qR=Y_(),VR=bc(),HR=Ac(),Z_=">",J_="<",td="prototype",ed="script",j_=HR("IE_PROTO"),Qp=function(){},Q_=function(r){return J_+ed+Z_+r+J_+"/"+ed+Z_},K_=function(r){r.write(Q_("")),r.close();var t=r.parentWindow.Object;return r=null,t},WR=function(){var r=VR("iframe"),t="java"+ed+":",e;return r.style.display="none",qR.appendChild(r),r.src=String(t),e=r.contentWindow.document,e.open(),e.write(Q_("document.F=Object")),e.close(),e.F},Uc,Bc=function(){try{Uc=new ActiveXObject("htmlfile")}catch(t){}Bc=typeof document!="undefined"?document.domain&&Uc?K_(Uc):WR():K_(Uc);for(var r=$_.length;r--;)delete Bc[td][$_[r]];return Bc()};kR[j_]=!0;tx.exports=Object.create||function(t,e){var o;return t!==null?(Qp[td]=zR(t),o=new Qp,Qp[td]=null,o[j_]=t):o=Bc(),e===void 0?o:GR.f(o,e)}});var nx=nt((HV,ex)=>{"use strict";var XR=oo(),YR=xl(),$R=xs().f,nd=XR("unscopables"),rd=Array.prototype;rd[nd]===void 0&&$R(rd,nd,{configurable:!0,value:YR(null)});ex.exports=function(r){rd[nd][r]=!0}});var zc=nt((WV,rx)=>{"use strict";rx.exports={}});var ox=nt((XV,ix)=>{"use strict";var ZR=Ur();ix.exports=!ZR(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype})});var od=nt((YV,ax)=>{"use strict";var JR=To(),KR=Br(),jR=ml(),QR=Ac(),tL=ox(),sx=QR("IE_PROTO"),id=Object,eL=id.prototype;ax.exports=tL?id.getPrototypeOf:function(r){var t=jR(r);if(JR(t,sx))return t[sx];var e=t.constructor;return KR(e)&&t instanceof e?e.prototype:t instanceof id?eL:null}});var ld=nt(($V,cx)=>{"use strict";var nL=Ur(),rL=Br(),iL=bo(),oL=xl(),ux=od(),sL=yl(),aL=oo(),uL=dl(),ud=aL("iterator"),lx=!1,Jo,sd,ad;[].keys&&(ad=[].keys(),"next"in ad?(sd=ux(ux(ad)),sd!==Object.prototype&&(Jo=sd)):lx=!0);var lL=!iL(Jo)||nL(function(){var r={};return Jo[ud].call(r)!==r});lL?Jo={}:uL&&(Jo=oL(Jo));rL(Jo[ud])||sL(Jo,ud,function(){return this});cx.exports={IteratorPrototype:Jo,BUGGY_SAFARI_ITERATORS:lx}});var Gc=nt((ZV,hx)=>{"use strict";var cL=xs().f,fL=To(),hL=oo(),fx=hL("toStringTag");hx.exports=function(r,t,e){r&&!e&&(r=r.prototype),r&&!fL(r,fx)&&cL(r,fx,{configurable:!0,value:t})}});var dx=nt((JV,px)=>{"use strict";var pL=ld().IteratorPrototype,dL=xl(),mL=_c(),gL=Gc(),yL=zc(),vL=function(){return this};px.exports=function(r,t,e,o){var a=t+" Iterator";return r.prototype=dL(pL,{next:mL(+!o,e)}),gL(r,a,!1,!0),yL[a]=vL,r}});var gx=nt((KV,mx)=>{"use strict";var _L=li(),xL=Mp();mx.exports=function(r,t,e){try{return _L(xL(Object.getOwnPropertyDescriptor(r,t)[e]))}catch(o){}}});var vx=nt((jV,yx)=>{"use strict";var EL=bo();yx.exports=function(r){return EL(r)||r===null}});var xx=nt((QV,_x)=>{"use strict";var ML=vx(),SL=String,wL=TypeError;_x.exports=function(r){if(ML(r))return r;throw new wL("Can't set "+SL(r)+" as a prototype")}});var Mx=nt((tH,Ex)=>{"use strict";var bL=gx(),TL=bo(),AL=Ya(),CL=xx();Ex.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r=!1,t={},e;try{e=bL(Object.prototype,"__proto__","set"),e(t,[]),r=t instanceof Array}catch(o){}return function(a,l){return AL(a),CL(l),TL(a)&&(r?e(a,l):a.__proto__=l),a}}():void 0)});var Nx=nt((eH,Lx)=>{"use strict";var PL=Fc(),IL=Zo(),kc=dl(),Ix=Gp(),RL=Br(),LL=dx(),Sx=od(),wx=Mx(),NL=Gc(),OL=Ja(),cd=yl(),DL=oo(),bx=zc(),Rx=ld(),FL=Ix.PROPER,UL=Ix.CONFIGURABLE,Tx=Rx.IteratorPrototype,qc=Rx.BUGGY_SAFARI_ITERATORS,El=DL("iterator"),Ax="keys",Ml="values",Cx="entries",Px=function(){return this};Lx.exports=function(r,t,e,o,a,l,h){LL(e,t,o);var f=function(y){if(y===a&&v)return v;if(!qc&&y&&y in g)return g[y];switch(y){case Ax:return function(){return new e(this,y)};case Ml:return function(){return new e(this,y)};case Cx:return function(){return new e(this,y)}}return function(){return new e(this)}},p=t+" Iterator",d=!1,g=r.prototype,x=g[El]||g["@@iterator"]||a&&g[a],v=!qc&&x||f(a),M=t==="Array"&&g.entries||x,b,T,_;if(M&&(b=Sx(M.call(new r)),b!==Object.prototype&&b.next&&(!kc&&Sx(b)!==Tx&&(wx?wx(b,Tx):RL(b[El])||cd(b,El,Px)),NL(b,p,!0,!0),kc&&(bx[p]=Px))),FL&&a===Ml&&x&&x.name!==Ml&&(!kc&&UL?OL(g,"name",Ml):(d=!0,v=function(){return IL(x,this)})),a)if(T={values:f(Ml),keys:l?v:f(Ax),entries:f(Cx)},h)for(_ in T)(qc||d||!(_ in g))&&cd(g,_,T[_]);else PL({target:t,proto:!0,forced:qc||d},T);return(!kc||h)&&g[El]!==v&&cd(g,El,v,{name:a}),bx[t]=v,T}});var Dx=nt((nH,Ox)=>{"use strict";Ox.exports=function(r,t){return{value:r,done:t}}});var kx=nt((rH,Gx)=>{"use strict";var BL=$a(),fd=nx(),Fx=zc(),Bx=Rc(),zL=xs().f,GL=Nx(),Vc=Dx(),kL=dl(),qL=ro(),zx="Array Iterator",VL=Bx.set,HL=Bx.getterFor(zx);Gx.exports=GL(Array,"Array",function(r,t){VL(this,{type:zx,target:BL(r),index:0,kind:t})},function(){var r=HL(this),t=r.target,e=r.index++;if(!t||e>=t.length)return r.target=null,Vc(void 0,!0);switch(r.kind){case"keys":return Vc(e,!1);case"values":return Vc(t[e],!1)}return Vc([e,t[e]],!1)},"values");var Ux=Fx.Arguments=Fx.Array;fd("keys");fd("values");fd("entries");if(!kL&&qL&&Ux.name!=="values")try{zL(Ux,"name",{value:"values"})}catch(r){}});var Wc=nt(()=>{"use strict";var qx=Zr(),Hx=B_(),WL=k_(),Sl=kx(),Vx=Ja(),XL=Gc(),YL=oo(),hd=YL("iterator"),pd=Sl.values,Wx=function(r,t){if(r){if(r[hd]!==pd)try{Vx(r,hd,pd)}catch(o){r[hd]=pd}if(XL(r,t,!0),Hx[t]){for(var e in Sl)if(r[e]!==Sl[e])try{Vx(r,e,Sl[e])}catch(o){r[e]=Sl[e]}}}};for(Hc in Hx)Wx(qx[Hc]&&qx[Hc].prototype,Hc);var Hc;Wx(WL,"DOMTokenList")});var $x=nt((sH,Yx)=>{"use strict";var $L=oo(),ZL=$L("toStringTag"),Xx={};Xx[ZL]="z";Yx.exports=String(Xx)==="[object z]"});var Jx=nt((aH,Zx)=>{"use strict";var JL=$x(),KL=Br(),Xc=pl(),jL=oo(),QL=jL("toStringTag"),tN=Object,eN=Xc(function(){return arguments}())==="Arguments",nN=function(r,t){try{return r[t]}catch(e){}};Zx.exports=JL?Xc:function(r){var t,e,o;return r===void 0?"Undefined":r===null?"Null":typeof(e=nN(t=tN(r),QL))=="string"?e:eN?Xc(t):(o=Xc(t))==="Object"&&KL(t.callee)?"Arguments":o}});var Yc=nt((uH,Kx)=>{"use strict";var rN=Jx(),iN=String;Kx.exports=function(r){if(rN(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return iN(r)}});var Qx=nt((lH,jx)=>{"use strict";var oN=_s();jx.exports=function(){var r=oN(this),t="";return r.hasIndices&&(t+="d"),r.global&&(t+="g"),r.ignoreCase&&(t+="i"),r.multiline&&(t+="m"),r.dotAll&&(t+="s"),r.unicode&&(t+="u"),r.unicodeSets&&(t+="v"),r.sticky&&(t+="y"),t}});var e1=nt((cH,t1)=>{"use strict";var dd=Ur(),sN=Zr(),md=sN.RegExp,gd=dd(function(){var r=md("a","y");return r.lastIndex=2,r.exec("abcd")!==null}),aN=gd||dd(function(){return!md("a","y").sticky}),uN=gd||dd(function(){var r=md("^r","gy");return r.lastIndex=2,r.exec("str")!==null});t1.exports={BROKEN_CARET:uN,MISSED_STICKY:aN,UNSUPPORTED_Y:gd}});var r1=nt((fH,n1)=>{"use strict";var lN=Ur(),cN=Zr(),fN=cN.RegExp;n1.exports=lN(function(){var r=fN(".","s");return!(r.dotAll&&r.test(\`
15647
15647
  \`)&&r.flags==="s")})});var o1=nt((hH,i1)=>{"use strict";var hN=Ur(),pN=Zr(),dN=pN.RegExp;i1.exports=hN(function(){var r=dN("(?<a>b)","g");return r.exec("b").groups.a!=="b"||"b".replace(r,"$<a>c")!=="bc"})});var Jc=nt((pH,a1)=>{"use strict";var Ka=Zo(),Zc=li(),mN=Yc(),gN=Qx(),yN=e1(),vN=wc(),_N=xl(),xN=Rc().get,EN=r1(),MN=o1(),SN=vN("native-string-replace",String.prototype.replace),$c=RegExp.prototype.exec,vd=$c,wN=Zc("".charAt),bN=Zc("".indexOf),TN=Zc("".replace),yd=Zc("".slice),_d=function(){var r=/a/,t=/b*/g;return Ka($c,r,"a"),Ka($c,t,"a"),r.lastIndex!==0||t.lastIndex!==0}(),s1=yN.BROKEN_CARET,xd=/()??/.exec("")[1]!==void 0,AN=_d||xd||s1||EN||MN;AN&&(vd=function(t){var e=this,o=xN(e),a=mN(t),l=o.raw,h,f,p,d,g,x,v;if(l)return l.lastIndex=e.lastIndex,h=Ka(vd,l,a),e.lastIndex=l.lastIndex,h;var M=o.groups,b=s1&&e.sticky,T=Ka(gN,e),_=e.source,y=0,A=a;if(b&&(T=TN(T,"y",""),bN(T,"g")===-1&&(T+="g"),A=yd(a,e.lastIndex),e.lastIndex>0&&(!e.multiline||e.multiline&&wN(a,e.lastIndex-1)!==\`
15648
15648
  \`)&&(_="(?: "+_+")",A=" "+A,y++),f=new RegExp("^(?:"+_+")",T)),xd&&(f=new RegExp("^"+_+"$(?!\\\\s)",T)),_d&&(p=e.lastIndex),d=Ka($c,b?f:e,A),b?d?(d.input=yd(d.input,y),d[0]=yd(d[0],y),d.index=e.lastIndex,e.lastIndex+=d[0].length):e.lastIndex=0:_d&&d&&(e.lastIndex=e.global?d.index+d[0].length:p),xd&&d&&d.length>1&&Ka(SN,d[0],f,function(){for(g=1;g<arguments.length-2;g++)arguments[g]===void 0&&(d[g]=void 0)}),d&&M)for(d.groups=x=_N(null),g=0;g<M.length;g++)v=M[g],x[v[0]]=d[v[1]];return d});a1.exports=vd});var Kc=nt(()=>{"use strict";var CN=Fc(),u1=Jc();CN({target:"RegExp",proto:!0,forced:/./.exec!==u1},{exec:u1})});var c1=nt((gH,l1)=>{var Ed=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((t,e)=>t.priority-e.priority)}set(t,e){let o=Number(e);if(isNaN(o))throw new TypeError('"priority" must be a number');return this.keys.has(t)?this.queue.map(a=>(a.key===t&&Object.assign(a,{priority:o}),a)):(this.keys.add(t),this.queue.push({key:t,priority:o})),this.sort(),this.queue.length}next(){let t=this.queue.shift();return this.keys.delete(t.key),t}isEmpty(){return this.queue.length===0}has(t){return this.keys.has(t)}get(t){return this.queue.find(e=>e.key===t)}};l1.exports=Ed});var p1=nt((yH,h1)=>{function f1(r,t){let e=new Map;for(let[o,a]of r)o!==t&&a instanceof Map?e.set(o,f1(a,t)):o!==t&&e.set(o,a);return e}h1.exports=f1});var g1=nt((vH,m1)=>{function PN(r){let t=Number(r);return!(isNaN(t)||t<=0)}function d1(r){let t=new Map;return Object.keys(r).forEach(o=>{let a=r[o];if(a!==null&&typeof a=="object"&&!Array.isArray(a))return t.set(o,d1(a));if(!PN(a))throw new Error(\`Could not add node at key "\${o}", make sure it's a valid node\`,a);return t.set(o,Number(a))}),t}m1.exports=d1});var _1=nt((_H,v1)=>{function y1(r){if(!(r instanceof Map))throw new Error(\`Invalid graph: Expected Map instead found \${typeof r}\`);r.forEach((t,e)=>{if(typeof t=="object"&&t instanceof Map){y1(t);return}if(typeof t!="number"||t<=0)throw new Error(\`Values must be numbers greater than 0. Found value \${t} at \${e}\`)})}v1.exports=y1});var S1=nt((xH,M1)=>{var IN=c1(),RN=p1(),x1=g1(),E1=_1(),Md=class{constructor(t){t instanceof Map?(E1(t),this.graph=t):t?this.graph=x1(t):this.graph=new Map}addNode(t,e){let o;return e instanceof Map?(E1(e),o=e):o=x1(e),this.graph.set(t,o),this}addVertex(t,e){return this.addNode(t,e)}removeNode(t){return this.graph=RN(this.graph,t),this}path(t,e,o={}){if(!this.graph.size)return o.cost?{path:null,cost:0}:null;let a=new Set,l=new IN,h=new Map,f=[],p=0,d=[];if(o.avoid&&(d=[].concat(o.avoid)),d.includes(t))throw new Error(\`Starting node (\${t}) cannot be avoided\`);if(d.includes(e))throw new Error(\`Ending node (\${e}) cannot be avoided\`);for(l.set(t,0);!l.isEmpty();){let g=l.next();if(g.key===e){p=g.priority;let v=g.key;for(;h.has(v);)f.push(v),v=h.get(v);break}a.add(g.key),(this.graph.get(g.key)||new Map).forEach((v,M)=>{if(a.has(M)||d.includes(M))return null;if(!l.has(M))return h.set(M,g.key),l.set(M,g.priority+v);let b=l.get(M).priority,T=g.priority+v;return T<b?(h.set(M,g.key),l.set(M,T)):null})}return f.length?(o.trim?f.shift():f=f.concat([t]),o.reverse||(f=f.reverse()),o.cost?{path:f,cost:p}:f):o.cost?{path:null,cost:0}:null}shortestPath(...t){return this.path(...t)}};M1.exports=Md});var Zf=nt((LH,_M)=>{"use strict";var vM=Object.getOwnPropertySymbols,VU=Object.prototype.hasOwnProperty,HU=Object.prototype.propertyIsEnumerable;function WU(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function XU(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var t={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;var o=Object.getOwnPropertyNames(t).map(function(l){return t[l]});if(o.join("")!=="0123456789")return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach(function(l){a[l]=l}),Object.keys(Object.assign({},a)).join("")==="abcdefghijklmnopqrst"}catch(l){return!1}}_M.exports=XU()?Object.assign:function(r,t){for(var e,o=WU(r),a,l=1;l<arguments.length;l++){e=Object(arguments[l]);for(var h in e)VU.call(e,h)&&(o[h]=e[h]);if(vM){a=vM(e);for(var f=0;f<a.length;f++)HU.call(e,a[f])&&(o[a[f]]=e[a[f]])}}return o}});var ng=nt((tg,eg)=>{(function(r,t){typeof tg=="object"&&typeof eg!="undefined"?eg.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self).RBush=t()})(tg,function(){"use strict";function r(_,y,A,S,L){(function G(z,F,I,ut,R){for(;ut>I;){if(ut-I>600){var W=ut-I+1,V=F-I+1,Mt=Math.log(W),X=.5*Math.exp(2*Mt/3),mt=.5*Math.sqrt(Mt*X*(W-X)/W)*(V-W/2<0?-1:1),dt=Math.max(I,Math.floor(F-V*X/W+mt)),_t=Math.min(ut,Math.floor(F+(W-V)*X/W+mt));G(z,F,dt,_t,R)}var it=z[F],lt=I,H=ut;for(t(z,I,F),R(z[ut],it)>0&&t(z,I,ut);lt<H;){for(t(z,lt,H),lt++,H--;R(z[lt],it)<0;)lt++;for(;R(z[H],it)>0;)H--}R(z[I],it)===0?t(z,I,H):t(z,++H,ut),H<=F&&(I=H+1),F<=H&&(ut=H-1)}})(_,y,A||0,S||_.length-1,L||e)}function t(_,y,A){var S=_[y];_[y]=_[A],_[A]=S}function e(_,y){return _<y?-1:_>y?1:0}var o=function(_){_===void 0&&(_=9),this._maxEntries=Math.max(4,_),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(_,y,A){if(!A)return y.indexOf(_);for(var S=0;S<y.length;S++)if(A(_,y[S]))return S;return-1}function l(_,y){h(_,0,_.children.length,y,_)}function h(_,y,A,S,L){L||(L=b(null)),L.minX=1/0,L.minY=1/0,L.maxX=-1/0,L.maxY=-1/0;for(var G=y;G<A;G++){var z=_.children[G];f(L,_.leaf?S(z):z)}return L}function f(_,y){return _.minX=Math.min(_.minX,y.minX),_.minY=Math.min(_.minY,y.minY),_.maxX=Math.max(_.maxX,y.maxX),_.maxY=Math.max(_.maxY,y.maxY),_}function p(_,y){return _.minX-y.minX}function d(_,y){return _.minY-y.minY}function g(_){return(_.maxX-_.minX)*(_.maxY-_.minY)}function x(_){return _.maxX-_.minX+(_.maxY-_.minY)}function v(_,y){return _.minX<=y.minX&&_.minY<=y.minY&&y.maxX<=_.maxX&&y.maxY<=_.maxY}function M(_,y){return y.minX<=_.maxX&&y.minY<=_.maxY&&y.maxX>=_.minX&&y.maxY>=_.minY}function b(_){return{children:_,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function T(_,y,A,S,L){for(var G=[y,A];G.length;)if(!((A=G.pop())-(y=G.pop())<=S)){var z=y+Math.ceil((A-y)/S/2)*S;r(_,z,y,A,L),G.push(y,z,z,A)}}return o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(_){var y=this.data,A=[];if(!M(_,y))return A;for(var S=this.toBBox,L=[];y;){for(var G=0;G<y.children.length;G++){var z=y.children[G],F=y.leaf?S(z):z;M(_,F)&&(y.leaf?A.push(z):v(_,F)?this._all(z,A):L.push(z))}y=L.pop()}return A},o.prototype.collides=function(_){var y=this.data;if(!M(_,y))return!1;for(var A=[];y;){for(var S=0;S<y.children.length;S++){var L=y.children[S],G=y.leaf?this.toBBox(L):L;if(M(_,G)){if(y.leaf||v(_,G))return!0;A.push(L)}}y=A.pop()}return!1},o.prototype.load=function(_){if(!_||!_.length)return this;if(_.length<this._minEntries){for(var y=0;y<_.length;y++)this.insert(_[y]);return this}var A=this._build(_.slice(),0,_.length-1,0);if(this.data.children.length)if(this.data.height===A.height)this._splitRoot(this.data,A);else{if(this.data.height<A.height){var S=this.data;this.data=A,A=S}this._insert(A,this.data.height-A.height-1,!0)}else this.data=A;return this},o.prototype.insert=function(_){return _&&this._insert(_,this.data.height-1),this},o.prototype.clear=function(){return this.data=b([]),this},o.prototype.remove=function(_,y){if(!_)return this;for(var A,S,L,G=this.data,z=this.toBBox(_),F=[],I=[];G||F.length;){if(G||(G=F.pop(),S=F[F.length-1],A=I.pop(),L=!0),G.leaf){var ut=a(_,G.children,y);if(ut!==-1)return G.children.splice(ut,1),F.push(G),this._condense(F),this}L||G.leaf||!v(G,z)?S?(A++,G=S.children[A],L=!1):G=null:(F.push(G),I.push(A),A=0,S=G,G=G.children[0])}return this},o.prototype.toBBox=function(_){return _},o.prototype.compareMinX=function(_,y){return _.minX-y.minX},o.prototype.compareMinY=function(_,y){return _.minY-y.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(_){return this.data=_,this},o.prototype._all=function(_,y){for(var A=[];_;)_.leaf?y.push.apply(y,_.children):A.push.apply(A,_.children),_=A.pop();return y},o.prototype._build=function(_,y,A,S){var L,G=A-y+1,z=this._maxEntries;if(G<=z)return l(L=b(_.slice(y,A+1)),this.toBBox),L;S||(S=Math.ceil(Math.log(G)/Math.log(z)),z=Math.ceil(G/Math.pow(z,S-1))),(L=b([])).leaf=!1,L.height=S;var F=Math.ceil(G/z),I=F*Math.ceil(Math.sqrt(z));T(_,y,A,I,this.compareMinX);for(var ut=y;ut<=A;ut+=I){var R=Math.min(ut+I-1,A);T(_,ut,R,F,this.compareMinY);for(var W=ut;W<=R;W+=F){var V=Math.min(W+F-1,R);L.children.push(this._build(_,W,V,S-1))}}return l(L,this.toBBox),L},o.prototype._chooseSubtree=function(_,y,A,S){for(;S.push(y),!y.leaf&&S.length-1!==A;){for(var L=1/0,G=1/0,z=void 0,F=0;F<y.children.length;F++){var I=y.children[F],ut=g(I),R=(W=_,V=I,(Math.max(V.maxX,W.maxX)-Math.min(V.minX,W.minX))*(Math.max(V.maxY,W.maxY)-Math.min(V.minY,W.minY))-ut);R<G?(G=R,L=ut<L?ut:L,z=I):R===G&&ut<L&&(L=ut,z=I)}y=z||y.children[0]}var W,V;return y},o.prototype._insert=function(_,y,A){var S=A?_:this.toBBox(_),L=[],G=this._chooseSubtree(S,this.data,y,L);for(G.children.push(_),f(G,S);y>=0&&L[y].children.length>this._maxEntries;)this._split(L,y),y--;this._adjustParentBBoxes(S,L,y)},o.prototype._split=function(_,y){var A=_[y],S=A.children.length,L=this._minEntries;this._chooseSplitAxis(A,L,S);var G=this._chooseSplitIndex(A,L,S),z=b(A.children.splice(G,A.children.length-G));z.height=A.height,z.leaf=A.leaf,l(A,this.toBBox),l(z,this.toBBox),y?_[y-1].children.push(z):this._splitRoot(A,z)},o.prototype._splitRoot=function(_,y){this.data=b([_,y]),this.data.height=_.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(_,y,A){for(var S,L,G,z,F,I,ut,R=1/0,W=1/0,V=y;V<=A-y;V++){var Mt=h(_,0,V,this.toBBox),X=h(_,V,A,this.toBBox),mt=(L=Mt,G=X,z=void 0,F=void 0,I=void 0,ut=void 0,z=Math.max(L.minX,G.minX),F=Math.max(L.minY,G.minY),I=Math.min(L.maxX,G.maxX),ut=Math.min(L.maxY,G.maxY),Math.max(0,I-z)*Math.max(0,ut-F)),dt=g(Mt)+g(X);mt<R?(R=mt,S=V,W=dt<W?dt:W):mt===R&&dt<W&&(W=dt,S=V)}return S||A-y},o.prototype._chooseSplitAxis=function(_,y,A){var S=_.leaf?this.compareMinX:p,L=_.leaf?this.compareMinY:d;this._allDistMargin(_,y,A,S)<this._allDistMargin(_,y,A,L)&&_.children.sort(S)},o.prototype._allDistMargin=function(_,y,A,S){_.children.sort(S);for(var L=this.toBBox,G=h(_,0,y,L),z=h(_,A-y,A,L),F=x(G)+x(z),I=y;I<A-y;I++){var ut=_.children[I];f(G,_.leaf?L(ut):ut),F+=x(G)}for(var R=A-y-1;R>=y;R--){var W=_.children[R];f(z,_.leaf?L(W):W),F+=x(z)}return F},o.prototype._adjustParentBBoxes=function(_,y,A){for(var S=A;S>=0;S--)f(y[S],_)},o.prototype._condense=function(_){for(var y=_.length-1,A=void 0;y>=0;y--)_[y].children.length===0?y>0?(A=_[y-1].children).splice(A.indexOf(_[y]),1):this.clear():l(_[y],this.toBBox)},o})});var xM=nt((rg,ig)=>{(function(r,t){typeof rg=="object"&&typeof ig!="undefined"?ig.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self,r.TinyQueue=t())})(rg,function(){"use strict";var r=function(o,a){if(o===void 0&&(o=[]),a===void 0&&(a=t),this.data=o,this.length=this.data.length,this.compare=a,this.length>0)for(var l=(this.length>>1)-1;l>=0;l--)this._down(l)};r.prototype.push=function(o){this.data.push(o),this.length++,this._up(this.length-1)},r.prototype.pop=function(){if(this.length!==0){var o=this.data[0],a=this.data.pop();return this.length--,this.length>0&&(this.data[0]=a,this._down(0)),o}},r.prototype.peek=function(){return this.data[0]},r.prototype._up=function(o){for(var a=this,l=a.data,h=a.compare,f=l[o];o>0;){var p=o-1>>1,d=l[p];if(h(f,d)>=0)break;l[o]=d,o=p}l[o]=f},r.prototype._down=function(o){for(var a=this,l=a.data,h=a.compare,f=this.length>>1,p=l[o];o<f;){var d=(o<<1)+1,g=l[d],x=d+1;if(x<this.length&&h(l[x],g)<0&&(d=x,g=l[x]),h(g,p)>=0)break;l[o]=g,o=d}l[o]=p};function t(e,o){return e<o?-1:e>o?1:0}return r})});var MM=nt((BH,EM)=>{EM.exports=function(t,e,o,a){var l=t[0],h=t[1],f=!1;o===void 0&&(o=0),a===void 0&&(a=e.length);for(var p=(a-o)/2,d=0,g=p-1;d<p;g=d++){var x=e[o+d*2+0],v=e[o+d*2+1],M=e[o+g*2+0],b=e[o+g*2+1],T=v>h!=b>h&&l<(M-x)*(h-v)/(b-v)+x;T&&(f=!f)}return f}});var wM=nt((zH,SM)=>{SM.exports=function(t,e,o,a){var l=t[0],h=t[1],f=!1;o===void 0&&(o=0),a===void 0&&(a=e.length);for(var p=a-o,d=0,g=p-1;d<p;g=d++){var x=e[d+o][0],v=e[d+o][1],M=e[g+o][0],b=e[g+o][1],T=v>h!=b>h&&l<(M-x)*(h-v)/(b-v)+x;T&&(f=!f)}return f}});var AM=nt((GH,jf)=>{var bM=MM(),TM=wM();jf.exports=function(t,e,o,a){return e.length>0&&Array.isArray(e[0])?TM(t,e,o,a):bM(t,e,o,a)};jf.exports.nested=TM;jf.exports.flat=bM});var PM=nt((Qf,CM)=>{(function(r,t){typeof Qf=="object"&&typeof CM!="undefined"?t(Qf):typeof define=="function"&&define.amd?define(["exports"],t):t((r=r||self).predicates={})})(Qf,function(r){"use strict";let e=33306690738754706e-32;function o(M,b,T,_,y){let A,S,L,G,z=b[0],F=_[0],I=0,ut=0;F>z==F>-z?(A=z,z=b[++I]):(A=F,F=_[++ut]);let R=0;if(I<M&&ut<T)for(F>z==F>-z?(L=A-((S=z+A)-z),z=b[++I]):(L=A-((S=F+A)-F),F=_[++ut]),A=S,L!==0&&(y[R++]=L);I<M&&ut<T;)F>z==F>-z?(L=A-((S=A+z)-(G=S-A))+(z-G),z=b[++I]):(L=A-((S=A+F)-(G=S-A))+(F-G),F=_[++ut]),A=S,L!==0&&(y[R++]=L);for(;I<M;)L=A-((S=A+z)-(G=S-A))+(z-G),z=b[++I],A=S,L!==0&&(y[R++]=L);for(;ut<T;)L=A-((S=A+F)-(G=S-A))+(F-G),F=_[++ut],A=S,L!==0&&(y[R++]=L);return A===0&&R!==0||(y[R++]=A),R}function a(M){return new Float64Array(M)}let l=33306690738754716e-32,h=22204460492503146e-32,f=11093356479670487e-47,p=a(4),d=a(8),g=a(12),x=a(16),v=a(4);r.orient2d=function(M,b,T,_,y,A){let S=(b-A)*(T-y),L=(M-y)*(_-A),G=S-L;if(S===0||L===0||S>0!=L>0)return G;let z=Math.abs(S+L);return Math.abs(G)>=l*z?G:-function(F,I,ut,R,W,V,Mt){let X,mt,dt,_t,it,lt,H,bt,Tt,Yt,tt,wt,Bt,$t,Ut,Dt,At,te,rt=F-W,an=ut-W,zt=I-V,ne=R-V;it=(Ut=(bt=rt-(H=(lt=134217729*rt)-(lt-rt)))*(Yt=ne-(Tt=(lt=134217729*ne)-(lt-ne)))-(($t=rt*ne)-H*Tt-bt*Tt-H*Yt))-(tt=Ut-(At=(bt=zt-(H=(lt=134217729*zt)-(lt-zt)))*(Yt=an-(Tt=(lt=134217729*an)-(lt-an)))-((Dt=zt*an)-H*Tt-bt*Tt-H*Yt))),p[0]=Ut-(tt+it)+(it-At),it=(Bt=$t-((wt=$t+tt)-(it=wt-$t))+(tt-it))-(tt=Bt-Dt),p[1]=Bt-(tt+it)+(it-Dt),it=(te=wt+tt)-wt,p[2]=wt-(te-it)+(tt-it),p[3]=te;let Wt=function(Y,N){let xt=N[0];for(let Et=1;Et<Y;Et++)xt+=N[Et];return xt}(4,p),ie=h*Mt;if(Wt>=ie||-Wt>=ie||(X=F-(rt+(it=F-rt))+(it-W),dt=ut-(an+(it=ut-an))+(it-W),mt=I-(zt+(it=I-zt))+(it-V),_t=R-(ne+(it=R-ne))+(it-V),X===0&&mt===0&&dt===0&&_t===0)||(ie=f*Mt+e*Math.abs(Wt),(Wt+=rt*_t+ne*X-(zt*dt+an*mt))>=ie||-Wt>=ie))return Wt;it=(Ut=(bt=X-(H=(lt=134217729*X)-(lt-X)))*(Yt=ne-(Tt=(lt=134217729*ne)-(lt-ne)))-(($t=X*ne)-H*Tt-bt*Tt-H*Yt))-(tt=Ut-(At=(bt=mt-(H=(lt=134217729*mt)-(lt-mt)))*(Yt=an-(Tt=(lt=134217729*an)-(lt-an)))-((Dt=mt*an)-H*Tt-bt*Tt-H*Yt))),v[0]=Ut-(tt+it)+(it-At),it=(Bt=$t-((wt=$t+tt)-(it=wt-$t))+(tt-it))-(tt=Bt-Dt),v[1]=Bt-(tt+it)+(it-Dt),it=(te=wt+tt)-wt,v[2]=wt-(te-it)+(tt-it),v[3]=te;let ce=o(4,p,4,v,d);it=(Ut=(bt=rt-(H=(lt=134217729*rt)-(lt-rt)))*(Yt=_t-(Tt=(lt=134217729*_t)-(lt-_t)))-(($t=rt*_t)-H*Tt-bt*Tt-H*Yt))-(tt=Ut-(At=(bt=zt-(H=(lt=134217729*zt)-(lt-zt)))*(Yt=dt-(Tt=(lt=134217729*dt)-(lt-dt)))-((Dt=zt*dt)-H*Tt-bt*Tt-H*Yt))),v[0]=Ut-(tt+it)+(it-At),it=(Bt=$t-((wt=$t+tt)-(it=wt-$t))+(tt-it))-(tt=Bt-Dt),v[1]=Bt-(tt+it)+(it-Dt),it=(te=wt+tt)-wt,v[2]=wt-(te-it)+(tt-it),v[3]=te;let Lt=o(ce,d,4,v,g);it=(Ut=(bt=X-(H=(lt=134217729*X)-(lt-X)))*(Yt=_t-(Tt=(lt=134217729*_t)-(lt-_t)))-(($t=X*_t)-H*Tt-bt*Tt-H*Yt))-(tt=Ut-(At=(bt=mt-(H=(lt=134217729*mt)-(lt-mt)))*(Yt=dt-(Tt=(lt=134217729*dt)-(lt-dt)))-((Dt=mt*dt)-H*Tt-bt*Tt-H*Yt))),v[0]=Ut-(tt+it)+(it-At),it=(Bt=$t-((wt=$t+tt)-(it=wt-$t))+(tt-it))-(tt=Bt-Dt),v[1]=Bt-(tt+it)+(it-Dt),it=(te=wt+tt)-wt,v[2]=wt-(te-it)+(tt-it),v[3]=te;let se=o(Lt,g,4,v,x);return x[se-1]}(M,b,T,_,y,A,z)},r.orient2dfast=function(M,b,T,_,y,A){return(b-A)*(T-y)-(M-y)*(_-A)},Object.defineProperty(r,"__esModule",{value:!0})})});var DM=nt((kH,ug)=>{"use strict";var IM=ng(),eh=xM(),$U=AM(),ZU=PM().orient2d;eh.default&&(eh=eh.default);ug.exports=OM;ug.exports.default=OM;function OM(r,t,e){t=Math.max(0,t===void 0?2:t),e=e||0;var o=tB(r),a=new IM(16);a.toBBox=function(A){return{minX:A[0],minY:A[1],maxX:A[0],maxY:A[1]}},a.compareMinX=function(A,S){return A[0]-S[0]},a.compareMinY=function(A,S){return A[1]-S[1]},a.load(r);for(var l=[],h=0,f;h<o.length;h++){var p=o[h];a.remove(p),f=NM(p,f),l.push(f)}var d=new IM(16);for(h=0;h<l.length;h++)d.insert(og(l[h]));for(var g=t*t,x=e*e;l.length;){var v=l.shift(),M=v.p,b=v.next.p,T=sg(M,b);if(!(T<x)){var _=T/g;p=JU(a,v.prev.p,M,b,v.next.next.p,_,d),p&&Math.min(sg(p,M),sg(p,b))<=_&&(l.push(v),l.push(NM(p,v)),a.remove(p),d.remove(v),d.insert(og(v)),d.insert(og(v.next)))}}v=f;var y=[];do y.push(v.p),v=v.next;while(v!==f);return y.push(v.p),y}function JU(r,t,e,o,a,l,h){for(var f=new eh([],KU),p=r.data;p;){for(var d=0;d<p.children.length;d++){var g=p.children[d],x=p.leaf?ag(g,e,o):jU(e,o,g);x>l||f.push({node:g,dist:x})}for(;f.length&&!f.peek().node.children;){var v=f.pop(),M=v.node,b=ag(M,t,e),T=ag(M,o,a);if(v.dist<b&&v.dist<T&&LM(e,M,h)&&LM(o,M,h))return M}p=f.pop(),p&&(p=p.node)}return null}function KU(r,t){return r.dist-t.dist}function jU(r,t,e){if(RM(r,e)||RM(t,e))return 0;var o=th(r[0],r[1],t[0],t[1],e.minX,e.minY,e.maxX,e.minY);if(o===0)return 0;var a=th(r[0],r[1],t[0],t[1],e.minX,e.minY,e.minX,e.maxY);if(a===0)return 0;var l=th(r[0],r[1],t[0],t[1],e.maxX,e.minY,e.maxX,e.maxY);if(l===0)return 0;var h=th(r[0],r[1],t[0],t[1],e.minX,e.maxY,e.maxX,e.maxY);return h===0?0:Math.min(o,a,l,h)}function RM(r,t){return r[0]>=t.minX&&r[0]<=t.maxX&&r[1]>=t.minY&&r[1]<=t.maxY}function LM(r,t,e){for(var o=Math.min(r[0],t[0]),a=Math.min(r[1],t[1]),l=Math.max(r[0],t[0]),h=Math.max(r[1],t[1]),f=e.search({minX:o,minY:a,maxX:l,maxY:h}),p=0;p<f.length;p++)if(QU(f[p].p,f[p].next.p,r,t))return!1;return!0}function Pu(r,t,e){return ZU(r[0],r[1],t[0],t[1],e[0],e[1])}function QU(r,t,e,o){return r!==o&&t!==e&&Pu(r,t,e)>0!=Pu(r,t,o)>0&&Pu(e,o,r)>0!=Pu(e,o,t)>0}function og(r){var t=r.p,e=r.next.p;return r.minX=Math.min(t[0],e[0]),r.minY=Math.min(t[1],e[1]),r.maxX=Math.max(t[0],e[0]),r.maxY=Math.max(t[1],e[1]),r}function tB(r){for(var t=r[0],e=r[0],o=r[0],a=r[0],l=0;l<r.length;l++){var h=r[l];h[0]<t[0]&&(t=h),h[0]>o[0]&&(o=h),h[1]<e[1]&&(e=h),h[1]>a[1]&&(a=h)}var f=[t,e,o,a],p=f.slice();for(l=0;l<r.length;l++)$U(r[l],f)||p.push(r[l]);return nB(p)}function NM(r,t){var e={p:r,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(e.next=t.next,e.prev=t,t.next.prev=e,t.next=e):(e.prev=e,e.next=e),e}function sg(r,t){var e=r[0]-t[0],o=r[1]-t[1];return e*e+o*o}function ag(r,t,e){var o=t[0],a=t[1],l=e[0]-o,h=e[1]-a;if(l!==0||h!==0){var f=((r[0]-o)*l+(r[1]-a)*h)/(l*l+h*h);f>1?(o=e[0],a=e[1]):f>0&&(o+=l*f,a+=h*f)}return l=r[0]-o,h=r[1]-a,l*l+h*h}function th(r,t,e,o,a,l,h,f){var p=e-r,d=o-t,g=h-a,x=f-l,v=r-a,M=t-l,b=p*p+d*d,T=p*g+d*x,_=g*g+x*x,y=p*v+d*M,A=g*v+x*M,S=b*_-T*T,L,G,z,F,I=S,ut=S;S===0?(G=0,I=1,F=A,ut=_):(G=T*A-_*y,F=b*A-T*y,G<0?(G=0,F=A,ut=_):G>I&&(G=I,F=A+T,ut=_)),F<0?(F=0,-y<0?G=0:-y>b?G=I:(G=-y,I=b)):F>ut&&(F=ut,-y+T<0?G=0:-y+T>b?G=I:(G=-y+T,I=b)),L=G===0?0:G/I,z=F===0?0:F/ut;var R=(1-L)*r+L*e,W=(1-L)*t+L*o,V=(1-z)*a+z*h,Mt=(1-z)*l+z*f,X=V-R,mt=Mt-W;return X*X+mt*mt}function eB(r,t){return r[0]===t[0]?r[1]-t[1]:r[0]-t[0]}function nB(r){r.sort(eB);for(var t=[],e=0;e<r.length;e++){for(;t.length>=2&&Pu(t[t.length-2],t[t.length-1],r[e])<=0;)t.pop();t.push(r[e])}for(var o=[],a=r.length-1;a>=0;a--){for(;o.length>=2&&Pu(o[o.length-2],o[o.length-1],r[a])<=0;)o.pop();o.push(r[a])}return o.pop(),t.pop(),t.concat(o)}});var kM=nt((cg,fg)=>{(function(r,t){typeof cg=="object"&&typeof fg!="undefined"?fg.exports=t():typeof define=="function"&&define.amd?define(t):r.quickselect=t()})(cg,function(){"use strict";function r(a,l,h,f,p){t(a,l,h||0,f||a.length-1,p||o)}function t(a,l,h,f,p){for(;f>h;){if(f-h>600){var d=f-h+1,g=l-h+1,x=Math.log(d),v=.5*Math.exp(2*x/3),M=.5*Math.sqrt(x*v*(d-v)/d)*(g-d/2<0?-1:1),b=Math.max(h,Math.floor(l-g*v/d+M)),T=Math.min(f,Math.floor(l+(d-g)*v/d+M));t(a,l,b,T,p)}var _=a[l],y=h,A=f;for(e(a,h,l),p(a[f],_)>0&&e(a,h,f);y<A;){for(e(a,y,A),y++,A--;p(a[y],_)<0;)y++;for(;p(a[A],_)>0;)A--}p(a[h],_)===0?e(a,h,A):(A++,e(a,A,f)),A<=l&&(h=A+1),l<=A&&(f=A-1)}}function e(a,l,h){var f=a[l];a[l]=a[h],a[h]=f}function o(a,l){return a<l?-1:a>l?1:0}return r})});var mg=nt((pW,dg)=>{"use strict";dg.exports=zl;dg.exports.default=zl;var mB=kM();function zl(r,t){if(!(this instanceof zl))return new zl(r,t);this._maxEntries=Math.max(4,r||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),t&&this._initFormat(t),this.clear()}zl.prototype={all:function(){return this._all(this.data,[])},search:function(r){var t=this.data,e=[],o=this.toBBox;if(!rh(r,t))return e;for(var a=[],l,h,f,p;t;){for(l=0,h=t.children.length;l<h;l++)f=t.children[l],p=t.leaf?o(f):f,rh(r,p)&&(t.leaf?e.push(f):pg(r,p)?this._all(f,e):a.push(f));t=a.pop()}return e},collides:function(r){var t=this.data,e=this.toBBox;if(!rh(r,t))return!1;for(var o=[],a,l,h,f;t;){for(a=0,l=t.children.length;a<l;a++)if(h=t.children[a],f=t.leaf?e(h):h,rh(r,f)){if(t.leaf||pg(r,f))return!0;o.push(h)}t=o.pop()}return!1},load:function(r){if(!(r&&r.length))return this;if(r.length<this._minEntries){for(var t=0,e=r.length;t<e;t++)this.insert(r[t]);return this}var o=this._build(r.slice(),0,r.length-1,0);if(!this.data.children.length)this.data=o;else if(this.data.height===o.height)this._splitRoot(this.data,o);else{if(this.data.height<o.height){var a=this.data;this.data=o,o=a}this._insert(o,this.data.height-o.height-1,!0)}return this},insert:function(r){return r&&this._insert(r,this.data.height-1),this},clear:function(){return this.data=Lu([]),this},remove:function(r,t){if(!r)return this;for(var e=this.data,o=this.toBBox(r),a=[],l=[],h,f,p,d;e||a.length;){if(e||(e=a.pop(),f=a[a.length-1],h=l.pop(),d=!0),e.leaf&&(p=gB(r,e.children,t),p!==-1))return e.children.splice(p,1),a.push(e),this._condense(a),this;!d&&!e.leaf&&pg(e,o)?(a.push(e),l.push(h),h=0,f=e,e=e.children[0]):f?(h++,e=f.children[h],d=!1):e=null}return this},toBBox:function(r){return r},compareMinX:qM,compareMinY:VM,toJSON:function(){return this.data},fromJSON:function(r){return this.data=r,this},_all:function(r,t){for(var e=[];r;)r.leaf?t.push.apply(t,r.children):e.push.apply(e,r.children),r=e.pop();return t},_build:function(r,t,e,o){var a=e-t+1,l=this._maxEntries,h;if(a<=l)return h=Lu(r.slice(t,e+1)),Ru(h,this.toBBox),h;o||(o=Math.ceil(Math.log(a)/Math.log(l)),l=Math.ceil(a/Math.pow(l,o-1))),h=Lu([]),h.leaf=!1,h.height=o;var f=Math.ceil(a/l),p=f*Math.ceil(Math.sqrt(l)),d,g,x,v;for(HM(r,t,e,p,this.compareMinX),d=t;d<=e;d+=p)for(x=Math.min(d+p-1,e),HM(r,d,x,f,this.compareMinY),g=d;g<=x;g+=f)v=Math.min(g+f-1,x),h.children.push(this._build(r,g,v,o-1));return Ru(h,this.toBBox),h},_chooseSubtree:function(r,t,e,o){for(var a,l,h,f,p,d,g,x;o.push(t),!(t.leaf||o.length-1===e);){for(g=x=1/0,a=0,l=t.children.length;a<l;a++)h=t.children[a],p=hg(h),d=yB(r,h)-p,d<x?(x=d,g=p<g?p:g,f=h):d===x&&p<g&&(g=p,f=h);t=f||t.children[0]}return t},_insert:function(r,t,e){var o=this.toBBox,a=e?r:o(r),l=[],h=this._chooseSubtree(a,this.data,t,l);for(h.children.push(r),Bl(h,a);t>=0&&l[t].children.length>this._maxEntries;)this._split(l,t),t--;this._adjustParentBBoxes(a,l,t)},_split:function(r,t){var e=r[t],o=e.children.length,a=this._minEntries;this._chooseSplitAxis(e,a,o);var l=this._chooseSplitIndex(e,a,o),h=Lu(e.children.splice(l,e.children.length-l));h.height=e.height,h.leaf=e.leaf,Ru(e,this.toBBox),Ru(h,this.toBBox),t?r[t-1].children.push(h):this._splitRoot(e,h)},_splitRoot:function(r,t){this.data=Lu([r,t]),this.data.height=r.height+1,this.data.leaf=!1,Ru(this.data,this.toBBox)},_chooseSplitIndex:function(r,t,e){var o,a,l,h,f,p,d,g;for(p=d=1/0,o=t;o<=e-t;o++)a=Ul(r,0,o,this.toBBox),l=Ul(r,o,e,this.toBBox),h=vB(a,l),f=hg(a)+hg(l),h<p?(p=h,g=o,d=f<d?f:d):h===p&&f<d&&(d=f,g=o);return g},_chooseSplitAxis:function(r,t,e){var o=r.leaf?this.compareMinX:qM,a=r.leaf?this.compareMinY:VM,l=this._allDistMargin(r,t,e,o),h=this._allDistMargin(r,t,e,a);l<h&&r.children.sort(o)},_allDistMargin:function(r,t,e,o){r.children.sort(o);var a=this.toBBox,l=Ul(r,0,t,a),h=Ul(r,e-t,e,a),f=nh(l)+nh(h),p,d;for(p=t;p<e-t;p++)d=r.children[p],Bl(l,r.leaf?a(d):d),f+=nh(l);for(p=e-t-1;p>=t;p--)d=r.children[p],Bl(h,r.leaf?a(d):d),f+=nh(h);return f},_adjustParentBBoxes:function(r,t,e){for(var o=e;o>=0;o--)Bl(t[o],r)},_condense:function(r){for(var t=r.length-1,e;t>=0;t--)r[t].children.length===0?t>0?(e=r[t-1].children,e.splice(e.indexOf(r[t]),1)):this.clear():Ru(r[t],this.toBBox)},_initFormat:function(r){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(r[0])),this.compareMinY=new Function("a","b",t.join(r[1])),this.toBBox=new Function("a","return {minX: a"+r[0]+", minY: a"+r[1]+", maxX: a"+r[2]+", maxY: a"+r[3]+"};")}};function gB(r,t,e){if(!e)return t.indexOf(r);for(var o=0;o<t.length;o++)if(e(r,t[o]))return o;return-1}function Ru(r,t){Ul(r,0,r.children.length,t,r)}function Ul(r,t,e,o,a){a||(a=Lu(null)),a.minX=1/0,a.minY=1/0,a.maxX=-1/0,a.maxY=-1/0;for(var l=t,h;l<e;l++)h=r.children[l],Bl(a,r.leaf?o(h):h);return a}function Bl(r,t){return r.minX=Math.min(r.minX,t.minX),r.minY=Math.min(r.minY,t.minY),r.maxX=Math.max(r.maxX,t.maxX),r.maxY=Math.max(r.maxY,t.maxY),r}function qM(r,t){return r.minX-t.minX}function VM(r,t){return r.minY-t.minY}function hg(r){return(r.maxX-r.minX)*(r.maxY-r.minY)}function nh(r){return r.maxX-r.minX+(r.maxY-r.minY)}function yB(r,t){return(Math.max(t.maxX,r.maxX)-Math.min(t.minX,r.minX))*(Math.max(t.maxY,r.maxY)-Math.min(t.minY,r.minY))}function vB(r,t){var e=Math.max(r.minX,t.minX),o=Math.max(r.minY,t.minY),a=Math.min(r.maxX,t.maxX),l=Math.min(r.maxY,t.maxY);return Math.max(0,a-e)*Math.max(0,l-o)}function pg(r,t){return r.minX<=t.minX&&r.minY<=t.minY&&t.maxX<=r.maxX&&t.maxY<=r.maxY}function rh(r,t){return t.minX<=r.maxX&&t.minY<=r.maxY&&t.maxX>=r.minX&&t.maxY>=r.minY}function Lu(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function HM(r,t,e,o,a){for(var l=[t,e],h;l.length;)e=l.pop(),t=l.pop(),!(e-t<=o)&&(h=t+Math.ceil((e-t)/o/2)*o,mB(r,h,t,e,a),l.push(t,h,h,e))}});var JM=nt((TX,Eg)=>{"use strict";Eg.exports=ah;Eg.exports.default=ah;function ah(r,t,e){e=e||2;var o=t&&t.length,a=o?t[0]*e:r.length,l=YM(r,0,a,e,!0),h=[];if(!l||l.next===l.prev)return h;var f,p,d,g,x,v,M;if(o&&(l=CB(r,t,l,e)),r.length>80*e){f=d=r[0],p=g=r[1];for(var b=e;b<a;b+=e)x=r[b],v=r[b+1],x<f&&(f=x),v<p&&(p=v),x>d&&(d=x),v>g&&(g=v);M=Math.max(d-f,g-p),M=M!==0?32767/M:0}return ql(l,h,e,f,p,M,0),h}function YM(r,t,e,o,a){var l,h;if(a===xg(r,t,e,o)>0)for(l=t;l<e;l+=o)h=XM(l,r[l],r[l+1],h);else for(l=e-o;l>=t;l-=o)h=XM(l,r[l],r[l+1],h);return h&&uh(h,h.next)&&(Hl(h),h=h.next),h}function wa(r,t){if(!r)return r;t||(t=r);var e=r,o;do if(o=!1,!e.steiner&&(uh(e,e.next)||$n(e.prev,e,e.next)===0)){if(Hl(e),e=t=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==t);return t}function ql(r,t,e,o,a,l,h){if(r){!h&&l&&NB(r,o,a,l);for(var f=r,p,d;r.prev!==r.next;){if(p=r.prev,d=r.next,l?bB(r,o,a,l):wB(r)){t.push(p.i/e|0),t.push(r.i/e|0),t.push(d.i/e|0),Hl(r),r=d.next,f=d.next;continue}if(r=d,r===f){h?h===1?(r=TB(wa(r),t,e),ql(r,t,e,o,a,l,2)):h===2&&AB(r,t,e,o,a,l):ql(wa(r),t,e,o,a,l,1);break}}}}function wB(r){var t=r.prev,e=r,o=r.next;if($n(t,e,o)>=0)return!1;for(var a=t.x,l=e.x,h=o.x,f=t.y,p=e.y,d=o.y,g=a<l?a<h?a:h:l<h?l:h,x=f<p?f<d?f:d:p<d?p:d,v=a>l?a>h?a:h:l>h?l:h,M=f>p?f>d?f:d:p>d?p:d,b=o.next;b!==t;){if(b.x>=g&&b.x<=v&&b.y>=x&&b.y<=M&&Du(a,f,l,p,h,d,b.x,b.y)&&$n(b.prev,b,b.next)>=0)return!1;b=b.next}return!0}function bB(r,t,e,o){var a=r.prev,l=r,h=r.next;if($n(a,l,h)>=0)return!1;for(var f=a.x,p=l.x,d=h.x,g=a.y,x=l.y,v=h.y,M=f<p?f<d?f:d:p<d?p:d,b=g<x?g<v?g:v:x<v?x:v,T=f>p?f>d?f:d:p>d?p:d,_=g>x?g>v?g:v:x>v?x:v,y=vg(M,b,t,e,o),A=vg(T,_,t,e,o),S=r.prevZ,L=r.nextZ;S&&S.z>=y&&L&&L.z<=A;){if(S.x>=M&&S.x<=T&&S.y>=b&&S.y<=_&&S!==a&&S!==h&&Du(f,g,p,x,d,v,S.x,S.y)&&$n(S.prev,S,S.next)>=0||(S=S.prevZ,L.x>=M&&L.x<=T&&L.y>=b&&L.y<=_&&L!==a&&L!==h&&Du(f,g,p,x,d,v,L.x,L.y)&&$n(L.prev,L,L.next)>=0))return!1;L=L.nextZ}for(;S&&S.z>=y;){if(S.x>=M&&S.x<=T&&S.y>=b&&S.y<=_&&S!==a&&S!==h&&Du(f,g,p,x,d,v,S.x,S.y)&&$n(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;L&&L.z<=A;){if(L.x>=M&&L.x<=T&&L.y>=b&&L.y<=_&&L!==a&&L!==h&&Du(f,g,p,x,d,v,L.x,L.y)&&$n(L.prev,L,L.next)>=0)return!1;L=L.nextZ}return!0}function TB(r,t,e){var o=r;do{var a=o.prev,l=o.next.next;!uh(a,l)&&$M(a,o,o.next,l)&&Vl(a,l)&&Vl(l,a)&&(t.push(a.i/e|0),t.push(o.i/e|0),t.push(l.i/e|0),Hl(o),Hl(o.next),o=r=l),o=o.next}while(o!==r);return wa(o)}function AB(r,t,e,o,a,l){var h=r;do{for(var f=h.next.next;f!==h.prev;){if(h.i!==f.i&&FB(h,f)){var p=ZM(h,f);h=wa(h,h.next),p=wa(p,p.next),ql(h,t,e,o,a,l,0),ql(p,t,e,o,a,l,0);return}f=f.next}h=h.next}while(h!==r)}function CB(r,t,e,o){var a=[],l,h,f,p,d;for(l=0,h=t.length;l<h;l++)f=t[l]*o,p=l<h-1?t[l+1]*o:r.length,d=YM(r,f,p,o,!1),d===d.next&&(d.steiner=!0),a.push(DB(d));for(a.sort(PB),l=0;l<a.length;l++)e=IB(a[l],e);return e}function PB(r,t){return r.x-t.x}function IB(r,t){var e=RB(r,t);if(!e)return t;var o=ZM(e,r);return wa(o,o.next),wa(e,e.next)}function RB(r,t){var e=t,o=r.x,a=r.y,l=-1/0,h;do{if(a<=e.y&&a>=e.next.y&&e.next.y!==e.y){var f=e.x+(a-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(f<=o&&f>l&&(l=f,h=e.x<e.next.x?e:e.next,f===o))return h}e=e.next}while(e!==t);if(!h)return null;var p=h,d=h.x,g=h.y,x=1/0,v;e=h;do o>=e.x&&e.x>=d&&o!==e.x&&Du(a<g?o:l,a,d,g,a<g?l:o,a,e.x,e.y)&&(v=Math.abs(a-e.y)/(o-e.x),Vl(e,r)&&(v<x||v===x&&(e.x>h.x||e.x===h.x&&LB(h,e)))&&(h=e,x=v)),e=e.next;while(e!==p);return h}function LB(r,t){return $n(r.prev,r,t.prev)<0&&$n(t.next,r,r.next)<0}function NB(r,t,e,o){var a=r;do a.z===0&&(a.z=vg(a.x,a.y,t,e,o)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==r);a.prevZ.nextZ=null,a.prevZ=null,OB(a)}function OB(r){var t,e,o,a,l,h,f,p,d=1;do{for(e=r,r=null,l=null,h=0;e;){for(h++,o=e,f=0,t=0;t<d&&(f++,o=o.nextZ,!!o);t++);for(p=d;f>0||p>0&&o;)f!==0&&(p===0||!o||e.z<=o.z)?(a=e,e=e.nextZ,f--):(a=o,o=o.nextZ,p--),l?l.nextZ=a:r=a,a.prevZ=l,l=a;e=o}l.nextZ=null,d*=2}while(h>1);return r}function vg(r,t,e,o,a){return r=(r-e)*a|0,t=(t-o)*a|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function DB(r){var t=r,e=r;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==r);return e}function Du(r,t,e,o,a,l,h,f){return(a-h)*(t-f)>=(r-h)*(l-f)&&(r-h)*(o-f)>=(e-h)*(t-f)&&(e-h)*(l-f)>=(a-h)*(o-f)}function FB(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!UB(r,t)&&(Vl(r,t)&&Vl(t,r)&&BB(r,t)&&($n(r.prev,r,t.prev)||$n(r,t.prev,t))||uh(r,t)&&$n(r.prev,r,r.next)>0&&$n(t.prev,t,t.next)>0)}function $n(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function uh(r,t){return r.x===t.x&&r.y===t.y}function $M(r,t,e,o){var a=sh($n(r,t,e)),l=sh($n(r,t,o)),h=sh($n(e,o,r)),f=sh($n(e,o,t));return!!(a!==l&&h!==f||a===0&&oh(r,e,t)||l===0&&oh(r,o,t)||h===0&&oh(e,r,o)||f===0&&oh(e,t,o))}function oh(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function sh(r){return r>0?1:r<0?-1:0}function UB(r,t){var e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&$M(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function Vl(r,t){return $n(r.prev,r,r.next)<0?$n(r,t,r.next)>=0&&$n(r,r.prev,t)>=0:$n(r,t,r.prev)<0||$n(r,r.next,t)<0}function BB(r,t){var e=r,o=!1,a=(r.x+t.x)/2,l=(r.y+t.y)/2;do e.y>l!=e.next.y>l&&e.next.y!==e.y&&a<(e.next.x-e.x)*(l-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==r);return o}function ZM(r,t){var e=new _g(r.i,r.x,r.y),o=new _g(t.i,t.x,t.y),a=r.next,l=t.prev;return r.next=t,t.prev=r,e.next=a,a.prev=e,o.next=e,e.prev=o,l.next=o,o.prev=l,o}function XM(r,t,e,o){var a=new _g(r,t,e);return o?(a.next=o.next,a.prev=o,o.next.prev=a,o.next=a):(a.prev=a,a.next=a),a}function Hl(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function _g(r,t,e){this.i=r,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}ah.deviation=function(r,t,e,o){var a=t&&t.length,l=a?t[0]*e:r.length,h=Math.abs(xg(r,0,l,e));if(a)for(var f=0,p=t.length;f<p;f++){var d=t[f]*e,g=f<p-1?t[f+1]*e:r.length;h-=Math.abs(xg(r,d,g,e))}var x=0;for(f=0;f<o.length;f+=3){var v=o[f]*e,M=o[f+1]*e,b=o[f+2]*e;x+=Math.abs((r[v]-r[b])*(r[M+1]-r[v+1])-(r[v]-r[M])*(r[b+1]-r[v+1]))}return h===0&&x===0?0:Math.abs((x-h)/h)};function xg(r,t,e,o){for(var a=0,l=t,h=e-o;l<e;l+=o)a+=(r[h]-r[l])*(r[l+1]+r[h+1]),h=l;return a}ah.flatten=function(r){for(var t=r[0][0].length,e={vertices:[],holes:[],dimensions:t},o=0,a=0;a<r.length;a++){for(var l=0;l<r[a].length;l++)for(var h=0;h<t;h++)e.vertices.push(r[a][l][h]);a>0&&(o+=r[a-1].length,e.holes.push(o))}return e}});var Tg=nt(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.earthRadius=63710088e-1;he.factors={centimeters:he.earthRadius*100,centimetres:he.earthRadius*100,degrees:he.earthRadius/111325,feet:he.earthRadius*3.28084,inches:he.earthRadius*39.37,kilometers:he.earthRadius/1e3,kilometres:he.earthRadius/1e3,meters:he.earthRadius,metres:he.earthRadius,miles:he.earthRadius/1609.344,millimeters:he.earthRadius*1e3,millimetres:he.earthRadius*1e3,nauticalmiles:he.earthRadius/1852,radians:1,yards:he.earthRadius*1.0936};he.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/he.earthRadius,yards:1.0936133};he.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 Gs(r,t,e){e===void 0&&(e={});var o={type:"Feature"};return(e.id===0||e.id)&&(o.id=e.id),e.bbox&&(o.bbox=e.bbox),o.properties=t||{},o.geometry=r,o}he.feature=Gs;function GB(r,t,e){switch(e===void 0&&(e={}),r){case"Point":return Mg(t).geometry;case"LineString":return wg(t).geometry;case"Polygon":return Sg(t).geometry;case"MultiPoint":return jM(t).geometry;case"MultiLineString":return KM(t).geometry;case"MultiPolygon":return QM(t).geometry;default:throw new Error(r+" is invalid")}}he.geometry=GB;function Mg(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!lh(r[0])||!lh(r[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:r};return Gs(o,t,e)}he.point=Mg;function kB(r,t,e){return e===void 0&&(e={}),ch(r.map(function(o){return Mg(o,t)}),e)}he.points=kB;function Sg(r,t,e){e===void 0&&(e={});for(var o=0,a=r;o<a.length;o++){var l=a[o];if(l.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var h=0;h<l[l.length-1].length;h++)if(l[l.length-1][h]!==l[0][h])throw new Error("First and last Position are not equivalent.")}var f={type:"Polygon",coordinates:r};return Gs(f,t,e)}he.polygon=Sg;function qB(r,t,e){return e===void 0&&(e={}),ch(r.map(function(o){return Sg(o,t)}),e)}he.polygons=qB;function wg(r,t,e){if(e===void 0&&(e={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var o={type:"LineString",coordinates:r};return Gs(o,t,e)}he.lineString=wg;function VB(r,t,e){return e===void 0&&(e={}),ch(r.map(function(o){return wg(o,t)}),e)}he.lineStrings=VB;function ch(r,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}he.featureCollection=ch;function KM(r,t,e){e===void 0&&(e={});var o={type:"MultiLineString",coordinates:r};return Gs(o,t,e)}he.multiLineString=KM;function jM(r,t,e){e===void 0&&(e={});var o={type:"MultiPoint",coordinates:r};return Gs(o,t,e)}he.multiPoint=jM;function QM(r,t,e){e===void 0&&(e={});var o={type:"MultiPolygon",coordinates:r};return Gs(o,t,e)}he.multiPolygon=QM;function HB(r,t,e){e===void 0&&(e={});var o={type:"GeometryCollection",geometries:r};return Gs(o,t,e)}he.geometryCollection=HB;function WB(r,t){if(t===void 0&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,t||0);return Math.round(r*e)/e}he.round=WB;function tS(r,t){t===void 0&&(t="kilometers");var e=he.factors[t];if(!e)throw new Error(t+" units is invalid");return r*e}he.radiansToLength=tS;function bg(r,t){t===void 0&&(t="kilometers");var e=he.factors[t];if(!e)throw new Error(t+" units is invalid");return r/e}he.lengthToRadians=bg;function XB(r,t){return eS(bg(r,t))}he.lengthToDegrees=XB;function YB(r){var t=r%360;return t<0&&(t+=360),t}he.bearingToAzimuth=YB;function eS(r){var t=r%(2*Math.PI);return t*180/Math.PI}he.radiansToDegrees=eS;function $B(r){var t=r%360;return t*Math.PI/180}he.degreesToRadians=$B;function ZB(r,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("length must be a positive number");return tS(bg(r,t),e)}he.convertLength=ZB;function JB(r,t,e){if(t===void 0&&(t="meters"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("area must be a positive number");var o=he.areaFactors[t];if(!o)throw new Error("invalid original units");var a=he.areaFactors[e];if(!a)throw new Error("invalid final units");return r/o*a}he.convertArea=JB;function lh(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}he.isNumber=lh;function KB(r){return!!r&&r.constructor===Object}he.isObject=KB;function jB(r){if(!r)throw new Error("bbox is required");if(!Array.isArray(r))throw new Error("bbox must be an Array");if(r.length!==4&&r.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");r.forEach(function(t){if(!lh(t))throw new Error("bbox must only contain numbers")})}he.validateBBox=jB;function QB(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}he.validateId=QB});var Cg=nt(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});var Qr=Tg();function Wl(r,t,e){if(r!==null)for(var o,a,l,h,f,p,d,g=0,x=0,v,M=r.type,b=M==="FeatureCollection",T=M==="Feature",_=b?r.features.length:1,y=0;y<_;y++){d=b?r.features[y].geometry:T?r.geometry:r,v=d?d.type==="GeometryCollection":!1,f=v?d.geometries.length:1;for(var A=0;A<f;A++){var S=0,L=0;if(h=v?d.geometries[A]:d,h!==null){p=h.coordinates;var G=h.type;switch(g=e&&(G==="Polygon"||G==="MultiPolygon")?1:0,G){case null:break;case"Point":if(t(p,x,y,S,L)===!1)return!1;x++,S++;break;case"LineString":case"MultiPoint":for(o=0;o<p.length;o++){if(t(p[o],x,y,S,L)===!1)return!1;x++,G==="MultiPoint"&&S++}G==="LineString"&&S++;break;case"Polygon":case"MultiLineString":for(o=0;o<p.length;o++){for(a=0;a<p[o].length-g;a++){if(t(p[o][a],x,y,S,L)===!1)return!1;x++}G==="MultiLineString"&&S++,G==="Polygon"&&L++}G==="Polygon"&&S++;break;case"MultiPolygon":for(o=0;o<p.length;o++){for(L=0,a=0;a<p[o].length;a++){for(l=0;l<p[o][a].length-g;l++){if(t(p[o][a][l],x,y,S,L)===!1)return!1;x++}L++}S++}break;case"GeometryCollection":for(o=0;o<h.geometries.length;o++)if(Wl(h.geometries[o],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function tz(r,t,e,o){var a=e;return Wl(r,function(l,h,f,p,d){h===0&&e===void 0?a=l:a=t(a,l,h,f,p,d)},o),a}function nS(r,t){var e;switch(r.type){case"FeatureCollection":for(e=0;e<r.features.length&&t(r.features[e].properties,e)!==!1;e++);break;case"Feature":t(r.properties,0);break}}function ez(r,t,e){var o=e;return nS(r,function(a,l){l===0&&e===void 0?o=a:o=t(o,a,l)}),o}function rS(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}function nz(r,t,e){var o=e;return rS(r,function(a,l){l===0&&e===void 0?o=a:o=t(o,a,l)}),o}function rz(r){var t=[];return Wl(r,function(e){t.push(e)}),t}function Ag(r,t){var e,o,a,l,h,f,p,d,g,x,v=0,M=r.type==="FeatureCollection",b=r.type==="Feature",T=M?r.features.length:1;for(e=0;e<T;e++){for(f=M?r.features[e].geometry:b?r.geometry:r,d=M?r.features[e].properties:b?r.properties:{},g=M?r.features[e].bbox:b?r.bbox:void 0,x=M?r.features[e].id:b?r.id:void 0,p=f?f.type==="GeometryCollection":!1,h=p?f.geometries.length:1,a=0;a<h;a++){if(l=p?f.geometries[a]:f,l===null){if(t(null,v,d,g,x)===!1)return!1;continue}switch(l.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(l,v,d,g,x)===!1)return!1;break}case"GeometryCollection":{for(o=0;o<l.geometries.length;o++)if(t(l.geometries[o],v,d,g,x)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}v++}}function iz(r,t,e){var o=e;return Ag(r,function(a,l,h,f,p){l===0&&e===void 0?o=a:o=t(o,a,l,h,f,p)}),o}function fh(r,t){Ag(r,function(e,o,a,l,h){var f=e===null?null:e.type;switch(f){case null:case"Point":case"LineString":case"Polygon":return t(Qr.feature(e,a,{bbox:l,id:h}),o,0)===!1?!1:void 0}var p;switch(f){case"MultiPoint":p="Point";break;case"MultiLineString":p="LineString";break;case"MultiPolygon":p="Polygon";break}for(var d=0;d<e.coordinates.length;d++){var g=e.coordinates[d],x={type:p,coordinates:g};if(t(Qr.feature(x,a),o,d)===!1)return!1}})}function oz(r,t,e){var o=e;return fh(r,function(a,l,h){l===0&&h===0&&e===void 0?o=a:o=t(o,a,l,h)}),o}function iS(r,t){fh(r,function(e,o,a){var l=0;if(e.geometry){var h=e.geometry.type;if(!(h==="Point"||h==="MultiPoint")){var f,p=0,d=0,g=0;if(Wl(e,function(x,v,M,b,T){if(f===void 0||o>p||b>d||T>g){f=x,p=o,d=b,g=T,l=0;return}var _=Qr.lineString([f,x],e.properties);if(t(_,o,a,T,l)===!1)return!1;l++,f=x})===!1)return!1}}})}function sz(r,t,e){var o=e,a=!1;return iS(r,function(l,h,f,p,d){a===!1&&e===void 0?o=l:o=t(o,l,h,f,p,d),a=!0}),o}function oS(r,t){if(!r)throw new Error("geojson is required");fh(r,function(e,o,a){if(e.geometry!==null){var l=e.geometry.type,h=e.geometry.coordinates;switch(l){case"LineString":if(t(e,o,a,0,0)===!1)return!1;break;case"Polygon":for(var f=0;f<h.length;f++)if(t(Qr.lineString(h[f],e.properties),o,a,f)===!1)return!1;break}}})}function az(r,t,e){var o=e;return oS(r,function(a,l,h,f){l===0&&e===void 0?o=a:o=t(o,a,l,h,f)}),o}function uz(r,t){if(t=t||{},!Qr.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,a=t.geometryIndex||0,l=t.segmentIndex||0,h=t.properties,f;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),h=h||r.features[e].properties,f=r.features[e].geometry;break;case"Feature":h=h||r.properties,f=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":f=r;break;default:throw new Error("geojson is invalid")}if(f===null)return null;var p=f.coordinates;switch(f.type){case"Point":case"MultiPoint":return null;case"LineString":return l<0&&(l=p.length+l-1),Qr.lineString([p[l],p[l+1]],h,t);case"Polygon":return a<0&&(a=p.length+a),l<0&&(l=p[a].length+l-1),Qr.lineString([p[a][l],p[a][l+1]],h,t);case"MultiLineString":return o<0&&(o=p.length+o),l<0&&(l=p[o].length+l-1),Qr.lineString([p[o][l],p[o][l+1]],h,t);case"MultiPolygon":return o<0&&(o=p.length+o),a<0&&(a=p[o].length+a),l<0&&(l=p[o][a].length-l-1),Qr.lineString([p[o][a][l],p[o][a][l+1]],h,t)}throw new Error("geojson is invalid")}function lz(r,t){if(t=t||{},!Qr.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,a=t.geometryIndex||0,l=t.coordIndex||0,h=t.properties,f;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),h=h||r.features[e].properties,f=r.features[e].geometry;break;case"Feature":h=h||r.properties,f=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":f=r;break;default:throw new Error("geojson is invalid")}if(f===null)return null;var p=f.coordinates;switch(f.type){case"Point":return Qr.point(p,h,t);case"MultiPoint":return o<0&&(o=p.length+o),Qr.point(p[o],h,t);case"LineString":return l<0&&(l=p.length+l),Qr.point(p[l],h,t);case"Polygon":return a<0&&(a=p.length+a),l<0&&(l=p[a].length+l),Qr.point(p[a][l],h,t);case"MultiLineString":return o<0&&(o=p.length+o),l<0&&(l=p[o].length+l),Qr.point(p[o][l],h,t);case"MultiPolygon":return o<0&&(o=p.length+o),a<0&&(a=p[o].length+a),l<0&&(l=p[o][a].length-l),Qr.point(p[o][a][l],h,t)}throw new Error("geojson is invalid")}mr.coordAll=rz;mr.coordEach=Wl;mr.coordReduce=tz;mr.featureEach=rS;mr.featureReduce=nz;mr.findPoint=lz;mr.findSegment=uz;mr.flattenEach=fh;mr.flattenReduce=oz;mr.geomEach=Ag;mr.geomReduce=iz;mr.lineEach=oS;mr.lineReduce=az;mr.propEach=nS;mr.propReduce=ez;mr.segmentEach=iS;mr.segmentReduce=sz});var sS=nt(Ig=>{"use strict";Object.defineProperty(Ig,"__esModule",{value:!0});var cz=Cg();function Pg(r){var t=[1/0,1/0,-1/0,-1/0];return cz.coordEach(r,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}Pg.default=Pg;Ig.default=Pg});var hh=nt((qX,Rg)=>{var Lo=ng(),uS=Tg(),lS=Cg(),Fu=sS().default,fz=lS.featureEach,GX=lS.coordEach,kX=uS.polygon,aS=uS.featureCollection;function cS(r){var t=new Lo(r);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Fu(e),Lo.prototype.insert.call(this,e)},t.load=function(e){var o=[];return Array.isArray(e)?e.forEach(function(a){if(a.type!=="Feature")throw new Error("invalid features");a.bbox=a.bbox?a.bbox:Fu(a),o.push(a)}):fz(e,function(a){if(a.type!=="Feature")throw new Error("invalid features");a.bbox=a.bbox?a.bbox:Fu(a),o.push(a)}),Lo.prototype.load.call(this,o)},t.remove=function(e,o){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Fu(e),Lo.prototype.remove.call(this,e,o)},t.clear=function(){return Lo.prototype.clear.call(this)},t.search=function(e){var o=Lo.prototype.search.call(this,this.toBBox(e));return aS(o)},t.collides=function(e){return Lo.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=Lo.prototype.all.call(this);return aS(e)},t.toJSON=function(){return Lo.prototype.toJSON.call(this)},t.fromJSON=function(e){return Lo.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var o;if(e.bbox)o=e.bbox;else if(Array.isArray(e)&&e.length===4)o=e;else if(Array.isArray(e)&&e.length===6)o=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")o=Fu(e);else if(e.type==="FeatureCollection")o=Fu(e);else throw new Error("invalid geojson");return{minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]}},t}Rg.exports=cS;Rg.exports.default=cS});var Ug=nt((K7,xS)=>{"use strict";var _S=Object.prototype.toString;xS.exports=function(t){var e=_S.call(t),o=e==="[object Arguments]";return o||(o=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&_S.call(t.callee)==="[object Function]"),o}});var PS=nt((j7,CS)=>{"use strict";var AS;Object.keys||($l=Object.prototype.hasOwnProperty,Bg=Object.prototype.toString,ES=Ug(),zg=Object.prototype.propertyIsEnumerable,MS=!zg.call({toString:null},"toString"),SS=zg.call(function(){},"prototype"),Zl=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],yh=function(r){var t=r.constructor;return t&&t.prototype===r},wS={$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},bS=function(){if(typeof window=="undefined")return!1;for(var r in window)try{if(!wS["$"+r]&&$l.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{yh(window[r])}catch(t){return!0}}catch(t){return!0}return!1}(),TS=function(r){if(typeof window=="undefined"||!bS)return yh(r);try{return yh(r)}catch(t){return!1}},AS=function(t){var e=t!==null&&typeof t=="object",o=Bg.call(t)==="[object Function]",a=ES(t),l=e&&Bg.call(t)==="[object String]",h=[];if(!e&&!o&&!a)throw new TypeError("Object.keys called on a non-object");var f=SS&&o;if(l&&t.length>0&&!$l.call(t,0))for(var p=0;p<t.length;++p)h.push(String(p));if(a&&t.length>0)for(var d=0;d<t.length;++d)h.push(String(d));else for(var g in t)!(f&&g==="prototype")&&$l.call(t,g)&&h.push(String(g));if(MS)for(var x=TS(t),v=0;v<Zl.length;++v)!(x&&Zl[v]==="constructor")&&$l.call(t,Zl[v])&&h.push(Zl[v]);return h});var $l,Bg,ES,zg,MS,SS,Zl,yh,wS,bS,TS;CS.exports=AS});var Gg=nt((Q7,LS)=>{"use strict";var Ez=Array.prototype.slice,Mz=Ug(),IS=Object.keys,vh=IS?function(t){return IS(t)}:PS(),RS=Object.keys;vh.shim=function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=function(o){return Mz(o)?RS(Ez.call(o)):RS(o)})}else Object.keys=vh;return Object.keys||vh};LS.exports=vh});var kg=nt((tY,NS)=>{"use strict";NS.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),o=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var a=42;t[e]=a;for(var l 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 h=Object.getOwnPropertySymbols(t);if(h.length!==1||h[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var f=Object.getOwnPropertyDescriptor(t,e);if(f.value!==a||f.enumerable!==!0)return!1}return!0}});var _h=nt((eY,OS)=>{"use strict";var Sz=kg();OS.exports=function(){return Sz()&&!!Symbol.toStringTag}});var qg=nt((nY,DS)=>{"use strict";DS.exports=Object});var Vg=nt((rY,FS)=>{"use strict";FS.exports=Error});var BS=nt((iY,US)=>{"use strict";US.exports=EvalError});var GS=nt((oY,zS)=>{"use strict";zS.exports=RangeError});var qS=nt((sY,kS)=>{"use strict";kS.exports=ReferenceError});var Hg=nt((aY,VS)=>{"use strict";VS.exports=SyntaxError});var ba=nt((uY,HS)=>{"use strict";HS.exports=TypeError});var XS=nt((lY,WS)=>{"use strict";WS.exports=URIError});var $S=nt((cY,YS)=>{"use strict";YS.exports=Math.abs});var JS=nt((fY,ZS)=>{"use strict";ZS.exports=Math.floor});var jS=nt((hY,KS)=>{"use strict";KS.exports=Math.max});var tw=nt((pY,QS)=>{"use strict";QS.exports=Math.min});var nw=nt((dY,ew)=>{"use strict";ew.exports=Math.pow});var iw=nt((mY,rw)=>{"use strict";rw.exports=Math.round});var sw=nt((gY,ow)=>{"use strict";ow.exports=Number.isNaN||function(t){return t!==t}});var uw=nt((yY,aw)=>{"use strict";var wz=sw();aw.exports=function(t){return wz(t)||t===0?t:t<0?-1:1}});var cw=nt((vY,lw)=>{"use strict";lw.exports=Object.getOwnPropertyDescriptor});var Ta=nt((_Y,fw)=>{"use strict";var xh=cw();if(xh)try{xh([],"length")}catch(r){xh=null}fw.exports=xh});var Jl=nt((xY,hw)=>{"use strict";var Eh=Object.defineProperty||!1;if(Eh)try{Eh({},"a",{value:1})}catch(r){Eh=!1}hw.exports=Eh});var mw=nt((EY,dw)=>{"use strict";var pw=typeof Symbol!="undefined"&&Symbol,bz=kg();dw.exports=function(){return typeof pw!="function"||typeof Symbol!="function"||typeof pw("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:bz()}});var Wg=nt((MY,gw)=>{"use strict";gw.exports=typeof Reflect!="undefined"&&Reflect.getPrototypeOf||null});var Xg=nt((SY,yw)=>{"use strict";var Tz=qg();yw.exports=Tz.getPrototypeOf||null});var xw=nt((wY,_w)=>{"use strict";var Az="Function.prototype.bind called on incompatible ",Cz=Object.prototype.toString,Pz=Math.max,Iz="[object Function]",vw=function(t,e){for(var o=[],a=0;a<t.length;a+=1)o[a]=t[a];for(var l=0;l<e.length;l+=1)o[l+t.length]=e[l];return o},Rz=function(t,e){for(var o=[],a=e||0,l=0;a<t.length;a+=1,l+=1)o[l]=t[a];return o},Lz=function(r,t){for(var e="",o=0;o<r.length;o+=1)e+=r[o],o+1<r.length&&(e+=t);return e};_w.exports=function(t){var e=this;if(typeof e!="function"||Cz.apply(e)!==Iz)throw new TypeError(Az+e);for(var o=Rz(arguments,1),a,l=function(){if(this instanceof a){var g=e.apply(this,vw(o,arguments));return Object(g)===g?g:this}return e.apply(t,vw(o,arguments))},h=Pz(0,e.length-o.length),f=[],p=0;p<h;p++)f[p]="$"+p;if(a=Function("binder","return function ("+Lz(f,",")+"){ return binder.apply(this,arguments); }")(l),e.prototype){var d=function(){};d.prototype=e.prototype,a.prototype=new d,d.prototype=null}return a}});var Uu=nt((bY,Ew)=>{"use strict";var Nz=xw();Ew.exports=Function.prototype.bind||Nz});var Mh=nt((TY,Mw)=>{"use strict";Mw.exports=Function.prototype.call});var Sh=nt((AY,Sw)=>{"use strict";Sw.exports=Function.prototype.apply});var bw=nt((CY,ww)=>{"use strict";ww.exports=typeof Reflect!="undefined"&&Reflect&&Reflect.apply});var Yg=nt((PY,Tw)=>{"use strict";var Oz=Uu(),Dz=Sh(),Fz=Mh(),Uz=bw();Tw.exports=Uz||Oz.call(Fz,Dz)});var wh=nt((IY,Aw)=>{"use strict";var Bz=Uu(),zz=ba(),Gz=Mh(),kz=Yg();Aw.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new zz("a function is required");return kz(Bz,Gz,t)}});var Nw=nt((RY,Lw)=>{"use strict";var qz=wh(),Cw=Ta(),Iw;try{Iw=[].__proto__===Array.prototype}catch(r){if(!r||typeof r!="object"||!("code"in r)||r.code!=="ERR_PROTO_ACCESS")throw r}var $g=!!Iw&&Cw&&Cw(Object.prototype,"__proto__"),Rw=Object,Pw=Rw.getPrototypeOf;Lw.exports=$g&&typeof $g.get=="function"?qz([$g.get]):typeof Pw=="function"?function(t){return Pw(t==null?t:Rw(t))}:!1});var Zg=nt((LY,Uw)=>{"use strict";var Ow=Wg(),Dw=Xg(),Fw=Nw();Uw.exports=Ow?function(t){return Ow(t)}:Dw?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Dw(t)}:Fw?function(t){return Fw(t)}:null});var Jg=nt((NY,Bw)=>{"use strict";var Vz=Function.prototype.call,Hz=Object.prototype.hasOwnProperty,Wz=Uu();Bw.exports=Wz.call(Vz,Hz)});var Qg=nt((OY,Hw)=>{"use strict";var Ke,Xz=qg(),Yz=Vg(),$z=BS(),Zz=GS(),Jz=qS(),ku=Hg(),Gu=ba(),Kz=XS(),jz=$S(),Qz=JS(),tG=jS(),eG=tw(),nG=nw(),rG=iw(),iG=uw(),qw=Function,Kg=function(r){try{return qw('"use strict"; return ('+r+").constructor;")()}catch(t){}},Kl=Ta(),oG=Jl(),jg=function(){throw new Gu},sG=Kl?function(){try{return arguments.callee,jg}catch(r){try{return Kl(arguments,"callee").get}catch(t){return jg}}}():jg,Bu=mw()(),Rr=Zg(),aG=Xg(),uG=Wg(),Vw=Sh(),jl=Mh(),zu={},lG=typeof Uint8Array=="undefined"||!Rr?Ke:Rr(Uint8Array),Aa={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?Ke:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?Ke:ArrayBuffer,"%ArrayIteratorPrototype%":Bu&&Rr?Rr([][Symbol.iterator]()):Ke,"%AsyncFromSyncIteratorPrototype%":Ke,"%AsyncFunction%":zu,"%AsyncGenerator%":zu,"%AsyncGeneratorFunction%":zu,"%AsyncIteratorPrototype%":zu,"%Atomics%":typeof Atomics=="undefined"?Ke:Atomics,"%BigInt%":typeof BigInt=="undefined"?Ke:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?Ke:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?Ke:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?Ke:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Yz,"%eval%":eval,"%EvalError%":$z,"%Float16Array%":typeof Float16Array=="undefined"?Ke:Float16Array,"%Float32Array%":typeof Float32Array=="undefined"?Ke:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?Ke:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?Ke:FinalizationRegistry,"%Function%":qw,"%GeneratorFunction%":zu,"%Int8Array%":typeof Int8Array=="undefined"?Ke:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?Ke:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?Ke:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Bu&&Rr?Rr(Rr([][Symbol.iterator]())):Ke,"%JSON%":typeof JSON=="object"?JSON:Ke,"%Map%":typeof Map=="undefined"?Ke:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!Bu||!Rr?Ke:Rr(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Xz,"%Object.getOwnPropertyDescriptor%":Kl,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?Ke:Promise,"%Proxy%":typeof Proxy=="undefined"?Ke:Proxy,"%RangeError%":Zz,"%ReferenceError%":Jz,"%Reflect%":typeof Reflect=="undefined"?Ke:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?Ke:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!Bu||!Rr?Ke:Rr(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?Ke:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Bu&&Rr?Rr(""[Symbol.iterator]()):Ke,"%Symbol%":Bu?Symbol:Ke,"%SyntaxError%":ku,"%ThrowTypeError%":sG,"%TypedArray%":lG,"%TypeError%":Gu,"%Uint8Array%":typeof Uint8Array=="undefined"?Ke:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?Ke:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?Ke:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?Ke:Uint32Array,"%URIError%":Kz,"%WeakMap%":typeof WeakMap=="undefined"?Ke:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?Ke:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?Ke:WeakSet,"%Function.prototype.call%":jl,"%Function.prototype.apply%":Vw,"%Object.defineProperty%":oG,"%Object.getPrototypeOf%":aG,"%Math.abs%":jz,"%Math.floor%":Qz,"%Math.max%":tG,"%Math.min%":eG,"%Math.pow%":nG,"%Math.round%":rG,"%Math.sign%":iG,"%Reflect.getPrototypeOf%":uG};if(Rr)try{null.error}catch(r){zw=Rr(Rr(r)),Aa["%Error.prototype%"]=zw}var zw,cG=function r(t){var e;if(t==="%AsyncFunction%")e=Kg("async function () {}");else if(t==="%GeneratorFunction%")e=Kg("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=Kg("async function* () {}");else if(t==="%AsyncGenerator%"){var o=r("%AsyncGeneratorFunction%");o&&(e=o.prototype)}else if(t==="%AsyncIteratorPrototype%"){var a=r("%AsyncGenerator%");a&&Rr&&(e=Rr(a.prototype))}return Aa[t]=e,e},Gw={__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"]},Ql=Uu(),bh=Jg(),fG=Ql.call(jl,Array.prototype.concat),hG=Ql.call(Vw,Array.prototype.splice),kw=Ql.call(jl,String.prototype.replace),Th=Ql.call(jl,String.prototype.slice),pG=Ql.call(jl,RegExp.prototype.exec),dG=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,mG=/\\\\(\\\\)?/g,gG=function(t){var e=Th(t,0,1),o=Th(t,-1);if(e==="%"&&o!=="%")throw new ku("invalid intrinsic syntax, expected closing \`%\`");if(o==="%"&&e!=="%")throw new ku("invalid intrinsic syntax, expected opening \`%\`");var a=[];return kw(t,dG,function(l,h,f,p){a[a.length]=f?kw(p,mG,"$1"):h||l}),a},yG=function(t,e){var o=t,a;if(bh(Gw,o)&&(a=Gw[o],o="%"+a[0]+"%"),bh(Aa,o)){var l=Aa[o];if(l===zu&&(l=cG(o)),typeof l=="undefined"&&!e)throw new Gu("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:a,name:o,value:l}}throw new ku("intrinsic "+t+" does not exist!")};Hw.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new Gu("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Gu('"allowMissing" argument must be a boolean');if(pG(/^%?[^%]*%?$/,t)===null)throw new ku("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var o=gG(t),a=o.length>0?o[0]:"",l=yG("%"+a+"%",e),h=l.name,f=l.value,p=!1,d=l.alias;d&&(a=d[0],hG(o,fG([0,1],d)));for(var g=1,x=!0;g<o.length;g+=1){var v=o[g],M=Th(v,0,1),b=Th(v,-1);if((M==='"'||M==="'"||M==="\`"||b==='"'||b==="'"||b==="\`")&&M!==b)throw new ku("property names with quotes must have matching quotes");if((v==="constructor"||!x)&&(p=!0),a+="."+v,h="%"+a+"%",bh(Aa,h))f=Aa[h];else if(f!=null){if(!(v in f)){if(!e)throw new Gu("base intrinsic for "+t+" exists, but the property is not available.");return}if(Kl&&g+1>=o.length){var T=Kl(f,v);x=!!T,x&&"get"in T&&!("originalValue"in T.get)?f=T.get:f=f[v]}else x=bh(f,v),f=f[v];x&&!p&&(Aa[h]=f)}}return f}});var Ah=nt((DY,Yw)=>{"use strict";var Ww=Qg(),Xw=wh(),vG=Xw([Ww("%String.prototype.indexOf%")]);Yw.exports=function(t,e){var o=Ww(t,!!e);return typeof o=="function"&&vG(t,".prototype.")>-1?Xw([o]):o}});var Jw=nt((FY,Zw)=>{"use strict";var _G=_h()(),xG=Ah(),t0=xG("Object.prototype.toString"),Ch=function(t){return _G&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:t0(t)==="[object Arguments]"},$w=function(t){return Ch(t)?!0:t!==null&&typeof t=="object"&&"length"in t&&typeof t.length=="number"&&t.length>=0&&t0(t)!=="[object Array]"&&"callee"in t&&t0(t.callee)==="[object Function]"},EG=function(){return Ch(arguments)}();Ch.isLegacyArguments=$w;Zw.exports=EG?Ch:$w});var Ph=nt((UY,Qw)=>{"use strict";var Kw=Jl(),MG=Hg(),qu=ba(),jw=Ta();Qw.exports=function(t,e,o){if(!t||typeof t!="object"&&typeof t!="function")throw new qu("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new qu("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new qu("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new qu("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new qu("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new qu("\`loose\`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,h=arguments.length>5?arguments[5]:null,f=arguments.length>6?arguments[6]:!1,p=!!jw&&jw(t,e);if(Kw)Kw(t,e,{configurable:h===null&&p?p.configurable:!h,enumerable:a===null&&p?p.enumerable:!a,value:o,writable:l===null&&p?p.writable:!l});else if(f||!a&&!l&&!h)t[e]=o;else throw new MG("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Ih=nt((BY,eb)=>{"use strict";var e0=Jl(),tb=function(){return!!e0};tb.hasArrayLengthDefineBug=function(){if(!e0)return null;try{return e0([],"length",{value:1}).length!==1}catch(t){return!0}};eb.exports=tb});var Vu=nt((zY,ob)=>{"use strict";var SG=Gg(),wG=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",bG=Object.prototype.toString,TG=Array.prototype.concat,nb=Ph(),AG=function(r){return typeof r=="function"&&bG.call(r)==="[object Function]"},rb=Ih()(),CG=function(r,t,e,o){if(t in r){if(o===!0){if(r[t]===e)return}else if(!AG(o)||!o())return}rb?nb(r,t,e,!0):nb(r,t,e)},ib=function(r,t){var e=arguments.length>2?arguments[2]:{},o=SG(t);wG&&(o=TG.call(o,Object.getOwnPropertySymbols(t)));for(var a=0;a<o.length;a+=1)CG(r,o[a],t[o[a]],e[o[a]])};ib.supportsDescriptors=!!rb;ob.exports=ib});var cb=nt((GY,lb)=>{"use strict";var PG=Qg(),sb=Ph(),IG=Ih()(),ab=Ta(),ub=ba(),RG=PG("%Math.floor%");lb.exports=function(t,e){if(typeof t!="function")throw new ub("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||RG(e)!==e)throw new ub("\`length\` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],a=!0,l=!0;if("length"in t&&ab){var h=ab(t,"length");h&&!h.configurable&&(a=!1),h&&!h.writable&&(l=!1)}return(a||l||!o)&&(IG?sb(t,"length",e,!0,!0):sb(t,"length",e)),t}});var hb=nt((kY,fb)=>{"use strict";var LG=Uu(),NG=Sh(),OG=Yg();fb.exports=function(){return OG(LG,NG,arguments)}});var n0=nt((qY,Rh)=>{"use strict";var DG=cb(),pb=Jl(),FG=wh(),db=hb();Rh.exports=function(t){var e=FG(arguments),o=t.length-(arguments.length-1);return DG(e,1+(o>0?o:0),!0)};pb?pb(Rh.exports,"apply",{value:db}):Rh.exports.apply=db});var r0=nt((VY,gb)=>{"use strict";var mb=function(r){return r!==r};gb.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||mb(t)&&mb(e))}});var i0=nt((HY,yb)=>{"use strict";var UG=r0();yb.exports=function(){return typeof Object.is=="function"?Object.is:UG}});var _b=nt((WY,vb)=>{"use strict";var BG=i0(),zG=Vu();vb.exports=function(){var t=BG();return zG(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var Sb=nt((XY,Mb)=>{"use strict";var GG=Vu(),kG=n0(),qG=r0(),xb=i0(),VG=_b(),Eb=kG(xb(),Object);GG(Eb,{getPolyfill:xb,implementation:qG,shim:VG});Mb.exports=Eb});var Pb=nt((YY,Cb)=>{"use strict";var wb=Ah(),HG=_h()(),WG=Jg(),XG=Ta(),a0;HG?(bb=wb("RegExp.prototype.exec"),o0={},Lh=function(){throw o0},s0={toString:Lh,valueOf:Lh},typeof Symbol.toPrimitive=="symbol"&&(s0[Symbol.toPrimitive]=Lh),a0=function(t){if(!t||typeof t!="object")return!1;var e=XG(t,"lastIndex"),o=e&&WG(e,"value");if(!o)return!1;try{bb(t,s0)}catch(a){return a===o0}}):(Tb=wb("Object.prototype.toString"),Ab="[object RegExp]",a0=function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:Tb(t)===Ab});var bb,o0,Lh,s0,Tb,Ab;Cb.exports=a0});var Rb=nt(($Y,Ib)=>{"use strict";var ec=function(){return typeof function(){}.name=="string"},tc=Object.getOwnPropertyDescriptor;if(tc)try{tc([],"length")}catch(r){tc=null}ec.functionsHaveConfigurableNames=function(){if(!ec()||!tc)return!1;var t=tc(function(){},"name");return!!t&&!!t.configurable};var YG=Function.prototype.bind;ec.boundFunctionsHaveNames=function(){return ec()&&typeof YG=="function"&&function(){}.bind().name!==""};Ib.exports=ec});var Ob=nt((ZY,Nb)=>{"use strict";var Lb=Ph(),$G=Ih()(),ZG=Rb().functionsHaveConfigurableNames(),JG=ba();Nb.exports=function(t,e){if(typeof t!="function")throw new JG("\`fn\` is not a function");var o=arguments.length>2&&!!arguments[2];return(!o||ZG)&&($G?Lb(t,"name",e,!0,!0):Lb(t,"name",e)),t}});var u0=nt((JY,Db)=>{"use strict";var KG=Ob(),jG=ba(),QG=Object;Db.exports=KG(function(){if(this==null||this!==QG(this))throw new jG("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},"get flags",!0)});var l0=nt((KY,Fb)=>{"use strict";var tk=u0(),ek=Vu().supportsDescriptors,nk=Object.getOwnPropertyDescriptor;Fb.exports=function(){if(ek&&/a/mig.flags==="gim"){var t=nk(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",o={};if(Object.defineProperty(o,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(o,"sticky",{get:function(){e+="y"}}),t.get.call(o),e==="dy")return t.get}}return tk}});var zb=nt((jY,Bb)=>{"use strict";var rk=Vu().supportsDescriptors,ik=l0(),ok=Ta(),sk=Object.defineProperty,ak=Vg(),Ub=Zg(),uk=/a/;Bb.exports=function(){if(!rk||!Ub)throw new ak("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=ik(),e=Ub(uk),o=ok(e,"flags");return(!o||o.get!==t)&&sk(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var Vb=nt((QY,qb)=>{"use strict";var lk=Vu(),ck=n0(),fk=u0(),Gb=l0(),hk=zb(),kb=ck(Gb());lk(kb,{getPolyfill:Gb,implementation:fk,shim:hk});qb.exports=kb});var Xb=nt((t$,Wb)=>{"use strict";var Hb=Ah(),pk=Hb("Date.prototype.getDay"),dk=function(t){try{return pk(t),!0}catch(e){return!1}},mk=Hb("Object.prototype.toString"),gk="[object Date]",yk=_h()();Wb.exports=function(t){return typeof t!="object"||t===null?!1:yk?dk(t):mk(t)===gk}});var c0=nt((e$,rT)=>{var Yb=Gg(),$b=Jw(),Zb=Sb(),Jb=Pb(),Kb=Vb(),jb=Xb(),Qb=Date.prototype.getTime;function nT(r,t,e){var o=e||{};return(o.strict?Zb(r,t):r===t)?!0:!r||!t||typeof r!="object"&&typeof t!="object"?o.strict?Zb(r,t):r==t:vk(r,t,o)}function tT(r){return r==null}function eT(r){return!(!r||typeof r!="object"||typeof r.length!="number"||typeof r.copy!="function"||typeof r.slice!="function"||r.length>0&&typeof r[0]!="number")}function vk(r,t,e){var o,a;if(typeof r!=typeof t||tT(r)||tT(t)||r.prototype!==t.prototype||$b(r)!==$b(t))return!1;var l=Jb(r),h=Jb(t);if(l!==h)return!1;if(l||h)return r.source===t.source&&Kb(r)===Kb(t);if(jb(r)&&jb(t))return Qb.call(r)===Qb.call(t);var f=eT(r),p=eT(t);if(f!==p)return!1;if(f||p){if(r.length!==t.length)return!1;for(o=0;o<r.length;o++)if(r[o]!==t[o])return!1;return!0}if(typeof r!=typeof t)return!1;try{var d=Yb(r),g=Yb(t)}catch(x){return!1}if(d.length!==g.length)return!1;for(d.sort(),g.sort(),o=d.length-1;o>=0;o--)if(d[o]!=g[o])return!1;for(o=d.length-1;o>=0;o--)if(a=d[o],!nT(r[a],t[a],e))return!1;return!0}rT.exports=nT});var M0=nt((aJ,cT)=>{var u4=c0(),No=function(r){this.precision=r&&r.precision?r.precision:17,this.direction=r&&r.direction?r.direction:!1,this.pseudoNode=r&&r.pseudoNode?r.pseudoNode:!1,this.objectComparator=r&&r.objectComparator?r.objectComparator:l4};No.prototype.compare=function(r,t){if(r.type!==t.type||!lT(r,t))return!1;switch(r.type){case"Point":return this.compareCoord(r.coordinates,t.coordinates);case"LineString":return this.compareLine(r.coordinates,t.coordinates,0,!1);case"Polygon":return this.comparePolygon(r,t);case"Feature":return this.compareFeature(r,t);default:if(r.type.indexOf("Multi")===0){var e=this,o=uT(r),a=uT(t);return o.every(function(l){return this.some(function(h){return e.compare(l,h)})},a)}}return!1};function uT(r){return r.coordinates.map(function(t){return{type:r.type.replace("Multi",""),coordinates:t}})}function lT(r,t){return r.hasOwnProperty("coordinates")?r.coordinates.length===t.coordinates.length:r.length===t.length}No.prototype.compareCoord=function(r,t){if(r.length!==t.length)return!1;for(var e=0;e<r.length;e++)if(r[e].toFixed(this.precision)!==t[e].toFixed(this.precision))return!1;return!0};No.prototype.compareLine=function(r,t,e,o){if(!lT(r,t))return!1;var a=this.pseudoNode?r:this.removePseudo(r),l=this.pseudoNode?t:this.removePseudo(t);if(!(o&&!this.compareCoord(a[0],l[0])&&(l=this.fixStartIndex(l,a),!l))){var h=this.compareCoord(a[e],l[e]);return this.direction||h?this.comparePath(a,l):this.compareCoord(a[e],l[l.length-(1+e)])?this.comparePath(a.slice().reverse(),l):!1}};No.prototype.fixStartIndex=function(r,t){for(var e,o=-1,a=0;a<r.length;a++)if(this.compareCoord(r[a],t[0])){o=a;break}return o>=0&&(e=[].concat(r.slice(o,r.length),r.slice(1,o+1))),e};No.prototype.comparePath=function(r,t){var e=this;return r.every(function(o,a){return e.compareCoord(o,this[a])},t)};No.prototype.comparePolygon=function(r,t){if(this.compareLine(r.coordinates[0],t.coordinates[0],1,!0)){var e=r.coordinates.slice(1,r.coordinates.length),o=t.coordinates.slice(1,t.coordinates.length),a=this;return e.every(function(l){return this.some(function(h){return a.compareLine(l,h,1,!0)})},o)}else return!1};No.prototype.compareFeature=function(r,t){return r.id!==t.id||!this.objectComparator(r.properties,t.properties)||!this.compareBBox(r,t)?!1:this.compare(r.geometry,t.geometry)};No.prototype.compareBBox=function(r,t){return!!(!r.bbox&&!t.bbox||r.bbox&&t.bbox&&this.compareCoord(r.bbox,t.bbox))};No.prototype.removePseudo=function(r){return r};function l4(r,t){return u4(r,t,{strict:!0})}cT.exports=No});var fT=nt((_J,Dh)=>{function qs(r,t,e,o){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(r,t,e,o)}qs.prototype.run=function(r,t,e,o){this._init(r,t,e,o);for(var a=0;a<this._datasetLength;a++)if(this._visited[a]!==1){this._visited[a]=1;var l=this._regionQuery(a);if(l.length<this.minPts)this.noise.push(a);else{var h=this.clusters.length;this.clusters.push([]),this._addToCluster(a,h),this._expandCluster(h,l)}}return this.clusters};qs.prototype._init=function(r,t,e,o){if(r){if(!(r instanceof Array))throw Error("Dataset must be of type array, "+typeof r+" given");this.dataset=r,this.clusters=[],this.noise=[],this._datasetLength=r.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}t&&(this.epsilon=t),e&&(this.minPts=e),o&&(this.distance=o)};qs.prototype._expandCluster=function(r,t){for(var e=0;e<t.length;e++){var o=t[e];if(this._visited[o]!==1){this._visited[o]=1;var a=this._regionQuery(o);a.length>=this.minPts&&(t=this._mergeArrays(t,a))}this._assigned[o]!==1&&this._addToCluster(o,r)}};qs.prototype._addToCluster=function(r,t){this.clusters[t].push(r),this._assigned[r]=1};qs.prototype._regionQuery=function(r){for(var t=[],e=0;e<this._datasetLength;e++){var o=this.distance(this.dataset[r],this.dataset[e]);o<this.epsilon&&t.push(e)}return t};qs.prototype._mergeArrays=function(r,t){for(var e=t.length,o=0;o<e;o++){var a=t[o];r.indexOf(a)<0&&r.push(a)}return r};qs.prototype._euclideanDistance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;)e+=(r[o]-t[o])*(r[o]-t[o]);return Math.sqrt(e)};typeof Dh!="undefined"&&Dh.exports&&(Dh.exports=qs)});var hT=nt((xJ,Fh)=>{function Vs(r,t,e){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(r,t,e)}Vs.prototype.init=function(r,t,e){this.assignments=[],this.centroids=[],typeof r!="undefined"&&(this.dataset=r),typeof t!="undefined"&&(this.k=t),typeof e!="undefined"&&(this.distance=e)};Vs.prototype.run=function(r,t){this.init(r,t);for(var e=this.dataset.length,o=0;o<this.k;o++)this.centroids[o]=this.randomCentroid();for(var a=!0;a;){a=this.assign();for(var l=0;l<this.k;l++){for(var h=new Array(g),f=0,p=0;p<g;p++)h[p]=0;for(var d=0;d<e;d++){var g=this.dataset[d].length;if(l===this.assignments[d]){for(var p=0;p<g;p++)h[p]+=this.dataset[d][p];f++}}if(f>0){for(var p=0;p<g;p++)h[p]/=f;this.centroids[l]=h}else this.centroids[l]=this.randomCentroid(),a=!0}}return this.getClusters()};Vs.prototype.randomCentroid=function(){var r=this.dataset.length-1,t,e;do e=Math.round(Math.random()*r),t=this.dataset[e];while(this.centroids.indexOf(t)>=0);return t};Vs.prototype.assign=function(){for(var r=!1,t=this.dataset.length,e,o=0;o<t;o++)e=this.argmin(this.dataset[o],this.centroids,this.distance),e!=this.assignments[o]&&(this.assignments[o]=e,r=!0);return r};Vs.prototype.getClusters=function(){for(var r=new Array(this.k),t,e=0;e<this.assignments.length;e++)t=this.assignments[e],typeof r[t]=="undefined"&&(r[t]=[]),r[t].push(e);return r};Vs.prototype.argmin=function(r,t,e){for(var o=Number.MAX_VALUE,a=0,l=t.length,h,f=0;f<l;f++)h=e(r,t[f]),h<o&&(o=h,a=f);return a};Vs.prototype.distance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;){var a=r[o]-t[o];e+=a*a}return Math.sqrt(e)};typeof Fh!="undefined"&&Fh.exports&&(Fh.exports=Vs)});var S0=nt((EJ,Uh)=>{function Oo(r,t,e){this._queue=[],this._priorities=[],this._sorting="desc",this._init(r,t,e)}Oo.prototype.insert=function(r,t){for(var e=this._queue.length,o=e;o--;){var a=this._priorities[o];this._sorting==="desc"?t>a&&(e=o):t<a&&(e=o)}this._insertAt(r,t,e)};Oo.prototype.remove=function(r){for(var t=this._queue.length;t--;){var e=this._queue[t];if(r===e){this._queue.splice(t,1),this._priorities.splice(t,1);break}}};Oo.prototype.forEach=function(r){this._queue.forEach(r)};Oo.prototype.getElements=function(){return this._queue};Oo.prototype.getElementPriority=function(r){return this._priorities[r]};Oo.prototype.getPriorities=function(){return this._priorities};Oo.prototype.getElementsWithPriorities=function(){for(var r=[],t=0,e=this._queue.length;t<e;t++)r.push([this._queue[t],this._priorities[t]]);return r};Oo.prototype._init=function(r,t,e){if(r&&t){if(this._queue=[],this._priorities=[],r.length!==t.length)throw new Error("Arrays must have the same length");for(var o=0;o<r.length;o++)this.insert(r[o],t[o])}e&&(this._sorting=e)};Oo.prototype._insertAt=function(r,t,e){this._queue.length===e?(this._queue.push(r),this._priorities.push(t)):(this._queue.splice(e,0,r),this._priorities.splice(e,0,t))};typeof Uh!="undefined"&&Uh.exports&&(Uh.exports=Oo)});var dT=nt((MJ,Wu)=>{typeof Wu!="undefined"&&Wu.exports&&(pT=S0());var pT;function ls(r,t,e,o){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(r,t,e,o)}ls.prototype.run=function(r,t,e,o){this._init(r,t,e,o);for(var a=0,l=this.dataset.length;a<l;a++)if(this._processed[a]!==1){this._processed[a]=1,this.clusters.push([a]);var h=this.clusters.length-1;this._orderedList.push(a);var f=new pT(null,null,"asc"),p=this._regionQuery(a);this._distanceToCore(a)!==void 0&&(this._updateQueue(a,p,f),this._expandCluster(h,f))}return this.clusters};ls.prototype.getReachabilityPlot=function(){for(var r=[],t=0,e=this._orderedList.length;t<e;t++){var o=this._orderedList[t],a=this._reachability[o];r.push([o,a])}return r};ls.prototype._init=function(r,t,e,o){if(r){if(!(r instanceof Array))throw Error("Dataset must be of type array, "+typeof r+" given");this.dataset=r,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),e&&(this.minPts=e),o&&(this.distance=o)};ls.prototype._updateQueue=function(r,t,e){var o=this;this._coreDistance=this._distanceToCore(r),t.forEach(function(a){if(o._processed[a]===void 0){var l=o.distance(o.dataset[r],o.dataset[a]),h=Math.max(o._coreDistance,l);o._reachability[a]===void 0?(o._reachability[a]=h,e.insert(a,h)):h<o._reachability[a]&&(o._reachability[a]=h,e.remove(a),e.insert(a,h))}})};ls.prototype._expandCluster=function(r,t){for(var e=t.getElements(),o=0,a=e.length;o<a;o++){var l=e[o];if(this._processed[l]===void 0){var h=this._regionQuery(l);this._processed[l]=1,this.clusters[r].push(l),this._orderedList.push(l),this._distanceToCore(l)!==void 0&&(this._updateQueue(l,h,t),this._expandCluster(r,t))}}};ls.prototype._distanceToCore=function(r){for(var t=this.epsilon,e=0;e<t;e++){var o=this._regionQuery(r,e);if(o.length>=this.minPts)return e}};ls.prototype._regionQuery=function(r,t){t=t||this.epsilon;for(var e=[],o=0,a=this.dataset.length;o<a;o++)this.distance(this.dataset[r],this.dataset[o])<t&&e.push(o);return e};ls.prototype._euclideanDistance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;)e+=(r[o]-t[o])*(r[o]-t[o]);return Math.sqrt(e)};typeof Wu!="undefined"&&Wu.exports&&(Wu.exports=ls)});var mT=nt((SJ,Bh)=>{typeof Bh!="undefined"&&Bh.exports&&(Bh.exports={DBSCAN:fT(),KMEANS:hT(),OPTICS:dT(),PriorityQueue:S0()})});var w0=nt((PJ,yT)=>{"use strict";yT.exports={eudist:function(t,e,o){for(var a=t.length,l=0,h=0;h<a;h++){var f=(t[h]||0)-(e[h]||0);l+=f*f}return o?Math.sqrt(l):l},mandist:function(t,e,o){for(var a=t.length,l=0,h=0;h<a;h++)l+=Math.abs((t[h]||0)-(e[h]||0));return o?Math.sqrt(l):l},dist:function(t,e,o){var a=Math.abs(t-e);return o?a:a*a}}});var xT=nt((IJ,_T)=>{"use strict";var vT=w0(),m4=vT.eudist,g4=vT.dist;_T.exports={kmrand:function(t,e){for(var o={},a=[],l=e<<2,h=t.length,f=t[0].length>0;a.length<e&&l-- >0;){var p=t[Math.floor(Math.random()*h)],d=f?p.join("_"):""+p;o[d]||(o[d]=!0,a.push(p))}if(a.length<e)throw new Error("Error initializating clusters");return a},kmpp:function(t,e){var o=t[0].length?m4:g4,a=[],l=t.length,h=t[0].length>0,f={},p=t[Math.floor(Math.random()*l)],d=h?p.join("_"):""+p;for(a.push(p),f[d]=!0;a.length<e;){for(var g=[],x=a.length,v=0,M=[],b=0;b<l;b++){for(var T=1/0,_=0;_<x;_++){var y=o(t[b],a[_]);y<=T&&(T=y)}g[b]=T}for(var A=0;A<l;A++)v+=g[A];for(var S=0;S<l;S++)M[S]={i:S,v:t[S],pr:g[S]/v,cs:0};M.sort(function(F,I){return F.pr-I.pr}),M[0].cs=M[0].pr;for(var L=1;L<l;L++)M[L].cs=M[L-1].cs+M[L].pr;for(var G=Math.random(),z=0;z<l-1&&M[z++].cs<G;);a.push(M[z-1].v)}return a}}});var bT=nt((NJ,wT)=>{"use strict";var b0=w0(),ST=xT(),y4=b0.eudist,RJ=b0.mandist,LJ=b0.dist,v4=ST.kmrand,_4=ST.kmpp,ET=1e4;function MT(r,t,e){e=e||[];for(var o=0;o<r;o++)e[o]=t;return e}function x4(r,t,e,o){var a=[],l=[],h=[],f=[],p=!1,d=o||ET,g=r.length,x=r[0].length,v=x>0,M=[];if(e)e=="kmrand"?a=v4(r,t):e=="kmpp"?a=_4(r,t):a=e;else for(var b={};a.length<t;){var T=Math.floor(Math.random()*g);b[T]||(b[T]=!0,a.push(r[T]))}do{MT(t,0,M);for(var _=0;_<g;_++){for(var y=1/0,A=0,S=0;S<t;S++){var f=v?y4(r[_],a[S]):Math.abs(r[_]-a[S]);f<=y&&(y=f,A=S)}h[_]=A,M[A]++}for(var L=[],l=[],G=0,z=0;z<t;z++)L[z]=v?MT(x,0,L[z]):0,l[z]=a[z];if(v){for(var F=0;F<t;F++)a[F]=[];for(var I=0;I<g;I++)for(var ut=h[I],R=L[ut],W=r[I],V=0;V<x;V++)R[V]+=W[V];p=!0;for(var Mt=0;Mt<t;Mt++){for(var X=a[Mt],mt=L[Mt],dt=l[Mt],_t=M[Mt],it=0;it<x;it++)X[it]=mt[it]/_t||0;if(p){for(var lt=0;lt<x;lt++)if(dt[lt]!=X[lt]){p=!1;break}}}}else{for(var H=0;H<g;H++){var bt=h[H];L[bt]+=r[H]}for(var Tt=0;Tt<t;Tt++)a[Tt]=L[Tt]/M[Tt]||0;p=!0;for(var Yt=0;Yt<t;Yt++)if(l[Yt]!=a[Yt]){p=!1;break}}p=p||--d<=0}while(!p);return{it:ET-d,k:t,idxs:h,centroids:a}}wT.exports=x4});var Ju=nt((R0,L0)=>{(function(r,t){typeof R0=="object"&&typeof L0!="undefined"?L0.exports=t():typeof define=="function"&&define.amd?define(t):(r=typeof globalThis!="undefined"?globalThis:r||self,r.polygonClipping=t())})(R0,function(){"use strict";function r(J,w){var P={label:0,sent:function(){if(B[0]&1)throw B[1];return B[1]},trys:[],ops:[]},D,k,B,et;return et={next:j(0),throw:j(1),return:j(2)},typeof Symbol=="function"&&(et[Symbol.iterator]=function(){return this}),et;function j(ct){return function(O){return ft([ct,O])}}function ft(ct){if(D)throw new TypeError("Generator is already executing.");for(;P;)try{if(D=1,k&&(B=ct[0]&2?k.return:ct[0]?k.throw||((B=k.return)&&B.call(k),0):k.next)&&!(B=B.call(k,ct[1])).done)return B;switch(k=0,B&&(ct=[ct[0]&2,B.value]),ct[0]){case 0:case 1:B=ct;break;case 4:return P.label++,{value:ct[1],done:!1};case 5:P.label++,k=ct[1],ct=[0];continue;case 7:ct=P.ops.pop(),P.trys.pop();continue;default:if(B=P.trys,!(B=B.length>0&&B[B.length-1])&&(ct[0]===6||ct[0]===2)){P=0;continue}if(ct[0]===3&&(!B||ct[1]>B[0]&&ct[1]<B[3])){P.label=ct[1];break}if(ct[0]===6&&P.label<B[1]){P.label=B[1],B=ct;break}if(B&&P.label<B[2]){P.label=B[2],P.ops.push(ct);break}B[2]&&P.ops.pop(),P.trys.pop();continue}ct=w.call(J,P)}catch(O){ct=[6,O],k=0}finally{D=B=0}if(ct[0]&5)throw ct[1];return{value:ct[0]?ct[1]:void 0,done:!0}}}var t=function(){function J(w,P){this.next=null,this.key=w,this.data=P,this.left=null,this.right=null}return J}();function e(J,w){return J>w?1:J<w?-1:0}function o(J,w,P){for(var D=new t(null,null),k=D,B=D;;){var et=P(J,w.key);if(et<0){if(w.left===null)break;if(P(J,w.left.key)<0){var j=w.left;if(w.left=j.right,j.right=w,w=j,w.left===null)break}B.left=w,B=w,w=w.left}else if(et>0){if(w.right===null)break;if(P(J,w.right.key)>0){var j=w.right;if(w.right=j.left,j.left=w,w=j,w.right===null)break}k.right=w,k=w,w=w.right}else break}return k.right=w.left,B.left=w.right,w.left=D.right,w.right=D.left,w}function a(J,w,P,D){var k=new t(J,w);if(P===null)return k.left=k.right=null,k;P=o(J,P,D);var B=D(J,P.key);return B<0?(k.left=P.left,k.right=P,P.left=null):B>=0&&(k.right=P.right,k.left=P,P.right=null),k}function l(J,w,P){var D=null,k=null;if(w){w=o(J,w,P);var B=P(w.key,J);B===0?(D=w.left,k=w.right):B<0?(k=w.right,w.right=null,D=w):(D=w.left,w.left=null,k=w)}return{left:D,right:k}}function h(J,w,P){return w===null?J:(J===null||(w=o(J.key,w,P),w.left=J),w)}function f(J,w,P,D,k){if(J){D(""+w+(P?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+k(J)+\`
@@ -23466,5 +23466,5 @@ void main() {
23466
23466
  }
23467
23467
 
23468
23468
  }\`,dv=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,o){if(this.texture===null){let s=new Us,l=t.properties.get(s);l.__webglTexture=e.texture,(e.depthNear!=o.depthNear||e.depthFar!=o.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=s}}render(t,e){if(this.texture!==null){if(this.mesh===null){let o=e.cameras[0].viewport,s=new Ia({extensions:{fragDepth:!0},vertexShader:sX,fragmentShader:aX,uniforms:{depthColor:{value:this.texture},depthWidth:{value:o.z},depthHeight:{value:o.w}}});this.mesh=new ra(new zd(20,20),s)}t.render(this.mesh,e)}}reset(){this.texture=null,this.mesh=null}},gv=class extends Ku{constructor(t,e){super();let o=this,s=null,l=1,p=null,h="local-floor",g=1,m=null,v=null,x=null,E=null,b=null,T=null,I=new dv,S=e.getContextAttributes(),w=null,R=null,C=[],F=[],W=new Ye,X=null,q=new gs;q.layers.enable(1),q.viewport=new ji;let D=new gs;D.layers.enable(2),D.viewport=new ji;let xt=[q,D],B=new pv;B.layers.enable(1),B.layers.enable(2);let j=null,J=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ut){let Ut=C[ut];return Ut===void 0&&(Ut=new sh,C[ut]=Ut),Ut.getTargetRaySpace()},this.getControllerGrip=function(ut){let Ut=C[ut];return Ut===void 0&&(Ut=new sh,C[ut]=Ut),Ut.getGripSpace()},this.getHand=function(ut){let Ut=C[ut];return Ut===void 0&&(Ut=new sh,C[ut]=Ut),Ut.getHandSpace()};function Dt(ut){let Ut=F.indexOf(ut.inputSource);if(Ut===-1)return;let jt=C[Ut];jt!==void 0&&(jt.update(ut.inputSource,ut.frame,m||p),jt.dispatchEvent({type:ut.type,data:ut.inputSource}))}function Q(){s.removeEventListener("select",Dt),s.removeEventListener("selectstart",Dt),s.removeEventListener("selectend",Dt),s.removeEventListener("squeeze",Dt),s.removeEventListener("squeezestart",Dt),s.removeEventListener("squeezeend",Dt),s.removeEventListener("end",Q),s.removeEventListener("inputsourceschange",At);for(let ut=0;ut<C.length;ut++){let Ut=F[ut];Ut!==null&&(F[ut]=null,C[ut].disconnect(Ut))}j=null,J=null,I.reset(),t.setRenderTarget(w),b=null,E=null,x=null,s=null,R=null,ae.stop(),o.isPresenting=!1,t.setPixelRatio(X),t.setSize(W.width,W.height,!1),o.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(ut){l=ut,o.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(ut){h=ut,o.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return m||p},this.setReferenceSpace=function(ut){m=ut},this.getBaseLayer=function(){return E!==null?E:b},this.getBinding=function(){return x},this.getFrame=function(){return T},this.getSession=function(){return s},this.setSession=function(ut){return ac(this,null,function*(){if(s=ut,s!==null){if(w=t.getRenderTarget(),s.addEventListener("select",Dt),s.addEventListener("selectstart",Dt),s.addEventListener("selectend",Dt),s.addEventListener("squeeze",Dt),s.addEventListener("squeezestart",Dt),s.addEventListener("squeezeend",Dt),s.addEventListener("end",Q),s.addEventListener("inputsourceschange",At),S.xrCompatible!==!0&&(yield e.makeXRCompatible()),X=t.getPixelRatio(),t.getSize(W),s.renderState.layers===void 0||t.capabilities.isWebGL2===!1){let Ut={antialias:s.renderState.layers===void 0?S.antialias:!0,alpha:!0,depth:S.depth,stencil:S.stencil,framebufferScaleFactor:l};b=new XRWebGLLayer(s,e,Ut),s.updateRenderState({baseLayer:b}),t.setPixelRatio(1),t.setSize(b.framebufferWidth,b.framebufferHeight,!1),R=new du(b.framebufferWidth,b.framebufferHeight,{format:na,type:$u,colorSpace:t.outputColorSpace,stencilBuffer:S.stencil})}else{let Ut=null,jt=null,ce=null;S.depth&&(ce=S.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,Ut=S.stencil?Wc:Dl,jt=S.stencil?Ol:Wu);let te={colorFormat:e.RGBA8,depthFormat:ce,scaleFactor:l};x=new XRWebGLBinding(s,e),E=x.createProjectionLayer(te),s.updateRenderState({layers:[E]}),t.setPixelRatio(1),t.setSize(E.textureWidth,E.textureHeight,!1),R=new du(E.textureWidth,E.textureHeight,{format:na,type:$u,depthTexture:new kd(E.textureWidth,E.textureHeight,jt,void 0,void 0,void 0,void 0,void 0,void 0,Ut),stencilBuffer:S.stencil,colorSpace:t.outputColorSpace,samples:S.antialias?4:0});let $t=t.properties.get(R);$t.__ignoreDepthValues=E.ignoreDepthValues}R.isXRRenderTarget=!0,this.setFoveation(g),m=null,p=yield s.requestReferenceSpace(h),ae.setContext(s),ae.start(),o.isPresenting=!0,o.dispatchEvent({type:"sessionstart"})}})},this.getEnvironmentBlendMode=function(){if(s!==null)return s.environmentBlendMode};function At(ut){for(let Ut=0;Ut<ut.removed.length;Ut++){let jt=ut.removed[Ut],ce=F.indexOf(jt);ce>=0&&(F[ce]=null,C[ce].disconnect(jt))}for(let Ut=0;Ut<ut.added.length;Ut++){let jt=ut.added[Ut],ce=F.indexOf(jt);if(ce===-1){for(let $t=0;$t<C.length;$t++)if($t>=F.length){F.push(jt),ce=$t;break}else if(F[$t]===null){F[$t]=jt,ce=$t;break}if(ce===-1)break}let te=C[ce];te&&te.connect(jt)}}let Mt=new Rt,Lt=new Rt;function pt(ut,Ut,jt){Mt.setFromMatrixPosition(Ut.matrixWorld),Lt.setFromMatrixPosition(jt.matrixWorld);let ce=Mt.distanceTo(Lt),te=Ut.projectionMatrix.elements,$t=jt.projectionMatrix.elements,qt=te[14]/(te[10]-1),xe=te[14]/(te[10]+1),ft=(te[9]+1)/te[5],We=(te[9]-1)/te[5],ee=(te[8]-1)/te[0],ge=($t[8]+1)/$t[0],fe=qt*ee,Te=qt*ge,be=ce/(-ee+ge),Wt=be*-ee;Ut.matrixWorld.decompose(ut.position,ut.quaternion,ut.scale),ut.translateX(Wt),ut.translateZ(be),ut.matrixWorld.compose(ut.position,ut.quaternion,ut.scale),ut.matrixWorldInverse.copy(ut.matrixWorld).invert();let Me=qt+be,tt=xe+be,z=fe-Wt,Pt=Te+(ce-Wt),Ot=ft*xe/tt*Me,dt=We*xe/tt*Me;ut.projectionMatrix.makePerspective(z,Pt,Ot,dt,Me,tt),ut.projectionMatrixInverse.copy(ut.projectionMatrix).invert()}function yt(ut,Ut){Ut===null?ut.matrixWorld.copy(ut.matrix):ut.matrixWorld.multiplyMatrices(Ut.matrixWorld,ut.matrix),ut.matrixWorldInverse.copy(ut.matrixWorld).invert()}this.updateCamera=function(ut){if(s===null)return;I.texture!==null&&(ut.near=I.depthNear,ut.far=I.depthFar),B.near=D.near=q.near=ut.near,B.far=D.far=q.far=ut.far,(j!==B.near||J!==B.far)&&(s.updateRenderState({depthNear:B.near,depthFar:B.far}),j=B.near,J=B.far,q.near=j,q.far=J,D.near=j,D.far=J,q.updateProjectionMatrix(),D.updateProjectionMatrix(),ut.updateProjectionMatrix());let Ut=ut.parent,jt=B.cameras;yt(B,Ut);for(let ce=0;ce<jt.length;ce++)yt(jt[ce],Ut);jt.length===2?pt(B,q,D):B.projectionMatrix.copy(q.projectionMatrix),K(ut,B,Ut)};function K(ut,Ut,jt){jt===null?ut.matrix.copy(Ut.matrixWorld):(ut.matrix.copy(jt.matrixWorld),ut.matrix.invert(),ut.matrix.multiply(Ut.matrixWorld)),ut.matrix.decompose(ut.position,ut.quaternion,ut.scale),ut.updateMatrixWorld(!0),ut.projectionMatrix.copy(Ut.projectionMatrix),ut.projectionMatrixInverse.copy(Ut.projectionMatrixInverse),ut.isPerspectiveCamera&&(ut.fov=Ky*2*Math.atan(1/ut.projectionMatrix.elements[5]),ut.zoom=1)}this.getCamera=function(){return B},this.getFoveation=function(){if(!(E===null&&b===null))return g},this.setFoveation=function(ut){g=ut,E!==null&&(E.fixedFoveation=ut),b!==null&&b.fixedFoveation!==void 0&&(b.fixedFoveation=ut)},this.hasDepthSensing=function(){return I.texture!==null};let Bt=null;function Gt(ut,Ut){if(v=Ut.getViewerPose(m||p),T=Ut,v!==null){let jt=v.views;b!==null&&(t.setRenderTargetFramebuffer(R,b.framebuffer),t.setRenderTarget(R));let ce=!1;jt.length!==B.cameras.length&&(B.cameras.length=0,ce=!0);for(let $t=0;$t<jt.length;$t++){let qt=jt[$t],xe=null;if(b!==null)xe=b.getViewport(qt);else{let We=x.getViewSubImage(E,qt);xe=We.viewport,$t===0&&(t.setRenderTargetTextures(R,We.colorTexture,E.ignoreDepthValues?void 0:We.depthStencilTexture),t.setRenderTarget(R))}let ft=xt[$t];ft===void 0&&(ft=new gs,ft.layers.enable($t),ft.viewport=new ji,xt[$t]=ft),ft.matrix.fromArray(qt.transform.matrix),ft.matrix.decompose(ft.position,ft.quaternion,ft.scale),ft.projectionMatrix.fromArray(qt.projectionMatrix),ft.projectionMatrixInverse.copy(ft.projectionMatrix).invert(),ft.viewport.set(xe.x,xe.y,xe.width,xe.height),$t===0&&(B.matrix.copy(ft.matrix),B.matrix.decompose(B.position,B.quaternion,B.scale)),ce===!0&&B.cameras.push(ft)}let te=s.enabledFeatures;if(te&&te.includes("depth-sensing")){let $t=x.getDepthInformation(jt[0]);$t&&$t.isValid&&$t.texture&&I.init(t,$t,s.renderState)}}for(let jt=0;jt<C.length;jt++){let ce=F[jt],te=C[jt];ce!==null&&te!==void 0&&te.update(ce,Ut,m||p)}I.render(t,B),Bt&&Bt(ut,Ut),Ut.detectedPlanes&&o.dispatchEvent({type:"planesdetected",data:Ut}),T=null}let ae=new xC;ae.setAnimationLoop(Gt),this.setAnimationLoop=function(ut){Bt=ut},this.dispose=function(){}}},Cl=new Ul,uX=new vi;function lX(n,t){function e(S,w){S.matrixAutoUpdate===!0&&S.updateMatrix(),w.value.copy(S.matrix)}function o(S,w){w.color.getRGB(S.fogColor.value,_C(n)),w.isFog?(S.fogNear.value=w.near,S.fogFar.value=w.far):w.isFogExp2&&(S.fogDensity.value=w.density)}function s(S,w,R,C,F){w.isMeshBasicMaterial||w.isMeshLambertMaterial?l(S,w):w.isMeshToonMaterial?(l(S,w),x(S,w)):w.isMeshPhongMaterial?(l(S,w),v(S,w)):w.isMeshStandardMaterial?(l(S,w),E(S,w),w.isMeshPhysicalMaterial&&b(S,w,F)):w.isMeshMatcapMaterial?(l(S,w),T(S,w)):w.isMeshDepthMaterial?l(S,w):w.isMeshDistanceMaterial?(l(S,w),I(S,w)):w.isMeshNormalMaterial?l(S,w):w.isLineBasicMaterial?(p(S,w),w.isLineDashedMaterial&&h(S,w)):w.isPointsMaterial?g(S,w,R,C):w.isSpriteMaterial?m(S,w):w.isShadowMaterial?(S.color.value.copy(w.color),S.opacity.value=w.opacity):w.isShaderMaterial&&(w.uniformsNeedUpdate=!1)}function l(S,w){S.opacity.value=w.opacity,w.color&&S.diffuse.value.copy(w.color),w.emissive&&S.emissive.value.copy(w.emissive).multiplyScalar(w.emissiveIntensity),w.map&&(S.map.value=w.map,e(w.map,S.mapTransform)),w.alphaMap&&(S.alphaMap.value=w.alphaMap,e(w.alphaMap,S.alphaMapTransform)),w.bumpMap&&(S.bumpMap.value=w.bumpMap,e(w.bumpMap,S.bumpMapTransform),S.bumpScale.value=w.bumpScale,w.side===$o&&(S.bumpScale.value*=-1)),w.normalMap&&(S.normalMap.value=w.normalMap,e(w.normalMap,S.normalMapTransform),S.normalScale.value.copy(w.normalScale),w.side===$o&&S.normalScale.value.negate()),w.displacementMap&&(S.displacementMap.value=w.displacementMap,e(w.displacementMap,S.displacementMapTransform),S.displacementScale.value=w.displacementScale,S.displacementBias.value=w.displacementBias),w.emissiveMap&&(S.emissiveMap.value=w.emissiveMap,e(w.emissiveMap,S.emissiveMapTransform)),w.specularMap&&(S.specularMap.value=w.specularMap,e(w.specularMap,S.specularMapTransform)),w.alphaTest>0&&(S.alphaTest.value=w.alphaTest);let R=t.get(w),C=R.envMap,F=R.envMapRotation;if(C&&(S.envMap.value=C,Cl.copy(F),Cl.x*=-1,Cl.y*=-1,Cl.z*=-1,C.isCubeTexture&&C.isRenderTargetTexture===!1&&(Cl.y*=-1,Cl.z*=-1),S.envMapRotation.value.setFromMatrix4(uX.makeRotationFromEuler(Cl)),S.flipEnvMap.value=C.isCubeTexture&&C.isRenderTargetTexture===!1?-1:1,S.reflectivity.value=w.reflectivity,S.ior.value=w.ior,S.refractionRatio.value=w.refractionRatio),w.lightMap){S.lightMap.value=w.lightMap;let W=n._useLegacyLights===!0?Math.PI:1;S.lightMapIntensity.value=w.lightMapIntensity*W,e(w.lightMap,S.lightMapTransform)}w.aoMap&&(S.aoMap.value=w.aoMap,S.aoMapIntensity.value=w.aoMapIntensity,e(w.aoMap,S.aoMapTransform))}function p(S,w){S.diffuse.value.copy(w.color),S.opacity.value=w.opacity,w.map&&(S.map.value=w.map,e(w.map,S.mapTransform))}function h(S,w){S.dashSize.value=w.dashSize,S.totalSize.value=w.dashSize+w.gapSize,S.scale.value=w.scale}function g(S,w,R,C){S.diffuse.value.copy(w.color),S.opacity.value=w.opacity,S.size.value=w.size*R,S.scale.value=C*.5,w.map&&(S.map.value=w.map,e(w.map,S.uvTransform)),w.alphaMap&&(S.alphaMap.value=w.alphaMap,e(w.alphaMap,S.alphaMapTransform)),w.alphaTest>0&&(S.alphaTest.value=w.alphaTest)}function m(S,w){S.diffuse.value.copy(w.color),S.opacity.value=w.opacity,S.rotation.value=w.rotation,w.map&&(S.map.value=w.map,e(w.map,S.mapTransform)),w.alphaMap&&(S.alphaMap.value=w.alphaMap,e(w.alphaMap,S.alphaMapTransform)),w.alphaTest>0&&(S.alphaTest.value=w.alphaTest)}function v(S,w){S.specular.value.copy(w.specular),S.shininess.value=Math.max(w.shininess,1e-4)}function x(S,w){w.gradientMap&&(S.gradientMap.value=w.gradientMap)}function E(S,w){S.metalness.value=w.metalness,w.metalnessMap&&(S.metalnessMap.value=w.metalnessMap,e(w.metalnessMap,S.metalnessMapTransform)),S.roughness.value=w.roughness,w.roughnessMap&&(S.roughnessMap.value=w.roughnessMap,e(w.roughnessMap,S.roughnessMapTransform)),t.get(w).envMap&&(S.envMapIntensity.value=w.envMapIntensity)}function b(S,w,R){S.ior.value=w.ior,w.sheen>0&&(S.sheenColor.value.copy(w.sheenColor).multiplyScalar(w.sheen),S.sheenRoughness.value=w.sheenRoughness,w.sheenColorMap&&(S.sheenColorMap.value=w.sheenColorMap,e(w.sheenColorMap,S.sheenColorMapTransform)),w.sheenRoughnessMap&&(S.sheenRoughnessMap.value=w.sheenRoughnessMap,e(w.sheenRoughnessMap,S.sheenRoughnessMapTransform))),w.clearcoat>0&&(S.clearcoat.value=w.clearcoat,S.clearcoatRoughness.value=w.clearcoatRoughness,w.clearcoatMap&&(S.clearcoatMap.value=w.clearcoatMap,e(w.clearcoatMap,S.clearcoatMapTransform)),w.clearcoatRoughnessMap&&(S.clearcoatRoughnessMap.value=w.clearcoatRoughnessMap,e(w.clearcoatRoughnessMap,S.clearcoatRoughnessMapTransform)),w.clearcoatNormalMap&&(S.clearcoatNormalMap.value=w.clearcoatNormalMap,e(w.clearcoatNormalMap,S.clearcoatNormalMapTransform),S.clearcoatNormalScale.value.copy(w.clearcoatNormalScale),w.side===$o&&S.clearcoatNormalScale.value.negate())),w.iridescence>0&&(S.iridescence.value=w.iridescence,S.iridescenceIOR.value=w.iridescenceIOR,S.iridescenceThicknessMinimum.value=w.iridescenceThicknessRange[0],S.iridescenceThicknessMaximum.value=w.iridescenceThicknessRange[1],w.iridescenceMap&&(S.iridescenceMap.value=w.iridescenceMap,e(w.iridescenceMap,S.iridescenceMapTransform)),w.iridescenceThicknessMap&&(S.iridescenceThicknessMap.value=w.iridescenceThicknessMap,e(w.iridescenceThicknessMap,S.iridescenceThicknessMapTransform))),w.transmission>0&&(S.transmission.value=w.transmission,S.transmissionSamplerMap.value=R.texture,S.transmissionSamplerSize.value.set(R.width,R.height),w.transmissionMap&&(S.transmissionMap.value=w.transmissionMap,e(w.transmissionMap,S.transmissionMapTransform)),S.thickness.value=w.thickness,w.thicknessMap&&(S.thicknessMap.value=w.thicknessMap,e(w.thicknessMap,S.thicknessMapTransform)),S.attenuationDistance.value=w.attenuationDistance,S.attenuationColor.value.copy(w.attenuationColor)),w.anisotropy>0&&(S.anisotropyVector.value.set(w.anisotropy*Math.cos(w.anisotropyRotation),w.anisotropy*Math.sin(w.anisotropyRotation)),w.anisotropyMap&&(S.anisotropyMap.value=w.anisotropyMap,e(w.anisotropyMap,S.anisotropyMapTransform))),S.specularIntensity.value=w.specularIntensity,S.specularColor.value.copy(w.specularColor),w.specularColorMap&&(S.specularColorMap.value=w.specularColorMap,e(w.specularColorMap,S.specularColorMapTransform)),w.specularIntensityMap&&(S.specularIntensityMap.value=w.specularIntensityMap,e(w.specularIntensityMap,S.specularIntensityMapTransform))}function T(S,w){w.matcap&&(S.matcap.value=w.matcap)}function I(S,w){let R=t.get(w).light;S.referencePosition.value.setFromMatrixPosition(R.matrixWorld),S.nearDistance.value=R.shadow.camera.near,S.farDistance.value=R.shadow.camera.far}return{refreshFogUniforms:o,refreshMaterialUniforms:s}}function cX(n,t,e,o){let s={},l={},p=[],h=e.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function g(R,C){let F=C.program;o.uniformBlockBinding(R,F)}function m(R,C){let F=s[R.id];F===void 0&&(T(R),F=v(R),s[R.id]=F,R.addEventListener("dispose",S));let W=C.program;o.updateUBOMapping(R,W);let X=t.render.frame;l[R.id]!==X&&(E(R),l[R.id]=X)}function v(R){let C=x();R.__bindingPointIndex=C;let F=n.createBuffer(),W=R.__size,X=R.usage;return n.bindBuffer(n.UNIFORM_BUFFER,F),n.bufferData(n.UNIFORM_BUFFER,W,X),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,C,F),F}function x(){for(let R=0;R<h;R++)if(p.indexOf(R)===-1)return p.push(R),R;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function E(R){let C=s[R.id],F=R.uniforms,W=R.__cache;n.bindBuffer(n.UNIFORM_BUFFER,C);for(let X=0,q=F.length;X<q;X++){let D=Array.isArray(F[X])?F[X]:[F[X]];for(let xt=0,B=D.length;xt<B;xt++){let j=D[xt];if(b(j,X,xt,W)===!0){let J=j.__offset,Dt=Array.isArray(j.value)?j.value:[j.value],Q=0;for(let At=0;At<Dt.length;At++){let Mt=Dt[At],Lt=I(Mt);typeof Mt=="number"||typeof Mt=="boolean"?(j.__data[0]=Mt,n.bufferSubData(n.UNIFORM_BUFFER,J+Q,j.__data)):Mt.isMatrix3?(j.__data[0]=Mt.elements[0],j.__data[1]=Mt.elements[1],j.__data[2]=Mt.elements[2],j.__data[3]=0,j.__data[4]=Mt.elements[3],j.__data[5]=Mt.elements[4],j.__data[6]=Mt.elements[5],j.__data[7]=0,j.__data[8]=Mt.elements[6],j.__data[9]=Mt.elements[7],j.__data[10]=Mt.elements[8],j.__data[11]=0):(Mt.toArray(j.__data,Q),Q+=Lt.storage/Float32Array.BYTES_PER_ELEMENT)}n.bufferSubData(n.UNIFORM_BUFFER,J,j.__data)}}}n.bindBuffer(n.UNIFORM_BUFFER,null)}function b(R,C,F,W){let X=R.value,q=C+"_"+F;if(W[q]===void 0)return typeof X=="number"||typeof X=="boolean"?W[q]=X:W[q]=X.clone(),!0;{let D=W[q];if(typeof X=="number"||typeof X=="boolean"){if(D!==X)return W[q]=X,!0}else if(D.equals(X)===!1)return D.copy(X),!0}return!1}function T(R){let C=R.uniforms,F=0,W=16;for(let q=0,D=C.length;q<D;q++){let xt=Array.isArray(C[q])?C[q]:[C[q]];for(let B=0,j=xt.length;B<j;B++){let J=xt[B],Dt=Array.isArray(J.value)?J.value:[J.value];for(let Q=0,At=Dt.length;Q<At;Q++){let Mt=Dt[Q],Lt=I(Mt),pt=F%W;pt!==0&&W-pt<Lt.boundary&&(F+=W-pt),J.__data=new Float32Array(Lt.storage/Float32Array.BYTES_PER_ELEMENT),J.__offset=F,F+=Lt.storage}}}let X=F%W;return X>0&&(F+=W-X),R.__size=F,R.__cache={},this}function I(R){let C={boundary:0,storage:0};return typeof R=="number"||typeof R=="boolean"?(C.boundary=4,C.storage=4):R.isVector2?(C.boundary=8,C.storage=8):R.isVector3||R.isColor?(C.boundary=16,C.storage=12):R.isVector4?(C.boundary=16,C.storage=16):R.isMatrix3?(C.boundary=48,C.storage=48):R.isMatrix4?(C.boundary=64,C.storage=64):R.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",R),C}function S(R){let C=R.target;C.removeEventListener("dispose",S);let F=p.indexOf(C.__bindingPointIndex);p.splice(F,1),n.deleteBuffer(s[C.id]),delete s[C.id],delete l[C.id]}function w(){for(let R in s)n.deleteBuffer(s[R]);p=[],s={},l={}}return{bind:g,update:m,dispose:w}}var mv=class{constructor(t={}){let{canvas:e=d6(),context:o=null,depth:s=!0,stencil:l=!0,alpha:p=!1,antialias:h=!1,premultipliedAlpha:g=!0,preserveDrawingBuffer:m=!1,powerPreference:v="default",failIfMajorPerformanceCaveat:x=!1}=t;this.isWebGLRenderer=!0;let E;o!==null?E=o.getContextAttributes().alpha:E=p;let b=new Uint32Array(4),T=new Int32Array(4),I=null,S=null,w=[],R=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Ta,this._useLegacyLights=!1,this.toneMapping=Yu,this.toneMappingExposure=1;let C=this,F=!1,W=0,X=0,q=null,D=-1,xt=null,B=new ji,j=new ji,J=null,Dt=new ar(0),Q=0,At=e.width,Mt=e.height,Lt=1,pt=null,yt=null,K=new ji(0,0,At,Mt),Bt=new ji(0,0,At,Mt),Gt=!1,ae=new Bd,ut=!1,Ut=!1,jt=null,ce=new vi,te=new Ye,$t=new Rt,qt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function xe(){return q===null?Lt:1}let ft=o;function We(Z,mt){for(let It=0;It<Z.length;It++){let St=Z[It],vt=e.getContext(St,mt);if(vt!==null)return vt}return null}try{let Z={alpha:!0,depth:s,stencil:l,antialias:h,premultipliedAlpha:g,preserveDrawingBuffer:m,powerPreference:v,failIfMajorPerformanceCaveat:x};if("setAttribute"in e&&e.setAttribute("data-engine",\`three.js r\${Rv}\`),e.addEventListener("webglcontextlost",Et,!1),e.addEventListener("webglcontextrestored",G,!1),e.addEventListener("webglcontextcreationerror",ot,!1),ft===null){let mt=["webgl2","webgl","experimental-webgl"];if(C.isWebGL1Renderer===!0&&mt.shift(),ft=We(mt,Z),ft===null)throw We(mt)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}typeof WebGLRenderingContext!="undefined"&&ft instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),ft.getShaderPrecisionFormat===void 0&&(ft.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(Z){throw console.error("THREE.WebGLRenderer: "+Z.message),Z}let ee,ge,fe,Te,be,Wt,Me,tt,z,Pt,Ot,dt,Ht,Ce,Vt,Zt,ne,rt,P,N,k,$,V,ht;function at(){ee=new AW(ft),ge=new xW(ft,ee,t),ee.init(ge),$=new iX(ft,ee,ge),fe=new nX(ft,ee,ge),Te=new PW(ft),be=new V9,Wt=new rX(ft,ee,fe,be,ge,$,Te),Me=new wW(C),tt=new bW(C),z=new D6(ft,ge),V=new vW(ft,ee,z,ge),Pt=new TW(ft,z,Te,V),Ot=new NW(ft,Pt,z,Te),P=new LW(ft,ge,Wt),Zt=new EW(be),dt=new H9(C,Me,tt,ee,ge,V,Zt),Ht=new lX(C,be),Ce=new X9,Vt=new j9(ee,ge),rt=new yW(C,Me,tt,fe,Ot,E,g),ne=new eX(C,Ot,ge),ht=new cX(ft,Te,ge,fe),N=new _W(ft,ee,Te,ge),k=new CW(ft,ee,Te,ge),Te.programs=dt.programs,C.capabilities=ge,C.extensions=ee,C.properties=be,C.renderLists=Ce,C.shadowMap=ne,C.state=fe,C.info=Te}at();let wt=new gv(C,ft);this.xr=wt,this.getContext=function(){return ft},this.getContextAttributes=function(){return ft.getContextAttributes()},this.forceContextLoss=function(){let Z=ee.get("WEBGL_lose_context");Z&&Z.loseContext()},this.forceContextRestore=function(){let Z=ee.get("WEBGL_lose_context");Z&&Z.restoreContext()},this.getPixelRatio=function(){return Lt},this.setPixelRatio=function(Z){Z!==void 0&&(Lt=Z,this.setSize(At,Mt,!1))},this.getSize=function(Z){return Z.set(At,Mt)},this.setSize=function(Z,mt,It=!0){if(wt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}At=Z,Mt=mt,e.width=Math.floor(Z*Lt),e.height=Math.floor(mt*Lt),It===!0&&(e.style.width=Z+"px",e.style.height=mt+"px"),this.setViewport(0,0,Z,mt)},this.getDrawingBufferSize=function(Z){return Z.set(At*Lt,Mt*Lt).floor()},this.setDrawingBufferSize=function(Z,mt,It){At=Z,Mt=mt,Lt=It,e.width=Math.floor(Z*It),e.height=Math.floor(mt*It),this.setViewport(0,0,Z,mt)},this.getCurrentViewport=function(Z){return Z.copy(B)},this.getViewport=function(Z){return Z.copy(K)},this.setViewport=function(Z,mt,It,St){Z.isVector4?K.set(Z.x,Z.y,Z.z,Z.w):K.set(Z,mt,It,St),fe.viewport(B.copy(K).multiplyScalar(Lt).round())},this.getScissor=function(Z){return Z.copy(Bt)},this.setScissor=function(Z,mt,It,St){Z.isVector4?Bt.set(Z.x,Z.y,Z.z,Z.w):Bt.set(Z,mt,It,St),fe.scissor(j.copy(Bt).multiplyScalar(Lt).round())},this.getScissorTest=function(){return Gt},this.setScissorTest=function(Z){fe.setScissorTest(Gt=Z)},this.setOpaqueSort=function(Z){pt=Z},this.setTransparentSort=function(Z){yt=Z},this.getClearColor=function(Z){return Z.copy(rt.getClearColor())},this.setClearColor=function(){rt.setClearColor.apply(rt,arguments)},this.getClearAlpha=function(){return rt.getClearAlpha()},this.setClearAlpha=function(){rt.setClearAlpha.apply(rt,arguments)},this.clear=function(Z=!0,mt=!0,It=!0){let St=0;if(Z){let vt=!1;if(q!==null){let he=q.texture.format;vt=he===pC||he===hC||he===fC}if(vt){let he=q.texture.type,ue=he===$u||he===Wu||he===Lv||he===Ol||he===lC||he===cC,we=rt.getClearColor(),de=rt.getClearAlpha(),Be=we.r,Ae=we.g,Pe=we.b;ue?(b[0]=Be,b[1]=Ae,b[2]=Pe,b[3]=de,ft.clearBufferuiv(ft.COLOR,0,b)):(T[0]=Be,T[1]=Ae,T[2]=Pe,T[3]=de,ft.clearBufferiv(ft.COLOR,0,T))}else St|=ft.COLOR_BUFFER_BIT}mt&&(St|=ft.DEPTH_BUFFER_BIT),It&&(St|=ft.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),ft.clear(St)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",Et,!1),e.removeEventListener("webglcontextrestored",G,!1),e.removeEventListener("webglcontextcreationerror",ot,!1),Ce.dispose(),Vt.dispose(),be.dispose(),Me.dispose(),tt.dispose(),Ot.dispose(),V.dispose(),ht.dispose(),dt.dispose(),ne.dispose(),wt.dispose(),wt.removeEventListener("sessionstart",qe),wt.removeEventListener("sessionend",Ue),jt&&(jt.dispose(),jt=null),Xe.stop()};function Et(Z){Z.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),F=!0}function G(){console.log("THREE.WebGLRenderer: Context Restored."),F=!1;let Z=Te.autoReset,mt=ne.enabled,It=ne.autoUpdate,St=ne.needsUpdate,vt=ne.type;at(),Te.autoReset=Z,ne.enabled=mt,ne.autoUpdate=It,ne.needsUpdate=St,ne.type=vt}function ot(Z){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",Z.statusMessage)}function et(Z){let mt=Z.target;mt.removeEventListener("dispose",et),lt(mt)}function lt(Z){Ft(Z),be.remove(Z)}function Ft(Z){let mt=be.get(Z).programs;mt!==void 0&&(mt.forEach(function(It){dt.releaseProgram(It)}),Z.isShaderMaterial&&dt.releaseShaderCache(Z))}this.renderBufferDirect=function(Z,mt,It,St,vt,he){mt===null&&(mt=qt);let ue=vt.isMesh&&vt.matrixWorld.determinant()<0,we=Qn(Z,mt,It,St,vt);fe.setMaterial(St,ue);let de=It.index,Be=1;if(St.wireframe===!0){if(de=Pt.getWireframeAttribute(It),de===void 0)return;Be=2}let Ae=It.drawRange,Pe=It.attributes.position,en=Ae.start*Be,si=(Ae.start+Ae.count)*Be;he!==null&&(en=Math.max(en,he.start*Be),si=Math.min(si,(he.start+he.count)*Be)),de!==null?(en=Math.max(en,0),si=Math.min(si,de.count)):Pe!=null&&(en=Math.max(en,0),si=Math.min(si,Pe.count));let br=si-en;if(br<0||br===1/0)return;V.setup(vt,St,we,It,de);let Vi,sr=N;if(de!==null&&(Vi=z.get(de),sr=k,sr.setIndex(Vi)),vt.isMesh)St.wireframe===!0?(fe.setLineWidth(St.wireframeLinewidth*xe()),sr.setMode(ft.LINES)):sr.setMode(ft.TRIANGLES);else if(vt.isLine){let ye=St.linewidth;ye===void 0&&(ye=1),fe.setLineWidth(ye*xe()),vt.isLineSegments?sr.setMode(ft.LINES):vt.isLineLoop?sr.setMode(ft.LINE_LOOP):sr.setMode(ft.LINE_STRIP)}else vt.isPoints?sr.setMode(ft.POINTS):vt.isSprite&&sr.setMode(ft.TRIANGLES);if(vt.isBatchedMesh)sr.renderMultiDraw(vt._multiDrawStarts,vt._multiDrawCounts,vt._multiDrawCount);else if(vt.isInstancedMesh)sr.renderInstances(en,br,vt.count);else if(It.isInstancedBufferGeometry){let ye=It._maxInstanceCount!==void 0?It._maxInstanceCount:1/0,Ua=Math.min(It.instanceCount,ye);sr.renderInstances(en,br,Ua)}else sr.render(en,br)};function Kt(Z,mt,It){Z.transparent===!0&&Z.side===cu&&Z.forceSinglePass===!1?(Z.side=$o,Z.needsUpdate=!0,rr(Z,mt,It),Z.side=Ju,Z.needsUpdate=!0,rr(Z,mt,It),Z.side=cu):rr(Z,mt,It)}this.compile=function(Z,mt,It=null){It===null&&(It=Z),S=Vt.get(It),S.init(),R.push(S),It.traverseVisible(function(vt){vt.isLight&&vt.layers.test(mt.layers)&&(S.pushLight(vt),vt.castShadow&&S.pushShadow(vt))}),Z!==It&&Z.traverseVisible(function(vt){vt.isLight&&vt.layers.test(mt.layers)&&(S.pushLight(vt),vt.castShadow&&S.pushShadow(vt))}),S.setupLights(C._useLegacyLights);let St=new Set;return Z.traverse(function(vt){let he=vt.material;if(he)if(Array.isArray(he))for(let ue=0;ue<he.length;ue++){let we=he[ue];Kt(we,It,vt),St.add(we)}else Kt(he,It,vt),St.add(he)}),R.pop(),S=null,St},this.compileAsync=function(Z,mt,It=null){let St=this.compile(Z,mt,It);return new Promise(vt=>{function he(){if(St.forEach(function(ue){be.get(ue).currentProgram.isReady()&&St.delete(ue)}),St.size===0){vt(Z);return}setTimeout(he,10)}ee.get("KHR_parallel_shader_compile")!==null?he():setTimeout(he,10)})};let me=null;function ve(Z){me&&me(Z)}function qe(){Xe.stop()}function Ue(){Xe.start()}let Xe=new xC;Xe.setAnimationLoop(ve),typeof self!="undefined"&&Xe.setContext(self),this.setAnimationLoop=function(Z){me=Z,wt.setAnimationLoop(Z),Z===null?Xe.stop():Xe.start()},wt.addEventListener("sessionstart",qe),wt.addEventListener("sessionend",Ue),this.render=function(Z,mt){if(mt!==void 0&&mt.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(F===!0)return;Z.matrixWorldAutoUpdate===!0&&Z.updateMatrixWorld(),mt.parent===null&&mt.matrixWorldAutoUpdate===!0&&mt.updateMatrixWorld(),wt.enabled===!0&&wt.isPresenting===!0&&(wt.cameraAutoUpdate===!0&&wt.updateCamera(mt),mt=wt.getCamera()),Z.isScene===!0&&Z.onBeforeRender(C,Z,mt,q),S=Vt.get(Z,R.length),S.init(),R.push(S),ce.multiplyMatrices(mt.projectionMatrix,mt.matrixWorldInverse),ae.setFromProjectionMatrix(ce),Ut=this.localClippingEnabled,ut=Zt.init(this.clippingPlanes,Ut),I=Ce.get(Z,w.length),I.init(),w.push(I),Je(Z,mt,0,C.sortObjects),I.finish(),C.sortObjects===!0&&I.sort(pt,yt),this.info.render.frame++,ut===!0&&Zt.beginShadows();let It=S.state.shadowsArray;if(ne.render(It,Z,mt),ut===!0&&Zt.endShadows(),this.info.autoReset===!0&&this.info.reset(),(wt.enabled===!1||wt.isPresenting===!1||wt.hasDepthSensing()===!1)&&rt.render(I,Z),S.setupLights(C._useLegacyLights),mt.isArrayCamera){let St=mt.cameras;for(let vt=0,he=St.length;vt<he;vt++){let ue=St[vt];wr(I,Z,ue,ue.viewport)}}else wr(I,Z,mt);q!==null&&(Wt.updateMultisampleRenderTarget(q),Wt.updateRenderTargetMipmap(q)),Z.isScene===!0&&Z.onAfterRender(C,Z,mt),V.resetDefaultState(),D=-1,xt=null,R.pop(),R.length>0?S=R[R.length-1]:S=null,w.pop(),w.length>0?I=w[w.length-1]:I=null};function Je(Z,mt,It,St){if(Z.visible===!1)return;if(Z.layers.test(mt.layers)){if(Z.isGroup)It=Z.renderOrder;else if(Z.isLOD)Z.autoUpdate===!0&&Z.update(mt);else if(Z.isLight)S.pushLight(Z),Z.castShadow&&S.pushShadow(Z);else if(Z.isSprite){if(!Z.frustumCulled||ae.intersectsSprite(Z)){St&&$t.setFromMatrixPosition(Z.matrixWorld).applyMatrix4(ce);let ue=Ot.update(Z),we=Z.material;we.visible&&I.push(Z,ue,we,It,$t.z,null)}}else if((Z.isMesh||Z.isLine||Z.isPoints)&&(!Z.frustumCulled||ae.intersectsObject(Z))){let ue=Ot.update(Z),we=Z.material;if(St&&(Z.boundingSphere!==void 0?(Z.boundingSphere===null&&Z.computeBoundingSphere(),$t.copy(Z.boundingSphere.center)):(ue.boundingSphere===null&&ue.computeBoundingSphere(),$t.copy(ue.boundingSphere.center)),$t.applyMatrix4(Z.matrixWorld).applyMatrix4(ce)),Array.isArray(we)){let de=ue.groups;for(let Be=0,Ae=de.length;Be<Ae;Be++){let Pe=de[Be],en=we[Pe.materialIndex];en&&en.visible&&I.push(Z,ue,en,It,$t.z,Pe)}}else we.visible&&I.push(Z,ue,we,It,$t.z,null)}}let he=Z.children;for(let ue=0,we=he.length;ue<we;ue++)Je(he[ue],mt,It,St)}function wr(Z,mt,It,St){let vt=Z.opaque,he=Z.transmissive,ue=Z.transparent;S.setupLightsView(It),ut===!0&&Zt.setGlobalState(C.clippingPlanes,It),he.length>0&&Jr(vt,he,mt,It),St&&fe.viewport(B.copy(St)),vt.length>0&&nr(vt,mt,It),he.length>0&&nr(he,mt,It),ue.length>0&&nr(ue,mt,It),fe.buffers.depth.setTest(!0),fe.buffers.depth.setMask(!0),fe.buffers.color.setMask(!0),fe.setPolygonOffset(!1)}function Jr(Z,mt,It,St){if((It.isScene===!0?It.overrideMaterial:null)!==null)return;let he=ge.isWebGL2;jt===null&&(jt=new du(1,1,{generateMipmaps:!0,type:ee.has("EXT_color_buffer_half_float")?ah:$u,minFilter:Ll,samples:he?4:0})),C.getDrawingBufferSize(te),he?jt.setSize(te.x,te.y):jt.setSize(jy(te.x),jy(te.y));let ue=C.getRenderTarget();C.setRenderTarget(jt),C.getClearColor(Dt),Q=C.getClearAlpha(),Q<1&&C.setClearColor(16777215,.5),C.clear();let we=C.toneMapping;C.toneMapping=Yu,nr(Z,It,St),Wt.updateMultisampleRenderTarget(jt),Wt.updateRenderTargetMipmap(jt);let de=!1;for(let Be=0,Ae=mt.length;Be<Ae;Be++){let Pe=mt[Be],en=Pe.object,si=Pe.geometry,br=Pe.material,Vi=Pe.group;if(br.side===cu&&en.layers.test(St.layers)){let sr=br.side;br.side=$o,br.needsUpdate=!0,Ie(en,It,St,si,br,Vi),br.side=sr,br.needsUpdate=!0,de=!0}}de===!0&&(Wt.updateMultisampleRenderTarget(jt),Wt.updateRenderTargetMipmap(jt)),C.setRenderTarget(ue),C.setClearColor(Dt,Q),C.toneMapping=we}function nr(Z,mt,It){let St=mt.isScene===!0?mt.overrideMaterial:null;for(let vt=0,he=Z.length;vt<he;vt++){let ue=Z[vt],we=ue.object,de=ue.geometry,Be=St===null?ue.material:St,Ae=ue.group;we.layers.test(It.layers)&&Ie(we,mt,It,de,Be,Ae)}}function Ie(Z,mt,It,St,vt,he){Z.onBeforeRender(C,mt,It,St,vt,he),Z.modelViewMatrix.multiplyMatrices(It.matrixWorldInverse,Z.matrixWorld),Z.normalMatrix.getNormalMatrix(Z.modelViewMatrix),vt.onBeforeRender(C,mt,It,St,Z,he),vt.transparent===!0&&vt.side===cu&&vt.forceSinglePass===!1?(vt.side=$o,vt.needsUpdate=!0,C.renderBufferDirect(It,mt,St,vt,Z,he),vt.side=Ju,vt.needsUpdate=!0,C.renderBufferDirect(It,mt,St,vt,Z,he),vt.side=cu):C.renderBufferDirect(It,mt,St,vt,Z,he),Z.onAfterRender(C,mt,It,St,vt,he)}function rr(Z,mt,It){mt.isScene!==!0&&(mt=qt);let St=be.get(Z),vt=S.state.lights,he=S.state.shadowsArray,ue=vt.state.version,we=dt.getParameters(Z,vt.state,he,mt,It),de=dt.getProgramCacheKey(we),Be=St.programs;St.environment=Z.isMeshStandardMaterial?mt.environment:null,St.fog=mt.fog,St.envMap=(Z.isMeshStandardMaterial?tt:Me).get(Z.envMap||St.environment),St.envMapRotation=St.environment!==null&&Z.envMap===null?mt.environmentRotation:Z.envMapRotation,Be===void 0&&(Z.addEventListener("dispose",et),Be=new Map,St.programs=Be);let Ae=Be.get(de);if(Ae!==void 0){if(St.currentProgram===Ae&&St.lightsStateVersion===ue)return ur(Z,we),Ae}else we.uniforms=dt.getUniforms(Z),Z.onBuild(It,we,C),Z.onBeforeCompile(we,C),Ae=dt.acquireProgram(we,de),Be.set(de,Ae),St.uniforms=we.uniforms;let Pe=St.uniforms;return(!Z.isShaderMaterial&&!Z.isRawShaderMaterial||Z.clipping===!0)&&(Pe.clippingPlanes=Zt.uniform),ur(Z,we),St.needsLights=oi(Z),St.lightsStateVersion=ue,St.needsLights&&(Pe.ambientLightColor.value=vt.state.ambient,Pe.lightProbe.value=vt.state.probe,Pe.directionalLights.value=vt.state.directional,Pe.directionalLightShadows.value=vt.state.directionalShadow,Pe.spotLights.value=vt.state.spot,Pe.spotLightShadows.value=vt.state.spotShadow,Pe.rectAreaLights.value=vt.state.rectArea,Pe.ltc_1.value=vt.state.rectAreaLTC1,Pe.ltc_2.value=vt.state.rectAreaLTC2,Pe.pointLights.value=vt.state.point,Pe.pointLightShadows.value=vt.state.pointShadow,Pe.hemisphereLights.value=vt.state.hemi,Pe.directionalShadowMap.value=vt.state.directionalShadowMap,Pe.directionalShadowMatrix.value=vt.state.directionalShadowMatrix,Pe.spotShadowMap.value=vt.state.spotShadowMap,Pe.spotLightMatrix.value=vt.state.spotLightMatrix,Pe.spotLightMap.value=vt.state.spotLightMap,Pe.pointShadowMap.value=vt.state.pointShadowMap,Pe.pointShadowMatrix.value=vt.state.pointShadowMatrix),St.currentProgram=Ae,St.uniformsList=null,Ae}function pr(Z){if(Z.uniformsList===null){let mt=Z.currentProgram.getUniforms();Z.uniformsList=qc.seqWithValue(mt.seq,Z.uniforms)}return Z.uniformsList}function ur(Z,mt){let It=be.get(Z);It.outputColorSpace=mt.outputColorSpace,It.batching=mt.batching,It.instancing=mt.instancing,It.instancingColor=mt.instancingColor,It.instancingMorph=mt.instancingMorph,It.skinning=mt.skinning,It.morphTargets=mt.morphTargets,It.morphNormals=mt.morphNormals,It.morphColors=mt.morphColors,It.morphTargetsCount=mt.morphTargetsCount,It.numClippingPlanes=mt.numClippingPlanes,It.numIntersection=mt.numClipIntersection,It.vertexAlphas=mt.vertexAlphas,It.vertexTangents=mt.vertexTangents,It.toneMapping=mt.toneMapping}function Qn(Z,mt,It,St,vt){mt.isScene!==!0&&(mt=qt),Wt.resetTextureUnits();let he=mt.fog,ue=St.isMeshStandardMaterial?mt.environment:null,we=q===null?C.outputColorSpace:q.isXRRenderTarget===!0?q.texture.colorSpace:tl,de=(St.isMeshStandardMaterial?tt:Me).get(St.envMap||ue),Be=St.vertexColors===!0&&!!It.attributes.color&&It.attributes.color.itemSize===4,Ae=!!It.attributes.tangent&&(!!St.normalMap||St.anisotropy>0),Pe=!!It.morphAttributes.position,en=!!It.morphAttributes.normal,si=!!It.morphAttributes.color,br=Yu;St.toneMapped&&(q===null||q.isXRRenderTarget===!0)&&(br=C.toneMapping);let Vi=It.morphAttributes.position||It.morphAttributes.normal||It.morphAttributes.color,sr=Vi!==void 0?Vi.length:0,ye=be.get(St),Ua=S.state.lights;if(ut===!0&&(Ut===!0||Z!==xt)){let Ai=Z===xt&&St.id===D;Zt.setState(St,Z,Ai)}let nn=!1;St.version===ye.__version?(ye.needsLights&&ye.lightsStateVersion!==Ua.state.version||ye.outputColorSpace!==we||vt.isBatchedMesh&&ye.batching===!1||!vt.isBatchedMesh&&ye.batching===!0||vt.isInstancedMesh&&ye.instancing===!1||!vt.isInstancedMesh&&ye.instancing===!0||vt.isSkinnedMesh&&ye.skinning===!1||!vt.isSkinnedMesh&&ye.skinning===!0||vt.isInstancedMesh&&ye.instancingColor===!0&&vt.instanceColor===null||vt.isInstancedMesh&&ye.instancingColor===!1&&vt.instanceColor!==null||vt.isInstancedMesh&&ye.instancingMorph===!0&&vt.morphTexture===null||vt.isInstancedMesh&&ye.instancingMorph===!1&&vt.morphTexture!==null||ye.envMap!==de||St.fog===!0&&ye.fog!==he||ye.numClippingPlanes!==void 0&&(ye.numClippingPlanes!==Zt.numPlanes||ye.numIntersection!==Zt.numIntersection)||ye.vertexAlphas!==Be||ye.vertexTangents!==Ae||ye.morphTargets!==Pe||ye.morphNormals!==en||ye.morphColors!==si||ye.toneMapping!==br||ge.isWebGL2===!0&&ye.morphTargetsCount!==sr)&&(nn=!0):(nn=!0,ye.__version=St.version);let fo=ye.currentProgram;nn===!0&&(fo=rr(St,mt,vt));let ul=!1,ze=!1,vs=!1,ir=fo.getUniforms(),Qo=ye.uniforms;if(fe.useProgram(fo.program)&&(ul=!0,ze=!0,vs=!0),St.id!==D&&(D=St.id,ze=!0),ul||xt!==Z){ir.setValue(ft,"projectionMatrix",Z.projectionMatrix),ir.setValue(ft,"viewMatrix",Z.matrixWorldInverse);let Ai=ir.map.cameraPosition;Ai!==void 0&&Ai.setValue(ft,$t.setFromMatrixPosition(Z.matrixWorld)),ge.logarithmicDepthBuffer&&ir.setValue(ft,"logDepthBufFC",2/(Math.log(Z.far+1)/Math.LN2)),(St.isMeshPhongMaterial||St.isMeshToonMaterial||St.isMeshLambertMaterial||St.isMeshBasicMaterial||St.isMeshStandardMaterial||St.isShaderMaterial)&&ir.setValue(ft,"isOrthographic",Z.isOrthographicCamera===!0),xt!==Z&&(xt=Z,ze=!0,vs=!0)}if(vt.isSkinnedMesh){ir.setOptional(ft,vt,"bindMatrix"),ir.setOptional(ft,vt,"bindMatrixInverse");let Ai=vt.skeleton;Ai&&(ge.floatVertexTextures?(Ai.boneTexture===null&&Ai.computeBoneTexture(),ir.setValue(ft,"boneTexture",Ai.boneTexture,Wt)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}vt.isBatchedMesh&&(ir.setOptional(ft,vt,"batchingTexture"),ir.setValue(ft,"batchingTexture",vt._matricesTexture,Wt));let Le=It.morphAttributes;if((Le.position!==void 0||Le.normal!==void 0||Le.color!==void 0&&ge.isWebGL2===!0)&&P.update(vt,It,fo),(ze||ye.receiveShadow!==vt.receiveShadow)&&(ye.receiveShadow=vt.receiveShadow,ir.setValue(ft,"receiveShadow",vt.receiveShadow)),St.isMeshGouraudMaterial&&St.envMap!==null&&(Qo.envMap.value=de,Qo.flipEnvMap.value=de.isCubeTexture&&de.isRenderTargetTexture===!1?-1:1),ze&&(ir.setValue(ft,"toneMappingExposure",C.toneMappingExposure),ye.needsLights&&bi(Qo,vs),he&&St.fog===!0&&Ht.refreshFogUniforms(Qo,he),Ht.refreshMaterialUniforms(Qo,St,Lt,Mt,jt),qc.upload(ft,pr(ye),Qo,Wt)),St.isShaderMaterial&&St.uniformsNeedUpdate===!0&&(qc.upload(ft,pr(ye),Qo,Wt),St.uniformsNeedUpdate=!1),St.isSpriteMaterial&&ir.setValue(ft,"center",vt.center),ir.setValue(ft,"modelViewMatrix",vt.modelViewMatrix),ir.setValue(ft,"normalMatrix",vt.normalMatrix),ir.setValue(ft,"modelMatrix",vt.matrixWorld),St.isShaderMaterial||St.isRawShaderMaterial){let Ai=St.uniformsGroups;for(let Ba=0,mu=Ai.length;Ba<mu;Ba++)if(ge.isWebGL2){let Ti=Ai[Ba];ht.update(Ti,fo),ht.bind(Ti,fo)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return fo}function bi(Z,mt){Z.ambientLightColor.needsUpdate=mt,Z.lightProbe.needsUpdate=mt,Z.directionalLights.needsUpdate=mt,Z.directionalLightShadows.needsUpdate=mt,Z.pointLights.needsUpdate=mt,Z.pointLightShadows.needsUpdate=mt,Z.spotLights.needsUpdate=mt,Z.spotLightShadows.needsUpdate=mt,Z.rectAreaLights.needsUpdate=mt,Z.hemisphereLights.needsUpdate=mt}function oi(Z){return Z.isMeshLambertMaterial||Z.isMeshToonMaterial||Z.isMeshPhongMaterial||Z.isMeshStandardMaterial||Z.isShadowMaterial||Z.isShaderMaterial&&Z.lights===!0}this.getActiveCubeFace=function(){return W},this.getActiveMipmapLevel=function(){return X},this.getRenderTarget=function(){return q},this.setRenderTargetTextures=function(Z,mt,It){be.get(Z.texture).__webglTexture=mt,be.get(Z.depthTexture).__webglTexture=It;let St=be.get(Z);St.__hasExternalTextures=!0,St.__autoAllocateDepthBuffer=It===void 0,St.__autoAllocateDepthBuffer||ee.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),St.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(Z,mt){let It=be.get(Z);It.__webglFramebuffer=mt,It.__useDefaultFramebuffer=mt===void 0},this.setRenderTarget=function(Z,mt=0,It=0){q=Z,W=mt,X=It;let St=!0,vt=null,he=!1,ue=!1;if(Z){let de=be.get(Z);de.__useDefaultFramebuffer!==void 0?(fe.bindFramebuffer(ft.FRAMEBUFFER,null),St=!1):de.__webglFramebuffer===void 0?Wt.setupRenderTarget(Z):de.__hasExternalTextures&&Wt.rebindTextures(Z,be.get(Z.texture).__webglTexture,be.get(Z.depthTexture).__webglTexture);let Be=Z.texture;(Be.isData3DTexture||Be.isDataArrayTexture||Be.isCompressedArrayTexture)&&(ue=!0);let Ae=be.get(Z).__webglFramebuffer;Z.isWebGLCubeRenderTarget?(Array.isArray(Ae[mt])?vt=Ae[mt][It]:vt=Ae[mt],he=!0):ge.isWebGL2&&Z.samples>0&&Wt.useMultisampledRTT(Z)===!1?vt=be.get(Z).__webglMultisampledFramebuffer:Array.isArray(Ae)?vt=Ae[It]:vt=Ae,B.copy(Z.viewport),j.copy(Z.scissor),J=Z.scissorTest}else B.copy(K).multiplyScalar(Lt).floor(),j.copy(Bt).multiplyScalar(Lt).floor(),J=Gt;if(fe.bindFramebuffer(ft.FRAMEBUFFER,vt)&&ge.drawBuffers&&St&&fe.drawBuffers(Z,vt),fe.viewport(B),fe.scissor(j),fe.setScissorTest(J),he){let de=be.get(Z.texture);ft.framebufferTexture2D(ft.FRAMEBUFFER,ft.COLOR_ATTACHMENT0,ft.TEXTURE_CUBE_MAP_POSITIVE_X+mt,de.__webglTexture,It)}else if(ue){let de=be.get(Z.texture),Be=mt||0;ft.framebufferTextureLayer(ft.FRAMEBUFFER,ft.COLOR_ATTACHMENT0,de.__webglTexture,It||0,Be)}D=-1},this.readRenderTargetPixels=function(Z,mt,It,St,vt,he,ue){if(!(Z&&Z.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let we=be.get(Z).__webglFramebuffer;if(Z.isWebGLCubeRenderTarget&&ue!==void 0&&(we=we[ue]),we){fe.bindFramebuffer(ft.FRAMEBUFFER,we);try{let de=Z.texture,Be=de.format,Ae=de.type;if(Be!==na&&$.convert(Be)!==ft.getParameter(ft.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let Pe=Ae===ah&&(ee.has("EXT_color_buffer_half_float")||ge.isWebGL2&&ee.has("EXT_color_buffer_float"));if(Ae!==$u&&$.convert(Ae)!==ft.getParameter(ft.IMPLEMENTATION_COLOR_READ_TYPE)&&!(Ae===fu&&(ge.isWebGL2||ee.has("OES_texture_float")||ee.has("WEBGL_color_buffer_float")))&&!Pe){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}mt>=0&&mt<=Z.width-St&&It>=0&&It<=Z.height-vt&&ft.readPixels(mt,It,St,vt,$.convert(Be),$.convert(Ae),he)}finally{let de=q!==null?be.get(q).__webglFramebuffer:null;fe.bindFramebuffer(ft.FRAMEBUFFER,de)}}},this.copyFramebufferToTexture=function(Z,mt,It=0){let St=Math.pow(2,-It),vt=Math.floor(mt.image.width*St),he=Math.floor(mt.image.height*St);Wt.setTexture2D(mt,0),ft.copyTexSubImage2D(ft.TEXTURE_2D,It,0,0,Z.x,Z.y,vt,he),fe.unbindTexture()},this.copyTextureToTexture=function(Z,mt,It,St=0){let vt=mt.image.width,he=mt.image.height,ue=$.convert(It.format),we=$.convert(It.type);Wt.setTexture2D(It,0),ft.pixelStorei(ft.UNPACK_FLIP_Y_WEBGL,It.flipY),ft.pixelStorei(ft.UNPACK_PREMULTIPLY_ALPHA_WEBGL,It.premultiplyAlpha),ft.pixelStorei(ft.UNPACK_ALIGNMENT,It.unpackAlignment),mt.isDataTexture?ft.texSubImage2D(ft.TEXTURE_2D,St,Z.x,Z.y,vt,he,ue,we,mt.image.data):mt.isCompressedTexture?ft.compressedTexSubImage2D(ft.TEXTURE_2D,St,Z.x,Z.y,mt.mipmaps[0].width,mt.mipmaps[0].height,ue,mt.mipmaps[0].data):ft.texSubImage2D(ft.TEXTURE_2D,St,Z.x,Z.y,ue,we,mt.image),St===0&&It.generateMipmaps&&ft.generateMipmap(ft.TEXTURE_2D),fe.unbindTexture()},this.copyTextureToTexture3D=function(Z,mt,It,St,vt=0){if(C.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let he=Math.round(Z.max.x-Z.min.x),ue=Math.round(Z.max.y-Z.min.y),we=Z.max.z-Z.min.z+1,de=$.convert(St.format),Be=$.convert(St.type),Ae;if(St.isData3DTexture)Wt.setTexture3D(St,0),Ae=ft.TEXTURE_3D;else if(St.isDataArrayTexture||St.isCompressedArrayTexture)Wt.setTexture2DArray(St,0),Ae=ft.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}ft.pixelStorei(ft.UNPACK_FLIP_Y_WEBGL,St.flipY),ft.pixelStorei(ft.UNPACK_PREMULTIPLY_ALPHA_WEBGL,St.premultiplyAlpha),ft.pixelStorei(ft.UNPACK_ALIGNMENT,St.unpackAlignment);let Pe=ft.getParameter(ft.UNPACK_ROW_LENGTH),en=ft.getParameter(ft.UNPACK_IMAGE_HEIGHT),si=ft.getParameter(ft.UNPACK_SKIP_PIXELS),br=ft.getParameter(ft.UNPACK_SKIP_ROWS),Vi=ft.getParameter(ft.UNPACK_SKIP_IMAGES),sr=It.isCompressedTexture?It.mipmaps[vt]:It.image;ft.pixelStorei(ft.UNPACK_ROW_LENGTH,sr.width),ft.pixelStorei(ft.UNPACK_IMAGE_HEIGHT,sr.height),ft.pixelStorei(ft.UNPACK_SKIP_PIXELS,Z.min.x),ft.pixelStorei(ft.UNPACK_SKIP_ROWS,Z.min.y),ft.pixelStorei(ft.UNPACK_SKIP_IMAGES,Z.min.z),It.isDataTexture||It.isData3DTexture?ft.texSubImage3D(Ae,vt,mt.x,mt.y,mt.z,he,ue,we,de,Be,sr.data):St.isCompressedArrayTexture?ft.compressedTexSubImage3D(Ae,vt,mt.x,mt.y,mt.z,he,ue,we,de,sr.data):ft.texSubImage3D(Ae,vt,mt.x,mt.y,mt.z,he,ue,we,de,Be,sr),ft.pixelStorei(ft.UNPACK_ROW_LENGTH,Pe),ft.pixelStorei(ft.UNPACK_IMAGE_HEIGHT,en),ft.pixelStorei(ft.UNPACK_SKIP_PIXELS,si),ft.pixelStorei(ft.UNPACK_SKIP_ROWS,br),ft.pixelStorei(ft.UNPACK_SKIP_IMAGES,Vi),vt===0&&St.generateMipmaps&&ft.generateMipmap(Ae),fe.unbindTexture()},this.initTexture=function(Z){Z.isCubeTexture?Wt.setTextureCube(Z,0):Z.isData3DTexture?Wt.setTexture3D(Z,0):Z.isDataArrayTexture||Z.isCompressedArrayTexture?Wt.setTexture2DArray(Z,0):Wt.setTexture2D(Z,0),fe.unbindTexture()},this.resetState=function(){W=0,X=0,q=null,fe.reset(),V.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return hu}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;let e=this.getContext();e.drawingBufferColorSpace=t===Nv?"display-p3":"srgb",e.unpackColorSpace=xr.workingColorSpace===Vd?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}},yv=class extends mv{};yv.prototype.isWebGL1Renderer=!0;var vv=class{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=t!==void 0?t.length/e:0,this.usage=Zy,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Zu()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return yC("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,o){t*=this.stride,o*=e.stride;for(let s=0,l=this.stride;s<l;s++)this.array[t+s]=e.array[o+s];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Zu()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),o=new this.constructor(e,this.stride);return o.setUsage(this.usage),o}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Zu()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}},wo=new Rt,qd=class n{constructor(t,e,o,s=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=o,this.normalized=s}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,o=this.data.count;e<o;e++)wo.fromBufferAttribute(this,e),wo.applyMatrix4(t),this.setXYZ(e,wo.x,wo.y,wo.z);return this}applyNormalMatrix(t){for(let e=0,o=this.count;e<o;e++)wo.fromBufferAttribute(this,e),wo.applyNormalMatrix(t),this.setXYZ(e,wo.x,wo.y,wo.z);return this}transformDirection(t){for(let e=0,o=this.count;e<o;e++)wo.fromBufferAttribute(this,e),wo.transformDirection(t),this.setXYZ(e,wo.x,wo.y,wo.z);return this}getComponent(t,e){let o=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(o=Pa(o,this.array)),o}setComponent(t,e,o){return this.normalized&&(o=_r(o,this.array)),this.data.array[t*this.data.stride+this.offset+e]=o,this}setX(t,e){return this.normalized&&(e=_r(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=_r(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=_r(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=_r(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=Pa(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=Pa(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=Pa(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=Pa(e,this.array)),e}setXY(t,e,o){return t=t*this.data.stride+this.offset,this.normalized&&(e=_r(e,this.array),o=_r(o,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=o,this}setXYZ(t,e,o,s){return t=t*this.data.stride+this.offset,this.normalized&&(e=_r(e,this.array),o=_r(o,this.array),s=_r(s,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=o,this.data.array[t+2]=s,this}setXYZW(t,e,o,s,l){return t=t*this.data.stride+this.offset,this.normalized&&(e=_r(e,this.array),o=_r(o,this.array),s=_r(s,this.array),l=_r(l,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=o,this.data.array[t+2]=s,this.data.array[t+3]=l,this}clone(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let o=0;o<this.count;o++){let s=o*this.data.stride+this.offset;for(let l=0;l<this.itemSize;l++)e.push(this.data.array[s+l])}return new ms(new this.array.constructor(e),this.itemSize,this.normalized)}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new n(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let o=0;o<this.count;o++){let s=o*this.data.stride+this.offset;for(let l=0;l<this.itemSize;l++)e.push(this.data.array[s+l])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}},_v=class extends Bl{constructor(t){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new ar(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}},Hu,rh=new Rt,Oc=new Rt,Dc=new Rt,Fc=new Ye,ih=new Ye,AC=new vi,yd=new Rt,oh=new Rt,vd=new Rt,rC=new Ye,qy=new Ye,iC=new Ye,xv=class extends ia{constructor(t=new _v){if(super(),this.isSprite=!0,this.type="Sprite",Hu===void 0){Hu=new Qu;let e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),o=new vv(e,5);Hu.setIndex([0,1,2,0,2,3]),Hu.setAttribute("position",new qd(o,3,0,!1)),Hu.setAttribute("uv",new qd(o,2,3,!1))}this.geometry=Hu,this.material=t,this.center=new Ye(.5,.5)}raycast(t,e){t.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Oc.setFromMatrixScale(this.matrixWorld),AC.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),Dc.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Oc.multiplyScalar(-Dc.z);let o=this.material.rotation,s,l;o!==0&&(l=Math.cos(o),s=Math.sin(o));let p=this.center;_d(yd.set(-.5,-.5,0),Dc,p,Oc,s,l),_d(oh.set(.5,-.5,0),Dc,p,Oc,s,l),_d(vd.set(.5,.5,0),Dc,p,Oc,s,l),rC.set(0,0),qy.set(1,0),iC.set(1,1);let h=t.ray.intersectTriangle(yd,oh,vd,!1,rh);if(h===null&&(_d(oh.set(-.5,.5,0),Dc,p,Oc,s,l),qy.set(0,1),h=t.ray.intersectTriangle(yd,vd,oh,!1,rh),h===null))return;let g=t.ray.origin.distanceTo(rh);g<t.near||g>t.far||e.push({distance:g,point:rh.clone(),uv:Nl.getInterpolation(rh,yd,oh,vd,rC,qy,iC,new Ye),face:null,object:this})}copy(t,e){return super.copy(t,e),t.center!==void 0&&this.center.copy(t.center),this.material=t.material,this}};xv.Dispose=function(){Hu.dispose(),Hu=void 0};function _d(n,t,e,o,s,l){Fc.subVectors(n,e).addScalar(.5).multiply(o),s!==void 0?(ih.x=l*Fc.x-s*Fc.y,ih.y=s*Fc.x+l*Fc.y):ih.copy(Fc),n.copy(t),n.x+=ih.x,n.y+=ih.y,n.applyMatrix4(AC)}function xd(n,t,e){return!n||!e&&n.constructor===t?n:typeof t.BYTES_PER_ELEMENT=="number"?new t(n):Array.prototype.slice.call(n)}function fX(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}var Yc=class{constructor(t,e,o,s){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=s!==void 0?s:new e.constructor(o),this.sampleValues=e,this.valueSize=o,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,o=this._cachedIndex,s=e[o],l=e[o-1];t:{e:{let p;n:{r:if(!(t<s)){for(let h=o+2;;){if(s===void 0){if(t<l)break r;return o=e.length,this._cachedIndex=o,this.copySampleValue_(o-1)}if(o===h)break;if(l=s,s=e[++o],t<s)break e}p=e.length;break n}if(!(t>=l)){let h=e[1];t<h&&(o=2,l=h);for(let g=o-2;;){if(l===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(o===g)break;if(s=l,l=e[--o-1],t>=l)break e}p=o,o=0;break n}break t}for(;o<p;){let h=o+p>>>1;t<e[h]?p=h:o=h+1}if(s=e[o],l=e[o-1],l===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(s===void 0)return o=e.length,this._cachedIndex=o,this.copySampleValue_(o-1)}this._cachedIndex=o,this.intervalChanged_(o,l,s)}return this.interpolate_(o,l,t,s)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,o=this.sampleValues,s=this.valueSize,l=t*s;for(let p=0;p!==s;++p)e[p]=o[l+p];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},Ev=class extends Yc{constructor(t,e,o,s){super(t,e,o,s),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:hT,endingEnd:hT}}intervalChanged_(t,e,o){let s=this.parameterPositions,l=t-2,p=t+1,h=s[l],g=s[p];if(h===void 0)switch(this.getSettings_().endingStart){case pT:l=t,h=2*e-o;break;case dT:l=s.length-2,h=e+s[l]-s[l+1];break;default:l=t,h=o}if(g===void 0)switch(this.getSettings_().endingEnd){case pT:p=t,g=2*o-e;break;case dT:p=1,g=o+s[1]-s[0];break;default:p=t-1,g=e}let m=(o-e)*.5,v=this.valueSize;this._weightPrev=m/(e-h),this._weightNext=m/(g-o),this._offsetPrev=l*v,this._offsetNext=p*v}interpolate_(t,e,o,s){let l=this.resultBuffer,p=this.sampleValues,h=this.valueSize,g=t*h,m=g-h,v=this._offsetPrev,x=this._offsetNext,E=this._weightPrev,b=this._weightNext,T=(o-e)/(s-e),I=T*T,S=I*T,w=-E*S+2*E*I-E*T,R=(1+E)*S+(-1.5-2*E)*I+(-.5+E)*T+1,C=(-1-b)*S+(1.5+b)*I+.5*T,F=b*S-b*I;for(let W=0;W!==h;++W)l[W]=w*p[v+W]+R*p[m+W]+C*p[g+W]+F*p[x+W];return l}},wv=class extends Yc{constructor(t,e,o,s){super(t,e,o,s)}interpolate_(t,e,o,s){let l=this.resultBuffer,p=this.sampleValues,h=this.valueSize,g=t*h,m=g-h,v=(o-e)/(s-e),x=1-v;for(let E=0;E!==h;++E)l[E]=p[m+E]*x+p[g+E]*v;return l}},Sv=class extends Yc{constructor(t,e,o,s){super(t,e,o,s)}interpolate_(t){return this.copySampleValue_(t-1)}},oa=class{constructor(t,e,o,s){if(t===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(e===void 0||e.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=xd(e,this.TimeBufferType),this.values=xd(o,this.ValueBufferType),this.setInterpolation(s||this.DefaultInterpolation)}static toJSON(t){let e=t.constructor,o;if(e.toJSON!==this.toJSON)o=e.toJSON(t);else{o={name:t.name,times:xd(t.times,Array),values:xd(t.values,Array)};let s=t.getInterpolation();s!==t.DefaultInterpolation&&(o.interpolation=s)}return o.type=t.ValueTypeName,o}InterpolantFactoryMethodDiscrete(t){return new Sv(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new wv(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new Ev(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case wd:e=this.InterpolantFactoryMethodDiscrete;break;case Sd:e=this.InterpolantFactoryMethodLinear;break;case gy:e=this.InterpolantFactoryMethodSmooth;break}if(e===void 0){let o="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(o);return console.warn("THREE.KeyframeTrack:",o),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return wd;case this.InterpolantFactoryMethodLinear:return Sd;case this.InterpolantFactoryMethodSmooth:return gy}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){let e=this.times;for(let o=0,s=e.length;o!==s;++o)e[o]+=t}return this}scale(t){if(t!==1){let e=this.times;for(let o=0,s=e.length;o!==s;++o)e[o]*=t}return this}trim(t,e){let o=this.times,s=o.length,l=0,p=s-1;for(;l!==s&&o[l]<t;)++l;for(;p!==-1&&o[p]>e;)--p;if(++p,l!==0||p!==s){l>=p&&(p=Math.max(p,1),l=p-1);let h=this.getValueSize();this.times=o.slice(l,p),this.values=this.values.slice(l*h,p*h)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);let o=this.times,s=this.values,l=o.length;l===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let p=null;for(let h=0;h!==l;h++){let g=o[h];if(typeof g=="number"&&isNaN(g)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,h,g),t=!1;break}if(p!==null&&p>g){console.error("THREE.KeyframeTrack: Out of order keys.",this,h,g,p),t=!1;break}p=g}if(s!==void 0&&fX(s))for(let h=0,g=s.length;h!==g;++h){let m=s[h];if(isNaN(m)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,h,m),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),o=this.getValueSize(),s=this.getInterpolation()===gy,l=t.length-1,p=1;for(let h=1;h<l;++h){let g=!1,m=t[h],v=t[h+1];if(m!==v&&(h!==1||m!==t[0]))if(s)g=!0;else{let x=h*o,E=x-o,b=x+o;for(let T=0;T!==o;++T){let I=e[x+T];if(I!==e[E+T]||I!==e[b+T]){g=!0;break}}}if(g){if(h!==p){t[p]=t[h];let x=h*o,E=p*o;for(let b=0;b!==o;++b)e[E+b]=e[x+b]}++p}}if(l>0){t[p]=t[l];for(let h=l*o,g=p*o,m=0;m!==o;++m)e[g+m]=e[h+m];++p}return p!==t.length?(this.times=t.slice(0,p),this.values=e.slice(0,p*o)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),o=this.constructor,s=new o(this.name,t,e);return s.createInterpolant=this.createInterpolant,s}};oa.prototype.TimeBufferType=Float32Array;oa.prototype.ValueBufferType=Float32Array;oa.prototype.DefaultInterpolation=Sd;var zl=class extends oa{};zl.prototype.ValueTypeName="bool";zl.prototype.ValueBufferType=Array;zl.prototype.DefaultInterpolation=wd;zl.prototype.InterpolantFactoryMethodLinear=void 0;zl.prototype.InterpolantFactoryMethodSmooth=void 0;var Mv=class extends oa{};Mv.prototype.ValueTypeName="color";var bv=class extends oa{};bv.prototype.ValueTypeName="number";var Av=class extends Yc{constructor(t,e,o,s){super(t,e,o,s)}interpolate_(t,e,o,s){let l=this.resultBuffer,p=this.sampleValues,h=this.valueSize,g=(o-e)/(s-e),m=t*h;for(let v=m+h;m!==v;m+=4)ju.slerpFlat(l,0,p,m-h,p,m,g);return l}},ch=class extends oa{InterpolantFactoryMethodLinear(t){return new Av(this.times,this.values,this.getValueSize(),t)}};ch.prototype.ValueTypeName="quaternion";ch.prototype.DefaultInterpolation=Sd;ch.prototype.InterpolantFactoryMethodSmooth=void 0;var Gl=class extends oa{};Gl.prototype.ValueTypeName="string";Gl.prototype.ValueBufferType=Array;Gl.prototype.DefaultInterpolation=wd;Gl.prototype.InterpolantFactoryMethodLinear=void 0;Gl.prototype.InterpolantFactoryMethodSmooth=void 0;var Tv=class extends oa{};Tv.prototype.ValueTypeName="vector";var Cv=class{constructor(t,e,o){let s=this,l=!1,p=0,h=0,g,m=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=o,this.itemStart=function(v){h++,l===!1&&s.onStart!==void 0&&s.onStart(v,p,h),l=!0},this.itemEnd=function(v){p++,s.onProgress!==void 0&&s.onProgress(v,p,h),p===h&&(l=!1,s.onLoad!==void 0&&s.onLoad())},this.itemError=function(v){s.onError!==void 0&&s.onError(v)},this.resolveURL=function(v){return g?g(v):v},this.setURLModifier=function(v){return g=v,this},this.addHandler=function(v,x){return m.push(v,x),this},this.removeHandler=function(v){let x=m.indexOf(v);return x!==-1&&m.splice(x,2),this},this.getHandler=function(v){for(let x=0,E=m.length;x<E;x+=2){let b=m[x],T=m[x+1];if(b.global&&(b.lastIndex=0),b.test(v))return T}return null}}},hX=new Cv,Pv=class{constructor(t){this.manager=t!==void 0?t:hX,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){let o=this;return new Promise(function(s,l){o.load(t,s,e,l)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}};Pv.DEFAULT_MATERIAL_NAME="__DEFAULT";var Dv="\\\\[\\\\]\\\\.:\\\\/",pX=new RegExp("["+Dv+"]","g"),Fv="[^"+Dv+"]",dX="[^"+Dv.replace("\\\\.","")+"]",gX=/((?:WC+[\\/:])*)/.source.replace("WC",Fv),mX=/(WCOD+)?/.source.replace("WCOD",dX),yX=/(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace("WC",Fv),vX=/\\.(WC+)(?:\\[(.+)\\])?/.source.replace("WC",Fv),_X=new RegExp("^"+gX+mX+yX+vX+"$"),xX=["material","materials","bones","map"],Iv=class{constructor(t,e,o){let s=o||Or.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,s)}getValue(t,e){this.bind();let o=this._targetGroup.nCachedObjects_,s=this._bindings[o];s!==void 0&&s.getValue(t,e)}setValue(t,e){let o=this._bindings;for(let s=this._targetGroup.nCachedObjects_,l=o.length;s!==l;++s)o[s].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,o=t.length;e!==o;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,o=t.length;e!==o;++e)t[e].unbind()}},Or=class n{constructor(t,e,o){this.path=e,this.parsedPath=o||n.parseTrackName(e),this.node=n.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,o){return t&&t.isAnimationObjectGroup?new n.Composite(t,e,o):new n(t,e,o)}static sanitizeNodeName(t){return t.replace(/\\s/g,"_").replace(pX,"")}static parseTrackName(t){let e=_X.exec(t);if(e===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);let o={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},s=o.nodeName&&o.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){let l=o.nodeName.substring(s+1);xX.indexOf(l)!==-1&&(o.nodeName=o.nodeName.substring(0,s),o.objectName=l)}if(o.propertyName===null||o.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return o}static findNode(t,e){if(e===void 0||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){let o=t.skeleton.getBoneByName(e);if(o!==void 0)return o}if(t.children){let o=function(l){for(let p=0;p<l.length;p++){let h=l[p];if(h.name===e||h.uuid===e)return h;let g=o(h.children);if(g)return g}return null},s=o(t.children);if(s)return s}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){let o=this.resolvedProperty;for(let s=0,l=o.length;s!==l;++s)t[e++]=o[s]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){let o=this.resolvedProperty;for(let s=0,l=o.length;s!==l;++s)o[s]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let o=this.resolvedProperty;for(let s=0,l=o.length;s!==l;++s)o[s]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let o=this.resolvedProperty;for(let s=0,l=o.length;s!==l;++s)o[s]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node,e=this.parsedPath,o=e.objectName,s=e.propertyName,l=e.propertyIndex;if(t||(t=n.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(o){let m=e.objectIndex;switch(o){case"materials":if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}t=t.material.materials;break;case"bones":if(!t.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}t=t.skeleton.bones;for(let v=0;v<t.length;v++)if(t[v].name===m){m=v;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}t=t.material.map;break;default:if(t[o]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}t=t[o]}if(m!==void 0){if(t[m]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);return}t=t[m]}}let p=t[s];if(p===void 0){let m=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+m+"."+s+" but it wasn't found.",t);return}let h=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?h=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(h=this.Versioning.MatrixWorldNeedsUpdate);let g=this.BindingType.Direct;if(l!==void 0){if(s==="morphTargetInfluences"){if(!t.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!t.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}t.morphTargetDictionary[l]!==void 0&&(l=t.morphTargetDictionary[l])}g=this.BindingType.ArrayElement,this.resolvedProperty=p,this.propertyIndex=l}else p.fromArray!==void 0&&p.toArray!==void 0?(g=this.BindingType.HasFromToArray,this.resolvedProperty=p):Array.isArray(p)?(g=this.BindingType.EntireArray,this.resolvedProperty=p):this.propertyName=s;this.getValue=this.GetterByBindingType[g],this.setValue=this.SetterByBindingTypeAndVersioning[g][h]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};Or.Composite=Iv;Or.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Or.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Or.prototype.GetterByBindingType=[Or.prototype._getValue_direct,Or.prototype._getValue_array,Or.prototype._getValue_arrayElement,Or.prototype._getValue_toArray];Or.prototype.SetterByBindingTypeAndVersioning=[[Or.prototype._setValue_direct,Or.prototype._setValue_direct_setNeedsUpdate,Or.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Or.prototype._setValue_array,Or.prototype._setValue_array_setNeedsUpdate,Or.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Or.prototype._setValue_arrayElement,Or.prototype._setValue_arrayElement_setNeedsUpdate,Or.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Or.prototype._setValue_fromArray,Or.prototype._setValue_fromArray_setNeedsUpdate,Or.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var Ytt=new Float32Array(1);typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Rv}}));typeof window!="undefined"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Rv);var zi=63710088e-1,Jtt={centimeters:zi*100,centimetres:zi*100,degrees:zi/111325,feet:zi*3.28084,inches:zi*39.37,kilometers:zi/1e3,kilometres:zi/1e3,meters:zi,metres:zi,miles:zi/1609.344,millimeters:zi*1e3,millimetres:zi*1e3,nauticalmiles:zi/1852,radians:1,yards:zi*1.0936},Ktt={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/zi,yards:1.0936133};function bo(n,t,e){e===void 0&&(e={});var o={type:"Feature"};return(e.id===0||e.id)&&(o.id=e.id),e.bbox&&(o.bbox=e.bbox),o.properties=t||{},o.geometry=n,o}function Pr(n,t,e){if(e===void 0&&(e={}),!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ra(n[0])||!Ra(n[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:n};return bo(o,t,e)}function Dr(n,t,e){e===void 0&&(e={});for(var o=0,s=n;o<s.length;o++){var l=s[o];if(l.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var p=0;p<l[l.length-1].length;p++)if(l[l.length-1][p]!==l[0][p])throw new Error("First and last Position are not equivalent.")}var h={type:"Polygon",coordinates:n};return bo(h,t,e)}function Gi(n,t,e){if(e===void 0&&(e={}),n.length<2)throw new Error("coordinates must be an array of two or more positions");var o={type:"LineString",coordinates:n};return bo(o,t,e)}function Uv(n,t,e){e===void 0&&(e={});var o={type:"MultiPoint",coordinates:n};return bo(o,t,e)}function Ra(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}function Ei(n,t,e){if(n!==null)for(var o,s,l,p,h,g,m,v=0,x=0,E,b=n.type,T=b==="FeatureCollection",I=b==="Feature",S=T?n.features.length:1,w=0;w<S;w++){m=T?n.features[w].geometry:I?n.geometry:n,E=m?m.type==="GeometryCollection":!1,h=E?m.geometries.length:1;for(var R=0;R<h;R++){var C=0,F=0;if(p=E?m.geometries[R]:m,p!==null){g=p.coordinates;var W=p.type;switch(v=e&&(W==="Polygon"||W==="MultiPolygon")?1:0,W){case null:break;case"Point":if(t(g,x,w,C,F)===!1)return!1;x++,C++;break;case"LineString":case"MultiPoint":for(o=0;o<g.length;o++){if(t(g[o],x,w,C,F)===!1)return!1;x++,W==="MultiPoint"&&C++}W==="LineString"&&C++;break;case"Polygon":case"MultiLineString":for(o=0;o<g.length;o++){for(s=0;s<g[o].length-v;s++){if(t(g[o][s],x,w,C,F)===!1)return!1;x++}W==="MultiLineString"&&C++,W==="Polygon"&&F++}W==="Polygon"&&C++;break;case"MultiPolygon":for(o=0;o<g.length;o++){for(F=0,s=0;s<g[o].length;s++){for(l=0;l<g[o][s].length-v;l++){if(t(g[o][s][l],x,w,C,F)===!1)return!1;x++}F++}C++}break;case"GeometryCollection":for(o=0;o<p.geometries.length;o++)if(Ei(p.geometries[o],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function TC(n,t,e,o){var s=e;return Ei(n,function(l,p,h,g,m){p===0&&e===void 0?s=l:s=t(s,l,p,h,g,m)},o),s}function el(n,t){var e,o,s,l,p,h,g,m,v,x,E=0,b=n.type==="FeatureCollection",T=n.type==="Feature",I=b?n.features.length:1;for(e=0;e<I;e++){for(h=b?n.features[e].geometry:T?n.geometry:n,m=b?n.features[e].properties:T?n.properties:{},v=b?n.features[e].bbox:T?n.bbox:void 0,x=b?n.features[e].id:T?n.id:void 0,g=h?h.type==="GeometryCollection":!1,p=g?h.geometries.length:1,s=0;s<p;s++){if(l=g?h.geometries[s]:h,l===null){if(t(null,E,m,v,x)===!1)return!1;continue}switch(l.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(l,E,m,v,x)===!1)return!1;break}case"GeometryCollection":{for(o=0;o<l.geometries.length;o++)if(t(l.geometries[o],E,m,v,x)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}E++}}function ys(n,t){el(n,function(e,o,s,l,p){var h=e===null?null:e.type;switch(h){case null:case"Point":case"LineString":case"Polygon":return t(bo(e,s,{bbox:l,id:p}),o,0)===!1?!1:void 0}var g;switch(h){case"MultiPoint":g="Point";break;case"MultiLineString":g="LineString";break;case"MultiPolygon":g="Polygon";break}for(var m=0;m<e.coordinates.length;m++){var v=e.coordinates[m],x={type:g,coordinates:v};if(t(bo(x,s),o,m)===!1)return!1}})}function Bv(n){var t=[1/0,1/0,-1/0,-1/0];return Ei(n,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}Bv.default=Bv;var Ao=Bv;function Qi(n){if(!n)throw new Error("coord is required");if(!Array.isArray(n)){if(n.type==="Feature"&&n.geometry!==null&&n.geometry.type==="Point")return n.geometry.coordinates;if(n.type==="Point")return n.coordinates}if(Array.isArray(n)&&n.length>=2&&!Array.isArray(n[0])&&!Array.isArray(n[1]))return n;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function zv(n,t,e){if(!n)throw new Error("No feature passed");if(!e)throw new Error(".featureOf() requires a name");if(!n||n.type!=="Feature"||!n.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!n.geometry||n.geometry.type!==t)throw new Error("Invalid input to "+e+": must be a "+t+", given "+n.geometry.type)}function to(n){return n.type==="Feature"?n.geometry:n}var CX=sn(Xd(),1);var BX=sn(WC(),1);function ki(n,t,e){if(e===void 0&&(e={}),!n)throw new Error("point is required");if(!t)throw new Error("polygon is required");var o=Qi(n),s=to(t),l=s.type,p=t.bbox,h=s.coordinates;if(p&&zX(o,p)===!1)return!1;l==="Polygon"&&(h=[h]);for(var g=!1,m=0;m<h.length&&!g;m++)if(XC(o,h[m][0],e.ignoreBoundary)){for(var v=!1,x=1;x<h[m].length&&!v;)XC(o,h[m][x],!e.ignoreBoundary)&&(v=!0),x++;v||(g=!0)}return g}function XC(n,t,e){var o=!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 s=0,l=t.length-1;s<t.length;l=s++){var p=t[s][0],h=t[s][1],g=t[l][0],m=t[l][1],v=n[1]*(p-g)+h*(g-n[0])+m*(n[0]-p)===0&&(p-n[0])*(g-n[0])<=0&&(h-n[1])*(m-n[1])<=0;if(v)return!e;var x=h>n[1]!=m>n[1]&&n[0]<(g-p)*(n[1]-h)/(m-h)+p;x&&(o=!o)}return o}function zX(n,t){return t[0]<=n[0]&&t[1]<=n[1]&&t[2]>=n[0]&&t[3]>=n[1]}var ZC=new ArrayBuffer(16),Cnt=new Float64Array(ZC),Pnt=new Uint32Array(ZC);var t7=sn(e_(),1);var eit=function(){function n(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 e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(var e=0;e<this.length-1;e++){var o=this.points[e],s=this.points[e+1];this.centers.push({x:(o.x+s.x)/2,y:(o.y+s.y)/2,z:(o.z+s.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var e=0;e<this.centers.length-1;e++){var l=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,p=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,h=this.points[e+1].z-(this.centers[e].y+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+l),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+p),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+h)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+l),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+p),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+h)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}return n.prototype.cacheSteps=function(t){var e=[],o=this.pos(0);e.push(0);for(var s=0;s<this.duration;s+=10){var l=this.pos(s),p=Math.sqrt((l.x-o.x)*(l.x-o.x)+(l.y-o.y)*(l.y-o.y)+(l.z-o.z)*(l.z-o.z));p>t&&(e.push(s),o=l)}return e},n.prototype.vector=function(t){var e=this.pos(t+10),o=this.pos(t-10);return{angle:180*Math.atan2(e.y-o.y,e.x-o.x)/3.14,speed:Math.sqrt((o.x-e.x)*(o.x-e.x)+(o.y-e.y)*(o.y-e.y)+(o.z-e.z)*(o.z-e.z))}},n.prototype.pos=function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var o=e/this.duration;if(o>=1)return this.points[this.length-1];var s=Math.floor((this.points.length-1)*o),l=(this.length-1)*o-s;return e7(l,this.points[s],this.controls[s][1],this.controls[s+1][0],this.points[s+1])},n}();function e7(n,t,e,o,s){var l=n7(n),p={x:s.x*l[0]+o.x*l[1]+e.x*l[2]+t.x*l[3],y:s.y*l[0]+o.y*l[1]+e.y*l[2]+t.y*l[3],z:s.z*l[0]+o.z*l[1]+e.z*l[2]+t.z*l[3]};return p}function n7(n){var t=n*n,e=t*n;return[e,3*t*(1-n),3*n*(1-n)*(1-n),(1-n)*(1-n)*(1-n)]}function dh(n,t){t===void 0&&(t={});var e=Number(n[0]),o=Number(n[1]),s=Number(n[2]),l=Number(n[3]);if(n.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var p=[e,o],h=[e,l],g=[s,l],m=[s,o];return Dr([[p,m,g,h,p]],t.properties,{bbox:n,id:t.id})}function r7(n){return dh(Ao(n))}var n_=r7;var x7=sn(sP(),1);var Y7=sn(lg(),1);var Z7=sn(Xd(),1);var j7=sn(e_(),1);var MP=Math.PI/180,bP=180/Math.PI,Eh=function(n,t){this.lon=n,this.lat=t,this.x=MP*n,this.y=MP*t};Eh.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)};Eh.prototype.antipode=function(){var n=-1*this.lat,t=this.lon<0?180+this.lon:(180-this.lon)*-1;return new Eh(t,n)};var AP=function(){this.coords=[],this.length=0};AP.prototype.move_to=function(n){this.length++,this.coords.push(n)};var w_=function(n){this.properties=n||{},this.geometries=[]};w_.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 n=[],t=0;t<this.geometries.length;t++)n.push(this.geometries[t].coords);return{geometry:{type:"MultiLineString",coordinates:n},type:"Feature",properties:this.properties}};w_.prototype.wkt=function(){for(var n="",t="LINESTRING(",e=function(l){t+=l[0]+" "+l[1]+","},o=0;o<this.geometries.length;o++){if(this.geometries[o].coords.length===0)return"LINESTRING(empty)";var s=this.geometries[o].coords;s.forEach(e),n+=t.substring(0,t.length-1)+")"}return n};var TP=function(n,t,e){if(!n||n.x===void 0||n.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 Eh(n.x,n.y),this.end=new Eh(t.x,t.y),this.properties=e||{};var o=this.start.x-this.end.x,s=this.start.y-this.end.y,l=Math.pow(Math.sin(s/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(o/2),2);if(this.g=2*Math.asin(Math.sqrt(l)),this.g===Math.PI)throw new Error("it appears "+n.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 "+n+" and "+t)};TP.prototype.interpolate=function(n){var t=Math.sin((1-n)*this.g)/Math.sin(this.g),e=Math.sin(n*this.g)/Math.sin(this.g),o=t*Math.cos(this.start.y)*Math.cos(this.start.x)+e*Math.cos(this.end.y)*Math.cos(this.end.x),s=t*Math.cos(this.start.y)*Math.sin(this.start.x)+e*Math.cos(this.end.y)*Math.sin(this.end.x),l=t*Math.sin(this.start.y)+e*Math.sin(this.end.y),p=bP*Math.atan2(l,Math.sqrt(Math.pow(o,2)+Math.pow(s,2))),h=bP*Math.atan2(s,o);return[h,p]};TP.prototype.Arc=function(n,t){var e=[];if(!n||n<=2)e.push([this.start.lon,this.start.lat]),e.push([this.end.lon,this.end.lat]);else for(var o=1/(n-1),s=0;s<n;++s){var l=o*s,p=this.interpolate(l);e.push(p)}for(var h=!1,g=0,m=t&&t.offset?t.offset:10,v=180-m,x=-180+m,E=360-m,b=1;b<e.length;++b){var T=e[b-1][0],I=e[b][0],S=Math.abs(I-T);S>E&&(I>v&&T<x||T>v&&I<x)?h=!0:S>g&&(g=S)}var w=[];if(h&&g<m){var R=[];w.push(R);for(var C=0;C<e.length;++C){var F=parseFloat(e[C][0]);if(C>0&&Math.abs(F-e[C-1][0])>E){var W=parseFloat(e[C-1][0]),X=parseFloat(e[C-1][1]),q=parseFloat(e[C][0]),D=parseFloat(e[C][1]);if(W>-180&&W<x&&q===180&&C+1<e.length&&e[C-1][0]>-180&&e[C-1][0]<x){R.push([-180,e[C][1]]),C++,R.push([e[C][0],e[C][1]]);continue}else if(W>v&&W<180&&q===-180&&C+1<e.length&&e[C-1][0]>v&&e[C-1][0]<180){R.push([180,e[C][1]]),C++,R.push([e[C][0],e[C][1]]);continue}if(W<x&&q>v){var xt=W;W=q,q=xt;var B=X;X=D,D=B}if(W>v&&q<x&&(q+=360),W<=180&&q>=180&&W<q){var j=(180-W)/(q-W),J=j*D+(1-j)*X;R.push([e[C-1][0]>v?180:-180,J]),R=[],R.push([e[C-1][0]>v?-180:180,J]),w.push(R)}else R=[],w.push(R);R.push([F,e[C][1]])}else R.push([e[C][0],e[C][1]])}}else{var Dt=[];w.push(Dt);for(var Q=0;Q<e.length;++Q)Dt.push([e[Q][0],e[Q][1]])}for(var At=new w_(this.properties),Mt=0;Mt<w.length;++Mt){var Lt=new AP;At.geometries.push(Lt);for(var pt=w[Mt],yt=0;yt<pt.length;++yt)Lt.move_to(pt[yt])}return At};var eY=sn(lg(),1);var tZ=sn(lg(),1);var eZ=sn(J_(),1);var iZ=sn(Xd(),1);var ln=[],cn=[],fn=[],hn=[],pn=[],dn=[],gn=[],mn=[],yn=[],vn=[],_n=[],xn=[],En=[],wn=[],Sn=[],Mn=[],bn=[],An=[],Tn=[],Cn=[],Pn=[],In=[],Rn=[],Ln=[];gn[85]=vn[85]=-1;mn[85]=_n[85]=0;yn[85]=xn[85]=1;Tn[85]=In[85]=1;Cn[85]=Rn[85]=0;Pn[85]=Ln[85]=1;ln[85]=hn[85]=0;cn[85]=pn[85]=-1;fn[85]=Sn[85]=0;Mn[85]=En[85]=0;bn[85]=wn[85]=1;dn[85]=An[85]=1;In[1]=In[169]=0;Rn[1]=Rn[169]=-1;Ln[1]=Ln[169]=0;En[1]=En[169]=-1;wn[1]=wn[169]=0;Sn[1]=Sn[169]=0;vn[4]=vn[166]=0;_n[4]=_n[166]=-1;xn[4]=xn[166]=1;Mn[4]=Mn[166]=1;bn[4]=bn[166]=0;An[4]=An[166]=0;gn[16]=gn[154]=0;mn[16]=mn[154]=1;yn[16]=yn[154]=1;hn[16]=hn[154]=1;pn[16]=pn[154]=0;dn[16]=dn[154]=1;Tn[64]=Tn[106]=0;Cn[64]=Cn[106]=1;Pn[64]=Pn[106]=0;ln[64]=ln[106]=-1;cn[64]=cn[106]=0;fn[64]=fn[106]=1;Tn[2]=Tn[168]=0;Cn[2]=Cn[168]=-1;Pn[2]=Pn[168]=1;In[2]=In[168]=0;Rn[2]=Rn[168]=-1;Ln[2]=Ln[168]=0;En[2]=En[168]=-1;wn[2]=wn[168]=0;Sn[2]=Sn[168]=0;Mn[2]=Mn[168]=-1;bn[2]=bn[168]=0;An[2]=An[168]=1;gn[8]=gn[162]=0;mn[8]=mn[162]=-1;yn[8]=yn[162]=0;vn[8]=vn[162]=0;_n[8]=_n[162]=-1;xn[8]=xn[162]=1;En[8]=En[162]=1;wn[8]=wn[162]=0;Sn[8]=Sn[162]=1;Mn[8]=Mn[162]=1;bn[8]=bn[162]=0;An[8]=An[162]=0;gn[32]=gn[138]=0;mn[32]=mn[138]=1;yn[32]=yn[138]=1;vn[32]=vn[138]=0;_n[32]=_n[138]=1;xn[32]=xn[138]=0;ln[32]=ln[138]=1;cn[32]=cn[138]=0;fn[32]=fn[138]=0;hn[32]=hn[138]=1;pn[32]=pn[138]=0;dn[32]=dn[138]=1;In[128]=In[42]=0;Rn[128]=Rn[42]=1;Ln[128]=Ln[42]=1;Tn[128]=Tn[42]=0;Cn[128]=Cn[42]=1;Pn[128]=Pn[42]=0;ln[128]=ln[42]=-1;cn[128]=cn[42]=0;fn[128]=fn[42]=1;hn[128]=hn[42]=-1;pn[128]=pn[42]=0;dn[128]=dn[42]=0;vn[5]=vn[165]=-1;_n[5]=_n[165]=0;xn[5]=xn[165]=0;In[5]=In[165]=1;Rn[5]=Rn[165]=0;Ln[5]=Ln[165]=0;Mn[20]=Mn[150]=0;bn[20]=bn[150]=1;An[20]=An[150]=1;hn[20]=hn[150]=0;pn[20]=pn[150]=-1;dn[20]=dn[150]=1;gn[80]=gn[90]=-1;mn[80]=mn[90]=0;yn[80]=yn[90]=1;Tn[80]=Tn[90]=1;Cn[80]=Cn[90]=0;Pn[80]=Pn[90]=1;En[65]=En[105]=0;wn[65]=wn[105]=1;Sn[65]=Sn[105]=0;ln[65]=ln[105]=0;cn[65]=cn[105]=-1;fn[65]=fn[105]=0;gn[160]=gn[10]=-1;mn[160]=mn[10]=0;yn[160]=yn[10]=1;vn[160]=vn[10]=-1;_n[160]=_n[10]=0;xn[160]=xn[10]=0;In[160]=In[10]=1;Rn[160]=Rn[10]=0;Ln[160]=Ln[10]=0;Tn[160]=Tn[10]=1;Cn[160]=Cn[10]=0;Pn[160]=Pn[10]=1;Mn[130]=Mn[40]=0;bn[130]=bn[40]=1;An[130]=An[40]=1;En[130]=En[40]=0;wn[130]=wn[40]=1;Sn[130]=Sn[40]=0;ln[130]=ln[40]=0;cn[130]=cn[40]=-1;fn[130]=fn[40]=0;hn[130]=hn[40]=0;pn[130]=pn[40]=-1;dn[130]=dn[40]=1;vn[37]=vn[133]=0;_n[37]=_n[133]=1;xn[37]=xn[133]=1;In[37]=In[133]=0;Rn[37]=Rn[133]=1;Ln[37]=Ln[133]=0;ln[37]=ln[133]=-1;cn[37]=cn[133]=0;fn[37]=fn[133]=0;hn[37]=hn[133]=1;pn[37]=pn[133]=0;dn[37]=dn[133]=0;Mn[148]=Mn[22]=-1;bn[148]=bn[22]=0;An[148]=An[22]=0;In[148]=In[22]=0;Rn[148]=Rn[22]=-1;Ln[148]=Ln[22]=1;Tn[148]=Tn[22]=0;Cn[148]=Cn[22]=1;Pn[148]=Pn[22]=1;hn[148]=hn[22]=-1;pn[148]=pn[22]=0;dn[148]=dn[22]=1;gn[82]=gn[88]=0;mn[82]=mn[88]=-1;yn[82]=yn[88]=1;Mn[82]=Mn[88]=1;bn[82]=bn[88]=0;An[82]=An[88]=1;En[82]=En[88]=-1;wn[82]=wn[88]=0;Sn[82]=Sn[88]=1;Tn[82]=Tn[88]=0;Cn[82]=Cn[88]=-1;Pn[82]=Pn[88]=0;gn[73]=gn[97]=0;mn[73]=mn[97]=1;yn[73]=yn[97]=0;vn[73]=vn[97]=0;_n[73]=_n[97]=-1;xn[73]=xn[97]=0;En[73]=En[97]=1;wn[73]=wn[97]=0;Sn[73]=Sn[97]=0;ln[73]=ln[97]=1;cn[73]=cn[97]=0;fn[73]=fn[97]=1;gn[145]=gn[25]=0;mn[145]=mn[25]=-1;yn[145]=yn[25]=0;En[145]=En[25]=1;wn[145]=wn[25]=0;Sn[145]=Sn[25]=1;In[145]=In[25]=0;Rn[145]=Rn[25]=1;Ln[145]=Ln[25]=1;hn[145]=hn[25]=-1;pn[145]=pn[25]=0;dn[145]=dn[25]=0;vn[70]=vn[100]=0;_n[70]=_n[100]=1;xn[70]=xn[100]=0;Mn[70]=Mn[100]=-1;bn[70]=bn[100]=0;An[70]=An[100]=1;Tn[70]=Tn[100]=0;Cn[70]=Cn[100]=-1;Pn[70]=Pn[100]=1;ln[70]=ln[100]=1;cn[70]=cn[100]=0;fn[70]=fn[100]=0;vn[101]=vn[69]=0;_n[101]=_n[69]=1;xn[101]=xn[69]=0;ln[101]=ln[69]=1;cn[101]=cn[69]=0;fn[101]=fn[69]=0;In[149]=In[21]=0;Rn[149]=Rn[21]=1;Ln[149]=Ln[21]=1;hn[149]=hn[21]=-1;pn[149]=pn[21]=0;dn[149]=dn[21]=0;Mn[86]=Mn[84]=-1;bn[86]=bn[84]=0;An[86]=An[84]=1;Tn[86]=Tn[84]=0;Cn[86]=Cn[84]=-1;Pn[86]=Pn[84]=1;gn[89]=gn[81]=0;mn[89]=mn[81]=-1;yn[89]=yn[81]=0;En[89]=En[81]=1;wn[89]=wn[81]=0;Sn[89]=Sn[81]=1;gn[96]=gn[74]=0;mn[96]=mn[74]=1;yn[96]=yn[74]=0;vn[96]=vn[74]=-1;_n[96]=_n[74]=0;xn[96]=xn[74]=1;Tn[96]=Tn[74]=1;Cn[96]=Cn[74]=0;Pn[96]=Pn[74]=0;ln[96]=ln[74]=1;cn[96]=cn[74]=0;fn[96]=fn[74]=1;gn[24]=gn[146]=0;mn[24]=mn[146]=-1;yn[24]=yn[146]=1;Mn[24]=Mn[146]=1;bn[24]=bn[146]=0;An[24]=An[146]=1;En[24]=En[146]=0;wn[24]=wn[146]=1;Sn[24]=Sn[146]=1;hn[24]=hn[146]=0;pn[24]=pn[146]=-1;dn[24]=dn[146]=0;vn[6]=vn[164]=-1;_n[6]=_n[164]=0;xn[6]=xn[164]=1;Mn[6]=Mn[164]=-1;bn[6]=bn[164]=0;An[6]=An[164]=0;In[6]=In[164]=0;Rn[6]=Rn[164]=-1;Ln[6]=Ln[164]=1;Tn[6]=Tn[164]=1;Cn[6]=Cn[164]=0;Pn[6]=Pn[164]=0;En[129]=En[41]=0;wn[129]=wn[41]=1;Sn[129]=Sn[41]=1;In[129]=In[41]=0;Rn[129]=Rn[41]=1;Ln[129]=Ln[41]=0;ln[129]=ln[41]=-1;cn[129]=cn[41]=0;fn[129]=fn[41]=0;hn[129]=hn[41]=0;pn[129]=pn[41]=-1;dn[129]=dn[41]=0;Mn[66]=Mn[104]=0;bn[66]=bn[104]=1;An[66]=An[104]=0;En[66]=En[104]=-1;wn[66]=wn[104]=0;Sn[66]=Sn[104]=1;Tn[66]=Tn[104]=0;Cn[66]=Cn[104]=-1;Pn[66]=Pn[104]=0;ln[66]=ln[104]=0;cn[66]=cn[104]=-1;fn[66]=fn[104]=1;gn[144]=gn[26]=-1;mn[144]=mn[26]=0;yn[144]=yn[26]=0;In[144]=In[26]=1;Rn[144]=Rn[26]=0;Ln[144]=Ln[26]=1;Tn[144]=Tn[26]=0;Cn[144]=Cn[26]=1;Pn[144]=Pn[26]=1;hn[144]=hn[26]=-1;pn[144]=pn[26]=0;dn[144]=dn[26]=1;vn[36]=vn[134]=0;_n[36]=_n[134]=1;xn[36]=xn[134]=1;Mn[36]=Mn[134]=0;bn[36]=bn[134]=1;An[36]=An[134]=0;ln[36]=ln[134]=0;cn[36]=cn[134]=-1;fn[36]=fn[134]=1;hn[36]=hn[134]=1;pn[36]=pn[134]=0;dn[36]=dn[134]=0;gn[9]=gn[161]=-1;mn[9]=mn[161]=0;yn[9]=yn[161]=0;vn[9]=vn[161]=0;_n[9]=_n[161]=-1;xn[9]=xn[161]=0;En[9]=En[161]=1;wn[9]=wn[161]=0;Sn[9]=Sn[161]=0;In[9]=In[161]=1;Rn[9]=Rn[161]=0;Ln[9]=Ln[161]=1;gn[136]=0;mn[136]=1;yn[136]=1;vn[136]=0;_n[136]=1;xn[136]=0;Mn[136]=-1;bn[136]=0;An[136]=1;En[136]=-1;wn[136]=0;Sn[136]=0;In[136]=0;Rn[136]=-1;Ln[136]=0;Tn[136]=0;Cn[136]=-1;Pn[136]=1;ln[136]=1;cn[136]=0;fn[136]=0;hn[136]=1;pn[136]=0;dn[136]=1;gn[34]=0;mn[34]=-1;yn[34]=0;vn[34]=0;_n[34]=-1;xn[34]=1;Mn[34]=1;bn[34]=0;An[34]=0;En[34]=1;wn[34]=0;Sn[34]=1;In[34]=0;Rn[34]=1;Ln[34]=1;Tn[34]=0;Cn[34]=1;Pn[34]=0;ln[34]=-1;cn[34]=0;fn[34]=1;hn[34]=-1;pn[34]=0;dn[34]=0;gn[35]=0;mn[35]=1;yn[35]=1;vn[35]=0;_n[35]=-1;xn[35]=1;Mn[35]=1;bn[35]=0;An[35]=0;En[35]=-1;wn[35]=0;Sn[35]=0;In[35]=0;Rn[35]=-1;Ln[35]=0;Tn[35]=0;Cn[35]=1;Pn[35]=0;ln[35]=-1;cn[35]=0;fn[35]=1;hn[35]=1;pn[35]=0;dn[35]=1;gn[153]=0;mn[153]=1;yn[153]=1;En[153]=-1;wn[153]=0;Sn[153]=0;In[153]=0;Rn[153]=-1;Ln[153]=0;hn[153]=1;pn[153]=0;dn[153]=1;vn[102]=0;_n[102]=-1;xn[102]=1;Mn[102]=1;bn[102]=0;An[102]=0;Tn[102]=0;Cn[102]=1;Pn[102]=0;ln[102]=-1;cn[102]=0;fn[102]=1;gn[155]=0;mn[155]=-1;yn[155]=0;En[155]=1;wn[155]=0;Sn[155]=1;In[155]=0;Rn[155]=1;Ln[155]=1;hn[155]=-1;pn[155]=0;dn[155]=0;vn[103]=0;_n[103]=1;xn[103]=0;Mn[103]=-1;bn[103]=0;An[103]=1;Tn[103]=0;Cn[103]=-1;Pn[103]=1;ln[103]=1;cn[103]=0;fn[103]=0;gn[152]=0;mn[152]=1;yn[152]=1;Mn[152]=-1;bn[152]=0;An[152]=1;En[152]=-1;wn[152]=0;Sn[152]=0;In[152]=0;Rn[152]=-1;Ln[152]=0;Tn[152]=0;Cn[152]=-1;Pn[152]=1;hn[152]=1;pn[152]=0;dn[152]=1;gn[156]=0;mn[156]=-1;yn[156]=1;Mn[156]=1;bn[156]=0;An[156]=1;En[156]=-1;wn[156]=0;Sn[156]=0;In[156]=0;Rn[156]=-1;Ln[156]=0;Tn[156]=0;Cn[156]=1;Pn[156]=1;hn[156]=-1;pn[156]=0;dn[156]=1;gn[137]=0;mn[137]=1;yn[137]=1;vn[137]=0;_n[137]=1;xn[137]=0;En[137]=-1;wn[137]=0;Sn[137]=0;In[137]=0;Rn[137]=-1;Ln[137]=0;ln[137]=1;cn[137]=0;fn[137]=0;hn[137]=1;pn[137]=0;dn[137]=1;gn[139]=0;mn[139]=1;yn[139]=1;vn[139]=0;_n[139]=-1;xn[139]=0;En[139]=1;wn[139]=0;Sn[139]=0;In[139]=0;Rn[139]=1;Ln[139]=0;ln[139]=-1;cn[139]=0;fn[139]=0;hn[139]=1;pn[139]=0;dn[139]=1;gn[98]=0;mn[98]=-1;yn[98]=0;vn[98]=0;_n[98]=-1;xn[98]=1;Mn[98]=1;bn[98]=0;An[98]=0;En[98]=1;wn[98]=0;Sn[98]=1;Tn[98]=0;Cn[98]=1;Pn[98]=0;ln[98]=-1;cn[98]=0;fn[98]=1;gn[99]=0;mn[99]=1;yn[99]=0;vn[99]=0;_n[99]=-1;xn[99]=1;Mn[99]=1;bn[99]=0;An[99]=0;En[99]=-1;wn[99]=0;Sn[99]=1;Tn[99]=0;Cn[99]=-1;Pn[99]=0;ln[99]=1;cn[99]=0;fn[99]=1;vn[38]=0;_n[38]=-1;xn[38]=1;Mn[38]=1;bn[38]=0;An[38]=0;In[38]=0;Rn[38]=1;Ln[38]=1;Tn[38]=0;Cn[38]=1;Pn[38]=0;ln[38]=-1;cn[38]=0;fn[38]=1;hn[38]=-1;pn[38]=0;dn[38]=0;vn[39]=0;_n[39]=1;xn[39]=1;Mn[39]=-1;bn[39]=0;An[39]=0;In[39]=0;Rn[39]=-1;Ln[39]=1;Tn[39]=0;Cn[39]=1;Pn[39]=0;ln[39]=-1;cn[39]=0;fn[39]=1;hn[39]=1;pn[39]=0;dn[39]=0;var K_=function(n){return[[n.bottomleft,0],[0,0],[0,n.leftbottom]]},j_=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0]]},Q_=function(n){return[[n.topright,1],[1,1],[1,n.righttop]]},t1=function(n){return[[0,n.lefttop],[0,1],[n.topleft,1]]},e1=function(n){return[[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop]]},n1=function(n){return[[n.bottomright,0],[n.bottomleft,0],[1,n.righttop],[1,n.rightbottom]]},r1=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.topleft,1],[n.topright,1]]},i1=function(n){return[[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},oZ=function(n){return[[0,0],[0,n.leftbottom],[1,n.rightbottom],[1,0]]},sZ=function(n){return[[1,0],[n.bottomright,0],[n.topright,1],[1,1]]},aZ=function(n){return[[1,1],[1,n.righttop],[0,n.lefttop],[0,1]]},uZ=function(n){return[[n.bottomleft,0],[0,0],[0,1],[n.topleft,1]]},lZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[0,n.leftbottom],[0,n.lefttop]]},cZ=function(n){return[[n.topleft,1],[n.topright,1],[n.bottomright,0],[n.bottomleft,0]]},fZ=function(){return[[0,0],[0,1],[1,1],[1,0]]},hZ=function(n){return[[1,n.rightbottom],[1,0],[0,0],[0,1],[n.topleft,1]]},pZ=function(n){return[[n.topright,1],[1,1],[1,0],[0,0],[0,n.leftbottom]]},dZ=function(n){return[[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[1,1]]},gZ=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,1]]},mZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[0,n.lefttop],[0,1],[n.topleft,1]]},yZ=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[n.topright,1]]},vZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop]]},_Z=function(n){return[[n.topright,1],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topleft,1]]},xZ=function(n){return[[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1],[n.topleft,1]]},EZ=function(n){return[[1,1],[1,n.righttop],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},wZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[n.topleft,1],[n.topright,1]]},SZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,n.leftbottom]]},MZ=function(n){return[[1,n.rightbottom],[1,0],[0,0],[0,n.leftbottom],[n.topleft,1],[n.topright,1]]},bZ=function(n){return[[1,1],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},AZ=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1]]},TZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,1],[n.topleft,1]]},CZ=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topright,1]]},PZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[n.topleft,1]]},IZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},RZ=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topright,1]]},LZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[n.topleft,1]]},NZ=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},OZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topleft,1],[n.topright,1]]},DZ=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1],[n.topleft,1]]},FZ=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},Un=[],Bn=[],zn=[],Gn=[],kn=[],qn=[],Hn=[],Vn=[];Gn[1]=kn[1]=18;Gn[169]=kn[169]=18;zn[4]=Bn[4]=12;zn[166]=Bn[166]=12;Un[16]=Vn[16]=4;Un[154]=Vn[154]=4;qn[64]=Hn[64]=22;qn[106]=Hn[106]=22;zn[2]=qn[2]=17;Gn[2]=kn[2]=18;zn[168]=qn[168]=17;Gn[168]=kn[168]=18;Un[8]=Gn[8]=9;Bn[8]=zn[8]=12;Un[162]=Gn[162]=9;Bn[162]=zn[162]=12;Un[32]=Vn[32]=4;Bn[32]=Hn[32]=1;Un[138]=Vn[138]=4;Bn[138]=Hn[138]=1;kn[128]=Vn[128]=21;qn[128]=Hn[128]=22;kn[42]=Vn[42]=21;qn[42]=Hn[42]=22;Bn[5]=kn[5]=14;Bn[165]=kn[165]=14;zn[20]=Vn[20]=6;zn[150]=Vn[150]=6;Un[80]=qn[80]=11;Un[90]=qn[90]=11;Gn[65]=Hn[65]=3;Gn[105]=Hn[105]=3;Un[160]=qn[160]=11;Bn[160]=kn[160]=14;Un[10]=qn[10]=11;Bn[10]=kn[10]=14;zn[130]=Vn[130]=6;Gn[130]=Hn[130]=3;zn[40]=Vn[40]=6;Gn[40]=Hn[40]=3;Bn[101]=Hn[101]=1;Bn[69]=Hn[69]=1;kn[149]=Vn[149]=21;kn[21]=Vn[21]=21;zn[86]=qn[86]=17;zn[84]=qn[84]=17;Un[89]=Gn[89]=9;Un[81]=Gn[81]=9;Un[96]=Hn[96]=0;Bn[96]=qn[96]=15;Un[74]=Hn[74]=0;Bn[74]=qn[74]=15;Un[24]=zn[24]=8;Gn[24]=Vn[24]=7;Un[146]=zn[146]=8;Gn[146]=Vn[146]=7;Bn[6]=qn[6]=15;zn[6]=kn[6]=16;Bn[164]=qn[164]=15;zn[164]=kn[164]=16;Gn[129]=Vn[129]=7;kn[129]=Hn[129]=20;Gn[41]=Vn[41]=7;kn[41]=Hn[41]=20;zn[66]=Hn[66]=2;Gn[66]=qn[66]=19;zn[104]=Hn[104]=2;Gn[104]=qn[104]=19;Un[144]=kn[144]=10;qn[144]=Vn[144]=23;Un[26]=kn[26]=10;qn[26]=Vn[26]=23;Bn[36]=Vn[36]=5;zn[36]=Hn[36]=2;Bn[134]=Vn[134]=5;zn[134]=Hn[134]=2;Un[9]=kn[9]=10;Bn[9]=Gn[9]=13;Un[161]=kn[161]=10;Bn[161]=Gn[161]=13;Bn[37]=Vn[37]=5;kn[37]=Hn[37]=20;Bn[133]=Vn[133]=5;kn[133]=Hn[133]=20;zn[148]=kn[148]=16;qn[148]=Vn[148]=23;zn[22]=kn[22]=16;qn[22]=Vn[22]=23;Un[82]=zn[82]=8;Gn[82]=qn[82]=19;Un[88]=zn[88]=8;Gn[88]=qn[88]=19;Un[73]=Hn[73]=0;Bn[73]=Gn[73]=13;Un[97]=Hn[97]=0;Bn[97]=Gn[97]=13;Un[145]=Gn[145]=9;kn[145]=Vn[145]=21;Un[25]=Gn[25]=9;kn[25]=Vn[25]=21;Bn[70]=Hn[70]=1;zn[70]=qn[70]=17;Bn[100]=Hn[100]=1;zn[100]=qn[100]=17;Un[34]=Gn[34]=9;Bn[34]=zn[34]=12;kn[34]=Vn[34]=21;qn[34]=Hn[34]=22;Un[136]=Vn[136]=4;Bn[136]=Hn[136]=1;zn[136]=qn[136]=17;Gn[136]=kn[136]=18;Un[35]=Vn[35]=4;Bn[35]=zn[35]=12;Gn[35]=kn[35]=18;qn[35]=Hn[35]=22;Un[153]=Vn[153]=4;Gn[153]=kn[153]=18;Bn[102]=zn[102]=12;qn[102]=Hn[102]=22;Un[155]=Gn[155]=9;kn[155]=Vn[155]=23;Bn[103]=Hn[103]=1;zn[103]=qn[103]=17;Un[152]=Vn[152]=4;zn[152]=qn[152]=17;Gn[152]=kn[152]=18;Un[156]=zn[156]=8;Gn[156]=kn[156]=18;qn[156]=Vn[156]=23;Un[137]=Vn[137]=4;Bn[137]=Hn[137]=1;Gn[137]=kn[137]=18;Un[139]=Vn[139]=4;Bn[139]=Gn[139]=13;kn[139]=Hn[139]=20;Un[98]=Gn[98]=9;Bn[98]=zn[98]=12;qn[98]=Hn[98]=22;Un[99]=Hn[99]=0;Bn[99]=zn[99]=12;Gn[99]=qn[99]=19;Bn[38]=zn[38]=12;kn[38]=Vn[38]=21;qn[38]=Hn[38]=22;Bn[39]=Vn[39]=5;zn[39]=kn[39]=16;qn[39]=Hn[39]=22;var re=[];re[1]=re[169]=K_;re[4]=re[166]=j_;re[16]=re[154]=Q_;re[64]=re[106]=t1;re[168]=re[2]=e1;re[162]=re[8]=n1;re[138]=re[32]=r1;re[42]=re[128]=i1;re[5]=re[165]=oZ;re[20]=re[150]=sZ;re[80]=re[90]=aZ;re[65]=re[105]=uZ;re[160]=re[10]=lZ;re[130]=re[40]=cZ;re[85]=fZ;re[101]=re[69]=hZ;re[149]=re[21]=pZ;re[86]=re[84]=dZ;re[89]=re[81]=gZ;re[96]=re[74]=mZ;re[24]=re[146]=yZ;re[6]=re[164]=vZ;re[129]=re[41]=_Z;re[66]=re[104]=xZ;re[144]=re[26]=EZ;re[36]=re[134]=wZ;re[9]=re[161]=SZ;re[37]=re[133]=MZ;re[148]=re[22]=bZ;re[82]=re[88]=AZ;re[73]=re[97]=TZ;re[145]=re[25]=CZ;re[70]=re[100]=PZ;re[34]=function(n){return[i1(n),n1(n)]};re[35]=IZ;re[136]=function(n){return[r1(n),e1(n)]};re[153]=function(n){return[Q_(n),K_(n)]};re[102]=function(n){return[j_(n),t1(n)]};re[155]=RZ;re[103]=LZ;re[152]=function(n){return[Q_(n),e1(n)]};re[156]=NZ;re[137]=function(n){return[r1(n),K_(n)]};re[139]=OZ;re[98]=function(n){return[n1(n),t1(n)]};re[99]=DZ;re[38]=function(n){return[j_(n),i1(n)]};re[39]=FZ;function BZ(n){return(n>0)-(n<0)||+n}function ff(n,t,e){var o=t[0]-n[0],s=t[1]-n[1],l=e[0]-t[0],p=e[1]-t[1];return BZ(o*p-l*s)}function dL(n,t){var e=n.geometry.coordinates[0].map(function(p){return p[0]}),o=n.geometry.coordinates[0].map(function(p){return p[1]}),s=t.geometry.coordinates[0].map(function(p){return p[0]}),l=t.geometry.coordinates[0].map(function(p){return p[1]});return Math.max.apply(null,e)===Math.max.apply(null,s)&&Math.max.apply(null,o)===Math.max.apply(null,l)&&Math.min.apply(null,e)===Math.min.apply(null,s)&&Math.min.apply(null,o)===Math.min.apply(null,l)}function o1(n,t){return t.geometry.coordinates[0].every(function(e){return ki(Pr(e),n)})}function gL(n,t){return n[0]===t[0]&&n[1]===t[1]}var zZ=function(){function n(t){this.id=n.buildId(t),this.coordinates=t,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return n.buildId=function(t){return t.join(",")},n.prototype.removeInnerEdge=function(t){this.innerEdges=this.innerEdges.filter(function(e){return e.from.id!==t.from.id})},n.prototype.removeOuterEdge=function(t){this.outerEdges=this.outerEdges.filter(function(e){return e.to.id!==t.to.id})},n.prototype.addOuterEdge=function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1},n.prototype.sortOuterEdges=function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort(function(e,o){var s=e.to,l=o.to;if(s.coordinates[0]-t.coordinates[0]>=0&&l.coordinates[0]-t.coordinates[0]<0)return 1;if(s.coordinates[0]-t.coordinates[0]<0&&l.coordinates[0]-t.coordinates[0]>=0)return-1;if(s.coordinates[0]-t.coordinates[0]===0&&l.coordinates[0]-t.coordinates[0]===0)return s.coordinates[1]-t.coordinates[1]>=0||l.coordinates[1]-t.coordinates[1]>=0?s.coordinates[1]-l.coordinates[1]:l.coordinates[1]-s.coordinates[1];var p=ff(t.coordinates,s.coordinates,l.coordinates);if(p<0)return 1;if(p>0)return-1;var h=Math.pow(s.coordinates[0]-t.coordinates[0],2)+Math.pow(s.coordinates[1]-t.coordinates[1],2),g=Math.pow(l.coordinates[0]-t.coordinates[0],2)+Math.pow(l.coordinates[1]-t.coordinates[1],2);return h-g}),this.outerEdgesSorted=!0)},n.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},n.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},n.prototype.addInnerEdge=function(t){this.innerEdges.push(t)},n}(),s1=zZ;var GZ=function(){function n(t,e){this.from=t,this.to=e,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 n.prototype.getSymetric=function(){return this.symetric||(this.symetric=new n(this.to,this.from),this.symetric.symetric=this),this.symetric},n.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},n.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},n.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},n.prototype.toLineString=function(){return Gi([this.from.coordinates,this.to.coordinates])},n.prototype.compareTo=function(t){return ff(t.from.coordinates,t.to.coordinates,this.to.coordinates)},n}(),mL=GZ;var kZ=function(){function n(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return n.prototype.push=function(t){this.edges.push(t),this.polygon=this.envelope=void 0},n.prototype.get=function(t){return this.edges[t]},Object.defineProperty(n.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),n.prototype.forEach=function(t){this.edges.forEach(t)},n.prototype.map=function(t){return this.edges.map(t)},n.prototype.some=function(t){return this.edges.some(t)},n.prototype.isValid=function(){return!0},n.prototype.isHole=function(){var t=this,e=this.edges.reduce(function(p,h,g){return h.from.coordinates[1]>t.edges[p].from.coordinates[1]&&(p=g),p},0),o=(e===0?this.length:e)-1,s=(e+1)%this.length,l=ff(this.edges[o].from.coordinates,this.edges[e].from.coordinates,this.edges[s].from.coordinates);return l===0?this.edges[o].from.coordinates[0]>this.edges[s].from.coordinates[0]:l>0},n.prototype.toMultiPoint=function(){return Uv(this.edges.map(function(t){return t.from.coordinates}))},n.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map(function(e){return e.from.coordinates});return t.push(this.edges[0].from.coordinates),this.polygon=Dr([t])},n.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=n_(this.toPolygon())},n.findEdgeRingContaining=function(t,e){var o=t.getEnvelope(),s,l;return e.forEach(function(p){var h=p.getEnvelope();if(l&&(s=l.getEnvelope()),!dL(h,o)&&o1(h,o)){for(var g=t.map(function(T){return T.from.coordinates}),m=void 0,v=function(T){p.some(function(I){return gL(T,I.from.coordinates)})||(m=T)},x=0,E=g;x<E.length;x++){var b=E[x];v(b)}m&&p.inside(Pr(m))&&(!l||o1(s,h))&&(l=p)}}),l},n.prototype.inside=function(t){return ki(t,this.toPolygon())},n}(),a1=kZ;function qZ(n){if(!n)throw new Error("No geojson passed");if(n.type!=="FeatureCollection"&&n.type!=="GeometryCollection"&&n.type!=="MultiLineString"&&n.type!=="LineString"&&n.type!=="Feature")throw new Error("Invalid input type '"+n.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}var lct=function(){function n(){this.edges=[],this.nodes={}}return n.fromGeoJson=function(t){qZ(t);var e=new n;return ys(t,function(o){zv(o,"LineString","Graph::fromGeoJson"),TC(o,function(s,l){if(s){var p=e.getNode(s),h=e.getNode(l);e.addEdge(p,h)}return l})}),e},n.prototype.getNode=function(t){var e=s1.buildId(t),o=this.nodes[e];return o||(o=this.nodes[e]=new s1(t)),o},n.prototype.addEdge=function(t,e){var o=new mL(t,e),s=o.getSymetric();this.edges.push(o),this.edges.push(s)},n.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map(function(e){return t.nodes[e]}).forEach(function(e){return t._removeIfDangle(e)})},n.prototype._removeIfDangle=function(t){var e=this;if(t.innerEdges.length<=1){var o=t.getOuterEdges().map(function(s){return s.to});this.removeNode(t),o.forEach(function(s){return e._removeIfDangle(s)})}},n.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))})},n.prototype._computeNextCWEdges=function(t){var e=this;typeof t=="undefined"?Object.keys(this.nodes).forEach(function(o){return e._computeNextCWEdges(e.nodes[o])}):t.getOuterEdges().forEach(function(o,s){t.getOuterEdge((s===0?t.getOuterEdges().length:s)-1).symetric.next=o})},n.prototype._computeNextCCWEdges=function(t,e){for(var o=t.getOuterEdges(),s,l,p=o.length-1;p>=0;--p){var h=o[p],g=h.symetric,m=void 0,v=void 0;h.label===e&&(m=h),g.label===e&&(v=g),!(!m||!v)&&(v&&(l=v),m&&(l&&(l.next=m,l=void 0),s||(s=m)))}l&&(l.next=s)},n.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach(function(o){if(!(o.label>=0)){t.push(o);var s=o;do s.label=e,s=s.next;while(!o.isEqual(s));e++}}),t},n.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach(function(o){o.label=void 0}),this._findLabeledEdgeRings().forEach(function(o){t._findIntersectionNodes(o).forEach(function(s){t._computeNextCCWEdges(s,o.label)})});var e=[];return this.edges.forEach(function(o){o.ring||e.push(t._findEdgeRing(o))}),e},n.prototype._findIntersectionNodes=function(t){var e=[],o=t,s=function(){var l=0;o.from.getOuterEdges().forEach(function(p){p.label===t.label&&++l}),l>1&&e.push(o.from),o=o.next};do s();while(!t.isEqual(o));return e},n.prototype._findEdgeRing=function(t){var e=t,o=new a1;do o.push(e),e.ring=o,e=e.next;while(!t.isEqual(e));return o},n.prototype.removeNode=function(t){var e=this;t.getOuterEdges().forEach(function(o){return e.removeEdge(o)}),t.innerEdges.forEach(function(o){return e.removeEdge(o)}),delete this.nodes[t.id]},n.prototype.removeEdge=function(t){this.edges=this.edges.filter(function(e){return!e.isEqual(t)}),t.deleteEdge()},n}();var XZ=sn(u1(),1);var YZ=sn(u1(),1);var ZZ=sn(bL(),1);var nJ=sn(DL(),1);function UL(n){for(var t=n,e=[];t.parent;)e.unshift(t),t=t.parent;return e}function iJ(){return new BL(function(n){return n.f})}var h1={search:function(n,t,e,o){n.cleanDirty(),o=o||{};var s=o.heuristic||h1.heuristics.manhattan,l=o.closest||!1,p=iJ(),h=t;for(t.h=s(t,e),p.push(t);p.size()>0;){var g=p.pop();if(g===e)return UL(g);g.closed=!0;for(var m=n.neighbors(g),v=0,x=m.length;v<x;++v){var E=m[v];if(!(E.closed||E.isWall())){var b=g.g+E.getCost(g),T=E.visited;(!T||b<E.g)&&(E.visited=!0,E.parent=g,E.h=E.h||s(E,e),E.g=b,E.f=E.g+E.h,n.markDirty(E),l&&(E.h<h.h||E.h===h.h&&E.g<h.g)&&(h=E),T?p.rescoreElement(E):p.push(E))}}}return l?UL(h):[]},heuristics:{manhattan:function(n,t){var e=Math.abs(t.x-n.x),o=Math.abs(t.y-n.y);return e+o},diagonal:function(n,t){var e=1,o=Math.sqrt(2),s=Math.abs(t.x-n.x),l=Math.abs(t.y-n.y);return e*(s+l)+(o-2*e)*Math.min(s,l)}},cleanNode:function(n){n.f=0,n.g=0,n.h=0,n.visited=!1,n.closed=!1,n.parent=null}};function Ih(n,t){t=t||{},this.nodes=[],this.diagonal=!!t.diagonal,this.grid=[];for(var e=0;e<n.length;e++){this.grid[e]=[];for(var o=0,s=n[e];o<s.length;o++){var l=new Fg(e,o,s[o]);this.grid[e][o]=l,this.nodes.push(l)}}this.init()}Ih.prototype.init=function(){this.dirtyNodes=[];for(var n=0;n<this.nodes.length;n++)h1.cleanNode(this.nodes[n])};Ih.prototype.cleanDirty=function(){for(var n=0;n<this.dirtyNodes.length;n++)h1.cleanNode(this.dirtyNodes[n]);this.dirtyNodes=[]};Ih.prototype.markDirty=function(n){this.dirtyNodes.push(n)};Ih.prototype.neighbors=function(n){var t=[],e=n.x,o=n.y,s=this.grid;return s[e-1]&&s[e-1][o]&&t.push(s[e-1][o]),s[e+1]&&s[e+1][o]&&t.push(s[e+1][o]),s[e]&&s[e][o-1]&&t.push(s[e][o-1]),s[e]&&s[e][o+1]&&t.push(s[e][o+1]),this.diagonal&&(s[e-1]&&s[e-1][o-1]&&t.push(s[e-1][o-1]),s[e+1]&&s[e+1][o-1]&&t.push(s[e+1][o-1]),s[e-1]&&s[e-1][o+1]&&t.push(s[e-1][o+1]),s[e+1]&&s[e+1][o+1]&&t.push(s[e+1][o+1])),t};Ih.prototype.toString=function(){for(var n=[],t=this.grid,e,o,s,l,p=0,h=t.length;p<h;p++){for(e=[],o=t[p],s=0,l=o.length;s<l;s++)e.push(o[s].weight);n.push(e.join(" "))}return n.join(\`
23469
- \`)};function Fg(n,t,e){this.x=n,this.y=t,this.weight=e}Fg.prototype.toString=function(){return"["+this.x+" "+this.y+"]"};Fg.prototype.getCost=function(n){return n&&n.x!==this.x&&n.y!==this.y?this.weight*1.41421:this.weight};Fg.prototype.isWall=function(){return this.weight===0};function BL(n){this.content=[],this.scoreFunction=n}BL.prototype={push:function(n){this.content.push(n),this.sinkDown(this.content.length-1)},pop:function(){var n=this.content[0],t=this.content.pop();return this.content.length>0&&(this.content[0]=t,this.bubbleUp(0)),n},remove:function(n){var t=this.content.indexOf(n),e=this.content.pop();t!==this.content.length-1&&(this.content[t]=e,this.scoreFunction(e)<this.scoreFunction(n)?this.sinkDown(t):this.bubbleUp(t))},size:function(){return this.content.length},rescoreElement:function(n){this.sinkDown(this.content.indexOf(n))},sinkDown:function(n){for(var t=this.content[n];n>0;){var e=(n+1>>1)-1,o=this.content[e];if(this.scoreFunction(t)<this.scoreFunction(o))this.content[e]=t,this.content[n]=o,n=e;else break}},bubbleUp:function(n){for(var t=this.content.length,e=this.content[n],o=this.scoreFunction(e);;){var s=n+1<<1,l=s-1,p=null,h;if(l<t){var g=this.content[l];h=this.scoreFunction(g),h<o&&(p=l)}if(s<t){var m=this.content[s],v=this.scoreFunction(m);v<(p===null?o:h)&&(p=s)}if(p!==null)this.content[n]=this.content[p],this.content[p]=e,n=p;else break}}};function p1(){this._=null}function pf(n){n.U=n.C=n.L=n.R=n.P=n.N=null}p1.prototype={constructor:p1,insert:function(n,t){var e,o,s;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=zL(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)o=e.U,e===o.L?(s=o.R,s&&s.C?(e.C=s.C=!1,o.C=!0,n=o):(n===e.R&&(Rh(this,e),n=e,e=n.U),e.C=!1,o.C=!0,Lh(this,o))):(s=o.L,s&&s.C?(e.C=s.C=!1,o.C=!0,n=o):(n===e.L&&(Lh(this,e),n=e,e=n.U),e.C=!1,o.C=!0,Rh(this,o))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t=n.U,e,o=n.L,s=n.R,l,p;if(o?s?l=zL(s):l=o:l=s,t?t.L===n?t.L=l:t.R=l:this._=l,o&&s?(p=l.C,l.C=n.C,l.L=o,o.U=l,l!==s?(t=l.U,l.U=n.U,n=l.R,t.L=n,l.R=s,s.U=l):(l.U=t,t=l,n=l.R)):(p=n.C,n=l),n&&(n.U=t),!p){if(n&&n.C){n.C=!1;return}do{if(n===this._)break;if(n===t.L){if(e=t.R,e.C&&(e.C=!1,t.C=!0,Rh(this,t),e=t.R),e.L&&e.L.C||e.R&&e.R.C){(!e.R||!e.R.C)&&(e.L.C=!1,e.C=!0,Lh(this,e),e=t.R),e.C=t.C,t.C=e.R.C=!1,Rh(this,t),n=this._;break}}else if(e=t.L,e.C&&(e.C=!1,t.C=!0,Lh(this,t),e=t.L),e.L&&e.L.C||e.R&&e.R.C){(!e.L||!e.L.C)&&(e.R.C=!1,e.C=!0,Rh(this,e),e=t.L),e.C=t.C,t.C=e.L.C=!1,Lh(this,t),n=this._;break}e.C=!0,n=t,t=t.U}while(!n.C);n&&(n.C=!1)}}};function Rh(n,t){var e=t,o=t.R,s=e.U;s?s.L===e?s.L=o:s.R=o:n._=o,o.U=s,e.U=o,e.R=o.L,e.R&&(e.R.U=e),o.L=e}function Lh(n,t){var e=t,o=t.L,s=e.U;s?s.L===e?s.L=o:s.R=o:n._=o,o.U=s,e.U=o,e.L=o.R,e.L&&(e.L.U=e),o.R=e}function zL(n){for(;n.L;)n=n.L;return n}var d1=p1;function df(n,t,e,o){var s=[null,null],l=Hi.push(s)-1;return s.left=n,s.right=t,e&&Nh(s,n,t,e),o&&Nh(s,t,n,o),To[n.index].halfedges.push(l),To[t.index].halfedges.push(l),s}function gf(n,t,e){var o=[t,e];return o.left=n,o}function Nh(n,t,e,o){!n[0]&&!n[1]?(n[0]=o,n.left=t,n.right=e):n.left===e?n[1]=o:n[0]=o}function oJ(n,t,e,o,s){var l=n[0],p=n[1],h=l[0],g=l[1],m=p[0],v=p[1],x=0,E=1,b=m-h,T=v-g,I;if(I=t-h,!(!b&&I>0)){if(I/=b,b<0){if(I<x)return;I<E&&(E=I)}else if(b>0){if(I>E)return;I>x&&(x=I)}if(I=o-h,!(!b&&I<0)){if(I/=b,b<0){if(I>E)return;I>x&&(x=I)}else if(b>0){if(I<x)return;I<E&&(E=I)}if(I=e-g,!(!T&&I>0)){if(I/=T,T<0){if(I<x)return;I<E&&(E=I)}else if(T>0){if(I>E)return;I>x&&(x=I)}if(I=s-g,!(!T&&I<0)){if(I/=T,T<0){if(I>E)return;I>x&&(x=I)}else if(T>0){if(I<x)return;I<E&&(E=I)}return!(x>0)&&!(E<1)||(x>0&&(n[0]=[h+x*b,g+x*T]),E<1&&(n[1]=[h+E*b,g+E*T])),!0}}}}}function sJ(n,t,e,o,s){var l=n[1];if(l)return!0;var p=n[0],h=n.left,g=n.right,m=h[0],v=h[1],x=g[0],E=g[1],b=(m+x)/2,T=(v+E)/2,I,S;if(E===v){if(b<t||b>=o)return;if(m>x){if(!p)p=[b,e];else if(p[1]>=s)return;l=[b,s]}else{if(!p)p=[b,s];else if(p[1]<e)return;l=[b,e]}}else if(I=(m-x)/(E-v),S=T-I*b,I<-1||I>1)if(m>x){if(!p)p=[(e-S)/I,e];else if(p[1]>=s)return;l=[(s-S)/I,s]}else{if(!p)p=[(s-S)/I,s];else if(p[1]<e)return;l=[(e-S)/I,e]}else if(v<E){if(!p)p=[t,I*t+S];else if(p[0]>=o)return;l=[o,I*o+S]}else{if(!p)p=[o,I*o+S];else if(p[0]<t)return;l=[t,I*t+S]}return n[0]=p,n[1]=l,!0}function GL(n,t,e,o){for(var s=Hi.length,l;s--;)(!sJ(l=Hi[s],n,t,e,o)||!oJ(l,n,t,e,o)||!(Math.abs(l[0][0]-l[1][0])>Er||Math.abs(l[0][1]-l[1][1])>Er))&&delete Hi[s]}function kL(n){return To[n.index]={site:n,halfedges:[]}}function aJ(n,t){var e=n.site,o=t.left,s=t.right;return e===s&&(s=o,o=e),s?Math.atan2(s[1]-o[1],s[0]-o[0]):(e===o?(o=t[1],s=t[0]):(o=t[0],s=t[1]),Math.atan2(o[0]-s[0],s[1]-o[1]))}function g1(n,t){return t[+(t.left!==n.site)]}function uJ(n,t){return t[+(t.left===n.site)]}function qL(){for(var n=0,t=To.length,e,o,s,l;n<t;++n)if((e=To[n])&&(l=(o=e.halfedges).length)){var p=new Array(l),h=new Array(l);for(s=0;s<l;++s)p[s]=s,h[s]=aJ(e,Hi[o[s]]);for(p.sort(function(g,m){return h[m]-h[g]}),s=0;s<l;++s)h[s]=o[p[s]];for(s=0;s<l;++s)o[s]=h[s]}}function HL(n,t,e,o){var s=To.length,l,p,h,g,m,v,x,E,b,T,I,S,w=!0;for(l=0;l<s;++l)if(p=To[l]){for(h=p.site,m=p.halfedges,g=m.length;g--;)Hi[m[g]]||m.splice(g,1);for(g=0,v=m.length;g<v;)T=uJ(p,Hi[m[g]]),I=T[0],S=T[1],x=g1(p,Hi[m[++g%v]]),E=x[0],b=x[1],(Math.abs(I-E)>Er||Math.abs(S-b)>Er)&&(m.splice(g,0,Hi.push(gf(h,T,Math.abs(I-n)<Er&&o-S>Er?[n,Math.abs(E-n)<Er?b:o]:Math.abs(S-o)<Er&&e-I>Er?[Math.abs(b-o)<Er?E:e,o]:Math.abs(I-e)<Er&&S-t>Er?[e,Math.abs(E-e)<Er?b:t]:Math.abs(S-t)<Er&&I-n>Er?[Math.abs(b-t)<Er?E:n,t]:null))-1),++v);v&&(w=!1)}if(w){var R,C,F,W=1/0;for(l=0,w=null;l<s;++l)(p=To[l])&&(h=p.site,R=h[0]-n,C=h[1]-t,F=R*R+C*C,F<W&&(W=F,w=p));if(w){var X=[n,t],q=[n,o],D=[e,o],xt=[e,t];w.halfedges.push(Hi.push(gf(h=w.site,X,q))-1,Hi.push(gf(h,q,D))-1,Hi.push(gf(h,D,xt))-1,Hi.push(gf(h,xt,X))-1)}}for(l=0;l<s;++l)(p=To[l])&&(p.halfedges.length||delete To[l])}var VL=[],Ug;function lJ(){pf(this),this.x=this.y=this.arc=this.site=this.cy=null}function Wl(n){var t=n.P,e=n.N;if(!(!t||!e)){var o=t.site,s=n.site,l=e.site;if(o!==l){var p=s[0],h=s[1],g=o[0]-p,m=o[1]-h,v=l[0]-p,x=l[1]-h,E=2*(g*x-m*v);if(!(E>=-WL)){var b=g*g+m*m,T=v*v+x*x,I=(x*b-m*T)/E,S=(g*T-v*b)/E,w=VL.pop()||new lJ;w.arc=n,w.site=s,w.x=I+p,w.y=(w.cy=S+h)+Math.sqrt(I*I+S*S),n.circle=w;for(var R=null,C=mf._;C;)if(w.y<C.y||w.y===C.y&&w.x<=C.x)if(C.L)C=C.L;else{R=C.P;break}else if(C.R)C=C.R;else{R=C;break}mf.insert(R,w),R||(Ug=w)}}}}function Xl(n){var t=n.circle;t&&(t.P||(Ug=t.N),mf.remove(t),VL.push(t),pf(t),n.circle=null)}var YL=[];function cJ(){pf(this),this.edge=this.site=this.circle=null}function XL(n){var t=YL.pop()||new cJ;return t.site=n,t}function m1(n){Xl(n),Yl.remove(n),YL.push(n),pf(n)}function $L(n){var t=n.circle,e=t.x,o=t.cy,s=[e,o],l=n.P,p=n.N,h=[n];m1(n);for(var g=l;g.circle&&Math.abs(e-g.circle.x)<Er&&Math.abs(o-g.circle.cy)<Er;)l=g.P,h.unshift(g),m1(g),g=l;h.unshift(g),Xl(g);for(var m=p;m.circle&&Math.abs(e-m.circle.x)<Er&&Math.abs(o-m.circle.cy)<Er;)p=m.N,h.push(m),m1(m),m=p;h.push(m),Xl(m);var v=h.length,x;for(x=1;x<v;++x)m=h[x],g=h[x-1],Nh(m.edge,g.site,m.site,s);g=h[0],m=h[v-1],m.edge=df(g.site,m.site,null,s),Wl(g),Wl(m)}function ZL(n){for(var t=n[0],e=n[1],o,s,l,p,h=Yl._;h;)if(l=JL(h,e)-t,l>Er)h=h.L;else if(p=t-fJ(h,e),p>Er){if(!h.R){o=h;break}h=h.R}else{l>-Er?(o=h.P,s=h):p>-Er?(o=h,s=h.N):o=s=h;break}kL(n);var g=XL(n);if(Yl.insert(o,g),!(!o&&!s)){if(o===s){Xl(o),s=XL(o.site),Yl.insert(g,s),g.edge=s.edge=df(o.site,g.site),Wl(o),Wl(s);return}if(!s){g.edge=df(o.site,g.site);return}Xl(o),Xl(s);var m=o.site,v=m[0],x=m[1],E=n[0]-v,b=n[1]-x,T=s.site,I=T[0]-v,S=T[1]-x,w=2*(E*S-b*I),R=E*E+b*b,C=I*I+S*S,F=[(S*R-b*C)/w+v,(E*C-I*R)/w+x];Nh(s.edge,m,T,F),g.edge=df(m,n,null,F),s.edge=df(n,T,null,F),Wl(o),Wl(s)}}function JL(n,t){var e=n.site,o=e[0],s=e[1],l=s-t;if(!l)return o;var p=n.P;if(!p)return-1/0;e=p.site;var h=e[0],g=e[1],m=g-t;if(!m)return h;var v=h-o,x=1/l-1/m,E=v/m;return x?(-E+Math.sqrt(E*E-2*x*(v*v/(-2*m)-g+m/2+s-l/2)))/x+o:(o+h)/2}function fJ(n,t){var e=n.N;if(e)return JL(e,t);var o=n.site;return o[1]===t?o[0]:1/0}var Er=1e-6,WL=1e-12,Yl,To,mf,Hi;function hJ(n,t,e){return(n[0]-e[0])*(t[1]-n[1])-(n[0]-t[0])*(e[1]-n[1])}function pJ(n,t){return t[1]-n[1]||t[0]-n[0]}function Bg(n,t){var e=n.sort(pJ).pop(),o,s,l;for(Hi=[],To=new Array(n.length),Yl=new d1,mf=new d1;;)if(l=Ug,e&&(!l||e[1]<l.y||e[1]===l.y&&e[0]<l.x))(e[0]!==o||e[1]!==s)&&(ZL(e),o=e[0],s=e[1]),e=n.pop();else if(l)$L(l.arc);else break;if(qL(),t){var p=+t[0][0],h=+t[0][1],g=+t[1][0],m=+t[1][1];GL(p,h,g,m),HL(p,h,g,m)}this.edges=Hi,this.cells=To,Yl=mf=Hi=To=null}Bg.prototype={constructor:Bg,polygons:function(){var n=this.edges;return this.cells.map(function(t){var e=t.halfedges.map(function(o){return g1(t,n[o])});return e.data=t.site.data,e})},triangles:function(){var n=[],t=this.edges;return this.cells.forEach(function(e,o){if(h=(l=e.halfedges).length)for(var s=e.site,l,p=-1,h,g,m=t[l[h-1]],v=m.left===s?m.right:m.left;++p<h;)g=v,m=t[l[p]],v=m.left===s?m.right:m.left,g&&v&&o<g.index&&o<v.index&&hJ(s,g,v)<0&&n.push([s.data,g.data,v.data])}),n},links:function(){return this.edges.filter(function(n){return n.right}).map(function(n){return{source:n.left.data,target:n.right.data}})},find:function(n,t,e){for(var o=this,s,l=o._found||0,p=o.cells.length,h;!(h=o.cells[l]);)if(++l>=p)return null;var g=n-h.site[0],m=t-h.site[1],v=g*g+m*m;do h=o.cells[s=l],l=null,h.halfedges.forEach(function(x){var E=o.edges[x],b=E.left;if(!((b===h.site||!b)&&!(b=E.right))){var T=n-b[0],I=t-b[1],S=T*T+I*I;S<v&&(v=S,l=b.index)}});while(l!==null);return o._found=s,e==null||v<=e*e?h.site:null}};var EJ=sn(yf(),1);var R1=sn(tN(),1);function Zo(){return new kg}function kg(){this.reset()}kg.prototype={constructor:kg,reset:function(){this.s=this.t=0},add:function(n){eN(Gg,n,this.t),eN(this,Gg.s,this.s),this.s?this.t+=Gg.t:this.s=Gg.t},valueOf:function(){return this.s}};var Gg=new kg;function eN(n,t,e){var o=n.s=t+e,s=o-t,l=o-s;n.t=t-l+(e-s)}var er=1e-6;var gr=Math.PI,Mi=gr/2,qg=gr/4,Da=gr*2,$l=180/gr,Jo=gr/180,Zr=Math.abs,aa=Math.atan,Ko=Math.atan2,Wn=Math.cos;var Hg=Math.exp;var Oh=Math.log;var an=Math.sin;var no=Math.sqrt,Dh=Math.tan;function _1(n){return n>1?0:n<-1?gr:Math.acos(n)}function Co(n){return n>1?Mi:n<-1?-Mi:Math.asin(n)}function ua(){}var wJ=Zo(),rpt=Zo();function Zl(n){var t=n[0],e=n[1],o=Wn(e);return[o*Wn(t),o*an(t),an(e)]}function Fh(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function Uh(n){var t=no(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}var ppt=Zo();function rN(n,t){return[n>gr?n-Da:n<-gr?n+Da:n,t]}rN.invert=rN;function x1(){var n=[],t;return{point:function(e,o){t.push([e,o])},lineStart:function(){n.push(t=[])},lineEnd:ua,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function E1(n,t){return Zr(n[0]-t[0])<er&&Zr(n[1]-t[1])<er}function Vg(n,t,e,o){this.x=n,this.z=t,this.o=e,this.e=o,this.v=!1,this.n=this.p=null}function w1(n,t,e,o,s){var l=[],p=[],h,g;if(n.forEach(function(T){if(!((I=T.length-1)<=0)){var I,S=T[0],w=T[I],R;if(E1(S,w)){for(s.lineStart(),h=0;h<I;++h)s.point((S=T[h])[0],S[1]);s.lineEnd();return}l.push(R=new Vg(S,T,null,!0)),p.push(R.o=new Vg(S,null,R,!1)),l.push(R=new Vg(w,T,null,!1)),p.push(R.o=new Vg(w,null,R,!0))}}),!!l.length){for(p.sort(t),iN(l),iN(p),h=0,g=p.length;h<g;++h)p[h].e=e=!e;for(var m=l[0],v,x;;){for(var E=m,b=!0;E.v;)if((E=E.n)===m)return;v=E.z,s.lineStart();do{if(E.v=E.o.v=!0,E.e){if(b)for(h=0,g=v.length;h<g;++h)s.point((x=v[h])[0],x[1]);else o(E.x,E.n.x,1,s);E=E.n}else{if(b)for(v=E.p.z,h=v.length-1;h>=0;--h)s.point((x=v[h])[0],x[1]);else o(E.x,E.p.x,-1,s);E=E.p}E=E.o,v=E.z,b=!b}while(!E.v);s.lineEnd()}}}function iN(n){if(t=n.length){for(var t,e=0,o=n[0],s;++e<t;)o.n=s=n[e],s.p=o,o=s;o.n=s=n[0],s.p=o}}function sl(n,t){return n<t?-1:n>t?1:n>=t?0:NaN}function S1(n){return n.length===1&&(n=bJ(n)),{left:function(t,e,o,s){for(o==null&&(o=0),s==null&&(s=t.length);o<s;){var l=o+s>>>1;n(t[l],e)<0?o=l+1:s=l}return o},right:function(t,e,o,s){for(o==null&&(o=0),s==null&&(s=t.length);o<s;){var l=o+s>>>1;n(t[l],e)>0?s=l:o=l+1}return o}}}function bJ(n){return function(t,e){return sl(n(t),e)}}var oN=S1(sl),AJ=oN.right,TJ=oN.left;var sN=Array.prototype,PJ=sN.slice,IJ=sN.map;var odt=Math.sqrt(50),sdt=Math.sqrt(10),adt=Math.sqrt(2);function Xg(n){for(var t=n.length,e,o=-1,s=0,l,p;++o<t;)s+=n[o].length;for(l=new Array(s);--t>=0;)for(p=n[t],e=p.length;--e>=0;)l[--s]=p[e];return l}var BJ=1e9,Vgt=-BJ;var M1=Zo();function b1(n,t){var e=t[0],o=t[1],s=[an(e),-Wn(e),0],l=0,p=0;M1.reset();for(var h=0,g=n.length;h<g;++h)if(v=(m=n[h]).length)for(var m,v,x=m[v-1],E=x[0],b=x[1]/2+qg,T=an(b),I=Wn(b),S=0;S<v;++S,E=R,T=F,I=W,x=w){var w=m[S],R=w[0],C=w[1]/2+qg,F=an(C),W=Wn(C),X=R-E,q=X>=0?1:-1,D=q*X,xt=D>gr,B=T*F;if(M1.add(Ko(B*q*an(D),I*W+B*Wn(D))),l+=xt?X+q*Da:X,xt^E>=e^R>=e){var j=Fh(Zl(x),Zl(w));Uh(j);var J=Fh(s,j);Uh(J);var Dt=(xt^X>=0?-1:1)*Co(J[2]);(o>Dt||o===Dt&&(j[0]||j[1]))&&(p+=xt^X>=0?1:-1)}}return(l<-er||l<er&&M1<-er)^p&1}var tmt=Zo();var _mt=Zo(),xmt=Zo();var kJ=1/0;var Smt=-kJ;function A1(n){this._context=n}A1.prototype={_radius:4.5,pointRadius:function(n){return this._radius=n,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(n,t){switch(this._point){case 0:{this._context.moveTo(n,t),this._point=1;break}case 1:{this._context.lineTo(n,t);break}default:{this._context.moveTo(n+this._radius,t),this._context.arc(n,t,this._radius,0,Da);break}}},result:ua};var Nmt=Zo();function T1(){this._string=[]}T1.prototype={_radius:4.5,_circle:lN(4.5),pointRadius:function(n){return(n=+n)!==this._radius&&(this._radius=n,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(n,t){switch(this._point){case 0:{this._string.push("M",n,",",t),this._point=1;break}case 1:{this._string.push("L",n,",",t);break}default:{this._circle==null&&(this._circle=lN(this._radius)),this._string.push("M",n,",",t,this._circle);break}}},result:function(){if(this._string.length){var n=this._string.join("");return this._string=[],n}else return null}};function lN(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function C1(n,t,e,o){return function(s,l){var p=t(l),h=s.invert(o[0],o[1]),g=x1(),m=t(g),v=!1,x,E,b,T={point:I,lineStart:w,lineEnd:R,polygonStart:function(){T.point=C,T.lineStart=F,T.lineEnd=W,E=[],x=[]},polygonEnd:function(){T.point=I,T.lineStart=w,T.lineEnd=R,E=Xg(E);var X=b1(x,h);E.length?(v||(l.polygonStart(),v=!0),w1(E,VJ,X,e,l)):X&&(v||(l.polygonStart(),v=!0),l.lineStart(),e(null,null,1,l),l.lineEnd()),v&&(l.polygonEnd(),v=!1),E=x=null},sphere:function(){l.polygonStart(),l.lineStart(),e(null,null,1,l),l.lineEnd(),l.polygonEnd()}};function I(X,q){var D=s(X,q);n(X=D[0],q=D[1])&&l.point(X,q)}function S(X,q){var D=s(X,q);p.point(D[0],D[1])}function w(){T.point=S,p.lineStart()}function R(){T.point=I,p.lineEnd()}function C(X,q){b.push([X,q]);var D=s(X,q);m.point(D[0],D[1])}function F(){m.lineStart(),b=[]}function W(){C(b[0][0],b[0][1]),m.lineEnd();var X=m.clean(),q=g.result(),D,xt=q.length,B,j,J;if(b.pop(),x.push(b),b=null,!!xt){if(X&1){if(j=q[0],(B=j.length-1)>0){for(v||(l.polygonStart(),v=!0),l.lineStart(),D=0;D<B;++D)l.point((J=j[D])[0],J[1]);l.lineEnd()}return}xt>1&&X&2&&q.push(q.pop().concat(q.shift())),E.push(q.filter(HJ))}}return T}}function HJ(n){return n.length>1}function VJ(n,t){return((n=n.x)[0]<0?n[1]-Mi-er:Mi-n[1])-((t=t.x)[0]<0?t[1]-Mi-er:Mi-t[1])}var WJ=C1(function(){return!0},XJ,$J,[-gr,-Mi]);function XJ(n){var t=NaN,e=NaN,o=NaN,s;return{lineStart:function(){n.lineStart(),s=1},point:function(l,p){var h=l>0?gr:-gr,g=Zr(l-t);Zr(g-gr)<er?(n.point(t,e=(e+p)/2>0?Mi:-Mi),n.point(o,e),n.lineEnd(),n.lineStart(),n.point(h,e),n.point(l,e),s=0):o!==h&&g>=gr&&(Zr(t-o)<er&&(t-=o*er),Zr(l-h)<er&&(l-=h*er),e=YJ(t,e,l,p),n.point(o,e),n.lineEnd(),n.lineStart(),n.point(h,e),s=0),n.point(t=l,e=p),o=h},lineEnd:function(){n.lineEnd(),t=e=NaN},clean:function(){return 2-s}}}function YJ(n,t,e,o){var s,l,p=an(n-e);return Zr(p)>er?aa((an(t)*(l=Wn(o))*an(e)-an(o)*(s=Wn(t))*an(n))/(s*l*p)):(t+o)/2}function $J(n,t,e,o){var s;if(n==null)s=e*Mi,o.point(-gr,s),o.point(0,s),o.point(gr,s),o.point(gr,0),o.point(gr,-s),o.point(0,-s),o.point(-gr,-s),o.point(-gr,0),o.point(-gr,s);else if(Zr(n[0]-t[0])>er){var l=n[0]<t[0]?gr:-gr;s=e*l/2,o.point(-l,s),o.point(0,s),o.point(l,s)}else o.point(t[0],t[1])}function Yg(n){return function(t){var e=new P1;for(var o in n)e[o]=n[o];return e.stream=t,e}}function P1(){}P1.prototype={constructor:P1,point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var x0t=Wn(30*Jo);var O0t=Yg({point:function(n,t){this.stream.point(n*Jo,t*Jo)}});function $g(n){return function(t,e){var o=Wn(t),s=Wn(e),l=n(o*s);return[l*s*an(t),l*an(e)]}}function Fa(n){return function(t,e){var o=no(t*t+e*e),s=n(o),l=an(s),p=Wn(s);return[Ko(t*l,o*p),Co(o&&e*l/o)]}}var mN=$g(function(n){return no(2/(1+n))});mN.invert=Fa(function(n){return 2*Co(n/2)});var yN=$g(function(n){return(n=_1(n))&&n/an(n)});yN.invert=Fa(function(n){return n});function I1(n,t){return[n,Oh(Dh((Mi+t)/2))]}I1.invert=function(n,t){return[n,2*aa(Hg(t))-Mi]};function Zg(n,t){return[n,t]}Zg.invert=Zg;function vN(n,t){var e=Wn(t),o=Wn(n)*e;return[e*an(n)/o,an(t)/o]}vN.invert=Fa(aa);function _N(n,t){var e=t*t,o=e*e;return[n*(.8707-.131979*e+o*(-.013791+o*(.003971*e-.001529*o))),t*(1.007226+e*(.015085+o*(-.044475+.028874*e-.005916*o)))]}_N.invert=function(n,t){var e=t,o=25,s;do{var l=e*e,p=l*l;e-=s=(e*(1.007226+l*(.015085+p*(-.044475+.028874*l-.005916*p)))-t)/(1.007226+l*(.015085*3+p*(-.044475*7+.028874*9*l-.005916*11*p)))}while(Zr(s)>er&&--o>0);return[n/(.8707+(l=e*e)*(-.131979+l*(-.013791+l*l*l*(.003971-.001529*l)))),e]};function xN(n,t){return[Wn(t)*an(n),an(t)]}xN.invert=Fa(Co);function EN(n,t){var e=Wn(t),o=1+Wn(n)*e;return[e*an(n)/o,an(t)/o]}EN.invert=Fa(function(n){return 2*aa(n)});function wN(n,t){return[Oh(Dh((Mi+t)/2)),-n]}wN.invert=function(n,t){return[-t,2*aa(Hg(n))-Mi]};var tK=sn(yf(),1);var eK=sn(yf(),1);var rK=sn(yf(),1);var iK=sn(yf(),1);function _f(n,t){return Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2)}function MN(n){let t=0;for(let e=0;e<n.length-1;e++)t+=_f(n[e],n[e+1]);return t}var jo=sn(bN(),1);var Xn="___",Jg=class{isFacilityByType(t){return["facility","escalator","straightLadder","staircase","ramp","connectionPoint"].includes(t)}initFacilities(t){this.facilities=t.map(e=>{let o=[];try{o=JSON.parse(e.entry_end_floor)}catch(l){o=[]}let s=[];try{s=JSON.parse(e.entry_start_floor)}catch(l){s=[]}return Lu({},e,{entry_start_floor:s,entry_end_floor:o})})}getParkingSpaceInfo(t,e){let o=""+t+Xn+e;var s;return(s=this.parkingMap.get(o))!=null?s:null}getNodeInfo(t,e){let o=""+t+Xn+e,s=this.nodeMap.get(o);if(!(s!=null&&s.length))return null;let l=this.pointMap.get(s[0]);return l!=null?l:null}initRoute(t,e){this.clear(),this.roadInfo=t,this.initFacilities(e);let o=new Date,s=o.getHours()*60+o.getMinutes();t.length&&(t.forEach(l=>{let p=(l.points||[]).filter(h=>!(0,jo.isNil)(h.passWeight)&&h.passWeight!==1&&!(0,jo.isNil)(h.coverageArea)&&h.coverageArea!==0);(l.points||[]).filter(h=>h.openStatus!==!1).filter(h=>{if(!h.startTime||!h.endTime)return!0;let[g,m]=h.startTime.split(":").map(T=>+T),[v,x]=h.endTime.split(":").map(T=>+T),E=g*60+m,b=v*60+x;return s>=E&&s<=b}).forEach(h=>{h.floor=l.floor;let g=""+l.floor+Xn+h.id,m=""+l.floor+Xn+h.nodeId,v=this.nodeMap.get(m)||[];if(v.push(""+l.floor+Xn+(h.relatedId||h.id)),this.nodeMap.set(""+l.floor+Xn+h.nodeId,v),this.pointMap.set(g,h),this.isFacilityByType(h.type)){let x=this.facilities.find(E=>E.id===+h.targetId);if(x){switch(x.entry_infra_type){case"straightLadder":if(x.entry_end_floor.find(I=>I.floor===l.floor)&&x.entry_start_floor.find(I=>I.floor===l.floor)){let I=this.straightLadderMap.get(h.targetId)||[];I.push(Lu({},h)),this.straightLadderMap.set(h.targetId,I)}break;case"staircase":if(x.entry_end_floor.find(I=>I.floor===l.floor)&&x.entry_start_floor.find(I=>I.floor===l.floor)){let I=this.staircaseMap.get(h.targetId)||[];I.push(Lu({},h)),this.staircaseMap.set(h.targetId,I)}break;case"escalator":let b=this.escalatorMap.get(h.targetId)||[];if(x.entry_start_floor.find(I=>I.floor===l.floor)){let I=b.find(S=>{var w;return((w=S.end)==null?void 0:w.floor)!==l.floor&&!S.start});I?I.start=h:b.push({start:h})}if(x.entry_end_floor.find(I=>I.floor===l.floor)){let I=b.find(S=>{var w;return((w=S.start)==null?void 0:w.floor)!==l.floor&&!S.end});I?I.end=h:b.push({end:h})}this.escalatorMap.set(h.targetId,b);break;case"ramp":let T=this.rampMap.get(h.targetId)||[];if(x.entry_start_floor.find(I=>I.floor===l.floor)){let I=T.find(S=>{var w;return((w=S.end)==null?void 0:w.floor)!==l.floor&&!S.start});I?I.start=h:T.push({start:h})}if(x.entry_end_floor.find(I=>I.floor===l.floor)){let I=T.find(S=>{var w;return((w=S.start)==null?void 0:w.floor)!==l.floor&&!S.end});I?I.end=h:T.push({end:h})}this.rampMap.set(h.targetId,T);break;case"connectionPoint":if(x.entry_end_floor.find(I=>I.floor===l.floor)&&x.entry_start_floor.find(I=>I.floor===l.floor)){let I=this.connectionPointMap.get(h.targetId)||[];I.push(Lu({},h)),this.connectionPointMap.set(h.targetId,I)}break}let E=this.facilityMap.get(h.targetId)||[];E.push(Lu({},h)),this.facilityMap.set(h.targetId,E)}}h.type==="parkingSpace"&&h.name.split(/[,\uFF0C]/).forEach(E=>{this.parkingMap.set(""+l.floor+Xn+E,h)})}),(l.lines||[]).filter(h=>h.to!==h.from).forEach(h=>{let g=""+l.floor+Xn+h.from,m=""+l.floor+Xn+h.to,v=this.pointMap.get(g),x=this.pointMap.get(m);if(!v||!x)return;let E=v.cds,b=x.cds,T=_f(E,b);if(p.forEach(I=>{(I.id===h.from||I.id===h.to)&&(T=T/I.passWeight);let S=_f(E,I.cds)<=I.coverageArea,w=_f(b,I.cds)<=I.coverageArea;(S||w)&&(T=T/I.passWeight)}),!v.permission&&!x.permission){switch(this.addLineItem(g,m,T),this.addLineItem(m,g,T),h.direction){case"double":this.addLineItem(g,m,T,this.forwardLineMap),this.addLineItem(m,g,T,this.forwardLineMap);break;case"single":this.addLineItem(g,m,T,this.forwardLineMap);break;case"back":this.addLineItem(m,g,T,this.forwardLineMap);break}(v.type==="parkingSpace"||x.type==="parkingSpace")&&h.direction==="noDir"&&(this.addLineItem(g,m,T,this.forwardLineMap),this.addLineItem(m,g,T,this.forwardLineMap))}else v.permission&&(this.setPermissionLine(g,m,v.permission,T,""),this.setPermissionLine(m,g,v.permission,T,"")),x.permission&&x.permission!==v.permission&&(this.setPermissionLine(g,m,x.permission,T,""),this.setPermissionLine(m,g,x.permission,T,""))})}),this.addPermissionFacility(),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute(),this.initForwardRoute())}getPermissionMap(t){return this["permission_"+t]||(this["permission_"+t]=new Set),this["permission_"+t]}setPermissionLine(t,e,o,s,l){this.getPermissionMap(o).add({fromKey:t,toKey:e,distance:s,type:l})}addPermissionFacility(){this.straightLadderMap.forEach((t,e)=>{if(t.length<2){this.straightLadderMap.delete(e);return}for(let o=0;o<t.length;o++){let s=""+t[o].floor+Xn+t[o].id,l=this.pointMap.get(s);if(l){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Xn+t[p].id,g=this.pointMap.get(h);if(!g)continue;l.permission&&this.setPermissionLine(s,h,l.permission,1,"straightLadder"),g.permission&&g.permission!==l.permission&&this.setPermissionLine(s,h,g.permission,1,"straightLadder")}}}}),this.staircaseMap.forEach((t,e)=>{if(t.length<2){this.staircaseMap.delete(e);return}for(let o=0;o<t.length;o++){let s=""+t[o].floor+Xn+t[o].id,l=this.pointMap.get(s);if(l){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Xn+t[p].id,g=this.pointMap.get(h);if(!g)continue;l.permission&&this.setPermissionLine(s,h,l.permission,1,"staircase"),g.permission&&g.permission!==l.permission&&this.setPermissionLine(s,h,g.permission,1,"staircase")}}}}),this.escalatorMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Xn+o.start.id,l=""+o.end.floor+Xn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(l);p&&h&&(p.permission&&this.setPermissionLine(s,l,p.permission,1,"escalator"),h.permission&&h.permission!==p.permission&&this.setPermissionLine(s,l,h.permission,1,"escalator"))}})}),this.rampMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Xn+o.start.id,l=""+o.end.floor+Xn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(l);p&&h&&(p.permission&&this.setPermissionLine(s,l,p.permission,10,"ramp"),h.permission&&h.permission!==p.permission&&this.setPermissionLine(s,l,h.permission,10,"ramp"))}})}),this.connectionPointMap.forEach((t,e)=>{if(t.length<2){this.connectionPointMap.delete(e);return}for(let o=0;o<t.length;o++){let s=""+t[o].floor+Xn+t[o].id,l=this.pointMap.get(s);if(l){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Xn+t[p].id,g=this.pointMap.get(h);if(!g)continue;l.permission&&this.setPermissionLine(s,h,l.permission,1,"connectionPoint"),g.permission&&g.permission!==l.permission&&this.setPermissionLine(s,h,g.permission,1,"connectionPoint")}}}})}addPermissionLineToMap(t,e,o,s){this.getPermissionMap(t).forEach(p=>{e.includes(p.type)&&(p.type===""?this.addLineItem(p.fromKey,p.toKey,p.distance,o):this.addLineItem(p.fromKey,p.toKey,s.get(p.type),o))})}addLineItem(t,e,o,s){s===void 0&&(s=this.lineMap);let l=s.get(t)||new Map;l.set(e,o),s.set(t,l)}addFacilityToLineMap(t,e,o,s){[...this.straightLadderMap,...this.staircaseMap].forEach(l=>{let[p,h]=l;if(!(h.length<2))for(let g=0;g<h.length;g++){let m=""+h[g].floor+Xn+h[g].id,v=this.pointMap.get(m);if(!(!v||v.permission)){for(let x=0;x<h.length;x++)if(g!==x){let E=""+h[x].floor+Xn+h[x].id,b=this.pointMap.get(E);if(!b||b.permission)continue;if(h[g].type==="straightLadder"){let T=e;this.addLineItem(m,E,T,s)}else{let T=o;this.addLineItem(m,E,T,s)}}}}}),this.escalatorMap.forEach((l,p)=>{l.forEach(h=>{if(h.start&&h.end){let g=""+h.start.floor+Xn+h.start.id,m=""+h.end.floor+Xn+h.end.id,v=this.pointMap.get(g),x=this.pointMap.get(m);if(v&&x&&!v.permission&&!x.permission){let E=t;this.addLineItem(g,m,E,s)}}})}),this.connectionPointMap.forEach((l,p)=>{if(!(l.length<2))for(let h=0;h<l.length;h++){let g=""+l[h].floor+Xn+l[h].id,m=this.pointMap.get(g);if(!(!m||m.permission)){for(let v=0;v<l.length;v++)if(h!==v){let x=""+l[v].floor+Xn+l[v].id,E=this.pointMap.get(x);if(!E||E.permission)continue;this.addLineItem(g,x,100,s)}}}})}initBaseRoute(){let t=new Map((0,jo.cloneDeep)([...this.lineMap]));this.addFacilityToLineMap(100,100+this.lift_priority,3e4,t),this.baseRoute=new ro.default(t)}initEscalatorRoute(){let t=new Map((0,jo.cloneDeep)([...this.lineMap])),e=1e4;this.addFacilityToLineMap(1*e,this.lift_priority*e,3e4*e,t),this.escalatorRoute=new ro.default(t)}initStraightLadderRoute(){let t=new Map((0,jo.cloneDeep)([...this.lineMap])),e=1e4;this.addFacilityToLineMap(3*e,1*e,3e4*e,t),this.straightLadderRoute=new ro.default(t)}initForwardRoute(){this.rampMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Xn+o.start.id,l=""+o.end.floor+Xn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(l);p&&h&&!p.permission&&!h.permission&&this.addLineItem(s,l,10,this.forwardLineMap)}})}),this.connectionPointMap.forEach((t,e)=>{if(!(t.length<2))for(let o=0;o<t.length;o++){let s=""+t[o].floor+Xn+t[o].id,l=this.pointMap.get(s);if(!(!l||l.permission)){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Xn+t[p].id,g=this.pointMap.get(h);if(!g||g.permission)continue;this.addLineItem(s,h,100,this.forwardLineMap)}}}}),this.forwardRoute=new ro.default(this.forwardLineMap)}checkStart(t){return!(!t.floor||!t.nodeId&&(!t.coord||t.coord.length<2))}checkEnd(t){return t.facility||t.parkingSpace&&t.floor?!0:this.checkStart(t)}transformStart(t,e,o){o===void 0&&(o={});var s;if(t.nodeId){let l=this.nodeMap.get(""+t.floor+Xn+t.nodeId);if(l!=null&&l.length)return l.map(p=>{let[h,g]=p.split(Xn);return{floor:h,id:g}})}if((s=t.coord)!=null&&s.length){let l=this.roadInfo.find(m=>m.floor===t.floor);if(!l)return null;let p=l.points.filter(m=>m.isStarted),h=l.points.filter(m=>{let v=""+m.floor+Xn+m.id;if(e==="forward"){if(!this.forwardLineMap.has(v)||o.adsorptionIntersection&&p.length&&!m.isStarted)return!1}else if(!this.lineMap.has(v))return!1;return!0});if(!h.length)return null;let g=h.reduce((m,v)=>{if(v.relatedId)return m;let x=_f(t.coord,v.cds);return x<m.min&&(m.min=x,m.point=v),m},{min:1/0,point:h[0]});return[{floor:l.floor,id:g.point.id}]}return null}transformEnd(t,e){if(t.floor){if(t.parkingSpace){let s=this.parkingMap.get(""+t.floor+Xn+t.parkingSpace);if(s)return[{floor:t.floor,id:s.id}]}let o=this.transformStart(t,e);if(o)return o}if(t.facility){let s=this.facilities.filter(l=>+l.type_id==+t.facility).map(l=>l.id).map(l=>this.facilityMap.get(""+l)).flat(2);if(s!=null&&s.length)return{floor:t.floor,facility:t.facility}}return null}getPath(t,e,o,s,l,p){if(o===void 0&&(o=""),p===void 0&&(p={}),!this.checkStart(t))return"start-error";if(!this.checkEnd(e))return"end-error";let h=this.transformStart(t,o,p);if(!h)return"no-start";let g=this.transformEnd(e,o);if(!g)return"no-end";let m=[];if(Array.isArray(g))for(let E=0;E<h.length;E++){let b=h[E];for(let T=0;T<g.length;T++){let I=g[T];if(b.floor===I.floor&&b.id===I.id)return"near"}}else{m=this.facilities.filter(b=>+b.type_id==+e.facility).map(b=>b.id).map(b=>this.facilityMap.get(""+b)).flat(2).filter(b=>b).filter(b=>g.floor?b.floor===g.floor:!0);for(let b=0;b<h.length;b++){let T=h[b];for(let I=0;I<m.length;I++){let S=m[I];if(T.floor===S.floor&&T.id===S.id)return"near"}}}let v;switch(o){case"escalator":v=this.getEscalatorPath.bind(this);break;case"straightLadder":v=this.getStraightLadderPath.bind(this);break;case"forward":v=this.getForwardPath.bind(this);break;default:v=this.getBasePath.bind(this);break}let x=null;return h.forEach(E=>{if(Array.isArray(g))g.forEach(b=>{let T=v(E,b,s,l);T&&T&&(!x||T[0].consume<x[0].consume)&&(x=T)});else{if(!m.length)return null;let b=m.map(T=>v(E,{floor:T.floor,id:T.id},s,l)).filter(T=>!!T);x=b.reduce((T,I)=>{let S=I[0].consume;return S<T.distance&&(T.distance=S,T.path=I),T},{distance:1/0,path:b[0]}).path}}),x}getRoutePath(t,e,o){let s=""+t.floor+Xn+t.id,l=""+e.floor+Xn+e.id,p=o.path(s,l);if(!p)return null;let h=[],g=p.reduce((m,v,x,E)=>{if(x===0)return 0;let b=E[x-1],T=o.graph.get(b).get(v);return m+T},0);return p.map(m=>{let v=this.pointMap.get(m);if(v){var x;let{floor:E}=v,b=v.type;if(this.isFacilityByType(v.type)){let T=this.facilities.find(I=>I.id===+v.targetId);T&&(b=T.entry_infra_type)}if(((x=h[h.length-1])==null?void 0:x.floor)===E){let T=h[h.length-1];T.points.push(v.cds),T.pointInfos.push(v),T.endType=b,T.destId=v.nodeId,T.distance=MN(T.points)}else h.push({floor:E,points:[v.cds],pointInfos:[v],endType:b,destId:v.nodeId,distance:0,consume:g})}}),h}getBasePath(t,e,o){if(!o)return this.getRoutePath(t,e,this.baseRoute);let s=(0,jo.cloneDeep)(this.baseRoute.graph);this.addPermissionLineToMap(o,["","escalator","staircase","straightLadder","connectionPoint"],s,new Map([["escalator",100],["connectionPoint",100],["straightLadder",100+this.lift_priority],["staircase",3e4]]));let l=new ro.default(s);return this.getRoutePath(t,e,l)}getEscalatorPath(t,e,o){if(!o)return this.getRoutePath(t,e,this.escalatorRoute);let s=(0,jo.cloneDeep)(this.escalatorRoute.graph),l=1e4;this.addPermissionLineToMap(o,["","escalator","staircase","straightLadder","connectionPoint"],s,new Map([["escalator",1*l],["connectionPoint",100],["straightLadder",this.lift_priority*l],["staircase",3e4*l]]));let p=new ro.default(s);return this.getRoutePath(t,e,p)}getStraightLadderPath(t,e,o){if(!o)return this.getRoutePath(t,e,this.straightLadderRoute);let s=(0,jo.cloneDeep)(this.straightLadderRoute.graph),l=1e4;this.addPermissionLineToMap(o,["","escalator","staircase","straightLadder","connectionPoint"],s,new Map([["escalator",3*l],["connectionPoint",100],["straightLadder",1*l],["staircase",3e4*l]]));let p=new ro.default(s);return this.getRoutePath(t,e,p)}getForwardPath(t,e,o,s){let l=new Map,p=E=>{let b=this.forwardRoute.graph.get(g);E.forEach(T=>{let I=b.get(T);(0,jo.isNil)(I)||(l.set(T,I),b.delete(T))})},h=()=>{let E=this.forwardRoute.graph.get(g);l.forEach((b,T)=>{E.set(T,b)})},g=""+t.floor+Xn+t.id;if(!(0,jo.isNil)(s)){let E=this.forwardLineMap.get(g),b=this.pointMap.get(g);if(b&&(E!=null&&E.size)&&E.size>1){let T=new Ye(b.cds[0],b.cds[1]),I=new Map;E.forEach((w,R)=>{let C=this.pointMap.get(R);if(C){let F=new Ye(C.cds[0],C.cds[1]),X=360-(new Ye().subVectors(F,T).angle()/Math.PI*180-90+360)%360;I.set(R,X)}});let S=Array.from(I).filter(w=>{let[R,C]=w;return Math.abs(C-s)<=60}).map(w=>{let[R]=w;return R});if(S.length)S.forEach(w=>I.delete(w)),p([...I.keys()]);else{let w=Array.from(I).reduce((R,C)=>{let F=Math.abs(C[1]-s);return F<R.diff?{diff:F,key:C[0]}:R},{diff:1/0,key:""});I.delete(w.key),p([...I.keys()])}}}if(!o){let E=this.getRoutePath(t,e,this.forwardRoute);return h(),E||this.getRoutePath(t,e,this.forwardRoute)}let m=(0,jo.cloneDeep)(this.forwardRoute.graph);this.addPermissionLineToMap(o,["","ramp"],m,new Map([["ramp",10]]));let v=new ro.default(m),x=this.getRoutePath(t,e,v);if(h(),x)return x;{let E=(0,jo.cloneDeep)(this.forwardRoute.graph);this.addPermissionLineToMap(o,["","ramp"],E,new Map([["ramp",10]]));let b=new ro.default(E);return this.getRoutePath(t,e,b)}}clear(){this.roadInfo=[],this.pointMap.clear(),this.nodeMap.clear(),this.facilityMap.clear(),this.straightLadderMap.clear(),this.escalatorMap.clear(),this.staircaseMap.clear(),this.lineMap.clear(),this.baseRoute=new ro.default,this.escalatorRoute=new ro.default,this.straightLadderRoute=new ro.default}constructor(t=3){this.lift_priority=t,this.roadInfo=[],this.facilities=[],this.pointMap=new Map,this.nodeMap=new Map,this.facilityMap=new Map,this.straightLadderMap=new Map,this.escalatorMap=new Map,this.rampMap=new Map,this.staircaseMap=new Map,this.connectionPointMap=new Map,this.parkingMap=new Map,this.lineMap=new Map,this.baseRoute=new ro.default,this.escalatorRoute=new ro.default,this.straightLadderRoute=new ro.default,this.forwardLineMap=new Map,this.forwardRoute=new ro.default}};var uwt=sn(jN(),1),lwt=sn(Yp(),1);function QN(n){return n.replace(/[A-Z]/g,t=>"_"+t.toLowerCase()).replace(/^_/,"")}function t2(n){let t={};for(let o in n)o.startsWith("on")&&(t[QN(o.slice(2))]=n[o]);let e=o=>ac(this,null,function*(){let{data:s}=o;if(t[s.type])try{let l=yield t[s.type](s.data);if(l!=null&&l.$transfer&&Array.isArray(l.$transfer)){let p=l.$transfer;delete l.$transfer,self.postMessage({type:""+s.type+"_result",key:s.key,data:l},p)}else self.postMessage({type:""+s.type+"_result",key:s.key,data:l})}catch(l){self.postMessage({type:""+s.type+"_result",key:s.key,error:l})}else self.postMessage({type:""+s.type+"_result",key:s.key,error:"no_event"})});return self.addEventListener("message",e),()=>{self.removeEventListener("message",e)}}var la=new Jg,r2,QK=new Promise(n=>{r2=n});function i2(n,t,e){let{floor:o,coord:s}=n,l=null;return(t||[]).forEach(p=>{let h=la.getPath({floor:o,coord:s},{floor:p.floor,parkingSpace:p.lot_id},"forward",0,e);if(h==="near"){l={floor:p.floor,spaceNo:p.lot_id,distance:0};return}if(!h||typeof h=="string")return;let g={floor:p.floor,spaceNo:p.lot_id,distance:h[0].consume};l||(l=g),l.distance>g.distance&&(l=g)}),l}function e2(n,t,e,o,s){let l=i2({floor:n,coord:t},e[n],s);return l||tj(n,t,e,o,s)}function tj(n,t,e,o,s){let l=o.indexOf(n);l===-1&&(l=o.length);let p=1,h=null;for(;p<=o.length;){if(o.filter((m,v)=>v===l-1||v===l+1).forEach(m=>{let v=i2({floor:n,coord:t},e[m],s);h?v&&h.distance>v.distance&&(h=v):h=v}),h)return h;p++}return h}function n2(n,t,e,o,s){let l=z1(n,t,t.floor,e,s);if(l)return l;let p=z1(n,t,n.floor,e,s);return p||ej(n,t,n.floor,e,o,s)}function z1(n,t,e,o,s){let l=o[e]||[];if(!l.length)return null;let p=null;return l.forEach(h=>{let g={floor:h.floor,parkingSpace:h.lot_id},m=la.getPath(n,g,"forward",0,s);if(!m||typeof m=="string"&&m!=="near")return;let v=la.getParkingSpaceInfo(h.floor,h.lot_id);if(!v)return;let x=la.getPath({floor:h.floor,coord:v.cds},t,"",0);if(x==="near"){p={floor:h.floor,spaceNo:h.lot_id,distance:0};return}if(!x||typeof x=="string")return;let E={floor:h.floor,spaceNo:h.lot_id,distance:x[0].consume};p?p.distance>E.distance&&(p=E):p=E}),p}function ej(n,t,e,o,s,l){let p=s.indexOf(e);p===-1&&(p=s.length);let h=1,g=null;for(;h<=s.length;){if(s.filter((v,x)=>x===p-1||x===p+1).forEach(v=>{let x=z1(n,t,v,o,l);g?x&&g.distance>x.distance&&(g=x):g=x}),g)return g;h++}return g}function nj(n){if(n.coord)return{floor:n.floor,coord:n.coord};if(n.nodeId){let t=la.getNodeInfo(n.floor,n.nodeId);if(t)return{floor:t.floor,coord:t.cds}}return null}function rj(n){if(n.coord)return{floor:n.floor,coord:n.coord};if(n.nodeId){let t=la.getNodeInfo(n.floor,n.nodeId);if(t)return{floor:t.floor,coord:t.cds}}if(n.parkingSpace){let t=la.getParkingSpaceInfo(n.floor,n.parkingSpace);if(t)return{floor:t.floor,coord:t.cds}}return null}t2({onSetRoadInfo(n){let{roadData:t,facilities:e}=n;la.initRoute(t,e),r2(!0)},onRecommend(n){return ac(this,null,function*(){let{start:t,end:e,travelDirection:o,carLotStatus:s,parkingType:l}=n;yield QK;let p=s.reduce((v,x)=>(v[x.floor]?v[x.floor].push(x):v[x.floor]=[x],v),{}),h=la.roadInfo.map(v=>v.floor),g=nj(t);if(!g)return null;let m=e?rj(e):null;if(l){let v=s.filter(x=>{let E=la.getParkingSpaceInfo(x.floor,x.lot_id);return E?E.parkingType===l:!1});if(v){let x=v.reduce((E,b)=>(E[b.floor]?E[b.floor].push(b):E[b.floor]=[b],E),{});if(m){let E=n2(g,m,x,h,o);if(E)return E}else{let E=e2(g.floor,g.coord,x,h,o);if(E)return E}}}return m?n2(g,m,p,h,o):e2(g.floor,g.coord,p,h,o)})},onClear(){la.clear()}});
23469
+ \`)};function Fg(n,t,e){this.x=n,this.y=t,this.weight=e}Fg.prototype.toString=function(){return"["+this.x+" "+this.y+"]"};Fg.prototype.getCost=function(n){return n&&n.x!==this.x&&n.y!==this.y?this.weight*1.41421:this.weight};Fg.prototype.isWall=function(){return this.weight===0};function BL(n){this.content=[],this.scoreFunction=n}BL.prototype={push:function(n){this.content.push(n),this.sinkDown(this.content.length-1)},pop:function(){var n=this.content[0],t=this.content.pop();return this.content.length>0&&(this.content[0]=t,this.bubbleUp(0)),n},remove:function(n){var t=this.content.indexOf(n),e=this.content.pop();t!==this.content.length-1&&(this.content[t]=e,this.scoreFunction(e)<this.scoreFunction(n)?this.sinkDown(t):this.bubbleUp(t))},size:function(){return this.content.length},rescoreElement:function(n){this.sinkDown(this.content.indexOf(n))},sinkDown:function(n){for(var t=this.content[n];n>0;){var e=(n+1>>1)-1,o=this.content[e];if(this.scoreFunction(t)<this.scoreFunction(o))this.content[e]=t,this.content[n]=o,n=e;else break}},bubbleUp:function(n){for(var t=this.content.length,e=this.content[n],o=this.scoreFunction(e);;){var s=n+1<<1,l=s-1,p=null,h;if(l<t){var g=this.content[l];h=this.scoreFunction(g),h<o&&(p=l)}if(s<t){var m=this.content[s],v=this.scoreFunction(m);v<(p===null?o:h)&&(p=s)}if(p!==null)this.content[n]=this.content[p],this.content[p]=e,n=p;else break}}};function p1(){this._=null}function pf(n){n.U=n.C=n.L=n.R=n.P=n.N=null}p1.prototype={constructor:p1,insert:function(n,t){var e,o,s;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=zL(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)o=e.U,e===o.L?(s=o.R,s&&s.C?(e.C=s.C=!1,o.C=!0,n=o):(n===e.R&&(Rh(this,e),n=e,e=n.U),e.C=!1,o.C=!0,Lh(this,o))):(s=o.L,s&&s.C?(e.C=s.C=!1,o.C=!0,n=o):(n===e.L&&(Lh(this,e),n=e,e=n.U),e.C=!1,o.C=!0,Rh(this,o))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t=n.U,e,o=n.L,s=n.R,l,p;if(o?s?l=zL(s):l=o:l=s,t?t.L===n?t.L=l:t.R=l:this._=l,o&&s?(p=l.C,l.C=n.C,l.L=o,o.U=l,l!==s?(t=l.U,l.U=n.U,n=l.R,t.L=n,l.R=s,s.U=l):(l.U=t,t=l,n=l.R)):(p=n.C,n=l),n&&(n.U=t),!p){if(n&&n.C){n.C=!1;return}do{if(n===this._)break;if(n===t.L){if(e=t.R,e.C&&(e.C=!1,t.C=!0,Rh(this,t),e=t.R),e.L&&e.L.C||e.R&&e.R.C){(!e.R||!e.R.C)&&(e.L.C=!1,e.C=!0,Lh(this,e),e=t.R),e.C=t.C,t.C=e.R.C=!1,Rh(this,t),n=this._;break}}else if(e=t.L,e.C&&(e.C=!1,t.C=!0,Lh(this,t),e=t.L),e.L&&e.L.C||e.R&&e.R.C){(!e.L||!e.L.C)&&(e.R.C=!1,e.C=!0,Rh(this,e),e=t.L),e.C=t.C,t.C=e.L.C=!1,Lh(this,t),n=this._;break}e.C=!0,n=t,t=t.U}while(!n.C);n&&(n.C=!1)}}};function Rh(n,t){var e=t,o=t.R,s=e.U;s?s.L===e?s.L=o:s.R=o:n._=o,o.U=s,e.U=o,e.R=o.L,e.R&&(e.R.U=e),o.L=e}function Lh(n,t){var e=t,o=t.L,s=e.U;s?s.L===e?s.L=o:s.R=o:n._=o,o.U=s,e.U=o,e.L=o.R,e.L&&(e.L.U=e),o.R=e}function zL(n){for(;n.L;)n=n.L;return n}var d1=p1;function df(n,t,e,o){var s=[null,null],l=Hi.push(s)-1;return s.left=n,s.right=t,e&&Nh(s,n,t,e),o&&Nh(s,t,n,o),To[n.index].halfedges.push(l),To[t.index].halfedges.push(l),s}function gf(n,t,e){var o=[t,e];return o.left=n,o}function Nh(n,t,e,o){!n[0]&&!n[1]?(n[0]=o,n.left=t,n.right=e):n.left===e?n[1]=o:n[0]=o}function oJ(n,t,e,o,s){var l=n[0],p=n[1],h=l[0],g=l[1],m=p[0],v=p[1],x=0,E=1,b=m-h,T=v-g,I;if(I=t-h,!(!b&&I>0)){if(I/=b,b<0){if(I<x)return;I<E&&(E=I)}else if(b>0){if(I>E)return;I>x&&(x=I)}if(I=o-h,!(!b&&I<0)){if(I/=b,b<0){if(I>E)return;I>x&&(x=I)}else if(b>0){if(I<x)return;I<E&&(E=I)}if(I=e-g,!(!T&&I>0)){if(I/=T,T<0){if(I<x)return;I<E&&(E=I)}else if(T>0){if(I>E)return;I>x&&(x=I)}if(I=s-g,!(!T&&I<0)){if(I/=T,T<0){if(I>E)return;I>x&&(x=I)}else if(T>0){if(I<x)return;I<E&&(E=I)}return!(x>0)&&!(E<1)||(x>0&&(n[0]=[h+x*b,g+x*T]),E<1&&(n[1]=[h+E*b,g+E*T])),!0}}}}}function sJ(n,t,e,o,s){var l=n[1];if(l)return!0;var p=n[0],h=n.left,g=n.right,m=h[0],v=h[1],x=g[0],E=g[1],b=(m+x)/2,T=(v+E)/2,I,S;if(E===v){if(b<t||b>=o)return;if(m>x){if(!p)p=[b,e];else if(p[1]>=s)return;l=[b,s]}else{if(!p)p=[b,s];else if(p[1]<e)return;l=[b,e]}}else if(I=(m-x)/(E-v),S=T-I*b,I<-1||I>1)if(m>x){if(!p)p=[(e-S)/I,e];else if(p[1]>=s)return;l=[(s-S)/I,s]}else{if(!p)p=[(s-S)/I,s];else if(p[1]<e)return;l=[(e-S)/I,e]}else if(v<E){if(!p)p=[t,I*t+S];else if(p[0]>=o)return;l=[o,I*o+S]}else{if(!p)p=[o,I*o+S];else if(p[0]<t)return;l=[t,I*t+S]}return n[0]=p,n[1]=l,!0}function GL(n,t,e,o){for(var s=Hi.length,l;s--;)(!sJ(l=Hi[s],n,t,e,o)||!oJ(l,n,t,e,o)||!(Math.abs(l[0][0]-l[1][0])>Er||Math.abs(l[0][1]-l[1][1])>Er))&&delete Hi[s]}function kL(n){return To[n.index]={site:n,halfedges:[]}}function aJ(n,t){var e=n.site,o=t.left,s=t.right;return e===s&&(s=o,o=e),s?Math.atan2(s[1]-o[1],s[0]-o[0]):(e===o?(o=t[1],s=t[0]):(o=t[0],s=t[1]),Math.atan2(o[0]-s[0],s[1]-o[1]))}function g1(n,t){return t[+(t.left!==n.site)]}function uJ(n,t){return t[+(t.left===n.site)]}function qL(){for(var n=0,t=To.length,e,o,s,l;n<t;++n)if((e=To[n])&&(l=(o=e.halfedges).length)){var p=new Array(l),h=new Array(l);for(s=0;s<l;++s)p[s]=s,h[s]=aJ(e,Hi[o[s]]);for(p.sort(function(g,m){return h[m]-h[g]}),s=0;s<l;++s)h[s]=o[p[s]];for(s=0;s<l;++s)o[s]=h[s]}}function HL(n,t,e,o){var s=To.length,l,p,h,g,m,v,x,E,b,T,I,S,w=!0;for(l=0;l<s;++l)if(p=To[l]){for(h=p.site,m=p.halfedges,g=m.length;g--;)Hi[m[g]]||m.splice(g,1);for(g=0,v=m.length;g<v;)T=uJ(p,Hi[m[g]]),I=T[0],S=T[1],x=g1(p,Hi[m[++g%v]]),E=x[0],b=x[1],(Math.abs(I-E)>Er||Math.abs(S-b)>Er)&&(m.splice(g,0,Hi.push(gf(h,T,Math.abs(I-n)<Er&&o-S>Er?[n,Math.abs(E-n)<Er?b:o]:Math.abs(S-o)<Er&&e-I>Er?[Math.abs(b-o)<Er?E:e,o]:Math.abs(I-e)<Er&&S-t>Er?[e,Math.abs(E-e)<Er?b:t]:Math.abs(S-t)<Er&&I-n>Er?[Math.abs(b-t)<Er?E:n,t]:null))-1),++v);v&&(w=!1)}if(w){var R,C,F,W=1/0;for(l=0,w=null;l<s;++l)(p=To[l])&&(h=p.site,R=h[0]-n,C=h[1]-t,F=R*R+C*C,F<W&&(W=F,w=p));if(w){var X=[n,t],q=[n,o],D=[e,o],xt=[e,t];w.halfedges.push(Hi.push(gf(h=w.site,X,q))-1,Hi.push(gf(h,q,D))-1,Hi.push(gf(h,D,xt))-1,Hi.push(gf(h,xt,X))-1)}}for(l=0;l<s;++l)(p=To[l])&&(p.halfedges.length||delete To[l])}var VL=[],Ug;function lJ(){pf(this),this.x=this.y=this.arc=this.site=this.cy=null}function Wl(n){var t=n.P,e=n.N;if(!(!t||!e)){var o=t.site,s=n.site,l=e.site;if(o!==l){var p=s[0],h=s[1],g=o[0]-p,m=o[1]-h,v=l[0]-p,x=l[1]-h,E=2*(g*x-m*v);if(!(E>=-WL)){var b=g*g+m*m,T=v*v+x*x,I=(x*b-m*T)/E,S=(g*T-v*b)/E,w=VL.pop()||new lJ;w.arc=n,w.site=s,w.x=I+p,w.y=(w.cy=S+h)+Math.sqrt(I*I+S*S),n.circle=w;for(var R=null,C=mf._;C;)if(w.y<C.y||w.y===C.y&&w.x<=C.x)if(C.L)C=C.L;else{R=C.P;break}else if(C.R)C=C.R;else{R=C;break}mf.insert(R,w),R||(Ug=w)}}}}function Xl(n){var t=n.circle;t&&(t.P||(Ug=t.N),mf.remove(t),VL.push(t),pf(t),n.circle=null)}var YL=[];function cJ(){pf(this),this.edge=this.site=this.circle=null}function XL(n){var t=YL.pop()||new cJ;return t.site=n,t}function m1(n){Xl(n),Yl.remove(n),YL.push(n),pf(n)}function $L(n){var t=n.circle,e=t.x,o=t.cy,s=[e,o],l=n.P,p=n.N,h=[n];m1(n);for(var g=l;g.circle&&Math.abs(e-g.circle.x)<Er&&Math.abs(o-g.circle.cy)<Er;)l=g.P,h.unshift(g),m1(g),g=l;h.unshift(g),Xl(g);for(var m=p;m.circle&&Math.abs(e-m.circle.x)<Er&&Math.abs(o-m.circle.cy)<Er;)p=m.N,h.push(m),m1(m),m=p;h.push(m),Xl(m);var v=h.length,x;for(x=1;x<v;++x)m=h[x],g=h[x-1],Nh(m.edge,g.site,m.site,s);g=h[0],m=h[v-1],m.edge=df(g.site,m.site,null,s),Wl(g),Wl(m)}function ZL(n){for(var t=n[0],e=n[1],o,s,l,p,h=Yl._;h;)if(l=JL(h,e)-t,l>Er)h=h.L;else if(p=t-fJ(h,e),p>Er){if(!h.R){o=h;break}h=h.R}else{l>-Er?(o=h.P,s=h):p>-Er?(o=h,s=h.N):o=s=h;break}kL(n);var g=XL(n);if(Yl.insert(o,g),!(!o&&!s)){if(o===s){Xl(o),s=XL(o.site),Yl.insert(g,s),g.edge=s.edge=df(o.site,g.site),Wl(o),Wl(s);return}if(!s){g.edge=df(o.site,g.site);return}Xl(o),Xl(s);var m=o.site,v=m[0],x=m[1],E=n[0]-v,b=n[1]-x,T=s.site,I=T[0]-v,S=T[1]-x,w=2*(E*S-b*I),R=E*E+b*b,C=I*I+S*S,F=[(S*R-b*C)/w+v,(E*C-I*R)/w+x];Nh(s.edge,m,T,F),g.edge=df(m,n,null,F),s.edge=df(n,T,null,F),Wl(o),Wl(s)}}function JL(n,t){var e=n.site,o=e[0],s=e[1],l=s-t;if(!l)return o;var p=n.P;if(!p)return-1/0;e=p.site;var h=e[0],g=e[1],m=g-t;if(!m)return h;var v=h-o,x=1/l-1/m,E=v/m;return x?(-E+Math.sqrt(E*E-2*x*(v*v/(-2*m)-g+m/2+s-l/2)))/x+o:(o+h)/2}function fJ(n,t){var e=n.N;if(e)return JL(e,t);var o=n.site;return o[1]===t?o[0]:1/0}var Er=1e-6,WL=1e-12,Yl,To,mf,Hi;function hJ(n,t,e){return(n[0]-e[0])*(t[1]-n[1])-(n[0]-t[0])*(e[1]-n[1])}function pJ(n,t){return t[1]-n[1]||t[0]-n[0]}function Bg(n,t){var e=n.sort(pJ).pop(),o,s,l;for(Hi=[],To=new Array(n.length),Yl=new d1,mf=new d1;;)if(l=Ug,e&&(!l||e[1]<l.y||e[1]===l.y&&e[0]<l.x))(e[0]!==o||e[1]!==s)&&(ZL(e),o=e[0],s=e[1]),e=n.pop();else if(l)$L(l.arc);else break;if(qL(),t){var p=+t[0][0],h=+t[0][1],g=+t[1][0],m=+t[1][1];GL(p,h,g,m),HL(p,h,g,m)}this.edges=Hi,this.cells=To,Yl=mf=Hi=To=null}Bg.prototype={constructor:Bg,polygons:function(){var n=this.edges;return this.cells.map(function(t){var e=t.halfedges.map(function(o){return g1(t,n[o])});return e.data=t.site.data,e})},triangles:function(){var n=[],t=this.edges;return this.cells.forEach(function(e,o){if(h=(l=e.halfedges).length)for(var s=e.site,l,p=-1,h,g,m=t[l[h-1]],v=m.left===s?m.right:m.left;++p<h;)g=v,m=t[l[p]],v=m.left===s?m.right:m.left,g&&v&&o<g.index&&o<v.index&&hJ(s,g,v)<0&&n.push([s.data,g.data,v.data])}),n},links:function(){return this.edges.filter(function(n){return n.right}).map(function(n){return{source:n.left.data,target:n.right.data}})},find:function(n,t,e){for(var o=this,s,l=o._found||0,p=o.cells.length,h;!(h=o.cells[l]);)if(++l>=p)return null;var g=n-h.site[0],m=t-h.site[1],v=g*g+m*m;do h=o.cells[s=l],l=null,h.halfedges.forEach(function(x){var E=o.edges[x],b=E.left;if(!((b===h.site||!b)&&!(b=E.right))){var T=n-b[0],I=t-b[1],S=T*T+I*I;S<v&&(v=S,l=b.index)}});while(l!==null);return o._found=s,e==null||v<=e*e?h.site:null}};var EJ=sn(yf(),1);var R1=sn(tN(),1);function Zo(){return new kg}function kg(){this.reset()}kg.prototype={constructor:kg,reset:function(){this.s=this.t=0},add:function(n){eN(Gg,n,this.t),eN(this,Gg.s,this.s),this.s?this.t+=Gg.t:this.s=Gg.t},valueOf:function(){return this.s}};var Gg=new kg;function eN(n,t,e){var o=n.s=t+e,s=o-t,l=o-s;n.t=t-l+(e-s)}var er=1e-6;var gr=Math.PI,Mi=gr/2,qg=gr/4,Da=gr*2,$l=180/gr,Jo=gr/180,Zr=Math.abs,aa=Math.atan,Ko=Math.atan2,Wn=Math.cos;var Hg=Math.exp;var Oh=Math.log;var an=Math.sin;var no=Math.sqrt,Dh=Math.tan;function _1(n){return n>1?0:n<-1?gr:Math.acos(n)}function Co(n){return n>1?Mi:n<-1?-Mi:Math.asin(n)}function ua(){}var wJ=Zo(),rpt=Zo();function Zl(n){var t=n[0],e=n[1],o=Wn(e);return[o*Wn(t),o*an(t),an(e)]}function Fh(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function Uh(n){var t=no(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}var ppt=Zo();function rN(n,t){return[n>gr?n-Da:n<-gr?n+Da:n,t]}rN.invert=rN;function x1(){var n=[],t;return{point:function(e,o){t.push([e,o])},lineStart:function(){n.push(t=[])},lineEnd:ua,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function E1(n,t){return Zr(n[0]-t[0])<er&&Zr(n[1]-t[1])<er}function Vg(n,t,e,o){this.x=n,this.z=t,this.o=e,this.e=o,this.v=!1,this.n=this.p=null}function w1(n,t,e,o,s){var l=[],p=[],h,g;if(n.forEach(function(T){if(!((I=T.length-1)<=0)){var I,S=T[0],w=T[I],R;if(E1(S,w)){for(s.lineStart(),h=0;h<I;++h)s.point((S=T[h])[0],S[1]);s.lineEnd();return}l.push(R=new Vg(S,T,null,!0)),p.push(R.o=new Vg(S,null,R,!1)),l.push(R=new Vg(w,T,null,!1)),p.push(R.o=new Vg(w,null,R,!0))}}),!!l.length){for(p.sort(t),iN(l),iN(p),h=0,g=p.length;h<g;++h)p[h].e=e=!e;for(var m=l[0],v,x;;){for(var E=m,b=!0;E.v;)if((E=E.n)===m)return;v=E.z,s.lineStart();do{if(E.v=E.o.v=!0,E.e){if(b)for(h=0,g=v.length;h<g;++h)s.point((x=v[h])[0],x[1]);else o(E.x,E.n.x,1,s);E=E.n}else{if(b)for(v=E.p.z,h=v.length-1;h>=0;--h)s.point((x=v[h])[0],x[1]);else o(E.x,E.p.x,-1,s);E=E.p}E=E.o,v=E.z,b=!b}while(!E.v);s.lineEnd()}}}function iN(n){if(t=n.length){for(var t,e=0,o=n[0],s;++e<t;)o.n=s=n[e],s.p=o,o=s;o.n=s=n[0],s.p=o}}function sl(n,t){return n<t?-1:n>t?1:n>=t?0:NaN}function S1(n){return n.length===1&&(n=bJ(n)),{left:function(t,e,o,s){for(o==null&&(o=0),s==null&&(s=t.length);o<s;){var l=o+s>>>1;n(t[l],e)<0?o=l+1:s=l}return o},right:function(t,e,o,s){for(o==null&&(o=0),s==null&&(s=t.length);o<s;){var l=o+s>>>1;n(t[l],e)>0?s=l:o=l+1}return o}}}function bJ(n){return function(t,e){return sl(n(t),e)}}var oN=S1(sl),AJ=oN.right,TJ=oN.left;var sN=Array.prototype,PJ=sN.slice,IJ=sN.map;var odt=Math.sqrt(50),sdt=Math.sqrt(10),adt=Math.sqrt(2);function Xg(n){for(var t=n.length,e,o=-1,s=0,l,p;++o<t;)s+=n[o].length;for(l=new Array(s);--t>=0;)for(p=n[t],e=p.length;--e>=0;)l[--s]=p[e];return l}var BJ=1e9,Vgt=-BJ;var M1=Zo();function b1(n,t){var e=t[0],o=t[1],s=[an(e),-Wn(e),0],l=0,p=0;M1.reset();for(var h=0,g=n.length;h<g;++h)if(v=(m=n[h]).length)for(var m,v,x=m[v-1],E=x[0],b=x[1]/2+qg,T=an(b),I=Wn(b),S=0;S<v;++S,E=R,T=F,I=W,x=w){var w=m[S],R=w[0],C=w[1]/2+qg,F=an(C),W=Wn(C),X=R-E,q=X>=0?1:-1,D=q*X,xt=D>gr,B=T*F;if(M1.add(Ko(B*q*an(D),I*W+B*Wn(D))),l+=xt?X+q*Da:X,xt^E>=e^R>=e){var j=Fh(Zl(x),Zl(w));Uh(j);var J=Fh(s,j);Uh(J);var Dt=(xt^X>=0?-1:1)*Co(J[2]);(o>Dt||o===Dt&&(j[0]||j[1]))&&(p+=xt^X>=0?1:-1)}}return(l<-er||l<er&&M1<-er)^p&1}var tmt=Zo();var _mt=Zo(),xmt=Zo();var kJ=1/0;var Smt=-kJ;function A1(n){this._context=n}A1.prototype={_radius:4.5,pointRadius:function(n){return this._radius=n,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(n,t){switch(this._point){case 0:{this._context.moveTo(n,t),this._point=1;break}case 1:{this._context.lineTo(n,t);break}default:{this._context.moveTo(n+this._radius,t),this._context.arc(n,t,this._radius,0,Da);break}}},result:ua};var Nmt=Zo();function T1(){this._string=[]}T1.prototype={_radius:4.5,_circle:lN(4.5),pointRadius:function(n){return(n=+n)!==this._radius&&(this._radius=n,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(n,t){switch(this._point){case 0:{this._string.push("M",n,",",t),this._point=1;break}case 1:{this._string.push("L",n,",",t);break}default:{this._circle==null&&(this._circle=lN(this._radius)),this._string.push("M",n,",",t,this._circle);break}}},result:function(){if(this._string.length){var n=this._string.join("");return this._string=[],n}else return null}};function lN(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function C1(n,t,e,o){return function(s,l){var p=t(l),h=s.invert(o[0],o[1]),g=x1(),m=t(g),v=!1,x,E,b,T={point:I,lineStart:w,lineEnd:R,polygonStart:function(){T.point=C,T.lineStart=F,T.lineEnd=W,E=[],x=[]},polygonEnd:function(){T.point=I,T.lineStart=w,T.lineEnd=R,E=Xg(E);var X=b1(x,h);E.length?(v||(l.polygonStart(),v=!0),w1(E,VJ,X,e,l)):X&&(v||(l.polygonStart(),v=!0),l.lineStart(),e(null,null,1,l),l.lineEnd()),v&&(l.polygonEnd(),v=!1),E=x=null},sphere:function(){l.polygonStart(),l.lineStart(),e(null,null,1,l),l.lineEnd(),l.polygonEnd()}};function I(X,q){var D=s(X,q);n(X=D[0],q=D[1])&&l.point(X,q)}function S(X,q){var D=s(X,q);p.point(D[0],D[1])}function w(){T.point=S,p.lineStart()}function R(){T.point=I,p.lineEnd()}function C(X,q){b.push([X,q]);var D=s(X,q);m.point(D[0],D[1])}function F(){m.lineStart(),b=[]}function W(){C(b[0][0],b[0][1]),m.lineEnd();var X=m.clean(),q=g.result(),D,xt=q.length,B,j,J;if(b.pop(),x.push(b),b=null,!!xt){if(X&1){if(j=q[0],(B=j.length-1)>0){for(v||(l.polygonStart(),v=!0),l.lineStart(),D=0;D<B;++D)l.point((J=j[D])[0],J[1]);l.lineEnd()}return}xt>1&&X&2&&q.push(q.pop().concat(q.shift())),E.push(q.filter(HJ))}}return T}}function HJ(n){return n.length>1}function VJ(n,t){return((n=n.x)[0]<0?n[1]-Mi-er:Mi-n[1])-((t=t.x)[0]<0?t[1]-Mi-er:Mi-t[1])}var WJ=C1(function(){return!0},XJ,$J,[-gr,-Mi]);function XJ(n){var t=NaN,e=NaN,o=NaN,s;return{lineStart:function(){n.lineStart(),s=1},point:function(l,p){var h=l>0?gr:-gr,g=Zr(l-t);Zr(g-gr)<er?(n.point(t,e=(e+p)/2>0?Mi:-Mi),n.point(o,e),n.lineEnd(),n.lineStart(),n.point(h,e),n.point(l,e),s=0):o!==h&&g>=gr&&(Zr(t-o)<er&&(t-=o*er),Zr(l-h)<er&&(l-=h*er),e=YJ(t,e,l,p),n.point(o,e),n.lineEnd(),n.lineStart(),n.point(h,e),s=0),n.point(t=l,e=p),o=h},lineEnd:function(){n.lineEnd(),t=e=NaN},clean:function(){return 2-s}}}function YJ(n,t,e,o){var s,l,p=an(n-e);return Zr(p)>er?aa((an(t)*(l=Wn(o))*an(e)-an(o)*(s=Wn(t))*an(n))/(s*l*p)):(t+o)/2}function $J(n,t,e,o){var s;if(n==null)s=e*Mi,o.point(-gr,s),o.point(0,s),o.point(gr,s),o.point(gr,0),o.point(gr,-s),o.point(0,-s),o.point(-gr,-s),o.point(-gr,0),o.point(-gr,s);else if(Zr(n[0]-t[0])>er){var l=n[0]<t[0]?gr:-gr;s=e*l/2,o.point(-l,s),o.point(0,s),o.point(l,s)}else o.point(t[0],t[1])}function Yg(n){return function(t){var e=new P1;for(var o in n)e[o]=n[o];return e.stream=t,e}}function P1(){}P1.prototype={constructor:P1,point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var x0t=Wn(30*Jo);var O0t=Yg({point:function(n,t){this.stream.point(n*Jo,t*Jo)}});function $g(n){return function(t,e){var o=Wn(t),s=Wn(e),l=n(o*s);return[l*s*an(t),l*an(e)]}}function Fa(n){return function(t,e){var o=no(t*t+e*e),s=n(o),l=an(s),p=Wn(s);return[Ko(t*l,o*p),Co(o&&e*l/o)]}}var mN=$g(function(n){return no(2/(1+n))});mN.invert=Fa(function(n){return 2*Co(n/2)});var yN=$g(function(n){return(n=_1(n))&&n/an(n)});yN.invert=Fa(function(n){return n});function I1(n,t){return[n,Oh(Dh((Mi+t)/2))]}I1.invert=function(n,t){return[n,2*aa(Hg(t))-Mi]};function Zg(n,t){return[n,t]}Zg.invert=Zg;function vN(n,t){var e=Wn(t),o=Wn(n)*e;return[e*an(n)/o,an(t)/o]}vN.invert=Fa(aa);function _N(n,t){var e=t*t,o=e*e;return[n*(.8707-.131979*e+o*(-.013791+o*(.003971*e-.001529*o))),t*(1.007226+e*(.015085+o*(-.044475+.028874*e-.005916*o)))]}_N.invert=function(n,t){var e=t,o=25,s;do{var l=e*e,p=l*l;e-=s=(e*(1.007226+l*(.015085+p*(-.044475+.028874*l-.005916*p)))-t)/(1.007226+l*(.015085*3+p*(-.044475*7+.028874*9*l-.005916*11*p)))}while(Zr(s)>er&&--o>0);return[n/(.8707+(l=e*e)*(-.131979+l*(-.013791+l*l*l*(.003971-.001529*l)))),e]};function xN(n,t){return[Wn(t)*an(n),an(t)]}xN.invert=Fa(Co);function EN(n,t){var e=Wn(t),o=1+Wn(n)*e;return[e*an(n)/o,an(t)/o]}EN.invert=Fa(function(n){return 2*aa(n)});function wN(n,t){return[Oh(Dh((Mi+t)/2)),-n]}wN.invert=function(n,t){return[-t,2*aa(Hg(n))-Mi]};var tK=sn(yf(),1);var eK=sn(yf(),1);var rK=sn(yf(),1);var iK=sn(yf(),1);function _f(n,t){return Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2)}function MN(n){let t=0;for(let e=0;e<n.length-1;e++)t+=_f(n[e],n[e+1]);return t}var jo=sn(bN(),1);var Xn="___",Jg=class{isFacilityByType(t){return["facility","escalator","straightLadder","staircase","ramp","connectionPoint"].includes(t)}initFacilities(t){this.facilities=t.map(e=>{let o=[];try{o=JSON.parse(e.entry_end_floor)}catch(l){o=[]}let s=[];try{s=JSON.parse(e.entry_start_floor)}catch(l){s=[]}return Lu({},e,{entry_start_floor:s,entry_end_floor:o})})}getParkingSpaceInfo(t,e){let o=""+t+Xn+e;var s;return(s=this.parkingMap.get(o))!=null?s:null}getNodeInfo(t,e){let o=""+t+Xn+e,s=this.nodeMap.get(o);if(!(s!=null&&s.length))return null;let l=this.pointMap.get(s[0]);return l!=null?l:null}initRoute(t,e){this.clear(),this.roadInfo=t,this.initFacilities(e);let o=new Date,s=o.getHours()*60+o.getMinutes();t.length&&(t.forEach(l=>{let p=(l.points||[]).filter(h=>!(0,jo.isNil)(h.passWeight)&&h.passWeight!==1&&!(0,jo.isNil)(h.coverageArea)&&h.coverageArea!==0);(l.points||[]).filter(h=>h.openStatus!==!1).filter(h=>{if(!h.startTime||!h.endTime)return!0;let[g,m]=h.startTime.split(":").map(T=>+T),[v,x]=h.endTime.split(":").map(T=>+T),E=g*60+m,b=v*60+x;return s>=E&&s<=b}).forEach(h=>{h.floor=l.floor;let g=""+l.floor+Xn+h.id,m=""+l.floor+Xn+h.nodeId,v=this.nodeMap.get(m)||[];if(v.push(""+l.floor+Xn+(h.relatedId||h.id)),this.nodeMap.set(""+l.floor+Xn+h.nodeId,v),this.pointMap.set(g,h),this.isFacilityByType(h.type)){let x=this.facilities.find(E=>E.id===+h.targetId);if(x){switch(x.entry_infra_type){case"straightLadder":if(x.entry_end_floor.find(I=>I.floor===l.floor)&&x.entry_start_floor.find(I=>I.floor===l.floor)){let I=this.straightLadderMap.get(h.targetId)||[];I.push(Lu({},h)),this.straightLadderMap.set(h.targetId,I)}break;case"staircase":if(x.entry_end_floor.find(I=>I.floor===l.floor)&&x.entry_start_floor.find(I=>I.floor===l.floor)){let I=this.staircaseMap.get(h.targetId)||[];I.push(Lu({},h)),this.staircaseMap.set(h.targetId,I)}break;case"escalator":let b=this.escalatorMap.get(h.targetId)||[];if(x.entry_start_floor.find(I=>I.floor===l.floor)){let I=b.find(S=>{var w;return((w=S.end)==null?void 0:w.floor)!==l.floor&&!S.start});I?I.start=h:b.push({start:h})}if(x.entry_end_floor.find(I=>I.floor===l.floor)){let I=b.find(S=>{var w;return((w=S.start)==null?void 0:w.floor)!==l.floor&&!S.end});I?I.end=h:b.push({end:h})}this.escalatorMap.set(h.targetId,b);break;case"ramp":let T=this.rampMap.get(h.targetId)||[];if(x.entry_start_floor.find(I=>I.floor===l.floor)){let I=T.find(S=>{var w;return((w=S.end)==null?void 0:w.floor)!==l.floor&&!S.start});I?I.start=h:T.push({start:h})}if(x.entry_end_floor.find(I=>I.floor===l.floor)){let I=T.find(S=>{var w;return((w=S.start)==null?void 0:w.floor)!==l.floor&&!S.end});I?I.end=h:T.push({end:h})}this.rampMap.set(h.targetId,T);break;case"connectionPoint":if(x.entry_end_floor.find(I=>I.floor===l.floor)&&x.entry_start_floor.find(I=>I.floor===l.floor)){let I=this.connectionPointMap.get(h.targetId)||[];I.push(Lu({},h)),this.connectionPointMap.set(h.targetId,I)}break}let E=this.facilityMap.get(h.targetId)||[];E.push(Lu({},h)),this.facilityMap.set(h.targetId,E)}}h.type==="parkingSpace"&&h.name.split(/[,\uFF0C]/).forEach(E=>{this.parkingMap.set(""+l.floor+Xn+E,h)})}),(l.lines||[]).filter(h=>h.to!==h.from).forEach(h=>{let g=""+l.floor+Xn+h.from,m=""+l.floor+Xn+h.to,v=this.pointMap.get(g),x=this.pointMap.get(m);if(!v||!x)return;let E=v.cds,b=x.cds,T=_f(E,b);if(p.forEach(I=>{(I.id===h.from||I.id===h.to)&&(T=T/I.passWeight);let S=_f(E,I.cds)<=I.coverageArea,w=_f(b,I.cds)<=I.coverageArea;(S||w)&&(T=T/I.passWeight)}),!v.permission&&!x.permission){switch(this.addLineItem(g,m,T),this.addLineItem(m,g,T),h.direction){case"double":this.addLineItem(g,m,T,this.forwardLineMap),this.addLineItem(m,g,T,this.forwardLineMap);break;case"single":this.addLineItem(g,m,T,this.forwardLineMap);break;case"back":this.addLineItem(m,g,T,this.forwardLineMap);break}(v.type==="parkingSpace"||x.type==="parkingSpace")&&h.direction==="noDir"&&(this.addLineItem(g,m,T,this.forwardLineMap),this.addLineItem(m,g,T,this.forwardLineMap))}else v.permission&&(this.setPermissionLine(g,m,v.permission,T,""),this.setPermissionLine(m,g,v.permission,T,"")),x.permission&&x.permission!==v.permission&&(this.setPermissionLine(g,m,x.permission,T,""),this.setPermissionLine(m,g,x.permission,T,""))})}),this.addPermissionFacility(),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute(),this.initForwardRoute())}getPermissionMap(t){return this["permission_"+t]||(this["permission_"+t]=new Set),this["permission_"+t]}setPermissionLine(t,e,o,s,l){this.getPermissionMap(o).add({fromKey:t,toKey:e,distance:s,type:l})}addPermissionFacility(){this.straightLadderMap.forEach((t,e)=>{if(t.length<2){this.straightLadderMap.delete(e);return}for(let o=0;o<t.length;o++){let s=""+t[o].floor+Xn+t[o].id,l=this.pointMap.get(s);if(l){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Xn+t[p].id,g=this.pointMap.get(h);if(!g)continue;l.permission&&this.setPermissionLine(s,h,l.permission,1,"straightLadder"),g.permission&&g.permission!==l.permission&&this.setPermissionLine(s,h,g.permission,1,"straightLadder")}}}}),this.staircaseMap.forEach((t,e)=>{if(t.length<2){this.staircaseMap.delete(e);return}for(let o=0;o<t.length;o++){let s=""+t[o].floor+Xn+t[o].id,l=this.pointMap.get(s);if(l){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Xn+t[p].id,g=this.pointMap.get(h);if(!g)continue;l.permission&&this.setPermissionLine(s,h,l.permission,1,"staircase"),g.permission&&g.permission!==l.permission&&this.setPermissionLine(s,h,g.permission,1,"staircase")}}}}),this.escalatorMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Xn+o.start.id,l=""+o.end.floor+Xn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(l);p&&h&&(p.permission&&this.setPermissionLine(s,l,p.permission,1,"escalator"),h.permission&&h.permission!==p.permission&&this.setPermissionLine(s,l,h.permission,1,"escalator"))}})}),this.rampMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Xn+o.start.id,l=""+o.end.floor+Xn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(l);p&&h&&(p.permission&&this.setPermissionLine(s,l,p.permission,10,"ramp"),h.permission&&h.permission!==p.permission&&this.setPermissionLine(s,l,h.permission,10,"ramp"))}})}),this.connectionPointMap.forEach((t,e)=>{if(t.length<2){this.connectionPointMap.delete(e);return}for(let o=0;o<t.length;o++){let s=""+t[o].floor+Xn+t[o].id,l=this.pointMap.get(s);if(l){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Xn+t[p].id,g=this.pointMap.get(h);if(!g)continue;l.permission&&this.setPermissionLine(s,h,l.permission,1,"connectionPoint"),g.permission&&g.permission!==l.permission&&this.setPermissionLine(s,h,g.permission,1,"connectionPoint")}}}})}addPermissionLineToMap(t,e,o,s){this.getPermissionMap(t).forEach(p=>{e.includes(p.type)&&(p.type===""?this.addLineItem(p.fromKey,p.toKey,p.distance,o):this.addLineItem(p.fromKey,p.toKey,s.get(p.type),o))})}addLineItem(t,e,o,s){s===void 0&&(s=this.lineMap);let l=s.get(t)||new Map;l.set(e,o),s.set(t,l)}addFacilityToLineMap(t,e,o,s){[...this.straightLadderMap,...this.staircaseMap].forEach(l=>{let[p,h]=l;if(!(h.length<2))for(let g=0;g<h.length;g++){let m=""+h[g].floor+Xn+h[g].id,v=this.pointMap.get(m);if(!(!v||v.permission)){for(let x=0;x<h.length;x++)if(g!==x){let E=""+h[x].floor+Xn+h[x].id,b=this.pointMap.get(E);if(!b||b.permission)continue;if(h[g].type==="straightLadder"){let T=e;this.addLineItem(m,E,T,s)}else{let T=o;this.addLineItem(m,E,T,s)}}}}}),this.escalatorMap.forEach((l,p)=>{l.forEach(h=>{if(h.start&&h.end){let g=""+h.start.floor+Xn+h.start.id,m=""+h.end.floor+Xn+h.end.id,v=this.pointMap.get(g),x=this.pointMap.get(m);if(v&&x&&!v.permission&&!x.permission){let E=t;this.addLineItem(g,m,E,s)}}})}),this.connectionPointMap.forEach((l,p)=>{if(!(l.length<2))for(let h=0;h<l.length;h++){let g=""+l[h].floor+Xn+l[h].id,m=this.pointMap.get(g);if(!(!m||m.permission)){for(let v=0;v<l.length;v++)if(h!==v){let x=""+l[v].floor+Xn+l[v].id,E=this.pointMap.get(x);if(!E||E.permission)continue;this.addLineItem(g,x,100,s)}}}})}initBaseRoute(){let t=new Map((0,jo.cloneDeep)([...this.lineMap]));this.addFacilityToLineMap(100,100*this.lift_priority,3e4,t),this.baseRoute=new ro.default(t)}initEscalatorRoute(){let t=new Map((0,jo.cloneDeep)([...this.lineMap])),e=1e4;this.addFacilityToLineMap(1*e,this.lift_priority*e,3e4*e,t),this.escalatorRoute=new ro.default(t)}initStraightLadderRoute(){let t=new Map((0,jo.cloneDeep)([...this.lineMap])),e=1e4;this.addFacilityToLineMap(3*e,1*e,3e4*e,t),this.straightLadderRoute=new ro.default(t)}initForwardRoute(){this.rampMap.forEach((t,e)=>{t.forEach(o=>{if(o.start&&o.end){let s=""+o.start.floor+Xn+o.start.id,l=""+o.end.floor+Xn+o.end.id,p=this.pointMap.get(s),h=this.pointMap.get(l);p&&h&&!p.permission&&!h.permission&&this.addLineItem(s,l,10,this.forwardLineMap)}})}),this.connectionPointMap.forEach((t,e)=>{if(!(t.length<2))for(let o=0;o<t.length;o++){let s=""+t[o].floor+Xn+t[o].id,l=this.pointMap.get(s);if(!(!l||l.permission)){for(let p=0;p<t.length;p++)if(o!==p){let h=""+t[p].floor+Xn+t[p].id,g=this.pointMap.get(h);if(!g||g.permission)continue;this.addLineItem(s,h,100,this.forwardLineMap)}}}}),this.forwardRoute=new ro.default(this.forwardLineMap)}checkStart(t){return!(!t.floor||!t.nodeId&&(!t.coord||t.coord.length<2))}checkEnd(t){return t.facility||t.parkingSpace&&t.floor?!0:this.checkStart(t)}transformStart(t,e,o){o===void 0&&(o={});var s;if(t.nodeId){let l=this.nodeMap.get(""+t.floor+Xn+t.nodeId);if(l!=null&&l.length)return l.map(p=>{let[h,g]=p.split(Xn);return{floor:h,id:g}})}if((s=t.coord)!=null&&s.length){let l=this.roadInfo.find(m=>m.floor===t.floor);if(!l)return null;let p=l.points.filter(m=>m.isStarted),h=l.points.filter(m=>{let v=""+m.floor+Xn+m.id;if(e==="forward"){if(!this.forwardLineMap.has(v)||o.adsorptionIntersection&&p.length&&!m.isStarted)return!1}else if(!this.lineMap.has(v))return!1;return!0});if(!h.length)return null;let g=h.reduce((m,v)=>{if(v.relatedId)return m;let x=_f(t.coord,v.cds);return x<m.min&&(m.min=x,m.point=v),m},{min:1/0,point:h[0]});return[{floor:l.floor,id:g.point.id}]}return null}transformEnd(t,e){if(t.floor){if(t.parkingSpace){let s=this.parkingMap.get(""+t.floor+Xn+t.parkingSpace);if(s)return[{floor:t.floor,id:s.id}]}let o=this.transformStart(t,e);if(o)return o}if(t.facility){let s=this.facilities.filter(l=>+l.type_id==+t.facility).map(l=>l.id).map(l=>this.facilityMap.get(""+l)).flat(2);if(s!=null&&s.length)return{floor:t.floor,facility:t.facility}}return null}getPath(t,e,o,s,l,p){if(o===void 0&&(o=""),p===void 0&&(p={}),!this.checkStart(t))return"start-error";if(!this.checkEnd(e))return"end-error";let h=this.transformStart(t,o,p);if(!h)return"no-start";let g=this.transformEnd(e,o);if(!g)return"no-end";let m=[];if(Array.isArray(g))for(let E=0;E<h.length;E++){let b=h[E];for(let T=0;T<g.length;T++){let I=g[T];if(b.floor===I.floor&&b.id===I.id)return"near"}}else{m=this.facilities.filter(b=>+b.type_id==+e.facility).map(b=>b.id).map(b=>this.facilityMap.get(""+b)).flat(2).filter(b=>b).filter(b=>g.floor?b.floor===g.floor:!0);for(let b=0;b<h.length;b++){let T=h[b];for(let I=0;I<m.length;I++){let S=m[I];if(T.floor===S.floor&&T.id===S.id)return"near"}}}let v;switch(o){case"escalator":v=this.getEscalatorPath.bind(this);break;case"straightLadder":v=this.getStraightLadderPath.bind(this);break;case"forward":v=this.getForwardPath.bind(this);break;default:v=this.getBasePath.bind(this);break}let x=null;return h.forEach(E=>{if(Array.isArray(g))g.forEach(b=>{let T=v(E,b,s,l);T&&T&&(!x||T[0].consume<x[0].consume)&&(x=T)});else{if(!m.length)return null;let b=m.map(T=>v(E,{floor:T.floor,id:T.id},s,l)).filter(T=>!!T);x=b.reduce((T,I)=>{let S=I[0].consume;return S<T.distance&&(T.distance=S,T.path=I),T},{distance:1/0,path:b[0]}).path}}),x}getRoutePath(t,e,o){let s=""+t.floor+Xn+t.id,l=""+e.floor+Xn+e.id,p=o.path(s,l);if(!p)return null;let h=[],g=p.reduce((m,v,x,E)=>{if(x===0)return 0;let b=E[x-1],T=o.graph.get(b).get(v);return m+T},0);return p.map(m=>{let v=this.pointMap.get(m);if(v){var x;let{floor:E}=v,b=v.type;if(this.isFacilityByType(v.type)){let T=this.facilities.find(I=>I.id===+v.targetId);T&&(b=T.entry_infra_type)}if(((x=h[h.length-1])==null?void 0:x.floor)===E){let T=h[h.length-1];T.points.push(v.cds),T.pointInfos.push(v),T.endType=b,T.destId=v.nodeId,T.distance=MN(T.points)}else h.push({floor:E,points:[v.cds],pointInfos:[v],endType:b,destId:v.nodeId,distance:0,consume:g})}}),h}getBasePath(t,e,o){if(!o)return this.getRoutePath(t,e,this.baseRoute);let s=(0,jo.cloneDeep)(this.baseRoute.graph);this.addPermissionLineToMap(o,["","escalator","staircase","straightLadder","connectionPoint"],s,new Map([["escalator",100],["connectionPoint",100],["straightLadder",100*this.lift_priority],["staircase",3e4]]));let l=new ro.default(s);return this.getRoutePath(t,e,l)}getEscalatorPath(t,e,o){if(!o)return this.getRoutePath(t,e,this.escalatorRoute);let s=(0,jo.cloneDeep)(this.escalatorRoute.graph),l=1e4;this.addPermissionLineToMap(o,["","escalator","staircase","straightLadder","connectionPoint"],s,new Map([["escalator",1*l],["connectionPoint",100],["straightLadder",this.lift_priority*l],["staircase",3e4*l]]));let p=new ro.default(s);return this.getRoutePath(t,e,p)}getStraightLadderPath(t,e,o){if(!o)return this.getRoutePath(t,e,this.straightLadderRoute);let s=(0,jo.cloneDeep)(this.straightLadderRoute.graph),l=1e4;this.addPermissionLineToMap(o,["","escalator","staircase","straightLadder","connectionPoint"],s,new Map([["escalator",3*l],["connectionPoint",100],["straightLadder",1*l],["staircase",3e4*l]]));let p=new ro.default(s);return this.getRoutePath(t,e,p)}getForwardPath(t,e,o,s){let l=new Map,p=E=>{let b=this.forwardRoute.graph.get(g);E.forEach(T=>{let I=b.get(T);(0,jo.isNil)(I)||(l.set(T,I),b.delete(T))})},h=()=>{let E=this.forwardRoute.graph.get(g);l.forEach((b,T)=>{E.set(T,b)})},g=""+t.floor+Xn+t.id;if(!(0,jo.isNil)(s)){let E=this.forwardLineMap.get(g),b=this.pointMap.get(g);if(b&&(E!=null&&E.size)&&E.size>1){let T=new Ye(b.cds[0],b.cds[1]),I=new Map;E.forEach((w,R)=>{let C=this.pointMap.get(R);if(C){let F=new Ye(C.cds[0],C.cds[1]),X=360-(new Ye().subVectors(F,T).angle()/Math.PI*180-90+360)%360;I.set(R,X)}});let S=Array.from(I).filter(w=>{let[R,C]=w;return Math.abs(C-s)<=60}).map(w=>{let[R]=w;return R});if(S.length)S.forEach(w=>I.delete(w)),p([...I.keys()]);else{let w=Array.from(I).reduce((R,C)=>{let F=Math.abs(C[1]-s);return F<R.diff?{diff:F,key:C[0]}:R},{diff:1/0,key:""});I.delete(w.key),p([...I.keys()])}}}if(!o){let E=this.getRoutePath(t,e,this.forwardRoute);return h(),E||this.getRoutePath(t,e,this.forwardRoute)}let m=(0,jo.cloneDeep)(this.forwardRoute.graph);this.addPermissionLineToMap(o,["","ramp"],m,new Map([["ramp",10]]));let v=new ro.default(m),x=this.getRoutePath(t,e,v);if(h(),x)return x;{let E=(0,jo.cloneDeep)(this.forwardRoute.graph);this.addPermissionLineToMap(o,["","ramp"],E,new Map([["ramp",10]]));let b=new ro.default(E);return this.getRoutePath(t,e,b)}}clear(){this.roadInfo=[],this.pointMap.clear(),this.nodeMap.clear(),this.facilityMap.clear(),this.straightLadderMap.clear(),this.escalatorMap.clear(),this.staircaseMap.clear(),this.lineMap.clear(),this.baseRoute=new ro.default,this.escalatorRoute=new ro.default,this.straightLadderRoute=new ro.default}constructor(t=3){this.lift_priority=t,this.roadInfo=[],this.facilities=[],this.pointMap=new Map,this.nodeMap=new Map,this.facilityMap=new Map,this.straightLadderMap=new Map,this.escalatorMap=new Map,this.rampMap=new Map,this.staircaseMap=new Map,this.connectionPointMap=new Map,this.parkingMap=new Map,this.lineMap=new Map,this.baseRoute=new ro.default,this.escalatorRoute=new ro.default,this.straightLadderRoute=new ro.default,this.forwardLineMap=new Map,this.forwardRoute=new ro.default}};var uwt=sn(jN(),1),lwt=sn(Yp(),1);function QN(n){return n.replace(/[A-Z]/g,t=>"_"+t.toLowerCase()).replace(/^_/,"")}function t2(n){let t={};for(let o in n)o.startsWith("on")&&(t[QN(o.slice(2))]=n[o]);let e=o=>ac(this,null,function*(){let{data:s}=o;if(t[s.type])try{let l=yield t[s.type](s.data);if(l!=null&&l.$transfer&&Array.isArray(l.$transfer)){let p=l.$transfer;delete l.$transfer,self.postMessage({type:""+s.type+"_result",key:s.key,data:l},p)}else self.postMessage({type:""+s.type+"_result",key:s.key,data:l})}catch(l){self.postMessage({type:""+s.type+"_result",key:s.key,error:l})}else self.postMessage({type:""+s.type+"_result",key:s.key,error:"no_event"})});return self.addEventListener("message",e),()=>{self.removeEventListener("message",e)}}var la=new Jg,r2,QK=new Promise(n=>{r2=n});function i2(n,t,e){let{floor:o,coord:s}=n,l=null;return(t||[]).forEach(p=>{let h=la.getPath({floor:o,coord:s},{floor:p.floor,parkingSpace:p.lot_id},"forward",0,e);if(h==="near"){l={floor:p.floor,spaceNo:p.lot_id,distance:0};return}if(!h||typeof h=="string")return;let g={floor:p.floor,spaceNo:p.lot_id,distance:h[0].consume};l||(l=g),l.distance>g.distance&&(l=g)}),l}function e2(n,t,e,o,s){let l=i2({floor:n,coord:t},e[n],s);return l||tj(n,t,e,o,s)}function tj(n,t,e,o,s){let l=o.indexOf(n);l===-1&&(l=o.length);let p=1,h=null;for(;p<=o.length;){if(o.filter((m,v)=>v===l-1||v===l+1).forEach(m=>{let v=i2({floor:n,coord:t},e[m],s);h?v&&h.distance>v.distance&&(h=v):h=v}),h)return h;p++}return h}function n2(n,t,e,o,s){let l=z1(n,t,t.floor,e,s);if(l)return l;let p=z1(n,t,n.floor,e,s);return p||ej(n,t,n.floor,e,o,s)}function z1(n,t,e,o,s){let l=o[e]||[];if(!l.length)return null;let p=null;return l.forEach(h=>{let g={floor:h.floor,parkingSpace:h.lot_id},m=la.getPath(n,g,"forward",0,s);if(!m||typeof m=="string"&&m!=="near")return;let v=la.getParkingSpaceInfo(h.floor,h.lot_id);if(!v)return;let x=la.getPath({floor:h.floor,coord:v.cds},t,"",0);if(x==="near"){p={floor:h.floor,spaceNo:h.lot_id,distance:0};return}if(!x||typeof x=="string")return;let E={floor:h.floor,spaceNo:h.lot_id,distance:x[0].consume};p?p.distance>E.distance&&(p=E):p=E}),p}function ej(n,t,e,o,s,l){let p=s.indexOf(e);p===-1&&(p=s.length);let h=1,g=null;for(;h<=s.length;){if(s.filter((v,x)=>x===p-1||x===p+1).forEach(v=>{let x=z1(n,t,v,o,l);g?x&&g.distance>x.distance&&(g=x):g=x}),g)return g;h++}return g}function nj(n){if(n.coord)return{floor:n.floor,coord:n.coord};if(n.nodeId){let t=la.getNodeInfo(n.floor,n.nodeId);if(t)return{floor:t.floor,coord:t.cds}}return null}function rj(n){if(n.coord)return{floor:n.floor,coord:n.coord};if(n.nodeId){let t=la.getNodeInfo(n.floor,n.nodeId);if(t)return{floor:t.floor,coord:t.cds}}if(n.parkingSpace){let t=la.getParkingSpaceInfo(n.floor,n.parkingSpace);if(t)return{floor:t.floor,coord:t.cds}}return null}t2({onSetRoadInfo(n){let{roadData:t,facilities:e}=n;la.initRoute(t,e),r2(!0)},onRecommend(n){return ac(this,null,function*(){let{start:t,end:e,travelDirection:o,carLotStatus:s,parkingType:l}=n;yield QK;let p=s.reduce((v,x)=>(v[x.floor]?v[x.floor].push(x):v[x.floor]=[x],v),{}),h=la.roadInfo.map(v=>v.floor),g=nj(t);if(!g)return null;let m=e?rj(e):null;if(l){let v=s.filter(x=>{let E=la.getParkingSpaceInfo(x.floor,x.lot_id);return E?E.parkingType===l:!1});if(v){let x=v.reduce((E,b)=>(E[b.floor]?E[b.floor].push(b):E[b.floor]=[b],E),{});if(m){let E=n2(g,m,x,h,o);if(E)return E}else{let E=e2(g.floor,g.coord,x,h,o);if(E)return E}}}return m?n2(g,m,p,h,o):e2(g.floor,g.coord,p,h,o)})},onClear(){la.clear()}});
23470
23470
  `],{type:"text/javascript"}),g=URL.createObjectURL(t),I=new Worker(g);return URL.revokeObjectURL(g),I}var eN={placeId:0,catLotStatusApi:"https://vrapi.aibee.cn/parking/cat-lot-status"},v0=class{setRoadData(g,I){return ng(this.worker,"set_road_info",{roadData:g,facilities:I})}recommend(g){return m(this,null,function*(){let I=yield fetch(this.options.catLotStatusApi,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({place_id:+this.options.placeId})}).then(A=>A.json()).then(A=>A.data.filter(C=>C.status===0));return ng(this.worker,"recommend",D({},g,{carLotStatus:I}))})}dispose(){this.worker.terminate()}constructor(g={}){this.worker=M0(),this.options=D({},eN,g)}};var CIg=l(DC(),1),tIg=l(_(),1),eIg=l(PC(),1),iIg=l(W(),1),nIg=l(Nu(),1),rIg=l(Fu(),1),oIg=l(ku(),1),sIg=l(Lu(),1),aIg=l(nI(),1);var qgg=l(DC(),1);var iN={url:"",reconnect:!0,heartBeat:2e3,heartMsg:"PING",reconnectTime:3e3,reconnectMaxCount:1e6,noMessageTime:6e3},Kt=class extends hg{initWebsocket(){this.ws=new WebSocket(this.options.url),this.ws.onopen=()=>{this.alive=!0,this.startHeart(),this.startOnMessageTimer(),this.stopReconnect(),this.dispatchEvent({type:"open"})},this.ws.onerror=()=>{this.alive=!1,this.ws=null,this.stopHeart(),this.stopOnMessageTimer(),this.startReconnect(),this.registryEvent()},this.ws.onclose=()=>{this.alive=!1,this.ws=null,this.stopHeart(),this.stopOnMessageTimer(),this.startReconnect()},this.ws.onmessage=g=>{this.startOnMessageTimer(),this.dispatchEvent({type:"message",message:g})}}startHeart(){this.stopHeart(),this.heartTimer=this.timer.setInterval(()=>{this.send(this.options.heartMsg)&&this.dispatchEvent({type:"send-heart"})},this.options.heartBeat)}stopHeart(){this.heartTimer&&(this.timer.clearInterval(this.heartTimer),this.heartTimer=null)}startReconnect(g){g===void 0&&(g=this.options.reconnectTime),this.stopReconnect(),this.options.reconnect&&(this.options.reconnectMaxCount--,this.options.reconnectMaxCount>=0&&(this.reconnectTimer=this.timer.setTimeout(()=>{this.initWebsocket()},g)))}stopReconnect(){this.reconnectTimer&&(this.timer.clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}startOnMessageTimer(){this.stopOnMessageTimer(),this.noMessageTimer=this.timer.setTimeout(()=>{var g;(g=this.ws)==null||g.close(),this.dispatchEvent({type:"no-message-timeout"})},this.options.noMessageTime)}stopOnMessageTimer(){this.noMessageTimer&&(this.timer.clearTimeout(this.noMessageTimer),this.noMessageTimer=null)}send(g){var I;let A=typeof g=="string"?g:JSON.stringify(g);return this.alive&&((I=this.ws)==null?void 0:I.readyState)===1?(this.ws.send(g),this.dispatchEvent({type:"send-success",msg:A}),!0):(this.dispatchEvent({type:"send-fail",msg:A}),!1)}registryEvent(){window.addEventListener("online",this.onOnline)}unRegistryEvent(){window.removeEventListener("online",this.onOnline)}close(){var g;this.unRegistryEvent(),this.options.reconnect=!1,this.alive=!1,this.stopHeart(),this.stopReconnect(),this.stopOnMessageTimer(),(g=this.ws)==null||g.close(),this.ws=null,this.dispatchEvent({type:"close"})}dispose(){this.close(),this.timer.dispose(),super.dispose()}constructor(g){super(),this.ws=null,this.alive=!1,this.timer=new tg,this.heartTimer=null,this.reconnectTimer=null,this.noMessageTimer=null,this.onOnline=()=>{this.startReconnect()},this.options=D({},iN,g||{}),this.options.url&&this.initWebsocket()}};var _0=require("lodash");var P0=t=>{let g=t.toString(2),I=""+Array(16-g.length+1).join("0")+g,A=parseInt(I.slice(0,4),2)*10,C=parseInt(I.slice(4,16),2);return[A,C]};var E0=class extends hg{initPositionWebSocket(){let g=D({},this.options.ext_position_params,{place_id:this.options.place_id,token:this.options.access_token}),I=Object.keys(g).filter(A=>!(0,_0.isNil)(g[A])).map(A=>A+"="+g[A]).join("&");this.positionWebSocket=new Kt({url:this.options.wss_position_url+"?"+I}),this.positionWebSocket.addEventListener("message",A=>{let{message:C}=A,e=(()=>{try{return JSON.parse(C.data)}catch(Y){return C.data}})();if(e.command==="POSITION_RESULT"&&e.data.success)if(["POSITION","FLOOR","PARK_POSITION"].includes(e.data.success_type)&&this.useGpsFloorTimer&&(this.positionFloor=e.data.floor,this.timer.clearTimeout(this.useGpsFloorTimer),this.useGpsFloorTimer=null),e.data.success_type==="POSITION"){let{x:Y,y:b,time:G,floor:E,ts:Q}=e.data,Cg=this.positionFloor!==E;if(this.positionFloor=E,this.dispatchEvent({type:"ws-position",floor:E,x:Y,y:b,time:G}),console.log("positionFloor",E,Cg),this.options.upload_position){var i;(i=this.positionWebSocket)==null||i.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:Y,y:b,floor:E,type:"originBeacon"}),serverData:JSON.stringify(e)})}if(!this.options.use_pdr){this.dispatchEvent({type:"position",floor:E,x:Y,y:b,time:new Date(Q).getTime()-e.lag-e.duration});return}if(this.options.type!==1){var n;if(Cg){var r,o,s;(s=this.pdrPosition)==null||(o=s.pdr)==null||(r=o.particleFilter)==null||r.setPosInitFlag(!1)}(n=this.pdrPosition)==null||n.setBeaconPosition({x:Y,y:b},new Date(Q).getTime()-e.lag-e.duration)}else if(Cg){var a;if(this.resetPdr(),(a=this.carInertialPosition)==null||a.stopPositionTimer(),this.path){let $=this.path.findIndex(NA=>NA.floor===E),L=this.path[$];if(L){var u;this.resetPdr(),(u=this.carInertialPosition)==null||u.setBeaconPosition(L.points[0],new Date(G).getTime()-e.lag-e.duration,e.lag+e.duration)}else{var c;(c=this.carInertialPosition)==null||c.setBeaconPosition([Y,b],new Date(G).getTime()-e.lag-e.duration,e.lag+e.duration)}}else{var h;(h=this.carInertialPosition)==null||h.setBeaconPosition([Y,b],new Date(G).getTime()-e.lag-e.duration,e.lag+e.duration)}}else{var f;(f=this.carInertialPosition)==null||f.setBeaconPosition([Y,b],new Date(G).getTime()-e.lag-e.duration,e.lag+e.duration)}}else if(e.data.success_type==="PARK_POSITION"&&e.data.success){if(this.options.type===1){let{x:Y,y:b,time:G,floor:E}=e.data,Q=this.positionFloor!==E;if(this.positionFloor=e.data.floor,this.dispatchEvent({type:"ws-position",floor:E,x:Y,y:b,time:G}),!this.options.use_pdr){this.dispatchEvent({type:"position",floor:E,x:Y,y:b,time:new Date(G).getTime()});return}if(Q){var d;if(this.resetPdr(),(d=this.carInertialPosition)==null||d.stopPositionTimer(),this.path){let Cg=this.path.findIndex(L=>L.floor===E),$=this.path[Cg];if($){var S;this.resetPdr(),(S=this.carInertialPosition)==null||S.setPosition($.points[0],new Date(G).getTime(),e.duration)}else{var w;(w=this.carInertialPosition)==null||w.setPosition([Y,b],new Date(G).getTime(),e.duration)}}else{var M;(M=this.carInertialPosition)==null||M.setPosition([Y,b],new Date(G).getTime(),e.duration)}}else{var K,O;if((K=this.carInertialPosition)==null||K.setPosition([Y,b],new Date(G).getTime(),e.duration),!((O=this.carInertialPosition)!=null&&O.positionTimer)){var N;(N=this.carInertialPosition)==null||N.startPositionTimer()}}if(this.options.upload_position){var v;(v=this.positionWebSocket)==null||v.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:Y,y:b,floor:E,type:"vision"}),serverData:JSON.stringify(e)})}}}else this.dispatchEvent({type:"floor",floor:e.data.floor,time:e.data.time})})}initSensorWebSocket(){let g=D({},this.options.ext_sensor_params,{token:this.options.access_token,place_id:this.options.place_id,record_sensor:1}),I=Object.keys(g).filter(A=>!(0,_0.isNil)(g[A])).map(A=>A+"="+g[A]).join("&");this.sensorWebSocket=new Kt({url:this.options.wss_sensor_url+"?"+I})}initPdr(){this.options.type===1?(this.carInertialPosition=new pi,this.carInertialPosition.addEventListener("change-pos",g=>{let{value:I}=g,{pos:A,success:C,speed:e}=I;if(C&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:A[0],y:A[1],time:Date.now(),speed:e}),this.options.upload_position)){var i;(i=this.positionWebSocket)==null||i.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:A[0],y:A[1],floor:this.positionFloor,type:"vision_pdr"})})}}),this.carInertialPosition.addEventListener("change-compass",g=>{let{value:I}=g;this.dispatchEvent({type:"compass",value:I})})):(this.pdrPosition=new ui(this.bmap,{pdr:{using_gps:this.options.use_gps},sensor:{elements:[J.COMPASS,J.ACCELERATION,J.DEVICE_MOTION].concat(this.options.use_gps?[J.GPS]:[])}}),this.requestDeviceOrientationPermission(),this.options.upload_position&&this.pdrPosition.sensor.addEventListener("sensor-data",g=>{let{data:I}=g;var A;(A=this.positionWebSocket)==null||A.send({command:"UPLOAD_SENSOR",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify(I)})}),this.pdrPosition.sensor.addEventListener("add-data-item",g=>{g.item.type==="compass"&&this.dispatchEvent({type:"compass",value:g.item.res})}),this.pdrPosition.addEventListener("position",g=>{let{x:I,y:A,_type:C}=g;if(console.log("_type",C,I,A,this.positionFloor,this.gpsFloor),C==="gps"&&!this.useGpsFloorTimer){let i=()=>{this.useGpsFloorTimer=this.timer.setTimeout(()=>{this.gpsFloor?this.positionFloor=this.gpsFloor:i()},5e3)};i()}if(this.positionFloor&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:I,y:A,time:Date.now()}),this.options.upload_position)){var e;(e=this.positionWebSocket)==null||e.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:I,y:A,floor:this.positionFloor,type:C})})}}))}setSensor(g){this.pdrPosition&&this.pdrPosition.setSensor(g)}requestDeviceOrientationPermission(){return m(this,null,function*(){if(this.pdrPosition){let g=yield this.pdrPosition.checkSensor();return g.deviceOrientation?this.pdrPosition.start():(this.dispatchEvent(D({type:"check-sensor"},g)),!g.deviceOrientation&&this.options.use_default_permission),g}else return null})}getGpsFloor(){return m(this,null,function*(){if(this.options.use_gps&&this.options.get_gps_floor_url){let g=yield fetch(this.options.get_gps_floor_url+"/"+this.options.place_id).then(I=>I.json());g.code===200&&(this.gpsFloor=g.data.gps_floor)}})}pausePdr(){if(this.options.type===1){var g;(g=this.carInertialPosition)==null||g.stopPositionTimer()}else{var I;(I=this.pdrPosition)==null||I.pause()}}continuePdr(){if(this.options.type===1)this.carInertialPosition&&(this.carInertialPosition.positionTimer||this.carInertialPosition.startPositionTimer());else{var g;(g=this.pdrPosition)==null||g.continue()}}setPathAngle(g){if(this.options.type===1){var I;(I=this.carInertialPosition)==null||I.setPathAngle(g)}}getForwardAngle(){if(this.options.type===1){var g,I;return(I=(g=this.carInertialPosition)==null?void 0:g.angle)!=null?I:null}else return null}resetPdr(){this.carInertialPosition&&(this.carInertialPosition.history=[],this.carInertialPosition.setPathAngle(0),this.carInertialPosition.speed=0),this.pdrPosition&&this.pdrPosition.pdr.particleFilter.setPosInitFlag(!1)}setPath(g){this.path=g}sendBeacon(g){var I;let A=[];if(zA)A=g.map(e=>{let[i,n]=P0(e.major);return[e.uuid,n,e.minor,e.rssi,e.accuracy,i]}).filter(e=>e[3]!==0).sort((e,i)=>i[3]-e[3]);else{let e=g.reduce((i,n)=>{var r,o;let[s,a]=P0(n.major),u=""+a+n.minor;return(r=i)[o=u]||(r[o]=[]),i[u].push(D({},n,{battery:s})),i},{});Object.entries(e).forEach(i=>{let[n,r]=i,{uuid:o,major:s,minor:a,accuracy:u,battery:c}=r[0];if(r.length>1){let h=r.filter(d=>d.rssi<0),f=h.reduce((d,S)=>d+S.rssi,0);A.push([o,s,a,f/h.length,u,c])}else A.push([o,s,a,r[0].rssi,u,c])})}let C={command:"POSITION",index:this.uploadIndex++,ts:Date.now(),beacons:JSON.stringify(A),ext_sensors:JSON.stringify({})};(I=this.sensorWebSocket)==null||I.send(C)}dispose(){var g,I,A,C;this.timer.dispose(),(g=this.positionWebSocket)==null||g.dispose(),this.positionWebSocket=null,(I=this.sensorWebSocket)==null||I.dispose(),this.sensorWebSocket=null,(A=this.pdrPosition)==null||A.dispose(),this.pdrPosition=null,(C=this.carInertialPosition)==null||C.dispose(),this.carInertialPosition=null,super.dispose()}constructor(g,I){super(),this.bmap=g,this.positionWebSocket=null,this.sensorWebSocket=null,this.pdrPosition=null,this.carInertialPosition=null,this.gpsFloor="",this.positionFloor="",this.useGpsFloorTimer=null,this.uploadIndex=0,this.path=null,this.timer=new tg;let A=new URLSearchParams(location.search),C=A.get("server_env")||"prod",e={test:"nav-test.aibee.cn",prod:"nav.aibee.cn"},i="wss://"+e[C]+"/aether-walker/indoor/position",n="wss://"+e[C]+"/aether-walker/indoor/sensor";this.options=D({place_id:A.get("place_id"),access_token:A.get("access_token"),env:C,wss_position_url:i,wss_sensor_url:n,get_gps_floor_url:"https://"+e[C]+"/aether-walker/indoor/conf",use_sensor:!1,type:-1,use_gps:!0,use_pdr:!0,upload_position:!0,use_default_permission:!0,ext_position_params:{},ext_sensor_params:{}},I),this.initPositionWebSocket(),this.options.use_sensor&&this.initSensorWebSocket(),this.options.use_pdr&&this.initPdr(),this.options.use_gps&&this.getGpsFloor()}};var yIg=l(_(),1);var b0=class extends yg{showMyPosition(g,I){var A;let C=(A=this.bmap.context.currentFloor)==null?void 0:A.getGraphicPosition(g);if(C){let e=new RC(this.bmap.context,{autoUpdate:!0,appendToBody:!1});e.div.appendChild(I),e.position.copy(this.bmap.mercatorToWorld(C)),this.myPositionOverlay=e,console.log("graphicPos",C,this)}else console.warn("[showMyPosition] \u6CA1\u6709\u627E\u5230\u56FE\u5143\u6240\u5728\u7684\u4F4D\u7F6E")}hideMyPosition(){this.myPositionOverlay&&(this.myPositionOverlay.dispose(),this.myPositionOverlay=null)}dispose(){this.hideMyPosition()}constructor(...g){super(...g),this.myPositionOverlay=null}};var x0=class extends yg{highlightPoi(g,I){I===void 0&&(I={icon_size:[40,40],collision_enable:!1}),g.map(C=>this.bmap.getPoiById(C)).filter(C=>!!C).forEach(C=>{var e;(e=C.userData).restore||(e.restore={});for(let r in I)if(r in C.options){var i,n;(i=C.userData.restore)[n=r]||(i[n]=C.options[r]),C.options[r]=I[r]}})}restorePoi(g){g.map(A=>this.bmap.getPoiById(A)).filter(A=>!!A).forEach(A=>{console.log("poi.userData.restore",A.userData.restore);for(let C in A.userData.restore)C in A.options&&(A.options[C]=A.userData.restore[C]);A.userData.restore={}})}};var vIg=l(_(),1),PIg=l(PC(),1);var K0=class extends yg{sortByDistance(g,I,A){return m(this,null,function*(){A===void 0&&(A=!1);let C=[...I];if(A||I.length<20)return yield Promise.all(C.map(e=>m(this,null,function*(){e.distance=yield this._getDistance(g,{floor:e.floor,x:e.center_x,y:e.center_y})}))),C.sort((e,i)=>e.distance-i.distance);{let e=C.sort((n,r)=>{let o=Math.sqrt((n.center_x-g.x)**2+(n.center_y-g.y)**2)+(g.floor===n.floor?0:100),s=Math.sqrt((r.center_x-g.x)**2+(r.center_y-g.y)**2)+(g.floor===r.floor?0:100);return o-s});return[...(yield Promise.all(e.slice(0,20).map(n=>m(this,null,function*(){return n.distance=yield this._getDistance(g,{floor:n.floor,x:n.center_x,y:n.center_y}),n})))).sort((n,r)=>n.distance-r.distance),...e.slice(20)]}})}_getDistance(g,I){return m(this,null,function*(){return this.navPath.getPath({floor:g.floor,coord:[g.x,g.y]},{floor:I.floor,coord:[I.x,I.y]},"",0).then(A=>A.reduce((C,e,i)=>{if(C+=e.distance,i!==A.length-1)switch(e.endType){case"escalator":case"straightLadder":case"staircase":case"ramp":C+=100;break}return C},0)).catch(A=>A==="near"?0:1/0)})}dispose(){super.dispose(),this.needDisposeNavPath&&this.navPath.dispose()}constructor(g,I){if(super(g),this.needDisposeNavPath=!1,I)this.navPath=I;else{this.navPath=new oi;let A=new FC(g);this.needDisposeNavPath=!0,A.load(g.config.apiPath.loadPlaceInfo+"?place_id="+g.config.placeId+"&env=prod").then(C=>m(this,null,function*(){let[e,i]=yield Promise.all([A.getRoadNetworkData(),A.getFacilitiesData()]);this.navPath.setRoadData(e,i.infrastructures)}))}}};