@aibee/crc-bmap 0.12.29 → 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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var eE=Object.create;var co=Object.defineProperty;var nE=Object.getOwnPropertyDescriptor;var rE=Object.getOwnPropertyNames,Xh=Object.getOwnPropertySymbols,iE=Object.getPrototypeOf,jh=Object.prototype.hasOwnProperty,oE=Object.prototype.propertyIsEnumerable;var Mu=(i,t,e)=>t in i?co(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,wu=(i,t)=>{for(var e in t||(t={}))jh.call(t,e)&&Mu(i,e,t[e]);if(Xh)for(var e of Xh(t))oE.call(t,e)&&Mu(i,e,t[e]);return i};var m=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),sE=(i,t)=>{for(var e in t)co(i,e,{get:t[e],enumerable:!0})},aE=(i,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of rE(t))!jh.call(i,r)&&r!==e&&co(i,r,{get:()=>t[r],enumerable:!(n=nE(t,r))||n.enumerable});return i};var f=(i,t,e)=>(e=i!=null?eE(iE(i)):{},aE(t||!i||!i.__esModule?co(e,"default",{value:i,enumerable:!0}):e,i));var ct=(i,t,e)=>Mu(i,typeof t!="symbol"?t+"":t,e);var y=(i,t,e)=>new Promise((n,r)=>{var o=u=>{try{a(e.next(u))}catch(l){r(l)}},s=u=>{try{a(e.throw(u))}catch(l){r(l)}},a=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,s);a((e=e.apply(i,t)).next())});var z=m((Tu,Yh)=>{"use strict";var ti=function(i){return i&&i.Math===Math&&i};Yh.exports=ti(typeof globalThis=="object"&&globalThis)||ti(typeof window=="object"&&window)||ti(typeof self=="object"&&self)||ti(typeof global=="object"&&global)||ti(typeof Tu=="object"&&Tu)||function(){return this}()||Function("return this")()});var k=m((kH,Zh)=>{"use strict";Zh.exports=function(i){try{return!!i()}catch(t){return!0}}});var $=m((VH,Kh)=>{"use strict";var uE=k();Kh.exports=!uE(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var ei=m((HH,$h)=>{"use strict";var lE=k();$h.exports=!lE(function(){var i=function(){}.bind();return typeof i!="function"||i.hasOwnProperty("prototype")})});var et=m((WH,Jh)=>{"use strict";var cE=ei(),ho=Function.prototype.call;Jh.exports=cE?ho.bind(ho):function(){return ho.apply(ho,arguments)}});var Au=m(ep=>{"use strict";var Qh={}.propertyIsEnumerable,tp=Object.getOwnPropertyDescriptor,hE=tp&&!Qh.call({1:2},1);ep.f=hE?function(t){var e=tp(this,t);return!!e&&e.enumerable}:Qh});var pn=m((XH,np)=>{"use strict";np.exports=function(i,t){return{enumerable:!(i&1),configurable:!(i&2),writable:!(i&4),value:t}}});var B=m((jH,op)=>{"use strict";var rp=ei(),ip=Function.prototype,Cu=ip.call,pE=rp&&ip.bind.bind(Cu,Cu);op.exports=rp?pE:function(i){return function(){return Cu.apply(i,arguments)}}});var Ne=m((YH,ap)=>{"use strict";var sp=B(),fE=sp({}.toString),dE=sp("".slice);ap.exports=function(i){return dE(fE(i),8,-1)}});var ni=m((ZH,up)=>{"use strict";var gE=B(),mE=k(),vE=Ne(),Ru=Object,_E=gE("".split);up.exports=mE(function(){return!Ru("z").propertyIsEnumerable(0)})?function(i){return vE(i)==="String"?_E(i,""):Ru(i)}:Ru});var ri=m((KH,lp)=>{"use strict";lp.exports=function(i){return i==null}});var Bn=m(($H,cp)=>{"use strict";var yE=ri(),xE=TypeError;cp.exports=function(i){if(yE(i))throw new xE("Can't call method on "+i);return i}});var ur=m((JH,hp)=>{"use strict";var EE=ni(),SE=Bn();hp.exports=function(i){return EE(SE(i))}});var J=m((QH,pp)=>{"use strict";var Pu=typeof document=="object"&&document.all;pp.exports=typeof Pu=="undefined"&&Pu!==void 0?function(i){return typeof i=="function"||i===Pu}:function(i){return typeof i=="function"}});var pt=m((tW,fp)=>{"use strict";var bE=J();fp.exports=function(i){return typeof i=="object"?i!==null:bE(i)}});var ee=m((eW,dp)=>{"use strict";var Iu=z(),ME=J(),wE=function(i){return ME(i)?i:void 0};dp.exports=function(i,t){return arguments.length<2?wE(Iu[i]):Iu[i]&&Iu[i][t]}});var lr=m((nW,gp)=>{"use strict";var TE=B();gp.exports=TE({}.isPrototypeOf)});var cr=m((rW,_p)=>{"use strict";var AE=z(),mp=AE.navigator,vp=mp&&mp.userAgent;_p.exports=vp?String(vp):""});var ii=m((iW,Mp)=>{"use strict";var bp=z(),Lu=cr(),yp=bp.process,xp=bp.Deno,Ep=yp&&yp.versions||xp&&xp.version,Sp=Ep&&Ep.v8,ne,po;Sp&&(ne=Sp.split("."),po=ne[0]>0&&ne[0]<4?1:+(ne[0]+ne[1]));!po&&Lu&&(ne=Lu.match(/Edge\/(\d+)/),(!ne||ne[1]>=74)&&(ne=Lu.match(/Chrome\/(\d+)/),ne&&(po=+ne[1])));Mp.exports=po});var fo=m((oW,Tp)=>{"use strict";var wp=ii(),CE=k(),RE=z(),PE=RE.String;Tp.exports=!!Object.getOwnPropertySymbols&&!CE(function(){var i=Symbol("symbol detection");return!PE(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&wp&&wp<41})});var Nu=m((sW,Ap)=>{"use strict";var IE=fo();Ap.exports=IE&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var oi=m((aW,Cp)=>{"use strict";var LE=ee(),NE=J(),OE=lr(),DE=Nu(),UE=Object;Cp.exports=DE?function(i){return typeof i=="symbol"}:function(i){var t=LE("Symbol");return NE(t)&&OE(t.prototype,UE(i))}});var hr=m((uW,Rp)=>{"use strict";var FE=String;Rp.exports=function(i){try{return FE(i)}catch(t){return"Object"}}});var Ee=m((lW,Pp)=>{"use strict";var BE=J(),zE=hr(),GE=TypeError;Pp.exports=function(i){if(BE(i))return i;throw new GE(zE(i)+" is not a function")}});var si=m((cW,Ip)=>{"use strict";var kE=Ee(),VE=ri();Ip.exports=function(i,t){var e=i[t];return VE(e)?void 0:kE(e)}});var Np=m((hW,Lp)=>{"use strict";var Ou=et(),Du=J(),Uu=pt(),HE=TypeError;Lp.exports=function(i,t){var e,n;if(t==="string"&&Du(e=i.toString)&&!Uu(n=Ou(e,i))||Du(e=i.valueOf)&&!Uu(n=Ou(e,i))||t!=="string"&&Du(e=i.toString)&&!Uu(n=Ou(e,i)))return n;throw new HE("Can't convert object to primitive value")}});var fn=m((pW,Op)=>{"use strict";Op.exports=!1});var go=m((fW,Up)=>{"use strict";var Dp=z(),WE=Object.defineProperty;Up.exports=function(i,t){try{WE(Dp,i,{value:t,configurable:!0,writable:!0})}catch(e){Dp[i]=t}return t}});var mo=m((dW,zp)=>{"use strict";var qE=fn(),XE=z(),jE=go(),Fp="__core-js_shared__",Bp=zp.exports=XE[Fp]||jE(Fp,{});(Bp.versions||(Bp.versions=[])).push({version:"3.42.0",mode:qE?"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 vo=m((gW,kp)=>{"use strict";var Gp=mo();kp.exports=function(i,t){return Gp[i]||(Gp[i]=t||{})}});var yt=m((mW,Vp)=>{"use strict";var YE=Bn(),ZE=Object;Vp.exports=function(i){return ZE(YE(i))}});var xt=m((vW,Hp)=>{"use strict";var KE=B(),$E=yt(),JE=KE({}.hasOwnProperty);Hp.exports=Object.hasOwn||function(t,e){return JE($E(t),e)}});var _o=m((_W,Wp)=>{"use strict";var QE=B(),tS=0,eS=Math.random(),nS=QE(1 .toString);Wp.exports=function(i){return"Symbol("+(i===void 0?"":i)+")_"+nS(++tS+eS,36)}});var ot=m((yW,Xp)=>{"use strict";var rS=z(),iS=vo(),qp=xt(),oS=_o(),sS=fo(),aS=Nu(),pr=rS.Symbol,Fu=iS("wks"),uS=aS?pr.for||pr:pr&&pr.withoutSetter||oS;Xp.exports=function(i){return qp(Fu,i)||(Fu[i]=sS&&qp(pr,i)?pr[i]:uS("Symbol."+i)),Fu[i]}});var Bu=m((xW,Zp)=>{"use strict";var lS=et(),jp=pt(),Yp=oi(),cS=si(),hS=Np(),pS=ot(),fS=TypeError,dS=pS("toPrimitive");Zp.exports=function(i,t){if(!jp(i)||Yp(i))return i;var e=cS(i,dS),n;if(e){if(t===void 0&&(t="default"),n=lS(e,i,t),!jp(n)||Yp(n))return n;throw new fS("Can't convert object to primitive value")}return t===void 0&&(t="number"),hS(i,t)}});var yo=m((EW,Kp)=>{"use strict";var gS=Bu(),mS=oi();Kp.exports=function(i){var t=gS(i,"string");return mS(t)?t:t+""}});var xo=m((SW,Jp)=>{"use strict";var vS=z(),$p=pt(),zu=vS.document,_S=$p(zu)&&$p(zu.createElement);Jp.exports=function(i){return _S?zu.createElement(i):{}}});var Gu=m((bW,Qp)=>{"use strict";var yS=$(),xS=k(),ES=xo();Qp.exports=!yS&&!xS(function(){return Object.defineProperty(ES("div"),"a",{get:function(){return 7}}).a!==7})});var Eo=m(ef=>{"use strict";var SS=$(),bS=et(),MS=Au(),wS=pn(),TS=ur(),AS=yo(),CS=xt(),RS=Gu(),tf=Object.getOwnPropertyDescriptor;ef.f=SS?tf:function(t,e){if(t=TS(t),e=AS(e),RS)try{return tf(t,e)}catch(n){}if(CS(t,e))return wS(!bS(MS.f,t,e),t[e])}});var ku=m((wW,nf)=>{"use strict";var PS=$(),IS=k();nf.exports=PS&&IS(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var mt=m((TW,rf)=>{"use strict";var LS=pt(),NS=String,OS=TypeError;rf.exports=function(i){if(LS(i))return i;throw new OS(NS(i)+" is not an object")}});var zt=m(sf=>{"use strict";var DS=$(),US=Gu(),FS=ku(),So=mt(),of=yo(),BS=TypeError,Vu=Object.defineProperty,zS=Object.getOwnPropertyDescriptor,Hu="enumerable",Wu="configurable",qu="writable";sf.f=DS?FS?function(t,e,n){if(So(t),e=of(e),So(n),typeof t=="function"&&e==="prototype"&&"value"in n&&qu in n&&!n[qu]){var r=zS(t,e);r&&r[qu]&&(t[e]=n.value,n={configurable:Wu in n?n[Wu]:r[Wu],enumerable:Hu in n?n[Hu]:r[Hu],writable:!1})}return Vu(t,e,n)}:Vu:function(t,e,n){if(So(t),e=of(e),So(n),US)try{return Vu(t,e,n)}catch(r){}if("get"in n||"set"in n)throw new BS("Accessors not supported");return"value"in n&&(t[e]=n.value),t}});var Gt=m((CW,af)=>{"use strict";var GS=$(),kS=zt(),VS=pn();af.exports=GS?function(i,t,e){return kS.f(i,t,VS(1,e))}:function(i,t,e){return i[t]=e,i}});var ai=m((RW,lf)=>{"use strict";var Xu=$(),HS=xt(),uf=Function.prototype,WS=Xu&&Object.getOwnPropertyDescriptor,ju=HS(uf,"name"),qS=ju&&function(){}.name==="something",XS=ju&&(!Xu||Xu&&WS(uf,"name").configurable);lf.exports={EXISTS:ju,PROPER:qS,CONFIGURABLE:XS}});var Zu=m((PW,cf)=>{"use strict";var jS=B(),YS=J(),Yu=mo(),ZS=jS(Function.toString);YS(Yu.inspectSource)||(Yu.inspectSource=function(i){return ZS(i)});cf.exports=Yu.inspectSource});var ff=m((IW,pf)=>{"use strict";var KS=z(),$S=J(),hf=KS.WeakMap;pf.exports=$S(hf)&&/native code/.test(String(hf))});var bo=m((LW,gf)=>{"use strict";var JS=vo(),QS=_o(),df=JS("keys");gf.exports=function(i){return df[i]||(df[i]=QS(i))}});var Mo=m((NW,mf)=>{"use strict";mf.exports={}});var Se=m((OW,yf)=>{"use strict";var tb=ff(),_f=z(),eb=pt(),nb=Gt(),Ku=xt(),$u=mo(),rb=bo(),ib=Mo(),vf="Object already initialized",Ju=_f.TypeError,ob=_f.WeakMap,wo,ui,To,sb=function(i){return To(i)?ui(i):wo(i,{})},ab=function(i){return function(t){var e;if(!eb(t)||(e=ui(t)).type!==i)throw new Ju("Incompatible receiver, "+i+" required");return e}};tb||$u.state?(re=$u.state||($u.state=new ob),re.get=re.get,re.has=re.has,re.set=re.set,wo=function(i,t){if(re.has(i))throw new Ju(vf);return t.facade=i,re.set(i,t),t},ui=function(i){return re.get(i)||{}},To=function(i){return re.has(i)}):(zn=rb("state"),ib[zn]=!0,wo=function(i,t){if(Ku(i,zn))throw new Ju(vf);return t.facade=i,nb(i,zn,t),t},ui=function(i){return Ku(i,zn)?i[zn]:{}},To=function(i){return Ku(i,zn)});var re,zn;yf.exports={set:wo,get:ui,has:To,enforce:sb,getterFor:ab}});var e0=m((DW,Sf)=>{"use strict";var t0=B(),ub=k(),lb=J(),Ao=xt(),Qu=$(),cb=ai().CONFIGURABLE,hb=Zu(),Ef=Se(),pb=Ef.enforce,fb=Ef.get,xf=String,Co=Object.defineProperty,db=t0("".slice),gb=t0("".replace),mb=t0([].join),vb=Qu&&!ub(function(){return Co(function(){},"length",{value:8}).length!==8}),_b=String(String).split("String"),yb=Sf.exports=function(i,t,e){db(xf(t),0,7)==="Symbol("&&(t="["+gb(xf(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),e&&e.getter&&(t="get "+t),e&&e.setter&&(t="set "+t),(!Ao(i,"name")||cb&&i.name!==t)&&(Qu?Co(i,"name",{value:t,configurable:!0}):i.name=t),vb&&e&&Ao(e,"arity")&&i.length!==e.arity&&Co(i,"length",{value:e.arity});try{e&&Ao(e,"constructor")&&e.constructor?Qu&&Co(i,"prototype",{writable:!1}):i.prototype&&(i.prototype=void 0)}catch(r){}var n=pb(i);return Ao(n,"source")||(n.source=mb(_b,typeof t=="string"?t:"")),i};Function.prototype.toString=yb(function(){return lb(this)&&fb(this).source||hb(this)},"toString")});var kt=m((UW,bf)=>{"use strict";var xb=J(),Eb=zt(),Sb=e0(),bb=go();bf.exports=function(i,t,e,n){n||(n={});var r=n.enumerable,o=n.name!==void 0?n.name:t;if(xb(e)&&Sb(e,o,n),n.global)r?i[t]=e:bb(t,e);else{try{n.unsafe?i[t]&&(r=!0):delete i[t]}catch(s){}r?i[t]=e:Eb.f(i,t,{value:e,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return i}});var wf=m((FW,Mf)=>{"use strict";var Mb=Math.ceil,wb=Math.floor;Mf.exports=Math.trunc||function(t){var e=+t;return(e>0?wb:Mb)(e)}});var Lt=m((BW,Tf)=>{"use strict";var Tb=wf();Tf.exports=function(i){var t=+i;return t!==t||t===0?0:Tb(t)}});var li=m((zW,Af)=>{"use strict";var Ab=Lt(),Cb=Math.max,Rb=Math.min;Af.exports=function(i,t){var e=Ab(i);return e<0?Cb(e+t,0):Rb(e,t)}});var Gn=m((GW,Cf)=>{"use strict";var Pb=Lt(),Ib=Math.min;Cf.exports=function(i){var t=Pb(i);return t>0?Ib(t,9007199254740991):0}});var dt=m((kW,Rf)=>{"use strict";var Lb=Gn();Rf.exports=function(i){return Lb(i.length)}});var Lf=m((VW,If)=>{"use strict";var Nb=ur(),Ob=li(),Db=dt(),Pf=function(i){return function(t,e,n){var r=Nb(t),o=Db(r);if(o===0)return!i&&-1;var s=Ob(n,o),a;if(i&&e!==e){for(;o>s;)if(a=r[s++],a!==a)return!0}else for(;o>s;s++)if((i||s in r)&&r[s]===e)return i||s||0;return!i&&-1}};If.exports={includes:Pf(!0),indexOf:Pf(!1)}});var r0=m((HW,Of)=>{"use strict";var Ub=B(),n0=xt(),Fb=ur(),Bb=Lf().indexOf,zb=Mo(),Nf=Ub([].push);Of.exports=function(i,t){var e=Fb(i),n=0,r=[],o;for(o in e)!n0(zb,o)&&n0(e,o)&&Nf(r,o);for(;t.length>n;)n0(e,o=t[n++])&&(~Bb(r,o)||Nf(r,o));return r}});var Ro=m((WW,Df)=>{"use strict";Df.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var i0=m(Uf=>{"use strict";var Gb=r0(),kb=Ro(),Vb=kb.concat("length","prototype");Uf.f=Object.getOwnPropertyNames||function(t){return Gb(t,Vb)}});var o0=m(Ff=>{"use strict";Ff.f=Object.getOwnPropertySymbols});var zf=m((jW,Bf)=>{"use strict";var Hb=ee(),Wb=B(),qb=i0(),Xb=o0(),jb=mt(),Yb=Wb([].concat);Bf.exports=Hb("Reflect","ownKeys")||function(t){var e=qb.f(jb(t)),n=Xb.f;return n?Yb(e,n(t)):e}});var Po=m((YW,kf)=>{"use strict";var Gf=xt(),Zb=zf(),Kb=Eo(),$b=zt();kf.exports=function(i,t,e){for(var n=Zb(t),r=$b.f,o=Kb.f,s=0;s<n.length;s++){var a=n[s];!Gf(i,a)&&!(e&&Gf(e,a))&&r(i,a,o(t,a))}}});var Hf=m((ZW,Vf)=>{"use strict";var Jb=k(),Qb=J(),tM=/#|\.prototype\./,ci=function(i,t){var e=nM[eM(i)];return e===iM?!0:e===rM?!1:Qb(t)?Jb(t):!!t},eM=ci.normalize=function(i){return String(i).replace(tM,".").toLowerCase()},nM=ci.data={},rM=ci.NATIVE="N",iM=ci.POLYFILL="P";Vf.exports=ci});var H=m((KW,Wf)=>{"use strict";var Io=z(),oM=Eo().f,sM=Gt(),aM=kt(),uM=go(),lM=Po(),cM=Hf();Wf.exports=function(i,t){var e=i.target,n=i.global,r=i.stat,o,s,a,u,l,c;if(n?s=Io:r?s=Io[e]||uM(e,{}):s=Io[e]&&Io[e].prototype,s)for(a in t){if(l=t[a],i.dontCallGetSet?(c=oM(s,a),u=c&&c.value):u=s[a],o=cM(n?a:e+(r?".":"#")+a,i.forced),!o&&u!==void 0){if(typeof l==typeof u)continue;lM(l,u)}(i.sham||u&&u.sham)&&sM(l,"sham",!0),aM(s,a,l,i)}}});var hi=m(($W,qf)=>{"use strict";var hM=Ne();qf.exports=Array.isArray||function(t){return hM(t)==="Array"}});var s0=m((JW,Xf)=>{"use strict";var pM=$(),fM=hi(),dM=TypeError,gM=Object.getOwnPropertyDescriptor,mM=pM&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(i){return i instanceof TypeError}}();Xf.exports=mM?function(i,t){if(fM(i)&&!gM(i,"length").writable)throw new dM("Cannot set read only .length");return i.length=t}:function(i,t){return i.length=t}});var Lo=m((QW,jf)=>{"use strict";var vM=TypeError,_M=9007199254740991;jf.exports=function(i){if(i>_M)throw vM("Maximum allowed index exceeded");return i}});var F=m(()=>{"use strict";var yM=H(),xM=yt(),EM=dt(),SM=s0(),bM=Lo(),MM=k(),wM=MM(function(){return[].push.call({length:4294967296},1)!==4294967297}),TM=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(i){return i instanceof TypeError}},AM=wM||!TM();yM({target:"Array",proto:!0,arity:1,forced:AM},{push:function(t){var e=xM(this),n=EM(e),r=arguments.length;bM(n+r);for(var o=0;o<r;o++)e[n]=arguments[o],n++;return SM(e,n),n}})});var Zf=m((n4,Yf)=>{"use strict";Yf.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 Jf=m((r4,$f)=>{"use strict";var CM=xo(),a0=CM("span").classList,Kf=a0&&a0.constructor&&a0.constructor.prototype;$f.exports=Kf===Object.prototype?void 0:Kf});var u0=m((i4,Qf)=>{"use strict";var RM=r0(),PM=Ro();Qf.exports=Object.keys||function(t){return RM(t,PM)}});var ed=m(td=>{"use strict";var IM=$(),LM=ku(),NM=zt(),OM=mt(),DM=ur(),UM=u0();td.f=IM&&!LM?Object.defineProperties:function(t,e){OM(t);for(var n=DM(e),r=UM(e),o=r.length,s=0,a;o>s;)NM.f(t,a=r[s++],n[a]);return t}});var rd=m((s4,nd)=>{"use strict";var FM=ee();nd.exports=FM("document","documentElement")});var kn=m((a4,cd)=>{"use strict";var BM=mt(),zM=ed(),id=Ro(),GM=Mo(),kM=rd(),VM=xo(),HM=bo(),od=">",sd="<",c0="prototype",h0="script",ud=HM("IE_PROTO"),l0=function(){},ld=function(i){return sd+h0+od+i+sd+"/"+h0+od},ad=function(i){i.write(ld("")),i.close();var t=i.parentWindow.Object;return i=null,t},WM=function(){var i=VM("iframe"),t="java"+h0+":",e;return i.style.display="none",kM.appendChild(i),i.src=String(t),e=i.contentWindow.document,e.open(),e.write(ld("document.F=Object")),e.close(),e.F},No,Oo=function(){try{No=new ActiveXObject("htmlfile")}catch(t){}Oo=typeof document!="undefined"?document.domain&&No?ad(No):WM():ad(No);for(var i=id.length;i--;)delete Oo[c0][id[i]];return Oo()};GM[ud]=!0;cd.exports=Object.create||function(t,e){var n;return t!==null?(l0[c0]=BM(t),n=new l0,l0[c0]=null,n[ud]=t):n=Oo(),e===void 0?n:zM.f(n,e)}});var pi=m((u4,hd)=>{"use strict";var qM=ot(),XM=kn(),jM=zt().f,p0=qM("unscopables"),f0=Array.prototype;f0[p0]===void 0&&jM(f0,p0,{configurable:!0,value:XM(null)});hd.exports=function(i){f0[p0][i]=!0}});var fr=m((l4,pd)=>{"use strict";pd.exports={}});var dd=m((c4,fd)=>{"use strict";var YM=k();fd.exports=!YM(function(){function i(){}return i.prototype.constructor=null,Object.getPrototypeOf(new i)!==i.prototype})});var fi=m((h4,md)=>{"use strict";var ZM=xt(),KM=J(),$M=yt(),JM=bo(),QM=dd(),gd=JM("IE_PROTO"),d0=Object,tw=d0.prototype;md.exports=QM?d0.getPrototypeOf:function(i){var t=$M(i);if(ZM(t,gd))return t[gd];var e=t.constructor;return KM(e)&&t instanceof e?e.prototype:t instanceof d0?tw:null}});var _0=m((p4,yd)=>{"use strict";var ew=k(),nw=J(),rw=pt(),iw=kn(),vd=fi(),ow=kt(),sw=ot(),aw=fn(),v0=sw("iterator"),_d=!1,Oe,g0,m0;[].keys&&(m0=[].keys(),"next"in m0?(g0=vd(vd(m0)),g0!==Object.prototype&&(Oe=g0)):_d=!0);var uw=!rw(Oe)||ew(function(){var i={};return Oe[v0].call(i)!==i});uw?Oe={}:aw&&(Oe=iw(Oe));nw(Oe[v0])||ow(Oe,v0,function(){return this});yd.exports={IteratorPrototype:Oe,BUGGY_SAFARI_ITERATORS:_d}});var dn=m((f4,Ed)=>{"use strict";var lw=zt().f,cw=xt(),hw=ot(),xd=hw("toStringTag");Ed.exports=function(i,t,e){i&&!e&&(i=i.prototype),i&&!cw(i,xd)&&lw(i,xd,{configurable:!0,value:t})}});var y0=m((d4,Sd)=>{"use strict";var pw=_0().IteratorPrototype,fw=kn(),dw=pn(),gw=dn(),mw=fr(),vw=function(){return this};Sd.exports=function(i,t,e,n){var r=t+" Iterator";return i.prototype=fw(pw,{next:dw(+!n,e)}),gw(i,r,!1,!0),mw[r]=vw,i}});var di=m((g4,bd)=>{"use strict";var _w=B(),yw=Ee();bd.exports=function(i,t,e){try{return _w(yw(Object.getOwnPropertyDescriptor(i,t)[e]))}catch(n){}}});var wd=m((m4,Md)=>{"use strict";var xw=pt();Md.exports=function(i){return xw(i)||i===null}});var Ad=m((v4,Td)=>{"use strict";var Ew=wd(),Sw=String,bw=TypeError;Td.exports=function(i){if(Ew(i))return i;throw new bw("Can't set "+Sw(i)+" as a prototype")}});var Vn=m((_4,Cd)=>{"use strict";var Mw=di(),ww=pt(),Tw=Bn(),Aw=Ad();Cd.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var i=!1,t={},e;try{e=Mw(Object.prototype,"__proto__","set"),e(t,[]),i=t instanceof Array}catch(n){}return function(r,o){return Tw(r),Aw(o),ww(r)&&(i?e(r,o):r.__proto__=o),r}}():void 0)});var E0=m((y4,Bd)=>{"use strict";var Cw=H(),Rw=et(),Do=fn(),Ud=ai(),Pw=J(),Iw=y0(),Rd=fi(),Pd=Vn(),Lw=dn(),Nw=Gt(),x0=kt(),Ow=ot(),Id=fr(),Fd=_0(),Dw=Ud.PROPER,Uw=Ud.CONFIGURABLE,Ld=Fd.IteratorPrototype,Uo=Fd.BUGGY_SAFARI_ITERATORS,gi=Ow("iterator"),Nd="keys",mi="values",Od="entries",Dd=function(){return this};Bd.exports=function(i,t,e,n,r,o,s){Iw(e,t,n);var a=function(E){if(E===r&&p)return p;if(!Uo&&E&&E in c)return c[E];switch(E){case Nd:return function(){return new e(this,E)};case mi:return function(){return new e(this,E)};case Od:return function(){return new e(this,E)}}return function(){return new e(this)}},u=t+" Iterator",l=!1,c=i.prototype,h=c[gi]||c["@@iterator"]||r&&c[r],p=!Uo&&h||a(r),d=t==="Array"&&c.entries||h,g,v,_;if(d&&(g=Rd(d.call(new i)),g!==Object.prototype&&g.next&&(!Do&&Rd(g)!==Ld&&(Pd?Pd(g,Ld):Pw(g[gi])||x0(g,gi,Dd)),Lw(g,u,!0,!0),Do&&(Id[u]=Dd))),Dw&&r===mi&&h&&h.name!==mi&&(!Do&&Uw?Nw(c,"name",mi):(l=!0,p=function(){return Rw(h,this)})),r)if(v={values:a(mi),keys:o?p:a(Nd),entries:a(Od)},s)for(_ in v)(Uo||l||!(_ in c))&&x0(c,_,v[_]);else Cw({target:t,proto:!0,forced:Uo||l},v);return(!Do||s)&&c[gi]!==p&&x0(c,gi,p,{name:r}),Id[t]=p,v}});var Fo=m((x4,zd)=>{"use strict";zd.exports=function(i,t){return{value:i,done:t}}});var b0=m((E4,Wd)=>{"use strict";var Fw=ur(),S0=pi(),Gd=fr(),Vd=Se(),Bw=zt().f,zw=E0(),Bo=Fo(),Gw=fn(),kw=$(),Hd="Array Iterator",Vw=Vd.set,Hw=Vd.getterFor(Hd);Wd.exports=zw(Array,"Array",function(i,t){Vw(this,{type:Hd,target:Fw(i),index:0,kind:t})},function(){var i=Hw(this),t=i.target,e=i.index++;if(!t||e>=t.length)return i.target=null,Bo(void 0,!0);switch(i.kind){case"keys":return Bo(e,!1);case"values":return Bo(t[e],!1)}return Bo([e,t[e]],!1)},"values");var kd=Gd.Arguments=Gd.Array;S0("keys");S0("values");S0("entries");if(!Gw&&kw&&kd.name!=="values")try{Bw(kd,"name",{value:"values"})}catch(i){}});var A=m(()=>{"use strict";var qd=z(),jd=Zf(),Ww=Jf(),vi=b0(),Xd=Gt(),qw=dn(),Xw=ot(),M0=Xw("iterator"),w0=vi.values,Yd=function(i,t){if(i){if(i[M0]!==w0)try{Xd(i,M0,w0)}catch(n){i[M0]=w0}if(qw(i,t,!0),jd[t]){for(var e in vi)if(i[e]!==vi[e])try{Xd(i,e,vi[e])}catch(n){i[e]=vi[e]}}}};for(zo in jd)Yd(qd[zo]&&qd[zo].prototype,zo);var zo;Yd(Ww,"DOMTokenList")});var Go=m((M4,Jd)=>{"use strict";var jw=ei(),$d=Function.prototype,Zd=$d.apply,Kd=$d.call;Jd.exports=typeof Reflect=="object"&&Reflect.apply||(jw?Kd.bind(Zd):function(){return Kd.apply(Zd,arguments)})});var _i=m((w4,Qd)=>{"use strict";var Yw=B();Qd.exports=Yw([].slice)});var ng=m((T4,eg)=>{"use strict";var Zw=ot(),Kw=Zw("toStringTag"),tg={};tg[Kw]="z";eg.exports=String(tg)==="[object z]"});var De=m((A4,rg)=>{"use strict";var $w=ng(),Jw=J(),ko=Ne(),Qw=ot(),tT=Qw("toStringTag"),eT=Object,nT=ko(function(){return arguments}())==="Arguments",rT=function(i,t){try{return i[t]}catch(e){}};rg.exports=$w?ko:function(i){var t,e,n;return i===void 0?"Undefined":i===null?"Null":typeof(e=rT(t=eT(i),tT))=="string"?e:nT?ko(t):(n=ko(t))==="Object"&&Jw(t.callee)?"Arguments":n}});var Nt=m((C4,ig)=>{"use strict";var iT=De(),oT=String;ig.exports=function(i){if(iT(i)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return oT(i)}});var lg=m((R4,ug)=>{"use strict";var sT=B(),og=hi(),aT=J(),sg=Ne(),uT=Nt(),ag=sT([].push);ug.exports=function(i){if(aT(i))return i;if(og(i)){for(var t=i.length,e=[],n=0;n<t;n++){var r=i[n];typeof r=="string"?ag(e,r):(typeof r=="number"||sg(r)==="Number"||sg(r)==="String")&&ag(e,uT(r))}var o=e.length,s=!0;return function(a,u){if(s)return s=!1,u;if(og(this))return u;for(var l=0;l<o;l++)if(e[l]===a)return u}}}});var Hn=m(()=>{"use strict";var lT=H(),vg=ee(),_g=Go(),cT=et(),yi=B(),yg=k(),cg=J(),hg=oi(),xg=_i(),hT=lg(),pT=fo(),fT=String,gn=vg("JSON","stringify"),Vo=yi(/./.exec),pg=yi("".charAt),dT=yi("".charCodeAt),gT=yi("".replace),mT=yi(1 .toString),vT=/[\uD800-\uDFFF]/g,fg=/^[\uD800-\uDBFF]$/,dg=/^[\uDC00-\uDFFF]$/,gg=!pT||yg(function(){var i=vg("Symbol")("stringify detection");return gn([i])!=="[null]"||gn({a:i})!=="{}"||gn(Object(i))!=="{}"}),mg=yg(function(){return gn("\uDF06\uD834")!=='"\\udf06\\ud834"'||gn("\uDEAD")!=='"\\udead"'}),_T=function(i,t){var e=xg(arguments),n=hT(t);if(!(!cg(n)&&(i===void 0||hg(i))))return e[1]=function(r,o){if(cg(n)&&(o=cT(n,this,fT(r),o)),!hg(o))return o},_g(gn,null,e)},yT=function(i,t,e){var n=pg(e,t-1),r=pg(e,t+1);return Vo(fg,i)&&!Vo(dg,r)||Vo(dg,i)&&!Vo(fg,n)?"\\u"+mT(dT(i,0),16):i};gn&&lT({target:"JSON",stat:!0,arity:3,forced:gg||mg},{stringify:function(t,e,n){var r=xg(arguments),o=_g(gg?_T:gn,null,r);return mg&&typeof o=="string"?gT(o,vT,yT):o}})});var ie=m((L4,Eg)=>{"use strict";var T0=B(),Ho=Set.prototype;Eg.exports={Set,add:T0(Ho.add),has:T0(Ho.has),remove:T0(Ho.delete),proto:Ho}});var mn=m((N4,Sg)=>{"use strict";var xT=ie().has;Sg.exports=function(i){return xT(i),i}});var vn=m((O4,bg)=>{"use strict";var ET=et();bg.exports=function(i,t,e){for(var n=e?i:i.iterator,r=i.next,o,s;!(o=ET(r,n)).done;)if(s=t(o.value),s!==void 0)return s}});var dr=m((D4,Cg)=>{"use strict";var Mg=B(),ST=vn(),wg=ie(),bT=wg.Set,Tg=wg.proto,MT=Mg(Tg.forEach),Ag=Mg(Tg.keys),wT=Ag(new bT).next;Cg.exports=function(i,t,e){return e?ST({iterator:Ag(i),next:wT},t):MT(i,t)}});var Wo=m((U4,Pg)=>{"use strict";var Rg=ie(),TT=dr(),AT=Rg.Set,CT=Rg.add;Pg.exports=function(i){var t=new AT;return TT(i,function(e){CT(t,e)}),t}});var gr=m((F4,Ig)=>{"use strict";var RT=di(),PT=ie();Ig.exports=RT(PT.proto,"size","get")||function(i){return i.size}});var Ng=m((B4,Lg)=>{"use strict";Lg.exports=function(i){return{iterator:i,next:i.next,done:!1}}});var _n=m((z4,zg)=>{"use strict";var Og=Ee(),Fg=mt(),Dg=et(),IT=Lt(),LT=Ng(),Ug="Invalid size",NT=RangeError,OT=TypeError,DT=Math.max,Bg=function(i,t){this.set=i,this.size=DT(t,0),this.has=Og(i.has),this.keys=Og(i.keys)};Bg.prototype={getIterator:function(){return LT(Fg(Dg(this.keys,this.set)))},includes:function(i){return Dg(this.has,this.set,i)}};zg.exports=function(i){Fg(i);var t=+i.size;if(t!==t)throw new OT(Ug);var e=IT(t);if(e<0)throw new NT(Ug);return new Bg(i,e)}});var Hg=m((G4,Vg)=>{"use strict";var UT=mn(),kg=ie(),FT=Wo(),BT=gr(),zT=_n(),GT=dr(),kT=vn(),VT=kg.has,Gg=kg.remove;Vg.exports=function(t){var e=UT(this),n=zT(t),r=FT(e);return BT(e)<=n.size?GT(e,function(o){n.includes(o)&&Gg(r,o)}):kT(n.getIterator(),function(o){VT(e,o)&&Gg(r,o)}),r}});var yn=m((k4,Xg)=>{"use strict";var HT=ee(),Wg=function(i){return{size:i,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},qg=function(i){return{size:i,has:function(){return!0},keys:function(){throw new Error("e")}}};Xg.exports=function(i,t){var e=HT("Set");try{new e()[i](Wg(0));try{return new e()[i](Wg(-1)),!1}catch(r){if(!t)return!0;try{return new e()[i](qg(-1/0)),!1}catch(o){var n=new e;return n.add(1),n.add(2),t(n[i](qg(1/0)))}}}catch(r){return!1}}});var oe=m(()=>{"use strict";var WT=H(),qT=Hg(),XT=yn(),jT=!XT("difference",function(i){return i.size===0});WT({target:"Set",proto:!0,real:!0,forced:jT},{difference:qT})});var Zg=m((W4,Yg)=>{"use strict";var YT=mn(),A0=ie(),ZT=gr(),KT=_n(),$T=dr(),JT=vn(),QT=A0.Set,jg=A0.add,tA=A0.has;Yg.exports=function(t){var e=YT(this),n=KT(t),r=new QT;return ZT(e)>n.size?JT(n.getIterator(),function(o){tA(e,o)&&jg(r,o)}):$T(e,function(o){n.includes(o)&&jg(r,o)}),r}});var se=m(()=>{"use strict";var eA=H(),nA=k(),rA=Zg(),iA=yn(),oA=!iA("intersection",function(i){return i.size===2&&i.has(1)&&i.has(2)})||nA(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});eA({target:"Set",proto:!0,real:!0,forced:oA},{intersection:rA})});var qo=m((j4,$g)=>{"use strict";var sA=et(),Kg=mt(),aA=si();$g.exports=function(i,t,e){var n,r;Kg(i);try{if(n=aA(i,"return"),!n){if(t==="throw")throw e;return e}n=sA(n,i)}catch(o){r=!0,n=o}if(t==="throw")throw e;if(r)throw n;return Kg(n),e}});var Qg=m((Y4,Jg)=>{"use strict";var uA=mn(),lA=ie().has,cA=gr(),hA=_n(),pA=dr(),fA=vn(),dA=qo();Jg.exports=function(t){var e=uA(this),n=hA(t);if(cA(e)<=n.size)return pA(e,function(o){if(n.includes(o))return!1},!0)!==!1;var r=n.getIterator();return fA(r,function(o){if(lA(e,o))return dA(r,"normal",!1)})!==!1}});var ae=m(()=>{"use strict";var gA=H(),mA=Qg(),vA=yn(),_A=!vA("isDisjointFrom",function(i){return!i});gA({target:"Set",proto:!0,real:!0,forced:_A},{isDisjointFrom:mA})});var em=m(($4,tm)=>{"use strict";var yA=mn(),xA=gr(),EA=dr(),SA=_n();tm.exports=function(t){var e=yA(this),n=SA(t);return xA(e)>n.size?!1:EA(e,function(r){if(!n.includes(r))return!1},!0)!==!1}});var ue=m(()=>{"use strict";var bA=H(),MA=em(),wA=yn(),TA=!wA("isSubsetOf",function(i){return i});bA({target:"Set",proto:!0,real:!0,forced:TA},{isSubsetOf:MA})});var rm=m((tq,nm)=>{"use strict";var AA=mn(),CA=ie().has,RA=gr(),PA=_n(),IA=vn(),LA=qo();nm.exports=function(t){var e=AA(this),n=PA(t);if(RA(e)<n.size)return!1;var r=n.getIterator();return IA(r,function(o){if(!CA(e,o))return LA(r,"normal",!1)})!==!1}});var le=m(()=>{"use strict";var NA=H(),OA=rm(),DA=yn(),UA=!DA("isSupersetOf",function(i){return!i});NA({target:"Set",proto:!0,real:!0,forced:UA},{isSupersetOf:OA})});var om=m((rq,im)=>{"use strict";var FA=mn(),C0=ie(),BA=Wo(),zA=_n(),GA=vn(),kA=C0.add,VA=C0.has,HA=C0.remove;im.exports=function(t){var e=FA(this),n=zA(t).getIterator(),r=BA(e);return GA(n,function(o){VA(e,o)?HA(r,o):kA(r,o)}),r}});var ce=m(()=>{"use strict";var WA=H(),qA=om(),XA=yn();WA({target:"Set",proto:!0,real:!0,forced:!XA("symmetricDifference")},{symmetricDifference:qA})});var am=m((sq,sm)=>{"use strict";var jA=mn(),YA=ie().add,ZA=Wo(),KA=_n(),$A=vn();sm.exports=function(t){var e=jA(this),n=KA(t).getIterator(),r=ZA(e);return $A(n,function(o){YA(r,o)}),r}});var he=m(()=>{"use strict";var JA=H(),QA=am(),tC=yn();JA({target:"Set",proto:!0,real:!0,forced:!tC("union")},{union:QA})});var pm=m((bq,hm)=>{"use strict";var sC=mt();hm.exports=function(){var i=sC(this),t="";return i.hasIndices&&(t+="d"),i.global&&(t+="g"),i.ignoreCase&&(t+="i"),i.multiline&&(t+="m"),i.dotAll&&(t+="s"),i.unicode&&(t+="u"),i.unicodeSets&&(t+="v"),i.sticky&&(t+="y"),t}});var dm=m((Mq,fm)=>{"use strict";var R0=k(),aC=z(),P0=aC.RegExp,I0=R0(function(){var i=P0("a","y");return i.lastIndex=2,i.exec("abcd")!==null}),uC=I0||R0(function(){return!P0("a","y").sticky}),lC=I0||R0(function(){var i=P0("^r","gy");return i.lastIndex=2,i.exec("str")!==null});fm.exports={BROKEN_CARET:lC,MISSED_STICKY:uC,UNSUPPORTED_Y:I0}});var mm=m((wq,gm)=>{"use strict";var cC=k(),hC=z(),pC=hC.RegExp;gm.exports=cC(function(){var i=pC(".","s");return!(i.dotAll&&i.test(`
|
|
2
2
|
`)&&i.flags==="s")})});var _m=m((Tq,vm)=>{"use strict";var fC=k(),dC=z(),gC=dC.RegExp;vm.exports=fC(function(){var i=gC("(?<a>b)","g");return i.exec("b").groups.a!=="b"||"b".replace(i,"$<a>c")!=="bc"})});var Zo=m((Aq,xm)=>{"use strict";var mr=et(),Yo=B(),mC=Nt(),vC=pm(),_C=dm(),yC=vo(),xC=kn(),EC=Se().get,SC=mm(),bC=_m(),MC=yC("native-string-replace",String.prototype.replace),jo=RegExp.prototype.exec,N0=jo,wC=Yo("".charAt),TC=Yo("".indexOf),AC=Yo("".replace),L0=Yo("".slice),O0=function(){var i=/a/,t=/b*/g;return mr(jo,i,"a"),mr(jo,t,"a"),i.lastIndex!==0||t.lastIndex!==0}(),ym=_C.BROKEN_CARET,D0=/()??/.exec("")[1]!==void 0,CC=O0||D0||ym||SC||bC;CC&&(N0=function(t){var e=this,n=EC(e),r=mC(t),o=n.raw,s,a,u,l,c,h,p;if(o)return o.lastIndex=e.lastIndex,s=mr(N0,o,r),e.lastIndex=o.lastIndex,s;var d=n.groups,g=ym&&e.sticky,v=mr(vC,e),_=e.source,E=0,b=r;if(g&&(v=AC(v,"y",""),TC(v,"g")===-1&&(v+="g"),b=L0(r,e.lastIndex),e.lastIndex>0&&(!e.multiline||e.multiline&&wC(r,e.lastIndex-1)!==`
|
|
3
3
|
`)&&(_="(?: "+_+")",b=" "+b,E++),a=new RegExp("^(?:"+_+")",v)),D0&&(a=new RegExp("^"+_+"$(?!\\s)",v)),O0&&(u=e.lastIndex),l=mr(jo,g?a:e,b),g?l?(l.input=L0(l.input,E),l[0]=L0(l[0],E),l.index=e.lastIndex,e.lastIndex+=l[0].length):e.lastIndex=0:O0&&l&&(e.lastIndex=e.global?l.index+l[0].length:u),D0&&l&&l.length>1&&mr(MC,l[0],a,function(){for(c=1;c<arguments.length-2;c++)arguments[c]===void 0&&(l[c]=void 0)}),l&&d)for(l.groups=h=xC(null),c=0;c<d.length;c++)p=d[c],h[p[0]]=l[p[1]];return l});xm.exports=N0});var Ot=m(()=>{"use strict";var RC=H(),Em=Zo();RC({target:"RegExp",proto:!0,forced:/./.exec!==Em},{exec:Em})});var Mm=m(()=>{"use strict";var OC=H(),DC=z(),UC=dn();OC({global:!0},{Reflect:{}});UC(DC.Reflect,"Reflect",!0)});var Tm=m((Hq,wm)=>{"use strict";var FC=zt().f;wm.exports=function(i,t,e){e in i||FC(i,e,{configurable:!0,get:function(){return t[e]},set:function(n){t[e]=n}})}});var ts=m((Wq,Cm)=>{"use strict";var BC=J(),zC=pt(),Am=Vn();Cm.exports=function(i,t,e){var n,r;return Am&&BC(n=t.constructor)&&n!==e&&zC(r=n.prototype)&&r!==e.prototype&&Am(i,r),i}});var Pm=m((qq,Rm)=>{"use strict";var GC=Nt();Rm.exports=function(i,t){return i===void 0?arguments.length<2?"":t:GC(i)}});var Lm=m((Xq,Im)=>{"use strict";var kC=pt(),VC=Gt();Im.exports=function(i,t){kC(t)&&"cause"in t&&VC(i,"cause",t.cause)}});var Um=m((jq,Dm)=>{"use strict";var HC=B(),Nm=Error,WC=HC("".replace),qC=function(i){return String(new Nm(i).stack)}("zxcasd"),Om=/\n\s*at [^:]*:[^\n]*/,XC=Om.test(qC);Dm.exports=function(i,t){if(XC&&typeof i=="string"&&!Nm.prepareStackTrace)for(;t--;)i=WC(i,Om,"");return i}});var Bm=m((Yq,Fm)=>{"use strict";var jC=k(),YC=pn();Fm.exports=!jC(function(){var i=new Error("a");return"stack"in i?(Object.defineProperty(i,"stack",YC(1,7)),i.stack!==7):!0})});var km=m((Zq,Gm)=>{"use strict";var ZC=Gt(),KC=Um(),$C=Bm(),zm=Error.captureStackTrace;Gm.exports=function(i,t,e,n){$C&&(zm?zm(i,t):ZC(i,"stack",KC(e,n)))}});var Zm=m((Kq,Ym)=>{"use strict";var Vm=ee(),JC=xt(),Hm=Gt(),QC=lr(),Wm=Vn(),qm=Po(),Xm=Tm(),tR=ts(),eR=Pm(),nR=Lm(),rR=km(),iR=$(),jm=fn();Ym.exports=function(i,t,e,n){var r="stackTraceLimit",o=n?2:1,s=i.split("."),a=s[s.length-1],u=Vm.apply(null,s);if(u){var l=u.prototype;if(!jm&&JC(l,"cause")&&delete l.cause,!e)return u;var c=Vm("Error"),h=t(function(p,d){var g=eR(n?d:p,void 0),v=n?new u(p):new u;return g!==void 0&&Hm(v,"message",g),rR(v,h,v.stack,2),this&&QC(l,this)&&tR(v,this,h),arguments.length>o&&nR(v,arguments[o]),v});if(h.prototype=l,a!=="Error"?Wm?Wm(h,c):qm(h,c,{name:!0}):iR&&r in u&&(Xm(h,u,r),Xm(h,u,"prepareStackTrace")),qm(h,u),!jm)try{l.name!==a&&Hm(l,"name",a),l.constructor=h}catch(p){}return h}}});var B0=m(()=>{"use strict";var $m=H(),oR=z(),be=Go(),Jm=Zm(),U0="WebAssembly",Km=oR[U0],es=new Error("e",{cause:7}).cause!==7,Wn=function(i,t){var e={};e[i]=Jm(i,t,es),$m({global:!0,constructor:!0,arity:1,forced:es},e)},F0=function(i,t){if(Km&&Km[i]){var e={};e[i]=Jm(U0+"."+i,t,es),$m({target:U0,stat:!0,constructor:!0,arity:1,forced:es},e)}};Wn("Error",function(i){return function(e){return be(i,this,arguments)}});Wn("EvalError",function(i){return function(e){return be(i,this,arguments)}});Wn("RangeError",function(i){return function(e){return be(i,this,arguments)}});Wn("ReferenceError",function(i){return function(e){return be(i,this,arguments)}});Wn("SyntaxError",function(i){return function(e){return be(i,this,arguments)}});Wn("TypeError",function(i){return function(e){return be(i,this,arguments)}});Wn("URIError",function(i){return function(e){return be(i,this,arguments)}});F0("CompileError",function(i){return function(e){return be(i,this,arguments)}});F0("LinkError",function(i){return function(e){return be(i,this,arguments)}});F0("RuntimeError",function(i){return function(e){return be(i,this,arguments)}})});var av=m((iX,sv)=>{"use strict";Ot();var nv=et(),rv=kt(),sR=Zo(),iv=k(),ov=ot(),aR=Gt(),uR=ov("species"),G0=RegExp.prototype;sv.exports=function(i,t,e,n){var r=ov(i),o=!iv(function(){var l={};return l[r]=function(){return 7},""[i](l)!==7}),s=o&&!iv(function(){var l=!1,c=/a/;return i==="split"&&(c={},c.constructor={},c.constructor[uR]=function(){return c},c.flags="",c[r]=/./[r]),c.exec=function(){return l=!0,null},c[r](""),!l});if(!o||!s||e){var a=/./[r],u=t(r,""[i],function(l,c,h,p,d){var g=c.exec;return g===sR||g===G0.exec?o&&!d?{done:!0,value:nv(a,c,h,p)}:{done:!0,value:nv(l,h,c,p)}:{done:!1}});rv(String.prototype,i,u[0]),rv(G0,r,u[1])}n&&aR(G0[r],"sham",!0)}});var is=m((oX,cv)=>{"use strict";var k0=B(),lR=Lt(),cR=Nt(),hR=Bn(),pR=k0("".charAt),uv=k0("".charCodeAt),fR=k0("".slice),lv=function(i){return function(t,e){var n=cR(hR(t)),r=lR(e),o=n.length,s,a;return r<0||r>=o?i?"":void 0:(s=uv(n,r),s<55296||s>56319||r+1===o||(a=uv(n,r+1))<56320||a>57343?i?pR(n,r):s:i?fR(n,r,r+2):(s-55296<<10)+(a-56320)+65536)}};cv.exports={codeAt:lv(!1),charAt:lv(!0)}});var pv=m((sX,hv)=>{"use strict";var dR=is().charAt;hv.exports=function(i,t,e){return t+(e?dR(i,t).length:1)}});var dv=m((aX,fv)=>{"use strict";var W0=B(),gR=yt(),mR=Math.floor,V0=W0("".charAt),vR=W0("".replace),H0=W0("".slice),_R=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,yR=/\$([$&'`]|\d{1,2})/g;fv.exports=function(i,t,e,n,r,o){var s=e+i.length,a=n.length,u=yR;return r!==void 0&&(r=gR(r),u=_R),vR(o,u,function(l,c){var h;switch(V0(c,0)){case"$":return"$";case"&":return i;case"`":return H0(t,0,e);case"'":return H0(t,s);case"<":h=r[H0(c,1,-1)];break;default:var p=+c;if(p===0)return l;if(p>a){var d=mR(p/10);return d===0?l:d<=a?n[d-1]===void 0?V0(c,1):n[d-1]+V0(c,1):l}h=n[p-1]}return h===void 0?"":h})}});var vv=m((uX,mv)=>{"use strict";var gv=et(),xR=mt(),ER=J(),SR=Ne(),bR=Zo(),MR=TypeError;mv.exports=function(i,t){var e=i.exec;if(ER(e)){var n=gv(e,i,t);return n!==null&&xR(n),n}if(SR(i)==="RegExp")return gv(bR,i,t);throw new MR("RegExp#exec called on incompatible receiver")}});var Ei=m(()=>{"use strict";var wR=Go(),_v=et(),os=B(),TR=av(),AR=k(),CR=mt(),RR=J(),PR=pt(),IR=Lt(),LR=Gn(),_r=Nt(),NR=Bn(),OR=pv(),DR=si(),UR=dv(),FR=vv(),BR=ot(),X0=BR("replace"),zR=Math.max,GR=Math.min,kR=os([].concat),q0=os([].push),yv=os("".indexOf),xv=os("".slice),VR=function(i){return i===void 0?i:String(i)},HR=function(){return"a".replace(/./,"$0")==="$0"}(),Ev=function(){return/./[X0]?/./[X0]("a","$0")==="":!1}(),WR=!AR(function(){var i=/./;return i.exec=function(){var t=[];return t.groups={a:"7"},t},"".replace(i,"$<a>")!=="7"});TR("replace",function(i,t,e){var n=Ev?"$":"$0";return[function(o,s){var a=NR(this),u=PR(o)?DR(o,X0):void 0;return u?_v(u,o,a,s):_v(t,_r(a),o,s)},function(r,o){var s=CR(this),a=_r(r);if(typeof o=="string"&&yv(o,n)===-1&&yv(o,"$<")===-1){var u=e(t,s,a,o);if(u.done)return u.value}var l=RR(o);l||(o=_r(o));var c=s.global,h;c&&(h=s.unicode,s.lastIndex=0);for(var p=[],d;d=FR(s,a),!(d===null||(q0(p,d),!c));){var g=_r(d[0]);g===""&&(s.lastIndex=OR(a,LR(s.lastIndex),h))}for(var v="",_=0,E=0;E<p.length;E++){d=p[E];for(var b=_r(d[0]),w=zR(GR(IR(d.index),a.length),0),P=[],L,U=1;U<d.length;U++)q0(P,VR(d[U]));var T=d.groups;if(l){var N=kR([b],P,w,a);T!==void 0&&q0(N,T),L=_r(wR(o,void 0,N))}else L=UR(b,a,w,P,T,o);w>=_&&(v+=xv(a,_,w)+L,_=w+b.length)}return v+xv(a,_)}]},!WR||!HR||Ev)});var j0=m((hX,Sv)=>{"use strict";Sv.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 wv=m((pX,Mv)=>{"use strict";var qR=B(),XR=Bn(),jR=Nt(),Z0=j0(),bv=qR("".replace),YR=RegExp("^["+Z0+"]+"),ZR=RegExp("(^|[^"+Z0+"])["+Z0+"]+$"),Y0=function(i){return function(t){var e=jR(XR(t));return i&1&&(e=bv(e,YR,"")),i&2&&(e=bv(e,ZR,"$1")),e}};Mv.exports={start:Y0(1),end:Y0(2),trim:Y0(3)}});var Rv=m((fX,Cv)=>{"use strict";var KR=ai().PROPER,$R=k(),Tv=j0(),Av="\u200B\x85\u180E";Cv.exports=function(i){return $R(function(){return!!Tv[i]()||Av[i]()!==Av||KR&&Tv[i].name!==i})}});var ss=m(()=>{"use strict";var JR=H(),QR=wv().trim,tP=Rv();JR({target:"String",proto:!0,forced:tP("trim")},{trim:function(){return QR(this)}})});var J0=m((FX,Nv)=>{"use strict";var Lv=hr(),eP=TypeError;Nv.exports=function(i,t){if(!delete i[t])throw new eP("Cannot delete property "+Lv(t)+" of "+Lv(i))}});var as=m((BX,Dv)=>{"use strict";var Ov=_i(),nP=Math.floor,Q0=function(i,t){var e=i.length;if(e<8)for(var n=1,r,o;n<e;){for(o=n,r=i[n];o&&t(i[o-1],r)>0;)i[o]=i[--o];o!==n++&&(i[o]=r)}else for(var s=nP(e/2),a=Q0(Ov(i,0,s),t),u=Q0(Ov(i,s),t),l=a.length,c=u.length,h=0,p=0;h<l||p<c;)i[h+p]=h<l&&p<c?t(a[h],u[p])<=0?a[h++]:u[p++]:h<l?a[h++]:u[p++];return i};Dv.exports=Q0});var Fv=m((zX,Uv)=>{"use strict";var rP=k();Uv.exports=function(i,t){var e=[][i];return!!e&&rP(function(){e.call(null,t||function(){return 1},1)})}});var tl=m((GX,zv)=>{"use strict";var iP=cr(),Bv=iP.match(/firefox\/(\d+)/i);zv.exports=!!Bv&&+Bv[1]});var el=m((kX,Gv)=>{"use strict";var oP=cr();Gv.exports=/MSIE|Trident/.test(oP)});var nl=m((VX,Vv)=>{"use strict";var sP=cr(),kv=sP.match(/AppleWebKit\/(\d+)\./);Vv.exports=!!kv&&+kv[1]});var jn=m(()=>{"use strict";var aP=H(),Zv=B(),uP=Ee(),lP=yt(),Hv=dt(),cP=J0(),Wv=Nt(),rl=k(),hP=as(),pP=Fv(),qv=tl(),fP=el(),Xv=ii(),jv=nl(),Sn=[],Yv=Zv(Sn.sort),dP=Zv(Sn.push),gP=rl(function(){Sn.sort(void 0)}),mP=rl(function(){Sn.sort(null)}),vP=pP("sort"),Kv=!rl(function(){if(Xv)return Xv<70;if(!(qv&&qv>3)){if(fP)return!0;if(jv)return jv<603;var i="",t,e,n,r;for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(r=0;r<47;r++)Sn.push({k:e+r,v:n})}for(Sn.sort(function(o,s){return s.v-o.v}),r=0;r<Sn.length;r++)e=Sn[r].k.charAt(0),i.charAt(i.length-1)!==e&&(i+=e);return i!=="DGBEFHACIJK"}}),_P=gP||!mP||!vP||!Kv,yP=function(i){return function(t,e){return e===void 0?-1:t===void 0?1:i!==void 0?+i(t,e)||0:Wv(t)>Wv(e)?1:-1}};aP({target:"Array",proto:!0,forced:_P},{sort:function(t){t!==void 0&&uP(t);var e=lP(this);if(Kv)return t===void 0?Yv(e):Yv(e,t);var n=[],r=Hv(e),o,s;for(s=0;s<r;s++)s in e&&dP(n,e[s]);for(hP(n,yP(t)),o=Hv(n),s=0;s<o;)e[s]=n[s++];for(;s<r;)cP(e,s++);return e}})});var Jv=m((ZX,$v)=>{$v.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t}});var e_=m((KX,t_)=>{var Qv=Jv();t_.exports=function(i,t){Array.isArray(t)||(t=[]),i.length>0&&t.push(Qv([0,0],i[0]));for(var e=0;e<i.length-1;e++){var n=i[e],r=i[e+1],o=n[0],s=n[1],a=r[0],u=r[1],l=[.75*o+.25*a,.75*s+.25*u],c=[.25*o+.75*a,.25*s+.75*u];t.push(l),t.push(c)}return i.length>1&&t.push(Qv([0,0],i[i.length-1])),t}});var a_=m((i5,s_)=>{var sl=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((t,e)=>t.priority-e.priority)}set(t,e){let n=Number(e);if(isNaN(n))throw new TypeError('"priority" must be a number');return this.keys.has(t)?this.queue.map(r=>(r.key===t&&Object.assign(r,{priority:n}),r)):(this.keys.add(t),this.queue.push({key:t,priority:n})),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)}};s_.exports=sl});var c_=m((o5,l_)=>{function u_(i,t){let e=new Map;for(let[n,r]of i)n!==t&&r instanceof Map?e.set(n,u_(r,t)):n!==t&&e.set(n,r);return e}l_.exports=u_});var f_=m((s5,p_)=>{function bP(i){let t=Number(i);return!(isNaN(t)||t<=0)}function h_(i){let t=new Map;return Object.keys(i).forEach(n=>{let r=i[n];if(r!==null&&typeof r=="object"&&!Array.isArray(r))return t.set(n,h_(r));if(!bP(r))throw new Error(`Could not add node at key "${n}", make sure it's a valid node`,r);return t.set(n,Number(r))}),t}p_.exports=h_});var m_=m((a5,g_)=>{function d_(i){if(!(i instanceof Map))throw new Error(`Invalid graph: Expected Map instead found ${typeof i}`);i.forEach((t,e)=>{if(typeof t=="object"&&t instanceof Map){d_(t);return}if(typeof t!="number"||t<=0)throw new Error(`Values must be numbers greater than 0. Found value ${t} at ${e}`)})}g_.exports=d_});var ul=m((u5,y_)=>{var MP=a_(),wP=c_(),v_=f_(),__=m_(),al=class{constructor(t){t instanceof Map?(__(t),this.graph=t):t?this.graph=v_(t):this.graph=new Map}addNode(t,e){let n;return e instanceof Map?(__(e),n=e):n=v_(e),this.graph.set(t,n),this}addVertex(t,e){return this.addNode(t,e)}removeNode(t){return this.graph=wP(this.graph,t),this}path(t,e,n={}){if(!this.graph.size)return n.cost?{path:null,cost:0}:null;let r=new Set,o=new MP,s=new Map,a=[],u=0,l=[];if(n.avoid&&(l=[].concat(n.avoid)),l.includes(t))throw new Error(`Starting node (${t}) cannot be avoided`);if(l.includes(e))throw new Error(`Ending node (${e}) cannot be avoided`);for(o.set(t,0);!o.isEmpty();){let c=o.next();if(c.key===e){u=c.priority;let p=c.key;for(;s.has(p);)a.push(p),p=s.get(p);break}r.add(c.key),(this.graph.get(c.key)||new Map).forEach((p,d)=>{if(r.has(d)||l.includes(d))return null;if(!o.has(d))return s.set(d,c.key),o.set(d,c.priority+p);let g=o.get(d).priority,v=c.priority+p;return v<g?(s.set(d,c.key),o.set(d,v)):null})}return a.length?(n.trim?a.shift():a=a.concat([t]),n.reverse||(a=a.reverse()),n.cost?{path:a,cost:u}:a):n.cost?{path:null,cost:0}:null}shortestPath(...t){return this.path(...t)}};y_.exports=al});var ls=m((g5,E_)=>{"use strict";var TP=Ne(),AP=B();E_.exports=function(i){if(TP(i)==="Function")return AP(i)}});var bn=m((m5,b_)=>{"use strict";var S_=ls(),CP=Ee(),RP=ei(),PP=S_(S_.bind);b_.exports=function(i,t){return CP(i),t===void 0?i:RP?PP(i,t):function(){return i.apply(t,arguments)}}});var T_=m((v5,w_)=>{"use strict";var IP=hi(),LP=dt(),NP=Lo(),OP=bn(),M_=function(i,t,e,n,r,o,s,a){for(var u=r,l=0,c=s?OP(s,a):!1,h,p;l<n;)l in e&&(h=c?c(e[l],l,t):e[l],o>0&&IP(h)?(p=LP(h),u=M_(i,t,h,p,u,o-1)-1):(NP(u+1),i[u]=h),u++),l++;return u};w_.exports=M_});var cs=m((_5,I_)=>{"use strict";var DP=B(),UP=k(),A_=J(),FP=De(),BP=ee(),zP=Zu(),C_=function(){},R_=BP("Reflect","construct"),ll=/^\s*(?:class|function)\b/,GP=DP(ll.exec),kP=!ll.test(C_),bi=function(t){if(!A_(t))return!1;try{return R_(C_,[],t),!0}catch(e){return!1}},P_=function(t){if(!A_(t))return!1;switch(FP(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return kP||!!GP(ll,zP(t))}catch(e){return!0}};P_.sham=!0;I_.exports=!R_||UP(function(){var i;return bi(bi.call)||!bi(Object)||!bi(function(){i=!0})||i})?P_:bi});var D_=m((y5,O_)=>{"use strict";var L_=hi(),VP=cs(),HP=pt(),WP=ot(),qP=WP("species"),N_=Array;O_.exports=function(i){var t;return L_(i)&&(t=i.constructor,VP(t)&&(t===N_||L_(t.prototype))?t=void 0:HP(t)&&(t=t[qP],t===null&&(t=void 0))),t===void 0?N_:t}});var cl=m((x5,U_)=>{"use strict";var XP=D_();U_.exports=function(i,t){return new(XP(i))(t===0?0:t)}});var hs=m(()=>{"use strict";var jP=H(),YP=T_(),ZP=yt(),KP=dt(),$P=Lt(),JP=cl();jP({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=ZP(this),n=KP(e),r=JP(e,0);return r.length=YP(r,e,e,n,0,t===void 0?1:$P(t)),r}})});var ps=m(()=>{"use strict";var QP=pi();QP("flat")});var W_=m((zj,H_)=>{"use strict";var cI=ot(),k_=cI("iterator"),V_=!1;try{G_=0,pl={next:function(){return{done:!!G_++}},return:function(){V_=!0}},pl[k_]=function(){return this},Array.from(pl,function(){throw 2})}catch(i){}var G_,pl;H_.exports=function(i,t){try{if(!t&&!V_)return!1}catch(r){return!1}var e=!1;try{var n={};n[k_]=function(){return{next:function(){return{done:e=!0}}}},i(n)}catch(r){}return e}});var _s=m((Gj,q_)=>{"use strict";q_.exports=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"});var Ge=m((kj,j_)=>{"use strict";var X_=e0(),hI=zt();j_.exports=function(i,t,e){return e.get&&X_(e.get,t,{getter:!0}),e.set&&X_(e.set,t,{setter:!0}),hI.f(i,t,e)}});var Ct=m((Vj,ry)=>{"use strict";var pI=_s(),ml=$(),St=z(),$_=J(),Es=pt(),Cn=xt(),vl=De(),fI=hr(),dI=Gt(),fl=kt(),gI=Ge(),mI=lr(),Ss=fi(),Tr=Vn(),vI=ot(),_I=_o(),J_=Se(),Q_=J_.enforce,yI=J_.get,ys=St.Int8Array,dl=ys&&ys.prototype,Y_=St.Uint8ClampedArray,Z_=Y_&&Y_.prototype,we=ys&&Ss(ys),fe=dl&&Ss(dl),xI=Object.prototype,_l=St.TypeError,K_=vI("toStringTag"),gl=_I("TYPED_ARRAY_TAG"),xs="TypedArrayConstructor",ke=pI&&!!Tr&&vl(St.opera)!=="Opera",ty=!1,At,An,wr,Ve={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},yl={BigInt64Array:8,BigUint64Array:8},EI=function(t){if(!Es(t))return!1;var e=vl(t);return e==="DataView"||Cn(Ve,e)||Cn(yl,e)},ey=function(i){var t=Ss(i);if(Es(t)){var e=yI(t);return e&&Cn(e,xs)?e[xs]:ey(t)}},ny=function(i){if(!Es(i))return!1;var t=vl(i);return Cn(Ve,t)||Cn(yl,t)},SI=function(i){if(ny(i))return i;throw new _l("Target is not a typed array")},bI=function(i){if($_(i)&&(!Tr||mI(we,i)))return i;throw new _l(fI(i)+" is not a typed array constructor")},MI=function(i,t,e,n){if(ml){if(e)for(var r in Ve){var o=St[r];if(o&&Cn(o.prototype,i))try{delete o.prototype[i]}catch(s){try{o.prototype[i]=t}catch(a){}}}(!fe[i]||e)&&fl(fe,i,e?t:ke&&dl[i]||t,n)}},wI=function(i,t,e){var n,r;if(ml){if(Tr){if(e){for(n in Ve)if(r=St[n],r&&Cn(r,i))try{delete r[i]}catch(o){}}if(!we[i]||e)try{return fl(we,i,e?t:ke&&we[i]||t)}catch(o){}else return}for(n in Ve)r=St[n],r&&(!r[i]||e)&&fl(r,i,t)}};for(At in Ve)An=St[At],wr=An&&An.prototype,wr?Q_(wr)[xs]=An:ke=!1;for(At in yl)An=St[At],wr=An&&An.prototype,wr&&(Q_(wr)[xs]=An);if((!ke||!$_(we)||we===Function.prototype)&&(we=function(){throw new _l("Incorrect invocation")},ke))for(At in Ve)St[At]&&Tr(St[At],we);if((!ke||!fe||fe===xI)&&(fe=we.prototype,ke))for(At in Ve)St[At]&&Tr(St[At].prototype,fe);ke&&Ss(Z_)!==fe&&Tr(Z_,fe);if(ml&&!Cn(fe,K_)){ty=!0,gI(fe,K_,{configurable:!0,get:function(){return Es(this)?this[gl]:void 0}});for(At in Ve)St[At]&&dI(St[At],gl,At)}ry.exports={NATIVE_ARRAY_BUFFER_VIEWS:ke,TYPED_ARRAY_TAG:ty&&gl,aTypedArray:SI,aTypedArrayConstructor:bI,exportTypedArrayMethod:MI,exportTypedArrayStaticMethod:wI,getTypedArrayConstructor:ey,isView:EI,isTypedArray:ny,TypedArray:we,TypedArrayPrototype:fe}});var El=m((Hj,oy)=>{"use strict";var iy=z(),xl=k(),TI=W_(),AI=Ct().NATIVE_ARRAY_BUFFER_VIEWS,CI=iy.ArrayBuffer,Yn=iy.Int8Array;oy.exports=!AI||!xl(function(){Yn(1)})||!xl(function(){new Yn(-1)})||!TI(function(i){new Yn,new Yn(null),new Yn(1.5),new Yn(i)},!0)||xl(function(){return new Yn(new CI(2),1,void 0).length!==1})});var Sl=m((Wj,sy)=>{"use strict";var RI=kt();sy.exports=function(i,t,e){for(var n in t)RI(i,n,t[n],e);return i}});var Mi=m((qj,ay)=>{"use strict";var PI=lr(),II=TypeError;ay.exports=function(i,t){if(PI(t,i))return i;throw new II("Incorrect invocation")}});var bs=m((Xj,uy)=>{"use strict";var LI=Lt(),NI=Gn(),OI=RangeError;uy.exports=function(i){if(i===void 0)return 0;var t=LI(i),e=NI(t);if(t!==e)throw new OI("Wrong length or index");return e}});var cy=m((jj,ly)=>{"use strict";ly.exports=Math.sign||function(t){var e=+t;return e===0||e!==e?e:e<0?-1:1}});var fy=m((Yj,py)=>{"use strict";var DI=2220446049250313e-31,hy=1/DI;py.exports=function(i){return i+hy-hy}});var gy=m((Zj,dy)=>{"use strict";var UI=cy(),FI=fy(),BI=Math.abs,zI=2220446049250313e-31;dy.exports=function(i,t,e,n){var r=+i,o=BI(r),s=UI(r);if(o<n)return s*FI(o/n/t)*n*t;var a=(1+t/zI)*o,u=a-(a-o);return u>e||u!==u?s*(1/0):s*u}});var vy=m((Kj,my)=>{"use strict";var GI=gy(),kI=11920928955078125e-23,VI=34028234663852886e22,HI=11754943508222875e-54;my.exports=Math.fround||function(t){return GI(t,kI,VI,HI)}});var yy=m(($j,_y)=>{"use strict";var WI=Array,qI=Math.abs,He=Math.pow,XI=Math.floor,jI=Math.log,YI=Math.LN2,ZI=function(i,t,e){var n=WI(e),r=e*8-t-1,o=(1<<r)-1,s=o>>1,a=t===23?He(2,-24)-He(2,-77):0,u=i<0||i===0&&1/i<0?1:0,l=0,c,h,p;for(i=qI(i),i!==i||i===1/0?(h=i!==i?1:0,c=o):(c=XI(jI(i)/YI),p=He(2,-c),i*p<1&&(c--,p*=2),c+s>=1?i+=a/p:i+=a*He(2,1-s),i*p>=2&&(c++,p/=2),c+s>=o?(h=0,c=o):c+s>=1?(h=(i*p-1)*He(2,t),c+=s):(h=i*He(2,s-1)*He(2,t),c=0));t>=8;)n[l++]=h&255,h/=256,t-=8;for(c=c<<t|h,r+=t;r>0;)n[l++]=c&255,c/=256,r-=8;return n[l-1]|=u*128,n},KI=function(i,t){var e=i.length,n=e*8-t-1,r=(1<<n)-1,o=r>>1,s=n-7,a=e-1,u=i[a--],l=u&127,c;for(u>>=7;s>0;)l=l*256+i[a--],s-=8;for(c=l&(1<<-s)-1,l>>=-s,s+=t;s>0;)c=c*256+i[a--],s-=8;if(l===0)l=1-o;else{if(l===r)return c?NaN:u?-1/0:1/0;c+=He(2,t),l-=o}return(u?-1:1)*c*He(2,l-t)};_y.exports={pack:ZI,unpack:KI}});var bl=m((Jj,Ey)=>{"use strict";var $I=yt(),xy=li(),JI=dt();Ey.exports=function(t){for(var e=$I(this),n=JI(e),r=arguments.length,o=xy(r>1?arguments[1]:void 0,n),s=r>2?arguments[2]:void 0,a=s===void 0?n:xy(s,n);a>o;)e[o++]=t;return e}});var Ps=m((Qj,By)=>{"use strict";var Cs=z(),Cl=B(),Ml=$(),QI=_s(),Ny=ai(),tL=Gt(),eL=Ge(),Sy=Sl(),wl=k(),Ms=Mi(),nL=Lt(),rL=Gn(),Ts=bs(),iL=vy(),Oy=yy(),oL=fi(),by=Vn(),sL=bl(),aL=_i(),uL=ts(),lL=Po(),Dy=dn(),Rl=Se(),cL=Ny.PROPER,My=Ny.CONFIGURABLE,Cr="ArrayBuffer",Rs="DataView",Rr="prototype",hL="Wrong length",Uy="Wrong index",wy=Rl.getterFor(Cr),Ti=Rl.getterFor(Rs),Ty=Rl.set,de=Cs[Cr],Dt=de,Ar=Dt&&Dt[Rr],Te=Cs[Rs],Zn=Te&&Te[Rr],Ay=Object.prototype,pL=Cs.Array,As=Cs.RangeError,fL=Cl(sL),dL=Cl([].reverse),Fy=Oy.pack,Cy=Oy.unpack,Ry=function(i){return[i&255]},Py=function(i){return[i&255,i>>8&255]},Iy=function(i){return[i&255,i>>8&255,i>>16&255,i>>24&255]},Ly=function(i){return i[3]<<24|i[2]<<16|i[1]<<8|i[0]},gL=function(i){return Fy(iL(i),23,4)},mL=function(i){return Fy(i,52,8)},ws=function(i,t,e){eL(i[Rr],t,{configurable:!0,get:function(){return e(this)[t]}})},Rn=function(i,t,e,n){var r=Ti(i),o=Ts(e),s=!!n;if(o+t>r.byteLength)throw new As(Uy);var a=r.bytes,u=o+r.byteOffset,l=aL(a,u,u+t);return s?l:dL(l)},Pn=function(i,t,e,n,r,o){var s=Ti(i),a=Ts(e),u=n(+r),l=!!o;if(a+t>s.byteLength)throw new As(Uy);for(var c=s.bytes,h=a+s.byteOffset,p=0;p<t;p++)c[h+p]=u[l?p:t-p-1]};QI?(Tl=cL&&de.name!==Cr,!wl(function(){de(1)})||!wl(function(){new de(-1)})||wl(function(){return new de,new de(1.5),new de(NaN),de.length!==1||Tl&&!My})?(Dt=function(t){return Ms(this,Ar),uL(new de(Ts(t)),this,Dt)},Dt[Rr]=Ar,Ar.constructor=Dt,lL(Dt,de)):Tl&&My&&tL(de,"name",Cr),by&&oL(Zn)!==Ay&&by(Zn,Ay),wi=new Te(new Dt(2)),Al=Cl(Zn.setInt8),wi.setInt8(0,2147483648),wi.setInt8(1,2147483649),(wi.getInt8(0)||!wi.getInt8(1))&&Sy(Zn,{setInt8:function(t,e){Al(this,t,e<<24>>24)},setUint8:function(t,e){Al(this,t,e<<24>>24)}},{unsafe:!0})):(Dt=function(t){Ms(this,Ar);var e=Ts(t);Ty(this,{type:Cr,bytes:fL(pL(e),0),byteLength:e}),Ml||(this.byteLength=e,this.detached=!1)},Ar=Dt[Rr],Te=function(t,e,n){Ms(this,Zn),Ms(t,Ar);var r=wy(t),o=r.byteLength,s=nL(e);if(s<0||s>o)throw new As("Wrong offset");if(n=n===void 0?o-s:rL(n),s+n>o)throw new As(hL);Ty(this,{type:Rs,buffer:t,byteLength:n,byteOffset:s,bytes:r.bytes}),Ml||(this.buffer=t,this.byteLength=n,this.byteOffset=s)},Zn=Te[Rr],Ml&&(ws(Dt,"byteLength",wy),ws(Te,"buffer",Ti),ws(Te,"byteLength",Ti),ws(Te,"byteOffset",Ti)),Sy(Zn,{getInt8:function(t){return Rn(this,1,t)[0]<<24>>24},getUint8:function(t){return Rn(this,1,t)[0]},getInt16:function(t){var e=Rn(this,2,t,arguments.length>1?arguments[1]:!1);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=Rn(this,2,t,arguments.length>1?arguments[1]:!1);return e[1]<<8|e[0]},getInt32:function(t){return Ly(Rn(this,4,t,arguments.length>1?arguments[1]:!1))},getUint32:function(t){return Ly(Rn(this,4,t,arguments.length>1?arguments[1]:!1))>>>0},getFloat32:function(t){return Cy(Rn(this,4,t,arguments.length>1?arguments[1]:!1),23)},getFloat64:function(t){return Cy(Rn(this,8,t,arguments.length>1?arguments[1]:!1),52)},setInt8:function(t,e){Pn(this,1,t,Ry,e)},setUint8:function(t,e){Pn(this,1,t,Ry,e)},setInt16:function(t,e){Pn(this,2,t,Py,e,arguments.length>2?arguments[2]:!1)},setUint16:function(t,e){Pn(this,2,t,Py,e,arguments.length>2?arguments[2]:!1)},setInt32:function(t,e){Pn(this,4,t,Iy,e,arguments.length>2?arguments[2]:!1)},setUint32:function(t,e){Pn(this,4,t,Iy,e,arguments.length>2?arguments[2]:!1)},setFloat32:function(t,e){Pn(this,4,t,gL,e,arguments.length>2?arguments[2]:!1)},setFloat64:function(t,e){Pn(this,8,t,mL,e,arguments.length>2?arguments[2]:!1)}}));var Tl,wi,Al;Dy(Dt,Cr);Dy(Te,Rs);By.exports={ArrayBuffer:Dt,DataView:Te}});var Gy=m((tY,zy)=>{"use strict";var vL=pt(),_L=Math.floor;zy.exports=Number.isInteger||function(t){return!vL(t)&&isFinite(t)&&_L(t)===t}});var Vy=m((eY,ky)=>{"use strict";var yL=Lt(),xL=RangeError;ky.exports=function(i){var t=yL(i);if(t<0)throw new xL("The argument can't be less than 0");return t}});var Pl=m((nY,Hy)=>{"use strict";var EL=Vy(),SL=RangeError;Hy.exports=function(i,t){var e=EL(i);if(e%t)throw new SL("Wrong offset");return e}});var qy=m((rY,Wy)=>{"use strict";var bL=Math.round;Wy.exports=function(i){var t=bL(i);return t<0?0:t>255?255:t&255}});var Il=m((iY,Xy)=>{"use strict";var ML=cs(),wL=hr(),TL=TypeError;Xy.exports=function(i){if(ML(i))return i;throw new TL(wL(i)+" is not a constructor")}});var Ai=m((oY,Yy)=>{"use strict";var AL=De(),jy=si(),CL=ri(),RL=fr(),PL=ot(),IL=PL("iterator");Yy.exports=function(i){if(!CL(i))return jy(i,IL)||jy(i,"@@iterator")||RL[AL(i)]}});var Is=m((sY,Zy)=>{"use strict";var LL=et(),NL=Ee(),OL=mt(),DL=hr(),UL=Ai(),FL=TypeError;Zy.exports=function(i,t){var e=arguments.length<2?UL(i):t;if(NL(e))return OL(LL(e,i));throw new FL(DL(i)+" is not iterable")}});var Ll=m((aY,Ky)=>{"use strict";var BL=ot(),zL=fr(),GL=BL("iterator"),kL=Array.prototype;Ky.exports=function(i){return i!==void 0&&(zL.Array===i||kL[GL]===i)}});var Nl=m((uY,$y)=>{"use strict";var VL=De();$y.exports=function(i){var t=VL(i);return t==="BigInt64Array"||t==="BigUint64Array"}});var Ls=m((lY,Jy)=>{"use strict";var HL=Bu(),WL=TypeError;Jy.exports=function(i){var t=HL(i,"number");if(typeof t=="number")throw new WL("Can't convert number to bigint");return BigInt(t)}});var Ol=m((cY,Qy)=>{"use strict";var qL=bn(),XL=et(),jL=Il(),YL=yt(),ZL=dt(),KL=Is(),$L=Ai(),JL=Ll(),QL=Nl(),tN=Ct().aTypedArrayConstructor,eN=Ls();Qy.exports=function(t){var e=jL(this),n=YL(t),r=arguments.length,o=r>1?arguments[1]:void 0,s=o!==void 0,a=$L(n),u,l,c,h,p,d,g,v;if(a&&!JL(a))for(g=KL(n,a),v=g.next,n=[];!(d=XL(v,g)).done;)n.push(d.value);for(s&&r>2&&(o=qL(o,arguments[2])),l=ZL(n),c=new(tN(e))(l),h=QL(c),u=0;l>u;u++)p=s?o(n[u],u):n[u],c[u]=h?eN(p):+p;return c}});var n2=m((hY,e2)=>{"use strict";var nN=bn(),rN=B(),iN=ni(),oN=yt(),sN=dt(),aN=cl(),t2=rN([].push),In=function(i){var t=i===1,e=i===2,n=i===3,r=i===4,o=i===6,s=i===7,a=i===5||o;return function(u,l,c,h){for(var p=oN(u),d=iN(p),g=sN(d),v=nN(l,c),_=0,E=h||aN,b=t?E(u,g):e||s?E(u,0):void 0,w,P;g>_;_++)if((a||_ in d)&&(w=d[_],P=v(w,_,p),i))if(t)b[_]=P;else if(P)switch(i){case 3:return!0;case 5:return w;case 6:return _;case 2:t2(b,w)}else switch(i){case 4:return!1;case 7:t2(b,w)}return o?-1:n||r?r:b}};e2.exports={forEach:In(0),map:In(1),filter:In(2),some:In(3),every:In(4),find:In(5),findIndex:In(6),filterReject:In(7)}});var Dl=m((pY,i2)=>{"use strict";var uN=ee(),lN=Ge(),cN=ot(),hN=$(),r2=cN("species");i2.exports=function(i){var t=uN(i);hN&&t&&!t[r2]&&lN(t,r2,{configurable:!0,get:function(){return this}})}});var Ul=m((fY,o2)=>{"use strict";var pN=dt();o2.exports=function(i,t,e){for(var n=0,r=arguments.length>2?e:pN(t),o=new i(r);r>n;)o[n]=t[n++];return o}});var Ln=m((dY,Hl)=>{"use strict";var s2=H(),v2=z(),a2=et(),fN=$(),dN=El(),Ii=Ct(),_2=Ps(),u2=Mi(),gN=pn(),Ci=Gt(),mN=Gy(),vN=Gn(),l2=bs(),Fl=Pl(),_N=qy(),y2=yo(),Ri=xt(),yN=De(),Gl=pt(),xN=oi(),EN=kn(),SN=lr(),Ns=Vn(),bN=i0().f,c2=Ol(),MN=n2().forEach,wN=Dl(),TN=Ge(),x2=zt(),E2=Eo(),h2=Ul(),Wl=Se(),AN=ts(),kl=Wl.get,CN=Wl.set,RN=Wl.enforce,S2=x2.f,PN=E2.f,Bl=v2.RangeError,b2=_2.ArrayBuffer,IN=b2.prototype,LN=_2.DataView,Os=Ii.NATIVE_ARRAY_BUFFER_VIEWS,p2=Ii.TYPED_ARRAY_TAG,f2=Ii.TypedArray,Pi=Ii.TypedArrayPrototype,Vl=Ii.isTypedArray,Ds="BYTES_PER_ELEMENT",zl="Wrong length",Us=function(i,t){TN(i,t,{configurable:!0,get:function(){return kl(this)[t]}})},d2=function(i){var t;return SN(IN,i)||(t=yN(i))==="ArrayBuffer"||t==="SharedArrayBuffer"},M2=function(i,t){return Vl(i)&&!xN(t)&&t in i&&mN(+t)&&t>=0},g2=function(t,e){return e=y2(e),M2(t,e)?gN(2,t[e]):PN(t,e)},m2=function(t,e,n){return e=y2(e),M2(t,e)&&Gl(n)&&Ri(n,"value")&&!Ri(n,"get")&&!Ri(n,"set")&&!n.configurable&&(!Ri(n,"writable")||n.writable)&&(!Ri(n,"enumerable")||n.enumerable)?(t[e]=n.value,t):S2(t,e,n)};fN?(Os||(E2.f=g2,x2.f=m2,Us(Pi,"buffer"),Us(Pi,"byteOffset"),Us(Pi,"byteLength"),Us(Pi,"length")),s2({target:"Object",stat:!0,forced:!Os},{getOwnPropertyDescriptor:g2,defineProperty:m2}),Hl.exports=function(i,t,e){var n=i.match(/\d+/)[0]/8,r=i+(e?"Clamped":"")+"Array",o="get"+i,s="set"+i,a=v2[r],u=a,l=u&&u.prototype,c={},h=function(v,_){var E=kl(v);return E.view[o](_*n+E.byteOffset,!0)},p=function(v,_,E){var b=kl(v);b.view[s](_*n+b.byteOffset,e?_N(E):E,!0)},d=function(v,_){S2(v,_,{get:function(){return h(this,_)},set:function(E){return p(this,_,E)},enumerable:!0})};Os?dN&&(u=t(function(v,_,E,b){return u2(v,l),AN(function(){return Gl(_)?d2(_)?b!==void 0?new a(_,Fl(E,n),b):E!==void 0?new a(_,Fl(E,n)):new a(_):Vl(_)?h2(u,_):a2(c2,u,_):new a(l2(_))}(),v,u)}),Ns&&Ns(u,f2),MN(bN(a),function(v){v in u||Ci(u,v,a[v])}),u.prototype=l):(u=t(function(v,_,E,b){u2(v,l);var w=0,P=0,L,U,T;if(!Gl(_))T=l2(_),U=T*n,L=new b2(U);else if(d2(_)){L=_,P=Fl(E,n);var N=_.byteLength;if(b===void 0){if(N%n)throw new Bl(zl);if(U=N-P,U<0)throw new Bl(zl)}else if(U=vN(b)*n,U+P>N)throw new Bl(zl);T=U/n}else return Vl(_)?h2(u,_):a2(c2,u,_);for(CN(v,{buffer:L,byteOffset:P,byteLength:U,length:T,view:new LN(L)});w<T;)d(v,w++)}),Ns&&Ns(u,f2),l=u.prototype=EN(Pi)),l.constructor!==u&&Ci(l,"constructor",u),RN(l).TypedArrayConstructor=u,p2&&Ci(l,p2,r);var g=u!==a;c[r]=u,s2({global:!0,constructor:!0,forced:g,sham:!Os},c),Ds in u||Ci(u,Ds,n),Ds in l||Ci(l,Ds,n),wN(r)}):Hl.exports=function(){}});var Kn=m(()=>{"use strict";var NN=Ln();NN("Float32",function(i){return function(e,n,r){return i(this,e,n,r)}})});var We=m(()=>{"use strict";var w2=Ct(),ON=dt(),DN=Lt(),UN=w2.aTypedArray,FN=w2.exportTypedArrayMethod;FN("at",function(t){var e=UN(this),n=ON(e),r=DN(t),o=r>=0?r:n+r;return o<0||o>=n?void 0:e[o]})});var qe=m(()=>{"use strict";var T2=Ct(),BN=bl(),zN=Ls(),GN=De(),kN=et(),VN=B(),HN=k(),WN=T2.aTypedArray,qN=T2.exportTypedArrayMethod,XN=VN("".slice),jN=HN(function(){var i=0;return new Int8Array(2).fill({valueOf:function(){return i++}}),i!==1});qN("fill",function(t){var e=arguments.length;WN(this);var n=XN(GN(this),0,3)==="Big"?zN(t):+t;return kN(BN,this,n,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)},jN)});var Li=m((EY,C2)=>{"use strict";var YN=bn(),ZN=ni(),KN=yt(),$N=dt(),A2=function(i){var t=i===1;return function(e,n,r){for(var o=KN(e),s=ZN(o),a=$N(s),u=YN(n,r),l,c;a-- >0;)if(l=s[a],c=u(l,a,o),c)switch(i){case 0:return l;case 1:return a}return t?-1:void 0}};C2.exports={findLast:A2(0),findLastIndex:A2(1)}});var Xe=m(()=>{"use strict";var R2=Ct(),JN=Li().findLast,QN=R2.aTypedArray,tO=R2.exportTypedArrayMethod;tO("findLast",function(t){return JN(QN(this),t,arguments.length>1?arguments[1]:void 0)})});var je=m(()=>{"use strict";var P2=Ct(),eO=Li().findLastIndex,nO=P2.aTypedArray,rO=P2.exportTypedArrayMethod;rO("findLastIndex",function(t){return eO(nO(this),t,arguments.length>1?arguments[1]:void 0)})});var Ye=m(()=>{"use strict";var L2=z(),N2=et(),jl=Ct(),iO=dt(),oO=Pl(),sO=yt(),O2=k(),aO=L2.RangeError,ql=L2.Int8Array,I2=ql&&ql.prototype,D2=I2&&I2.set,uO=jl.aTypedArray,lO=jl.exportTypedArrayMethod,Xl=!O2(function(){var i=new Uint8ClampedArray(2);return N2(D2,i,{length:1,0:3},1),i[1]!==3}),cO=Xl&&jl.NATIVE_ARRAY_BUFFER_VIEWS&&O2(function(){var i=new ql(2);return i.set(1),i.set("2",1),i[0]!==0||i[1]!==2});lO("set",function(t){uO(this);var e=oO(arguments.length>1?arguments[1]:void 0,1),n=sO(t);if(Xl)return N2(D2,this,n,e);var r=this.length,o=iO(n),s=0;if(o+e>r)throw new aO("Wrong length");for(;s<o;)this[e+s]=n[s++]},!Xl||cO)});var Ze=m(()=>{"use strict";var hO=z(),pO=ls(),Yl=k(),fO=Ee(),dO=as(),G2=Ct(),U2=tl(),gO=el(),F2=ii(),B2=nl(),mO=G2.aTypedArray,vO=G2.exportTypedArrayMethod,Ni=hO.Uint16Array,Pr=Ni&&pO(Ni.prototype.sort),_O=!!Pr&&!(Yl(function(){Pr(new Ni(2),null)})&&Yl(function(){Pr(new Ni(2),{})})),z2=!!Pr&&!Yl(function(){if(F2)return F2<74;if(U2)return U2<67;if(gO)return!0;if(B2)return B2<602;var i=new Ni(516),t=Array(516),e,n;for(e=0;e<516;e++)n=e%4,i[e]=515-e,t[e]=e-2*n+3;for(Pr(i,function(r,o){return(r/4|0)-(o/4|0)}),e=0;e<516;e++)if(i[e]!==t[e])return!0}),yO=function(i){return function(t,e){return i!==void 0?+i(t,e)||0:e!==e?-1:t!==t?1:t===0&&e===0?1/t>0&&1/e<0?1:-1:t>e}};vO("sort",function(t){return t!==void 0&&fO(t),z2?Pr(this,t):dO(mO(this),yO(t))},!z2||_O)});var V2=m((PY,k2)=>{"use strict";var xO=dt();k2.exports=function(i,t){for(var e=xO(i),n=new t(e),r=0;r<e;r++)n[r]=i[e-r-1];return n}});var Ke=m(()=>{"use strict";var EO=V2(),Zl=Ct(),SO=Zl.aTypedArray,bO=Zl.exportTypedArrayMethod,MO=Zl.getTypedArrayConstructor;bO("toReversed",function(){return EO(SO(this),MO(this))})});var $e=m(()=>{"use strict";var Fs=Ct(),wO=B(),TO=Ee(),AO=Ul(),CO=Fs.aTypedArray,RO=Fs.getTypedArrayConstructor,PO=Fs.exportTypedArrayMethod,IO=wO(Fs.TypedArrayPrototype.sort);PO("toSorted",function(t){t!==void 0&&TO(t);var e=CO(this),n=AO(RO(e),e);return IO(n,t)})});var W2=m((DY,H2)=>{"use strict";var LO=dt(),NO=Lt(),OO=RangeError;H2.exports=function(i,t,e,n){var r=LO(i),o=NO(e),s=o<0?r+o:o;if(s>=r||s<0)throw new OO("Incorrect index");for(var a=new t(r),u=0;u<r;u++)a[u]=u===s?n:i[u];return a}});var Je=m(()=>{"use strict";var DO=W2(),Kl=Ct(),UO=Nl(),FO=Lt(),BO=Ls(),zO=Kl.aTypedArray,GO=Kl.getTypedArrayConstructor,kO=Kl.exportTypedArrayMethod,VO=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(i){return i===8}}();kO("with",function(i,t){var e=zO(this),n=FO(i),r=UO(e)?BO(t):+t;return DO(e,GO(e),n,r)},!VO)});var Qe=m(()=>{"use strict";var HO=H(),WO=z(),qO=Ps(),XO=Dl(),$l="ArrayBuffer",q2=qO[$l],jO=WO[$l];HO({global:!0,constructor:!0,forced:jO!==q2},{ArrayBuffer:q2});XO($l)});var tn=m(()=>{"use strict";var YO=H(),Ql=ls(),ZO=k(),Z2=Ps(),X2=mt(),j2=li(),KO=Gn(),tc=Z2.ArrayBuffer,Jl=Z2.DataView,K2=Jl.prototype,Y2=Ql(tc.prototype.slice),$O=Ql(K2.getUint8),JO=Ql(K2.setUint8),QO=ZO(function(){return!new tc(2).slice(1,void 0).byteLength});YO({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:QO},{slice:function(t,e){if(Y2&&e===void 0)return Y2(X2(this),t);for(var n=X2(this).byteLength,r=j2(t,n),o=j2(e===void 0?n:e,n),s=new tc(KO(o-r)),a=new Jl(this),u=new Jl(s),l=0;r<o;)JO(u,l++,$O(a,r++));return s}})});var ec=m((VY,Q2)=>{"use strict";var J2=z(),tD=di(),eD=Ne(),$2=J2.ArrayBuffer,nD=J2.TypeError;Q2.exports=$2&&tD($2.prototype,"byteLength","get")||function(i){if(eD(i)!=="ArrayBuffer")throw new nD("ArrayBuffer expected");return i.byteLength}});var nc=m((HY,tx)=>{"use strict";var rD=z(),iD=_s(),oD=ec(),sD=rD.DataView;tx.exports=function(i){if(!iD||oD(i)!==0)return!1;try{return new sD(i),!1}catch(t){return!0}}});var en=m(()=>{"use strict";var aD=$(),uD=Ge(),lD=nc(),ex=ArrayBuffer.prototype;aD&&!("detached"in ex)&&uD(ex,"detached",{configurable:!0,get:function(){return lD(this)}})});var rx=m((XY,nx)=>{"use strict";var cD=nc(),hD=TypeError;nx.exports=function(i){if(cD(i))throw new hD("ArrayBuffer is detached");return i}});var rc=m((jY,ix)=>{"use strict";var Oi=z(),pD=cr(),fD=Ne(),Bs=function(i){return pD.slice(0,i.length)===i};ix.exports=function(){return Bs("Bun/")?"BUN":Bs("Cloudflare-Workers")?"CLOUDFLARE":Bs("Deno/")?"DENO":Bs("Node.js/")?"NODE":Oi.Bun&&typeof Bun.version=="string"?"BUN":Oi.Deno&&typeof Deno.version=="object"?"DENO":fD(Oi.process)==="process"?"NODE":Oi.window&&Oi.document?"BROWSER":"REST"}()});var sx=m((YY,ox)=>{"use strict";var dD=rc();ox.exports=dD==="NODE"});var ux=m((ZY,ax)=>{"use strict";var gD=z(),mD=sx();ax.exports=function(i){if(mD){try{return gD.process.getBuiltinModule(i)}catch(t){}try{return Function('return require("'+i+'")')()}catch(t){}}}});var sc=m((KY,cx)=>{"use strict";var vD=z(),_D=k(),ic=ii(),oc=rc(),lx=vD.structuredClone;cx.exports=!!lx&&!_D(function(){if(oc==="DENO"&&ic>92||oc==="NODE"&&ic>94||oc==="BROWSER"&&ic>97)return!1;var i=new ArrayBuffer(8),t=lx(i,{transfer:[i]});return i.byteLength!==0||t.byteLength!==8})});var dx=m(($Y,fx)=>{"use strict";var cc=z(),yD=ux(),xD=sc(),ED=cc.structuredClone,hx=cc.ArrayBuffer,zs=cc.MessageChannel,lc=!1,ac,px,Gs,uc;if(xD)lc=function(i){ED(i,{transfer:[i]})};else if(hx)try{zs||(ac=yD("worker_threads"),ac&&(zs=ac.MessageChannel)),zs&&(px=new zs,Gs=new hx(2),uc=function(i){px.port1.postMessage(null,[i])},Gs.byteLength===2&&(uc(Gs),Gs.byteLength===0&&(lc=uc)))}catch(i){}fx.exports=lc});var mc=m((JY,Ex)=>{"use strict";var fc=z(),dc=B(),_x=di(),SD=bs(),bD=rx(),MD=ec(),gx=dx(),hc=sc(),wD=fc.structuredClone,yx=fc.ArrayBuffer,pc=fc.DataView,TD=Math.min,gc=yx.prototype,xx=pc.prototype,AD=dc(gc.slice),mx=_x(gc,"resizable","get"),vx=_x(gc,"maxByteLength","get"),CD=dc(xx.getInt8),RD=dc(xx.setInt8);Ex.exports=(hc||gx)&&function(i,t,e){var n=MD(i),r=t===void 0?n:SD(t),o=!mx||!mx(i),s;if(bD(i),hc&&(i=wD(i,{transfer:[i]}),n===r&&(e||o)))return i;if(n>=r&&(!e||o))s=AD(i,0,r);else{var a=e&&!o&&vx?{maxByteLength:vx(i)}:void 0;s=new yx(r,a);for(var u=new pc(i),l=new pc(s),c=TD(r,n),h=0;h<c;h++)RD(l,h,CD(u,h))}return hc||gx(i),s}});var nn=m(()=>{"use strict";var PD=H(),Sx=mc();Sx&&PD({target:"ArrayBuffer",proto:!0},{transfer:function(){return Sx(this,arguments.length?arguments[0]:void 0,!0)}})});var rn=m(()=>{"use strict";var ID=H(),bx=mc();bx&&ID({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return bx(this,arguments.length?arguments[0]:void 0,!1)}})});var ks=m(()=>{"use strict";var VD=Ln();VD("Uint8",function(i){return function(e,n,r){return i(this,e,n,r)}})});var _c=m(()=>{"use strict";var HD=El(),WD=Ct().exportTypedArrayStaticMethod,qD=Ol();WD("from",qD,HD)});var Lx=m(()=>{"use strict";var YD=is().charAt,ZD=Nt(),Px=Se(),KD=E0(),Rx=Fo(),Ix="String Iterator",$D=Px.set,JD=Px.getterFor(Ix);KD(String,"String",function(i){$D(this,{type:Ix,string:ZD(i),index:0})},function(){var t=JD(this),e=t.string,n=t.index,r;return n>=e.length?Rx(void 0,!0):(r=YD(e,n),t.index+=r.length,Rx(r,!1))})});var Ec=m((E9,Ox)=>{"use strict";var QD=k(),tU=ot(),eU=$(),Nx=fn(),nU=tU("iterator");Ox.exports=!QD(function(){var i=new URL("b?a=1&b=2&c=3","https://a"),t=i.searchParams,e=new URLSearchParams("a=1&a=2&b=3"),n="";return i.pathname="c%20d",t.forEach(function(r,o){t.delete("b"),n+=o+r}),e.delete("a",2),e.delete("b",void 0),Nx&&(!i.toJSON||!e.has("a",1)||e.has("a",2)||!e.has("a",void 0)||e.has("b"))||!t.size&&(Nx||!eU)||!t.sort||i.href!=="https://a/c%20d?a=1&c=3"||t.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!t[nU]||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"||n!=="a1c3"||new URL("https://x",void 0).host!=="x"})});var Bx=m((S9,Fx)=>{"use strict";var Dx=$(),rU=B(),iU=et(),oU=k(),Sc=u0(),sU=o0(),aU=Au(),uU=yt(),lU=ni(),Lr=Object.assign,Ux=Object.defineProperty,cU=rU([].concat);Fx.exports=!Lr||oU(function(){if(Dx&&Lr({b:1},Lr(Ux({},"a",{enumerable:!0,get:function(){Ux(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var i={},t={},e=Symbol("assign detection"),n="abcdefghijklmnopqrst";return i[e]=7,n.split("").forEach(function(r){t[r]=r}),Lr({},i)[e]!==7||Sc(Lr({},t)).join("")!==n})?function(t,e){for(var n=uU(t),r=arguments.length,o=1,s=sU.f,a=aU.f;r>o;)for(var u=lU(arguments[o++]),l=s?cU(Sc(u),s(u)):Sc(u),c=l.length,h=0,p;c>h;)p=l[h++],(!Dx||iU(a,u,p))&&(n[p]=u[p]);return n}:Lr});var Gx=m((b9,zx)=>{"use strict";var hU=mt(),pU=qo();zx.exports=function(i,t,e,n){try{return n?t(hU(e)[0],e[1]):t(e)}catch(r){pU(i,"throw",r)}}});var Vx=m((M9,kx)=>{"use strict";var fU=$(),dU=zt(),gU=pn();kx.exports=function(i,t,e){fU?dU.f(i,t,gU(0,e)):i[t]=e}});var Xx=m((w9,qx)=>{"use strict";var mU=bn(),vU=et(),_U=yt(),yU=Gx(),xU=Ll(),EU=cs(),SU=dt(),Hx=Vx(),bU=Is(),MU=Ai(),Wx=Array;qx.exports=function(t){var e=_U(t),n=EU(this),r=arguments.length,o=r>1?arguments[1]:void 0,s=o!==void 0;s&&(o=mU(o,r>2?arguments[2]:void 0));var a=MU(e),u=0,l,c,h,p,d,g;if(a&&!(this===Wx&&xU(a)))for(c=n?new this:[],p=bU(e,a),d=p.next;!(h=vU(d,p)).done;u++)g=s?yU(p,o,[h.value,u],!0):h.value,Hx(c,u,g);else for(l=SU(e),c=n?new this(l):Wx(l);l>u;u++)g=s?o(e[u],u):e[u],Hx(c,u,g);return c.length=u,c}});var e6=m((T9,t6)=>{"use strict";var Qn=B(),bc=2147483647,Bi=36,$x=1,Tc=26,wU=38,TU=700,AU=72,CU=128,RU="-",PU=/[^\0-\u007E]/,Jx=/[.\u3002\uFF0E\uFF61]/g,jx="Overflow: input needs wider integers to process",Mc=Bi-$x,Yx=RangeError,IU=Qn(Jx.exec),Nr=Math.floor,wc=String.fromCharCode,Zx=Qn("".charCodeAt),Qx=Qn([].join),Nn=Qn([].push),LU=Qn("".replace),NU=Qn("".split),OU=Qn("".toLowerCase),DU=function(i){for(var t=[],e=0,n=i.length;e<n;){var r=Zx(i,e++);if(r>=55296&&r<=56319&&e<n){var o=Zx(i,e++);(o&64512)===56320?Nn(t,((r&1023)<<10)+(o&1023)+65536):(Nn(t,r),e--)}else Nn(t,r)}return t},Kx=function(i){return i+22+75*(i<26)},UU=function(i,t,e){var n=0;for(i=e?Nr(i/TU):i>>1,i+=Nr(i/t);i>Mc*Tc>>1;)i=Nr(i/Mc),n+=Bi;return Nr(n+(Mc+1)*i/(i+wU))},FU=function(i){var t=[];i=DU(i);var e=i.length,n=CU,r=0,o=AU,s,a;for(s=0;s<i.length;s++)a=i[s],a<128&&Nn(t,wc(a));var u=t.length,l=u;for(u&&Nn(t,RU);l<e;){var c=bc;for(s=0;s<i.length;s++)a=i[s],a>=n&&a<c&&(c=a);var h=l+1;if(c-n>Nr((bc-r)/h))throw new Yx(jx);for(r+=(c-n)*h,n=c,s=0;s<i.length;s++){if(a=i[s],a<n&&++r>bc)throw new Yx(jx);if(a===n){for(var p=r,d=Bi;;){var g=d<=o?$x:d>=o+Tc?Tc:d-o;if(p<g)break;var v=p-g,_=Bi-g;Nn(t,wc(Kx(g+v%_))),p=Nr(v/_),d+=Bi}Nn(t,wc(Kx(p))),o=UU(r,h,l===u),r=0,l++}}r++,n++}return Qx(t,"")};t6.exports=function(i){var t=[],e=NU(LU(OU(i),Jx,"."),"."),n,r;for(n=0;n<e.length;n++)r=e[n],Nn(t,IU(PU,r)?"xn--"+FU(r):r);return Qx(t,".")}});var zi=m((A9,n6)=>{"use strict";var BU=TypeError;n6.exports=function(i,t){if(i<t)throw new BU("Not enough arguments");return i}});var o6=m(()=>{"use strict";var zU=H(),GU=B(),kU=li(),VU=RangeError,r6=String.fromCharCode,i6=String.fromCodePoint,HU=GU([].join),WU=!!i6&&i6.length!==1;zU({target:"String",stat:!0,arity:1,forced:WU},{fromCodePoint:function(t){for(var e=[],n=arguments.length,r=0,o;n>r;){if(o=+arguments[r++],kU(o,1114111)!==o)throw new VU(o+" is not a valid code point");e[r]=o<65536?r6(o):r6(((o-=65536)>>10)+55296,o%1024+56320)}return HU(e,"")}})});var u6=m((P9,a6)=>{"use strict";var s6=z(),qU=$(),XU=Object.getOwnPropertyDescriptor;a6.exports=function(i){if(!qU)return s6[i];var t=XU(s6,i);return t&&t.value}});var Dc=m((I9,I6)=>{"use strict";b0();o6();var Lc=H(),E6=z(),Nc=u6(),jU=ee(),qs=et(),ge=B(),Gi=$(),S6=Ec(),b6=kt(),YU=Ge(),ZU=Sl(),KU=dn(),$U=y0(),Oc=Se(),M6=Mi(),Ac=J(),JU=xt(),QU=bn(),tF=De(),eF=mt(),w6=pt(),Mt=Nt(),nF=kn(),l6=pn(),c6=Is(),rF=Ai(),Xs=Fo(),Or=zi(),iF=ot(),oF=as(),sF=iF("iterator"),Ur="URLSearchParams",T6=Ur+"Iterator",A6=Oc.set,Wt=Oc.getterFor(Ur),aF=Oc.getterFor(T6),h6=Nc("fetch"),Zs=Nc("Request"),ki=Nc("Headers"),Cc=Zs&&Zs.prototype,p6=ki&&ki.prototype,uF=E6.TypeError,lF=E6.encodeURIComponent,cF=String.fromCharCode,hF=jU("String","fromCodePoint"),pF=parseInt,Ys=ge("".charAt),f6=ge([].join),On=ge([].push),C6=ge("".replace),fF=ge([].shift),d6=ge([].splice),g6=ge("".split),R6=ge("".slice),dF=ge(/./.exec),gF=/\+/g,Rc="\uFFFD",mF=/^[0-9a-f]+$/i,m6=function(i,t){var e=R6(i,t,t+2);return dF(mF,e)?pF(e,16):NaN},vF=function(i){for(var t=0,e=128;e>0&&i&e;e>>=1)t++;return t},_F=function(i){var t=null;switch(i.length){case 1:t=i[0];break;case 2:t=(i[0]&31)<<6|i[1]&63;break;case 3:t=(i[0]&15)<<12|(i[1]&63)<<6|i[2]&63;break;case 4:t=(i[0]&7)<<18|(i[1]&63)<<12|(i[2]&63)<<6|i[3]&63;break}return t>1114111?null:t},v6=function(i){i=C6(i,gF," ");for(var t=i.length,e="",n=0;n<t;){var r=Ys(i,n);if(r==="%"){if(Ys(i,n+1)==="%"||n+3>t){e+="%",n++;continue}var o=m6(i,n+1);if(o!==o){e+=r,n++;continue}n+=2;var s=vF(o);if(s===0)r=cF(o);else{if(s===1||s>4){e+=Rc,n++;continue}for(var a=[o],u=1;u<s&&(n++,!(n+3>t||Ys(i,n)!=="%"));){var l=m6(i,n+1);if(l!==l){n+=3;break}if(l>191||l<128)break;On(a,l),n+=2,u++}if(a.length!==s){e+=Rc;continue}var c=_F(a);c===null?e+=Rc:r=hF(c)}}e+=r,n++}return e},yF=/[!'()~]|%20/g,xF={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},EF=function(i){return xF[i]},_6=function(i){return C6(lF(i),yF,EF)},Pc=$U(function(t,e){A6(this,{type:T6,target:Wt(t).entries,index:0,kind:e})},Ur,function(){var t=aF(this),e=t.target,n=t.index++;if(!e||n>=e.length)return t.target=null,Xs(void 0,!0);var r=e[n];switch(t.kind){case"keys":return Xs(r.key,!1);case"values":return Xs(r.value,!1)}return Xs([r.key,r.value],!1)},!0),P6=function(i){this.entries=[],this.url=null,i!==void 0&&(w6(i)?this.parseObject(i):this.parseQuery(typeof i=="string"?Ys(i,0)==="?"?R6(i,1):i:Mt(i)))};P6.prototype={type:Ur,bindURL:function(i){this.url=i,this.update()},parseObject:function(i){var t=this.entries,e=rF(i),n,r,o,s,a,u,l;if(e)for(n=c6(i,e),r=n.next;!(o=qs(r,n)).done;){if(s=c6(eF(o.value)),a=s.next,(u=qs(a,s)).done||(l=qs(a,s)).done||!qs(a,s).done)throw new uF("Expected sequence with length 2");On(t,{key:Mt(u.value),value:Mt(l.value)})}else for(var c in i)JU(i,c)&&On(t,{key:c,value:Mt(i[c])})},parseQuery:function(i){if(i)for(var t=this.entries,e=g6(i,"&"),n=0,r,o;n<e.length;)r=e[n++],r.length&&(o=g6(r,"="),On(t,{key:v6(fF(o)),value:v6(f6(o,"="))}))},serialize:function(){for(var i=this.entries,t=[],e=0,n;e<i.length;)n=i[e++],On(t,_6(n.key)+"="+_6(n.value));return f6(t,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Ks=function(){M6(this,Dr);var t=arguments.length>0?arguments[0]:void 0,e=A6(this,new P6(t));Gi||(this.size=e.entries.length)},Dr=Ks.prototype;ZU(Dr,{append:function(t,e){var n=Wt(this);Or(arguments.length,2),On(n.entries,{key:Mt(t),value:Mt(e)}),Gi||this.length++,n.updateURL()},delete:function(i){for(var t=Wt(this),e=Or(arguments.length,1),n=t.entries,r=Mt(i),o=e<2?void 0:arguments[1],s=o===void 0?o:Mt(o),a=0;a<n.length;){var u=n[a];if(u.key===r&&(s===void 0||u.value===s)){if(d6(n,a,1),s!==void 0)break}else a++}Gi||(this.size=n.length),t.updateURL()},get:function(t){var e=Wt(this).entries;Or(arguments.length,1);for(var n=Mt(t),r=0;r<e.length;r++)if(e[r].key===n)return e[r].value;return null},getAll:function(t){var e=Wt(this).entries;Or(arguments.length,1);for(var n=Mt(t),r=[],o=0;o<e.length;o++)e[o].key===n&&On(r,e[o].value);return r},has:function(t){for(var e=Wt(this).entries,n=Or(arguments.length,1),r=Mt(t),o=n<2?void 0:arguments[1],s=o===void 0?o:Mt(o),a=0;a<e.length;){var u=e[a++];if(u.key===r&&(s===void 0||u.value===s))return!0}return!1},set:function(t,e){var n=Wt(this);Or(arguments.length,1);for(var r=n.entries,o=!1,s=Mt(t),a=Mt(e),u=0,l;u<r.length;u++)l=r[u],l.key===s&&(o?d6(r,u--,1):(o=!0,l.value=a));o||On(r,{key:s,value:a}),Gi||(this.size=r.length),n.updateURL()},sort:function(){var t=Wt(this);oF(t.entries,function(e,n){return e.key>n.key?1:-1}),t.updateURL()},forEach:function(t){for(var e=Wt(this).entries,n=QU(t,arguments.length>1?arguments[1]:void 0),r=0,o;r<e.length;)o=e[r++],n(o.value,o.key,this)},keys:function(){return new Pc(this,"keys")},values:function(){return new Pc(this,"values")},entries:function(){return new Pc(this,"entries")}},{enumerable:!0});b6(Dr,sF,Dr.entries,{name:"entries"});b6(Dr,"toString",function(){return Wt(this).serialize()},{enumerable:!0});Gi&&YU(Dr,"size",{get:function(){return Wt(this).entries.length},configurable:!0,enumerable:!0});KU(Ks,Ur);Lc({global:!0,constructor:!0,forced:!S6},{URLSearchParams:Ks});!S6&&Ac(ki)&&(y6=ge(p6.has),x6=ge(p6.set),Ic=function(i){if(w6(i)){var t=i.body,e;if(tF(t)===Ur)return e=i.headers?new ki(i.headers):new ki,y6(e,"content-type")||x6(e,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),nF(i,{body:l6(0,Mt(t)),headers:l6(0,e)})}return i},Ac(h6)&&Lc({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return h6(t,arguments.length>1?Ic(arguments[1]):{})}}),Ac(Zs)&&(js=function(t){return M6(this,Cc),new Zs(t,arguments.length>1?Ic(arguments[1]):{})},Cc.constructor=js,js.prototype=Cc,Lc({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:js})));var y6,x6,Ic,js;I6.exports={URLSearchParams:Ks,getState:Wt}});var Z6=m(()=>{"use strict";Lx();var SF=H(),Jc=$(),bF=Ec(),Qc=z(),L6=bn(),Zt=B(),ea=kt(),qt=Ge(),MF=Mi(),Zc=xt(),th=Bx(),Fr=Xx(),me=_i(),wF=is().codeAt,TF=e6(),an=Nt(),AF=dn(),CF=zi(),H6=Dc(),W6=Se(),RF=W6.set,na=W6.getterFor("URL"),PF=H6.URLSearchParams,IF=H6.getState,Vi=Qc.URL,Kc=Qc.TypeError,ra=Qc.parseInt,LF=Math.floor,N6=Math.pow,Yt=Zt("".charAt),ve=Zt(/./.exec),Wi=Zt([].join),NF=Zt(1 .toString),OF=Zt([].pop),zr=Zt([].push),Uc=Zt("".replace),DF=Zt([].shift),UF=Zt("".split),Xi=Zt("".slice),ia=Zt("".toLowerCase),FF=Zt([].unshift),BF="Invalid authority",Fc="Invalid scheme",tr="Invalid host",O6="Invalid port",q6=/[a-z]/i,zF=/[\d+-.a-z]/i,$c=/\d/,GF=/^0x/i,kF=/^[0-7]+$/,VF=/^\d+$/,X6=/^[\da-f]+$/i,HF=/[\0\t\n\r #%/:<>?@[\\\]^|]/,WF=/[\0\t\n\r #/:<>?@[\\\]^|]/,qF=/^[\u0000-\u0020]+/,XF=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,jF=/[\t\n\r]/g,Xt,YF=function(i){var t=UF(i,"."),e,n,r,o,s,a,u;if(t.length&&t[t.length-1]===""&&t.length--,e=t.length,e>4)return i;for(n=[],r=0;r<e;r++){if(o=t[r],o==="")return i;if(s=10,o.length>1&&Yt(o,0)==="0"&&(s=ve(GF,o)?16:8,o=Xi(o,s===8?1:2)),o==="")a=0;else{if(!ve(s===10?VF:s===8?kF:X6,o))return i;a=ra(o,s)}zr(n,a)}for(r=0;r<e;r++)if(a=n[r],r===e-1){if(a>=N6(256,5-e))return null}else if(a>255)return null;for(u=OF(n),r=0;r<n.length;r++)u+=n[r]*N6(256,3-r);return u},ZF=function(i){var t=[0,0,0,0,0,0,0,0],e=0,n=null,r=0,o,s,a,u,l,c,h,p=function(){return Yt(i,r)};if(p()===":"){if(Yt(i,1)!==":")return;r+=2,e++,n=e}for(;p();){if(e===8)return;if(p()===":"){if(n!==null)return;r++,e++,n=e;continue}for(o=s=0;s<4&&ve(X6,p());)o=o*16+ra(p(),16),r++,s++;if(p()==="."){if(s===0||(r-=s,e>6))return;for(a=0;p();){if(u=null,a>0)if(p()==="."&&a<4)r++;else return;if(!ve($c,p()))return;for(;ve($c,p());){if(l=ra(p(),10),u===null)u=l;else{if(u===0)return;u=u*10+l}if(u>255)return;r++}t[e]=t[e]*256+u,a++,(a===2||a===4)&&e++}if(a!==4)return;break}else if(p()===":"){if(r++,!p())return}else if(p())return;t[e++]=o}if(n!==null)for(c=e-n,e=7;e!==0&&c>0;)h=t[e],t[e--]=t[n+c-1],t[n+--c]=h;else if(e!==8)return;return t},KF=function(i){for(var t=null,e=1,n=null,r=0,o=0;o<8;o++)i[o]!==0?(r>e&&(t=n,e=r),n=null,r=0):(n===null&&(n=o),++r);return r>e?n:t},Hi=function(i){var t,e,n,r;if(typeof i=="number"){for(t=[],e=0;e<4;e++)FF(t,i%256),i=LF(i/256);return Wi(t,".")}if(typeof i=="object"){for(t="",n=KF(i),e=0;e<8;e++)r&&i[e]===0||(r&&(r=!1),n===e?(t+=e?":":"::",r=!0):(t+=NF(i[e],16),e<7&&(t+=":")));return"["+t+"]"}return i},ta={},j6=th({},ta,{" ":1,'"':1,"<":1,">":1,"`":1}),Y6=th({},j6,{"#":1,"?":1,"{":1,"}":1}),Bc=th({},Y6,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Dn=function(i,t){var e=wF(i,0);return e>32&&e<127&&!Zc(t,i)?i:encodeURIComponent(i)},$s={ftp:21,file:null,http:80,https:443,ws:80,wss:443},qi=function(i,t){var e;return i.length===2&&ve(q6,Yt(i,0))&&((e=Yt(i,1))===":"||!t&&e==="|")},D6=function(i){var t;return i.length>1&&qi(Xi(i,0,2))&&(i.length===2||(t=Yt(i,2))==="/"||t==="\\"||t==="?"||t==="#")},$F=function(i){return i==="."||ia(i)==="%2e"},JF=function(i){return i=ia(i),i===".."||i==="%2e."||i===".%2e"||i==="%2e%2e"},zc={},U6={},Gc={},F6={},B6={},kc={},z6={},G6={},Js={},Qs={},Vc={},Hc={},Wc={},qc={},k6={},Xc={},Br={},Ce={},V6={},er={},sn={},eh=function(i,t,e){var n=an(i),r,o,s;if(t){if(o=this.parse(n),o)throw new Kc(o);this.searchParams=null}else{if(e!==void 0&&(r=new eh(e,!0)),o=this.parse(n,null,r),o)throw new Kc(o);s=IF(new PF),s.bindURL(this),this.searchParams=s}};eh.prototype={type:"URL",parse:function(i,t,e){var n=this,r=t||zc,o=0,s="",a=!1,u=!1,l=!1,c,h,p,d;for(i=an(i),t||(n.scheme="",n.username="",n.password="",n.host=null,n.port=null,n.path=[],n.query=null,n.fragment=null,n.cannotBeABaseURL=!1,i=Uc(i,qF,""),i=Uc(i,XF,"$1")),i=Uc(i,jF,""),c=Fr(i);o<=c.length;){switch(h=c[o],r){case zc:if(h&&ve(q6,h))s+=ia(h),r=U6;else{if(t)return Fc;r=Gc;continue}break;case U6:if(h&&(ve(zF,h)||h==="+"||h==="-"||h==="."))s+=ia(h);else if(h===":"){if(t&&(n.isSpecial()!==Zc($s,s)||s==="file"&&(n.includesCredentials()||n.port!==null)||n.scheme==="file"&&!n.host))return;if(n.scheme=s,t){n.isSpecial()&&$s[n.scheme]===n.port&&(n.port=null);return}s="",n.scheme==="file"?r=qc:n.isSpecial()&&e&&e.scheme===n.scheme?r=F6:n.isSpecial()?r=G6:c[o+1]==="/"?(r=B6,o++):(n.cannotBeABaseURL=!0,zr(n.path,""),r=V6)}else{if(t)return Fc;s="",r=Gc,o=0;continue}break;case Gc:if(!e||e.cannotBeABaseURL&&h!=="#")return Fc;if(e.cannotBeABaseURL&&h==="#"){n.scheme=e.scheme,n.path=me(e.path),n.query=e.query,n.fragment="",n.cannotBeABaseURL=!0,r=sn;break}r=e.scheme==="file"?qc:kc;continue;case F6:if(h==="/"&&c[o+1]==="/")r=Js,o++;else{r=kc;continue}break;case B6:if(h==="/"){r=Qs;break}else{r=Ce;continue}case kc:if(n.scheme=e.scheme,h===Xt)n.username=e.username,n.password=e.password,n.host=e.host,n.port=e.port,n.path=me(e.path),n.query=e.query;else if(h==="/"||h==="\\"&&n.isSpecial())r=z6;else if(h==="?")n.username=e.username,n.password=e.password,n.host=e.host,n.port=e.port,n.path=me(e.path),n.query="",r=er;else if(h==="#")n.username=e.username,n.password=e.password,n.host=e.host,n.port=e.port,n.path=me(e.path),n.query=e.query,n.fragment="",r=sn;else{n.username=e.username,n.password=e.password,n.host=e.host,n.port=e.port,n.path=me(e.path),n.path.length--,r=Ce;continue}break;case z6:if(n.isSpecial()&&(h==="/"||h==="\\"))r=Js;else if(h==="/")r=Qs;else{n.username=e.username,n.password=e.password,n.host=e.host,n.port=e.port,r=Ce;continue}break;case G6:if(r=Js,h!=="/"||Yt(s,o+1)!=="/")continue;o++;break;case Js:if(h!=="/"&&h!=="\\"){r=Qs;continue}break;case Qs:if(h==="@"){a&&(s="%40"+s),a=!0,p=Fr(s);for(var g=0;g<p.length;g++){var v=p[g];if(v===":"&&!l){l=!0;continue}var _=Dn(v,Bc);l?n.password+=_:n.username+=_}s=""}else if(h===Xt||h==="/"||h==="?"||h==="#"||h==="\\"&&n.isSpecial()){if(a&&s==="")return BF;o-=Fr(s).length+1,s="",r=Vc}else s+=h;break;case Vc:case Hc:if(t&&n.scheme==="file"){r=Xc;continue}else if(h===":"&&!u){if(s==="")return tr;if(d=n.parseHost(s),d)return d;if(s="",r=Wc,t===Hc)return}else if(h===Xt||h==="/"||h==="?"||h==="#"||h==="\\"&&n.isSpecial()){if(n.isSpecial()&&s==="")return tr;if(t&&s===""&&(n.includesCredentials()||n.port!==null))return;if(d=n.parseHost(s),d)return d;if(s="",r=Br,t)return;continue}else h==="["?u=!0:h==="]"&&(u=!1),s+=h;break;case Wc:if(ve($c,h))s+=h;else if(h===Xt||h==="/"||h==="?"||h==="#"||h==="\\"&&n.isSpecial()||t){if(s!==""){var E=ra(s,10);if(E>65535)return O6;n.port=n.isSpecial()&&E===$s[n.scheme]?null:E,s=""}if(t)return;r=Br;continue}else return O6;break;case qc:if(n.scheme="file",h==="/"||h==="\\")r=k6;else if(e&&e.scheme==="file")switch(h){case Xt:n.host=e.host,n.path=me(e.path),n.query=e.query;break;case"?":n.host=e.host,n.path=me(e.path),n.query="",r=er;break;case"#":n.host=e.host,n.path=me(e.path),n.query=e.query,n.fragment="",r=sn;break;default:D6(Wi(me(c,o),""))||(n.host=e.host,n.path=me(e.path),n.shortenPath()),r=Ce;continue}else{r=Ce;continue}break;case k6:if(h==="/"||h==="\\"){r=Xc;break}e&&e.scheme==="file"&&!D6(Wi(me(c,o),""))&&(qi(e.path[0],!0)?zr(n.path,e.path[0]):n.host=e.host),r=Ce;continue;case Xc:if(h===Xt||h==="/"||h==="\\"||h==="?"||h==="#"){if(!t&&qi(s))r=Ce;else if(s===""){if(n.host="",t)return;r=Br}else{if(d=n.parseHost(s),d)return d;if(n.host==="localhost"&&(n.host=""),t)return;s="",r=Br}continue}else s+=h;break;case Br:if(n.isSpecial()){if(r=Ce,h!=="/"&&h!=="\\")continue}else if(!t&&h==="?")n.query="",r=er;else if(!t&&h==="#")n.fragment="",r=sn;else if(h!==Xt&&(r=Ce,h!=="/"))continue;break;case Ce:if(h===Xt||h==="/"||h==="\\"&&n.isSpecial()||!t&&(h==="?"||h==="#")){if(JF(s)?(n.shortenPath(),h!=="/"&&!(h==="\\"&&n.isSpecial())&&zr(n.path,"")):$F(s)?h!=="/"&&!(h==="\\"&&n.isSpecial())&&zr(n.path,""):(n.scheme==="file"&&!n.path.length&&qi(s)&&(n.host&&(n.host=""),s=Yt(s,0)+":"),zr(n.path,s)),s="",n.scheme==="file"&&(h===Xt||h==="?"||h==="#"))for(;n.path.length>1&&n.path[0]==="";)DF(n.path);h==="?"?(n.query="",r=er):h==="#"&&(n.fragment="",r=sn)}else s+=Dn(h,Y6);break;case V6:h==="?"?(n.query="",r=er):h==="#"?(n.fragment="",r=sn):h!==Xt&&(n.path[0]+=Dn(h,ta));break;case er:!t&&h==="#"?(n.fragment="",r=sn):h!==Xt&&(h==="'"&&n.isSpecial()?n.query+="%27":h==="#"?n.query+="%23":n.query+=Dn(h,ta));break;case sn:h!==Xt&&(n.fragment+=Dn(h,j6));break}o++}},parseHost:function(i){var t,e,n;if(Yt(i,0)==="["){if(Yt(i,i.length-1)!=="]"||(t=ZF(Xi(i,1,-1)),!t))return tr;this.host=t}else if(this.isSpecial()){if(i=TF(i),ve(HF,i)||(t=YF(i),t===null))return tr;this.host=t}else{if(ve(WF,i))return tr;for(t="",e=Fr(i),n=0;n<e.length;n++)t+=Dn(e[n],ta);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return Zc($s,this.scheme)},shortenPath:function(){var i=this.path,t=i.length;t&&(this.scheme!=="file"||t!==1||!qi(i[0],!0))&&i.length--},serialize:function(){var i=this,t=i.scheme,e=i.username,n=i.password,r=i.host,o=i.port,s=i.path,a=i.query,u=i.fragment,l=t+":";return r!==null?(l+="//",i.includesCredentials()&&(l+=e+(n?":"+n:"")+"@"),l+=Hi(r),o!==null&&(l+=":"+o)):t==="file"&&(l+="//"),l+=i.cannotBeABaseURL?s[0]:s.length?"/"+Wi(s,"/"):"",a!==null&&(l+="?"+a),u!==null&&(l+="#"+u),l},setHref:function(i){var t=this.parse(i);if(t)throw new Kc(t);this.searchParams.update()},getOrigin:function(){var i=this.scheme,t=this.port;if(i==="blob")try{return new Gr(i.path[0]).origin}catch(e){return"null"}return i==="file"||!this.isSpecial()?"null":i+"://"+Hi(this.host)+(t!==null?":"+t:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(i){this.parse(an(i)+":",zc)},getUsername:function(){return this.username},setUsername:function(i){var t=Fr(an(i));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var e=0;e<t.length;e++)this.username+=Dn(t[e],Bc)}},getPassword:function(){return this.password},setPassword:function(i){var t=Fr(an(i));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var e=0;e<t.length;e++)this.password+=Dn(t[e],Bc)}},getHost:function(){var i=this.host,t=this.port;return i===null?"":t===null?Hi(i):Hi(i)+":"+t},setHost:function(i){this.cannotBeABaseURL||this.parse(i,Vc)},getHostname:function(){var i=this.host;return i===null?"":Hi(i)},setHostname:function(i){this.cannotBeABaseURL||this.parse(i,Hc)},getPort:function(){var i=this.port;return i===null?"":an(i)},setPort:function(i){this.cannotHaveUsernamePasswordPort()||(i=an(i),i===""?this.port=null:this.parse(i,Wc))},getPathname:function(){var i=this.path;return this.cannotBeABaseURL?i[0]:i.length?"/"+Wi(i,"/"):""},setPathname:function(i){this.cannotBeABaseURL||(this.path=[],this.parse(i,Br))},getSearch:function(){var i=this.query;return i?"?"+i:""},setSearch:function(i){i=an(i),i===""?this.query=null:(Yt(i,0)==="?"&&(i=Xi(i,1)),this.query="",this.parse(i,er)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var i=this.fragment;return i?"#"+i:""},setHash:function(i){if(i=an(i),i===""){this.fragment=null;return}Yt(i,0)==="#"&&(i=Xi(i,1)),this.fragment="",this.parse(i,sn)},update:function(){this.query=this.searchParams.serialize()||null}};var Gr=function(t){var e=MF(this,wt),n=CF(arguments.length,1)>1?arguments[1]:void 0,r=RF(e,new eh(t,!1,n));Jc||(e.href=r.serialize(),e.origin=r.getOrigin(),e.protocol=r.getProtocol(),e.username=r.getUsername(),e.password=r.getPassword(),e.host=r.getHost(),e.hostname=r.getHostname(),e.port=r.getPort(),e.pathname=r.getPathname(),e.search=r.getSearch(),e.searchParams=r.getSearchParams(),e.hash=r.getHash())},wt=Gr.prototype,jt=function(i,t){return{get:function(){return na(this)[i]()},set:t&&function(e){return na(this)[t](e)},configurable:!0,enumerable:!0}};Jc&&(qt(wt,"href",jt("serialize","setHref")),qt(wt,"origin",jt("getOrigin")),qt(wt,"protocol",jt("getProtocol","setProtocol")),qt(wt,"username",jt("getUsername","setUsername")),qt(wt,"password",jt("getPassword","setPassword")),qt(wt,"host",jt("getHost","setHost")),qt(wt,"hostname",jt("getHostname","setHostname")),qt(wt,"port",jt("getPort","setPort")),qt(wt,"pathname",jt("getPathname","setPathname")),qt(wt,"search",jt("getSearch","setSearch")),qt(wt,"searchParams",jt("getSearchParams")),qt(wt,"hash",jt("getHash","setHash")));ea(wt,"toJSON",function(){return na(this).serialize()},{enumerable:!0});ea(wt,"toString",function(){return na(this).serialize()},{enumerable:!0});Vi&&(jc=Vi.createObjectURL,Yc=Vi.revokeObjectURL,jc&&ea(Gr,"createObjectURL",L6(jc,Vi)),Yc&&ea(Gr,"revokeObjectURL",L6(Yc,Vi)));var jc,Yc;AF(Gr,"URL");SF({global:!0,constructor:!0,forced:!bF,sham:!Jc},{URL:Gr})});var K6=m(()=>{"use strict";Z6()});var $6=m(()=>{"use strict";var QF=H(),tB=et();QF({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return tB(URL.prototype.toString,this)}})});var nh=m(()=>{"use strict";Dc()});var ih=m(()=>{"use strict";var eB=kt(),oa=B(),J6=Nt(),nB=zi(),t3=URLSearchParams,sa=t3.prototype,rB=oa(sa.append),Q6=oa(sa.delete),iB=oa(sa.forEach),oB=oa([].push),rh=new t3("a=1&a=2&b=3");rh.delete("a",1);rh.delete("b",void 0);rh+""!="a=2"&&eB(sa,"delete",function(i){var t=arguments.length,e=t<2?void 0:arguments[1];if(t&&e===void 0)return Q6(this,i);var n=[];iB(this,function(h,p){oB(n,{key:p,value:h})}),nB(t,1);for(var r=J6(i),o=J6(e),s=0,a=0,u=!1,l=n.length,c;s<l;)c=n[s++],u||c.key===r?(u=!0,Q6(this,c.key)):a++;for(;a<l;)c=n[a++],c.key===r&&c.value===o||rB(this,c.key,c.value)},{enumerable:!0,unsafe:!0})});var sh=m(()=>{"use strict";var sB=kt(),n3=B(),aB=Nt(),uB=zi(),r3=URLSearchParams,oh=r3.prototype,lB=n3(oh.getAll),cB=n3(oh.has),e3=new r3("a=1");(e3.has("a",2)||!e3.has("a",void 0))&&sB(oh,"has",function(t){var e=arguments.length,n=e<2?void 0:arguments[1];if(e&&n===void 0)return cB(this,t);var r=lB(this,t);uB(e,1);for(var o=aB(n),s=0;s<r.length;)if(r[s++]===o)return!0;return!1},{enumerable:!0,unsafe:!0})});var uh=m(()=>{"use strict";var hB=$(),pB=B(),fB=Ge(),ah=URLSearchParams.prototype,dB=pB(ah.forEach);hB&&!("size"in ah)&&fB(ah,"size",{get:function(){var t=0;return dB(this,function(){t++}),t},configurable:!0,enumerable:!0})});var i3=m(()=>{"use strict";var gB=Ln();gB("Int8",function(i){return function(e,n,r){return i(this,e,n,r)}})});var o3=m(()=>{"use strict";var mB=Ln();mB("Uint32",function(i){return function(e,n,r){return i(this,e,n,r)}})});var s3=m(()=>{"use strict";var vB=Ln();vB("Int16",function(i){return function(e,n,r){return i(this,e,n,r)}})});var a3=m(()=>{"use strict";var _B=Ln();_B("Int32",function(i){return function(e,n,r){return i(this,e,n,r)}})});var lh=m(()=>{"use strict";var yB=Ln();yB("Uint16",function(i){return function(e,n,r){return i(this,e,n,r)}})});var ga=m(()=>{"use strict";var fz=H(),dz=yt(),gz=dt(),mz=s0(),vz=J0(),_z=Lo(),yz=[].unshift(0)!==1,xz=function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(i){return i instanceof TypeError}},Ez=yz||!xz();fz({target:"Array",proto:!0,arity:1,forced:Ez},{unshift:function(t){var e=dz(this),n=gz(e),r=arguments.length;if(r){_z(n+r);for(var o=n;o--;){var s=o+r;o in e?e[s]=e[o]:vz(e,s)}for(var a=0;a<r;a++)e[a]=arguments[a]}return mz(e,n+r)}})});var k3=m((Ztt,G3)=>{"use strict";var Ek=z();G3.exports=Ek.Promise});var W3=m((Ktt,H3)=>{"use strict";var V3=mt(),Sk=Il(),bk=ri(),Mk=ot(),wk=Mk("species");H3.exports=function(i,t){var e=V3(i).constructor,n;return e===void 0||bk(n=V3(e)[wk])?t:Sk(n)}});var j3=m(($tt,X3)=>{"use strict";var q3=Ee(),Tk=TypeError,Ak=function(i){var t,e;this.promise=new i(function(n,r){if(t!==void 0||e!==void 0)throw new Tk("Bad Promise constructor");t=n,e=r}),this.resolve=q3(t),this.reject=q3(e)};X3.exports.f=function(i){return new Ak(i)}});var Z3=m((Jtt,Y3)=>{"use strict";var Ck=mt(),Rk=pt(),Pk=j3();Y3.exports=function(i,t){if(Ck(i),Rk(t)&&t.constructor===i)return t;var e=Pk.f(i),n=e.resolve;return n(t),e.promise}});var bh=m(()=>{"use strict";var Ik=H(),Lk=fn(),Ga=k3(),Nk=k(),$3=ee(),J3=J(),Ok=W3(),K3=Z3(),Dk=kt(),Sh=Ga&&Ga.prototype,Uk=!!Ga&&Nk(function(){Sh.finally.call({then:function(){}},function(){})});Ik({target:"Promise",proto:!0,real:!0,forced:Uk},{finally:function(i){var t=Ok(this,$3("Promise")),e=J3(i);return this.then(e?function(n){return K3(t,i()).then(function(){return n})}:i,e?function(n){return K3(t,i()).then(function(){throw n})}:i)}});!Lk&&J3(Ga)&&(Eh=$3("Promise").prototype.finally,Sh.finally!==Eh&&Dk(Sh,"finally",Eh,{unsafe:!0}));var Eh});var P1=m(()=>{"use strict";var RH=H(),PH=Li().findLastIndex,IH=pi();RH({target:"Array",proto:!0},{findLastIndex:function(t){return PH(this,t,arguments.length>1?arguments[1]:void 0)}});IH("findLastIndex")});var I1=m(()=>{"use strict";var LH=H(),NH=Li().findLast,OH=pi();LH({target:"Array",proto:!0},{findLast:function(t){return NH(this,t,arguments.length>1?arguments[1]:void 0)}});OH("findLast")});function S(){return S=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},S.apply(this,arguments)}var Ent=f(F(),1),Snt=f(A(),1),bnt=f(Hn(),1);import{Box3 as MV,EventDispatcher as wV,Sprite as Ah,Vector3 as Qa}from"three";var wet=f(A(),1);var lq=f(oe(),1),cq=f(se(),1),hq=f(ae(),1),pq=f(ue(),1),fq=f(le(),1),dq=f(ce(),1),gq=f(he(),1),mq=f(A(),1),Q=class{requestAnimationFrame(t){let e=window.requestAnimationFrame(()=>{this.tasks.requestAnimation.delete(e),t()});return this.tasks.requestAnimation.add(e),e}cancelAnimationFrame(t){this.tasks.requestAnimation.delete(t),window.cancelAnimationFrame(t)}setTimeout(t,e){let n=window.setTimeout(()=>{this.tasks.timeout.delete(n),t()},e);return this.tasks.timeout.add(n),n}clearTimeout(t){this.tasks.timeout.delete(t),window.clearTimeout(t)}setInterval(t,e){let n=window.setInterval(()=>{t()},e);return this.tasks.interval.add(n),n}clearInterval(t){this.tasks.interval.delete(t),window.clearInterval(t)}requestIdleCallback(t,e){let n=window.requestIdleCallback(r=>{this.tasks.requestIdleCallback.delete(n),t(r)},e);return this.tasks.requestIdleCallback.add(n),n}cancelIdleCallback(t){this.tasks.requestIdleCallback.delete(t),window.cancelIdleCallback(t)}dispose(){this.tasks.requestAnimation.forEach(t=>{window.cancelAnimationFrame(t)}),this.tasks.requestAnimation.clear(),this.tasks.requestIdleCallback.forEach(t=>{window.cancelIdleCallback(t)}),this.tasks.requestIdleCallback.clear(),this.tasks.timeout.forEach(t=>{window.clearTimeout(t)}),this.tasks.timeout.clear(),this.tasks.interval.forEach(t=>{window.clearInterval(t)}),this.tasks.interval.clear()}constructor(){this.tasks={requestAnimation:new Set,requestIdleCallback:new Set,timeout:new Set,interval:new Set}}};var _q=f(A(),1),yq=f(F(),1);import{Shape as eC,Group as nC,DirectionalLight as rC,AmbientLight as iC,Path as oC,Vector2 as um}from"three";function lm(){let i=new nC,t=new iC(16777215,2.6);return i.add(t),i}function Xo(i,t){t===void 0&&(t=[]);let e=new eC(i.map(n=>new um(...n)));return t.length&&t.forEach(n=>{var r=new oC(n.map(o=>new um(...o)));e.holes.push(r)}),e}function cm(i,t){i===void 0&&(i=16777215),t===void 0&&(t=1);let e=new rC(i,t);return e.castShadow=!0,e.shadow.radius=8,e.shadow.bias=-.001,e.shadow.mapSize.set(256,256),e.shadow.camera.left=-200,e.shadow.camera.right=200,e.shadow.camera.top=200,e.shadow.camera.bottom=-200,e}function W(i,t){if(t&&i.children&&i.children.length&&i.children.forEach(e=>{W(e,t)}),i.isMesh){let e=i;e.geometry&&e.geometry.dispose(),e.material&&(Array.isArray(e.material)?e.material.forEach(n=>{n.dispose()}):e.material.dispose())}i.isLight&&(i.dispose==null||i.dispose.call(i))}var Pq=f(Ot(),1);function Sm(i){return/[\u4E00-\u9FA5]+/g.test(i)}var Lq=f(A(),1);import{Vector3 as $o,Vector2 as Ue,Matrix3 as Ko}from"three";import{point as PC,featureCollection as IC,center as LC}from"@turf/turf";function O(i,t,e,n){let r=i.clone().project(t),o=e/2,s=n/2,a=Math.round(r.x*o+o),u=Math.round(-r.y*s+s);return{x:a,y:u}}function Dq(i,t,e,n,r){if(!r)return null;e=Math.min(1,e),n=Math.min(1,n);let o=i/e*2-1,s=1-t/n*2;return new $o(o,s,0).unproject(r)}function Jo(i){let t=IC(i.map(n=>PC(n)));return LC(t).geometry.coordinates}function xn(i,t,e){return i.x>=t.x&&i.x<=e.x&&i.y>=t.y&&i.y<=e.y}function Uq(i){let t=0,e=new $o;for(let n=1;n<i.length;n++){let r=new $o(i[n-1][0],i[n-1][1],0),o=new $o(i[n][0],i[n][1],0),s=o.distanceTo(r);s>t&&(t=s,e=o.clone().sub(r).normalize())}return e}function X(i,t){return Math.sqrt((t[0]-i[0])**2+(t[1]-i[1])**2)}function Tt(i){let t=0;for(let e=0;e<i.length-1;e++)t+=X(i[e],i[e+1]);return t}function Qo(i,t,e){let n=new Ue(t[0]-i[0],t[1]-i[1]),r=new Ue(t[0]-e[0],t[1]-e[1]),s=n.angleTo(r)*180/Math.PI,a=new Ue(t[0]-i[0],t[1]-i[1]);return new Ue(e[0]-i[0],e[1]-i[1]).cross(a)>0?s:-s}function Fq(i,t){let e=Math.min(X(i[0][0],i[0][1]),X(i[0][2],i[0][1]))-1;t||(t=Jo(i[0]));let n=NC(t,e),r=new Ue(i[0][0][0],i[0][0][1]),o=new Ue(i[0][1][0],i[0][1][1]),s=new Ue(i[0][2][0],i[0][2][1]),u=(r.distanceTo(o)>o.distanceTo(s)?o.clone().sub(r):s.clone().sub(o)).angleTo(new Ue(0,1)),l=new Ko;return l.multiply(new Ko().translate(t[0],t[1])).multiply(new Ko().rotate(u)).multiply(new Ko().translate(-t[0],-t[1])),[n.map(c=>{let h=new Ue(c[0],c[1]).applyMatrix3(l);return[h.x,h.y]})]}function NC(i,t){let e=t/2;return[[i[0]-e,i[1]+e],[i[0]+e,i[1]+e],[i[0]+e,i[1]-e],[i[0]-e,i[1]-e],[i[0]-e,i[1]+e]]}function Fe(i,t){let e=0,n=1/0,[r,o]=t;for(let s=0;s<i.length-1;s++){let[a,u]=i[s],[l,c]=i[s+1],h=Math.min(a,l)<=r&&r<=Math.max(a,l),p=Math.min(u,c)<=o&&o<=Math.max(u,c);if(h&&p){let d=Math.abs((l-a)*(o-u)-(c-u)*(r-a));d<n&&(n=d,e=s)}}return e}function bm(i,t){let e=i[0],n=i[1],r=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){let a=t[o][0],u=t[o][1],l=t[s][0],c=t[s][1];u>n!=c>n&&e<(l-a)*(n-u)/(c-u)+a&&(r=!r)}return r}var kq=f(Mm(),1);function vr(i,t){return new Proxy(i,{get:(e,n,r)=>Reflect.get(e,n,r),set:(e,n,r,o)=>{let s=Reflect.get(e,n,o),a=Reflect.set(e,n,r,o);return s!==r&&t.dispatchEvent({type:"change-"+n,value:r}),a}})}var Qq=f(A(),1),tX=f(B0(),1);function Vt(i,t){return Promise.race([i,new Promise((e,n)=>{setTimeout(()=>n(new Error("Promise timeout")),t)})])}function ns(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function Qm(i,t){let e=ns("svg");return e.setAttribute("width",i),e.setAttribute("height",t),e.style.cssText="position: absolute; left: 0; top: 0; pointer-events: none;",e}function xi(i,t){i===void 0&&(i="2");let e=ns("circle");return e.setAttribute("r",i),e.setAttribute("fill",t),e}function rs(i){let t=ns("line");return t.setAttribute("stroke",i),t}function En(i,t){let e=ns("rect");return e.setAttribute("stroke",i),e.setAttribute("fill",t),e}function qn(i,t,e){i.setAttribute("cx",""+t),i.setAttribute("cy",""+e)}function pe(i,t,e){t&&(i.setAttribute("x1",""+t.x),i.setAttribute("y1",""+t.y)),e&&(i.setAttribute("x2",""+e.x),i.setAttribute("y2",""+e.y))}function Et(i,t,e,n,r){i.setAttribute("x",""+t),i.setAttribute("y",""+e),i.setAttribute("width",""+n),i.setAttribute("height",""+r)}function tv(){return Promise.resolve()}function z0(){return new Promise(i=>{requestAnimationFrame(i)})}function ev(i){return i===void 0&&(i=1),new Promise(t=>{function e(){i<=0?t(!0):(i--,window.requestAnimationFrame(e))}window.requestAnimationFrame(e)})}var mX=f(Ei(),1),vX=f(Ot(),1),_X=f(ss(),1);function yX(i){return parseInt(i.replace("#","0x"),16)}function xX(i,t){let e=parseInt(i.substring(1,3),16),n=parseInt(i.substring(3,5),16),r=parseInt(i.substring(5,7),16),o=Math.round(e*t),s=Math.round(n*t),a=Math.round(r*t);return"#"+(1<<24|o<<16|s<<8|a).toString(16).slice(1)}function Be(i,t){t===void 0&&(t=.85);let e,n,r;if(i.startsWith("#"))e=parseInt(i.substring(1,3),16),n=parseInt(i.substring(3,5),16),r=parseInt(i.substring(5,7),16);else{let s=i.slice(4,-1).split(",");e=parseInt(s[0].trim()),n=parseInt(s[1].trim()),r=parseInt(s[2].trim())}return e=Math.min(Math.floor(e*t),255),n=Math.min(Math.floor(n*t),255),r=Math.min(Math.floor(r*t),255),"#"+((1<<24)+(e<<16)+(n<<8)+r).toString(16).slice(1)}function K0(i,t){i=i.replace(/^#/,"");let e=parseInt(i.substring(0,2),16),n=parseInt(i.substring(2,4),16),r=parseInt(i.substring(4,6),16);return t!==void 0?"rgba("+e+", "+n+", "+r+", "+t+")":"rgb("+e+", "+n+", "+r+")"}var SX=f(Ot(),1),yr=navigator.userAgent.toUpperCase().indexOf("MAC")>=0,Pv=(navigator.userAgent||"").toLocaleLowerCase(),Xn=/ios|iphone/i.test(Pv),bX=/android|adr|linux/gi.test(Pv);function xr(i){return yr?i==="Meta":i==="Control"}var AX=f(oe(),1),CX=f(se(),1),RX=f(ae(),1),PX=f(ue(),1),IX=f(le(),1),LX=f(ce(),1),NX=f(he(),1),OX=f(A(),1),$0="__once__",Iv=class{on(t,e){if(typeof e!="function")return;let n=this.events.get(t);return n?n.add(e):this.events.set(t,new Set([e]))}once(t,e){if(typeof e!="function")return;let n=""+$0+t,r=this.events.get(n);return r?r.add(e):this.events.set(n,new Set([e]))}off(t,e){let n=this.events.get(t),r=this.events.get(""+$0+t);!n&&!r||(e===void 0&&(n==null||n.clear(),r==null||r.clear()),n!=null&&n.has(e)&&n.delete(e),r!=null&&r.has(e)&&r.delete(e))}offAll(){this.events.clear()}emit(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];let o=this.events.get(t),s=this.events.get(""+$0+t);!o&&!s||(o==null||o.forEach(a=>{typeof a=="function"&&a(...n)}),s==null||s.forEach(a=>{typeof a=="function"&&a(...n)}),s==null||s.clear())}constructor(){this.events=new Map}};var vt=function(i){return i.SWITCH_FLOOR_BEFORE="switch_floor_before",i.SWITCH_FLOOR_GROUND="switch_floor_ground",i.SWITCH_FLOOR_AFTER="switch_floor_after",i}({});var qX=f(jn(),1);function Er(i){return Object.keys(i).sort().map(t=>t+"="+i[t]).join("&")}function jX(i,t){return new Promise((e,n)=>{let r=new XMLHttpRequest;r.open("GET",i,!0),Object.keys(t.headers||{}).forEach(o=>{r.setRequestHeader(o,t.headers[o])}),t.responseType&&(r.responseType=t.responseType),r.onload=()=>{if(r.status>=200&&r.status<300)if(t.responseType==="arraybuffer")e(r.response);else try{let o=JSON.parse(r.responseText);e(o)}catch(o){n(o)}else n(r.statusText)},r.onerror=()=>{n(r.statusText)},r.send()})}var $X=f(A(),1),JX=f(F(),1),n_=f(e_(),1);import{Vector2 as Si}from"three";function xP(i,t){let e=i.clone().normalize(),n=t.clone().normalize();return Math.acos(e.dot(n))}function EP(i){let t=0;return i.reduce((e,n)=>{let[r,o]=e,[s,a]=n;return t+=Math.sqrt((s-r)**2+(a-o)**2),[s,a]}),t/i.length}function r_(i,t){if(t===void 0&&(t=.25),EP(i)<t)return i;let e=(0,n_.default)(i);return r_(e,t)}function us(i,t,e,n,r,o){t===void 0&&(t=!1),e===void 0&&(e=!0),n===void 0&&(n=5),r===void 0&&(r=150),o===void 0&&(o=3);let s=[],a=!t;if(s.push(i[0]),i.length<2)return s;for(let l=0;l<i.length-2;l+=1){let c=i[l],h=i[l+1],p=i[l+2],d=new Si(c[0]-h[0],c[1]-h[1]),g=new Si(p[0]-h[0],p[1]-h[1]),v=xP(d,g)/Math.PI*180,_=d.length()+g.length();(!a||v<r&&_>.01||_>n)&&(s.push(i[l+1]),a=!0)}if(s.push(i[i.length-1]),!e)return s;let u=[];u.push(s[0]);for(let l=0;l<s.length-2;l+=1){let c=new Si(s[l][0],s[l][1]),h=new Si(s[l+1][0],s[l+1][1]),p=new Si(s[l+2][0],s[l+2][1]),d=c.distanceTo(h)/2,g=p.distanceTo(h)/2,v=h.clone(),_=h.clone();v.add(c.clone().sub(h).normalize().multiplyScalar(d>o?o/2:d)),_.add(p.clone().sub(h).normalize().multiplyScalar(g>o?o/2:g));let E=[[v.x,v.y],[h.x,h.y],[_.x,_.y]];u.push(...r_(E,o/25))}return u.push(s[s.length-1]),SP(u)}function SP(i){if(i.length<=1)return i;let t=[],e;return i.forEach(n=>{let[r,o]=n;e?r===e[0]&&o===e[1]||(e=[r,o],t.push([r,o])):(e=[r,o],t.push([r,o]))}),t}function i_(i,t,e){let n=Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2);if(n===0)return{distance:Math.sqrt((i[0]-t[0])**2+(i[1]-t[1])**2),closestPoint:t.slice(0)};let r=Math.max(0,Math.min(1,((i[0]-t[0])*(e[0]-t[0])+(i[1]-t[1])*(e[1]-t[1]))/n**2)),o=[t[0]+r*(e[0]-t[0]),t[1]+r*(e[1]-t[1])];return{distance:Math.sqrt((i[0]-o[0])**2+(i[1]-o[1])**2),closestPoint:o}}function e5(i,t,e){let[n,r]=i,[o,s]=t,a=Math.sqrt(Math.pow(o-n,2)+Math.pow(s-r,2));if(a===0||a<e)return[...t];let u=e/a,l=n+(o-n)*u,c=r+(s-r)*u;return[l,c]}var ze=function(i){return i.START="start",i.END="end",i.FRONT="front",i.RIGHT="right",i.LEFT="left",i.RIGHT_FRONT="right_front",i.LEFT_FRONT="left_front",i.RIGHT_BACK="right_back",i.LEFT_BACK="left_back",i}({});function il(i,t,e){let n=Qo(i,t,e);return ol(n)}function ol(i){return 180-Math.abs(i)<15?"front":i>135?"right_front":i<-135?"left_front":i<=135&&i>=60?"right":i>=-135&&i<=-60?"left":i<60&&i>0?"right_back":i>-60&&i<0?"left_back":"front"}function n5(i){if(!i.length)return[];if(i.length===1)return[{direction:"start",distance:0,points:i}];let t=[{direction:"start",distance:X(i[0],i[1]),points:[i[0],i[1]]}];for(let e=2;e<i.length;e++){let n=il(i[e-2],i[e-1],i[e]);if(n==="front"){let r=t[t.length-1],o=X(i[e-1],i[e]);r.distance+=o,e!==2&&r.points.push(i[e-1])}else t.push({direction:n,distance:X(i[e-1],i[e]),points:[i[e-1],i[e]]})}return t.push({direction:"end",distance:0,points:[i[i.length-1]]}),t}function o_(i,t){if(i.length<2)return-1;let e=0;for(let n=1;n<i.length;n++){let r=i[n-1],o=i[n],s=[t[0]-r[0],t[1]-r[1]],a=[o[0]-r[0],o[1]-r[1]],u=Math.min(o[0],r[0])<=t[0]&&t[0]<=Math.max(o[0],r[0]),l=Math.min(o[1],r[1])<=t[1]&&t[1]<=Math.max(o[1],r[1]);if(u&&l){let c=s[0]*a[1]-s[1]*a[0];if(Math.abs(c)<1e-6){let h=Math.sqrt((t[0]-r[0])**2+(t[1]-r[1])**2);return e+h}}e+=Math.sqrt((o[0]-r[0])**2+(o[1]-r[1])**2)}return-1}function Sr(i,t){if(i.length<2){var e;return(e=i[0])!=null?e:null}let n=0;for(let r=1;r<i.length;r++){let o=i[r-1],s=i[r],a=Math.sqrt((s[0]-o[0])**2+(s[1]-o[1])**2);if(n+=a,n>=t){let u=(t-(n-a))/a,l=o[0]+(s[0]-o[0])*u,c=o[1]+(s[1]-o[1])*u;return[l,c]}}return null}var c5=f(F(),1),h5=f(A(),1),p5=f(Ot(),1),Me=f(ul(),1);var Ht="___",x_=class{initRoute(t){this.clear(),this.roadInfo=t,t.length&&(t.forEach(e=>{e.points.forEach(n=>{let r=""+e.floor+Ht+n.id;if(this.pointMap.set(r,n),this.nodeMap.set(""+n.floor+Ht+n.nodeId,r),n.type==="straightLadder"){let o=this.straightLadderMap.get(n.name)||[];o.push(S({},n)),this.straightLadderMap.set(n.name,o)}if(n.type==="staircase"){let o=this.staircaseMap.get(n.name)||[];o.push(S({},n)),this.staircaseMap.set(n.name,o)}if(n.type==="escalator"){let o=this.escalatorMap.get(n.name)||{};n.escalatorDirection==="exit"?o.end={floor:n.floor,id:n.id}:o.start={floor:n.floor,id:n.id},this.escalatorMap.set(n.name,o)}if(n.type==="facility"){let o=this.facilityMap.get(n.targetId)||[];o.push(S({},n)),this.facilityMap.set(n.targetId,o)}}),e.lines.filter(n=>n.direction!=="no").forEach(n=>{var r,o;let s=""+e.floor+Ht+n.from,a=""+e.floor+Ht+n.to,u=(r=this.pointMap.get(s))==null?void 0:r.cds,l=(o=this.pointMap.get(a))==null?void 0:o.cds;if(u!=null&&u.length&&(l!=null&&l.length)){let c=X(u,l);this.addLineItem(s,a,c),n.direction==="double"&&this.addLineItem(a,s,c)}})}),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute())}addLineItem(t,e,n,r){r===void 0&&(r=this.lineMap);let o=r.get(t)||new Map;o.set(e,n),r.set(t,o)}addFacilityToLineMap(t,e,n,r){[...this.straightLadderMap,...this.staircaseMap].forEach(o=>{let[s,a]=o;if(!(a.length<2))for(let c=0;c<a.length;c++){let h=""+a[c].floor+Ht+a[c].id;for(let p=0;p<a.length;p++)if(c!==p){var u,l;let d=""+a[p].floor+Ht+a[p].id,g=(u=this.pointMap.get(h))==null?void 0:u.cds,v=(l=this.pointMap.get(d))==null?void 0:l.cds;if(g!=null&&g.length&&(v!=null&&v.length))if(a[c].type==="straightLadder"){let _=e;this.addLineItem(h,d,_,r)}else{let _=n;this.addLineItem(h,d,_,r)}}}}),this.escalatorMap.forEach((o,s)=>{if(o.start&&o.end){var a,u;let l=""+o.start.floor+Ht+o.start.id,c=""+o.end.floor+Ht+o.end.id,h=(a=this.pointMap.get(l))==null?void 0:a.cds,p=(u=this.pointMap.get(c))==null?void 0:u.cds;if(h!=null&&h.length&&(p!=null&&p.length)){let d=t;this.addLineItem(l,c,d,r)}}})}initBaseRoute(){let t=new Map([...this.lineMap]);this.addFacilityToLineMap(1,this.lift_priority,3e4,t),this.baseRoute=new Me.default(t)}initEscalatorRoute(){let t=new Map([...this.lineMap]),e=1e4;this.addFacilityToLineMap(1*e,this.lift_priority*e,3e4*e,t),this.escalatorRoute=new Me.default(t)}initStraightLadderRoute(){let t=new Map([...this.lineMap]),e=1e4;this.addFacilityToLineMap(3*e,1*e,3e4*e,t),this.straightLadderRoute=new Me.default(t)}checkStart(t){return!(!t.floor||!t.nodeId&&(!t.coord||t.coord.length<2))}checkEnd(t){return t.facility?!0:this.checkStart(t)}transformStart(t){var e;if(t.nodeId){let n=this.nodeMap.get(""+t.floor+Ht+t.nodeId);if(n){let[r,o]=n.split(Ht);return{floor:r,id:o}}}if((e=t.coord)!=null&&e.length){let n=this.roadInfo.find(o=>o.floor===t.floor);if(!n)return null;let r=n.points.reduce((o,s)=>{let a=X(t.coord,s.cds);return a<o.min&&(o.min=a,o.point=s),o},{min:1/0,point:n.points[0]});return{floor:r.point.floor,id:r.point.id}}return null}transformEnd(t){if(t.floor){let e=this.transformStart(t);if(e)return e}if(t.facility){let e=this.facilityMap.get(t.facility);if(e!=null&&e.length)return{floor:t.floor,facility:t.facility}}return null}getPath(t,e,n){if(n===void 0&&(n=""),!this.checkStart(t))return"start-error";if(!this.checkEnd(e))return"end-error";let r=this.transformStart(t);if(!r)return"no-start";let o=this.transformEnd(e);if(!o)return"no-end";let s=this.getBasePath.bind(this);switch(n){case"escalator":s=this.getEscalatorPath.bind(this);break;case"straightLadder":s=this.getStraightLadderPath.bind(this);break;default:s=this.getBasePath.bind(this);break}if(o.id)return s(r,o);if(o.facility){let a=this.facilityMap.get(o.facility).filter(l=>o.floor?l.floor===o.floor:!0);if(!a.length)return null;let u=a.map(l=>s(r,{floor:l.floor,id:l.id})).filter(l=>!!l);return u.reduce((l,c)=>{let h=c.reduce((p,d)=>p+Tt(d.points),0);return h<l.distance&&(l.distance=h,l.path=c),l},{distance:1/0,path:u[0]}).path}}getRoutePath(t,e,n){let r=""+t.floor+Ht+t.id,o=""+e.floor+Ht+e.id,s=n.path(r,o);if(!s)return null;let a=[];return s.map(u=>{let l=this.pointMap.get(u);if(l){var c;let{floor:h}=l;if(((c=a[a.length-1])==null?void 0:c.floor)===h){let p=a[a.length-1];p.points.push(l.cds),p.endType=l.type,p.destId=l.nodeId,p.distance=Tt(p.points)}else a.push({floor:h,points:[l.cds],endType:l.type,destId:l.nodeId,distance:0})}}),a}getBasePath(t,e){return this.getRoutePath(t,e,this.baseRoute)}getEscalatorPath(t,e){return this.getRoutePath(t,e,this.escalatorRoute)}getStraightLadderPath(t,e){return this.getRoutePath(t,e,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 Me.default,this.escalatorRoute=new Me.default,this.straightLadderRoute=new Me.default}constructor(t=3){this.lift_priority=t,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 Me.default,this.escalatorRoute=new Me.default,this.straightLadderRoute=new Me.default}};var T5=f(A(),1),A5=f(Ot(),1),C5=f(F(),1),R5=f(oe(),1),P5=f(se(),1),I5=f(ae(),1),L5=f(ue(),1),N5=f(le(),1),O5=f(ce(),1),D5=f(he(),1),U5=f(hs(),1),F5=f(ps(),1),gt=f(ul(),1);import{cloneDeep as Mn,isNil as fs}from"lodash";import{Vector2 as hl}from"three";var G="___",F_=class{isFacilityByType(t){return["facility","escalator","straightLadder","staircase","ramp","connectionPoint"].includes(t)}initFacilities(t){this.facilities=t.map(e=>{let n=[];try{n=JSON.parse(e.entry_end_floor)}catch(o){n=[]}let r=[];try{r=JSON.parse(e.entry_start_floor)}catch(o){r=[]}return S({},e,{entry_start_floor:r,entry_end_floor:n})})}getParkingSpaceInfo(t,e){let n=""+t+G+e;var r;return(r=this.parkingMap.get(n))!=null?r:null}getNodeInfo(t,e){let n=""+t+G+e,r=this.nodeMap.get(n);if(!(r!=null&&r.length))return null;let o=this.pointMap.get(r[0]);return o!=null?o:null}initRoute(t,e){this.clear(),this.roadInfo=t,this.initFacilities(e);let n=new Date,r=n.getHours()*60+n.getMinutes();t.length&&(t.forEach(o=>{let s=(o.points||[]).filter(a=>!fs(a.passWeight)&&a.passWeight!==1&&!fs(a.coverageArea)&&a.coverageArea!==0);(o.points||[]).filter(a=>a.openStatus!==!1).filter(a=>{if(!a.startTime||!a.endTime)return!0;let[u,l]=a.startTime.split(":").map(g=>+g),[c,h]=a.endTime.split(":").map(g=>+g),p=u*60+l,d=c*60+h;return r>=p&&r<=d}).forEach(a=>{a.floor=o.floor;let u=""+o.floor+G+a.id,l=""+o.floor+G+a.nodeId,c=this.nodeMap.get(l)||[];if(c.push(""+o.floor+G+(a.relatedId||a.id)),this.nodeMap.set(""+o.floor+G+a.nodeId,c),this.pointMap.set(u,a),this.isFacilityByType(a.type)){let h=this.facilities.find(p=>p.id===+a.targetId);if(h){switch(h.entry_infra_type){case"straightLadder":if(h.entry_end_floor.find(v=>v.floor===o.floor)&&h.entry_start_floor.find(v=>v.floor===o.floor)){let v=this.straightLadderMap.get(a.targetId)||[];v.push(S({},a)),this.straightLadderMap.set(a.targetId,v)}break;case"staircase":if(h.entry_end_floor.find(v=>v.floor===o.floor)&&h.entry_start_floor.find(v=>v.floor===o.floor)){let v=this.staircaseMap.get(a.targetId)||[];v.push(S({},a)),this.staircaseMap.set(a.targetId,v)}break;case"escalator":let d=this.escalatorMap.get(a.targetId)||[];if(h.entry_start_floor.find(v=>v.floor===o.floor)){let v=d.find(_=>{var E;return((E=_.end)==null?void 0:E.floor)!==o.floor&&!_.start});v?v.start=a:d.push({start:a})}if(h.entry_end_floor.find(v=>v.floor===o.floor)){let v=d.find(_=>{var E;return((E=_.start)==null?void 0:E.floor)!==o.floor&&!_.end});v?v.end=a:d.push({end:a})}this.escalatorMap.set(a.targetId,d);break;case"ramp":let g=this.rampMap.get(a.targetId)||[];if(h.entry_start_floor.find(v=>v.floor===o.floor)){let v=g.find(_=>{var E;return((E=_.end)==null?void 0:E.floor)!==o.floor&&!_.start});v?v.start=a:g.push({start:a})}if(h.entry_end_floor.find(v=>v.floor===o.floor)){let v=g.find(_=>{var E;return((E=_.start)==null?void 0:E.floor)!==o.floor&&!_.end});v?v.end=a:g.push({end:a})}this.rampMap.set(a.targetId,g);break;case"connectionPoint":if(h.entry_end_floor.find(v=>v.floor===o.floor)&&h.entry_start_floor.find(v=>v.floor===o.floor)){let v=this.connectionPointMap.get(a.targetId)||[];v.push(S({},a)),this.connectionPointMap.set(a.targetId,v)}break}let p=this.facilityMap.get(a.targetId)||[];p.push(S({},a)),this.facilityMap.set(a.targetId,p)}}a.type==="parkingSpace"&&a.name.split(/[,,]/).forEach(p=>{this.parkingMap.set(""+o.floor+G+p,a)})}),(o.lines||[]).filter(a=>a.to!==a.from).forEach(a=>{let u=""+o.floor+G+a.from,l=""+o.floor+G+a.to,c=this.pointMap.get(u),h=this.pointMap.get(l);if(!c||!h)return;let p=c.cds,d=h.cds,g=X(p,d);if(s.forEach(v=>{(v.id===a.from||v.id===a.to)&&(g=g/v.passWeight);let _=X(p,v.cds)<=v.coverageArea,E=X(d,v.cds)<=v.coverageArea;(_||E)&&(g=g/v.passWeight)}),!c.permission&&!h.permission){switch(this.addLineItem(u,l,g),this.addLineItem(l,u,g),a.direction){case"double":this.addLineItem(u,l,g,this.forwardLineMap),this.addLineItem(l,u,g,this.forwardLineMap);break;case"single":this.addLineItem(u,l,g,this.forwardLineMap);break;case"back":this.addLineItem(l,u,g,this.forwardLineMap);break}(c.type==="parkingSpace"||h.type==="parkingSpace")&&a.direction==="noDir"&&(this.addLineItem(u,l,g,this.forwardLineMap),this.addLineItem(l,u,g,this.forwardLineMap))}else c.permission&&(this.setPermissionLine(u,l,c.permission,g,""),this.setPermissionLine(l,u,c.permission,g,"")),h.permission&&h.permission!==c.permission&&(this.setPermissionLine(u,l,h.permission,g,""),this.setPermissionLine(l,u,h.permission,g,""))})}),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,n,r,o){this.getPermissionMap(n).add({fromKey:t,toKey:e,distance:r,type:o})}addPermissionFacility(){this.straightLadderMap.forEach((t,e)=>{if(t.length<2){this.straightLadderMap.delete(e);return}for(let n=0;n<t.length;n++){let r=""+t[n].floor+G+t[n].id,o=this.pointMap.get(r);if(o){for(let s=0;s<t.length;s++)if(n!==s){let a=""+t[s].floor+G+t[s].id,u=this.pointMap.get(a);if(!u)continue;o.permission&&this.setPermissionLine(r,a,o.permission,1,"straightLadder"),u.permission&&u.permission!==o.permission&&this.setPermissionLine(r,a,u.permission,1,"straightLadder")}}}}),this.staircaseMap.forEach((t,e)=>{if(t.length<2){this.staircaseMap.delete(e);return}for(let n=0;n<t.length;n++){let r=""+t[n].floor+G+t[n].id,o=this.pointMap.get(r);if(o){for(let s=0;s<t.length;s++)if(n!==s){let a=""+t[s].floor+G+t[s].id,u=this.pointMap.get(a);if(!u)continue;o.permission&&this.setPermissionLine(r,a,o.permission,1,"staircase"),u.permission&&u.permission!==o.permission&&this.setPermissionLine(r,a,u.permission,1,"staircase")}}}}),this.escalatorMap.forEach((t,e)=>{t.forEach(n=>{if(n.start&&n.end){let r=""+n.start.floor+G+n.start.id,o=""+n.end.floor+G+n.end.id,s=this.pointMap.get(r),a=this.pointMap.get(o);s&&a&&(s.permission&&this.setPermissionLine(r,o,s.permission,1,"escalator"),a.permission&&a.permission!==s.permission&&this.setPermissionLine(r,o,a.permission,1,"escalator"))}})}),this.rampMap.forEach((t,e)=>{t.forEach(n=>{if(n.start&&n.end){let r=""+n.start.floor+G+n.start.id,o=""+n.end.floor+G+n.end.id,s=this.pointMap.get(r),a=this.pointMap.get(o);s&&a&&(s.permission&&this.setPermissionLine(r,o,s.permission,10,"ramp"),a.permission&&a.permission!==s.permission&&this.setPermissionLine(r,o,a.permission,10,"ramp"))}})}),this.connectionPointMap.forEach((t,e)=>{if(t.length<2){this.connectionPointMap.delete(e);return}for(let n=0;n<t.length;n++){let r=""+t[n].floor+G+t[n].id,o=this.pointMap.get(r);if(o){for(let s=0;s<t.length;s++)if(n!==s){let a=""+t[s].floor+G+t[s].id,u=this.pointMap.get(a);if(!u)continue;o.permission&&this.setPermissionLine(r,a,o.permission,1,"connectionPoint"),u.permission&&u.permission!==o.permission&&this.setPermissionLine(r,a,u.permission,1,"connectionPoint")}}}})}addPermissionLineToMap(t,e,n,r){this.getPermissionMap(t).forEach(s=>{e.includes(s.type)&&(s.type===""?this.addLineItem(s.fromKey,s.toKey,s.distance,n):this.addLineItem(s.fromKey,s.toKey,r.get(s.type),n))})}addLineItem(t,e,n,r){r===void 0&&(r=this.lineMap);let o=r.get(t)||new Map;o.set(e,n),r.set(t,o)}addFacilityToLineMap(t,e,n,r){[...this.straightLadderMap,...this.staircaseMap].forEach(o=>{let[s,a]=o;if(!(a.length<2))for(let u=0;u<a.length;u++){let l=""+a[u].floor+G+a[u].id,c=this.pointMap.get(l);if(!(!c||c.permission)){for(let h=0;h<a.length;h++)if(u!==h){let p=""+a[h].floor+G+a[h].id,d=this.pointMap.get(p);if(!d||d.permission)continue;if(a[u].type==="straightLadder"){let g=e;this.addLineItem(l,p,g,r)}else{let g=n;this.addLineItem(l,p,g,r)}}}}}),this.escalatorMap.forEach((o,s)=>{o.forEach(a=>{if(a.start&&a.end){let u=""+a.start.floor+G+a.start.id,l=""+a.end.floor+G+a.end.id,c=this.pointMap.get(u),h=this.pointMap.get(l);if(c&&h&&!c.permission&&!h.permission){let p=t;this.addLineItem(u,l,p,r)}}})}),this.connectionPointMap.forEach((o,s)=>{if(!(o.length<2))for(let a=0;a<o.length;a++){let u=""+o[a].floor+G+o[a].id,l=this.pointMap.get(u);if(!(!l||l.permission)){for(let c=0;c<o.length;c++)if(a!==c){let h=""+o[c].floor+G+o[c].id,p=this.pointMap.get(h);if(!p||p.permission)continue;this.addLineItem(u,h,100,r)}}}})}initBaseRoute(){let t=new Map(Mn([...this.lineMap]));this.addFacilityToLineMap(100,100+this.lift_priority,3e4,t),this.baseRoute=new gt.default(t)}initEscalatorRoute(){let t=new Map(Mn([...this.lineMap])),e=1e4;this.addFacilityToLineMap(1*e,this.lift_priority*e,3e4*e,t),this.escalatorRoute=new gt.default(t)}initStraightLadderRoute(){let t=new Map(Mn([...this.lineMap])),e=1e4;this.addFacilityToLineMap(3*e,1*e,3e4*e,t),this.straightLadderRoute=new gt.default(t)}initForwardRoute(){this.rampMap.forEach((t,e)=>{t.forEach(n=>{if(n.start&&n.end){let r=""+n.start.floor+G+n.start.id,o=""+n.end.floor+G+n.end.id,s=this.pointMap.get(r),a=this.pointMap.get(o);s&&a&&!s.permission&&!a.permission&&this.addLineItem(r,o,10,this.forwardLineMap)}})}),this.connectionPointMap.forEach((t,e)=>{if(!(t.length<2))for(let n=0;n<t.length;n++){let r=""+t[n].floor+G+t[n].id,o=this.pointMap.get(r);if(!(!o||o.permission)){for(let s=0;s<t.length;s++)if(n!==s){let a=""+t[s].floor+G+t[s].id,u=this.pointMap.get(a);if(!u||u.permission)continue;this.addLineItem(r,a,100,this.forwardLineMap)}}}}),this.forwardRoute=new gt.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,n){n===void 0&&(n={});var r;if(t.nodeId){let o=this.nodeMap.get(""+t.floor+G+t.nodeId);if(o!=null&&o.length)return o.map(s=>{let[a,u]=s.split(G);return{floor:a,id:u}})}if((r=t.coord)!=null&&r.length){let o=this.roadInfo.find(l=>l.floor===t.floor);if(!o)return null;let s=o.points.filter(l=>l.isStarted),a=o.points.filter(l=>{let c=""+l.floor+G+l.id;if(e==="forward"){if(!this.forwardLineMap.has(c)||n.adsorptionIntersection&&s.length&&!l.isStarted)return!1}else if(!this.lineMap.has(c))return!1;return!0});if(!a.length)return null;let u=a.reduce((l,c)=>{if(c.relatedId)return l;let h=X(t.coord,c.cds);return h<l.min&&(l.min=h,l.point=c),l},{min:1/0,point:a[0]});return[{floor:o.floor,id:u.point.id}]}return null}transformEnd(t,e){if(t.floor){if(t.parkingSpace){let r=this.parkingMap.get(""+t.floor+G+t.parkingSpace);if(r)return[{floor:t.floor,id:r.id}]}let n=this.transformStart(t,e);if(n)return n}if(t.facility){let r=this.facilities.filter(o=>+o.type_id==+t.facility).map(o=>o.id).map(o=>this.facilityMap.get(""+o)).flat(2);if(r!=null&&r.length)return{floor:t.floor,facility:t.facility}}return null}getPath(t,e,n,r,o,s){if(n===void 0&&(n=""),s===void 0&&(s={}),!this.checkStart(t))return"start-error";if(!this.checkEnd(e))return"end-error";let a=this.transformStart(t,n,s);if(!a)return"no-start";let u=this.transformEnd(e,n);if(!u)return"no-end";let l=[];if(Array.isArray(u))for(let p=0;p<a.length;p++){let d=a[p];for(let g=0;g<u.length;g++){let v=u[g];if(d.floor===v.floor&&d.id===v.id)return"near"}}else{l=this.facilities.filter(d=>+d.type_id==+e.facility).map(d=>d.id).map(d=>this.facilityMap.get(""+d)).flat(2).filter(d=>d).filter(d=>u.floor?d.floor===u.floor:!0);for(let d=0;d<a.length;d++){let g=a[d];for(let v=0;v<l.length;v++){let _=l[v];if(g.floor===_.floor&&g.id===_.id)return"near"}}}let c;switch(n){case"escalator":c=this.getEscalatorPath.bind(this);break;case"straightLadder":c=this.getStraightLadderPath.bind(this);break;case"forward":c=this.getForwardPath.bind(this);break;default:c=this.getBasePath.bind(this);break}let h=null;return a.forEach(p=>{if(Array.isArray(u))u.forEach(d=>{let g=c(p,d,r,o);g&&g&&(!h||g[0].consume<h[0].consume)&&(h=g)});else{if(!l.length)return null;let d=l.map(g=>c(p,{floor:g.floor,id:g.id},r,o)).filter(g=>!!g);h=d.reduce((g,v)=>{let _=v[0].consume;return _<g.distance&&(g.distance=_,g.path=v),g},{distance:1/0,path:d[0]}).path}}),h}getRoutePath(t,e,n){let r=""+t.floor+G+t.id,o=""+e.floor+G+e.id,s=n.path(r,o);if(!s)return null;let a=[],u=s.reduce((l,c,h,p)=>{if(h===0)return 0;let d=p[h-1],g=n.graph.get(d).get(c);return l+g},0);return s.map(l=>{let c=this.pointMap.get(l);if(c){var h;let{floor:p}=c,d=c.type;if(this.isFacilityByType(c.type)){let g=this.facilities.find(v=>v.id===+c.targetId);g&&(d=g.entry_infra_type)}if(((h=a[a.length-1])==null?void 0:h.floor)===p){let g=a[a.length-1];g.points.push(c.cds),g.pointInfos.push(c),g.endType=d,g.destId=c.nodeId,g.distance=Tt(g.points)}else a.push({floor:p,points:[c.cds],pointInfos:[c],endType:d,destId:c.nodeId,distance:0,consume:u})}}),a}getBasePath(t,e,n){if(!n)return this.getRoutePath(t,e,this.baseRoute);let r=Mn(this.baseRoute.graph);this.addPermissionLineToMap(n,["","escalator","staircase","straightLadder","connectionPoint"],r,new Map([["escalator",100],["connectionPoint",100],["straightLadder",100+this.lift_priority],["staircase",3e4]]));let o=new gt.default(r);return this.getRoutePath(t,e,o)}getEscalatorPath(t,e,n){if(!n)return this.getRoutePath(t,e,this.escalatorRoute);let r=Mn(this.escalatorRoute.graph),o=1e4;this.addPermissionLineToMap(n,["","escalator","staircase","straightLadder","connectionPoint"],r,new Map([["escalator",1*o],["connectionPoint",100],["straightLadder",this.lift_priority*o],["staircase",3e4*o]]));let s=new gt.default(r);return this.getRoutePath(t,e,s)}getStraightLadderPath(t,e,n){if(!n)return this.getRoutePath(t,e,this.straightLadderRoute);let r=Mn(this.straightLadderRoute.graph),o=1e4;this.addPermissionLineToMap(n,["","escalator","staircase","straightLadder","connectionPoint"],r,new Map([["escalator",3*o],["connectionPoint",100],["straightLadder",1*o],["staircase",3e4*o]]));let s=new gt.default(r);return this.getRoutePath(t,e,s)}getForwardPath(t,e,n,r){let o=new Map,s=p=>{let d=this.forwardRoute.graph.get(u);p.forEach(g=>{let v=d.get(g);fs(v)||(o.set(g,v),d.delete(g))})},a=()=>{let p=this.forwardRoute.graph.get(u);o.forEach((d,g)=>{p.set(g,d)})},u=""+t.floor+G+t.id;if(!fs(r)){let p=this.forwardLineMap.get(u),d=this.pointMap.get(u);if(d&&(p!=null&&p.size)&&p.size>1){let g=new hl(d.cds[0],d.cds[1]),v=new Map;p.forEach((E,b)=>{let w=this.pointMap.get(b);if(w){let P=new hl(w.cds[0],w.cds[1]),U=360-(new hl().subVectors(P,g).angle()/Math.PI*180-90+360)%360;v.set(b,U)}});let _=Array.from(v).filter(E=>{let[b,w]=E;return Math.abs(w-r)<=60}).map(E=>{let[b]=E;return b});if(_.length)_.forEach(E=>v.delete(E)),s([...v.keys()]);else{let E=Array.from(v).reduce((b,w)=>{let P=Math.abs(w[1]-r);return P<b.diff?{diff:P,key:w[0]}:b},{diff:1/0,key:""});v.delete(E.key),s([...v.keys()])}}}if(!n){let p=this.getRoutePath(t,e,this.forwardRoute);return a(),p||this.getRoutePath(t,e,this.forwardRoute)}let l=Mn(this.forwardRoute.graph);this.addPermissionLineToMap(n,["","ramp"],l,new Map([["ramp",10]]));let c=new gt.default(l),h=this.getRoutePath(t,e,c);if(a(),h)return h;{let p=Mn(this.forwardRoute.graph);this.addPermissionLineToMap(n,["","ramp"],p,new Map([["ramp",10]]));let d=new gt.default(p);return this.getRoutePath(t,e,d)}}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 gt.default,this.escalatorRoute=new gt.default,this.straightLadderRoute=new gt.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 gt.default,this.escalatorRoute=new gt.default,this.straightLadderRoute=new gt.default,this.forwardLineMap=new Map,this.forwardRoute=new gt.default}};var V5=f(oe(),1),H5=f(se(),1),W5=f(ae(),1),q5=f(ue(),1),X5=f(le(),1),j5=f(ce(),1),Y5=f(he(),1),Z5=f(A(),1),wn=class{static createKey(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}static genUniqueKey(){let t=this.createKey();for(;this.keySet.has(t);)t=this.createKey();return t}static removeKey(t){this.keySet.delete(t)}static dispose(){this.keySet.clear()}};wn.keySet=new Set;var $5=f(Ei(),1),J5=f(Ot(),1);function B_(i){return i.replace(/[A-Z]/g,t=>"_"+t.toLowerCase()).replace(/^_/,"")}function tt(i,t,e){return new Promise((n,r)=>{let o=wn.genUniqueKey(),s=a=>{let{data:u}=a;u.type===""+t+"_result"&&u.key===o&&(wn.removeKey(o),self.removeEventListener("message",s),u.error?r(u.error):n(u.data))};i.addEventListener("message",s),i.postMessage({type:t,key:o,data:e})})}function nj(i){let t={};for(let n in i)n.startsWith("on")&&(t[B_(n.slice(2))]=i[n]);let e=n=>y(this,null,function*(){let{data:r}=n;if(t[r.type])try{let o=yield t[r.type](r.data);if(o!=null&&o.$transfer&&Array.isArray(o.$transfer)){let s=o.$transfer;delete o.$transfer,self.postMessage({type:""+r.type+"_result",key:r.key,data:o},s)}else self.postMessage({type:""+r.type+"_result",key:r.key,data:o})}catch(o){self.postMessage({type:""+r.type+"_result",key:r.key,error:o})}else self.postMessage({type:""+r.type+"_result",key:r.key,error:"no_event"})});return self.addEventListener("message",e),()=>{self.removeEventListener("message",e)}}import{BoxGeometry as tI,BufferGeometry as eI,Line as nI,LineBasicMaterial as z_,Mesh as rI}from"three";function sj(i,t){t===void 0&&(t=16711680);let e=new z_({color:t}),n=new eI().setFromPoints(i);return new nI(n,e)}function aj(i,t){t===void 0&&(t=16711680);let e=new z_({color:t}),n=new tI(1,1,1),r=new rI(n,e);return r.position.copy(i),r}var lj=f(Hn(),1),cj=f(A(),1);function ds(i,t,e){e===void 0&&(e=0),i.forEach(n=>{if(n.geometry.coords=JSON.parse(JSON.stringify(n.geometry.cds)),n.geometry.type==="polygon"){var r;n.geometry.coords.map(o=>{Array.isArray(o)&&o.forEach(s=>{s[0]-=t[0],s[1]-=t[1]})}),n.geometry.otherCds&&(n.geometry.otherCoords=n.geometry.otherCds.map(o=>o.map(s=>br(s,t)))),(r=n.doors)!=null&&r.length&&n.doors.map(o=>{o.coord=br(o.coordinate,t)}),n.center&&(n.centerCoords=br(n.center,t))}else n.geometry.coords=br(n.geometry.cds,t),n.center&&(n.centerCoords=br(n.center,t));if(n.center_x&&n.center_y){let[o,s]=br([n.center_x,n.center_y],t);n.center_coord_x=o,n.center_coord_y=s}});for(let n=0;n<i.length;n++){let r=i[n];r.deltaHeight=1e-5*(e+n+1)}}function br(i,t){return[i[0]-t[0],i[1]-t[1]]}var pj=f(oe(),1),fj=f(se(),1),dj=f(ae(),1),gj=f(ue(),1),mj=f(le(),1),vj=f(ce(),1),_j=f(he(),1),yj=f(A(),1);import{Group as iI}from"@tweenjs/tween.js";var Tn=class{update(){this.group.update()}pause(){this.pauseTween=!0,this.getAll().forEach(t=>{this.tweenStore.add(t),t.pause()})}continue(){this.pauseTween&&(this.tweenStore.forEach(t=>{t.resume()}),this.tweenStore.clear(),this.pauseTween=!1)}remove(t){this.group.remove(t)}getAll(){return this.group.getAll()}clear(){this.getAll().forEach(t=>t.stop()),this.group.removeAll()}dispose(){this.clear()}constructor(){this.pauseTween=!1,this.tweenStore=new Set,this.group=new iI}};import{EventDispatcher as oI}from"three";var gs=class extends oI{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(t){super(),this.ctn=t,this._pointerDown=e=>{this.point={x:e.offsetX,y:e.offsetY}},this._pointerUp=e=>{if(!this.point)return;let{offsetX:n,offsetY:r}=e,{x:o,y:s}=this.point;Math.hypot(o-n+(s-r))>3||this.dispatchEvent({type:"click",e})},this.registryEvent()}};var wj=f(A(),1),Tj=f(F(),1),Aj=f(Ei(),1),Cj=f(Ot(),1);import{isNil as sI}from"lodash";import{EventDispatcher as aI}from"three";var Mr=class extends aI{_isEffectiveTask(t){return t&&typeof t.run=="function"}_getIndexByTid(t){return this._task.findIndex(e=>e.tid===t)}_createTask(t){return this._isEffectiveTask(t)?S({},t,{tid:++this._id,meta:t.meta||{}}):!1}get task(){return[...this._task]}getTasks(){return[...this._task]}add(t){if(this._isEffectiveTask(t)){let e=this._createTask(t);return this._task.push(e),this.started&&!this.activeTask&&this.start(),e.tid}return!1}replace(t,e){if(!this._isEffectiveTask(e))return console.warn("[TaskQueue] replace\u65B9\u6CD5\u4F20\u5165\u7684task\u53C2\u6570\u683C\u5F0F\u4E0D\u6B63\u786E"),!1;let n=this._getIndexByTid(t);if(n===-1)return console.warn("[TaskQueue] \u6CA1\u6709\u627E\u5230id="+t+"\u7684\u4EFB\u52A1"),!1;let r=this._createTask(e);return this._task.splice(n,1,r),r.tid}replaceByMetaType(t){var e;let n=(e=t.meta)==null?void 0:e.type;if(sI(n))return this.add(t);{let r=this._task.find(o=>o.meta.type===n);return r?this.replace(r.tid,t):this.add(t)}}remove(t){let e=this._getIndexByTid(t);return e===-1?(console.warn("[TaskQueue] remove\u65B9\u6CD5\u4F20\u5165\u7684id\uFF1A"+t+"\u627E\u4E0D\u5230\u5BF9\u5E94\u7684task"),!1):(this._task.splice(e,1),!0)}clear(){this._task.length=0}start(){this.started=!0,!this.activeTask&&this._task.length&&this.exec()}stop(){this.started=!1}exec(){return y(this,null,function*(){if(!this.started||!this._task.length)return!1;let t=this._task.shift();this.activeTask=t,this.dispatchEvent({type:"active-task-start",task:t});let e;try{e=yield t.run()}catch(n){console.warn("[task run err]",n,t)}return this.activeTask=null,this.dispatchEvent({type:"active-task-end",task:t,res:e}),this.exec()})}constructor(t=!0){super(),this._task=[],this.started=!1,this.activeTask=null,this._id=0,t&&this.start()}};var Nj=f(F(),1);import{EventDispatcher as uI}from"three";var ms=class extends uI{getWorker(){return new Promise(t=>{let e=this.pool.find(r=>r.state==="leisure");if(e){e.state="used",t(e.worker);return}if(this.pool.length<this.max&&this.workerConstructor){let r=this.workerConstructor();this.pool.push({worker:r,state:"used"}),t(r);return}let n=()=>{let r=this.pool.find(o=>o.state==="leisure");r&&(this.removeEventListener("release",n),r.state="used",t(r.worker))};this.addEventListener("release",n)})}releaseWorker(t){let e=this.pool.find(n=>n.worker===t);e&&(e.state="leisure",this.dispatchEvent({type:"release",worker:t}))}dispose(){this._listeners={},this.pool.forEach(t=>{t.worker.terminate()}),this.pool=[]}constructor(t=10,e){super(),this.max=10,this.pool=[],this.max=t,this.workerConstructor=e}};import{EventDispatcher as lI}from"three";var st=class extends lI{dispose(){this._listeners={}}};var vs=class{filter(t){let e=this.estimate,n=this.errorEstimate+this.processNoise,r=n/(n+this.measurementNoise);return this.estimate=e+r*(t-e),this.errorEstimate=(1-r)*n,this.estimate}constructor(t={}){this.estimate=0,this.errorEstimate=1,this.processNoise=.1,this.measurementNoise=1,this.measurementNoise=t.measurementNoise||1,this.processNoise=t.processNoise||.1,this.errorEstimate=t.errorEstimate||1}};var r8=f(Kn(),1),i8=f(We(),1),o8=f(qe(),1),s8=f(Xe(),1),a8=f(je(),1),u8=f(Ye(),1),l8=f(Ze(),1),c8=f(Ke(),1),h8=f($e(),1),p8=f(Je(),1),f8=f(Qe(),1),d8=f(tn(),1),g8=f(en(),1),m8=f(nn(),1),v8=f(rn(),1),_8=f(F(),1);import{BufferAttribute as Ir,BufferGeometry as LD,Color as wx,ExtrudeGeometry as ND,Vector3 as Mx}from"three";import{mergeGeometries as OD}from"three/examples/jsm/utils/BufferGeometryUtils.js";function S8(i,t,e){t===void 0&&(t=!0),e===void 0&&(e=!1);let n=i.filter(a=>a.geometry.type==="polygon");if(!n.length)return null;let r=n.map(a=>{var u;let l=a.geometry.coords,c=Xo(l[0],l.slice(1)),h=new ND(c,{steps:1,bevelEnabled:!1,depth:a.height,curveSegments:4});(u=a).deltaHeight||(u.deltaHeight=0),h.translate(0,0,a.airHeight+a.deltaHeight);let p=h.attributes.position.count,d=new Float32Array(p).fill(a.height+a.airHeight+a.deltaHeight);if(h.setAttribute("maxZ",new Ir(d,1)),h.setAttribute("opacity",new Ir(new Float32Array(p).fill(a.fillOpacity),1)),e){let _=new Float32Array(p).fill(a.airHeight+a.deltaHeight);h.setAttribute("minZ",new Ir(_,1))}let g=new wx(a.fillColor).convertLinearToSRGB(),v=new Float32Array(p*3);for(let _=0;_<p;_++)v[_*3]=g.r,v[_*3+1]=g.g,v[_*3+2]=g.b;return h.setAttribute("color",new Ir(v,3)),h}),o=OD(r);r.forEach(a=>a.dispose());let s={geometry:o};return o.dispose(),t&&(s.lineGeometry=DD(n)||void 0),s}function DD(i){let{points:t,colors:e,opacities:n}=vc(i);if(!t.length)return null;let r=new LD().setFromPoints(t);return r.setAttribute("color",new Ir(new Float32Array(e),3)),r.setAttribute("opacity",new Ir(new Float32Array(n),1)),r}function vc(i){let t=[],e=[],n=[];return i.filter(r=>r.strokeOpacity>0).map(r=>{let o=r.height+(r.deltaHeight||0)+r.airHeight,{coords:s}=r.geometry,{strokeColor:a,strokeOpacity:u}=r,l=new wx(a).convertLinearToSRGB();for(let c=0;c<s.length;c++){let h=s[c];for(let p=0;p<h.length;p++){let d=h[p],g=p+1===h.length?h[0]:h[p+1];t.push(new Mx(d[0],d[1],o)),t.push(new Mx(g[0],g[1],o)),e.push(l.r,l.g,l.b),e.push(l.r,l.g,l.b),n.push(u),n.push(u)}}}),{points:t,colors:e,opacities:n}}import{EventDispatcher as Jk,Box2 as Qk,Vector3 as ln,Vector2 as Xr,Raycaster as tV,Box3 as eV,Color as nV,AmbientLight as rV}from"three";var _tt=f(A(),1),ytt=f(oe(),1),xtt=f(se(),1),Ett=f(ae(),1),Stt=f(ue(),1),btt=f(le(),1),Mtt=f(ce(),1),wtt=f(he(),1),Ttt=f(F(),1);import{EventDispatcher as mk}from"three";var Q7=f(A(),1),tZ=f(F(),1);import{Object3D as OB,ExtrudeGeometry as DB,Mesh as UB,Box3 as ca,Vector3 as Kt,BufferGeometry as FB,LineSegments as BB,Ray as v3,Vector2 as un,DoubleSide as zB,RepeatWrapping as _3}from"three";var M8=f(A(),1);import{LineMaterial as UD}from"three/examples/jsm/lines/LineMaterial.js";import{Color as Di,LineBasicMaterial as FD,MeshStandardMaterial as BD,MeshBasicMaterial as zD,ShaderMaterial as Ui,DoubleSide as GD,LineDashedMaterial as kD}from"three";function Tx(i){return i.x+"-"+i.y+"-"+i.z}var D=class{static generateLineMaterialKey(t){let{color:e,opacity:n}=t;return e+"-"+n}static createLineMaterial(t){let{color:e,opacity:n,vertexColors:r}=t,o=this.generateLineMaterialKey({color:e,opacity:n,vertexColors:r});if(this.lineMaterialMap.has(o))return this.lineMaterialMap.get(o);let s=new FD({color:new Di(e).convertLinearToSRGB(),transparent:!0,opacity:n,vertexColors:r!=null?r:!1});return this.lineMaterialMap.set(o,s),s}static createMeshStandardMaterial(t){let{color:e,opacity:n}=t,r=e+"-"+n;if(this.meshStandardMaterialMap.has(r))return this.meshStandardMaterialMap.get(r);let o=new BD({color:new Di(e).convertLinearToSRGB(),roughness:1,transparent:!0,opacity:n,depthWrite:!0});return this.meshStandardMaterialMap.set(r,o),o}static createMeshBasicMaterial(t){let{color:e,opacity:n,vertexColors:r}=t,o=e+"-"+n+"-"+r;if(this.meshBasicMaterialMap.has(o))return this.meshBasicMaterialMap.get(o);let s=new zD({color:e,transparent:!0,opacity:n,depthWrite:!0,vertexColors:r!=null?r:!1});return this.meshBasicMaterialMap.set(o,s),s}static createShaderMaterial(t){let{gradualColor:e,center:n,maxValue:r,opacity:o,direction:s,max:a,min:u}=t,l=e.toString()+"-"+Tx(n)+"-"+r+"-"+o+"-"+Tx(s);if(this.shaderMaterialMap.has(l))return this.shaderMaterialMap.get(l);let c=`
|
|
4
|
+
\v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`});var wv=m((pX,Mv)=>{"use strict";var qR=B(),XR=Bn(),jR=Nt(),Z0=j0(),bv=qR("".replace),YR=RegExp("^["+Z0+"]+"),ZR=RegExp("(^|[^"+Z0+"])["+Z0+"]+$"),Y0=function(i){return function(t){var e=jR(XR(t));return i&1&&(e=bv(e,YR,"")),i&2&&(e=bv(e,ZR,"$1")),e}};Mv.exports={start:Y0(1),end:Y0(2),trim:Y0(3)}});var Rv=m((fX,Cv)=>{"use strict";var KR=ai().PROPER,$R=k(),Tv=j0(),Av="\u200B\x85\u180E";Cv.exports=function(i){return $R(function(){return!!Tv[i]()||Av[i]()!==Av||KR&&Tv[i].name!==i})}});var ss=m(()=>{"use strict";var JR=H(),QR=wv().trim,tP=Rv();JR({target:"String",proto:!0,forced:tP("trim")},{trim:function(){return QR(this)}})});var J0=m((FX,Nv)=>{"use strict";var Lv=hr(),eP=TypeError;Nv.exports=function(i,t){if(!delete i[t])throw new eP("Cannot delete property "+Lv(t)+" of "+Lv(i))}});var as=m((BX,Dv)=>{"use strict";var Ov=_i(),nP=Math.floor,Q0=function(i,t){var e=i.length;if(e<8)for(var n=1,r,o;n<e;){for(o=n,r=i[n];o&&t(i[o-1],r)>0;)i[o]=i[--o];o!==n++&&(i[o]=r)}else for(var s=nP(e/2),a=Q0(Ov(i,0,s),t),u=Q0(Ov(i,s),t),l=a.length,c=u.length,h=0,p=0;h<l||p<c;)i[h+p]=h<l&&p<c?t(a[h],u[p])<=0?a[h++]:u[p++]:h<l?a[h++]:u[p++];return i};Dv.exports=Q0});var Fv=m((zX,Uv)=>{"use strict";var rP=k();Uv.exports=function(i,t){var e=[][i];return!!e&&rP(function(){e.call(null,t||function(){return 1},1)})}});var tl=m((GX,zv)=>{"use strict";var iP=cr(),Bv=iP.match(/firefox\/(\d+)/i);zv.exports=!!Bv&&+Bv[1]});var el=m((kX,Gv)=>{"use strict";var oP=cr();Gv.exports=/MSIE|Trident/.test(oP)});var nl=m((VX,Vv)=>{"use strict";var sP=cr(),kv=sP.match(/AppleWebKit\/(\d+)\./);Vv.exports=!!kv&&+kv[1]});var jn=m(()=>{"use strict";var aP=H(),Zv=B(),uP=Ee(),lP=yt(),Hv=dt(),cP=J0(),Wv=Nt(),rl=k(),hP=as(),pP=Fv(),qv=tl(),fP=el(),Xv=ii(),jv=nl(),Sn=[],Yv=Zv(Sn.sort),dP=Zv(Sn.push),gP=rl(function(){Sn.sort(void 0)}),mP=rl(function(){Sn.sort(null)}),vP=pP("sort"),Kv=!rl(function(){if(Xv)return Xv<70;if(!(qv&&qv>3)){if(fP)return!0;if(jv)return jv<603;var i="",t,e,n,r;for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(r=0;r<47;r++)Sn.push({k:e+r,v:n})}for(Sn.sort(function(o,s){return s.v-o.v}),r=0;r<Sn.length;r++)e=Sn[r].k.charAt(0),i.charAt(i.length-1)!==e&&(i+=e);return i!=="DGBEFHACIJK"}}),_P=gP||!mP||!vP||!Kv,yP=function(i){return function(t,e){return e===void 0?-1:t===void 0?1:i!==void 0?+i(t,e)||0:Wv(t)>Wv(e)?1:-1}};aP({target:"Array",proto:!0,forced:_P},{sort:function(t){t!==void 0&&uP(t);var e=lP(this);if(Kv)return t===void 0?Yv(e):Yv(e,t);var n=[],r=Hv(e),o,s;for(s=0;s<r;s++)s in e&&dP(n,e[s]);for(hP(n,yP(t)),o=Hv(n),s=0;s<o;)e[s]=n[s++];for(;s<r;)cP(e,s++);return e}})});var Jv=m((ZX,$v)=>{$v.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t}});var e_=m((KX,t_)=>{var Qv=Jv();t_.exports=function(i,t){Array.isArray(t)||(t=[]),i.length>0&&t.push(Qv([0,0],i[0]));for(var e=0;e<i.length-1;e++){var n=i[e],r=i[e+1],o=n[0],s=n[1],a=r[0],u=r[1],l=[.75*o+.25*a,.75*s+.25*u],c=[.25*o+.75*a,.25*s+.75*u];t.push(l),t.push(c)}return i.length>1&&t.push(Qv([0,0],i[i.length-1])),t}});var a_=m((i5,s_)=>{var sl=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((t,e)=>t.priority-e.priority)}set(t,e){let n=Number(e);if(isNaN(n))throw new TypeError('"priority" must be a number');return this.keys.has(t)?this.queue.map(r=>(r.key===t&&Object.assign(r,{priority:n}),r)):(this.keys.add(t),this.queue.push({key:t,priority:n})),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)}};s_.exports=sl});var c_=m((o5,l_)=>{function u_(i,t){let e=new Map;for(let[n,r]of i)n!==t&&r instanceof Map?e.set(n,u_(r,t)):n!==t&&e.set(n,r);return e}l_.exports=u_});var f_=m((s5,p_)=>{function bP(i){let t=Number(i);return!(isNaN(t)||t<=0)}function h_(i){let t=new Map;return Object.keys(i).forEach(n=>{let r=i[n];if(r!==null&&typeof r=="object"&&!Array.isArray(r))return t.set(n,h_(r));if(!bP(r))throw new Error(`Could not add node at key "${n}", make sure it's a valid node`,r);return t.set(n,Number(r))}),t}p_.exports=h_});var m_=m((a5,g_)=>{function d_(i){if(!(i instanceof Map))throw new Error(`Invalid graph: Expected Map instead found ${typeof i}`);i.forEach((t,e)=>{if(typeof t=="object"&&t instanceof Map){d_(t);return}if(typeof t!="number"||t<=0)throw new Error(`Values must be numbers greater than 0. Found value ${t} at ${e}`)})}g_.exports=d_});var ul=m((u5,y_)=>{var MP=a_(),wP=c_(),v_=f_(),__=m_(),al=class{constructor(t){t instanceof Map?(__(t),this.graph=t):t?this.graph=v_(t):this.graph=new Map}addNode(t,e){let n;return e instanceof Map?(__(e),n=e):n=v_(e),this.graph.set(t,n),this}addVertex(t,e){return this.addNode(t,e)}removeNode(t){return this.graph=wP(this.graph,t),this}path(t,e,n={}){if(!this.graph.size)return n.cost?{path:null,cost:0}:null;let r=new Set,o=new MP,s=new Map,a=[],u=0,l=[];if(n.avoid&&(l=[].concat(n.avoid)),l.includes(t))throw new Error(`Starting node (${t}) cannot be avoided`);if(l.includes(e))throw new Error(`Ending node (${e}) cannot be avoided`);for(o.set(t,0);!o.isEmpty();){let c=o.next();if(c.key===e){u=c.priority;let p=c.key;for(;s.has(p);)a.push(p),p=s.get(p);break}r.add(c.key),(this.graph.get(c.key)||new Map).forEach((p,d)=>{if(r.has(d)||l.includes(d))return null;if(!o.has(d))return s.set(d,c.key),o.set(d,c.priority+p);let g=o.get(d).priority,v=c.priority+p;return v<g?(s.set(d,c.key),o.set(d,v)):null})}return a.length?(n.trim?a.shift():a=a.concat([t]),n.reverse||(a=a.reverse()),n.cost?{path:a,cost:u}:a):n.cost?{path:null,cost:0}:null}shortestPath(...t){return this.path(...t)}};y_.exports=al});var ls=m((g5,E_)=>{"use strict";var TP=Ne(),AP=B();E_.exports=function(i){if(TP(i)==="Function")return AP(i)}});var bn=m((m5,b_)=>{"use strict";var S_=ls(),CP=Ee(),RP=ei(),PP=S_(S_.bind);b_.exports=function(i,t){return CP(i),t===void 0?i:RP?PP(i,t):function(){return i.apply(t,arguments)}}});var T_=m((v5,w_)=>{"use strict";var IP=hi(),LP=dt(),NP=Lo(),OP=bn(),M_=function(i,t,e,n,r,o,s,a){for(var u=r,l=0,c=s?OP(s,a):!1,h,p;l<n;)l in e&&(h=c?c(e[l],l,t):e[l],o>0&&IP(h)?(p=LP(h),u=M_(i,t,h,p,u,o-1)-1):(NP(u+1),i[u]=h),u++),l++;return u};w_.exports=M_});var cs=m((_5,I_)=>{"use strict";var DP=B(),UP=k(),A_=J(),FP=De(),BP=ee(),zP=Zu(),C_=function(){},R_=BP("Reflect","construct"),ll=/^\s*(?:class|function)\b/,GP=DP(ll.exec),kP=!ll.test(C_),bi=function(t){if(!A_(t))return!1;try{return R_(C_,[],t),!0}catch(e){return!1}},P_=function(t){if(!A_(t))return!1;switch(FP(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return kP||!!GP(ll,zP(t))}catch(e){return!0}};P_.sham=!0;I_.exports=!R_||UP(function(){var i;return bi(bi.call)||!bi(Object)||!bi(function(){i=!0})||i})?P_:bi});var D_=m((y5,O_)=>{"use strict";var L_=hi(),VP=cs(),HP=pt(),WP=ot(),qP=WP("species"),N_=Array;O_.exports=function(i){var t;return L_(i)&&(t=i.constructor,VP(t)&&(t===N_||L_(t.prototype))?t=void 0:HP(t)&&(t=t[qP],t===null&&(t=void 0))),t===void 0?N_:t}});var cl=m((x5,U_)=>{"use strict";var XP=D_();U_.exports=function(i,t){return new(XP(i))(t===0?0:t)}});var hs=m(()=>{"use strict";var jP=H(),YP=T_(),ZP=yt(),KP=dt(),$P=Lt(),JP=cl();jP({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=ZP(this),n=KP(e),r=JP(e,0);return r.length=YP(r,e,e,n,0,t===void 0?1:$P(t)),r}})});var ps=m(()=>{"use strict";var QP=pi();QP("flat")});var W_=m((zj,H_)=>{"use strict";var cI=ot(),k_=cI("iterator"),V_=!1;try{G_=0,pl={next:function(){return{done:!!G_++}},return:function(){V_=!0}},pl[k_]=function(){return this},Array.from(pl,function(){throw 2})}catch(i){}var G_,pl;H_.exports=function(i,t){try{if(!t&&!V_)return!1}catch(r){return!1}var e=!1;try{var n={};n[k_]=function(){return{next:function(){return{done:e=!0}}}},i(n)}catch(r){}return e}});var _s=m((Gj,q_)=>{"use strict";q_.exports=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"});var Ge=m((kj,j_)=>{"use strict";var X_=e0(),hI=zt();j_.exports=function(i,t,e){return e.get&&X_(e.get,t,{getter:!0}),e.set&&X_(e.set,t,{setter:!0}),hI.f(i,t,e)}});var Ct=m((Vj,ry)=>{"use strict";var pI=_s(),ml=$(),St=z(),$_=J(),Es=pt(),Cn=xt(),vl=De(),fI=hr(),dI=Gt(),fl=kt(),gI=Ge(),mI=lr(),Ss=fi(),Tr=Vn(),vI=ot(),_I=_o(),J_=Se(),Q_=J_.enforce,yI=J_.get,ys=St.Int8Array,dl=ys&&ys.prototype,Y_=St.Uint8ClampedArray,Z_=Y_&&Y_.prototype,we=ys&&Ss(ys),fe=dl&&Ss(dl),xI=Object.prototype,_l=St.TypeError,K_=vI("toStringTag"),gl=_I("TYPED_ARRAY_TAG"),xs="TypedArrayConstructor",ke=pI&&!!Tr&&vl(St.opera)!=="Opera",ty=!1,At,An,wr,Ve={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},yl={BigInt64Array:8,BigUint64Array:8},EI=function(t){if(!Es(t))return!1;var e=vl(t);return e==="DataView"||Cn(Ve,e)||Cn(yl,e)},ey=function(i){var t=Ss(i);if(Es(t)){var e=yI(t);return e&&Cn(e,xs)?e[xs]:ey(t)}},ny=function(i){if(!Es(i))return!1;var t=vl(i);return Cn(Ve,t)||Cn(yl,t)},SI=function(i){if(ny(i))return i;throw new _l("Target is not a typed array")},bI=function(i){if($_(i)&&(!Tr||mI(we,i)))return i;throw new _l(fI(i)+" is not a typed array constructor")},MI=function(i,t,e,n){if(ml){if(e)for(var r in Ve){var o=St[r];if(o&&Cn(o.prototype,i))try{delete o.prototype[i]}catch(s){try{o.prototype[i]=t}catch(a){}}}(!fe[i]||e)&&fl(fe,i,e?t:ke&&dl[i]||t,n)}},wI=function(i,t,e){var n,r;if(ml){if(Tr){if(e){for(n in Ve)if(r=St[n],r&&Cn(r,i))try{delete r[i]}catch(o){}}if(!we[i]||e)try{return fl(we,i,e?t:ke&&we[i]||t)}catch(o){}else return}for(n in Ve)r=St[n],r&&(!r[i]||e)&&fl(r,i,t)}};for(At in Ve)An=St[At],wr=An&&An.prototype,wr?Q_(wr)[xs]=An:ke=!1;for(At in yl)An=St[At],wr=An&&An.prototype,wr&&(Q_(wr)[xs]=An);if((!ke||!$_(we)||we===Function.prototype)&&(we=function(){throw new _l("Incorrect invocation")},ke))for(At in Ve)St[At]&&Tr(St[At],we);if((!ke||!fe||fe===xI)&&(fe=we.prototype,ke))for(At in Ve)St[At]&&Tr(St[At].prototype,fe);ke&&Ss(Z_)!==fe&&Tr(Z_,fe);if(ml&&!Cn(fe,K_)){ty=!0,gI(fe,K_,{configurable:!0,get:function(){return Es(this)?this[gl]:void 0}});for(At in Ve)St[At]&&dI(St[At],gl,At)}ry.exports={NATIVE_ARRAY_BUFFER_VIEWS:ke,TYPED_ARRAY_TAG:ty&&gl,aTypedArray:SI,aTypedArrayConstructor:bI,exportTypedArrayMethod:MI,exportTypedArrayStaticMethod:wI,getTypedArrayConstructor:ey,isView:EI,isTypedArray:ny,TypedArray:we,TypedArrayPrototype:fe}});var El=m((Hj,oy)=>{"use strict";var iy=z(),xl=k(),TI=W_(),AI=Ct().NATIVE_ARRAY_BUFFER_VIEWS,CI=iy.ArrayBuffer,Yn=iy.Int8Array;oy.exports=!AI||!xl(function(){Yn(1)})||!xl(function(){new Yn(-1)})||!TI(function(i){new Yn,new Yn(null),new Yn(1.5),new Yn(i)},!0)||xl(function(){return new Yn(new CI(2),1,void 0).length!==1})});var Sl=m((Wj,sy)=>{"use strict";var RI=kt();sy.exports=function(i,t,e){for(var n in t)RI(i,n,t[n],e);return i}});var Mi=m((qj,ay)=>{"use strict";var PI=lr(),II=TypeError;ay.exports=function(i,t){if(PI(t,i))return i;throw new II("Incorrect invocation")}});var bs=m((Xj,uy)=>{"use strict";var LI=Lt(),NI=Gn(),OI=RangeError;uy.exports=function(i){if(i===void 0)return 0;var t=LI(i),e=NI(t);if(t!==e)throw new OI("Wrong length or index");return e}});var cy=m((jj,ly)=>{"use strict";ly.exports=Math.sign||function(t){var e=+t;return e===0||e!==e?e:e<0?-1:1}});var fy=m((Yj,py)=>{"use strict";var DI=2220446049250313e-31,hy=1/DI;py.exports=function(i){return i+hy-hy}});var gy=m((Zj,dy)=>{"use strict";var UI=cy(),FI=fy(),BI=Math.abs,zI=2220446049250313e-31;dy.exports=function(i,t,e,n){var r=+i,o=BI(r),s=UI(r);if(o<n)return s*FI(o/n/t)*n*t;var a=(1+t/zI)*o,u=a-(a-o);return u>e||u!==u?s*(1/0):s*u}});var vy=m((Kj,my)=>{"use strict";var GI=gy(),kI=11920928955078125e-23,VI=34028234663852886e22,HI=11754943508222875e-54;my.exports=Math.fround||function(t){return GI(t,kI,VI,HI)}});var yy=m(($j,_y)=>{"use strict";var WI=Array,qI=Math.abs,He=Math.pow,XI=Math.floor,jI=Math.log,YI=Math.LN2,ZI=function(i,t,e){var n=WI(e),r=e*8-t-1,o=(1<<r)-1,s=o>>1,a=t===23?He(2,-24)-He(2,-77):0,u=i<0||i===0&&1/i<0?1:0,l=0,c,h,p;for(i=qI(i),i!==i||i===1/0?(h=i!==i?1:0,c=o):(c=XI(jI(i)/YI),p=He(2,-c),i*p<1&&(c--,p*=2),c+s>=1?i+=a/p:i+=a*He(2,1-s),i*p>=2&&(c++,p/=2),c+s>=o?(h=0,c=o):c+s>=1?(h=(i*p-1)*He(2,t),c+=s):(h=i*He(2,s-1)*He(2,t),c=0));t>=8;)n[l++]=h&255,h/=256,t-=8;for(c=c<<t|h,r+=t;r>0;)n[l++]=c&255,c/=256,r-=8;return n[l-1]|=u*128,n},KI=function(i,t){var e=i.length,n=e*8-t-1,r=(1<<n)-1,o=r>>1,s=n-7,a=e-1,u=i[a--],l=u&127,c;for(u>>=7;s>0;)l=l*256+i[a--],s-=8;for(c=l&(1<<-s)-1,l>>=-s,s+=t;s>0;)c=c*256+i[a--],s-=8;if(l===0)l=1-o;else{if(l===r)return c?NaN:u?-1/0:1/0;c+=He(2,t),l-=o}return(u?-1:1)*c*He(2,l-t)};_y.exports={pack:ZI,unpack:KI}});var bl=m((Jj,Ey)=>{"use strict";var $I=yt(),xy=li(),JI=dt();Ey.exports=function(t){for(var e=$I(this),n=JI(e),r=arguments.length,o=xy(r>1?arguments[1]:void 0,n),s=r>2?arguments[2]:void 0,a=s===void 0?n:xy(s,n);a>o;)e[o++]=t;return e}});var Ps=m((Qj,By)=>{"use strict";var Cs=z(),Cl=B(),Ml=$(),QI=_s(),Ny=ai(),tL=Gt(),eL=Ge(),Sy=Sl(),wl=k(),Ms=Mi(),nL=Lt(),rL=Gn(),Ts=bs(),iL=vy(),Oy=yy(),oL=fi(),by=Vn(),sL=bl(),aL=_i(),uL=ts(),lL=Po(),Dy=dn(),Rl=Se(),cL=Ny.PROPER,My=Ny.CONFIGURABLE,Cr="ArrayBuffer",Rs="DataView",Rr="prototype",hL="Wrong length",Uy="Wrong index",wy=Rl.getterFor(Cr),Ti=Rl.getterFor(Rs),Ty=Rl.set,de=Cs[Cr],Dt=de,Ar=Dt&&Dt[Rr],Te=Cs[Rs],Zn=Te&&Te[Rr],Ay=Object.prototype,pL=Cs.Array,As=Cs.RangeError,fL=Cl(sL),dL=Cl([].reverse),Fy=Oy.pack,Cy=Oy.unpack,Ry=function(i){return[i&255]},Py=function(i){return[i&255,i>>8&255]},Iy=function(i){return[i&255,i>>8&255,i>>16&255,i>>24&255]},Ly=function(i){return i[3]<<24|i[2]<<16|i[1]<<8|i[0]},gL=function(i){return Fy(iL(i),23,4)},mL=function(i){return Fy(i,52,8)},ws=function(i,t,e){eL(i[Rr],t,{configurable:!0,get:function(){return e(this)[t]}})},Rn=function(i,t,e,n){var r=Ti(i),o=Ts(e),s=!!n;if(o+t>r.byteLength)throw new As(Uy);var a=r.bytes,u=o+r.byteOffset,l=aL(a,u,u+t);return s?l:dL(l)},Pn=function(i,t,e,n,r,o){var s=Ti(i),a=Ts(e),u=n(+r),l=!!o;if(a+t>s.byteLength)throw new As(Uy);for(var c=s.bytes,h=a+s.byteOffset,p=0;p<t;p++)c[h+p]=u[l?p:t-p-1]};QI?(Tl=cL&&de.name!==Cr,!wl(function(){de(1)})||!wl(function(){new de(-1)})||wl(function(){return new de,new de(1.5),new de(NaN),de.length!==1||Tl&&!My})?(Dt=function(t){return Ms(this,Ar),uL(new de(Ts(t)),this,Dt)},Dt[Rr]=Ar,Ar.constructor=Dt,lL(Dt,de)):Tl&&My&&tL(de,"name",Cr),by&&oL(Zn)!==Ay&&by(Zn,Ay),wi=new Te(new Dt(2)),Al=Cl(Zn.setInt8),wi.setInt8(0,2147483648),wi.setInt8(1,2147483649),(wi.getInt8(0)||!wi.getInt8(1))&&Sy(Zn,{setInt8:function(t,e){Al(this,t,e<<24>>24)},setUint8:function(t,e){Al(this,t,e<<24>>24)}},{unsafe:!0})):(Dt=function(t){Ms(this,Ar);var e=Ts(t);Ty(this,{type:Cr,bytes:fL(pL(e),0),byteLength:e}),Ml||(this.byteLength=e,this.detached=!1)},Ar=Dt[Rr],Te=function(t,e,n){Ms(this,Zn),Ms(t,Ar);var r=wy(t),o=r.byteLength,s=nL(e);if(s<0||s>o)throw new As("Wrong offset");if(n=n===void 0?o-s:rL(n),s+n>o)throw new As(hL);Ty(this,{type:Rs,buffer:t,byteLength:n,byteOffset:s,bytes:r.bytes}),Ml||(this.buffer=t,this.byteLength=n,this.byteOffset=s)},Zn=Te[Rr],Ml&&(ws(Dt,"byteLength",wy),ws(Te,"buffer",Ti),ws(Te,"byteLength",Ti),ws(Te,"byteOffset",Ti)),Sy(Zn,{getInt8:function(t){return Rn(this,1,t)[0]<<24>>24},getUint8:function(t){return Rn(this,1,t)[0]},getInt16:function(t){var e=Rn(this,2,t,arguments.length>1?arguments[1]:!1);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=Rn(this,2,t,arguments.length>1?arguments[1]:!1);return e[1]<<8|e[0]},getInt32:function(t){return Ly(Rn(this,4,t,arguments.length>1?arguments[1]:!1))},getUint32:function(t){return Ly(Rn(this,4,t,arguments.length>1?arguments[1]:!1))>>>0},getFloat32:function(t){return Cy(Rn(this,4,t,arguments.length>1?arguments[1]:!1),23)},getFloat64:function(t){return Cy(Rn(this,8,t,arguments.length>1?arguments[1]:!1),52)},setInt8:function(t,e){Pn(this,1,t,Ry,e)},setUint8:function(t,e){Pn(this,1,t,Ry,e)},setInt16:function(t,e){Pn(this,2,t,Py,e,arguments.length>2?arguments[2]:!1)},setUint16:function(t,e){Pn(this,2,t,Py,e,arguments.length>2?arguments[2]:!1)},setInt32:function(t,e){Pn(this,4,t,Iy,e,arguments.length>2?arguments[2]:!1)},setUint32:function(t,e){Pn(this,4,t,Iy,e,arguments.length>2?arguments[2]:!1)},setFloat32:function(t,e){Pn(this,4,t,gL,e,arguments.length>2?arguments[2]:!1)},setFloat64:function(t,e){Pn(this,8,t,mL,e,arguments.length>2?arguments[2]:!1)}}));var Tl,wi,Al;Dy(Dt,Cr);Dy(Te,Rs);By.exports={ArrayBuffer:Dt,DataView:Te}});var Gy=m((tY,zy)=>{"use strict";var vL=pt(),_L=Math.floor;zy.exports=Number.isInteger||function(t){return!vL(t)&&isFinite(t)&&_L(t)===t}});var Vy=m((eY,ky)=>{"use strict";var yL=Lt(),xL=RangeError;ky.exports=function(i){var t=yL(i);if(t<0)throw new xL("The argument can't be less than 0");return t}});var Pl=m((nY,Hy)=>{"use strict";var EL=Vy(),SL=RangeError;Hy.exports=function(i,t){var e=EL(i);if(e%t)throw new SL("Wrong offset");return e}});var qy=m((rY,Wy)=>{"use strict";var bL=Math.round;Wy.exports=function(i){var t=bL(i);return t<0?0:t>255?255:t&255}});var Il=m((iY,Xy)=>{"use strict";var ML=cs(),wL=hr(),TL=TypeError;Xy.exports=function(i){if(ML(i))return i;throw new TL(wL(i)+" is not a constructor")}});var Ai=m((oY,Yy)=>{"use strict";var AL=De(),jy=si(),CL=ri(),RL=fr(),PL=ot(),IL=PL("iterator");Yy.exports=function(i){if(!CL(i))return jy(i,IL)||jy(i,"@@iterator")||RL[AL(i)]}});var Is=m((sY,Zy)=>{"use strict";var LL=et(),NL=Ee(),OL=mt(),DL=hr(),UL=Ai(),FL=TypeError;Zy.exports=function(i,t){var e=arguments.length<2?UL(i):t;if(NL(e))return OL(LL(e,i));throw new FL(DL(i)+" is not iterable")}});var Ll=m((aY,Ky)=>{"use strict";var BL=ot(),zL=fr(),GL=BL("iterator"),kL=Array.prototype;Ky.exports=function(i){return i!==void 0&&(zL.Array===i||kL[GL]===i)}});var Nl=m((uY,$y)=>{"use strict";var VL=De();$y.exports=function(i){var t=VL(i);return t==="BigInt64Array"||t==="BigUint64Array"}});var Ls=m((lY,Jy)=>{"use strict";var HL=Bu(),WL=TypeError;Jy.exports=function(i){var t=HL(i,"number");if(typeof t=="number")throw new WL("Can't convert number to bigint");return BigInt(t)}});var Ol=m((cY,Qy)=>{"use strict";var qL=bn(),XL=et(),jL=Il(),YL=yt(),ZL=dt(),KL=Is(),$L=Ai(),JL=Ll(),QL=Nl(),tN=Ct().aTypedArrayConstructor,eN=Ls();Qy.exports=function(t){var e=jL(this),n=YL(t),r=arguments.length,o=r>1?arguments[1]:void 0,s=o!==void 0,a=$L(n),u,l,c,h,p,d,g,v;if(a&&!JL(a))for(g=KL(n,a),v=g.next,n=[];!(d=XL(v,g)).done;)n.push(d.value);for(s&&r>2&&(o=qL(o,arguments[2])),l=ZL(n),c=new(tN(e))(l),h=QL(c),u=0;l>u;u++)p=s?o(n[u],u):n[u],c[u]=h?eN(p):+p;return c}});var n2=m((hY,e2)=>{"use strict";var nN=bn(),rN=B(),iN=ni(),oN=yt(),sN=dt(),aN=cl(),t2=rN([].push),In=function(i){var t=i===1,e=i===2,n=i===3,r=i===4,o=i===6,s=i===7,a=i===5||o;return function(u,l,c,h){for(var p=oN(u),d=iN(p),g=sN(d),v=nN(l,c),_=0,E=h||aN,b=t?E(u,g):e||s?E(u,0):void 0,w,P;g>_;_++)if((a||_ in d)&&(w=d[_],P=v(w,_,p),i))if(t)b[_]=P;else if(P)switch(i){case 3:return!0;case 5:return w;case 6:return _;case 2:t2(b,w)}else switch(i){case 4:return!1;case 7:t2(b,w)}return o?-1:n||r?r:b}};e2.exports={forEach:In(0),map:In(1),filter:In(2),some:In(3),every:In(4),find:In(5),findIndex:In(6),filterReject:In(7)}});var Dl=m((pY,i2)=>{"use strict";var uN=ee(),lN=Ge(),cN=ot(),hN=$(),r2=cN("species");i2.exports=function(i){var t=uN(i);hN&&t&&!t[r2]&&lN(t,r2,{configurable:!0,get:function(){return this}})}});var Ul=m((fY,o2)=>{"use strict";var pN=dt();o2.exports=function(i,t,e){for(var n=0,r=arguments.length>2?e:pN(t),o=new i(r);r>n;)o[n]=t[n++];return o}});var Ln=m((dY,Hl)=>{"use strict";var s2=H(),v2=z(),a2=et(),fN=$(),dN=El(),Ii=Ct(),_2=Ps(),u2=Mi(),gN=pn(),Ci=Gt(),mN=Gy(),vN=Gn(),l2=bs(),Fl=Pl(),_N=qy(),y2=yo(),Ri=xt(),yN=De(),Gl=pt(),xN=oi(),EN=kn(),SN=lr(),Ns=Vn(),bN=i0().f,c2=Ol(),MN=n2().forEach,wN=Dl(),TN=Ge(),x2=zt(),E2=Eo(),h2=Ul(),Wl=Se(),AN=ts(),kl=Wl.get,CN=Wl.set,RN=Wl.enforce,S2=x2.f,PN=E2.f,Bl=v2.RangeError,b2=_2.ArrayBuffer,IN=b2.prototype,LN=_2.DataView,Os=Ii.NATIVE_ARRAY_BUFFER_VIEWS,p2=Ii.TYPED_ARRAY_TAG,f2=Ii.TypedArray,Pi=Ii.TypedArrayPrototype,Vl=Ii.isTypedArray,Ds="BYTES_PER_ELEMENT",zl="Wrong length",Us=function(i,t){TN(i,t,{configurable:!0,get:function(){return kl(this)[t]}})},d2=function(i){var t;return SN(IN,i)||(t=yN(i))==="ArrayBuffer"||t==="SharedArrayBuffer"},M2=function(i,t){return Vl(i)&&!xN(t)&&t in i&&mN(+t)&&t>=0},g2=function(t,e){return e=y2(e),M2(t,e)?gN(2,t[e]):PN(t,e)},m2=function(t,e,n){return e=y2(e),M2(t,e)&&Gl(n)&&Ri(n,"value")&&!Ri(n,"get")&&!Ri(n,"set")&&!n.configurable&&(!Ri(n,"writable")||n.writable)&&(!Ri(n,"enumerable")||n.enumerable)?(t[e]=n.value,t):S2(t,e,n)};fN?(Os||(E2.f=g2,x2.f=m2,Us(Pi,"buffer"),Us(Pi,"byteOffset"),Us(Pi,"byteLength"),Us(Pi,"length")),s2({target:"Object",stat:!0,forced:!Os},{getOwnPropertyDescriptor:g2,defineProperty:m2}),Hl.exports=function(i,t,e){var n=i.match(/\d+/)[0]/8,r=i+(e?"Clamped":"")+"Array",o="get"+i,s="set"+i,a=v2[r],u=a,l=u&&u.prototype,c={},h=function(v,_){var E=kl(v);return E.view[o](_*n+E.byteOffset,!0)},p=function(v,_,E){var b=kl(v);b.view[s](_*n+b.byteOffset,e?_N(E):E,!0)},d=function(v,_){S2(v,_,{get:function(){return h(this,_)},set:function(E){return p(this,_,E)},enumerable:!0})};Os?dN&&(u=t(function(v,_,E,b){return u2(v,l),AN(function(){return Gl(_)?d2(_)?b!==void 0?new a(_,Fl(E,n),b):E!==void 0?new a(_,Fl(E,n)):new a(_):Vl(_)?h2(u,_):a2(c2,u,_):new a(l2(_))}(),v,u)}),Ns&&Ns(u,f2),MN(bN(a),function(v){v in u||Ci(u,v,a[v])}),u.prototype=l):(u=t(function(v,_,E,b){u2(v,l);var w=0,P=0,L,U,T;if(!Gl(_))T=l2(_),U=T*n,L=new b2(U);else if(d2(_)){L=_,P=Fl(E,n);var N=_.byteLength;if(b===void 0){if(N%n)throw new Bl(zl);if(U=N-P,U<0)throw new Bl(zl)}else if(U=vN(b)*n,U+P>N)throw new Bl(zl);T=U/n}else return Vl(_)?h2(u,_):a2(c2,u,_);for(CN(v,{buffer:L,byteOffset:P,byteLength:U,length:T,view:new LN(L)});w<T;)d(v,w++)}),Ns&&Ns(u,f2),l=u.prototype=EN(Pi)),l.constructor!==u&&Ci(l,"constructor",u),RN(l).TypedArrayConstructor=u,p2&&Ci(l,p2,r);var g=u!==a;c[r]=u,s2({global:!0,constructor:!0,forced:g,sham:!Os},c),Ds in u||Ci(u,Ds,n),Ds in l||Ci(l,Ds,n),wN(r)}):Hl.exports=function(){}});var Kn=m(()=>{"use strict";var NN=Ln();NN("Float32",function(i){return function(e,n,r){return i(this,e,n,r)}})});var We=m(()=>{"use strict";var w2=Ct(),ON=dt(),DN=Lt(),UN=w2.aTypedArray,FN=w2.exportTypedArrayMethod;FN("at",function(t){var e=UN(this),n=ON(e),r=DN(t),o=r>=0?r:n+r;return o<0||o>=n?void 0:e[o]})});var qe=m(()=>{"use strict";var T2=Ct(),BN=bl(),zN=Ls(),GN=De(),kN=et(),VN=B(),HN=k(),WN=T2.aTypedArray,qN=T2.exportTypedArrayMethod,XN=VN("".slice),jN=HN(function(){var i=0;return new Int8Array(2).fill({valueOf:function(){return i++}}),i!==1});qN("fill",function(t){var e=arguments.length;WN(this);var n=XN(GN(this),0,3)==="Big"?zN(t):+t;return kN(BN,this,n,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)},jN)});var Li=m((EY,C2)=>{"use strict";var YN=bn(),ZN=ni(),KN=yt(),$N=dt(),A2=function(i){var t=i===1;return function(e,n,r){for(var o=KN(e),s=ZN(o),a=$N(s),u=YN(n,r),l,c;a-- >0;)if(l=s[a],c=u(l,a,o),c)switch(i){case 0:return l;case 1:return a}return t?-1:void 0}};C2.exports={findLast:A2(0),findLastIndex:A2(1)}});var Xe=m(()=>{"use strict";var R2=Ct(),JN=Li().findLast,QN=R2.aTypedArray,tO=R2.exportTypedArrayMethod;tO("findLast",function(t){return JN(QN(this),t,arguments.length>1?arguments[1]:void 0)})});var je=m(()=>{"use strict";var P2=Ct(),eO=Li().findLastIndex,nO=P2.aTypedArray,rO=P2.exportTypedArrayMethod;rO("findLastIndex",function(t){return eO(nO(this),t,arguments.length>1?arguments[1]:void 0)})});var Ye=m(()=>{"use strict";var L2=z(),N2=et(),jl=Ct(),iO=dt(),oO=Pl(),sO=yt(),O2=k(),aO=L2.RangeError,ql=L2.Int8Array,I2=ql&&ql.prototype,D2=I2&&I2.set,uO=jl.aTypedArray,lO=jl.exportTypedArrayMethod,Xl=!O2(function(){var i=new Uint8ClampedArray(2);return N2(D2,i,{length:1,0:3},1),i[1]!==3}),cO=Xl&&jl.NATIVE_ARRAY_BUFFER_VIEWS&&O2(function(){var i=new ql(2);return i.set(1),i.set("2",1),i[0]!==0||i[1]!==2});lO("set",function(t){uO(this);var e=oO(arguments.length>1?arguments[1]:void 0,1),n=sO(t);if(Xl)return N2(D2,this,n,e);var r=this.length,o=iO(n),s=0;if(o+e>r)throw new aO("Wrong length");for(;s<o;)this[e+s]=n[s++]},!Xl||cO)});var Ze=m(()=>{"use strict";var hO=z(),pO=ls(),Yl=k(),fO=Ee(),dO=as(),G2=Ct(),U2=tl(),gO=el(),F2=ii(),B2=nl(),mO=G2.aTypedArray,vO=G2.exportTypedArrayMethod,Ni=hO.Uint16Array,Pr=Ni&&pO(Ni.prototype.sort),_O=!!Pr&&!(Yl(function(){Pr(new Ni(2),null)})&&Yl(function(){Pr(new Ni(2),{})})),z2=!!Pr&&!Yl(function(){if(F2)return F2<74;if(U2)return U2<67;if(gO)return!0;if(B2)return B2<602;var i=new Ni(516),t=Array(516),e,n;for(e=0;e<516;e++)n=e%4,i[e]=515-e,t[e]=e-2*n+3;for(Pr(i,function(r,o){return(r/4|0)-(o/4|0)}),e=0;e<516;e++)if(i[e]!==t[e])return!0}),yO=function(i){return function(t,e){return i!==void 0?+i(t,e)||0:e!==e?-1:t!==t?1:t===0&&e===0?1/t>0&&1/e<0?1:-1:t>e}};vO("sort",function(t){return t!==void 0&&fO(t),z2?Pr(this,t):dO(mO(this),yO(t))},!z2||_O)});var V2=m((PY,k2)=>{"use strict";var xO=dt();k2.exports=function(i,t){for(var e=xO(i),n=new t(e),r=0;r<e;r++)n[r]=i[e-r-1];return n}});var Ke=m(()=>{"use strict";var EO=V2(),Zl=Ct(),SO=Zl.aTypedArray,bO=Zl.exportTypedArrayMethod,MO=Zl.getTypedArrayConstructor;bO("toReversed",function(){return EO(SO(this),MO(this))})});var $e=m(()=>{"use strict";var Fs=Ct(),wO=B(),TO=Ee(),AO=Ul(),CO=Fs.aTypedArray,RO=Fs.getTypedArrayConstructor,PO=Fs.exportTypedArrayMethod,IO=wO(Fs.TypedArrayPrototype.sort);PO("toSorted",function(t){t!==void 0&&TO(t);var e=CO(this),n=AO(RO(e),e);return IO(n,t)})});var W2=m((DY,H2)=>{"use strict";var LO=dt(),NO=Lt(),OO=RangeError;H2.exports=function(i,t,e,n){var r=LO(i),o=NO(e),s=o<0?r+o:o;if(s>=r||s<0)throw new OO("Incorrect index");for(var a=new t(r),u=0;u<r;u++)a[u]=u===s?n:i[u];return a}});var Je=m(()=>{"use strict";var DO=W2(),Kl=Ct(),UO=Nl(),FO=Lt(),BO=Ls(),zO=Kl.aTypedArray,GO=Kl.getTypedArrayConstructor,kO=Kl.exportTypedArrayMethod,VO=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(i){return i===8}}();kO("with",function(i,t){var e=zO(this),n=FO(i),r=UO(e)?BO(t):+t;return DO(e,GO(e),n,r)},!VO)});var Qe=m(()=>{"use strict";var HO=H(),WO=z(),qO=Ps(),XO=Dl(),$l="ArrayBuffer",q2=qO[$l],jO=WO[$l];HO({global:!0,constructor:!0,forced:jO!==q2},{ArrayBuffer:q2});XO($l)});var tn=m(()=>{"use strict";var YO=H(),Ql=ls(),ZO=k(),Z2=Ps(),X2=mt(),j2=li(),KO=Gn(),tc=Z2.ArrayBuffer,Jl=Z2.DataView,K2=Jl.prototype,Y2=Ql(tc.prototype.slice),$O=Ql(K2.getUint8),JO=Ql(K2.setUint8),QO=ZO(function(){return!new tc(2).slice(1,void 0).byteLength});YO({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:QO},{slice:function(t,e){if(Y2&&e===void 0)return Y2(X2(this),t);for(var n=X2(this).byteLength,r=j2(t,n),o=j2(e===void 0?n:e,n),s=new tc(KO(o-r)),a=new Jl(this),u=new Jl(s),l=0;r<o;)JO(u,l++,$O(a,r++));return s}})});var ec=m((VY,Q2)=>{"use strict";var J2=z(),tD=di(),eD=Ne(),$2=J2.ArrayBuffer,nD=J2.TypeError;Q2.exports=$2&&tD($2.prototype,"byteLength","get")||function(i){if(eD(i)!=="ArrayBuffer")throw new nD("ArrayBuffer expected");return i.byteLength}});var nc=m((HY,tx)=>{"use strict";var rD=z(),iD=_s(),oD=ec(),sD=rD.DataView;tx.exports=function(i){if(!iD||oD(i)!==0)return!1;try{return new sD(i),!1}catch(t){return!0}}});var en=m(()=>{"use strict";var aD=$(),uD=Ge(),lD=nc(),ex=ArrayBuffer.prototype;aD&&!("detached"in ex)&&uD(ex,"detached",{configurable:!0,get:function(){return lD(this)}})});var rx=m((XY,nx)=>{"use strict";var cD=nc(),hD=TypeError;nx.exports=function(i){if(cD(i))throw new hD("ArrayBuffer is detached");return i}});var rc=m((jY,ix)=>{"use strict";var Oi=z(),pD=cr(),fD=Ne(),Bs=function(i){return pD.slice(0,i.length)===i};ix.exports=function(){return Bs("Bun/")?"BUN":Bs("Cloudflare-Workers")?"CLOUDFLARE":Bs("Deno/")?"DENO":Bs("Node.js/")?"NODE":Oi.Bun&&typeof Bun.version=="string"?"BUN":Oi.Deno&&typeof Deno.version=="object"?"DENO":fD(Oi.process)==="process"?"NODE":Oi.window&&Oi.document?"BROWSER":"REST"}()});var sx=m((YY,ox)=>{"use strict";var dD=rc();ox.exports=dD==="NODE"});var ux=m((ZY,ax)=>{"use strict";var gD=z(),mD=sx();ax.exports=function(i){if(mD){try{return gD.process.getBuiltinModule(i)}catch(t){}try{return Function('return require("'+i+'")')()}catch(t){}}}});var sc=m((KY,cx)=>{"use strict";var vD=z(),_D=k(),ic=ii(),oc=rc(),lx=vD.structuredClone;cx.exports=!!lx&&!_D(function(){if(oc==="DENO"&&ic>92||oc==="NODE"&&ic>94||oc==="BROWSER"&&ic>97)return!1;var i=new ArrayBuffer(8),t=lx(i,{transfer:[i]});return i.byteLength!==0||t.byteLength!==8})});var dx=m(($Y,fx)=>{"use strict";var cc=z(),yD=ux(),xD=sc(),ED=cc.structuredClone,hx=cc.ArrayBuffer,zs=cc.MessageChannel,lc=!1,ac,px,Gs,uc;if(xD)lc=function(i){ED(i,{transfer:[i]})};else if(hx)try{zs||(ac=yD("worker_threads"),ac&&(zs=ac.MessageChannel)),zs&&(px=new zs,Gs=new hx(2),uc=function(i){px.port1.postMessage(null,[i])},Gs.byteLength===2&&(uc(Gs),Gs.byteLength===0&&(lc=uc)))}catch(i){}fx.exports=lc});var mc=m((JY,Ex)=>{"use strict";var fc=z(),dc=B(),_x=di(),SD=bs(),bD=rx(),MD=ec(),gx=dx(),hc=sc(),wD=fc.structuredClone,yx=fc.ArrayBuffer,pc=fc.DataView,TD=Math.min,gc=yx.prototype,xx=pc.prototype,AD=dc(gc.slice),mx=_x(gc,"resizable","get"),vx=_x(gc,"maxByteLength","get"),CD=dc(xx.getInt8),RD=dc(xx.setInt8);Ex.exports=(hc||gx)&&function(i,t,e){var n=MD(i),r=t===void 0?n:SD(t),o=!mx||!mx(i),s;if(bD(i),hc&&(i=wD(i,{transfer:[i]}),n===r&&(e||o)))return i;if(n>=r&&(!e||o))s=AD(i,0,r);else{var a=e&&!o&&vx?{maxByteLength:vx(i)}:void 0;s=new yx(r,a);for(var u=new pc(i),l=new pc(s),c=TD(r,n),h=0;h<c;h++)RD(l,h,CD(u,h))}return hc||gx(i),s}});var nn=m(()=>{"use strict";var PD=H(),Sx=mc();Sx&&PD({target:"ArrayBuffer",proto:!0},{transfer:function(){return Sx(this,arguments.length?arguments[0]:void 0,!0)}})});var rn=m(()=>{"use strict";var ID=H(),bx=mc();bx&&ID({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return bx(this,arguments.length?arguments[0]:void 0,!1)}})});var ks=m(()=>{"use strict";var VD=Ln();VD("Uint8",function(i){return function(e,n,r){return i(this,e,n,r)}})});var _c=m(()=>{"use strict";var HD=El(),WD=Ct().exportTypedArrayStaticMethod,qD=Ol();WD("from",qD,HD)});var Lx=m(()=>{"use strict";var YD=is().charAt,ZD=Nt(),Px=Se(),KD=E0(),Rx=Fo(),Ix="String Iterator",$D=Px.set,JD=Px.getterFor(Ix);KD(String,"String",function(i){$D(this,{type:Ix,string:ZD(i),index:0})},function(){var t=JD(this),e=t.string,n=t.index,r;return n>=e.length?Rx(void 0,!0):(r=YD(e,n),t.index+=r.length,Rx(r,!1))})});var Ec=m((E9,Ox)=>{"use strict";var QD=k(),tU=ot(),eU=$(),Nx=fn(),nU=tU("iterator");Ox.exports=!QD(function(){var i=new URL("b?a=1&b=2&c=3","https://a"),t=i.searchParams,e=new URLSearchParams("a=1&a=2&b=3"),n="";return i.pathname="c%20d",t.forEach(function(r,o){t.delete("b"),n+=o+r}),e.delete("a",2),e.delete("b",void 0),Nx&&(!i.toJSON||!e.has("a",1)||e.has("a",2)||!e.has("a",void 0)||e.has("b"))||!t.size&&(Nx||!eU)||!t.sort||i.href!=="https://a/c%20d?a=1&c=3"||t.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!t[nU]||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"||n!=="a1c3"||new URL("https://x",void 0).host!=="x"})});var Bx=m((S9,Fx)=>{"use strict";var Dx=$(),rU=B(),iU=et(),oU=k(),Sc=u0(),sU=o0(),aU=Au(),uU=yt(),lU=ni(),Lr=Object.assign,Ux=Object.defineProperty,cU=rU([].concat);Fx.exports=!Lr||oU(function(){if(Dx&&Lr({b:1},Lr(Ux({},"a",{enumerable:!0,get:function(){Ux(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var i={},t={},e=Symbol("assign detection"),n="abcdefghijklmnopqrst";return i[e]=7,n.split("").forEach(function(r){t[r]=r}),Lr({},i)[e]!==7||Sc(Lr({},t)).join("")!==n})?function(t,e){for(var n=uU(t),r=arguments.length,o=1,s=sU.f,a=aU.f;r>o;)for(var u=lU(arguments[o++]),l=s?cU(Sc(u),s(u)):Sc(u),c=l.length,h=0,p;c>h;)p=l[h++],(!Dx||iU(a,u,p))&&(n[p]=u[p]);return n}:Lr});var Gx=m((b9,zx)=>{"use strict";var hU=mt(),pU=qo();zx.exports=function(i,t,e,n){try{return n?t(hU(e)[0],e[1]):t(e)}catch(r){pU(i,"throw",r)}}});var Vx=m((M9,kx)=>{"use strict";var fU=$(),dU=zt(),gU=pn();kx.exports=function(i,t,e){fU?dU.f(i,t,gU(0,e)):i[t]=e}});var Xx=m((w9,qx)=>{"use strict";var mU=bn(),vU=et(),_U=yt(),yU=Gx(),xU=Ll(),EU=cs(),SU=dt(),Hx=Vx(),bU=Is(),MU=Ai(),Wx=Array;qx.exports=function(t){var e=_U(t),n=EU(this),r=arguments.length,o=r>1?arguments[1]:void 0,s=o!==void 0;s&&(o=mU(o,r>2?arguments[2]:void 0));var a=MU(e),u=0,l,c,h,p,d,g;if(a&&!(this===Wx&&xU(a)))for(c=n?new this:[],p=bU(e,a),d=p.next;!(h=vU(d,p)).done;u++)g=s?yU(p,o,[h.value,u],!0):h.value,Hx(c,u,g);else for(l=SU(e),c=n?new this(l):Wx(l);l>u;u++)g=s?o(e[u],u):e[u],Hx(c,u,g);return c.length=u,c}});var e6=m((T9,t6)=>{"use strict";var Qn=B(),bc=2147483647,Bi=36,$x=1,Tc=26,wU=38,TU=700,AU=72,CU=128,RU="-",PU=/[^\0-\u007E]/,Jx=/[.\u3002\uFF0E\uFF61]/g,jx="Overflow: input needs wider integers to process",Mc=Bi-$x,Yx=RangeError,IU=Qn(Jx.exec),Nr=Math.floor,wc=String.fromCharCode,Zx=Qn("".charCodeAt),Qx=Qn([].join),Nn=Qn([].push),LU=Qn("".replace),NU=Qn("".split),OU=Qn("".toLowerCase),DU=function(i){for(var t=[],e=0,n=i.length;e<n;){var r=Zx(i,e++);if(r>=55296&&r<=56319&&e<n){var o=Zx(i,e++);(o&64512)===56320?Nn(t,((r&1023)<<10)+(o&1023)+65536):(Nn(t,r),e--)}else Nn(t,r)}return t},Kx=function(i){return i+22+75*(i<26)},UU=function(i,t,e){var n=0;for(i=e?Nr(i/TU):i>>1,i+=Nr(i/t);i>Mc*Tc>>1;)i=Nr(i/Mc),n+=Bi;return Nr(n+(Mc+1)*i/(i+wU))},FU=function(i){var t=[];i=DU(i);var e=i.length,n=CU,r=0,o=AU,s,a;for(s=0;s<i.length;s++)a=i[s],a<128&&Nn(t,wc(a));var u=t.length,l=u;for(u&&Nn(t,RU);l<e;){var c=bc;for(s=0;s<i.length;s++)a=i[s],a>=n&&a<c&&(c=a);var h=l+1;if(c-n>Nr((bc-r)/h))throw new Yx(jx);for(r+=(c-n)*h,n=c,s=0;s<i.length;s++){if(a=i[s],a<n&&++r>bc)throw new Yx(jx);if(a===n){for(var p=r,d=Bi;;){var g=d<=o?$x:d>=o+Tc?Tc:d-o;if(p<g)break;var v=p-g,_=Bi-g;Nn(t,wc(Kx(g+v%_))),p=Nr(v/_),d+=Bi}Nn(t,wc(Kx(p))),o=UU(r,h,l===u),r=0,l++}}r++,n++}return Qx(t,"")};t6.exports=function(i){var t=[],e=NU(LU(OU(i),Jx,"."),"."),n,r;for(n=0;n<e.length;n++)r=e[n],Nn(t,IU(PU,r)?"xn--"+FU(r):r);return Qx(t,".")}});var zi=m((A9,n6)=>{"use strict";var BU=TypeError;n6.exports=function(i,t){if(i<t)throw new BU("Not enough arguments");return i}});var o6=m(()=>{"use strict";var zU=H(),GU=B(),kU=li(),VU=RangeError,r6=String.fromCharCode,i6=String.fromCodePoint,HU=GU([].join),WU=!!i6&&i6.length!==1;zU({target:"String",stat:!0,arity:1,forced:WU},{fromCodePoint:function(t){for(var e=[],n=arguments.length,r=0,o;n>r;){if(o=+arguments[r++],kU(o,1114111)!==o)throw new VU(o+" is not a valid code point");e[r]=o<65536?r6(o):r6(((o-=65536)>>10)+55296,o%1024+56320)}return HU(e,"")}})});var u6=m((P9,a6)=>{"use strict";var s6=z(),qU=$(),XU=Object.getOwnPropertyDescriptor;a6.exports=function(i){if(!qU)return s6[i];var t=XU(s6,i);return t&&t.value}});var Dc=m((I9,I6)=>{"use strict";b0();o6();var Lc=H(),E6=z(),Nc=u6(),jU=ee(),qs=et(),ge=B(),Gi=$(),S6=Ec(),b6=kt(),YU=Ge(),ZU=Sl(),KU=dn(),$U=y0(),Oc=Se(),M6=Mi(),Ac=J(),JU=xt(),QU=bn(),tF=De(),eF=mt(),w6=pt(),Mt=Nt(),nF=kn(),l6=pn(),c6=Is(),rF=Ai(),Xs=Fo(),Or=zi(),iF=ot(),oF=as(),sF=iF("iterator"),Ur="URLSearchParams",T6=Ur+"Iterator",A6=Oc.set,Wt=Oc.getterFor(Ur),aF=Oc.getterFor(T6),h6=Nc("fetch"),Zs=Nc("Request"),ki=Nc("Headers"),Cc=Zs&&Zs.prototype,p6=ki&&ki.prototype,uF=E6.TypeError,lF=E6.encodeURIComponent,cF=String.fromCharCode,hF=jU("String","fromCodePoint"),pF=parseInt,Ys=ge("".charAt),f6=ge([].join),On=ge([].push),C6=ge("".replace),fF=ge([].shift),d6=ge([].splice),g6=ge("".split),R6=ge("".slice),dF=ge(/./.exec),gF=/\+/g,Rc="\uFFFD",mF=/^[0-9a-f]+$/i,m6=function(i,t){var e=R6(i,t,t+2);return dF(mF,e)?pF(e,16):NaN},vF=function(i){for(var t=0,e=128;e>0&&i&e;e>>=1)t++;return t},_F=function(i){var t=null;switch(i.length){case 1:t=i[0];break;case 2:t=(i[0]&31)<<6|i[1]&63;break;case 3:t=(i[0]&15)<<12|(i[1]&63)<<6|i[2]&63;break;case 4:t=(i[0]&7)<<18|(i[1]&63)<<12|(i[2]&63)<<6|i[3]&63;break}return t>1114111?null:t},v6=function(i){i=C6(i,gF," ");for(var t=i.length,e="",n=0;n<t;){var r=Ys(i,n);if(r==="%"){if(Ys(i,n+1)==="%"||n+3>t){e+="%",n++;continue}var o=m6(i,n+1);if(o!==o){e+=r,n++;continue}n+=2;var s=vF(o);if(s===0)r=cF(o);else{if(s===1||s>4){e+=Rc,n++;continue}for(var a=[o],u=1;u<s&&(n++,!(n+3>t||Ys(i,n)!=="%"));){var l=m6(i,n+1);if(l!==l){n+=3;break}if(l>191||l<128)break;On(a,l),n+=2,u++}if(a.length!==s){e+=Rc;continue}var c=_F(a);c===null?e+=Rc:r=hF(c)}}e+=r,n++}return e},yF=/[!'()~]|%20/g,xF={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},EF=function(i){return xF[i]},_6=function(i){return C6(lF(i),yF,EF)},Pc=$U(function(t,e){A6(this,{type:T6,target:Wt(t).entries,index:0,kind:e})},Ur,function(){var t=aF(this),e=t.target,n=t.index++;if(!e||n>=e.length)return t.target=null,Xs(void 0,!0);var r=e[n];switch(t.kind){case"keys":return Xs(r.key,!1);case"values":return Xs(r.value,!1)}return Xs([r.key,r.value],!1)},!0),P6=function(i){this.entries=[],this.url=null,i!==void 0&&(w6(i)?this.parseObject(i):this.parseQuery(typeof i=="string"?Ys(i,0)==="?"?R6(i,1):i:Mt(i)))};P6.prototype={type:Ur,bindURL:function(i){this.url=i,this.update()},parseObject:function(i){var t=this.entries,e=rF(i),n,r,o,s,a,u,l;if(e)for(n=c6(i,e),r=n.next;!(o=qs(r,n)).done;){if(s=c6(eF(o.value)),a=s.next,(u=qs(a,s)).done||(l=qs(a,s)).done||!qs(a,s).done)throw new uF("Expected sequence with length 2");On(t,{key:Mt(u.value),value:Mt(l.value)})}else for(var c in i)JU(i,c)&&On(t,{key:c,value:Mt(i[c])})},parseQuery:function(i){if(i)for(var t=this.entries,e=g6(i,"&"),n=0,r,o;n<e.length;)r=e[n++],r.length&&(o=g6(r,"="),On(t,{key:v6(fF(o)),value:v6(f6(o,"="))}))},serialize:function(){for(var i=this.entries,t=[],e=0,n;e<i.length;)n=i[e++],On(t,_6(n.key)+"="+_6(n.value));return f6(t,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Ks=function(){M6(this,Dr);var t=arguments.length>0?arguments[0]:void 0,e=A6(this,new P6(t));Gi||(this.size=e.entries.length)},Dr=Ks.prototype;ZU(Dr,{append:function(t,e){var n=Wt(this);Or(arguments.length,2),On(n.entries,{key:Mt(t),value:Mt(e)}),Gi||this.length++,n.updateURL()},delete:function(i){for(var t=Wt(this),e=Or(arguments.length,1),n=t.entries,r=Mt(i),o=e<2?void 0:arguments[1],s=o===void 0?o:Mt(o),a=0;a<n.length;){var u=n[a];if(u.key===r&&(s===void 0||u.value===s)){if(d6(n,a,1),s!==void 0)break}else a++}Gi||(this.size=n.length),t.updateURL()},get:function(t){var e=Wt(this).entries;Or(arguments.length,1);for(var n=Mt(t),r=0;r<e.length;r++)if(e[r].key===n)return e[r].value;return null},getAll:function(t){var e=Wt(this).entries;Or(arguments.length,1);for(var n=Mt(t),r=[],o=0;o<e.length;o++)e[o].key===n&&On(r,e[o].value);return r},has:function(t){for(var e=Wt(this).entries,n=Or(arguments.length,1),r=Mt(t),o=n<2?void 0:arguments[1],s=o===void 0?o:Mt(o),a=0;a<e.length;){var u=e[a++];if(u.key===r&&(s===void 0||u.value===s))return!0}return!1},set:function(t,e){var n=Wt(this);Or(arguments.length,1);for(var r=n.entries,o=!1,s=Mt(t),a=Mt(e),u=0,l;u<r.length;u++)l=r[u],l.key===s&&(o?d6(r,u--,1):(o=!0,l.value=a));o||On(r,{key:s,value:a}),Gi||(this.size=r.length),n.updateURL()},sort:function(){var t=Wt(this);oF(t.entries,function(e,n){return e.key>n.key?1:-1}),t.updateURL()},forEach:function(t){for(var e=Wt(this).entries,n=QU(t,arguments.length>1?arguments[1]:void 0),r=0,o;r<e.length;)o=e[r++],n(o.value,o.key,this)},keys:function(){return new Pc(this,"keys")},values:function(){return new Pc(this,"values")},entries:function(){return new Pc(this,"entries")}},{enumerable:!0});b6(Dr,sF,Dr.entries,{name:"entries"});b6(Dr,"toString",function(){return Wt(this).serialize()},{enumerable:!0});Gi&&YU(Dr,"size",{get:function(){return Wt(this).entries.length},configurable:!0,enumerable:!0});KU(Ks,Ur);Lc({global:!0,constructor:!0,forced:!S6},{URLSearchParams:Ks});!S6&&Ac(ki)&&(y6=ge(p6.has),x6=ge(p6.set),Ic=function(i){if(w6(i)){var t=i.body,e;if(tF(t)===Ur)return e=i.headers?new ki(i.headers):new ki,y6(e,"content-type")||x6(e,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),nF(i,{body:l6(0,Mt(t)),headers:l6(0,e)})}return i},Ac(h6)&&Lc({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return h6(t,arguments.length>1?Ic(arguments[1]):{})}}),Ac(Zs)&&(js=function(t){return M6(this,Cc),new Zs(t,arguments.length>1?Ic(arguments[1]):{})},Cc.constructor=js,js.prototype=Cc,Lc({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:js})));var y6,x6,Ic,js;I6.exports={URLSearchParams:Ks,getState:Wt}});var Z6=m(()=>{"use strict";Lx();var SF=H(),Jc=$(),bF=Ec(),Qc=z(),L6=bn(),Zt=B(),ea=kt(),qt=Ge(),MF=Mi(),Zc=xt(),th=Bx(),Fr=Xx(),me=_i(),wF=is().codeAt,TF=e6(),an=Nt(),AF=dn(),CF=zi(),H6=Dc(),W6=Se(),RF=W6.set,na=W6.getterFor("URL"),PF=H6.URLSearchParams,IF=H6.getState,Vi=Qc.URL,Kc=Qc.TypeError,ra=Qc.parseInt,LF=Math.floor,N6=Math.pow,Yt=Zt("".charAt),ve=Zt(/./.exec),Wi=Zt([].join),NF=Zt(1 .toString),OF=Zt([].pop),zr=Zt([].push),Uc=Zt("".replace),DF=Zt([].shift),UF=Zt("".split),Xi=Zt("".slice),ia=Zt("".toLowerCase),FF=Zt([].unshift),BF="Invalid authority",Fc="Invalid scheme",tr="Invalid host",O6="Invalid port",q6=/[a-z]/i,zF=/[\d+-.a-z]/i,$c=/\d/,GF=/^0x/i,kF=/^[0-7]+$/,VF=/^\d+$/,X6=/^[\da-f]+$/i,HF=/[\0\t\n\r #%/:<>?@[\\\]^|]/,WF=/[\0\t\n\r #/:<>?@[\\\]^|]/,qF=/^[\u0000-\u0020]+/,XF=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,jF=/[\t\n\r]/g,Xt,YF=function(i){var t=UF(i,"."),e,n,r,o,s,a,u;if(t.length&&t[t.length-1]===""&&t.length--,e=t.length,e>4)return i;for(n=[],r=0;r<e;r++){if(o=t[r],o==="")return i;if(s=10,o.length>1&&Yt(o,0)==="0"&&(s=ve(GF,o)?16:8,o=Xi(o,s===8?1:2)),o==="")a=0;else{if(!ve(s===10?VF:s===8?kF:X6,o))return i;a=ra(o,s)}zr(n,a)}for(r=0;r<e;r++)if(a=n[r],r===e-1){if(a>=N6(256,5-e))return null}else if(a>255)return null;for(u=OF(n),r=0;r<n.length;r++)u+=n[r]*N6(256,3-r);return u},ZF=function(i){var t=[0,0,0,0,0,0,0,0],e=0,n=null,r=0,o,s,a,u,l,c,h,p=function(){return Yt(i,r)};if(p()===":"){if(Yt(i,1)!==":")return;r+=2,e++,n=e}for(;p();){if(e===8)return;if(p()===":"){if(n!==null)return;r++,e++,n=e;continue}for(o=s=0;s<4&&ve(X6,p());)o=o*16+ra(p(),16),r++,s++;if(p()==="."){if(s===0||(r-=s,e>6))return;for(a=0;p();){if(u=null,a>0)if(p()==="."&&a<4)r++;else return;if(!ve($c,p()))return;for(;ve($c,p());){if(l=ra(p(),10),u===null)u=l;else{if(u===0)return;u=u*10+l}if(u>255)return;r++}t[e]=t[e]*256+u,a++,(a===2||a===4)&&e++}if(a!==4)return;break}else if(p()===":"){if(r++,!p())return}else if(p())return;t[e++]=o}if(n!==null)for(c=e-n,e=7;e!==0&&c>0;)h=t[e],t[e--]=t[n+c-1],t[n+--c]=h;else if(e!==8)return;return t},KF=function(i){for(var t=null,e=1,n=null,r=0,o=0;o<8;o++)i[o]!==0?(r>e&&(t=n,e=r),n=null,r=0):(n===null&&(n=o),++r);return r>e?n:t},Hi=function(i){var t,e,n,r;if(typeof i=="number"){for(t=[],e=0;e<4;e++)FF(t,i%256),i=LF(i/256);return Wi(t,".")}if(typeof i=="object"){for(t="",n=KF(i),e=0;e<8;e++)r&&i[e]===0||(r&&(r=!1),n===e?(t+=e?":":"::",r=!0):(t+=NF(i[e],16),e<7&&(t+=":")));return"["+t+"]"}return i},ta={},j6=th({},ta,{" ":1,'"':1,"<":1,">":1,"`":1}),Y6=th({},j6,{"#":1,"?":1,"{":1,"}":1}),Bc=th({},Y6,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Dn=function(i,t){var e=wF(i,0);return e>32&&e<127&&!Zc(t,i)?i:encodeURIComponent(i)},$s={ftp:21,file:null,http:80,https:443,ws:80,wss:443},qi=function(i,t){var e;return i.length===2&&ve(q6,Yt(i,0))&&((e=Yt(i,1))===":"||!t&&e==="|")},D6=function(i){var t;return i.length>1&&qi(Xi(i,0,2))&&(i.length===2||(t=Yt(i,2))==="/"||t==="\\"||t==="?"||t==="#")},$F=function(i){return i==="."||ia(i)==="%2e"},JF=function(i){return i=ia(i),i===".."||i==="%2e."||i===".%2e"||i==="%2e%2e"},zc={},U6={},Gc={},F6={},B6={},kc={},z6={},G6={},Js={},Qs={},Vc={},Hc={},Wc={},qc={},k6={},Xc={},Br={},Ce={},V6={},er={},sn={},eh=function(i,t,e){var n=an(i),r,o,s;if(t){if(o=this.parse(n),o)throw new Kc(o);this.searchParams=null}else{if(e!==void 0&&(r=new eh(e,!0)),o=this.parse(n,null,r),o)throw new Kc(o);s=IF(new PF),s.bindURL(this),this.searchParams=s}};eh.prototype={type:"URL",parse:function(i,t,e){var n=this,r=t||zc,o=0,s="",a=!1,u=!1,l=!1,c,h,p,d;for(i=an(i),t||(n.scheme="",n.username="",n.password="",n.host=null,n.port=null,n.path=[],n.query=null,n.fragment=null,n.cannotBeABaseURL=!1,i=Uc(i,qF,""),i=Uc(i,XF,"$1")),i=Uc(i,jF,""),c=Fr(i);o<=c.length;){switch(h=c[o],r){case zc:if(h&&ve(q6,h))s+=ia(h),r=U6;else{if(t)return Fc;r=Gc;continue}break;case U6:if(h&&(ve(zF,h)||h==="+"||h==="-"||h==="."))s+=ia(h);else if(h===":"){if(t&&(n.isSpecial()!==Zc($s,s)||s==="file"&&(n.includesCredentials()||n.port!==null)||n.scheme==="file"&&!n.host))return;if(n.scheme=s,t){n.isSpecial()&&$s[n.scheme]===n.port&&(n.port=null);return}s="",n.scheme==="file"?r=qc:n.isSpecial()&&e&&e.scheme===n.scheme?r=F6:n.isSpecial()?r=G6:c[o+1]==="/"?(r=B6,o++):(n.cannotBeABaseURL=!0,zr(n.path,""),r=V6)}else{if(t)return Fc;s="",r=Gc,o=0;continue}break;case Gc:if(!e||e.cannotBeABaseURL&&h!=="#")return Fc;if(e.cannotBeABaseURL&&h==="#"){n.scheme=e.scheme,n.path=me(e.path),n.query=e.query,n.fragment="",n.cannotBeABaseURL=!0,r=sn;break}r=e.scheme==="file"?qc:kc;continue;case F6:if(h==="/"&&c[o+1]==="/")r=Js,o++;else{r=kc;continue}break;case B6:if(h==="/"){r=Qs;break}else{r=Ce;continue}case kc:if(n.scheme=e.scheme,h===Xt)n.username=e.username,n.password=e.password,n.host=e.host,n.port=e.port,n.path=me(e.path),n.query=e.query;else if(h==="/"||h==="\\"&&n.isSpecial())r=z6;else if(h==="?")n.username=e.username,n.password=e.password,n.host=e.host,n.port=e.port,n.path=me(e.path),n.query="",r=er;else if(h==="#")n.username=e.username,n.password=e.password,n.host=e.host,n.port=e.port,n.path=me(e.path),n.query=e.query,n.fragment="",r=sn;else{n.username=e.username,n.password=e.password,n.host=e.host,n.port=e.port,n.path=me(e.path),n.path.length--,r=Ce;continue}break;case z6:if(n.isSpecial()&&(h==="/"||h==="\\"))r=Js;else if(h==="/")r=Qs;else{n.username=e.username,n.password=e.password,n.host=e.host,n.port=e.port,r=Ce;continue}break;case G6:if(r=Js,h!=="/"||Yt(s,o+1)!=="/")continue;o++;break;case Js:if(h!=="/"&&h!=="\\"){r=Qs;continue}break;case Qs:if(h==="@"){a&&(s="%40"+s),a=!0,p=Fr(s);for(var g=0;g<p.length;g++){var v=p[g];if(v===":"&&!l){l=!0;continue}var _=Dn(v,Bc);l?n.password+=_:n.username+=_}s=""}else if(h===Xt||h==="/"||h==="?"||h==="#"||h==="\\"&&n.isSpecial()){if(a&&s==="")return BF;o-=Fr(s).length+1,s="",r=Vc}else s+=h;break;case Vc:case Hc:if(t&&n.scheme==="file"){r=Xc;continue}else if(h===":"&&!u){if(s==="")return tr;if(d=n.parseHost(s),d)return d;if(s="",r=Wc,t===Hc)return}else if(h===Xt||h==="/"||h==="?"||h==="#"||h==="\\"&&n.isSpecial()){if(n.isSpecial()&&s==="")return tr;if(t&&s===""&&(n.includesCredentials()||n.port!==null))return;if(d=n.parseHost(s),d)return d;if(s="",r=Br,t)return;continue}else h==="["?u=!0:h==="]"&&(u=!1),s+=h;break;case Wc:if(ve($c,h))s+=h;else if(h===Xt||h==="/"||h==="?"||h==="#"||h==="\\"&&n.isSpecial()||t){if(s!==""){var E=ra(s,10);if(E>65535)return O6;n.port=n.isSpecial()&&E===$s[n.scheme]?null:E,s=""}if(t)return;r=Br;continue}else return O6;break;case qc:if(n.scheme="file",h==="/"||h==="\\")r=k6;else if(e&&e.scheme==="file")switch(h){case Xt:n.host=e.host,n.path=me(e.path),n.query=e.query;break;case"?":n.host=e.host,n.path=me(e.path),n.query="",r=er;break;case"#":n.host=e.host,n.path=me(e.path),n.query=e.query,n.fragment="",r=sn;break;default:D6(Wi(me(c,o),""))||(n.host=e.host,n.path=me(e.path),n.shortenPath()),r=Ce;continue}else{r=Ce;continue}break;case k6:if(h==="/"||h==="\\"){r=Xc;break}e&&e.scheme==="file"&&!D6(Wi(me(c,o),""))&&(qi(e.path[0],!0)?zr(n.path,e.path[0]):n.host=e.host),r=Ce;continue;case Xc:if(h===Xt||h==="/"||h==="\\"||h==="?"||h==="#"){if(!t&&qi(s))r=Ce;else if(s===""){if(n.host="",t)return;r=Br}else{if(d=n.parseHost(s),d)return d;if(n.host==="localhost"&&(n.host=""),t)return;s="",r=Br}continue}else s+=h;break;case Br:if(n.isSpecial()){if(r=Ce,h!=="/"&&h!=="\\")continue}else if(!t&&h==="?")n.query="",r=er;else if(!t&&h==="#")n.fragment="",r=sn;else if(h!==Xt&&(r=Ce,h!=="/"))continue;break;case Ce:if(h===Xt||h==="/"||h==="\\"&&n.isSpecial()||!t&&(h==="?"||h==="#")){if(JF(s)?(n.shortenPath(),h!=="/"&&!(h==="\\"&&n.isSpecial())&&zr(n.path,"")):$F(s)?h!=="/"&&!(h==="\\"&&n.isSpecial())&&zr(n.path,""):(n.scheme==="file"&&!n.path.length&&qi(s)&&(n.host&&(n.host=""),s=Yt(s,0)+":"),zr(n.path,s)),s="",n.scheme==="file"&&(h===Xt||h==="?"||h==="#"))for(;n.path.length>1&&n.path[0]==="";)DF(n.path);h==="?"?(n.query="",r=er):h==="#"&&(n.fragment="",r=sn)}else s+=Dn(h,Y6);break;case V6:h==="?"?(n.query="",r=er):h==="#"?(n.fragment="",r=sn):h!==Xt&&(n.path[0]+=Dn(h,ta));break;case er:!t&&h==="#"?(n.fragment="",r=sn):h!==Xt&&(h==="'"&&n.isSpecial()?n.query+="%27":h==="#"?n.query+="%23":n.query+=Dn(h,ta));break;case sn:h!==Xt&&(n.fragment+=Dn(h,j6));break}o++}},parseHost:function(i){var t,e,n;if(Yt(i,0)==="["){if(Yt(i,i.length-1)!=="]"||(t=ZF(Xi(i,1,-1)),!t))return tr;this.host=t}else if(this.isSpecial()){if(i=TF(i),ve(HF,i)||(t=YF(i),t===null))return tr;this.host=t}else{if(ve(WF,i))return tr;for(t="",e=Fr(i),n=0;n<e.length;n++)t+=Dn(e[n],ta);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return Zc($s,this.scheme)},shortenPath:function(){var i=this.path,t=i.length;t&&(this.scheme!=="file"||t!==1||!qi(i[0],!0))&&i.length--},serialize:function(){var i=this,t=i.scheme,e=i.username,n=i.password,r=i.host,o=i.port,s=i.path,a=i.query,u=i.fragment,l=t+":";return r!==null?(l+="//",i.includesCredentials()&&(l+=e+(n?":"+n:"")+"@"),l+=Hi(r),o!==null&&(l+=":"+o)):t==="file"&&(l+="//"),l+=i.cannotBeABaseURL?s[0]:s.length?"/"+Wi(s,"/"):"",a!==null&&(l+="?"+a),u!==null&&(l+="#"+u),l},setHref:function(i){var t=this.parse(i);if(t)throw new Kc(t);this.searchParams.update()},getOrigin:function(){var i=this.scheme,t=this.port;if(i==="blob")try{return new Gr(i.path[0]).origin}catch(e){return"null"}return i==="file"||!this.isSpecial()?"null":i+"://"+Hi(this.host)+(t!==null?":"+t:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(i){this.parse(an(i)+":",zc)},getUsername:function(){return this.username},setUsername:function(i){var t=Fr(an(i));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var e=0;e<t.length;e++)this.username+=Dn(t[e],Bc)}},getPassword:function(){return this.password},setPassword:function(i){var t=Fr(an(i));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var e=0;e<t.length;e++)this.password+=Dn(t[e],Bc)}},getHost:function(){var i=this.host,t=this.port;return i===null?"":t===null?Hi(i):Hi(i)+":"+t},setHost:function(i){this.cannotBeABaseURL||this.parse(i,Vc)},getHostname:function(){var i=this.host;return i===null?"":Hi(i)},setHostname:function(i){this.cannotBeABaseURL||this.parse(i,Hc)},getPort:function(){var i=this.port;return i===null?"":an(i)},setPort:function(i){this.cannotHaveUsernamePasswordPort()||(i=an(i),i===""?this.port=null:this.parse(i,Wc))},getPathname:function(){var i=this.path;return this.cannotBeABaseURL?i[0]:i.length?"/"+Wi(i,"/"):""},setPathname:function(i){this.cannotBeABaseURL||(this.path=[],this.parse(i,Br))},getSearch:function(){var i=this.query;return i?"?"+i:""},setSearch:function(i){i=an(i),i===""?this.query=null:(Yt(i,0)==="?"&&(i=Xi(i,1)),this.query="",this.parse(i,er)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var i=this.fragment;return i?"#"+i:""},setHash:function(i){if(i=an(i),i===""){this.fragment=null;return}Yt(i,0)==="#"&&(i=Xi(i,1)),this.fragment="",this.parse(i,sn)},update:function(){this.query=this.searchParams.serialize()||null}};var Gr=function(t){var e=MF(this,wt),n=CF(arguments.length,1)>1?arguments[1]:void 0,r=RF(e,new eh(t,!1,n));Jc||(e.href=r.serialize(),e.origin=r.getOrigin(),e.protocol=r.getProtocol(),e.username=r.getUsername(),e.password=r.getPassword(),e.host=r.getHost(),e.hostname=r.getHostname(),e.port=r.getPort(),e.pathname=r.getPathname(),e.search=r.getSearch(),e.searchParams=r.getSearchParams(),e.hash=r.getHash())},wt=Gr.prototype,jt=function(i,t){return{get:function(){return na(this)[i]()},set:t&&function(e){return na(this)[t](e)},configurable:!0,enumerable:!0}};Jc&&(qt(wt,"href",jt("serialize","setHref")),qt(wt,"origin",jt("getOrigin")),qt(wt,"protocol",jt("getProtocol","setProtocol")),qt(wt,"username",jt("getUsername","setUsername")),qt(wt,"password",jt("getPassword","setPassword")),qt(wt,"host",jt("getHost","setHost")),qt(wt,"hostname",jt("getHostname","setHostname")),qt(wt,"port",jt("getPort","setPort")),qt(wt,"pathname",jt("getPathname","setPathname")),qt(wt,"search",jt("getSearch","setSearch")),qt(wt,"searchParams",jt("getSearchParams")),qt(wt,"hash",jt("getHash","setHash")));ea(wt,"toJSON",function(){return na(this).serialize()},{enumerable:!0});ea(wt,"toString",function(){return na(this).serialize()},{enumerable:!0});Vi&&(jc=Vi.createObjectURL,Yc=Vi.revokeObjectURL,jc&&ea(Gr,"createObjectURL",L6(jc,Vi)),Yc&&ea(Gr,"revokeObjectURL",L6(Yc,Vi)));var jc,Yc;AF(Gr,"URL");SF({global:!0,constructor:!0,forced:!bF,sham:!Jc},{URL:Gr})});var K6=m(()=>{"use strict";Z6()});var $6=m(()=>{"use strict";var QF=H(),tB=et();QF({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return tB(URL.prototype.toString,this)}})});var nh=m(()=>{"use strict";Dc()});var ih=m(()=>{"use strict";var eB=kt(),oa=B(),J6=Nt(),nB=zi(),t3=URLSearchParams,sa=t3.prototype,rB=oa(sa.append),Q6=oa(sa.delete),iB=oa(sa.forEach),oB=oa([].push),rh=new t3("a=1&a=2&b=3");rh.delete("a",1);rh.delete("b",void 0);rh+""!="a=2"&&eB(sa,"delete",function(i){var t=arguments.length,e=t<2?void 0:arguments[1];if(t&&e===void 0)return Q6(this,i);var n=[];iB(this,function(h,p){oB(n,{key:p,value:h})}),nB(t,1);for(var r=J6(i),o=J6(e),s=0,a=0,u=!1,l=n.length,c;s<l;)c=n[s++],u||c.key===r?(u=!0,Q6(this,c.key)):a++;for(;a<l;)c=n[a++],c.key===r&&c.value===o||rB(this,c.key,c.value)},{enumerable:!0,unsafe:!0})});var sh=m(()=>{"use strict";var sB=kt(),n3=B(),aB=Nt(),uB=zi(),r3=URLSearchParams,oh=r3.prototype,lB=n3(oh.getAll),cB=n3(oh.has),e3=new r3("a=1");(e3.has("a",2)||!e3.has("a",void 0))&&sB(oh,"has",function(t){var e=arguments.length,n=e<2?void 0:arguments[1];if(e&&n===void 0)return cB(this,t);var r=lB(this,t);uB(e,1);for(var o=aB(n),s=0;s<r.length;)if(r[s++]===o)return!0;return!1},{enumerable:!0,unsafe:!0})});var uh=m(()=>{"use strict";var hB=$(),pB=B(),fB=Ge(),ah=URLSearchParams.prototype,dB=pB(ah.forEach);hB&&!("size"in ah)&&fB(ah,"size",{get:function(){var t=0;return dB(this,function(){t++}),t},configurable:!0,enumerable:!0})});var i3=m(()=>{"use strict";var gB=Ln();gB("Int8",function(i){return function(e,n,r){return i(this,e,n,r)}})});var o3=m(()=>{"use strict";var mB=Ln();mB("Uint32",function(i){return function(e,n,r){return i(this,e,n,r)}})});var s3=m(()=>{"use strict";var vB=Ln();vB("Int16",function(i){return function(e,n,r){return i(this,e,n,r)}})});var a3=m(()=>{"use strict";var _B=Ln();_B("Int32",function(i){return function(e,n,r){return i(this,e,n,r)}})});var lh=m(()=>{"use strict";var yB=Ln();yB("Uint16",function(i){return function(e,n,r){return i(this,e,n,r)}})});var ga=m(()=>{"use strict";var fz=H(),dz=yt(),gz=dt(),mz=s0(),vz=J0(),_z=Lo(),yz=[].unshift(0)!==1,xz=function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(i){return i instanceof TypeError}},Ez=yz||!xz();fz({target:"Array",proto:!0,arity:1,forced:Ez},{unshift:function(t){var e=dz(this),n=gz(e),r=arguments.length;if(r){_z(n+r);for(var o=n;o--;){var s=o+r;o in e?e[s]=e[o]:vz(e,s)}for(var a=0;a<r;a++)e[a]=arguments[a]}return mz(e,n+r)}})});var k3=m((Ztt,G3)=>{"use strict";var Ek=z();G3.exports=Ek.Promise});var W3=m((Ktt,H3)=>{"use strict";var V3=mt(),Sk=Il(),bk=ri(),Mk=ot(),wk=Mk("species");H3.exports=function(i,t){var e=V3(i).constructor,n;return e===void 0||bk(n=V3(e)[wk])?t:Sk(n)}});var j3=m(($tt,X3)=>{"use strict";var q3=Ee(),Tk=TypeError,Ak=function(i){var t,e;this.promise=new i(function(n,r){if(t!==void 0||e!==void 0)throw new Tk("Bad Promise constructor");t=n,e=r}),this.resolve=q3(t),this.reject=q3(e)};X3.exports.f=function(i){return new Ak(i)}});var Z3=m((Jtt,Y3)=>{"use strict";var Ck=mt(),Rk=pt(),Pk=j3();Y3.exports=function(i,t){if(Ck(i),Rk(t)&&t.constructor===i)return t;var e=Pk.f(i),n=e.resolve;return n(t),e.promise}});var bh=m(()=>{"use strict";var Ik=H(),Lk=fn(),Ga=k3(),Nk=k(),$3=ee(),J3=J(),Ok=W3(),K3=Z3(),Dk=kt(),Sh=Ga&&Ga.prototype,Uk=!!Ga&&Nk(function(){Sh.finally.call({then:function(){}},function(){})});Ik({target:"Promise",proto:!0,real:!0,forced:Uk},{finally:function(i){var t=Ok(this,$3("Promise")),e=J3(i);return this.then(e?function(n){return K3(t,i()).then(function(){return n})}:i,e?function(n){return K3(t,i()).then(function(){throw n})}:i)}});!Lk&&J3(Ga)&&(Eh=$3("Promise").prototype.finally,Sh.finally!==Eh&&Dk(Sh,"finally",Eh,{unsafe:!0}));var Eh});var P1=m(()=>{"use strict";var RH=H(),PH=Li().findLastIndex,IH=pi();RH({target:"Array",proto:!0},{findLastIndex:function(t){return PH(this,t,arguments.length>1?arguments[1]:void 0)}});IH("findLastIndex")});var I1=m(()=>{"use strict";var LH=H(),NH=Li().findLast,OH=pi();LH({target:"Array",proto:!0},{findLast:function(t){return NH(this,t,arguments.length>1?arguments[1]:void 0)}});OH("findLast")});function S(){return S=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},S.apply(this,arguments)}var Ent=f(F(),1),Snt=f(A(),1),bnt=f(Hn(),1);import{Box3 as MV,EventDispatcher as wV,Sprite as Ah,Vector3 as Qa}from"three";var wet=f(A(),1);var lq=f(oe(),1),cq=f(se(),1),hq=f(ae(),1),pq=f(ue(),1),fq=f(le(),1),dq=f(ce(),1),gq=f(he(),1),mq=f(A(),1),Q=class{requestAnimationFrame(t){let e=window.requestAnimationFrame(()=>{this.tasks.requestAnimation.delete(e),t()});return this.tasks.requestAnimation.add(e),e}cancelAnimationFrame(t){this.tasks.requestAnimation.delete(t),window.cancelAnimationFrame(t)}setTimeout(t,e){let n=window.setTimeout(()=>{this.tasks.timeout.delete(n),t()},e);return this.tasks.timeout.add(n),n}clearTimeout(t){this.tasks.timeout.delete(t),window.clearTimeout(t)}setInterval(t,e){let n=window.setInterval(()=>{t()},e);return this.tasks.interval.add(n),n}clearInterval(t){this.tasks.interval.delete(t),window.clearInterval(t)}requestIdleCallback(t,e){let n=window.requestIdleCallback(r=>{this.tasks.requestIdleCallback.delete(n),t(r)},e);return this.tasks.requestIdleCallback.add(n),n}cancelIdleCallback(t){this.tasks.requestIdleCallback.delete(t),window.cancelIdleCallback(t)}dispose(){this.tasks.requestAnimation.forEach(t=>{window.cancelAnimationFrame(t)}),this.tasks.requestAnimation.clear(),this.tasks.requestIdleCallback.forEach(t=>{window.cancelIdleCallback(t)}),this.tasks.requestIdleCallback.clear(),this.tasks.timeout.forEach(t=>{window.clearTimeout(t)}),this.tasks.timeout.clear(),this.tasks.interval.forEach(t=>{window.clearInterval(t)}),this.tasks.interval.clear()}constructor(){this.tasks={requestAnimation:new Set,requestIdleCallback:new Set,timeout:new Set,interval:new Set}}};var _q=f(A(),1),yq=f(F(),1);import{Shape as eC,Group as nC,DirectionalLight as rC,AmbientLight as iC,Path as oC,Vector2 as um}from"three";function lm(){let i=new nC,t=new iC(16777215,2.6);return i.add(t),i}function Xo(i,t){t===void 0&&(t=[]);let e=new eC(i.map(n=>new um(...n)));return t.length&&t.forEach(n=>{var r=new oC(n.map(o=>new um(...o)));e.holes.push(r)}),e}function cm(i,t){i===void 0&&(i=16777215),t===void 0&&(t=1);let e=new rC(i,t);return e.castShadow=!0,e.shadow.radius=8,e.shadow.bias=-.001,e.shadow.mapSize.set(256,256),e.shadow.camera.left=-200,e.shadow.camera.right=200,e.shadow.camera.top=200,e.shadow.camera.bottom=-200,e}function W(i,t){if(t&&i.children&&i.children.length&&i.children.forEach(e=>{W(e,t)}),i.isMesh){let e=i;e.geometry&&e.geometry.dispose(),e.material&&(Array.isArray(e.material)?e.material.forEach(n=>{n.dispose()}):e.material.dispose())}i.isLight&&(i.dispose==null||i.dispose.call(i))}var Pq=f(Ot(),1);function Sm(i){return/[\u4E00-\u9FA5]+/g.test(i)}var Lq=f(A(),1);import{Vector3 as $o,Vector2 as Ue,Matrix3 as Ko}from"three";import{point as PC,featureCollection as IC,center as LC}from"@turf/turf";function O(i,t,e,n){let r=i.clone().project(t),o=e/2,s=n/2,a=Math.round(r.x*o+o),u=Math.round(-r.y*s+s);return{x:a,y:u}}function Dq(i,t,e,n,r){if(!r)return null;e=Math.min(1,e),n=Math.min(1,n);let o=i/e*2-1,s=1-t/n*2;return new $o(o,s,0).unproject(r)}function Jo(i){let t=IC(i.map(n=>PC(n)));return LC(t).geometry.coordinates}function xn(i,t,e){return i.x>=t.x&&i.x<=e.x&&i.y>=t.y&&i.y<=e.y}function Uq(i){let t=0,e=new $o;for(let n=1;n<i.length;n++){let r=new $o(i[n-1][0],i[n-1][1],0),o=new $o(i[n][0],i[n][1],0),s=o.distanceTo(r);s>t&&(t=s,e=o.clone().sub(r).normalize())}return e}function X(i,t){return Math.sqrt((t[0]-i[0])**2+(t[1]-i[1])**2)}function Tt(i){let t=0;for(let e=0;e<i.length-1;e++)t+=X(i[e],i[e+1]);return t}function Qo(i,t,e){let n=new Ue(t[0]-i[0],t[1]-i[1]),r=new Ue(t[0]-e[0],t[1]-e[1]),s=n.angleTo(r)*180/Math.PI,a=new Ue(t[0]-i[0],t[1]-i[1]);return new Ue(e[0]-i[0],e[1]-i[1]).cross(a)>0?s:-s}function Fq(i,t){let e=Math.min(X(i[0][0],i[0][1]),X(i[0][2],i[0][1]))-1;t||(t=Jo(i[0]));let n=NC(t,e),r=new Ue(i[0][0][0],i[0][0][1]),o=new Ue(i[0][1][0],i[0][1][1]),s=new Ue(i[0][2][0],i[0][2][1]),u=(r.distanceTo(o)>o.distanceTo(s)?o.clone().sub(r):s.clone().sub(o)).angleTo(new Ue(0,1)),l=new Ko;return l.multiply(new Ko().translate(t[0],t[1])).multiply(new Ko().rotate(u)).multiply(new Ko().translate(-t[0],-t[1])),[n.map(c=>{let h=new Ue(c[0],c[1]).applyMatrix3(l);return[h.x,h.y]})]}function NC(i,t){let e=t/2;return[[i[0]-e,i[1]+e],[i[0]+e,i[1]+e],[i[0]+e,i[1]-e],[i[0]-e,i[1]-e],[i[0]-e,i[1]+e]]}function Fe(i,t){let e=0,n=1/0,[r,o]=t;for(let s=0;s<i.length-1;s++){let[a,u]=i[s],[l,c]=i[s+1],h=Math.min(a,l)<=r&&r<=Math.max(a,l),p=Math.min(u,c)<=o&&o<=Math.max(u,c);if(h&&p){let d=Math.abs((l-a)*(o-u)-(c-u)*(r-a));d<n&&(n=d,e=s)}}return e}function bm(i,t){let e=i[0],n=i[1],r=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){let a=t[o][0],u=t[o][1],l=t[s][0],c=t[s][1];u>n!=c>n&&e<(l-a)*(n-u)/(c-u)+a&&(r=!r)}return r}var kq=f(Mm(),1);function vr(i,t){return new Proxy(i,{get:(e,n,r)=>Reflect.get(e,n,r),set:(e,n,r,o)=>{let s=Reflect.get(e,n,o),a=Reflect.set(e,n,r,o);return s!==r&&t.dispatchEvent({type:"change-"+n,value:r}),a}})}var Qq=f(A(),1),tX=f(B0(),1);function Vt(i,t){return Promise.race([i,new Promise((e,n)=>{setTimeout(()=>n(new Error("Promise timeout")),t)})])}function ns(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function Qm(i,t){let e=ns("svg");return e.setAttribute("width",i),e.setAttribute("height",t),e.style.cssText="position: absolute; left: 0; top: 0; pointer-events: none;",e}function xi(i,t){i===void 0&&(i="2");let e=ns("circle");return e.setAttribute("r",i),e.setAttribute("fill",t),e}function rs(i){let t=ns("line");return t.setAttribute("stroke",i),t}function En(i,t){let e=ns("rect");return e.setAttribute("stroke",i),e.setAttribute("fill",t),e}function qn(i,t,e){i.setAttribute("cx",""+t),i.setAttribute("cy",""+e)}function pe(i,t,e){t&&(i.setAttribute("x1",""+t.x),i.setAttribute("y1",""+t.y)),e&&(i.setAttribute("x2",""+e.x),i.setAttribute("y2",""+e.y))}function Et(i,t,e,n,r){i.setAttribute("x",""+t),i.setAttribute("y",""+e),i.setAttribute("width",""+n),i.setAttribute("height",""+r)}function tv(){return Promise.resolve()}function z0(){return new Promise(i=>{requestAnimationFrame(i)})}function ev(i){return i===void 0&&(i=1),new Promise(t=>{function e(){i<=0?t(!0):(i--,window.requestAnimationFrame(e))}window.requestAnimationFrame(e)})}var mX=f(Ei(),1),vX=f(Ot(),1),_X=f(ss(),1);function yX(i){return parseInt(i.replace("#","0x"),16)}function xX(i,t){let e=parseInt(i.substring(1,3),16),n=parseInt(i.substring(3,5),16),r=parseInt(i.substring(5,7),16),o=Math.round(e*t),s=Math.round(n*t),a=Math.round(r*t);return"#"+(1<<24|o<<16|s<<8|a).toString(16).slice(1)}function Be(i,t){t===void 0&&(t=.85);let e,n,r;if(i.startsWith("#"))e=parseInt(i.substring(1,3),16),n=parseInt(i.substring(3,5),16),r=parseInt(i.substring(5,7),16);else{let s=i.slice(4,-1).split(",");e=parseInt(s[0].trim()),n=parseInt(s[1].trim()),r=parseInt(s[2].trim())}return e=Math.min(Math.floor(e*t),255),n=Math.min(Math.floor(n*t),255),r=Math.min(Math.floor(r*t),255),"#"+((1<<24)+(e<<16)+(n<<8)+r).toString(16).slice(1)}function K0(i,t){i=i.replace(/^#/,"");let e=parseInt(i.substring(0,2),16),n=parseInt(i.substring(2,4),16),r=parseInt(i.substring(4,6),16);return t!==void 0?"rgba("+e+", "+n+", "+r+", "+t+")":"rgb("+e+", "+n+", "+r+")"}var SX=f(Ot(),1),yr=navigator.userAgent.toUpperCase().indexOf("MAC")>=0,Pv=(navigator.userAgent||"").toLocaleLowerCase(),Xn=/ios|iphone/i.test(Pv),bX=/android|adr|linux/gi.test(Pv);function xr(i){return yr?i==="Meta":i==="Control"}var AX=f(oe(),1),CX=f(se(),1),RX=f(ae(),1),PX=f(ue(),1),IX=f(le(),1),LX=f(ce(),1),NX=f(he(),1),OX=f(A(),1),$0="__once__",Iv=class{on(t,e){if(typeof e!="function")return;let n=this.events.get(t);return n?n.add(e):this.events.set(t,new Set([e]))}once(t,e){if(typeof e!="function")return;let n=""+$0+t,r=this.events.get(n);return r?r.add(e):this.events.set(n,new Set([e]))}off(t,e){let n=this.events.get(t),r=this.events.get(""+$0+t);!n&&!r||(e===void 0&&(n==null||n.clear(),r==null||r.clear()),n!=null&&n.has(e)&&n.delete(e),r!=null&&r.has(e)&&r.delete(e))}offAll(){this.events.clear()}emit(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];let o=this.events.get(t),s=this.events.get(""+$0+t);!o&&!s||(o==null||o.forEach(a=>{typeof a=="function"&&a(...n)}),s==null||s.forEach(a=>{typeof a=="function"&&a(...n)}),s==null||s.clear())}constructor(){this.events=new Map}};var vt=function(i){return i.SWITCH_FLOOR_BEFORE="switch_floor_before",i.SWITCH_FLOOR_GROUND="switch_floor_ground",i.SWITCH_FLOOR_AFTER="switch_floor_after",i}({});var qX=f(jn(),1);function Er(i){return Object.keys(i).sort().map(t=>t+"="+i[t]).join("&")}function jX(i,t){return new Promise((e,n)=>{let r=new XMLHttpRequest;r.open("GET",i,!0),Object.keys(t.headers||{}).forEach(o=>{r.setRequestHeader(o,t.headers[o])}),t.responseType&&(r.responseType=t.responseType),r.onload=()=>{if(r.status>=200&&r.status<300)if(t.responseType==="arraybuffer")e(r.response);else try{let o=JSON.parse(r.responseText);e(o)}catch(o){n(o)}else n(r.statusText)},r.onerror=()=>{n(r.statusText)},r.send()})}var $X=f(A(),1),JX=f(F(),1),n_=f(e_(),1);import{Vector2 as Si}from"three";function xP(i,t){let e=i.clone().normalize(),n=t.clone().normalize();return Math.acos(e.dot(n))}function EP(i){let t=0;return i.reduce((e,n)=>{let[r,o]=e,[s,a]=n;return t+=Math.sqrt((s-r)**2+(a-o)**2),[s,a]}),t/i.length}function r_(i,t){if(t===void 0&&(t=.25),EP(i)<t)return i;let e=(0,n_.default)(i);return r_(e,t)}function us(i,t,e,n,r,o){t===void 0&&(t=!1),e===void 0&&(e=!0),n===void 0&&(n=5),r===void 0&&(r=150),o===void 0&&(o=3);let s=[],a=!t;if(s.push(i[0]),i.length<2)return s;for(let l=0;l<i.length-2;l+=1){let c=i[l],h=i[l+1],p=i[l+2],d=new Si(c[0]-h[0],c[1]-h[1]),g=new Si(p[0]-h[0],p[1]-h[1]),v=xP(d,g)/Math.PI*180,_=d.length()+g.length();(!a||v<r&&_>.01||_>n)&&(s.push(i[l+1]),a=!0)}if(s.push(i[i.length-1]),!e)return s;let u=[];u.push(s[0]);for(let l=0;l<s.length-2;l+=1){let c=new Si(s[l][0],s[l][1]),h=new Si(s[l+1][0],s[l+1][1]),p=new Si(s[l+2][0],s[l+2][1]),d=c.distanceTo(h)/2,g=p.distanceTo(h)/2,v=h.clone(),_=h.clone();v.add(c.clone().sub(h).normalize().multiplyScalar(d>o?o/2:d)),_.add(p.clone().sub(h).normalize().multiplyScalar(g>o?o/2:g));let E=[[v.x,v.y],[h.x,h.y],[_.x,_.y]];u.push(...r_(E,o/25))}return u.push(s[s.length-1]),SP(u)}function SP(i){if(i.length<=1)return i;let t=[],e;return i.forEach(n=>{let[r,o]=n;e?r===e[0]&&o===e[1]||(e=[r,o],t.push([r,o])):(e=[r,o],t.push([r,o]))}),t}function i_(i,t,e){let n=Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2);if(n===0)return{distance:Math.sqrt((i[0]-t[0])**2+(i[1]-t[1])**2),closestPoint:t.slice(0)};let r=Math.max(0,Math.min(1,((i[0]-t[0])*(e[0]-t[0])+(i[1]-t[1])*(e[1]-t[1]))/n**2)),o=[t[0]+r*(e[0]-t[0]),t[1]+r*(e[1]-t[1])];return{distance:Math.sqrt((i[0]-o[0])**2+(i[1]-o[1])**2),closestPoint:o}}function e5(i,t,e){let[n,r]=i,[o,s]=t,a=Math.sqrt(Math.pow(o-n,2)+Math.pow(s-r,2));if(a===0||a<e)return[...t];let u=e/a,l=n+(o-n)*u,c=r+(s-r)*u;return[l,c]}var ze=function(i){return i.START="start",i.END="end",i.FRONT="front",i.RIGHT="right",i.LEFT="left",i.RIGHT_FRONT="right_front",i.LEFT_FRONT="left_front",i.RIGHT_BACK="right_back",i.LEFT_BACK="left_back",i}({});function il(i,t,e){let n=Qo(i,t,e);return ol(n)}function ol(i){return 180-Math.abs(i)<15?"front":i>135?"right_front":i<-135?"left_front":i<=135&&i>=60?"right":i>=-135&&i<=-60?"left":i<60&&i>0?"right_back":i>-60&&i<0?"left_back":"front"}function n5(i){if(!i.length)return[];if(i.length===1)return[{direction:"start",distance:0,points:i}];let t=[{direction:"start",distance:X(i[0],i[1]),points:[i[0],i[1]]}];for(let e=2;e<i.length;e++){let n=il(i[e-2],i[e-1],i[e]);if(n==="front"){let r=t[t.length-1],o=X(i[e-1],i[e]);r.distance+=o,e!==2&&r.points.push(i[e-1])}else t.push({direction:n,distance:X(i[e-1],i[e]),points:[i[e-1],i[e]]})}return t.push({direction:"end",distance:0,points:[i[i.length-1]]}),t}function o_(i,t){if(i.length<2)return-1;let e=0;for(let n=1;n<i.length;n++){let r=i[n-1],o=i[n],s=[t[0]-r[0],t[1]-r[1]],a=[o[0]-r[0],o[1]-r[1]],u=Math.min(o[0],r[0])<=t[0]&&t[0]<=Math.max(o[0],r[0]),l=Math.min(o[1],r[1])<=t[1]&&t[1]<=Math.max(o[1],r[1]);if(u&&l){let c=s[0]*a[1]-s[1]*a[0];if(Math.abs(c)<1e-6){let h=Math.sqrt((t[0]-r[0])**2+(t[1]-r[1])**2);return e+h}}e+=Math.sqrt((o[0]-r[0])**2+(o[1]-r[1])**2)}return-1}function Sr(i,t){if(i.length<2){var e;return(e=i[0])!=null?e:null}let n=0;for(let r=1;r<i.length;r++){let o=i[r-1],s=i[r],a=Math.sqrt((s[0]-o[0])**2+(s[1]-o[1])**2);if(n+=a,n>=t){let u=(t-(n-a))/a,l=o[0]+(s[0]-o[0])*u,c=o[1]+(s[1]-o[1])*u;return[l,c]}}return null}var c5=f(F(),1),h5=f(A(),1),p5=f(Ot(),1),Me=f(ul(),1);var Ht="___",x_=class{initRoute(t){this.clear(),this.roadInfo=t,t.length&&(t.forEach(e=>{e.points.forEach(n=>{let r=""+e.floor+Ht+n.id;if(this.pointMap.set(r,n),this.nodeMap.set(""+n.floor+Ht+n.nodeId,r),n.type==="straightLadder"){let o=this.straightLadderMap.get(n.name)||[];o.push(S({},n)),this.straightLadderMap.set(n.name,o)}if(n.type==="staircase"){let o=this.staircaseMap.get(n.name)||[];o.push(S({},n)),this.staircaseMap.set(n.name,o)}if(n.type==="escalator"){let o=this.escalatorMap.get(n.name)||{};n.escalatorDirection==="exit"?o.end={floor:n.floor,id:n.id}:o.start={floor:n.floor,id:n.id},this.escalatorMap.set(n.name,o)}if(n.type==="facility"){let o=this.facilityMap.get(n.targetId)||[];o.push(S({},n)),this.facilityMap.set(n.targetId,o)}}),e.lines.filter(n=>n.direction!=="no").forEach(n=>{var r,o;let s=""+e.floor+Ht+n.from,a=""+e.floor+Ht+n.to,u=(r=this.pointMap.get(s))==null?void 0:r.cds,l=(o=this.pointMap.get(a))==null?void 0:o.cds;if(u!=null&&u.length&&(l!=null&&l.length)){let c=X(u,l);this.addLineItem(s,a,c),n.direction==="double"&&this.addLineItem(a,s,c)}})}),this.initBaseRoute(),this.initEscalatorRoute(),this.initStraightLadderRoute())}addLineItem(t,e,n,r){r===void 0&&(r=this.lineMap);let o=r.get(t)||new Map;o.set(e,n),r.set(t,o)}addFacilityToLineMap(t,e,n,r){[...this.straightLadderMap,...this.staircaseMap].forEach(o=>{let[s,a]=o;if(!(a.length<2))for(let c=0;c<a.length;c++){let h=""+a[c].floor+Ht+a[c].id;for(let p=0;p<a.length;p++)if(c!==p){var u,l;let d=""+a[p].floor+Ht+a[p].id,g=(u=this.pointMap.get(h))==null?void 0:u.cds,v=(l=this.pointMap.get(d))==null?void 0:l.cds;if(g!=null&&g.length&&(v!=null&&v.length))if(a[c].type==="straightLadder"){let _=e;this.addLineItem(h,d,_,r)}else{let _=n;this.addLineItem(h,d,_,r)}}}}),this.escalatorMap.forEach((o,s)=>{if(o.start&&o.end){var a,u;let l=""+o.start.floor+Ht+o.start.id,c=""+o.end.floor+Ht+o.end.id,h=(a=this.pointMap.get(l))==null?void 0:a.cds,p=(u=this.pointMap.get(c))==null?void 0:u.cds;if(h!=null&&h.length&&(p!=null&&p.length)){let d=t;this.addLineItem(l,c,d,r)}}})}initBaseRoute(){let t=new Map([...this.lineMap]);this.addFacilityToLineMap(1,this.lift_priority,3e4,t),this.baseRoute=new Me.default(t)}initEscalatorRoute(){let t=new Map([...this.lineMap]),e=1e4;this.addFacilityToLineMap(1*e,this.lift_priority*e,3e4*e,t),this.escalatorRoute=new Me.default(t)}initStraightLadderRoute(){let t=new Map([...this.lineMap]),e=1e4;this.addFacilityToLineMap(3*e,1*e,3e4*e,t),this.straightLadderRoute=new Me.default(t)}checkStart(t){return!(!t.floor||!t.nodeId&&(!t.coord||t.coord.length<2))}checkEnd(t){return t.facility?!0:this.checkStart(t)}transformStart(t){var e;if(t.nodeId){let n=this.nodeMap.get(""+t.floor+Ht+t.nodeId);if(n){let[r,o]=n.split(Ht);return{floor:r,id:o}}}if((e=t.coord)!=null&&e.length){let n=this.roadInfo.find(o=>o.floor===t.floor);if(!n)return null;let r=n.points.reduce((o,s)=>{let a=X(t.coord,s.cds);return a<o.min&&(o.min=a,o.point=s),o},{min:1/0,point:n.points[0]});return{floor:r.point.floor,id:r.point.id}}return null}transformEnd(t){if(t.floor){let e=this.transformStart(t);if(e)return e}if(t.facility){let e=this.facilityMap.get(t.facility);if(e!=null&&e.length)return{floor:t.floor,facility:t.facility}}return null}getPath(t,e,n){if(n===void 0&&(n=""),!this.checkStart(t))return"start-error";if(!this.checkEnd(e))return"end-error";let r=this.transformStart(t);if(!r)return"no-start";let o=this.transformEnd(e);if(!o)return"no-end";let s=this.getBasePath.bind(this);switch(n){case"escalator":s=this.getEscalatorPath.bind(this);break;case"straightLadder":s=this.getStraightLadderPath.bind(this);break;default:s=this.getBasePath.bind(this);break}if(o.id)return s(r,o);if(o.facility){let a=this.facilityMap.get(o.facility).filter(l=>o.floor?l.floor===o.floor:!0);if(!a.length)return null;let u=a.map(l=>s(r,{floor:l.floor,id:l.id})).filter(l=>!!l);return u.reduce((l,c)=>{let h=c.reduce((p,d)=>p+Tt(d.points),0);return h<l.distance&&(l.distance=h,l.path=c),l},{distance:1/0,path:u[0]}).path}}getRoutePath(t,e,n){let r=""+t.floor+Ht+t.id,o=""+e.floor+Ht+e.id,s=n.path(r,o);if(!s)return null;let a=[];return s.map(u=>{let l=this.pointMap.get(u);if(l){var c;let{floor:h}=l;if(((c=a[a.length-1])==null?void 0:c.floor)===h){let p=a[a.length-1];p.points.push(l.cds),p.endType=l.type,p.destId=l.nodeId,p.distance=Tt(p.points)}else a.push({floor:h,points:[l.cds],endType:l.type,destId:l.nodeId,distance:0})}}),a}getBasePath(t,e){return this.getRoutePath(t,e,this.baseRoute)}getEscalatorPath(t,e){return this.getRoutePath(t,e,this.escalatorRoute)}getStraightLadderPath(t,e){return this.getRoutePath(t,e,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 Me.default,this.escalatorRoute=new Me.default,this.straightLadderRoute=new Me.default}constructor(t=3){this.lift_priority=t,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 Me.default,this.escalatorRoute=new Me.default,this.straightLadderRoute=new Me.default}};var T5=f(A(),1),A5=f(Ot(),1),C5=f(F(),1),R5=f(oe(),1),P5=f(se(),1),I5=f(ae(),1),L5=f(ue(),1),N5=f(le(),1),O5=f(ce(),1),D5=f(he(),1),U5=f(hs(),1),F5=f(ps(),1),gt=f(ul(),1);import{cloneDeep as Mn,isNil as fs}from"lodash";import{Vector2 as hl}from"three";var G="___",F_=class{isFacilityByType(t){return["facility","escalator","straightLadder","staircase","ramp","connectionPoint"].includes(t)}initFacilities(t){this.facilities=t.map(e=>{let n=[];try{n=JSON.parse(e.entry_end_floor)}catch(o){n=[]}let r=[];try{r=JSON.parse(e.entry_start_floor)}catch(o){r=[]}return S({},e,{entry_start_floor:r,entry_end_floor:n})})}getParkingSpaceInfo(t,e){let n=""+t+G+e;var r;return(r=this.parkingMap.get(n))!=null?r:null}getNodeInfo(t,e){let n=""+t+G+e,r=this.nodeMap.get(n);if(!(r!=null&&r.length))return null;let o=this.pointMap.get(r[0]);return o!=null?o:null}initRoute(t,e){this.clear(),this.roadInfo=t,this.initFacilities(e);let n=new Date,r=n.getHours()*60+n.getMinutes();t.length&&(t.forEach(o=>{let s=(o.points||[]).filter(a=>!fs(a.passWeight)&&a.passWeight!==1&&!fs(a.coverageArea)&&a.coverageArea!==0);(o.points||[]).filter(a=>a.openStatus!==!1).filter(a=>{if(!a.startTime||!a.endTime)return!0;let[u,l]=a.startTime.split(":").map(g=>+g),[c,h]=a.endTime.split(":").map(g=>+g),p=u*60+l,d=c*60+h;return r>=p&&r<=d}).forEach(a=>{a.floor=o.floor;let u=""+o.floor+G+a.id,l=""+o.floor+G+a.nodeId,c=this.nodeMap.get(l)||[];if(c.push(""+o.floor+G+(a.relatedId||a.id)),this.nodeMap.set(""+o.floor+G+a.nodeId,c),this.pointMap.set(u,a),this.isFacilityByType(a.type)){let h=this.facilities.find(p=>p.id===+a.targetId);if(h){switch(h.entry_infra_type){case"straightLadder":if(h.entry_end_floor.find(v=>v.floor===o.floor)&&h.entry_start_floor.find(v=>v.floor===o.floor)){let v=this.straightLadderMap.get(a.targetId)||[];v.push(S({},a)),this.straightLadderMap.set(a.targetId,v)}break;case"staircase":if(h.entry_end_floor.find(v=>v.floor===o.floor)&&h.entry_start_floor.find(v=>v.floor===o.floor)){let v=this.staircaseMap.get(a.targetId)||[];v.push(S({},a)),this.staircaseMap.set(a.targetId,v)}break;case"escalator":let d=this.escalatorMap.get(a.targetId)||[];if(h.entry_start_floor.find(v=>v.floor===o.floor)){let v=d.find(_=>{var E;return((E=_.end)==null?void 0:E.floor)!==o.floor&&!_.start});v?v.start=a:d.push({start:a})}if(h.entry_end_floor.find(v=>v.floor===o.floor)){let v=d.find(_=>{var E;return((E=_.start)==null?void 0:E.floor)!==o.floor&&!_.end});v?v.end=a:d.push({end:a})}this.escalatorMap.set(a.targetId,d);break;case"ramp":let g=this.rampMap.get(a.targetId)||[];if(h.entry_start_floor.find(v=>v.floor===o.floor)){let v=g.find(_=>{var E;return((E=_.end)==null?void 0:E.floor)!==o.floor&&!_.start});v?v.start=a:g.push({start:a})}if(h.entry_end_floor.find(v=>v.floor===o.floor)){let v=g.find(_=>{var E;return((E=_.start)==null?void 0:E.floor)!==o.floor&&!_.end});v?v.end=a:g.push({end:a})}this.rampMap.set(a.targetId,g);break;case"connectionPoint":if(h.entry_end_floor.find(v=>v.floor===o.floor)&&h.entry_start_floor.find(v=>v.floor===o.floor)){let v=this.connectionPointMap.get(a.targetId)||[];v.push(S({},a)),this.connectionPointMap.set(a.targetId,v)}break}let p=this.facilityMap.get(a.targetId)||[];p.push(S({},a)),this.facilityMap.set(a.targetId,p)}}a.type==="parkingSpace"&&a.name.split(/[,,]/).forEach(p=>{this.parkingMap.set(""+o.floor+G+p,a)})}),(o.lines||[]).filter(a=>a.to!==a.from).forEach(a=>{let u=""+o.floor+G+a.from,l=""+o.floor+G+a.to,c=this.pointMap.get(u),h=this.pointMap.get(l);if(!c||!h)return;let p=c.cds,d=h.cds,g=X(p,d);if(s.forEach(v=>{(v.id===a.from||v.id===a.to)&&(g=g/v.passWeight);let _=X(p,v.cds)<=v.coverageArea,E=X(d,v.cds)<=v.coverageArea;(_||E)&&(g=g/v.passWeight)}),!c.permission&&!h.permission){switch(this.addLineItem(u,l,g),this.addLineItem(l,u,g),a.direction){case"double":this.addLineItem(u,l,g,this.forwardLineMap),this.addLineItem(l,u,g,this.forwardLineMap);break;case"single":this.addLineItem(u,l,g,this.forwardLineMap);break;case"back":this.addLineItem(l,u,g,this.forwardLineMap);break}(c.type==="parkingSpace"||h.type==="parkingSpace")&&a.direction==="noDir"&&(this.addLineItem(u,l,g,this.forwardLineMap),this.addLineItem(l,u,g,this.forwardLineMap))}else c.permission&&(this.setPermissionLine(u,l,c.permission,g,""),this.setPermissionLine(l,u,c.permission,g,"")),h.permission&&h.permission!==c.permission&&(this.setPermissionLine(u,l,h.permission,g,""),this.setPermissionLine(l,u,h.permission,g,""))})}),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,n,r,o){this.getPermissionMap(n).add({fromKey:t,toKey:e,distance:r,type:o})}addPermissionFacility(){this.straightLadderMap.forEach((t,e)=>{if(t.length<2){this.straightLadderMap.delete(e);return}for(let n=0;n<t.length;n++){let r=""+t[n].floor+G+t[n].id,o=this.pointMap.get(r);if(o){for(let s=0;s<t.length;s++)if(n!==s){let a=""+t[s].floor+G+t[s].id,u=this.pointMap.get(a);if(!u)continue;o.permission&&this.setPermissionLine(r,a,o.permission,1,"straightLadder"),u.permission&&u.permission!==o.permission&&this.setPermissionLine(r,a,u.permission,1,"straightLadder")}}}}),this.staircaseMap.forEach((t,e)=>{if(t.length<2){this.staircaseMap.delete(e);return}for(let n=0;n<t.length;n++){let r=""+t[n].floor+G+t[n].id,o=this.pointMap.get(r);if(o){for(let s=0;s<t.length;s++)if(n!==s){let a=""+t[s].floor+G+t[s].id,u=this.pointMap.get(a);if(!u)continue;o.permission&&this.setPermissionLine(r,a,o.permission,1,"staircase"),u.permission&&u.permission!==o.permission&&this.setPermissionLine(r,a,u.permission,1,"staircase")}}}}),this.escalatorMap.forEach((t,e)=>{t.forEach(n=>{if(n.start&&n.end){let r=""+n.start.floor+G+n.start.id,o=""+n.end.floor+G+n.end.id,s=this.pointMap.get(r),a=this.pointMap.get(o);s&&a&&(s.permission&&this.setPermissionLine(r,o,s.permission,1,"escalator"),a.permission&&a.permission!==s.permission&&this.setPermissionLine(r,o,a.permission,1,"escalator"))}})}),this.rampMap.forEach((t,e)=>{t.forEach(n=>{if(n.start&&n.end){let r=""+n.start.floor+G+n.start.id,o=""+n.end.floor+G+n.end.id,s=this.pointMap.get(r),a=this.pointMap.get(o);s&&a&&(s.permission&&this.setPermissionLine(r,o,s.permission,10,"ramp"),a.permission&&a.permission!==s.permission&&this.setPermissionLine(r,o,a.permission,10,"ramp"))}})}),this.connectionPointMap.forEach((t,e)=>{if(t.length<2){this.connectionPointMap.delete(e);return}for(let n=0;n<t.length;n++){let r=""+t[n].floor+G+t[n].id,o=this.pointMap.get(r);if(o){for(let s=0;s<t.length;s++)if(n!==s){let a=""+t[s].floor+G+t[s].id,u=this.pointMap.get(a);if(!u)continue;o.permission&&this.setPermissionLine(r,a,o.permission,1,"connectionPoint"),u.permission&&u.permission!==o.permission&&this.setPermissionLine(r,a,u.permission,1,"connectionPoint")}}}})}addPermissionLineToMap(t,e,n,r){this.getPermissionMap(t).forEach(s=>{e.includes(s.type)&&(s.type===""?this.addLineItem(s.fromKey,s.toKey,s.distance,n):this.addLineItem(s.fromKey,s.toKey,r.get(s.type),n))})}addLineItem(t,e,n,r){r===void 0&&(r=this.lineMap);let o=r.get(t)||new Map;o.set(e,n),r.set(t,o)}addFacilityToLineMap(t,e,n,r){[...this.straightLadderMap,...this.staircaseMap].forEach(o=>{let[s,a]=o;if(!(a.length<2))for(let u=0;u<a.length;u++){let l=""+a[u].floor+G+a[u].id,c=this.pointMap.get(l);if(!(!c||c.permission)){for(let h=0;h<a.length;h++)if(u!==h){let p=""+a[h].floor+G+a[h].id,d=this.pointMap.get(p);if(!d||d.permission)continue;if(a[u].type==="straightLadder"){let g=e;this.addLineItem(l,p,g,r)}else{let g=n;this.addLineItem(l,p,g,r)}}}}}),this.escalatorMap.forEach((o,s)=>{o.forEach(a=>{if(a.start&&a.end){let u=""+a.start.floor+G+a.start.id,l=""+a.end.floor+G+a.end.id,c=this.pointMap.get(u),h=this.pointMap.get(l);if(c&&h&&!c.permission&&!h.permission){let p=t;this.addLineItem(u,l,p,r)}}})}),this.connectionPointMap.forEach((o,s)=>{if(!(o.length<2))for(let a=0;a<o.length;a++){let u=""+o[a].floor+G+o[a].id,l=this.pointMap.get(u);if(!(!l||l.permission)){for(let c=0;c<o.length;c++)if(a!==c){let h=""+o[c].floor+G+o[c].id,p=this.pointMap.get(h);if(!p||p.permission)continue;this.addLineItem(u,h,100,r)}}}})}initBaseRoute(){let t=new Map(Mn([...this.lineMap]));this.addFacilityToLineMap(100,100*this.lift_priority,3e4,t),this.baseRoute=new gt.default(t)}initEscalatorRoute(){let t=new Map(Mn([...this.lineMap])),e=1e4;this.addFacilityToLineMap(1*e,this.lift_priority*e,3e4*e,t),this.escalatorRoute=new gt.default(t)}initStraightLadderRoute(){let t=new Map(Mn([...this.lineMap])),e=1e4;this.addFacilityToLineMap(3*e,1*e,3e4*e,t),this.straightLadderRoute=new gt.default(t)}initForwardRoute(){this.rampMap.forEach((t,e)=>{t.forEach(n=>{if(n.start&&n.end){let r=""+n.start.floor+G+n.start.id,o=""+n.end.floor+G+n.end.id,s=this.pointMap.get(r),a=this.pointMap.get(o);s&&a&&!s.permission&&!a.permission&&this.addLineItem(r,o,10,this.forwardLineMap)}})}),this.connectionPointMap.forEach((t,e)=>{if(!(t.length<2))for(let n=0;n<t.length;n++){let r=""+t[n].floor+G+t[n].id,o=this.pointMap.get(r);if(!(!o||o.permission)){for(let s=0;s<t.length;s++)if(n!==s){let a=""+t[s].floor+G+t[s].id,u=this.pointMap.get(a);if(!u||u.permission)continue;this.addLineItem(r,a,100,this.forwardLineMap)}}}}),this.forwardRoute=new gt.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,n){n===void 0&&(n={});var r;if(t.nodeId){let o=this.nodeMap.get(""+t.floor+G+t.nodeId);if(o!=null&&o.length)return o.map(s=>{let[a,u]=s.split(G);return{floor:a,id:u}})}if((r=t.coord)!=null&&r.length){let o=this.roadInfo.find(l=>l.floor===t.floor);if(!o)return null;let s=o.points.filter(l=>l.isStarted),a=o.points.filter(l=>{let c=""+l.floor+G+l.id;if(e==="forward"){if(!this.forwardLineMap.has(c)||n.adsorptionIntersection&&s.length&&!l.isStarted)return!1}else if(!this.lineMap.has(c))return!1;return!0});if(!a.length)return null;let u=a.reduce((l,c)=>{if(c.relatedId)return l;let h=X(t.coord,c.cds);return h<l.min&&(l.min=h,l.point=c),l},{min:1/0,point:a[0]});return[{floor:o.floor,id:u.point.id}]}return null}transformEnd(t,e){if(t.floor){if(t.parkingSpace){let r=this.parkingMap.get(""+t.floor+G+t.parkingSpace);if(r)return[{floor:t.floor,id:r.id}]}let n=this.transformStart(t,e);if(n)return n}if(t.facility){let r=this.facilities.filter(o=>+o.type_id==+t.facility).map(o=>o.id).map(o=>this.facilityMap.get(""+o)).flat(2);if(r!=null&&r.length)return{floor:t.floor,facility:t.facility}}return null}getPath(t,e,n,r,o,s){if(n===void 0&&(n=""),s===void 0&&(s={}),!this.checkStart(t))return"start-error";if(!this.checkEnd(e))return"end-error";let a=this.transformStart(t,n,s);if(!a)return"no-start";let u=this.transformEnd(e,n);if(!u)return"no-end";let l=[];if(Array.isArray(u))for(let p=0;p<a.length;p++){let d=a[p];for(let g=0;g<u.length;g++){let v=u[g];if(d.floor===v.floor&&d.id===v.id)return"near"}}else{l=this.facilities.filter(d=>+d.type_id==+e.facility).map(d=>d.id).map(d=>this.facilityMap.get(""+d)).flat(2).filter(d=>d).filter(d=>u.floor?d.floor===u.floor:!0);for(let d=0;d<a.length;d++){let g=a[d];for(let v=0;v<l.length;v++){let _=l[v];if(g.floor===_.floor&&g.id===_.id)return"near"}}}let c;switch(n){case"escalator":c=this.getEscalatorPath.bind(this);break;case"straightLadder":c=this.getStraightLadderPath.bind(this);break;case"forward":c=this.getForwardPath.bind(this);break;default:c=this.getBasePath.bind(this);break}let h=null;return a.forEach(p=>{if(Array.isArray(u))u.forEach(d=>{let g=c(p,d,r,o);g&&g&&(!h||g[0].consume<h[0].consume)&&(h=g)});else{if(!l.length)return null;let d=l.map(g=>c(p,{floor:g.floor,id:g.id},r,o)).filter(g=>!!g);h=d.reduce((g,v)=>{let _=v[0].consume;return _<g.distance&&(g.distance=_,g.path=v),g},{distance:1/0,path:d[0]}).path}}),h}getRoutePath(t,e,n){let r=""+t.floor+G+t.id,o=""+e.floor+G+e.id,s=n.path(r,o);if(!s)return null;let a=[],u=s.reduce((l,c,h,p)=>{if(h===0)return 0;let d=p[h-1],g=n.graph.get(d).get(c);return l+g},0);return s.map(l=>{let c=this.pointMap.get(l);if(c){var h;let{floor:p}=c,d=c.type;if(this.isFacilityByType(c.type)){let g=this.facilities.find(v=>v.id===+c.targetId);g&&(d=g.entry_infra_type)}if(((h=a[a.length-1])==null?void 0:h.floor)===p){let g=a[a.length-1];g.points.push(c.cds),g.pointInfos.push(c),g.endType=d,g.destId=c.nodeId,g.distance=Tt(g.points)}else a.push({floor:p,points:[c.cds],pointInfos:[c],endType:d,destId:c.nodeId,distance:0,consume:u})}}),a}getBasePath(t,e,n){if(!n)return this.getRoutePath(t,e,this.baseRoute);let r=Mn(this.baseRoute.graph);this.addPermissionLineToMap(n,["","escalator","staircase","straightLadder","connectionPoint"],r,new Map([["escalator",100],["connectionPoint",100],["straightLadder",100*this.lift_priority],["staircase",3e4]]));let o=new gt.default(r);return this.getRoutePath(t,e,o)}getEscalatorPath(t,e,n){if(!n)return this.getRoutePath(t,e,this.escalatorRoute);let r=Mn(this.escalatorRoute.graph),o=1e4;this.addPermissionLineToMap(n,["","escalator","staircase","straightLadder","connectionPoint"],r,new Map([["escalator",1*o],["connectionPoint",100],["straightLadder",this.lift_priority*o],["staircase",3e4*o]]));let s=new gt.default(r);return this.getRoutePath(t,e,s)}getStraightLadderPath(t,e,n){if(!n)return this.getRoutePath(t,e,this.straightLadderRoute);let r=Mn(this.straightLadderRoute.graph),o=1e4;this.addPermissionLineToMap(n,["","escalator","staircase","straightLadder","connectionPoint"],r,new Map([["escalator",3*o],["connectionPoint",100],["straightLadder",1*o],["staircase",3e4*o]]));let s=new gt.default(r);return this.getRoutePath(t,e,s)}getForwardPath(t,e,n,r){let o=new Map,s=p=>{let d=this.forwardRoute.graph.get(u);p.forEach(g=>{let v=d.get(g);fs(v)||(o.set(g,v),d.delete(g))})},a=()=>{let p=this.forwardRoute.graph.get(u);o.forEach((d,g)=>{p.set(g,d)})},u=""+t.floor+G+t.id;if(!fs(r)){let p=this.forwardLineMap.get(u),d=this.pointMap.get(u);if(d&&(p!=null&&p.size)&&p.size>1){let g=new hl(d.cds[0],d.cds[1]),v=new Map;p.forEach((E,b)=>{let w=this.pointMap.get(b);if(w){let P=new hl(w.cds[0],w.cds[1]),U=360-(new hl().subVectors(P,g).angle()/Math.PI*180-90+360)%360;v.set(b,U)}});let _=Array.from(v).filter(E=>{let[b,w]=E;return Math.abs(w-r)<=60}).map(E=>{let[b]=E;return b});if(_.length)_.forEach(E=>v.delete(E)),s([...v.keys()]);else{let E=Array.from(v).reduce((b,w)=>{let P=Math.abs(w[1]-r);return P<b.diff?{diff:P,key:w[0]}:b},{diff:1/0,key:""});v.delete(E.key),s([...v.keys()])}}}if(!n){let p=this.getRoutePath(t,e,this.forwardRoute);return a(),p||this.getRoutePath(t,e,this.forwardRoute)}let l=Mn(this.forwardRoute.graph);this.addPermissionLineToMap(n,["","ramp"],l,new Map([["ramp",10]]));let c=new gt.default(l),h=this.getRoutePath(t,e,c);if(a(),h)return h;{let p=Mn(this.forwardRoute.graph);this.addPermissionLineToMap(n,["","ramp"],p,new Map([["ramp",10]]));let d=new gt.default(p);return this.getRoutePath(t,e,d)}}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 gt.default,this.escalatorRoute=new gt.default,this.straightLadderRoute=new gt.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 gt.default,this.escalatorRoute=new gt.default,this.straightLadderRoute=new gt.default,this.forwardLineMap=new Map,this.forwardRoute=new gt.default}};var V5=f(oe(),1),H5=f(se(),1),W5=f(ae(),1),q5=f(ue(),1),X5=f(le(),1),j5=f(ce(),1),Y5=f(he(),1),Z5=f(A(),1),wn=class{static createKey(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}static genUniqueKey(){let t=this.createKey();for(;this.keySet.has(t);)t=this.createKey();return t}static removeKey(t){this.keySet.delete(t)}static dispose(){this.keySet.clear()}};wn.keySet=new Set;var $5=f(Ei(),1),J5=f(Ot(),1);function B_(i){return i.replace(/[A-Z]/g,t=>"_"+t.toLowerCase()).replace(/^_/,"")}function tt(i,t,e){return new Promise((n,r)=>{let o=wn.genUniqueKey(),s=a=>{let{data:u}=a;u.type===""+t+"_result"&&u.key===o&&(wn.removeKey(o),self.removeEventListener("message",s),u.error?r(u.error):n(u.data))};i.addEventListener("message",s),i.postMessage({type:t,key:o,data:e})})}function nj(i){let t={};for(let n in i)n.startsWith("on")&&(t[B_(n.slice(2))]=i[n]);let e=n=>y(this,null,function*(){let{data:r}=n;if(t[r.type])try{let o=yield t[r.type](r.data);if(o!=null&&o.$transfer&&Array.isArray(o.$transfer)){let s=o.$transfer;delete o.$transfer,self.postMessage({type:""+r.type+"_result",key:r.key,data:o},s)}else self.postMessage({type:""+r.type+"_result",key:r.key,data:o})}catch(o){self.postMessage({type:""+r.type+"_result",key:r.key,error:o})}else self.postMessage({type:""+r.type+"_result",key:r.key,error:"no_event"})});return self.addEventListener("message",e),()=>{self.removeEventListener("message",e)}}import{BoxGeometry as tI,BufferGeometry as eI,Line as nI,LineBasicMaterial as z_,Mesh as rI}from"three";function sj(i,t){t===void 0&&(t=16711680);let e=new z_({color:t}),n=new eI().setFromPoints(i);return new nI(n,e)}function aj(i,t){t===void 0&&(t=16711680);let e=new z_({color:t}),n=new tI(1,1,1),r=new rI(n,e);return r.position.copy(i),r}var lj=f(Hn(),1),cj=f(A(),1);function ds(i,t,e){e===void 0&&(e=0),i.forEach(n=>{if(n.geometry.coords=JSON.parse(JSON.stringify(n.geometry.cds)),n.geometry.type==="polygon"){var r;n.geometry.coords.map(o=>{Array.isArray(o)&&o.forEach(s=>{s[0]-=t[0],s[1]-=t[1]})}),n.geometry.otherCds&&(n.geometry.otherCoords=n.geometry.otherCds.map(o=>o.map(s=>br(s,t)))),(r=n.doors)!=null&&r.length&&n.doors.map(o=>{o.coord=br(o.coordinate,t)}),n.center&&(n.centerCoords=br(n.center,t))}else n.geometry.coords=br(n.geometry.cds,t),n.center&&(n.centerCoords=br(n.center,t));if(n.center_x&&n.center_y){let[o,s]=br([n.center_x,n.center_y],t);n.center_coord_x=o,n.center_coord_y=s}});for(let n=0;n<i.length;n++){let r=i[n];r.deltaHeight=1e-5*(e+n+1)}}function br(i,t){return[i[0]-t[0],i[1]-t[1]]}var pj=f(oe(),1),fj=f(se(),1),dj=f(ae(),1),gj=f(ue(),1),mj=f(le(),1),vj=f(ce(),1),_j=f(he(),1),yj=f(A(),1);import{Group as iI}from"@tweenjs/tween.js";var Tn=class{update(){this.group.update()}pause(){this.pauseTween=!0,this.getAll().forEach(t=>{this.tweenStore.add(t),t.pause()})}continue(){this.pauseTween&&(this.tweenStore.forEach(t=>{t.resume()}),this.tweenStore.clear(),this.pauseTween=!1)}remove(t){this.group.remove(t)}getAll(){return this.group.getAll()}clear(){this.getAll().forEach(t=>t.stop()),this.group.removeAll()}dispose(){this.clear()}constructor(){this.pauseTween=!1,this.tweenStore=new Set,this.group=new iI}};import{EventDispatcher as oI}from"three";var gs=class extends oI{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(t){super(),this.ctn=t,this._pointerDown=e=>{this.point={x:e.offsetX,y:e.offsetY}},this._pointerUp=e=>{if(!this.point)return;let{offsetX:n,offsetY:r}=e,{x:o,y:s}=this.point;Math.hypot(o-n+(s-r))>3||this.dispatchEvent({type:"click",e})},this.registryEvent()}};var wj=f(A(),1),Tj=f(F(),1),Aj=f(Ei(),1),Cj=f(Ot(),1);import{isNil as sI}from"lodash";import{EventDispatcher as aI}from"three";var Mr=class extends aI{_isEffectiveTask(t){return t&&typeof t.run=="function"}_getIndexByTid(t){return this._task.findIndex(e=>e.tid===t)}_createTask(t){return this._isEffectiveTask(t)?S({},t,{tid:++this._id,meta:t.meta||{}}):!1}get task(){return[...this._task]}getTasks(){return[...this._task]}add(t){if(this._isEffectiveTask(t)){let e=this._createTask(t);return this._task.push(e),this.started&&!this.activeTask&&this.start(),e.tid}return!1}replace(t,e){if(!this._isEffectiveTask(e))return console.warn("[TaskQueue] replace\u65B9\u6CD5\u4F20\u5165\u7684task\u53C2\u6570\u683C\u5F0F\u4E0D\u6B63\u786E"),!1;let n=this._getIndexByTid(t);if(n===-1)return console.warn("[TaskQueue] \u6CA1\u6709\u627E\u5230id="+t+"\u7684\u4EFB\u52A1"),!1;let r=this._createTask(e);return this._task.splice(n,1,r),r.tid}replaceByMetaType(t){var e;let n=(e=t.meta)==null?void 0:e.type;if(sI(n))return this.add(t);{let r=this._task.find(o=>o.meta.type===n);return r?this.replace(r.tid,t):this.add(t)}}remove(t){let e=this._getIndexByTid(t);return e===-1?(console.warn("[TaskQueue] remove\u65B9\u6CD5\u4F20\u5165\u7684id\uFF1A"+t+"\u627E\u4E0D\u5230\u5BF9\u5E94\u7684task"),!1):(this._task.splice(e,1),!0)}clear(){this._task.length=0}start(){this.started=!0,!this.activeTask&&this._task.length&&this.exec()}stop(){this.started=!1}exec(){return y(this,null,function*(){if(!this.started||!this._task.length)return!1;let t=this._task.shift();this.activeTask=t,this.dispatchEvent({type:"active-task-start",task:t});let e;try{e=yield t.run()}catch(n){console.warn("[task run err]",n,t)}return this.activeTask=null,this.dispatchEvent({type:"active-task-end",task:t,res:e}),this.exec()})}constructor(t=!0){super(),this._task=[],this.started=!1,this.activeTask=null,this._id=0,t&&this.start()}};var Nj=f(F(),1);import{EventDispatcher as uI}from"three";var ms=class extends uI{getWorker(){return new Promise(t=>{let e=this.pool.find(r=>r.state==="leisure");if(e){e.state="used",t(e.worker);return}if(this.pool.length<this.max&&this.workerConstructor){let r=this.workerConstructor();this.pool.push({worker:r,state:"used"}),t(r);return}let n=()=>{let r=this.pool.find(o=>o.state==="leisure");r&&(this.removeEventListener("release",n),r.state="used",t(r.worker))};this.addEventListener("release",n)})}releaseWorker(t){let e=this.pool.find(n=>n.worker===t);e&&(e.state="leisure",this.dispatchEvent({type:"release",worker:t}))}dispose(){this._listeners={},this.pool.forEach(t=>{t.worker.terminate()}),this.pool=[]}constructor(t=10,e){super(),this.max=10,this.pool=[],this.max=t,this.workerConstructor=e}};import{EventDispatcher as lI}from"three";var st=class extends lI{dispose(){this._listeners={}}};var vs=class{filter(t){let e=this.estimate,n=this.errorEstimate+this.processNoise,r=n/(n+this.measurementNoise);return this.estimate=e+r*(t-e),this.errorEstimate=(1-r)*n,this.estimate}constructor(t={}){this.estimate=0,this.errorEstimate=1,this.processNoise=.1,this.measurementNoise=1,this.measurementNoise=t.measurementNoise||1,this.processNoise=t.processNoise||.1,this.errorEstimate=t.errorEstimate||1}};var r8=f(Kn(),1),i8=f(We(),1),o8=f(qe(),1),s8=f(Xe(),1),a8=f(je(),1),u8=f(Ye(),1),l8=f(Ze(),1),c8=f(Ke(),1),h8=f($e(),1),p8=f(Je(),1),f8=f(Qe(),1),d8=f(tn(),1),g8=f(en(),1),m8=f(nn(),1),v8=f(rn(),1),_8=f(F(),1);import{BufferAttribute as Ir,BufferGeometry as LD,Color as wx,ExtrudeGeometry as ND,Vector3 as Mx}from"three";import{mergeGeometries as OD}from"three/examples/jsm/utils/BufferGeometryUtils.js";function S8(i,t,e){t===void 0&&(t=!0),e===void 0&&(e=!1);let n=i.filter(a=>a.geometry.type==="polygon");if(!n.length)return null;let r=n.map(a=>{var u;let l=a.geometry.coords,c=Xo(l[0],l.slice(1)),h=new ND(c,{steps:1,bevelEnabled:!1,depth:a.height,curveSegments:4});(u=a).deltaHeight||(u.deltaHeight=0),h.translate(0,0,a.airHeight+a.deltaHeight);let p=h.attributes.position.count,d=new Float32Array(p).fill(a.height+a.airHeight+a.deltaHeight);if(h.setAttribute("maxZ",new Ir(d,1)),h.setAttribute("opacity",new Ir(new Float32Array(p).fill(a.fillOpacity),1)),e){let _=new Float32Array(p).fill(a.airHeight+a.deltaHeight);h.setAttribute("minZ",new Ir(_,1))}let g=new wx(a.fillColor).convertLinearToSRGB(),v=new Float32Array(p*3);for(let _=0;_<p;_++)v[_*3]=g.r,v[_*3+1]=g.g,v[_*3+2]=g.b;return h.setAttribute("color",new Ir(v,3)),h}),o=OD(r);r.forEach(a=>a.dispose());let s={geometry:o};return o.dispose(),t&&(s.lineGeometry=DD(n)||void 0),s}function DD(i){let{points:t,colors:e,opacities:n}=vc(i);if(!t.length)return null;let r=new LD().setFromPoints(t);return r.setAttribute("color",new Ir(new Float32Array(e),3)),r.setAttribute("opacity",new Ir(new Float32Array(n),1)),r}function vc(i){let t=[],e=[],n=[];return i.filter(r=>r.strokeOpacity>0).map(r=>{let o=r.height+(r.deltaHeight||0)+r.airHeight,{coords:s}=r.geometry,{strokeColor:a,strokeOpacity:u}=r,l=new wx(a).convertLinearToSRGB();for(let c=0;c<s.length;c++){let h=s[c];for(let p=0;p<h.length;p++){let d=h[p],g=p+1===h.length?h[0]:h[p+1];t.push(new Mx(d[0],d[1],o)),t.push(new Mx(g[0],g[1],o)),e.push(l.r,l.g,l.b),e.push(l.r,l.g,l.b),n.push(u),n.push(u)}}}),{points:t,colors:e,opacities:n}}import{EventDispatcher as Jk,Box2 as Qk,Vector3 as ln,Vector2 as Xr,Raycaster as tV,Box3 as eV,Color as nV,AmbientLight as rV}from"three";var _tt=f(A(),1),ytt=f(oe(),1),xtt=f(se(),1),Ett=f(ae(),1),Stt=f(ue(),1),btt=f(le(),1),Mtt=f(ce(),1),wtt=f(he(),1),Ttt=f(F(),1);import{EventDispatcher as mk}from"three";var Q7=f(A(),1),tZ=f(F(),1);import{Object3D as OB,ExtrudeGeometry as DB,Mesh as UB,Box3 as ca,Vector3 as Kt,BufferGeometry as FB,LineSegments as BB,Ray as v3,Vector2 as un,DoubleSide as zB,RepeatWrapping as _3}from"three";var M8=f(A(),1);import{LineMaterial as UD}from"three/examples/jsm/lines/LineMaterial.js";import{Color as Di,LineBasicMaterial as FD,MeshStandardMaterial as BD,MeshBasicMaterial as zD,ShaderMaterial as Ui,DoubleSide as GD,LineDashedMaterial as kD}from"three";function Tx(i){return i.x+"-"+i.y+"-"+i.z}var D=class{static generateLineMaterialKey(t){let{color:e,opacity:n}=t;return e+"-"+n}static createLineMaterial(t){let{color:e,opacity:n,vertexColors:r}=t,o=this.generateLineMaterialKey({color:e,opacity:n,vertexColors:r});if(this.lineMaterialMap.has(o))return this.lineMaterialMap.get(o);let s=new FD({color:new Di(e).convertLinearToSRGB(),transparent:!0,opacity:n,vertexColors:r!=null?r:!1});return this.lineMaterialMap.set(o,s),s}static createMeshStandardMaterial(t){let{color:e,opacity:n}=t,r=e+"-"+n;if(this.meshStandardMaterialMap.has(r))return this.meshStandardMaterialMap.get(r);let o=new BD({color:new Di(e).convertLinearToSRGB(),roughness:1,transparent:!0,opacity:n,depthWrite:!0});return this.meshStandardMaterialMap.set(r,o),o}static createMeshBasicMaterial(t){let{color:e,opacity:n,vertexColors:r}=t,o=e+"-"+n+"-"+r;if(this.meshBasicMaterialMap.has(o))return this.meshBasicMaterialMap.get(o);let s=new zD({color:e,transparent:!0,opacity:n,depthWrite:!0,vertexColors:r!=null?r:!1});return this.meshBasicMaterialMap.set(o,s),s}static createShaderMaterial(t){let{gradualColor:e,center:n,maxValue:r,opacity:o,direction:s,max:a,min:u}=t,l=e.toString()+"-"+Tx(n)+"-"+r+"-"+o+"-"+Tx(s);if(this.shaderMaterialMap.has(l))return this.shaderMaterialMap.get(l);let c=`
|
|
5
5
|
uniform vec3 uColor;
|
|
6
6
|
uniform vec3 uGradualColor;
|
|
7
7
|
uniform vec3 center;
|
|
@@ -7979,7 +7979,7 @@ void main() {
|
|
|
7979
7979
|
gl_FragColor = vec4(vColor, uOpacity); // \u5176\u4ED6\u9762\u989C\u8272\uFF09
|
|
7980
7980
|
}
|
|
7981
7981
|
}
|
|
7982
|
-
`,n=-1/0,r=1/0,o=this.geometry.getAttribute("position");if(o)for(let a=0;a<o.count;a++){let u=o.getZ(a);u>n&&(n=u),u<r&&(r=u)}let s=new Xz({uniforms:{maxZ:{value:n},uColor:{value:new vh(this.options[0].fillColor)},uGradualColor1:{value:new vh(Be(this.options[0].fillColor,.99))},uGradualColor2:{value:new vh(Be(this.options[0].fillColor,.9))},uOpacity:{value:this.options[0].fillOpacity},minZ:{value:r}},vertexShader:t,fragmentShader:e,transparent:!0});this.material=s}initLineMaterial(){let{strokeColor:t,strokeOpacity:e}=this.options[0],n=D.createLineMaterial({color:t,opacity:e});return this.lineMaterial=n,n}getBorderPoints(t){let{height:e,deltaHeight:n,geometry:r}=t,o=[],s=e+(n||0),{coords:a}=r;for(let u=0;u<a.length;u++){let l=a[u];for(let c=0;c<l.length;c++){let h=l[c],p=c+1===l.length?l[0]:l[c+1];o.push(new T3(h[0],h[1],s)),o.push(new T3(p[0],p[1],s))}}return o}initLineGeometry(){let t=this.options.map(e=>{let n=this.getBorderPoints(e);return new Vz().setFromPoints(n)});this.lineGeometry=jz(t)}createBorder(){let t=new Hz(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}setOpacity(t,e){e===void 0&&(e=!1),e?this.material.uniforms.uOpacity.value=t:this.material.uniforms.uOpacity.value=Math.min(t,this.originFillOpacity),this.material.needsUpdate=!0}init(){return y(this,null,function*(){yield this.initGeometry(),this.initMaterial();let t=new Wz(this.geometry,this.material);this.add(t),this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry())})}dispose(){var t,e,n;(t=this.geometry)==null||t.dispose(),(e=this.material)==null||e.dispose(),(n=this.lineGeometry)==null||n.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.originFillOpacity=1,e.length&&(this.originFillOpacity=e[0].fillOpacity,this.init())}};var V$=f(F(),1),H$=f(A(),1);import{Float32BufferAttribute as Yz,FrontSide as Zz,InstancedMesh as Kz,Matrix4 as $z,MeshBasicMaterial as Jz,Object3D as Qz,Quaternion as tG,Shape as eG,ShapeGeometry as nG,Vector2 as Ra,Vector3 as _h}from"three";var yh={id:"",uuid:"",iconUrl:"",name:"",airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},opacity:1,visible:!0,centerCoords:[0,0],secondWidth:0,secondHeight:0,secondRotate:0},ir=class extends Qz{init(){return y(this,null,function*(){let t=this.options.reduce((r,o)=>{let{iconUrl:s}=o;return r.has(s)||r.set(s,[]),r.get(s).push(o),r},new Map),e=Array.from(t.values());(yield Promise.all(e.map(r=>y(this,null,function*(){let o=r[0].iconUrl,s=yield ht.getTextureByUrl(o);return new Jz({map:s,transparent:!0,alphaTest:.2,side:Zz})})))).forEach((r,o)=>{let s=new Kz(this.geometry,r,e[o].length);e[o].forEach((a,u)=>{let l=new $z().compose(new _h(a.centerCoords[0],a.centerCoords[1],a.deltaHeight+a.airHeight+a.height),new tG().setFromAxisAngle(new _h(0,0,1),a.secondRotate),new _h(a.secondWidth,a.secondHeight,1));s.setMatrixAt(u,l)}),this.add(s)}),this.position.z+=.004})}setOpacity(t){this.children.forEach(e=>{e.material.opacity=t,e.material.needsUpdate=!0})}dispose(){W(this),this.clear()}constructor(t,e){super(),this.context=t,this.geometry=new nG(new eG([new Ra(-.5,-.5),new Ra(-.5,.5),new Ra(.5,.5),new Ra(.5,-.5)])),this.options=e.map(r=>S({},yh,r));let n=new Yz([0,0,0,1,1,1,1,0],2);this.geometry.setAttribute("uv",n),this.init()}};import{Box3 as rG,Mesh as iG,Object3D as oG,Vector3 as sG}from"three";var aG={url:"",geometry:{type:"polygon",cds:[],coords:[],curveCpt:[],curveIndex:[]},id:"",width:0,rotate:1,airHeight:1,deltaHeight:0,center_x:0,center_y:0},A3=class extends oG{loadModel(){return y(this,null,function*(){let t=yield _t.loadModel(this.options.url);t.scene.rotation.set(Math.PI/2,0,0);let n=new rG().setFromObject(t.scene).getSize(new sG),r=Math.max(n.x,n.y),o=this.options.width/r;this.scale.set(o,o,o),this.add(t.scene),this.position.set(this.options.center_x,this.options.center_y,0),this.position.z+=this.options.airHeight+this.options.deltaHeight,this.model=t,this.rotateZ(this.options.rotate)})}meshSetMaterial(t){t instanceof iG&&(t.frustumCulled=!1,t.castShadow=!0,t.material.emissiveIntensity*=.95,t.material.emissive=t.material.color,t.material.emissiveMap=t.material.map),t.children.forEach(n=>{this.meshSetMaterial(n)})}dispose(){W(this),this.model=null}constructor(t,e){super(),this.context=t,this.model=null,this.options=Object.assign({},aG,e),this.loadModel()}};var tJ=f(F(),1);import{BufferGeometry as uG,Color as lG,LineSegments as cG,Mesh as hG,Object3D as pG,Vector2 as fG,Vector3 as C3}from"three";import{mergeGeometries as dG}from"three/examples/jsm/utils/BufferGeometryUtils.js";import{LineSegments2 as gG}from"three/examples/jsm/lines/LineSegments2.js";import{LineSegmentsGeometry as mG}from"three/examples/jsm/lines/LineSegmentsGeometry.js";var Pa=class extends pG{initGeometry(){return y(this,null,function*(){this.geometry=yield _e.GetMergedShapeGeometry(this.options)})}initMaterial(){let t=D.createMeshBasicMaterial({color:"#ffffff",opacity:1,vertexColors:!0});return this.material=t,t}initLineMaterial(){let{strokeColor:t,strokeOpacity:e}=this.options[0],n=D.createLineMaterial({color:t,opacity:e,vertexColors:!0});return this.lineMaterial=n,n}getBorderPoints(t){let{deltaHeight:e,geometry:n}=t,r=[],o=e||0,{coords:s}=n;for(let a=0;a<s.length;a++){let u=s[a];for(let l=0;l<u.length;l++){let c=u[l],h=l+1===u.length?u[0]:u[l+1];r.push(new C3(c[0],c[1],o)),r.push(new C3(h[0],h[1],o))}}return r}initDoubleLine(){let t=this.options.filter(e=>{var n,r;return e.double&&((r=e.geometry.otherCoords)==null||(n=r[1])==null?void 0:n.length)});t.length&&[!0,!1].forEach(e=>{let n=t.filter(l=>l.dashed===e);if(!n.length)return;let r=D.createLine2MaterialMap({color:"#ffffff",width:.2,dashed:e,resolution:new fG(this.context.clientSize.width,this.context.clientSize.height),vertexColors:!0}),o=[],s=[];n.forEach(l=>{let c=l.geometry.otherCoords[1],h=l.airHeight+(l.deltaHeight||0)+.01,p=new lG(l.secondColor);for(let d=0;d<c.length-1;d++){let g=c[d],v=c[d+1];o.push(g[0],g[1],h,v[0],v[1],h),s.push(p.r,p.g,p.b,p.r,p.g,p.b)}});let a=new mG;a.setPositions(o),a.setColors(s);let u=new gG(a,r);u.computeLineDistances(),u.position.z+=.01,this.add(u),this.doubleLines.push(u)})}initLineGeometry(){let t=this.options.map(e=>{let n=this.getBorderPoints(e);return new uG().setFromPoints(n)});this.lineGeometry=dG(t)}createBorder(){let t=new cG(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}init(){return y(this,null,function*(){yield this.initGeometry(),this.initMaterial();let t=new hG(this.geometry,this.material);this.add(t),this.initDoubleLine(),this.position.z+=.02+(this.options[0].deltaHeight||0)})}dispose(){var t,e;(t=this.geometry)==null||t.dispose(),(e=this.lineGeometry)==null||e.dispose(),this.doubleLines.map(n=>n.geometry.dispose()),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.doubleLines=[],e.length&&this.init()}};var lJ=f(F(),1);import{Object3D as vG,Mesh as _G,Vector3 as R3,BufferGeometry as yG,LineSegments as xG,ShaderMaterial as EG,Color as P3,ObjectLoader as SG}from"three";var I3=class extends vG{initMergedElement(){let t=new SG,e=t.parseGeometries([this.mergedElement.mergedGeometry]);if(this.geometry=e[this.mergedElement.mergedGeometry.uuid],this.initMaterial(),this.initMesh(),this.mesh.position.z=(this.mergedElement.deltaHeight||0)+this.mergedElement.airHeight,this.mergedElement.lineGeometry){let n=t.parseGeometries([this.mergedElement.lineGeometry]);this.lineGeometry=n[this.mergedElement.lineGeometry.uuid],this.initLineMaterial(),this.createBorder()}}init(){return y(this,null,function*(){this.geometry=yield this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options[0].deltaHeight+this.options[0].airHeight,this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}initGeometry(){return y(this,null,function*(){let t=yield _e.GetMergeGeometry(this.options);return this.dispatchEvent({type:"init-geometry",geometry:t}),t})}initMaterial(){let t=`
|
|
7982
|
+
`,n=-1/0,r=1/0,o=this.geometry.getAttribute("position");if(o)for(let a=0;a<o.count;a++){let u=o.getZ(a);u>n&&(n=u),u<r&&(r=u)}let s=new Xz({uniforms:{maxZ:{value:n},uColor:{value:new vh(this.options[0].fillColor)},uGradualColor1:{value:new vh(Be(this.options[0].fillColor,.99))},uGradualColor2:{value:new vh(Be(this.options[0].fillColor,.9))},uOpacity:{value:this.options[0].fillOpacity},minZ:{value:r}},vertexShader:t,fragmentShader:e,transparent:!0});this.material=s}initLineMaterial(){let{strokeColor:t,strokeOpacity:e}=this.options[0],n=D.createLineMaterial({color:t,opacity:e});return this.lineMaterial=n,n}getBorderPoints(t){let{height:e,deltaHeight:n,geometry:r}=t,o=[],s=e+(n||0),{coords:a}=r;for(let u=0;u<a.length;u++){let l=a[u];for(let c=0;c<l.length;c++){let h=l[c],p=c+1===l.length?l[0]:l[c+1];o.push(new T3(h[0],h[1],s)),o.push(new T3(p[0],p[1],s))}}return o}initLineGeometry(){let t=this.options.map(e=>{let n=this.getBorderPoints(e);return new Vz().setFromPoints(n)});this.lineGeometry=jz(t)}createBorder(){let t=new Hz(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}setOpacity(t,e){e===void 0&&(e=!1),e?this.material.uniforms.uOpacity.value=t:this.material.uniforms.uOpacity.value=Math.min(t,this.originFillOpacity),this.material.needsUpdate=!0}init(){return y(this,null,function*(){yield this.initGeometry(),this.initMaterial();let t=new Wz(this.geometry,this.material);this.add(t),this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry())})}dispose(){var t,e,n;(t=this.geometry)==null||t.dispose(),(e=this.material)==null||e.dispose(),(n=this.lineGeometry)==null||n.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.originFillOpacity=1,e.length&&(this.originFillOpacity=e[0].fillOpacity,this.init())}};var V$=f(F(),1),H$=f(A(),1);import{Float32BufferAttribute as Yz,FrontSide as Zz,InstancedMesh as Kz,Matrix4 as $z,MeshBasicMaterial as Jz,Object3D as Qz,Quaternion as tG,Shape as eG,ShapeGeometry as nG,Vector2 as Ra,Vector3 as _h}from"three";var yh={id:"",uuid:"",iconUrl:"",name:"",airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},opacity:1,visible:!0,centerCoords:[0,0],secondWidth:0,secondHeight:0,secondRotate:0},ir=class extends Qz{init(){return y(this,null,function*(){let t=this.options.reduce((r,o)=>{let{iconUrl:s}=o;return r.has(s)||r.set(s,[]),r.get(s).push(o),r},new Map),e=Array.from(t.values());(yield Promise.all(e.map(r=>y(this,null,function*(){let o=r[0].iconUrl,s=yield ht.getTextureByUrl(o);return new Jz({map:s,transparent:!0,alphaTest:.2,side:Zz})})))).forEach((r,o)=>{let s=new Kz(this.geometry,r,e[o].length);e[o].forEach((a,u)=>{let l=new $z().compose(new _h(a.centerCoords[0],a.centerCoords[1],a.deltaHeight+a.airHeight+a.height),new tG().setFromAxisAngle(new _h(0,0,1),a.secondRotate),new _h(a.secondWidth,a.secondHeight,1));s.setMatrixAt(u,l)}),this.add(s)}),this.position.z+=.004})}setOpacity(t){this.children.forEach(e=>{e.material.opacity=t,e.material.needsUpdate=!0})}dispose(){W(this),this.clear()}constructor(t,e){super(),this.context=t,this.geometry=new nG(new eG([new Ra(-.5,-.5),new Ra(-.5,.5),new Ra(.5,.5),new Ra(.5,-.5)])),this.options=e.map(r=>S({},yh,r));let n=new Yz([0,0,0,1,1,1,1,0],2);this.geometry.setAttribute("uv",n),this.init()}};import{Box3 as rG,Mesh as iG,Object3D as oG,Vector3 as sG}from"three";var aG={url:"",geometry:{type:"polygon",cds:[],coords:[],curveCpt:[],curveIndex:[]},id:"",width:0,rotate:1,airHeight:1,deltaHeight:0,center_x:0,center_y:0},A3=class extends oG{loadModel(){return y(this,null,function*(){let t=yield _t.loadModel(this.options.url);t.scene.rotation.set(Math.PI/2,0,0);let n=new rG().setFromObject(t.scene).getSize(new sG),r=Math.max(n.x,n.y),o=this.options.width/r;this.scale.set(o,o,o),this.add(t.scene),this.position.set(this.options.center_x,this.options.center_y,0),this.position.z+=this.options.airHeight+this.options.deltaHeight,this.model=t,this.rotateZ(this.options.rotate),this.dispatchEvent({type:"load-model-end",object:t})})}meshSetMaterial(t){t instanceof iG&&(t.frustumCulled=!1,t.castShadow=!0,t.material.emissiveIntensity*=.95,t.material.emissive=t.material.color,t.material.emissiveMap=t.material.map),t.children.forEach(n=>{this.meshSetMaterial(n)})}dispose(){W(this),this.model=null,this._listeners={}}constructor(t,e){super(),this.context=t,this.model=null,this.options=Object.assign({},aG,e),this.loadModel()}};var tJ=f(F(),1);import{BufferGeometry as uG,Color as lG,LineSegments as cG,Mesh as hG,Object3D as pG,Vector2 as fG,Vector3 as C3}from"three";import{mergeGeometries as dG}from"three/examples/jsm/utils/BufferGeometryUtils.js";import{LineSegments2 as gG}from"three/examples/jsm/lines/LineSegments2.js";import{LineSegmentsGeometry as mG}from"three/examples/jsm/lines/LineSegmentsGeometry.js";var Pa=class extends pG{initGeometry(){return y(this,null,function*(){this.geometry=yield _e.GetMergedShapeGeometry(this.options)})}initMaterial(){let t=D.createMeshBasicMaterial({color:"#ffffff",opacity:1,vertexColors:!0});return this.material=t,t}initLineMaterial(){let{strokeColor:t,strokeOpacity:e}=this.options[0],n=D.createLineMaterial({color:t,opacity:e,vertexColors:!0});return this.lineMaterial=n,n}getBorderPoints(t){let{deltaHeight:e,geometry:n}=t,r=[],o=e||0,{coords:s}=n;for(let a=0;a<s.length;a++){let u=s[a];for(let l=0;l<u.length;l++){let c=u[l],h=l+1===u.length?u[0]:u[l+1];r.push(new C3(c[0],c[1],o)),r.push(new C3(h[0],h[1],o))}}return r}initDoubleLine(){let t=this.options.filter(e=>{var n,r;return e.double&&((r=e.geometry.otherCoords)==null||(n=r[1])==null?void 0:n.length)});t.length&&[!0,!1].forEach(e=>{let n=t.filter(l=>l.dashed===e);if(!n.length)return;let r=D.createLine2MaterialMap({color:"#ffffff",width:.2,dashed:e,resolution:new fG(this.context.clientSize.width,this.context.clientSize.height),vertexColors:!0}),o=[],s=[];n.forEach(l=>{let c=l.geometry.otherCoords[1],h=l.airHeight+(l.deltaHeight||0)+.01,p=new lG(l.secondColor);for(let d=0;d<c.length-1;d++){let g=c[d],v=c[d+1];o.push(g[0],g[1],h,v[0],v[1],h),s.push(p.r,p.g,p.b,p.r,p.g,p.b)}});let a=new mG;a.setPositions(o),a.setColors(s);let u=new gG(a,r);u.computeLineDistances(),u.position.z+=.01,this.add(u),this.doubleLines.push(u)})}initLineGeometry(){let t=this.options.map(e=>{let n=this.getBorderPoints(e);return new uG().setFromPoints(n)});this.lineGeometry=dG(t)}createBorder(){let t=new cG(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}init(){return y(this,null,function*(){yield this.initGeometry(),this.initMaterial();let t=new hG(this.geometry,this.material);this.add(t),this.initDoubleLine(),this.position.z+=.02+(this.options[0].deltaHeight||0)})}dispose(){var t,e;(t=this.geometry)==null||t.dispose(),(e=this.lineGeometry)==null||e.dispose(),this.doubleLines.map(n=>n.geometry.dispose()),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.doubleLines=[],e.length&&this.init()}};var lJ=f(F(),1);import{Object3D as vG,Mesh as _G,Vector3 as R3,BufferGeometry as yG,LineSegments as xG,ShaderMaterial as EG,Color as P3,ObjectLoader as SG}from"three";var I3=class extends vG{initMergedElement(){let t=new SG,e=t.parseGeometries([this.mergedElement.mergedGeometry]);if(this.geometry=e[this.mergedElement.mergedGeometry.uuid],this.initMaterial(),this.initMesh(),this.mesh.position.z=(this.mergedElement.deltaHeight||0)+this.mergedElement.airHeight,this.mergedElement.lineGeometry){let n=t.parseGeometries([this.mergedElement.lineGeometry]);this.lineGeometry=n[this.mergedElement.lineGeometry.uuid],this.initLineMaterial(),this.createBorder()}}init(){return y(this,null,function*(){this.geometry=yield this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options[0].deltaHeight+this.options[0].airHeight,this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}initGeometry(){return y(this,null,function*(){let t=yield _e.GetMergeGeometry(this.options);return this.dispatchEvent({type:"init-geometry",geometry:t}),t})}initMaterial(){let t=`
|
|
7983
7983
|
varying vec3 vPosition; // \u7528\u4E8E\u4F20\u9012\u9876\u70B9\u7684\u4F4D\u7F6E\u7ED9\u7247\u6BB5\u7740\u8272\u5668
|
|
7984
7984
|
uniform float maxZ; // \u58F0\u660E\u4E00\u4E2Auniform\u53D8\u91CF
|
|
7985
7985
|
uniform vec3 uColor;
|
|
@@ -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"}),t=URL.createObjectURL(i),e=new Worker(t);return URL.revokeObjectURL(t),e}var nu=class extends rH{loaded(){return new Promise(t=>{if(this.initRoadStatus)t(!0);else{let e=n=>{let{status:r}=n;r&&(this.removeEventListener("init-road-status",e),t(!0))};this.addEventListener("init-road-status",e)}})}setRoadData(t,e){return y(this,null,function*(){this.initRoadStatus=!1,this.dispatchEvent({type:"init-road-status",status:!1}),yield tt(this.worker,"set_road_info",{roadData:t,facilities:e}),this.initRoadStatus=!0,this.dispatchEvent({type:"init-road-status",status:!0})})}getPath(t,e,n,r,o,s){return y(this,null,function*(){return n===void 0&&(n=""),new Promise((a,u)=>{let l=()=>{tt(this.worker,"get_path",{start:t,end:e,type:n,permission:r,travelDirection:o,options:s}).then(c=>{c?typeof c=="string"?u(c):a(c):u("no-path")})};if(this.initRoadStatus)l();else{let c=h=>{let{status:p}=h;p&&(this.removeEventListener("init-road-status",c),l())};this.addEventListener("init-road-status",c)}})})}getDirectionPath(t){return tt(this.worker,"get_direction_path",t)}dispose(){return y(this,null,function*(){tt(this.worker,"clear",""),this.worker.terminate()})}constructor(){super(),this.worker=Ih(),this.initRoadStatus=!1}};import{EventDispatcher as iH}from"three";function Lh(){let i=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"}),t=URL.createObjectURL(i),e=new Worker(t);return URL.revokeObjectURL(t),e}var FH={placeId:0,catLotStatusApi:"https://vrapi.aibee.cn/parking/cat-lot-status"},N1=class{setRoadData(t,e){return tt(this.worker,"set_road_info",{roadData:t,facilities:e})}recommend(t){return y(this,null,function*(){let e=yield fetch(this.options.catLotStatusApi,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({place_id:+this.options.placeId})}).then(n=>n.json()).then(n=>n.data.filter(r=>r.status===0));return tt(this.worker,"recommend",S({},t,{carLotStatus:e}))})}dispose(){this.worker.terminate()}constructor(t={}){this.worker=Dh(),this.options=S({},FH,t)}};var Wst=f(Hn(),1),qst=f(A(),1),Xst=f(jn(),1),jst=f(F(),1),Yst=f(nh(),1),Zst=f(ih(),1),Kst=f(sh(),1),$st=f(uh(),1),Jst=f(Ot(),1);var zst=f(Hn(),1);var BH={url:"",reconnect:!0,heartBeat:2e3,heartMsg:"PING",reconnectTime:3e3,reconnectMaxCount:1e6,noMessageTime:6e3},ao=class extends st{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=t=>{this.startOnMessageTimer(),this.dispatchEvent({type:"message",message:t})}}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(t){t===void 0&&(t=this.options.reconnectTime),this.stopReconnect(),this.options.reconnect&&(this.options.reconnectMaxCount--,this.options.reconnectMaxCount>=0&&(this.reconnectTimer=this.timer.setTimeout(()=>{this.initWebsocket()},t)))}stopReconnect(){this.reconnectTimer&&(this.timer.clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}startOnMessageTimer(){this.stopOnMessageTimer(),this.noMessageTimer=this.timer.setTimeout(()=>{var t;(t=this.ws)==null||t.close(),this.dispatchEvent({type:"no-message-timeout"})},this.options.noMessageTime)}stopOnMessageTimer(){this.noMessageTimer&&(this.timer.clearTimeout(this.noMessageTimer),this.noMessageTimer=null)}send(t){var e;let n=typeof t=="string"?t:JSON.stringify(t);return this.alive&&((e=this.ws)==null?void 0:e.readyState)===1?(this.ws.send(t),this.dispatchEvent({type:"send-success",msg:n}),!0):(this.dispatchEvent({type:"send-fail",msg:n}),!1)}registryEvent(){window.addEventListener("online",this.onOnline)}unRegistryEvent(){window.removeEventListener("online",this.onOnline)}close(){var t;this.unRegistryEvent(),this.options.reconnect=!1,this.alive=!1,this.stopHeart(),this.stopReconnect(),this.stopOnMessageTimer(),(t=this.ws)==null||t.close(),this.ws=null,this.dispatchEvent({type:"close"})}dispose(){this.close(),this.timer.dispose(),super.dispose()}constructor(t){super(),this.ws=null,this.alive=!1,this.timer=new Q,this.heartTimer=null,this.reconnectTimer=null,this.noMessageTimer=null,this.onOnline=()=>{this.startReconnect()},this.options=S({},BH,t||{}),this.options.url&&this.initWebsocket()}};import{isNil as O1}from"lodash";var Uh=i=>{let t=i.toString(2),e=""+Array(16-t.length+1).join("0")+t,n=parseInt(e.slice(0,4),2)*10,r=parseInt(e.slice(4,16),2);return[n,r]};var D1=class extends st{initPositionWebSocket(){let t=S({},this.options.ext_position_params,{place_id:this.options.place_id,token:this.options.access_token}),e=Object.keys(t).filter(n=>!O1(t[n])).map(n=>n+"="+t[n]).join("&");this.positionWebSocket=new ao({url:this.options.wss_position_url+"?"+e}),this.positionWebSocket.addEventListener("message",n=>{let{message:r}=n,o=(()=>{try{return JSON.parse(r.data)}catch(N){return r.data}})();if(o.command==="POSITION_RESULT"&&o.data.success)if(["POSITION","FLOOR","PARK_POSITION"].includes(o.data.success_type)&&this.useGpsFloorTimer&&(this.positionFloor=o.data.floor,this.timer.clearTimeout(this.useGpsFloorTimer),this.useGpsFloorTimer=null),o.data.success_type==="POSITION"){let{x:N,y:R,time:I,floor:C,ts:q}=o.data,K=this.positionFloor!==C;if(this.positionFloor=C,this.dispatchEvent({type:"ws-position",floor:C,x:N,y:R,time:I}),console.log("positionFloor",C,K),this.options.upload_position){var s;(s=this.positionWebSocket)==null||s.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:N,y:R,floor:C,type:"originBeacon"}),serverData:JSON.stringify(o)})}if(!this.options.use_pdr){this.dispatchEvent({type:"position",floor:C,x:N,y:R,time:new Date(q).getTime()-o.lag-o.duration});return}if(this.options.type!==1){var a;if(K){var u,l,c;(c=this.pdrPosition)==null||(l=c.pdr)==null||(u=l.particleFilter)==null||u.setPosInitFlag(!1)}(a=this.pdrPosition)==null||a.setBeaconPosition({x:N,y:R},new Date(q).getTime()-o.lag-o.duration)}else if(K){var h;if(this.resetPdr(),(h=this.carInertialPosition)==null||h.stopPositionTimer(),this.path){let Y=this.path.findIndex(hn=>hn.floor===C),V=this.path[Y];if(V){var p;this.resetPdr(),(p=this.carInertialPosition)==null||p.setBeaconPosition(V.points[0],new Date(I).getTime()-o.lag-o.duration,o.lag+o.duration)}else{var d;(d=this.carInertialPosition)==null||d.setBeaconPosition([N,R],new Date(I).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var g;(g=this.carInertialPosition)==null||g.setBeaconPosition([N,R],new Date(I).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var v;(v=this.carInertialPosition)==null||v.setBeaconPosition([N,R],new Date(I).getTime()-o.lag-o.duration,o.lag+o.duration)}}else if(o.data.success_type==="PARK_POSITION"&&o.data.success){if(this.options.type===1){let{x:N,y:R,time:I,floor:C}=o.data,q=this.positionFloor!==C;if(this.positionFloor=o.data.floor,this.dispatchEvent({type:"ws-position",floor:C,x:N,y:R,time:I}),!this.options.use_pdr){this.dispatchEvent({type:"position",floor:C,x:N,y:R,time:new Date(I).getTime()});return}if(q){var _;if(this.resetPdr(),(_=this.carInertialPosition)==null||_.stopPositionTimer(),this.path){let K=this.path.findIndex(V=>V.floor===C),Y=this.path[K];if(Y){var E;this.resetPdr(),(E=this.carInertialPosition)==null||E.setPosition(Y.points[0],new Date(I).getTime(),o.duration)}else{var b;(b=this.carInertialPosition)==null||b.setPosition([N,R],new Date(I).getTime(),o.duration)}}else{var w;(w=this.carInertialPosition)==null||w.setPosition([N,R],new Date(I).getTime(),o.duration)}}else{var P,L;if((P=this.carInertialPosition)==null||P.setPosition([N,R],new Date(I).getTime(),o.duration),!((L=this.carInertialPosition)!=null&&L.positionTimer)){var U;(U=this.carInertialPosition)==null||U.startPositionTimer()}}if(this.options.upload_position){var T;(T=this.positionWebSocket)==null||T.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:N,y:R,floor:C,type:"vision"}),serverData:JSON.stringify(o)})}}}else this.dispatchEvent({type:"floor",floor:o.data.floor,time:o.data.time})})}initSensorWebSocket(){let t=S({},this.options.ext_sensor_params,{token:this.options.access_token,place_id:this.options.place_id,record_sensor:1}),e=Object.keys(t).filter(n=>!O1(t[n])).map(n=>n+"="+t[n]).join("&");this.sensorWebSocket=new ao({url:this.options.wss_sensor_url+"?"+e})}initPdr(){this.options.type===1?(this.carInertialPosition=new yu,this.carInertialPosition.addEventListener("change-pos",t=>{let{value:e}=t,{pos:n,success:r,speed:o}=e;if(r&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:n[0],y:n[1],time:Date.now(),speed:o}),this.options.upload_position)){var s;(s=this.positionWebSocket)==null||s.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:n[0],y:n[1],floor:this.positionFloor,type:"vision_pdr"})})}}),this.carInertialPosition.addEventListener("change-compass",t=>{let{value:e}=t;this.dispatchEvent({type:"compass",value:e})})):(this.pdrPosition=new lu(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",t=>{let{data:e}=t;var n;(n=this.positionWebSocket)==null||n.send({command:"UPLOAD_SENSOR",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify(e)})}),this.pdrPosition.sensor.addEventListener("add-data-item",t=>{t.item.type==="compass"&&this.dispatchEvent({type:"compass",value:t.item.res})}),this.pdrPosition.addEventListener("position",t=>{let{x:e,y:n,_type:r}=t;if(console.log("_type",r,e,n,this.positionFloor,this.gpsFloor),r==="gps"&&!this.useGpsFloorTimer){let s=()=>{this.useGpsFloorTimer=this.timer.setTimeout(()=>{this.gpsFloor?this.positionFloor=this.gpsFloor:s()},5e3)};s()}if(this.positionFloor&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:e,y:n,time:Date.now()}),this.options.upload_position)){var o;(o=this.positionWebSocket)==null||o.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:e,y:n,floor:this.positionFloor,type:r})})}}))}setSensor(t){this.pdrPosition&&this.pdrPosition.setSensor(t)}requestDeviceOrientationPermission(){return y(this,null,function*(){if(this.pdrPosition){let t=yield this.pdrPosition.checkSensor();return t.deviceOrientation?this.pdrPosition.start():(this.dispatchEvent(S({type:"check-sensor"},t)),!t.deviceOrientation&&this.options.use_default_permission),t}else return null})}getGpsFloor(){return y(this,null,function*(){if(this.options.use_gps&&this.options.get_gps_floor_url){let t=yield fetch(this.options.get_gps_floor_url+"/"+this.options.place_id).then(e=>e.json());t.code===200&&(this.gpsFloor=t.data.gps_floor)}})}pausePdr(){if(this.options.type===1){var t;(t=this.carInertialPosition)==null||t.stopPositionTimer()}else{var e;(e=this.pdrPosition)==null||e.pause()}}continuePdr(){if(this.options.type===1)this.carInertialPosition&&(this.carInertialPosition.positionTimer||this.carInertialPosition.startPositionTimer());else{var t;(t=this.pdrPosition)==null||t.continue()}}setPathAngle(t){if(this.options.type===1){var e;(e=this.carInertialPosition)==null||e.setPathAngle(t)}}getForwardAngle(){if(this.options.type===1){var t,e;return(e=(t=this.carInertialPosition)==null?void 0:t.angle)!=null?e: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(t){this.path=t}sendBeacon(t){var e;let n=[];if(Xn)n=t.map(o=>{let[s,a]=Uh(o.major);return[o.uuid,a,o.minor,o.rssi,o.accuracy,s]}).filter(o=>o[3]!==0).sort((o,s)=>s[3]-o[3]);else{let o=t.reduce((s,a)=>{var u,l;let[c,h]=Uh(a.major),p=""+h+a.minor;return(u=s)[l=p]||(u[l]=[]),s[p].push(S({},a,{battery:c})),s},{});Object.entries(o).forEach(s=>{let[a,u]=s,{uuid:l,major:c,minor:h,accuracy:p,battery:d}=u[0];if(u.length>1){let g=u.filter(_=>_.rssi<0),v=g.reduce((_,E)=>_+E.rssi,0);n.push([l,c,h,v/g.length,p,d])}else n.push([l,c,h,u[0].rssi,p,d])})}let r={command:"POSITION",index:this.uploadIndex++,ts:Date.now(),beacons:JSON.stringify(n),ext_sensors:JSON.stringify({})};(e=this.sensorWebSocket)==null||e.send(r)}dispose(){var t,e,n,r;this.timer.dispose(),(t=this.positionWebSocket)==null||t.dispose(),this.positionWebSocket=null,(e=this.sensorWebSocket)==null||e.dispose(),this.sensorWebSocket=null,(n=this.pdrPosition)==null||n.dispose(),this.pdrPosition=null,(r=this.carInertialPosition)==null||r.dispose(),this.carInertialPosition=null,super.dispose()}constructor(t,e){super(),this.bmap=t,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 Q;let n=new URLSearchParams(location.search),r=n.get("server_env")||"prod",o={test:"nav-test.aibee.cn",prod:"nav.aibee.cn"},s="wss://"+o[r]+"/aether-walker/indoor/position",a="wss://"+o[r]+"/aether-walker/indoor/sensor";this.options=S({place_id:n.get("place_id"),access_token:n.get("access_token"),env:r,wss_position_url:s,wss_sensor_url:a,get_gps_floor_url:"https://"+o[r]+"/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:{}},e),this.initPositionWebSocket(),this.options.use_sensor&&this.initSensorWebSocket(),this.options.use_pdr&&this.initPdr(),this.options.use_gps&&this.getGpsFloor()}};var uat=f(A(),1);var U1=class extends lt{showMyPosition(t,e){var n;let r=(n=this.bmap.context.currentFloor)==null?void 0:n.getGraphicPosition(t);if(r){let o=new kr(this.bmap.context,{autoUpdate:!0,appendToBody:!1});o.div.appendChild(e),o.position.copy(this.bmap.mercatorToWorld(r)),this.myPositionOverlay=o,console.log("graphicPos",r,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(...t){super(...t),this.myPositionOverlay=null}};var F1=class extends lt{highlightPoi(t,e){e===void 0&&(e={icon_size:[40,40],collision_enable:!1}),t.map(r=>this.bmap.getPoiById(r)).filter(r=>!!r).forEach(r=>{var o;(o=r.userData).restore||(o.restore={});for(let u in e)if(u in r.options){var s,a;(s=r.userData.restore)[a=u]||(s[a]=r.options[u]),r.options[u]=e[u]}})}restorePoi(t){t.map(n=>this.bmap.getPoiById(n)).filter(n=>!!n).forEach(n=>{console.log("poi.userData.restore",n.userData.restore);for(let r in n.userData.restore)r in n.options&&(n.options[r]=n.userData.restore[r]);n.userData.restore={}})}};var dat=f(A(),1),gat=f(jn(),1);var B1=class extends lt{sortByDistance(t,e,n){return y(this,null,function*(){n===void 0&&(n=!1);let r=[...e];if(n||e.length<20)return yield Promise.all(r.map(o=>y(this,null,function*(){o.distance=yield this._getDistance(t,{floor:o.floor,x:o.center_x,y:o.center_y})}))),r.sort((o,s)=>o.distance-s.distance);{let o=r.sort((a,u)=>{let l=Math.sqrt((a.center_x-t.x)**2+(a.center_y-t.y)**2)+(t.floor===a.floor?0:100),c=Math.sqrt((u.center_x-t.x)**2+(u.center_y-t.y)**2)+(t.floor===u.floor?0:100);return l-c});return[...(yield Promise.all(o.slice(0,20).map(a=>y(this,null,function*(){return a.distance=yield this._getDistance(t,{floor:a.floor,x:a.center_x,y:a.center_y}),a})))).sort((a,u)=>a.distance-u.distance),...o.slice(20)]}})}_getDistance(t,e){return y(this,null,function*(){return this.navPath.getPath({floor:t.floor,coord:[t.x,t.y]},{floor:e.floor,coord:[e.x,e.y]},"",0).then(n=>n.reduce((r,o,s)=>{if(r+=o.distance,s!==n.length-1)switch(o.endType){case"escalator":case"straightLadder":case"staircase":case"ramp":r+=100;break}return r},0)).catch(n=>n==="near"?0:1/0)})}dispose(){super.dispose(),this.needDisposeNavPath&&this.navPath.dispose()}constructor(t,e){if(super(t),this.needDisposeNavPath=!1,e)this.navPath=e;else{this.navPath=new nu;let n=new Yr(t);this.needDisposeNavPath=!0,n.load(t.config.apiPath.loadPlaceInfo+"?place_id="+t.config.placeId+"&env=prod").then(r=>y(this,null,function*(){let[o,s]=yield Promise.all([n.getRoadNetworkData(),n.getFacilitiesData()]);this.navPath.setRoadData(o,s.infrastructures)}))}}};export{Yr as AibeeLoader,c1 as BMap,E1 as BMapSelect,Jt as BaseSvg,yu as CarInertialPosition,gs as ClickHelper,Za as Context,l1 as CrLoader,x1 as CrNavPath,h1 as Equipment,st as EventDispatcher,Iv as Events,$t as Floor,A3 as GlbModel,ft as Graphic,da as GraphicLayer,ir as GroundTexture,pa as HeatmapElement,F1 as HighlightPoi,vt as HooksName,Ba as HoverHelper,xa as InstancedModel,ji as InstancedParkingSpace,vs as KalmanFilter,Pa as Lane,ut as Layer,Qi as LineElement,Nnt as MapTypePolar,sr as MergeAttributeGraphic,or as MergeAttributeGroundTexture,Oa as MergeAttributeLane,La as MergeAttributeWall,I3 as MergeGraphic,_a as MergeParkingSpace,Sa as MergedGraphicLayer,ya as MergedModelLayer,fa as Model,C1 as MulFloorNavigation,R1 as MulFloorSelect,y1 as MulFloors,nu as NavPath,_1 as Navigation,kr as Overlay,va as ParkingLayer,Unt as ParkingType,ze as PathDirection,lu as PdrPosition,rr as Poi,it as Poi2,ma as PoiLayer,Vr as PoiLayer2,D1 as Position,eo as RENDER_VERSION,N1 as RecommendParkingSpace,x_ as RoadNetwork,F_ as RoadNetwork2,j as SENSOR_TYPE,w3 as SelectBox,Fa as Selection,iu as Sensor,ha as Shadow,ao as Socket,B1 as SortByDistance,Ta as SvgLine,Aa as SvgPolygon,Mr as TaskQueue,Ia as TextTexture,Q as Timer,Tn as TweenUtil,Pv as UA,U1 as UseMyPosition,Ca as Wall,ms as WorkerPool,xX as addAlphaToHexColor,Qo as calc_angle,il as calc_direction,_st as calculateInstantaneousSpeed,vu as calculateLineDirection,B_ as convertToSnakeCase,xi as createCircle,rs as createLine,En as createRect,Qm as createSvg,ns as createSvgElement,aj as createThreeBox,sj as createThreeLine,Be as darkenColor,oV as defaultConfig,nr as defaultGraphicOptions,yh as defaultOptions,RG as defaultTextTextureOptions,Dq as deviceToVector3,W as dispose,i_ as distancePointToSegment,Er as generatorKeyByObj,xP as getAngle,vc as getBorderPoints,Jo as getCenter,r1 as getConfig,n5 as getDirectPath,ol as getDirectionByAngle,o_ as getDistanceByPathPos,X as getLength,Uq as getLongestSideDir,Fq as getMinEdgeSquare,Tt as getPathLength,Fe as getPointEdgeIndex,Sr as getPosByPathDistance,Sm as hasChinese,K0 as hexToRgb,cm as initDirectionalLight,lm as initLight,Xo as initShape,bX as isAndroid,xn as isContain,xr as isControl,Xn as isIphone,yr as isMac,bm as isPointInPolygon,a1 as loadBuildingGround,cnt as loadExternalStreet,u1 as loadGraphics,S8 as mergeGraphicGeometries,DD as mergeGraphicLineGeometries,e5 as moveOnRoute,so as predictFuturePosition,yst as predictFutureSpeed,vr as proxyOptions,xst as removeOutliers,SP as removeWeightPath,qn as setCirclePosition,pe as setLineStartEnd,Et as setRectPosition,us as simplifyPath,ev as sleepByRf,tv as sleepOnePromise,z0 as sleepOneRf,r_ as smoothPath,yX as strToNumber,Vt as timeoutPromise,nj as toWebWorker,ds as transformGraphicData,Oh as transformSpeed,br as translatePosToCenter,tt as triggerWorker,O as vector3ToDevice,jX as xhrGet};
|