human2ai 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +36 -4
- package/README.md +44 -4
- package/dist/cli/main.js +47 -13
- package/dist/cli/main.js.map +1 -1
- package/dist/database/style-library-repository.d.ts +14 -1
- package/dist/database/style-library-repository.js +59 -0
- package/dist/database/style-library-repository.js.map +1 -1
- package/dist/domain/composition/analysis.d.ts +3 -0
- package/dist/domain/composition/analysis.js +5 -0
- package/dist/domain/composition/analysis.js.map +1 -1
- package/dist/domain/composition/draft.d.ts +2 -0
- package/dist/domain/composition/draft.js +126 -5
- package/dist/domain/composition/draft.js.map +1 -1
- package/dist/domain/composition/frame.d.ts +1 -0
- package/dist/domain/composition/frame.js +6 -0
- package/dist/domain/composition/frame.js.map +1 -1
- package/dist/domain/composition/geometry.d.ts +5 -1
- package/dist/domain/composition/geometry.js +40 -2
- package/dist/domain/composition/geometry.js.map +1 -1
- package/dist/domain/composition/index.d.ts +6 -3
- package/dist/domain/composition/index.js +6 -3
- package/dist/domain/composition/index.js.map +1 -1
- package/dist/domain/composition/planning-intersections.d.ts +20 -0
- package/dist/domain/composition/planning-intersections.js +119 -0
- package/dist/domain/composition/planning-intersections.js.map +1 -0
- package/dist/domain/composition/planning.d.ts +25 -0
- package/dist/domain/composition/planning.js +152 -0
- package/dist/domain/composition/planning.js.map +1 -0
- package/dist/domain/composition/refinement/engine.js +1 -0
- package/dist/domain/composition/refinement/engine.js.map +1 -1
- package/dist/domain/composition/render.js +14 -1
- package/dist/domain/composition/render.js.map +1 -1
- package/dist/domain/composition/states.js +6 -3
- package/dist/domain/composition/states.js.map +1 -1
- package/dist/domain/composition/types.d.ts +49 -1
- package/dist/domain/session/capabilities.js +1 -0
- package/dist/domain/session/capabilities.js.map +1 -1
- package/dist/domain/spatial/camera-box-sheet.d.ts +15 -0
- package/dist/domain/spatial/camera-box-sheet.js +24 -0
- package/dist/domain/spatial/camera-box-sheet.js.map +1 -0
- package/dist/domain/spatial/camera-box.d.ts +1 -1
- package/dist/domain/spatial/camera-box.js +6 -2
- package/dist/domain/spatial/camera-box.js.map +1 -1
- package/dist/domain/spatial/camera-render-key.d.ts +7 -0
- package/dist/domain/spatial/camera-render-key.js +63 -0
- package/dist/domain/spatial/camera-render-key.js.map +1 -0
- package/dist/domain/spatial/index.d.ts +1 -0
- package/dist/domain/spatial/index.js +1 -0
- package/dist/domain/spatial/index.js.map +1 -1
- package/dist/domain/spatial/lighting.js +3 -2
- package/dist/domain/spatial/lighting.js.map +1 -1
- package/dist/domain/spatial/model.d.ts +2 -0
- package/dist/domain/spatial/model.js +82 -27
- package/dist/domain/spatial/model.js.map +1 -1
- package/dist/domain/spatial/preview.d.ts +4 -0
- package/dist/domain/spatial/preview.js +23 -0
- package/dist/domain/spatial/preview.js.map +1 -0
- package/dist/domain/spatial/reference-lines.d.ts +12 -3
- package/dist/domain/spatial/reference-lines.js +37 -16
- package/dist/domain/spatial/reference-lines.js.map +1 -1
- package/dist/domain/spatial/render-inputs.d.ts +3 -0
- package/dist/domain/spatial/render-inputs.js +14 -0
- package/dist/domain/spatial/render-inputs.js.map +1 -0
- package/dist/domain/spatial/scene-cache.d.ts +13 -1
- package/dist/domain/spatial/scene-cache.js +90 -11
- package/dist/domain/spatial/scene-cache.js.map +1 -1
- package/dist/domain/spatial/scene-update.d.ts +6 -0
- package/dist/domain/spatial/scene-update.js +52 -0
- package/dist/domain/spatial/scene-update.js.map +1 -0
- package/dist/domain/spatial/scene.d.ts +3 -1
- package/dist/domain/spatial/scene.js +78 -20
- package/dist/domain/spatial/scene.js.map +1 -1
- package/dist/domain/spatial/types.d.ts +8 -0
- package/dist/domain/spatial/types.js.map +1 -1
- package/dist/domain/style/model-input.d.ts +3 -0
- package/dist/domain/style/model-input.js +36 -0
- package/dist/domain/style/model-input.js.map +1 -0
- package/dist/domain/style/types.d.ts +8 -1
- package/dist/domain/style/types.js +1 -1
- package/dist/domain/style/types.js.map +1 -1
- package/dist/domain/ui-sketch/clipboard.d.ts +12 -0
- package/dist/domain/ui-sketch/clipboard.js +55 -0
- package/dist/domain/ui-sketch/clipboard.js.map +1 -0
- package/dist/domain/ui-sketch/index.d.ts +1 -0
- package/dist/domain/ui-sketch/index.js +1 -0
- package/dist/domain/ui-sketch/index.js.map +1 -1
- package/dist/server/routes/spatial-sessions.js +39 -15
- package/dist/server/routes/spatial-sessions.js.map +1 -1
- package/dist/server/routes/style-library.js +39 -0
- package/dist/server/routes/style-library.js.map +1 -1
- package/dist/server/spatial-render-service.d.ts +21 -0
- package/dist/server/spatial-render-service.js +67 -0
- package/dist/server/spatial-render-service.js.map +1 -0
- package/dist/server/spatial-render-worker.d.ts +1 -0
- package/dist/server/spatial-render-worker.js +15 -0
- package/dist/server/spatial-render-worker.js.map +1 -0
- package/dist/server/spatial-render.d.ts +15 -3
- package/dist/server/spatial-render.js +47 -14
- package/dist/server/spatial-render.js.map +1 -1
- package/locales/en/common.json +94 -14
- package/migrations/0009_spatial_styles.sql +31 -0
- package/migrations/0010_style_preview_models.sql +8 -0
- package/package.json +1 -1
- package/schemas/composition-draft.schema.json +474 -1
- package/schemas/spatial-draft.schema.json +12 -0
- package/schemas/spatial-operations.schema.json +12 -0
- package/skills/human2ai/SKILL.md +23 -9
- package/skills/human2ai/references/composition.md +192 -1
- package/skills/human2ai/references/spatial-modeling.md +119 -0
- package/skills/human2ai/references/spatial.md +7 -2
- package/web/out/404/index.html +1 -1
- package/web/out/404.html +1 -1
- package/web/out/__next.__PAGE__.txt +7 -5
- package/web/out/__next._full.txt +7 -5
- package/web/out/__next._tree.txt +4 -2
- package/web/out/_next/static/chunks/101.6ef34adad3e9815b.js +1 -0
- package/web/out/_next/static/chunks/130-7e9e715a084569bb.js +1 -0
- package/web/out/_next/static/chunks/166-96a8c6ae1e9aed59.js +1 -0
- package/web/out/_next/static/chunks/218.7b89674409b344b8.js +1 -0
- package/web/out/_next/static/chunks/484.92b016222d6749f2.js +1 -0
- package/web/out/_next/static/chunks/{381-4a803b79da320e6e.js → 635-611c009924b842be.js} +54 -54
- package/web/out/_next/static/chunks/653-6dfb97fec9a2d91b.js +1 -0
- package/web/out/_next/static/chunks/678-32d3aa1859450d63.js +1 -0
- package/web/out/_next/static/chunks/83607670-fd2f339702a222e4.js +1 -0
- package/web/out/_next/static/chunks/app/_not-found/{page-59ce938ad0594022.js → page-b92817fdc4609975.js} +1 -1
- package/web/out/_next/static/chunks/app/composition/page-6c12ee8472715448.js +1 -0
- package/web/out/_next/static/chunks/app/{layout-6351ae607c4ee18d.js → layout-1dd9196cde94389c.js} +1 -1
- package/web/out/_next/static/chunks/app/page-741ecaf9ee8c3c07.js +1 -0
- package/web/out/_next/static/chunks/app/spatial/page-5ba0940650df6c7f.js +1 -0
- package/web/out/_next/static/chunks/app/styles/page-1ccfc2c5fbc1e646.js +1 -0
- package/web/out/_next/static/chunks/app/ui-sketch/page-ef4f2e531583e684.js +1 -0
- package/web/out/_next/static/chunks/{c3f2cda1-9e279dab137b7272.js → c3f2cda1-ef85a0897724e46b.js} +1 -1
- package/web/out/_next/static/chunks/main-app-cf37a257d91ce62e.js +1 -0
- package/web/out/_next/static/chunks/next/dist/client/components/builtin/global-error-33b4f58f02e82215.js +1 -0
- package/web/out/_next/static/chunks/webpack-d16ce1f994e98178.js +1 -0
- package/web/out/_next/static/css/06743b5635914999.css +5 -0
- package/web/out/_next/static/css/0b43ff4a0439c97e.css +1 -0
- package/web/out/_next/static/css/1f8501a43042a5a2.css +1 -0
- package/web/out/_next/static/css/39e8cace36461a15.css +1 -0
- package/web/out/_not-found/__next._full.txt +3 -3
- package/web/out/_not-found/__next._not-found.__PAGE__.txt +3 -3
- package/web/out/_not-found/__next._tree.txt +1 -1
- package/web/out/_not-found/index.html +1 -1
- package/web/out/_not-found/index.txt +3 -3
- package/web/out/composition/__next._full.txt +6 -5
- package/web/out/composition/__next._tree.txt +3 -2
- package/web/out/composition/__next.composition.__PAGE__.txt +6 -5
- package/web/out/composition/index.html +1 -1
- package/web/out/composition/index.txt +6 -5
- package/web/out/index.html +1 -1
- package/web/out/index.txt +7 -5
- package/web/out/spatial/__next._full.txt +6 -5
- package/web/out/spatial/__next._tree.txt +3 -2
- package/web/out/spatial/__next.spatial.__PAGE__.txt +6 -5
- package/web/out/spatial/index.html +1 -1
- package/web/out/spatial/index.txt +6 -5
- package/web/out/styles/__next._full.txt +6 -5
- package/web/out/styles/__next._tree.txt +3 -2
- package/web/out/styles/__next.styles.__PAGE__.txt +6 -5
- package/web/out/styles/index.html +1 -1
- package/web/out/styles/index.txt +6 -5
- package/web/out/ui-sketch/__next._full.txt +6 -5
- package/web/out/ui-sketch/__next._tree.txt +3 -2
- package/web/out/ui-sketch/__next.ui-sketch.__PAGE__.txt +6 -5
- package/web/out/ui-sketch/index.html +1 -1
- package/web/out/ui-sketch/index.txt +6 -5
- package/web/out/_next/static/chunks/130-f2627352fc1e1f49.js +0 -1
- package/web/out/_next/static/chunks/678-b0ea409290a64ff4.js +0 -1
- package/web/out/_next/static/chunks/728-ce64a38c9e8339e8.js +0 -1
- package/web/out/_next/static/chunks/83607670-bc1279370476e59f.js +0 -1
- package/web/out/_next/static/chunks/app/composition/page-b0a2f7370b949cf9.js +0 -1
- package/web/out/_next/static/chunks/app/page-a6fde4165eb4be1e.js +0 -1
- package/web/out/_next/static/chunks/app/spatial/page-2c3df91fd1d7d444.js +0 -1
- package/web/out/_next/static/chunks/app/styles/page-54b11f1945d64255.js +0 -1
- package/web/out/_next/static/chunks/app/ui-sketch/page-1abcd70a81ac7b30.js +0 -1
- package/web/out/_next/static/chunks/main-app-8946bf6a8c0dc843.js +0 -1
- package/web/out/_next/static/chunks/next/dist/client/components/builtin/global-error-5ac7248e26f2e308.js +0 -1
- package/web/out/_next/static/chunks/webpack-97ae63c0e0b2a512.js +0 -1
- package/web/out/_next/static/css/7bfa3a5c92836f5c.css +0 -5
- /package/web/out/_next/static/{1To86KpfZhDmNzmTIgEuy → n4UcxqMmr_2CBmSxBp52z}/_buildManifest.js +0 -0
- /package/web/out/_next/static/{1To86KpfZhDmNzmTIgEuy → n4UcxqMmr_2CBmSxBp52z}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[460],{84910:(t,e,i)=>{let s,r,a,n,o;i.d(e,{$EB:()=>b,$Kf:()=>rS,$Yl:()=>W,$_I:()=>tA,$ei:()=>B,$p8:()=>nO,A$4:()=>sN,B69:()=>i0,BH$:()=>r1,BKk:()=>aL,BVL:()=>t6,BXX:()=>tQ,B_h:()=>ee,CSG:()=>aJ,CVz:()=>t3,CWW:()=>eM,Cfg:()=>tw,D$Q:()=>aD,DXC:()=>rK,Dmk:()=>tV,EAD:()=>rT,EZo:()=>w,EdD:()=>_,F1T:()=>nE,FCc:()=>r0,FFZ:()=>eD,FV:()=>to,FXf:()=>T,Fn:()=>em,GJx:()=>tg,GWd:()=>tj,GYF:()=>r_,G_z:()=>aW,Gc6:()=>at,Gu$:()=>aO,Gwm:()=>$,H23:()=>ey,H2z:()=>n5,HIg:()=>tD,HO_:()=>eb,HXV:()=>t1,HiM:()=>nC,Hit:()=>a4,Ho_:()=>as,I46:()=>rw,I9Y:()=>ie,IE4:()=>tH,IUQ:()=>iw,Iit:()=>aP,IzY:()=>n3,Jnc:()=>d,K52:()=>Q,KDk:()=>t4,KLL:()=>eO,KPJ:()=>ns,KRh:()=>te,Kef:()=>eg,Kwu:()=>S,Kzg:()=>nP,LAk:()=>tl,LiQ:()=>N,LlO:()=>aF,LoY:()=>sZ,MBL:()=>a9,MW4:()=>sP,Mjd:()=>ta,N1A:()=>rH,NRn:()=>sy,NTi:()=>v,Nex:()=>n4,Nt7:()=>F,Nwf:()=>nX,Nz6:()=>tG,O3Y:()=>aR,O49:()=>e_,O9p:()=>iV,ONl:()=>r6,OUM:()=>tz,Om:()=>tf,OtU:()=>t8,OuU:()=>E,PJ3:()=>ew,PPD:()=>rD,PTz:()=>ii,Pq0:()=>is,Q1f:()=>i8,QP0:()=>m,Qev:()=>eK,Qrf:()=>er,R3r:()=>i3,R8M:()=>eZ,RJ4:()=>eS,RQf:()=>tO,RiT:()=>a7,Riy:()=>t5,RlV:()=>s8,Rm2:()=>eY,RrE:()=>U,RyA:()=>f,S$4:()=>ed,TDQ:()=>al,THS:()=>sR,Tap:()=>nc,TdN:()=>eU,TiK:()=>eE,TkQ:()=>tq,U3G:()=>G,Ufg:()=>aB,V3x:()=>tE,V9B:()=>s7,VCu:()=>r7,VT0:()=>tJ,Vb5:()=>p,VxR:()=>eI,W9U:()=>ef,WNZ:()=>c,WTh:()=>n1,Wdf:()=>ej,Wew:()=>tN,Wk7:()=>y,XG_:()=>ex,XIg:()=>M,XrR:()=>ti,Y9S:()=>nh,YHV:()=>nG,YJl:()=>i1,Yuy:()=>tB,Z58:()=>st,ZLX:()=>rE,ZQM:()=>tX,Zcv:()=>s1,Zr2:()=>eB,ZyN:()=>nI,_4j:()=>aj,_QJ:()=>eo,_Ut:()=>aV,a55:()=>e3,a5J:()=>en,aEY:()=>D,aHM:()=>na,aJ8:()=>tu,aVO:()=>aX,amv:()=>eR,b4q:()=>r8,bC7:()=>eu,bCz:()=>A,bI3:()=>ez,bdM:()=>aI,bkx:()=>tI,brA:()=>Z,bw0:()=>K,c90:()=>tZ,cHt:()=>tk,caT:()=>tt,cj9:()=>it,czI:()=>ei,dYF:()=>iz,dcC:()=>tW,dwI:()=>io,e0p:()=>J,eB$:()=>sH,eHc:()=>Y,eHs:()=>s$,eaF:()=>rc,eoi:()=>eV,er$:()=>ek,f4X:()=>R,fBL:()=>tC,fTw:()=>nQ,g7M:()=>th,gJ2:()=>tP,gO9:()=>z,gPd:()=>iv,gWB:()=>eL,gZr:()=>t9,ghU:()=>tx,hB5:()=>g,hdd:()=>V,hgQ:()=>j,hsX:()=>x,hxR:()=>tM,hy7:()=>tp,iNn:()=>ai,ie2:()=>P,imn:()=>s3,ix0:()=>tR,iyt:()=>sD,jR7:()=>t$,jSS:()=>t7,jej:()=>e$,jf0:()=>eC,jzd:()=>eF,k6Q:()=>tK,k6q:()=>tS,kBv:()=>l,kO0:()=>eP,kRr:()=>t_,kTW:()=>tb,kTp:()=>t0,kn4:()=>iT,kyO:()=>tr,lGu:()=>q,lGw:()=>aH,lPF:()=>eJ,ljd:()=>ev,lxW:()=>aN,lyL:()=>el,mcG:()=>eG,mrM:()=>rj,nCl:()=>nz,nNL:()=>tn,nST:()=>C,nWS:()=>i_,nZQ:()=>nV,ojh:()=>I,ojs:()=>ep,ov9:()=>X,pBf:()=>t2,pHI:()=>tv,paN:()=>tY,ppV:()=>ic,psI:()=>ea,qUd:()=>nk,qa3:()=>et,qad:()=>O,qq$:()=>eW,qtW:()=>sE,r6x:()=>nR,rFo:()=>iA,rSH:()=>es,rYR:()=>eA,ri6:()=>eQ,rjZ:()=>ae,sPf:()=>h,tBo:()=>nq,tJf:()=>tT,tz3:()=>nt,uB5:()=>eh,uSd:()=>aU,uV5:()=>ty,uWO:()=>rC,ubm:()=>n_,vim:()=>eN,vyJ:()=>eT,wfO:()=>tm,wn6:()=>L,wrO:()=>tL,wtR:()=>u,xFO:()=>td,xSv:()=>H,y3Z:()=>ec,yT7:()=>tF,y_p:()=>ts,z3S:()=>eH,zdS:()=>tU,zgK:()=>iF,znC:()=>k});let h="186",l={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},u={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},c=0,p=1,d=2,m=1,y=2,f=3,g=0,x=1,b=2,M=0,v=1,w=2,S=3,_=4,A=5,z=100,T=101,C=102,k=103,B=104,I=200,O=201,R=202,N=203,P=204,E=205,V=206,F=207,L=208,D=209,j=210,U=211,W=212,J=213,X=214,Y=0,q=1,Z=2,H=3,G=4,$=5,Q=6,K=7,tt=0,te=1,ti=2,ts=0,tr=1,ta=2,tn=3,to=4,th=5,tl=6,tu=7,tc="attached",tp=301,td=302,tm=303,ty=304,tf=306,tg=1e3,tx=1001,tb=1002,tM=1003,tv=1004,tw=1005,tS=1006,t_=1007,tA=1008,tz=1009,tT=1010,tC=1011,tk=1012,tB=1013,tI=1014,tO=1015,tR=1016,tN=1017,tP=1018,tE=1020,tV=35902,tF=35899,tL=1021,tD=1022,tj=1023,tU=1026,tW=1027,tJ=1028,tX=1029,tY=1030,tq=1031,tZ=1033,tH=33776,tG=33777,t$=33778,tQ=33779,tK=35840,t0=35841,t1=35842,t2=35843,t3=36196,t5=37492,t4=37496,t6=37488,t9=37489,t8=37490,t7=37491,et=37808,ee=37809,ei=37810,es=37811,er=37812,ea=37813,en=37814,eo=37815,eh=37816,el=37817,eu=37818,ec=37819,ep=37820,ed=37821,em=36492,ey=36494,ef=36495,eg=36283,ex=36284,eb=36285,eM=36286,ev=2300,ew=2301,eS=0,e_=1,eA=2,ez=0,eT=1,eC="",ek="srgb",eB="srgb-linear",eI="linear",eO="srgb",eR=512,eN=513,eP=514,eE=515,eV=516,eF=517,eL=518,eD=519,ej="300 es",eU=2e3;function eW(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function eJ(){let t=eW("canvas");return t.style.display="block",t}Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;let eX={};function eY(...t){console.log("THREE."+t.shift(),...t)}function eq(t){let e=t[0];if("string"==typeof e&&e.startsWith("TSL:")){let e=t[1];e&&e.isStackTrace?t[0]+=" "+e.getLocation():t[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return t}function eZ(...t){let e="THREE."+(t=eq(t)).shift();{let i=t[0];i&&i.isStackTrace?console.warn(i.getError(e)):console.warn(e,...t)}}function eH(...t){let e="THREE."+(t=eq(t)).shift();{let i=t[0];i&&i.isStackTrace?console.error(i.getError(e)):console.error(e,...t)}}function eG(...t){let e=t.join(" ");e in eX||(eX[e]=!0,eZ(...t))}function e$(t,e,i){return new Promise(function(s,r){setTimeout(function a(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:r();break;case t.TIMEOUT_EXPIRED:setTimeout(a,i);break;default:s()}},i)})}let eQ={0:1,2:6,4:7,3:5,1:0,6:2,7:4,5:3};class eK{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});let i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)}hasEventListener(t,e){let i=this._listeners;return void 0!==i&&void 0!==i[t]&&-1!==i[t].indexOf(e)}removeEventListener(t,e){let i=this._listeners;if(void 0===i)return;let s=i[t];if(void 0!==s){let t=s.indexOf(e);-1!==t&&s.splice(t,1)}}dispatchEvent(t){let e=this._listeners;if(void 0===e)return;let i=e[t.type];if(void 0!==i){t.target=this;let e=i.slice(0);for(let i=0,s=e.length;i<s;i++)e[i].call(this,t);t.target=null}}}let e0=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],e1=1234567,e2=Math.PI/180,e3=180/Math.PI;function e5(){let t=0xffffffff*Math.random()|0,e=0xffffffff*Math.random()|0,i=0xffffffff*Math.random()|0,s=0xffffffff*Math.random()|0;return(e0[255&t]+e0[t>>8&255]+e0[t>>16&255]+e0[t>>24&255]+"-"+e0[255&e]+e0[e>>8&255]+"-"+e0[e>>16&15|64]+e0[e>>24&255]+"-"+e0[63&i|128]+e0[i>>8&255]+"-"+e0[i>>16&255]+e0[i>>24&255]+e0[255&s]+e0[s>>8&255]+e0[s>>16&255]+e0[s>>24&255]).toLowerCase()}function e4(t,e,i){return Math.max(e,Math.min(i,t))}function e6(t,e){return(t%e+e)%e}function e9(t,e,i){return(1-i)*t+i*e}function e8(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/0xffffffff;case Uint16Array:return t/65535;case Uint8Array:case Uint8ClampedArray:return t/255;case Int32Array:return Math.max(t/0x7fffffff,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw Error("THREE.MathUtils: Invalid component type.")}}function e7(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(0xffffffff*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:case Uint8ClampedArray:return Math.round(255*t);case Int32Array:return Math.round(0x7fffffff*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw Error("THREE.MathUtils: Invalid component type.")}}let it={DEG2RAD:e2,RAD2DEG:e3,generateUUID:e5,clamp:e4,euclideanModulo:e6,mapLinear:function(t,e,i,s,r){return s+(t-e)*(r-s)/(i-e)},inverseLerp:function(t,e,i){return t!==e?(i-t)/(e-t):0},lerp:e9,damp:function(t,e,i,s){return e9(t,e,1-Math.exp(-i*s))},pingpong:function(t,e=1){return e-Math.abs(e6(t,2*e)-e)},smoothstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)},smootherstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){void 0!==t&&(e1=t);let e=e1+=0x6d2b79f5;return e=Math.imul(e^e>>>15,1|e),(((e^=e+Math.imul(e^e>>>7,61|e))^e>>>14)>>>0)/0x100000000},degToRad:function(t){return t*e2},radToDeg:function(t){return t*e3},isPowerOfTwo:function(t){return t>0&&Number.isInteger(t)&&2**Math.round(Math.log2(t))===t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,i,s,r){let a=Math.cos,n=Math.sin,o=a(i/2),h=n(i/2),l=a((e+s)/2),u=n((e+s)/2),c=a((e-s)/2),p=n((e-s)/2),d=a((s-e)/2),m=n((s-e)/2);switch(r){case"XYX":t.set(o*u,h*c,h*p,o*l);break;case"YZY":t.set(h*p,o*u,h*c,o*l);break;case"ZXZ":t.set(h*c,h*p,o*u,o*l);break;case"XZX":t.set(o*u,h*m,h*d,o*l);break;case"YXY":t.set(h*d,o*u,h*m,o*l);break;case"ZYZ":t.set(h*m,h*d,o*u,o*l);break;default:eZ("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},normalize:e7,denormalize:e8};class ie{static{ie.prototype.isVector2=!0}constructor(t=0,e=0){this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw Error("THREE.Vector2: index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw Error("THREE.Vector2: index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){let e=this.x,i=this.y,s=t.elements;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=e4(this.x,t.x,e.x),this.y=e4(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=e4(this.x,t,e),this.y=e4(this.y,t,e),this}clampLength(t,e){let i=this.length();return this.divideScalar(i||1).multiplyScalar(e4(i,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());return 0===e?Math.PI/2:Math.acos(e4(this.dot(t)/e,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,i=this.y-t.y;return e*e+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){let i=Math.cos(e),s=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*i-a*s+t.x,this.y=r*s+a*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class ii{constructor(t=0,e=0,i=0,s=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=i,this._w=s}static slerpFlat(t,e,i,s,r,a,n){let o=i[s+0],h=i[s+1],l=i[s+2],u=i[s+3],c=r[a+0],p=r[a+1],d=r[a+2],m=r[a+3];if(u!==m||o!==c||h!==p||l!==d){let t=o*c+h*p+l*d+u*m;t<0&&(c=-c,p=-p,d=-d,m=-m,t=-t);let e=1-n;if(t<.9995){let i=Math.acos(t),s=Math.sin(i);o=o*(e=Math.sin(e*i)/s)+c*(n=Math.sin(n*i)/s),h=h*e+p*n,l=l*e+d*n,u=u*e+m*n}else{let t=1/Math.sqrt((o=o*e+c*n)*o+(h=h*e+p*n)*h+(l=l*e+d*n)*l+(u=u*e+m*n)*u);o*=t,h*=t,l*=t,u*=t}}t[e]=o,t[e+1]=h,t[e+2]=l,t[e+3]=u}static multiplyQuaternionsFlat(t,e,i,s,r,a){let n=i[s],o=i[s+1],h=i[s+2],l=i[s+3],u=r[a],c=r[a+1],p=r[a+2],d=r[a+3];return t[e]=n*d+l*u+o*p-h*c,t[e+1]=o*d+l*c+h*u-n*p,t[e+2]=h*d+l*p+n*c-o*u,t[e+3]=l*d-n*u-o*c-h*p,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,i,s){return this._x=t,this._y=e,this._z=i,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){let i=t._x,s=t._y,r=t._z,a=t._order,n=Math.cos,o=Math.sin,h=n(i/2),l=n(s/2),u=n(r/2),c=o(i/2),p=o(s/2),d=o(r/2);switch(a){case"XYZ":this._x=c*l*u+h*p*d,this._y=h*p*u-c*l*d,this._z=h*l*d+c*p*u,this._w=h*l*u-c*p*d;break;case"YXZ":this._x=c*l*u+h*p*d,this._y=h*p*u-c*l*d,this._z=h*l*d-c*p*u,this._w=h*l*u+c*p*d;break;case"ZXY":this._x=c*l*u-h*p*d,this._y=h*p*u+c*l*d,this._z=h*l*d+c*p*u,this._w=h*l*u-c*p*d;break;case"ZYX":this._x=c*l*u-h*p*d,this._y=h*p*u+c*l*d,this._z=h*l*d-c*p*u,this._w=h*l*u+c*p*d;break;case"YZX":this._x=c*l*u+h*p*d,this._y=h*p*u+c*l*d,this._z=h*l*d-c*p*u,this._w=h*l*u-c*p*d;break;case"XZY":this._x=c*l*u-h*p*d,this._y=h*p*u-c*l*d,this._z=h*l*d+c*p*u,this._w=h*l*u+c*p*d;break;default:eZ("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!0===e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){let i=e/2,s=Math.sin(i);return this._x=t.x*s,this._y=t.y*s,this._z=t.z*s,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,i=e[0],s=e[4],r=e[8],a=e[1],n=e[5],o=e[9],h=e[2],l=e[6],u=e[10],c=i+n+u;if(c>0){let t=.5/Math.sqrt(c+1);this._w=.25/t,this._x=(l-o)*t,this._y=(r-h)*t,this._z=(a-s)*t}else if(i>n&&i>u){let t=2*Math.sqrt(1+i-n-u);this._w=(l-o)/t,this._x=.25*t,this._y=(s+a)/t,this._z=(r+h)/t}else if(n>u){let t=2*Math.sqrt(1+n-i-u);this._w=(r-h)/t,this._x=(s+a)/t,this._y=.25*t,this._z=(o+l)/t}else{let t=2*Math.sqrt(1+u-i-n);this._w=(a-s)/t,this._x=(r+h)/t,this._y=(o+l)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return i<1e-8?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0):(this._x=0,this._y=-t.z,this._z=t.y)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x),this._w=i,this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(e4(this.dot(t),-1,1)))}rotateTowards(t,e){let i=this.angleTo(t);if(0===i)return this;let s=Math.min(1,e/i);return this.slerp(t,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){let i=t._x,s=t._y,r=t._z,a=t._w,n=e._x,o=e._y,h=e._z,l=e._w;return this._x=i*l+a*n+s*h-r*o,this._y=s*l+a*o+r*n-i*h,this._z=r*l+a*h+i*o-s*n,this._w=a*l-i*n-s*o-r*h,this._onChangeCallback(),this}slerp(t,e){let i=t._x,s=t._y,r=t._z,a=t._w,n=this.dot(t);n<0&&(i=-i,s=-s,r=-r,a=-a,n=-n);let o=1-e;if(n<.9995){let t=Math.acos(n),h=Math.sin(t);o=Math.sin(o*t)/h,e=Math.sin(e*t)/h,this._x=this._x*o+i*e,this._y=this._y*o+s*e,this._z=this._z*o+r*e,this._w=this._w*o+a*e,this._onChangeCallback()}else this._x=this._x*o+i*e,this._y=this._y*o+s*e,this._z=this._z*o+r*e,this._w=this._w*o+a*e,this.normalize();return this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){let t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),i=Math.random(),s=Math.sqrt(1-i),r=Math.sqrt(i);return this.set(s*Math.sin(t),s*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class is{static{is.prototype.isVector3=!0}constructor(t=0,e=0,i=0){this.x=t,this.y=e,this.z=i}set(t,e,i){return void 0===i&&(i=this.z),this.x=t,this.y=e,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw Error("THREE.Vector3: index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("THREE.Vector3: index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(ia.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(ia.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,i=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*s,this.y=r[1]*e+r[4]*i+r[7]*s,this.z=r[2]*e+r[5]*i+r[8]*s,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,i=this.y,s=this.z,r=t.elements,a=1/(r[3]*e+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*s+r[12])*a,this.y=(r[1]*e+r[5]*i+r[9]*s+r[13])*a,this.z=(r[2]*e+r[6]*i+r[10]*s+r[14])*a,this}applyQuaternion(t){let e=this.x,i=this.y,s=this.z,r=t.x,a=t.y,n=t.z,o=t.w,h=2*(a*s-n*i),l=2*(n*e-r*s),u=2*(r*i-a*e);return this.x=e+o*h+a*u-n*l,this.y=i+o*l+n*h-r*u,this.z=s+o*u+r*l-a*h,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let e=this.x,i=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*s,this.y=r[1]*e+r[5]*i+r[9]*s,this.z=r[2]*e+r[6]*i+r[10]*s,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=e4(this.x,t.x,e.x),this.y=e4(this.y,t.y,e.y),this.z=e4(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=e4(this.x,t,e),this.y=e4(this.y,t,e),this.z=e4(this.z,t,e),this}clampLength(t,e){let i=this.length();return this.divideScalar(i||1).multiplyScalar(e4(i,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){let i=t.x,s=t.y,r=t.z,a=e.x,n=e.y,o=e.z;return this.x=s*o-r*n,this.y=r*a-i*o,this.z=i*n-s*a,this}projectOnVector(t){let e=t.lengthSq();if(0===e)return this.set(0,0,0);let i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return ir.copy(this).projectOnVector(t),this.sub(ir)}reflect(t){return this.sub(ir.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());return 0===e?Math.PI/2:Math.acos(e4(this.dot(t)/e,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,i=this.y-t.y,s=this.z-t.z;return e*e+i*i+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){let s=Math.sin(e)*t;return this.x=s*Math.sin(i),this.y=Math.cos(e)*t,this.z=s*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){let e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),s=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=s,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let t=Math.random()*Math.PI*2,e=2*Math.random()-1,i=Math.sqrt(1-e*e);return this.x=i*Math.cos(t),this.y=e,this.z=i*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}let ir=new is,ia=new ii;class io{static{io.prototype.isMatrix3=!0}constructor(t,e,i,s,r,a,n,o,h){this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,i,s,r,a,n,o,h)}set(t,e,i,s,r,a,n,o,h){let l=this.elements;return l[0]=t,l[1]=s,l[2]=n,l[3]=e,l[4]=r,l[5]=o,l[6]=i,l[7]=a,l[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let i=t.elements,s=e.elements,r=this.elements,a=i[0],n=i[3],o=i[6],h=i[1],l=i[4],u=i[7],c=i[2],p=i[5],d=i[8],m=s[0],y=s[3],f=s[6],g=s[1],x=s[4],b=s[7],M=s[2],v=s[5],w=s[8];return r[0]=a*m+n*g+o*M,r[3]=a*y+n*x+o*v,r[6]=a*f+n*b+o*w,r[1]=h*m+l*g+u*M,r[4]=h*y+l*x+u*v,r[7]=h*f+l*b+u*w,r[2]=c*m+p*g+d*M,r[5]=c*y+p*x+d*v,r[8]=c*f+p*b+d*w,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){let t=this.elements,e=t[0],i=t[1],s=t[2],r=t[3],a=t[4],n=t[5],o=t[6],h=t[7],l=t[8];return e*a*l-e*n*h-i*r*l+i*n*o+s*r*h-s*a*o}invert(){let t=this.elements,e=t[0],i=t[1],s=t[2],r=t[3],a=t[4],n=t[5],o=t[6],h=t[7],l=t[8],u=l*a-n*h,c=n*o-l*r,p=h*r-a*o,d=e*u+i*c+s*p;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);let m=1/d;return t[0]=u*m,t[1]=(s*h-l*i)*m,t[2]=(n*i-s*a)*m,t[3]=c*m,t[4]=(l*e-s*o)*m,t[5]=(s*r-n*e)*m,t[6]=p*m,t[7]=(i*o-h*e)*m,t[8]=(a*e-i*r)*m,this}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){let e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,i,s,r,a,n){let o=Math.cos(r),h=Math.sin(r);return this.set(i*o,i*h,-i*(o*a+h*n)+a+t,-s*h,s*o,-s*(-h*a+o*n)+n+e,0,0,1),this}scale(t,e){return eG("Matrix3: .scale() is deprecated. Use .makeScale() instead."),this.premultiply(ih.makeScale(t,e)),this}rotate(t){return eG("Matrix3: .rotate() is deprecated. Use .makeRotation() instead."),this.premultiply(ih.makeRotation(-t)),this}translate(t,e){return eG("Matrix3: .translate() is deprecated. Use .makeTranslation() instead."),this.premultiply(ih.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){let e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,i,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){let e=this.elements,i=t.elements;for(let t=0;t<9;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){let i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}clone(){return new this.constructor().fromArray(this.elements)}}let ih=new io,il=new io().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),iu=new io().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),ic=(a=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],o=[.3127,.329],(r={enabled:!0,workingColorSpace:eB,spaces:{},convert:function(t,e,i){return!1!==this.enabled&&e!==i&&e&&i&&(this.spaces[e].transfer===eO&&(t.r=ip(t.r),t.g=ip(t.g),t.b=ip(t.b)),this.spaces[e].primaries!==this.spaces[i].primaries&&(t.applyMatrix3(this.spaces[e].toXYZ),t.applyMatrix3(this.spaces[i].fromXYZ)),this.spaces[i].transfer===eO&&(t.r=id(t.r),t.g=id(t.g),t.b=id(t.b))),t},workingToColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},colorSpaceToWorking:function(t,e){return this.convert(t,e,this.workingColorSpace)},getPrimaries:function(t){return this.spaces[t].primaries},getTransfer:function(t){return t===eC?eI:this.spaces[t].transfer},getToneMappingMode:function(t){return this.spaces[t].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(t,e=this.workingColorSpace){return t.fromArray(this.spaces[e].luminanceCoefficients)},define:function(t){Object.assign(this.spaces,t)},_getMatrix:function(t,e,i){return t.copy(this.spaces[e].toXYZ).multiply(this.spaces[i].fromXYZ)},_getDrawingBufferColorSpace:function(t){return this.spaces[t].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(t=this.workingColorSpace){return this.spaces[t].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,e){return eG("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),r.workingToColorSpace(t,e)},toWorkingColorSpace:function(t,e){return eG("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),r.colorSpaceToWorking(t,e)}}).define({[eB]:{primaries:a,whitePoint:o,transfer:eI,toXYZ:il,fromXYZ:iu,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:ek},outputColorSpaceConfig:{drawingBufferColorSpace:ek}},[ek]:{primaries:a,whitePoint:o,transfer:eO,toXYZ:il,fromXYZ:iu,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:ek}}}),r);function ip(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function id(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}class im{static getDataURL(t,e="image/png"){let i;if(/^data:/i.test(t.src)||"u"<typeof HTMLCanvasElement)return t.src;if(t instanceof HTMLCanvasElement)i=t;else{void 0===s&&(s=eW("canvas")),s.width=t.width,s.height=t.height;let e=s.getContext("2d");t instanceof ImageData?e.putImageData(t,0,0):e.drawImage(t,0,0,t.width,t.height),i=s}return i.toDataURL(e)}static sRGBToLinear(t){if("u">typeof HTMLImageElement&&t instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&t instanceof ImageBitmap){let e=eW("canvas");e.width=t.width,e.height=t.height;let i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);let s=i.getImageData(0,0,t.width,t.height),r=s.data;for(let t=0;t<r.length;t++)r[t]=255*ip(r[t]/255);return i.putImageData(s,0,0),e}if(!t.data)return eZ("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t;{let e=t.data.slice(0);for(let t=0;t<e.length;t++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[t]=Math.floor(255*ip(e[t]/255)):e[t]=ip(e[t]);return{data:e,width:t.width,height:t.height}}}}let iy=0;class ig{constructor(t=null){this.isTextureSource=!0,Object.defineProperty(this,"id",{value:iy++}),this.uuid=e5(),this.data=t,this.dataReady=!0,this.version=0}getSize(t){let e=this.data;return"u">typeof HTMLVideoElement&&e instanceof HTMLVideoElement?t.set(e.videoWidth,e.videoHeight,0):"u">typeof VideoFrame&&e instanceof VideoFrame?t.set(e.displayWidth,e.displayHeight,0):null!==e?t.set(e.width,e.height,e.depth||0):t.set(0,0,0),t}set needsUpdate(t){!0===t&&this.version++}toJSON(t){let e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];let i={uuid:this.uuid,url:""},s=this.data;if(null!==s){let t;if(Array.isArray(s)){t=[];for(let e=0,i=s.length;e<i;e++)s[e].isDataTexture?t.push(ix(s[e].image)):t.push(ix(s[e]))}else t=ix(s);i.url=t}return e||(t.images[this.uuid]=i),i}}function ix(t){return"u">typeof HTMLImageElement&&t instanceof HTMLImageElement||"u">typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"u">typeof ImageBitmap&&t instanceof ImageBitmap?im.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(eZ("Texture: Unable to serialize Texture."),{})}let ib=0,iM=new is;class iv extends eK{constructor(t=iv.DEFAULT_IMAGE,e=iv.DEFAULT_MAPPING,i=tx,s=tx,r=tS,a=tA,n=tj,o=tz,h=iv.DEFAULT_ANISOTROPY,l=eC){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:ib++}),this.uuid=e5(),this.name="",this.source=new ig(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=i,this.wrapT=s,this.magFilter=r,this.minFilter=a,this.anisotropy=h,this.format=n,this.internalFormat=null,this.type=o,this.offset=new ie(0,0),this.repeat=new ie(1,1),this.center=new ie(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new io,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=l,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!t&&!!t.depth&&t.depth>1,this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(iM).x}get height(){return this.source.getSize(iM).y}get depth(){return this.source.getSize(iM).z}get image(){return this.source.data}set image(t){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.normalized=t.normalized,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.renderTarget=t.renderTarget,this.isRenderTargetTexture=t.isRenderTargetTexture,this.isArrayTexture=t.isArrayTexture,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}setValues(t){for(let e in t){let i=t[e];if(void 0===i){eZ(`Texture.setValues(): parameter '${e}' has value of undefined.`);continue}let s=this[e];if(void 0===s){eZ(`Texture.setValues(): property '${e}' does not exist.`);continue}s&&i&&s.isVector2&&i.isVector2||s&&i&&s.isVector3&&i.isVector3||s&&i&&s.isMatrix3&&i.isMatrix3?s.copy(i):this[e]=i}}toJSON(t){let e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];let i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,normalized:this.normalized,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),e||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case tg:t.x=t.x-Math.floor(t.x);break;case tx:t.x=t.x<0?0:1;break;case tb:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case tg:t.y=t.y-Math.floor(t.y);break;case tx:t.y=t.y<0?0:1;break;case tb:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){!0===t&&this.pmremVersion++}}iv.DEFAULT_IMAGE=null,iv.DEFAULT_MAPPING=300,iv.DEFAULT_ANISOTROPY=1;class iw{static{iw.prototype.isVector4=!0}constructor(t=0,e=0,i=0,s=1){this.x=t,this.y=e,this.z=i,this.w=s}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,i,s){return this.x=t,this.y=e,this.z=i,this.w=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw Error("THREE.Vector4: index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("THREE.Vector4: index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){let e=this.x,i=this.y,s=this.z,r=this.w,a=t.elements;return this.x=a[0]*e+a[4]*i+a[8]*s+a[12]*r,this.y=a[1]*e+a[5]*i+a[9]*s+a[13]*r,this.z=a[2]*e+a[6]*i+a[10]*s+a[14]*r,this.w=a[3]*e+a[7]*i+a[11]*s+a[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,i,s,r,a=t.elements,n=a[0],o=a[4],h=a[8],l=a[1],u=a[5],c=a[9],p=a[2],d=a[6],m=a[10];if(.01>Math.abs(o-l)&&.01>Math.abs(h-p)&&.01>Math.abs(c-d)){if(.1>Math.abs(o+l)&&.1>Math.abs(h+p)&&.1>Math.abs(c+d)&&.1>Math.abs(n+u+m-3))return this.set(1,0,0,0),this;e=Math.PI;let t=(n+1)/2,a=(u+1)/2,y=(m+1)/2,f=(o+l)/4,g=(h+p)/4,x=(c+d)/4;return t>a&&t>y?t<.01?(i=0,s=.707106781,r=.707106781):(s=f/(i=Math.sqrt(t)),r=g/i):a>y?a<.01?(i=.707106781,s=0,r=.707106781):(i=f/(s=Math.sqrt(a)),r=x/s):y<.01?(i=.707106781,s=.707106781,r=0):(i=g/(r=Math.sqrt(y)),s=x/r),this.set(i,s,r,e),this}let y=Math.sqrt((d-c)*(d-c)+(h-p)*(h-p)+(l-o)*(l-o));return .001>Math.abs(y)&&(y=1),this.x=(d-c)/y,this.y=(h-p)/y,this.z=(l-o)/y,this.w=Math.acos((n+u+m-1)/2),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=e4(this.x,t.x,e.x),this.y=e4(this.y,t.y,e.y),this.z=e4(this.z,t.z,e.z),this.w=e4(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=e4(this.x,t,e),this.y=e4(this.y,t,e),this.z=e4(this.z,t,e),this.w=e4(this.w,t,e),this}clampLength(t,e){let i=this.length();return this.divideScalar(i||1).multiplyScalar(e4(i,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class iS extends eK{constructor(t=1,e=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:tS,depthBuffer:!0,stencilBuffer:!1,resolveColorBuffer:!0,resolveDepthBuffer:!0,resolveStencilBuffer:!0,storeMultisampledColorBuffer:!0,storeMultisampledDepthBuffer:!0,storeMultisampledStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1,useArrayDepthTexture:!1},i),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=i.depth,this.scissor=new iw(0,0,t,e),this.scissorTest=!1,this.viewport=new iw(0,0,t,e),this.textures=[];const s=new iv({width:t,height:e,depth:i.depth}),r=i.count;for(let t=0;t<r;t++)this.textures[t]=s.clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;this._setTextureOptions(i),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveColorBuffer=i.resolveColorBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this.storeMultisampledColorBuffer=i.storeMultisampledColorBuffer,this.storeMultisampledDepthBuffer=i.storeMultisampledDepthBuffer,this.storeMultisampledStencilBuffer=i.storeMultisampledStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples,this.multiview=i.multiview,this.useArrayDepthTexture=i.useArrayDepthTexture}_setTextureOptions(t={}){let e={minFilter:tS,generateMipmaps:!1,flipY:!1,internalFormat:null};void 0!==t.mapping&&(e.mapping=t.mapping),void 0!==t.wrapS&&(e.wrapS=t.wrapS),void 0!==t.wrapT&&(e.wrapT=t.wrapT),void 0!==t.wrapR&&(e.wrapR=t.wrapR),void 0!==t.magFilter&&(e.magFilter=t.magFilter),void 0!==t.minFilter&&(e.minFilter=t.minFilter),void 0!==t.format&&(e.format=t.format),void 0!==t.type&&(e.type=t.type),void 0!==t.anisotropy&&(e.anisotropy=t.anisotropy),void 0!==t.colorSpace&&(e.colorSpace=t.colorSpace),void 0!==t.flipY&&(e.flipY=t.flipY),void 0!==t.generateMipmaps&&(e.generateMipmaps=t.generateMipmaps),void 0!==t.internalFormat&&(e.internalFormat=t.internalFormat);for(let t=0;t<this.textures.length;t++)this.textures[t].setValues(e)}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}set depthTexture(t){null!==this._depthTexture&&this._depthTexture.renderTarget===this&&(this._depthTexture.renderTarget=null),null!==t&&null===t.renderTarget&&(t.renderTarget=this),this._depthTexture=t}get depthTexture(){return this._depthTexture}setSize(t,e,i=1){if(this.width!==t||this.height!==e||this.depth!==i){this.width=t,this.height=e,this.depth=i;for(let s=0,r=this.textures.length;s<r;s++)this.textures[s].image.width=t,this.textures[s].image.height=e,this.textures[s].image.depth=i,!0!==this.textures[s].isData3DTexture&&(this.textures[s].isArrayTexture=this.textures[s].image.depth>1);this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,i=t.textures.length;e<i;e++){this.textures[e]=t.textures[e].clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;let i=Object.assign({},t.textures[e].image);this.textures[e].source=new ig(i)}if(this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveColorBuffer=t.resolveColorBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,this.storeMultisampledColorBuffer=t.storeMultisampledColorBuffer,this.storeMultisampledDepthBuffer=t.storeMultisampledDepthBuffer,this.storeMultisampledStencilBuffer=t.storeMultisampledStencilBuffer,null!==t.depthTexture)if(t.depthTexture.renderTarget===t){let e=t.depthTexture.clone();e.renderTarget=null,this.depthTexture=e}else this.depthTexture=t.depthTexture;return this.samples=t.samples,this.multiview=t.multiview,this.useArrayDepthTexture=t.useArrayDepthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}class i_ extends iS{constructor(t=1,e=1,i={}){super(t,e,i),this.isWebGLRenderTarget=!0}}class iA extends iv{constructor(t=null,e=1,i=1,s=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:i,depth:s},this.magFilter=tM,this.minFilter=tM,this.wrapR=tx,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}copy(t){return super.copy(t),this.wrapR=t.wrapR,this}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class iz extends iv{constructor(t=null,e=1,i=1,s=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:i,depth:s},this.magFilter=tM,this.minFilter=tM,this.wrapR=tx,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}copy(t){return super.copy(t),this.wrapR=t.wrapR,this}}class iT{static{iT.prototype.isMatrix4=!0}constructor(t,e,i,s,r,a,n,o,h,l,u,c,p,d,m,y){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,i,s,r,a,n,o,h,l,u,c,p,d,m,y)}set(t,e,i,s,r,a,n,o,h,l,u,c,p,d,m,y){let f=this.elements;return f[0]=t,f[4]=e,f[8]=i,f[12]=s,f[1]=r,f[5]=a,f[9]=n,f[13]=o,f[2]=h,f[6]=l,f[10]=u,f[14]=c,f[3]=p,f[7]=d,f[11]=m,f[15]=y,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new iT().fromArray(this.elements)}copy(t){let e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){let e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){let e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,i){return 0===this.determinantAffine()?(t.set(1,0,0),e.set(0,1,0),i.set(0,0,1)):(t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2)),this}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){if(0===t.determinantAffine())return this.identity();let e=this.elements,i=t.elements,s=1/iC.setFromMatrixColumn(t,0).length(),r=1/iC.setFromMatrixColumn(t,1).length(),a=1/iC.setFromMatrixColumn(t,2).length();return e[0]=i[0]*s,e[1]=i[1]*s,e[2]=i[2]*s,e[3]=0,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[7]=0,e[8]=i[8]*a,e[9]=i[9]*a,e[10]=i[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){let e=this.elements,i=t.x,s=t.y,r=t.z,a=Math.cos(i),n=Math.sin(i),o=Math.cos(s),h=Math.sin(s),l=Math.cos(r),u=Math.sin(r);if("XYZ"===t.order){let t=a*l,i=a*u,s=n*l,r=n*u;e[0]=o*l,e[4]=-o*u,e[8]=h,e[1]=i+s*h,e[5]=t-r*h,e[9]=-n*o,e[2]=r-t*h,e[6]=s+i*h,e[10]=a*o}else if("YXZ"===t.order){let t=o*l,i=o*u,s=h*l,r=h*u;e[0]=t+r*n,e[4]=s*n-i,e[8]=a*h,e[1]=a*u,e[5]=a*l,e[9]=-n,e[2]=i*n-s,e[6]=r+t*n,e[10]=a*o}else if("ZXY"===t.order){let t=o*l,i=o*u,s=h*l,r=h*u;e[0]=t-r*n,e[4]=-a*u,e[8]=s+i*n,e[1]=i+s*n,e[5]=a*l,e[9]=r-t*n,e[2]=-a*h,e[6]=n,e[10]=a*o}else if("ZYX"===t.order){let t=a*l,i=a*u,s=n*l,r=n*u;e[0]=o*l,e[4]=s*h-i,e[8]=t*h+r,e[1]=o*u,e[5]=r*h+t,e[9]=i*h-s,e[2]=-h,e[6]=n*o,e[10]=a*o}else if("YZX"===t.order){let t=a*o,i=a*h,s=n*o,r=n*h;e[0]=o*l,e[4]=r-t*u,e[8]=s*u+i,e[1]=u,e[5]=a*l,e[9]=-n*l,e[2]=-h*l,e[6]=i*u+s,e[10]=t-r*u}else if("XZY"===t.order){let t=a*o,i=a*h,s=n*o,r=n*h;e[0]=o*l,e[4]=-u,e[8]=h*l,e[1]=t*u+r,e[5]=a*l,e[9]=i*u-s,e[2]=s*u-i,e[6]=n*l,e[10]=r*u+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(iB,t,iI)}lookAt(t,e,i){let s=this.elements;return iN.subVectors(t,e),0===iN.lengthSq()&&(iN.z=1),iN.normalize(),iO.crossVectors(i,iN),0===iO.lengthSq()&&(1===Math.abs(i.z)?iN.x+=1e-4:iN.z+=1e-4,iN.normalize(),iO.crossVectors(i,iN)),iO.normalize(),iR.crossVectors(iN,iO),s[0]=iO.x,s[4]=iR.x,s[8]=iN.x,s[1]=iO.y,s[5]=iR.y,s[9]=iN.y,s[2]=iO.z,s[6]=iR.z,s[10]=iN.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let i=t.elements,s=e.elements,r=this.elements,a=i[0],n=i[4],o=i[8],h=i[12],l=i[1],u=i[5],c=i[9],p=i[13],d=i[2],m=i[6],y=i[10],f=i[14],g=i[3],x=i[7],b=i[11],M=i[15],v=s[0],w=s[4],S=s[8],_=s[12],A=s[1],z=s[5],T=s[9],C=s[13],k=s[2],B=s[6],I=s[10],O=s[14],R=s[3],N=s[7],P=s[11],E=s[15];return r[0]=a*v+n*A+o*k+h*R,r[4]=a*w+n*z+o*B+h*N,r[8]=a*S+n*T+o*I+h*P,r[12]=a*_+n*C+o*O+h*E,r[1]=l*v+u*A+c*k+p*R,r[5]=l*w+u*z+c*B+p*N,r[9]=l*S+u*T+c*I+p*P,r[13]=l*_+u*C+c*O+p*E,r[2]=d*v+m*A+y*k+f*R,r[6]=d*w+m*z+y*B+f*N,r[10]=d*S+m*T+y*I+f*P,r[14]=d*_+m*C+y*O+f*E,r[3]=g*v+x*A+b*k+M*R,r[7]=g*w+x*z+b*B+M*N,r[11]=g*S+x*T+b*I+M*P,r[15]=g*_+x*C+b*O+M*E,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){let t=this.elements,e=t[0],i=t[4],s=t[8],r=t[12],a=t[1],n=t[5],o=t[9],h=t[13],l=t[2],u=t[6],c=t[10],p=t[14],d=t[3],m=t[7],y=t[11],f=t[15],g=o*p-h*c,x=n*p-h*u,b=n*c-o*u,M=a*p-h*l,v=a*c-o*l,w=a*u-n*l;return e*(m*g-y*x+f*b)-i*(d*g-y*M+f*v)+s*(d*x-m*M+f*w)-r*(d*b-m*v+y*w)}determinantAffine(){let t=this.elements,e=t[0],i=t[4],s=t[8],r=t[1],a=t[5],n=t[9],o=t[2],h=t[6],l=t[10];return e*(a*l-n*h)-i*(r*l-n*o)+s*(r*h-a*o)}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(t,e,i){let s=this.elements;return t.isVector3?(s[12]=t.x,s[13]=t.y,s[14]=t.z):(s[12]=t,s[13]=e,s[14]=i),this}invert(){let t=this.elements,e=t[0],i=t[1],s=t[2],r=t[3],a=t[4],n=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],p=t[11],d=t[12],m=t[13],y=t[14],f=t[15],g=e*n-i*a,x=e*o-s*a,b=e*h-r*a,M=i*o-s*n,v=i*h-r*n,w=s*h-r*o,S=l*m-u*d,_=l*y-c*d,A=l*f-p*d,z=u*y-c*m,T=u*f-p*m,C=c*f-p*y,k=g*C-x*T+b*z+M*A-v*_+w*S;if(0===k)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let B=1/k;return t[0]=(n*C-o*T+h*z)*B,t[1]=(s*T-i*C-r*z)*B,t[2]=(m*w-y*v+f*M)*B,t[3]=(c*v-u*w-p*M)*B,t[4]=(o*A-a*C-h*_)*B,t[5]=(e*C-s*A+r*_)*B,t[6]=(y*b-d*w-f*x)*B,t[7]=(l*w-c*b+p*x)*B,t[8]=(a*T-n*A+h*S)*B,t[9]=(i*A-e*T-r*S)*B,t[10]=(d*v-m*b+f*g)*B,t[11]=(u*b-l*v-p*g)*B,t[12]=(n*_-a*z-o*S)*B,t[13]=(e*z-i*_+s*S)*B,t[14]=(m*x-d*M-y*g)*B,t[15]=(l*M-u*x+c*g)*B,this}scale(t){let e=this.elements,i=t.x,s=t.y,r=t.z;return e[0]*=i,e[4]*=s,e[8]*=r,e[1]*=i,e[5]*=s,e[9]*=r,e[2]*=i,e[6]*=s,e[10]*=r,e[3]*=i,e[7]*=s,e[11]*=r,this}getMaxScaleOnAxis(){let t=this.elements;return Math.sqrt(Math.max(t[0]*t[0]+t[1]*t[1]+t[2]*t[2],t[4]*t[4]+t[5]*t[5]+t[6]*t[6],t[8]*t[8]+t[9]*t[9]+t[10]*t[10]))}makeTranslation(t,e,i){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){let e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){let e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){let e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){let i=Math.cos(e),s=Math.sin(e),r=1-i,a=t.x,n=t.y,o=t.z,h=r*a,l=r*n;return this.set(h*a+i,h*n-s*o,h*o+s*n,0,h*n+s*o,l*n+i,l*o-s*a,0,h*o-s*n,l*o+s*a,r*o*o+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i,s,r,a){return this.set(1,i,r,0,t,1,a,0,e,s,1,0,0,0,0,1),this}compose(t,e,i){let s=this.elements,r=e._x,a=e._y,n=e._z,o=e._w,h=r+r,l=a+a,u=n+n,c=r*h,p=r*l,d=r*u,m=a*l,y=a*u,f=n*u,g=o*h,x=o*l,b=o*u,M=i.x,v=i.y,w=i.z;return s[0]=(1-(m+f))*M,s[1]=(p+b)*M,s[2]=(d-x)*M,s[3]=0,s[4]=(p-b)*v,s[5]=(1-(c+f))*v,s[6]=(y+g)*v,s[7]=0,s[8]=(d+x)*w,s[9]=(y-g)*w,s[10]=(1-(c+m))*w,s[11]=0,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=1,this}decompose(t,e,i){let s=this.elements;t.x=s[12],t.y=s[13],t.z=s[14];let r=this.determinantAffine();if(0===r)return i.set(1,1,1),e.identity(),this;let a=iC.set(s[0],s[1],s[2]).length(),n=iC.set(s[4],s[5],s[6]).length(),o=iC.set(s[8],s[9],s[10]).length();r<0&&(a=-a),ik.copy(this);let h=1/a,l=1/n,u=1/o;return ik.elements[0]*=h,ik.elements[1]*=h,ik.elements[2]*=h,ik.elements[4]*=l,ik.elements[5]*=l,ik.elements[6]*=l,ik.elements[8]*=u,ik.elements[9]*=u,ik.elements[10]*=u,e.setFromRotationMatrix(ik),i.x=a,i.y=n,i.z=o,this}makePerspective(t,e,i,s,r,a,n=eU,o=!1){let h,l,u=this.elements;if(o)h=r/(a-r),l=a*r/(a-r);else if(n===eU)h=-(a+r)/(a-r),l=-2*a*r/(a-r);else if(2001===n)h=-a/(a-r),l=-a*r/(a-r);else throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+n);return u[0]=2*r/(e-t),u[4]=0,u[8]=(e+t)/(e-t),u[12]=0,u[1]=0,u[5]=2*r/(i-s),u[9]=(i+s)/(i-s),u[13]=0,u[2]=0,u[6]=0,u[10]=h,u[14]=l,u[3]=0,u[7]=0,u[11]=-1,u[15]=0,this}makeOrthographic(t,e,i,s,r,a,n=eU,o=!1){let h,l,u=this.elements;if(o)h=1/(a-r),l=a/(a-r);else if(n===eU)h=-2/(a-r),l=-(a+r)/(a-r);else if(2001===n)h=-1/(a-r),l=-r/(a-r);else throw Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+n);return u[0]=2/(e-t),u[4]=0,u[8]=0,u[12]=-(e+t)/(e-t),u[1]=0,u[5]=2/(i-s),u[9]=0,u[13]=-(i+s)/(i-s),u[2]=0,u[6]=0,u[10]=h,u[14]=l,u[3]=0,u[7]=0,u[11]=0,u[15]=1,this}equals(t){let e=this.elements,i=t.elements;for(let t=0;t<16;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){let i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}}let iC=new is,ik=new iT,iB=new is(0,0,0),iI=new is(1,1,1),iO=new is,iR=new is,iN=new is,iP=new iT,iE=new ii;class iV{constructor(t=0,e=0,i=0,s=iV.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=s}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,s=this._order){return this._x=t,this._y=e,this._z=i,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,i=!0){let s=t.elements,r=s[0],a=s[4],n=s[8],o=s[1],h=s[5],l=s[9],u=s[2],c=s[6],p=s[10];switch(e){case"XYZ":this._y=Math.asin(e4(n,-1,1)),.9999999>Math.abs(n)?(this._x=Math.atan2(-l,p),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(c,h),this._z=0);break;case"YXZ":this._x=Math.asin(-e4(l,-1,1)),.9999999>Math.abs(l)?(this._y=Math.atan2(n,p),this._z=Math.atan2(o,h)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(e4(c,-1,1)),.9999999>Math.abs(c)?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-a,h)):(this._y=0,this._z=Math.atan2(o,r));break;case"ZYX":this._y=Math.asin(-e4(u,-1,1)),.9999999>Math.abs(u)?(this._x=Math.atan2(c,p),this._z=Math.atan2(o,r)):(this._x=0,this._z=Math.atan2(-a,h));break;case"YZX":this._z=Math.asin(e4(o,-1,1)),.9999999>Math.abs(o)?(this._x=Math.atan2(-l,h),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(n,p));break;case"XZY":this._z=Math.asin(-e4(a,-1,1)),.9999999>Math.abs(a)?(this._x=Math.atan2(c,h),this._y=Math.atan2(n,r)):(this._x=Math.atan2(-l,p),this._y=0);break;default:eZ("Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===i&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return iP.makeRotationFromQuaternion(t),this.setFromRotationMatrix(iP,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return iE.setFromEuler(this),this.setFromQuaternion(iE,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}iV.DEFAULT_ORDER="XYZ";class iF{constructor(){this.mask=1}set(t){this.mask=1<<t>>>0}enable(t){this.mask|=1<<t}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t}disable(t){this.mask&=~(1<<t)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!=0}isEnabled(t){return(this.mask&1<<t)!=0}}let iL=0,iD=new is,ij=new ii,iU=new iT,iW=new is,iJ=new is,iX=new is,iY=new ii,iq=new is(1,0,0),iZ=new is(0,1,0),iH=new is(0,0,1),iG={type:"added"},i$={type:"removed"},iQ={type:"childadded",child:null},iK={type:"childremoved",child:null};class i0 extends eK{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:iL++}),this.uuid=e5(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=i0.DEFAULT_UP.clone();const t=new is,e=new iV,i=new ii,s=new is(1,1,1);e._onChange(function(){i.setFromEuler(e,!1)}),i._onChange(function(){e.setFromQuaternion(i,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:s},modelViewMatrix:{value:new iT},normalMatrix:{value:new io}}),this.matrix=new iT,this.matrixWorld=new iT,this.matrixAutoUpdate=i0.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=i0.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new iF,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return ij.setFromAxisAngle(t,e),this.quaternion.multiply(ij),this}rotateOnWorldAxis(t,e){return ij.setFromAxisAngle(t,e),this.quaternion.premultiply(ij),this}rotateX(t){return this.rotateOnAxis(iq,t)}rotateY(t){return this.rotateOnAxis(iZ,t)}rotateZ(t){return this.rotateOnAxis(iH,t)}translateOnAxis(t,e){return iD.copy(t).applyQuaternion(this.quaternion),this.position.add(iD.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(iq,t)}translateY(t){return this.translateOnAxis(iZ,t)}translateZ(t){return this.translateOnAxis(iH,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(iU.copy(this.matrixWorld).invert())}lookAt(t,e,i){t.isVector3?iW.copy(t):iW.set(t,e,i);let s=this.parent;this.updateWorldMatrix(!0,!1),iJ.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?iU.lookAt(iJ,iW,this.up):iU.lookAt(iW,iJ,this.up),this.quaternion.setFromRotationMatrix(iU),s&&(iU.extractRotation(s.matrixWorld),ij.setFromRotationMatrix(iU),this.quaternion.premultiply(ij.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?eH("Object3D.add: object can't be added as a child of itself.",t):t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(iG),iQ.child=t,this.dispatchEvent(iQ),iQ.child=null):eH("Object3D.add: object not an instance of THREE.Object3D.",t),this}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}let e=this.children.indexOf(t);return -1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(i$),iK.child=t,this.dispatchEvent(iK),iK.child=null),this}removeFromParent(){let t=this.parent;return null!==t&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),iU.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),iU.multiply(t.parent.matrixWorld)),t.applyMatrix4(iU),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(iG),iQ.child=t,this.dispatchEvent(iQ),iQ.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let i=0,s=this.children.length;i<s;i++){let s=this.children[i].getObjectByProperty(t,e);if(void 0!==s)return s}}getObjectsByProperty(t,e,i=[]){this[t]===e&&i.push(this);let s=this.children;for(let r=0,a=s.length;r<a;r++)s[r].getObjectsByProperty(t,e,i);return i}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(iJ,t,iX),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(iJ,iY,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}intersectsFrustum(){}traverse(t){t(this);let e=this.children;for(let i=0,s=e.length;i<s;i++)e[i].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);let e=this.children;for(let i=0,s=e.length;i<s;i++)e[i].traverseVisible(t)}traverseAncestors(t){let e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);let t=this.pivot;if(null!==t){let e=t.x,i=t.y,s=t.z,r=this.matrix.elements;r[12]+=e-r[0]*e-r[4]*i-r[8]*s,r[13]+=i-r[1]*e-r[5]*i-r[9]*s,r[14]+=s-r[2]*e-r[6]*i-r[10]*s}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);let e=this.children;for(let i=0,s=e.length;i<s;i++)e[i].updateMatrixWorld(t)}updateWorldMatrix(t,e,i=!1){let s=this.parent;if(!0===t&&null!==s&&s.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||i)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,i=!0),!0===e){let t=this.children;for(let e=0,s=t.length;e<s;e++)t[e].updateWorldMatrix(!1,!0,i)}}toJSON(t){let e=void 0===t||"string"==typeof t,i={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});let s={};function r(e,i){return void 0===e[i.uuid]&&(e[i.uuid]=i.toJSON(t)),i.uuid}if(s.uuid=this.uuid,s.type=this.type,s.name=this.name,s.castShadow=this.castShadow,s.receiveShadow=this.receiveShadow,s.visible=this.visible,s.frustumCulled=this.frustumCulled,s.renderOrder=this.renderOrder,s.static=this.static,s.matrixAutoUpdate=this.matrixAutoUpdate,Object.keys(this.userData).length>0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),null!==this.pivot&&(s.pivot=this.pivot.toArray()),void 0!==this.morphTargetDictionary&&(s.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),void 0!==this.morphTargetInfluences&&(s.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.geometryInfo=this._geometryInfo.map(t=>({...t,boundingBox:t.boundingBox?t.boundingBox.toJSON():void 0,boundingSphere:t.boundingSphere?t.boundingSphere.toJSON():void 0})),s.instanceInfo=this._instanceInfo.map(t=>({...t})),s.availableInstanceIds=this._availableInstanceIds.slice(),s.availableGeometryIds=this._availableGeometryIds.slice(),s.nextIndexStart=this._nextIndexStart,s.nextVertexStart=this._nextVertexStart,s.geometryCount=this._geometryCount,s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.matricesTexture=this._matricesTexture.toJSON(t),s.indirectTexture=this._indirectTexture.toJSON(t),null!==this._colorsTexture&&(s.colorsTexture=this._colorsTexture.toJSON(t)),null!==this.boundingSphere&&(s.boundingSphere=this.boundingSphere.toJSON()),null!==this.boundingBox&&(s.boundingBox=this.boundingBox.toJSON())),this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(s.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(t.geometries,this.geometry);let e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){let i=e.shapes;if(Array.isArray(i))for(let e=0,s=i.length;e<s;e++){let s=i[e];r(t.shapes,s)}else r(t.shapes,i)}}if(this.isSkinnedMesh&&(s.bindMode=this.bindMode,s.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(t.skeletons,this.skeleton),s.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){let e=[];for(let i=0,s=this.material.length;i<s;i++)e.push(r(t.materials,this.material[i]));s.material=e}else s.material=r(t.materials,this.material);if(this.children.length>0){s.children=[];for(let e=0;e<this.children.length;e++)s.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){s.animations=[];for(let e=0;e<this.animations.length;e++){let i=this.animations[e];s.animations.push(r(t.animations,i))}}if(e){let e=a(t.geometries),s=a(t.materials),r=a(t.textures),n=a(t.images),o=a(t.shapes),h=a(t.skeletons),l=a(t.animations),u=a(t.nodes);e.length>0&&(i.geometries=e),s.length>0&&(i.materials=s),r.length>0&&(i.textures=r),n.length>0&&(i.images=n),o.length>0&&(i.shapes=o),h.length>0&&(i.skeletons=h),l.length>0&&(i.animations=l),u.length>0&&(i.nodes=u)}return i.object=s,i;function a(t){let e=[];for(let i in t){let s=t[i];delete s.metadata,e.push(s)}return e}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.pivot=null!==t.pivot?t.pivot.clone():null,this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.static=t.static,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){let i=t.children[e];this.add(i.clone())}return this}dispose(){this.dispatchEvent({type:"dispose"})}}i0.DEFAULT_UP=new is(0,1,0),i0.DEFAULT_MATRIX_AUTO_UPDATE=!0,i0.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class i1 extends i0{constructor(){super(),this.isGroup=!0,this.type="Group"}}let i2={type:"move"};class i3{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new i1,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new i1,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new is,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new is),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new i1,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new is,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new is,this._grip.eventsEnabled=!1),this._grip}dispatchEvent(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){let e=this._hand;if(e)for(let i of t.hand.values())this._getHandJoint(e,i)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(t,e,i){let s=null,r=null,a=null,n=this._targetRay,o=this._grip,h=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState){if(h&&t.hand){for(let s of(a=!0,t.hand.values())){let t=e.getJointPose(s,i),r=this._getHandJoint(h,s);null!==t&&(r.matrix.fromArray(t.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.matrixWorldNeedsUpdate=!0,r.jointRadius=t.radius),r.visible=null!==t}let s=h.joints["index-finger-tip"],r=h.joints["thumb-tip"],n=s.position.distanceTo(r.position);h.inputState.pinching&&n>.025?(h.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!h.inputState.pinching&&n<=.015&&(h.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==o&&t.gripSpace&&null!==(r=e.getPose(t.gripSpace,i))&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,o.eventsEnabled&&o.dispatchEvent({type:"gripUpdated",data:t,target:this}));null!==n&&(null===(s=e.getPose(t.targetRaySpace,i))&&null!==r&&(s=r),null!==s&&(n.matrix.fromArray(s.transform.matrix),n.matrix.decompose(n.position,n.rotation,n.scale),n.matrixWorldNeedsUpdate=!0,s.linearVelocity?(n.hasLinearVelocity=!0,n.linearVelocity.copy(s.linearVelocity)):n.hasLinearVelocity=!1,s.angularVelocity?(n.hasAngularVelocity=!0,n.angularVelocity.copy(s.angularVelocity)):n.hasAngularVelocity=!1,this.dispatchEvent(i2)))}return null!==n&&(n.visible=null!==s),null!==o&&(o.visible=null!==r),null!==h&&(h.visible=null!==a),this}_getHandJoint(t,e){if(void 0===t.joints[e.jointName]){let i=new i1;i.matrixAutoUpdate=!1,i.visible=!1,t.joints[e.jointName]=i,t.add(i)}return t.joints[e.jointName]}}let i5={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32},i4={h:0,s:0,l:0},i6={h:0,s:0,l:0};function i9(t,e,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?t+(e-t)*6*i:i<.5?e:i<2/3?t+(e-t)*6*(2/3-i):t}class i8{constructor(t,e,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,i)}set(t,e,i){return void 0===e&&void 0===i?t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t):this.setRGB(t,e,i),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=ek){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,ic.colorSpaceToWorking(this,e),this}setRGB(t,e,i,s=ic.workingColorSpace){return this.r=t,this.g=e,this.b=i,ic.colorSpaceToWorking(this,s),this}setHSL(t,e,i,s=ic.workingColorSpace){if(t=e6(t,1),e=e4(e,0,1),i=e4(i,0,1),0===e)this.r=this.g=this.b=i;else{let s=i<=.5?i*(1+e):i+e-i*e,r=2*i-s;this.r=i9(r,s,t+1/3),this.g=i9(r,s,t),this.b=i9(r,s,t-1/3)}return ic.colorSpaceToWorking(this,s),this}setStyle(t,e=ek){let i;function s(e){void 0!==e&&1>parseFloat(e)&&eZ("Color: Alpha component of "+t+" will be ignored.")}if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let r,a=i[1],n=i[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(n))return s(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(n))return s(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(n))return s(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:eZ("Color: Unknown color model "+t)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){let s=i[1],r=s.length;if(3===r)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,e);if(6===r)return this.setHex(parseInt(s,16),e);eZ("Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=ek){let i=i5[t.toLowerCase()];return void 0!==i?this.setHex(i,e):eZ("Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=ip(t.r),this.g=ip(t.g),this.b=ip(t.b),this}copyLinearToSRGB(t){return this.r=id(t.r),this.g=id(t.g),this.b=id(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=ek){return ic.workingToColorSpace(i7.copy(this),t),65536*Math.round(e4(255*i7.r,0,255))+256*Math.round(e4(255*i7.g,0,255))+Math.round(e4(255*i7.b,0,255))}getHexString(t=ek){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=ic.workingColorSpace){let i,s;ic.workingToColorSpace(i7.copy(this),e);let r=i7.r,a=i7.g,n=i7.b,o=Math.max(r,a,n),h=Math.min(r,a,n),l=(h+o)/2;if(h===o)i=0,s=0;else{let t=o-h;switch(s=l<=.5?t/(o+h):t/(2-o-h),o){case r:i=(a-n)/t+6*(a<n);break;case a:i=(n-r)/t+2;break;case n:i=(r-a)/t+4}i/=6}return t.h=i,t.s=s,t.l=l,t}getRGB(t,e=ic.workingColorSpace){return ic.workingToColorSpace(i7.copy(this),e),t.r=i7.r,t.g=i7.g,t.b=i7.b,t}getStyle(t=ek){ic.workingToColorSpace(i7.copy(this),t);let e=i7.r,i=i7.g,s=i7.b;return t!==ek?`color(${t} ${e.toFixed(3)} ${i.toFixed(3)} ${s.toFixed(3)})`:`rgb(${Math.round(255*e)},${Math.round(255*i)},${Math.round(255*s)})`}offsetHSL(t,e,i){return this.getHSL(i4),this.setHSL(i4.h+t,i4.s+e,i4.l+i)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,i){return this.r=t.r+(e.r-t.r)*i,this.g=t.g+(e.g-t.g)*i,this.b=t.b+(e.b-t.b)*i,this}lerpHSL(t,e){this.getHSL(i4),t.getHSL(i6);let i=e9(i4.h,i6.h,e),s=e9(i4.s,i6.s,e),r=e9(i4.l,i6.l,e);return this.setHSL(i,s,r),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){let e=this.r,i=this.g,s=this.b,r=t.elements;return this.r=r[0]*e+r[3]*i+r[6]*s,this.g=r[1]*e+r[4]*i+r[7]*s,this.b=r[2]*e+r[5]*i+r[8]*s,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}let i7=new i8;i8.NAMES=i5;class st extends i0{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new iV,this.environmentIntensity=1,this.environmentRotation=new iV,this.overrideMaterial=null,"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){let e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),e.object.backgroundBlurriness=this.backgroundBlurriness,e.object.backgroundIntensity=this.backgroundIntensity,e.object.backgroundRotation=this.backgroundRotation.toArray(),e.object.environmentIntensity=this.environmentIntensity,e.object.environmentRotation=this.environmentRotation.toArray(),e}}let se=new is,si=new is,ss=new is,sr=new is,sa=new is,sn=new is,so=new is,sh=new is,sl=new is,su=new is,sc=new iw,sp=new iw,sd=new iw;class sm{constructor(t=new is,e=new is,i=new is){this.a=t,this.b=e,this.c=i}static getNormal(t,e,i,s){s.subVectors(i,e),se.subVectors(t,e),s.cross(se);let r=s.lengthSq();return r>0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(t,e,i,s,r){se.subVectors(s,e),si.subVectors(i,e),ss.subVectors(t,e);let a=se.dot(se),n=se.dot(si),o=se.dot(ss),h=si.dot(si),l=si.dot(ss),u=a*h-n*n;if(0===u)return r.set(0,0,0),null;let c=1/u,p=(h*o-n*l)*c,d=(a*l-n*o)*c;return r.set(1-p-d,d,p)}static containsPoint(t,e,i,s){return null!==this.getBarycoord(t,e,i,s,sr)&&sr.x>=0&&sr.y>=0&&sr.x+sr.y<=1}static getInterpolation(t,e,i,s,r,a,n,o){return null===this.getBarycoord(t,e,i,s,sr)?(o.x=0,o.y=0,"z"in o&&(o.z=0),"w"in o&&(o.w=0),null):(o.setScalar(0),o.addScaledVector(r,sr.x),o.addScaledVector(a,sr.y),o.addScaledVector(n,sr.z),o)}static getInterpolatedAttribute(t,e,i,s,r,a){return sc.setScalar(0),sp.setScalar(0),sd.setScalar(0),sc.fromBufferAttribute(t,e),sp.fromBufferAttribute(t,i),sd.fromBufferAttribute(t,s),a.setScalar(0),a.addScaledVector(sc,r.x),a.addScaledVector(sp,r.y),a.addScaledVector(sd,r.z),a}static isFrontFacing(t,e,i,s){return se.subVectors(i,e),si.subVectors(t,e),0>se.cross(si).dot(s)}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,s){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[s]),this}setFromAttributeAndIndices(t,e,i,s){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,s),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return se.subVectors(this.c,this.b),si.subVectors(this.a,this.b),.5*se.cross(si).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return sm.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return sm.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,i,s,r){return sm.getInterpolation(t,this.a,this.b,this.c,e,i,s,r)}containsPoint(t){return sm.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return sm.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let i,s,r=this.a,a=this.b,n=this.c;sa.subVectors(a,r),sn.subVectors(n,r),sh.subVectors(t,r);let o=sa.dot(sh),h=sn.dot(sh);if(o<=0&&h<=0)return e.copy(r);sl.subVectors(t,a);let l=sa.dot(sl),u=sn.dot(sl);if(l>=0&&u<=l)return e.copy(a);let c=o*u-l*h;if(c<=0&&o>=0&&l<=0)return i=o/(o-l),e.copy(r).addScaledVector(sa,i);su.subVectors(t,n);let p=sa.dot(su),d=sn.dot(su);if(d>=0&&p<=d)return e.copy(n);let m=p*h-o*d;if(m<=0&&h>=0&&d<=0)return s=h/(h-d),e.copy(r).addScaledVector(sn,s);let y=l*d-p*u;if(y<=0&&u-l>=0&&p-d>=0)return so.subVectors(n,a),s=(u-l)/(u-l+(p-d)),e.copy(a).addScaledVector(so,s);let f=1/(y+m+c);return i=m*f,s=c*f,e.copy(r).addScaledVector(sa,i).addScaledVector(sn,s)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}class sy{constructor(t=new is(Infinity,Infinity,Infinity),e=new is(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e+=3)this.expandByPoint(sg.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,i=t.count;e<i;e++)this.expandByPoint(sg.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){let i=sg.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=Infinity,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);let i=t.geometry;if(void 0!==i){let s=i.getAttribute("position");if(!0===e&&void 0!==s&&!0!==t.isInstancedMesh)for(let e=0,i=s.count;e<i;e++)!0===t.isMesh?t.getVertexPosition(e,sg):sg.fromBufferAttribute(s,e),sg.applyMatrix4(t.matrixWorld),this.expandByPoint(sg);else void 0!==t.boundingBox?(null===t.boundingBox&&t.computeBoundingBox(),sx.copy(t.boundingBox)):(null===i.boundingBox&&i.computeBoundingBox(),sx.copy(i.boundingBox)),sx.applyMatrix4(t.matrixWorld),this.union(sx)}let s=t.children;for(let t=0,i=s.length;t<i;t++)this.expandByObject(s[t],e);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,sg),sg.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(sA),sz.subVectors(this.max,sA),sb.subVectors(t.a,sA),sM.subVectors(t.b,sA),sv.subVectors(t.c,sA),sw.subVectors(sM,sb),sS.subVectors(sv,sM),s_.subVectors(sb,sv);let e=[0,-sw.z,sw.y,0,-sS.z,sS.y,0,-s_.z,s_.y,sw.z,0,-sw.x,sS.z,0,-sS.x,s_.z,0,-s_.x,-sw.y,sw.x,0,-sS.y,sS.x,0,-s_.y,s_.x,0];return!!sk(e,sb,sM,sv,sz)&&!!sk(e=[1,0,0,0,1,0,0,0,1],sb,sM,sv,sz)&&(sT.crossVectors(sw,sS),sk(e=[sT.x,sT.y,sT.z],sb,sM,sv,sz))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,sg).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(sg).length()),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(sf[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),sf[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),sf[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),sf[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),sf[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),sf[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),sf[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),sf[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(sf)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(t){return this.min.fromArray(t.min),this.max.fromArray(t.max),this}}let sf=[new is,new is,new is,new is,new is,new is,new is,new is],sg=new is,sx=new sy,sb=new is,sM=new is,sv=new is,sw=new is,sS=new is,s_=new is,sA=new is,sz=new is,sT=new is,sC=new is;function sk(t,e,i,s,r){for(let a=0,n=t.length-3;a<=n;a+=3){sC.fromArray(t,a);let n=r.x*Math.abs(sC.x)+r.y*Math.abs(sC.y)+r.z*Math.abs(sC.z),o=e.dot(sC),h=i.dot(sC),l=s.dot(sC);if(Math.max(-Math.max(o,h,l),Math.min(o,h,l))>n)return!1}return!0}let sB=new is,sI=new ie,sO=0;class sR extends eK{constructor(t,e,i=!1){if(super(),Array.isArray(t))throw TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:sO++}),this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=i,this.usage=35044,this.updateRanges=[],this.gpuType=tO,this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}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.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let s=0,r=this.itemSize;s<r;s++)this.array[t+s]=e.array[i+s];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,i=this.count;e<i;e++)sI.fromBufferAttribute(this,e),sI.applyMatrix3(t),this.setXY(e,sI.x,sI.y);else if(3===this.itemSize)for(let e=0,i=this.count;e<i;e++)sB.fromBufferAttribute(this,e),sB.applyMatrix3(t),this.setXYZ(e,sB.x,sB.y,sB.z);return this}applyMatrix4(t){for(let e=0,i=this.count;e<i;e++)sB.fromBufferAttribute(this,e),sB.applyMatrix4(t),this.setXYZ(e,sB.x,sB.y,sB.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)sB.fromBufferAttribute(this,e),sB.applyNormalMatrix(t),this.setXYZ(e,sB.x,sB.y,sB.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)sB.fromBufferAttribute(this,e),sB.transformDirection(t),this.setXYZ(e,sB.x,sB.y,sB.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let i=this.array[t*this.itemSize+e];return this.normalized&&(i=e8(i,this.array)),i}setComponent(t,e,i){return this.normalized&&(i=e7(i,this.array)),this.array[t*this.itemSize+e]=i,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=e8(e,this.array)),e}setX(t,e){return this.normalized&&(e=e7(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=e8(e,this.array)),e}setY(t,e){return this.normalized&&(e=e7(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=e8(e,this.array)),e}setZ(t,e){return this.normalized&&(e=e7(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=e8(e,this.array)),e}setW(t,e){return this.normalized&&(e=e7(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,i){return t*=this.itemSize,this.normalized&&(e=e7(e,this.array),i=e7(i,this.array)),this.array[t+0]=e,this.array[t+1]=i,this}setXYZ(t,e,i,s){return t*=this.itemSize,this.normalized&&(e=e7(e,this.array),i=e7(i,this.array),s=e7(s,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=s,this}setXYZW(t,e,i,s,r){return t*=this.itemSize,this.normalized&&(e=e7(e,this.array),i=e7(i,this.array),s=e7(s,this.array),r=e7(r,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=s,this.array[t+3]=r,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return t.name=this.name,t.usage=this.usage,t.gpuType=this.gpuType,t}dispose(){this.dispatchEvent({type:"dispose"})}}class sN extends sR{constructor(t,e,i){super(new Uint16Array(t),e,i)}}class sP extends sR{constructor(t,e,i){super(new Uint32Array(t),e,i)}}class sE extends sR{constructor(t,e,i){super(new Float32Array(t),e,i)}}let sV=new sy,sF=new is,sL=new is;class sD{constructor(t=new is,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){let i=this.center;void 0!==e?i.copy(e):sV.setFromPoints(t).getCenter(i);let s=0;for(let e=0,r=t.length;e<r;e++)s=Math.max(s,i.distanceToSquared(t[e]));return this.radius=Math.sqrt(s),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){let e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){let i=this.center.distanceToSquared(t);return e.copy(t),i>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?t.makeEmpty():(t.set(this.center,this.center),t.expandByScalar(this.radius)),t}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;sF.subVectors(t,this.center);let e=sF.lengthSq();if(e>this.radius*this.radius){let t=Math.sqrt(e),i=(t-this.radius)*.5;this.center.addScaledVector(sF,i/t),this.radius+=i}return this}union(t){return t.isEmpty()||(this.isEmpty()?this.copy(t):!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(sL.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(sF.copy(t.center).add(sL)),this.expandByPoint(sF.copy(t.center).sub(sL)))),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(t){return this.radius=t.radius,this.center.fromArray(t.center),this}}let sj=0,sU=new iT,sW=new i0,sJ=new is,sX=new sy,sY=new sy,sq=new is;class sZ extends eK{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:sj++}),this.uuid=e5(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={},this._transformed=!1}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(!function(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}(t)?sN:sP)(t,1):this.index=t,this}setIndirect(t,e=0){return this.indirect=t,this.indirectOffset=e,this}getIndirect(){return this.indirect}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return void 0!==this.attributes[t]}addGroup(t,e,i=0){this.groups.push({start:t,count:e,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){let e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);let i=this.attributes.normal;if(void 0!==i){let e=new io().getNormalMatrix(t);i.applyNormalMatrix(e),i.needsUpdate=!0}let s=this.attributes.tangent;return void 0!==s&&(s.transformDirection(t),s.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this._transformed=!0,this}applyQuaternion(t){return sU.makeRotationFromQuaternion(t),this.applyMatrix4(sU),this}rotateX(t){return sU.makeRotationX(t),this.applyMatrix4(sU),this}rotateY(t){return sU.makeRotationY(t),this.applyMatrix4(sU),this}rotateZ(t){return sU.makeRotationZ(t),this.applyMatrix4(sU),this}translate(t,e,i){return sU.makeTranslation(t,e,i),this.applyMatrix4(sU),this}scale(t,e,i){return sU.makeScale(t,e,i),this.applyMatrix4(sU),this}lookAt(t){return sW.lookAt(t),sW.updateMatrix(),this.applyMatrix4(sW.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(sJ).negate(),this.translate(sJ.x,sJ.y,sJ.z),this}setFromPoints(t){let e=this.getAttribute("position");if(void 0===e){let e=[];for(let i=0,s=t.length;i<s;i++){let s=t[i];e.push(s.x,s.y,s.z||0)}this.setAttribute("position",new sE(e,3))}else{let i=Math.min(t.length,e.count);for(let s=0;s<i;s++){let i=t[s];e.setXYZ(s,i.x,i.y,i.z||0)}t.length>e.count&&eZ("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new sy);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){eH("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new is(-1/0,-1/0,-1/0),new is(Infinity,Infinity,Infinity));return}if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){let i=e[t];sX.setFromBufferAttribute(i),this.morphTargetsRelative?(sq.addVectors(this.boundingBox.min,sX.min),this.boundingBox.expandByPoint(sq),sq.addVectors(this.boundingBox.max,sX.max),this.boundingBox.expandByPoint(sq)):(this.boundingBox.expandByPoint(sX.min),this.boundingBox.expandByPoint(sX.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&eH('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new sD);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){eH("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new is,1/0);return}if(t){let i=this.boundingSphere.center;if(sX.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){let i=e[t];sY.setFromBufferAttribute(i),this.morphTargetsRelative?(sq.addVectors(sX.min,sY.min),sX.expandByPoint(sq),sq.addVectors(sX.max,sY.max),sX.expandByPoint(sq)):(sX.expandByPoint(sY.min),sX.expandByPoint(sY.max))}sX.getCenter(i);let s=0;for(let e=0,r=t.count;e<r;e++)sq.fromBufferAttribute(t,e),s=Math.max(s,i.distanceToSquared(sq));if(e)for(let r=0,a=e.length;r<a;r++){let a=e[r],n=this.morphTargetsRelative;for(let e=0,r=a.count;e<r;e++)sq.fromBufferAttribute(a,e),n&&(sJ.fromBufferAttribute(t,e),sq.add(sJ)),s=Math.max(s,i.distanceToSquared(sq))}this.boundingSphere.radius=Math.sqrt(s),isNaN(this.boundingSphere.radius)&&eH('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return void eH("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");let i=e.position,s=e.normal,r=e.uv,a=this.getAttribute("tangent");(void 0===a||a.count!==i.count)&&(a=new sR(new Float32Array(4*i.count),4),this.setAttribute("tangent",a));let n=[],o=[];for(let t=0;t<i.count;t++)n[t]=new is,o[t]=new is;let h=new is,l=new is,u=new is,c=new ie,p=new ie,d=new ie,m=new is,y=new is,f=this.groups;0===f.length&&(f=[{start:0,count:t.count}]);for(let e=0,s=f.length;e<s;++e){let s=f[e],a=s.start,g=s.count;for(let e=a,s=a+g;e<s;e+=3)!function(t,e,s){h.fromBufferAttribute(i,t),l.fromBufferAttribute(i,e),u.fromBufferAttribute(i,s),c.fromBufferAttribute(r,t),p.fromBufferAttribute(r,e),d.fromBufferAttribute(r,s),l.sub(h),u.sub(h),p.sub(c),d.sub(c);let a=1/(p.x*d.y-d.x*p.y);isFinite(a)&&(m.copy(l).multiplyScalar(d.y).addScaledVector(u,-p.y).multiplyScalar(a),y.copy(u).multiplyScalar(p.x).addScaledVector(l,-d.x).multiplyScalar(a),n[t].add(m),n[e].add(m),n[s].add(m),o[t].add(y),o[e].add(y),o[s].add(y))}(t.getX(e+0),t.getX(e+1),t.getX(e+2))}let g=new is,x=new is,b=new is,M=new is;function v(t){b.fromBufferAttribute(s,t),M.copy(b);let e=n[t];g.copy(e),g.sub(b.multiplyScalar(b.dot(e))).normalize(),x.crossVectors(M,e);let i=x.dot(o[t]);a.setXYZW(t,g.x,g.y,g.z,i<0?-1:1)}for(let e=0,i=f.length;e<i;++e){let i=f[e],s=i.start,r=i.count;for(let e=s,i=s+r;e<i;e+=3)v(t.getX(e+0)),v(t.getX(e+1)),v(t.getX(e+2))}this._transformed=!0}computeVertexNormals(){let t=this.index,e=this.getAttribute("position");if(void 0!==e){let i=this.getAttribute("normal");if(void 0===i||i.count!==e.count)i=new sR(new Float32Array(3*e.count),3),this.setAttribute("normal",i);else for(let t=0,e=i.count;t<e;t++)i.setXYZ(t,0,0,0);let s=new is,r=new is,a=new is,n=new is,o=new is,h=new is,l=new is,u=new is;if(t)for(let c=0,p=t.count;c<p;c+=3){let p=t.getX(c+0),d=t.getX(c+1),m=t.getX(c+2);s.fromBufferAttribute(e,p),r.fromBufferAttribute(e,d),a.fromBufferAttribute(e,m),l.subVectors(a,r),u.subVectors(s,r),l.cross(u),n.fromBufferAttribute(i,p),o.fromBufferAttribute(i,d),h.fromBufferAttribute(i,m),n.add(l),o.add(l),h.add(l),i.setXYZ(p,n.x,n.y,n.z),i.setXYZ(d,o.x,o.y,o.z),i.setXYZ(m,h.x,h.y,h.z)}else for(let t=0,n=e.count;t<n;t+=3)s.fromBufferAttribute(e,t+0),r.fromBufferAttribute(e,t+1),a.fromBufferAttribute(e,t+2),l.subVectors(a,r),u.subVectors(s,r),l.cross(u),i.setXYZ(t+0,l.x,l.y,l.z),i.setXYZ(t+1,l.x,l.y,l.z),i.setXYZ(t+2,l.x,l.y,l.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){let t=this.attributes.normal;for(let e=0,i=t.count;e<i;e++)sq.fromBufferAttribute(t,e),sq.normalize(),t.setXYZ(e,sq.x,sq.y,sq.z)}toNonIndexed(){function t(t,e){let i=t.array,s=t.itemSize,r=t.normalized,a=new i.constructor(e.length*s),n=0,o=0;for(let r=0,h=e.length;r<h;r++){n=t.isInterleavedBufferAttribute?e[r]*t.data.stride+t.offset:e[r]*s;for(let t=0;t<s;t++)a[o++]=i[n++]}return new sR(a,s,r)}if(null===this.index)return eZ("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let e=new sZ,i=this.index.array,s=this.attributes;for(let r in s){let a=t(s[r],i);e.setAttribute(r,a)}let r=this.morphAttributes;for(let s in r){let a=[],n=r[s];for(let e=0,s=n.length;e<s;e++){let s=t(n[e],i);a.push(s)}e.morphAttributes[s]=a}e.morphTargetsRelative=this.morphTargetsRelative;let a=this.groups;for(let t=0,i=a.length;t<i;t++){let i=a[t];e.addGroup(i.start,i.count,i.materialIndex)}return e}toJSON(){let t={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=void 0!==this.parameters&&!0===this._transformed?"BufferGeometry":this.type,t.name=this.name,Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters&&!0!==this._transformed){let e=this.parameters;for(let i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};let e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});let i=this.attributes;for(let e in i){let s=i[e];t.data.attributes[e]=s.toJSON(t.data)}let s={},r=!1;for(let e in this.morphAttributes){let i=this.morphAttributes[e],a=[];for(let e=0,s=i.length;e<s;e++){let s=i[e];a.push(s.toJSON(t.data))}a.length>0&&(s[e]=a,r=!0)}r&&(t.data.morphAttributes=s,t.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));let n=this.boundingSphere;return null!==n&&(t.data.boundingSphere=n.toJSON()),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let e={};this.name=t.name;let i=t.index;null!==i&&this.setIndex(i.clone());let s=t.attributes;for(let t in s){let i=s[t];this.setAttribute(t,i.clone(e))}let r=t.morphAttributes;for(let t in r){let i=[],s=r[t];for(let t=0,r=s.length;t<r;t++)i.push(s[t].clone(e));this.morphAttributes[t]=i}this.morphTargetsRelative=t.morphTargetsRelative;let a=t.groups;for(let t=0,e=a.length;t<e;t++){let e=a[t];this.addGroup(e.start,e.count,e.materialIndex)}let n=t.boundingBox;null!==n&&(this.boundingBox=n.clone());let o=t.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this._transformed=t._transformed,this}dispose(){this.dispatchEvent({type:"dispose"})}}class sH{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=35044,this.updateRanges=[],this.version=0,this.uuid=e5()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}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,i){t*=this.stride,i*=e.stride;for(let s=0,r=this.stride;s<r;s++)this.array[t+s]=e.array[i+s];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=e5()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(e,this.stride);return i.setUsage(this.usage),i}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=e5()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer)));let e={uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride};return e.usage=this.usage,e}}let sG=new is;class s${constructor(t,e,i,s=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=i,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,i=this.data.count;e<i;e++)sG.fromBufferAttribute(this,e),sG.applyMatrix4(t),this.setXYZ(e,sG.x,sG.y,sG.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)sG.fromBufferAttribute(this,e),sG.applyNormalMatrix(t),this.setXYZ(e,sG.x,sG.y,sG.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)sG.fromBufferAttribute(this,e),sG.transformDirection(t),this.setXYZ(e,sG.x,sG.y,sG.z);return this}getComponent(t,e){let i=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(i=e8(i,this.array)),i}setComponent(t,e,i){return this.normalized&&(i=e7(i,this.array)),this.data.array[t*this.data.stride+this.offset+e]=i,this}setX(t,e){return this.normalized&&(e=e7(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=e7(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=e7(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=e7(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=e8(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=e8(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=e8(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=e8(e,this.array)),e}setXY(t,e,i){return t=t*this.data.stride+this.offset,this.normalized&&(e=e7(e,this.array),i=e7(i,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this}setXYZ(t,e,i,s){return t=t*this.data.stride+this.offset,this.normalized&&(e=e7(e,this.array),i=e7(i,this.array),s=e7(s,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=s,this}setXYZW(t,e,i,s,r){return t=t*this.data.stride+this.offset,this.normalized&&(e=e7(e,this.array),i=e7(i,this.array),s=e7(s,this.array),r=e7(r,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=s,this.data.array[t+3]=r,this}clone(t){if(void 0!==t)return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new s$(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized);{eY("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let t=[];for(let e=0;e<this.count;e++){let i=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[i+e])}return new sR(new this.array.constructor(t),this.itemSize,this.normalized)}}toJSON(t){if(void 0!==t)return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized};{eY("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let t=[];for(let e=0;e<this.count;e++){let i=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[i+e])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}}}let sQ=new is,sK=new is,s0=new io;class s1{constructor(t=new is(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,i,s){return this.normal.set(t,e,i),this.constant=s,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,i){let s=sQ.subVectors(i,e).cross(sK.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(s,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){let t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e,i=!0){let s=t.delta(sQ),r=this.normal.dot(s);if(0===r)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;let a=-(t.start.dot(this.normal)+this.constant)/r;return!0===i&&(a<0||a>1)?null:e.copy(t.start).addScaledVector(s,a)}intersectsLine(t){let e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){let i=e||s0.getNormalMatrix(t),s=this.coplanarPoint(sQ).applyMatrix4(t),r=this.normal.applyMatrix3(i).normalize();return this.constant=-s.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}toJSON(){return{normal:this.normal.toArray(),constant:this.constant}}fromJSON(t){return this.normal.fromArray(t.normal),this.constant=t.constant,this}}let s2=0;class s3 extends eK{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:s2++}),this.uuid=e5(),this.name="",this.type="Material",this.blending=v,this.side=g,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=P,this.blendDst=E,this.blendEquation=z,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new i8(0,0,0),this.blendAlpha=0,this.depthFunc=H,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(let e in t){let i=t[e];if(void 0===i){eZ(`Material: parameter '${e}' has value of undefined.`);continue}let s=this[e];if(void 0===s){eZ(`Material: '${e}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(i):s&&s.isVector2&&i&&i.isVector2||s&&s.isEuler&&i&&i.isEuler||s&&s.isVector3&&i&&i.isVector3?s.copy(i):this[e]=i}}toJSON(t){let e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});let i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};function s(t){let e=[];for(let i in t){let s=t[i];delete s.metadata,e.push(s)}return e}if(i.uuid=this.uuid,i.type=this.type,i.blending=this.blending,i.side=this.side,i.shadowSide=this.shadowSide,i.vertexColors=this.vertexColors,i.opacity=this.opacity,i.transparent=this.transparent,i.blendSrc=this.blendSrc,i.blendDst=this.blendDst,i.blendEquation=this.blendEquation,i.blendSrcAlpha=this.blendSrcAlpha,i.blendDstAlpha=this.blendDstAlpha,i.blendEquationAlpha=this.blendEquationAlpha,i.blendColor=this.blendColor.getHex(),i.blendAlpha=this.blendAlpha,i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.clipIntersection=this.clipIntersection,i.clipShadows=this.clipShadows,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,i.stencilWrite=this.stencilWrite,i.polygonOffset=this.polygonOffset,i.polygonOffsetFactor=this.polygonOffsetFactor,i.polygonOffsetUnits=this.polygonOffsetUnits,i.dithering=this.dithering,i.alphaTest=this.alphaTest,i.alphaHash=this.alphaHash,i.alphaToCoverage=this.alphaToCoverage,i.premultipliedAlpha=this.premultipliedAlpha,i.forceSinglePass=this.forceSinglePass,i.allowOverride=this.allowOverride,i.visible=this.visible,i.toneMapped=this.toneMapped,i.name=this.name,this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(t).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(t).uuid),void 0!==this.dispersion&&(i.dispersion=this.dispersion),void 0!==this.retroreflectivity&&(i.retroreflectivity=this.retroreflectivity),void 0!==this.iridescence&&(i.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(i.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(i.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapRotation&&(i.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),Array.isArray(this.clippingPlanes)&&this.clippingPlanes.length>0&&(i.clippingPlanes=this.clippingPlanes.map(t=>t.toJSON())),void 0!==this.rotation&&(i.rotation=this.rotation),void 0!==this.depthPacking&&(i.depthPacking=this.depthPacking),void 0!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.linecap&&(i.linecap=this.linecap),void 0!==this.linejoin&&(i.linejoin=this.linejoin),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),void 0!==this.wireframe&&(i.wireframe=this.wireframe),void 0!==this.wireframeLinewidth&&(i.wireframeLinewidth=this.wireframeLinewidth),void 0!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),void 0!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),void 0!==this.flatShading&&(i.flatShading=this.flatShading),void 0!==this.fog&&(i.fog=this.fog),Object.keys(this.userData).length>0&&(i.userData=this.userData),e){let e=s(t.textures),r=s(t.images);e.length>0&&(i.textures=e),r.length>0&&(i.images=r)}return i}fromJSON(t,e){if(void 0!==t.uuid&&(this.uuid=t.uuid),void 0!==t.name&&(this.name=t.name),void 0!==t.color&&void 0!==this.color&&this.color.setHex(t.color),void 0!==t.roughness&&(this.roughness=t.roughness),void 0!==t.metalness&&(this.metalness=t.metalness),void 0!==t.sheen&&(this.sheen=t.sheen),void 0!==t.sheenColor&&(this.sheenColor=new i8().setHex(t.sheenColor)),void 0!==t.sheenRoughness&&(this.sheenRoughness=t.sheenRoughness),void 0!==t.emissive&&void 0!==this.emissive&&this.emissive.setHex(t.emissive),void 0!==t.specular&&void 0!==this.specular&&this.specular.setHex(t.specular),void 0!==t.specularIntensity&&(this.specularIntensity=t.specularIntensity),void 0!==t.specularColor&&void 0!==this.specularColor&&this.specularColor.setHex(t.specularColor),void 0!==t.shininess&&(this.shininess=t.shininess),void 0!==t.clearcoat&&(this.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(this.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.dispersion&&(this.dispersion=t.dispersion),void 0!==t.retroreflectivity&&(this.retroreflectivity=t.retroreflectivity),void 0!==t.iridescence&&(this.iridescence=t.iridescence),void 0!==t.iridescenceIOR&&(this.iridescenceIOR=t.iridescenceIOR),void 0!==t.iridescenceThicknessRange&&(this.iridescenceThicknessRange=t.iridescenceThicknessRange),void 0!==t.transmission&&(this.transmission=t.transmission),void 0!==t.thickness&&(this.thickness=t.thickness),void 0!==t.attenuationDistance&&(this.attenuationDistance=t.attenuationDistance),void 0!==t.attenuationColor&&void 0!==this.attenuationColor&&this.attenuationColor.setHex(t.attenuationColor),void 0!==t.anisotropy&&(this.anisotropy=t.anisotropy),void 0!==t.anisotropyRotation&&(this.anisotropyRotation=t.anisotropyRotation),void 0!==t.fog&&(this.fog=t.fog),void 0!==t.flatShading&&(this.flatShading=t.flatShading),void 0!==t.blending&&(this.blending=t.blending),void 0!==t.combine&&(this.combine=t.combine),void 0!==t.side&&(this.side=t.side),void 0!==t.shadowSide&&(this.shadowSide=t.shadowSide),void 0!==t.opacity&&(this.opacity=t.opacity),void 0!==t.transparent&&(this.transparent=t.transparent),void 0!==t.alphaTest&&(this.alphaTest=t.alphaTest),void 0!==t.alphaHash&&(this.alphaHash=t.alphaHash),void 0!==t.depthFunc&&(this.depthFunc=t.depthFunc),void 0!==t.depthTest&&(this.depthTest=t.depthTest),void 0!==t.depthWrite&&(this.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(this.colorWrite=t.colorWrite),void 0!==t.clippingPlanes&&(this.clippingPlanes=t.clippingPlanes.map(t=>new s1().fromJSON(t))),void 0!==t.clipIntersection&&(this.clipIntersection=t.clipIntersection),void 0!==t.clipShadows&&(this.clipShadows=t.clipShadows),void 0!==t.depthPacking&&(this.depthPacking=t.depthPacking),void 0!==t.blendSrc&&(this.blendSrc=t.blendSrc),void 0!==t.blendDst&&(this.blendDst=t.blendDst),void 0!==t.blendEquation&&(this.blendEquation=t.blendEquation),void 0!==t.blendSrcAlpha&&(this.blendSrcAlpha=t.blendSrcAlpha),void 0!==t.blendDstAlpha&&(this.blendDstAlpha=t.blendDstAlpha),void 0!==t.blendEquationAlpha&&(this.blendEquationAlpha=t.blendEquationAlpha),void 0!==t.blendColor&&void 0!==this.blendColor&&this.blendColor.setHex(t.blendColor),void 0!==t.blendAlpha&&(this.blendAlpha=t.blendAlpha),void 0!==t.stencilWriteMask&&(this.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(this.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(this.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(this.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(this.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(this.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(this.stencilZPass=t.stencilZPass),void 0!==t.stencilWrite&&(this.stencilWrite=t.stencilWrite),void 0!==t.wireframe&&(this.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(this.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(this.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(this.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(this.rotation=t.rotation),void 0!==t.linewidth&&(this.linewidth=t.linewidth),void 0!==t.linecap&&(this.linecap=t.linecap),void 0!==t.linejoin&&(this.linejoin=t.linejoin),void 0!==t.dashSize&&(this.dashSize=t.dashSize),void 0!==t.gapSize&&(this.gapSize=t.gapSize),void 0!==t.scale&&(this.scale=t.scale),void 0!==t.polygonOffset&&(this.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(this.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(this.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.dithering&&(this.dithering=t.dithering),void 0!==t.alphaToCoverage&&(this.alphaToCoverage=t.alphaToCoverage),void 0!==t.premultipliedAlpha&&(this.premultipliedAlpha=t.premultipliedAlpha),void 0!==t.forceSinglePass&&(this.forceSinglePass=t.forceSinglePass),void 0!==t.allowOverride&&(this.allowOverride=t.allowOverride),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.toneMapped&&(this.toneMapped=t.toneMapped),void 0!==t.userData&&(this.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?this.vertexColors=t.vertexColors>0:this.vertexColors=t.vertexColors),void 0!==t.size&&(this.size=t.size),void 0!==t.sizeAttenuation&&(this.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(this.map=e[t.map]||null),void 0!==t.matcap&&(this.matcap=e[t.matcap]||null),void 0!==t.alphaMap&&(this.alphaMap=e[t.alphaMap]||null),void 0!==t.bumpMap&&(this.bumpMap=e[t.bumpMap]||null),void 0!==t.bumpScale&&(this.bumpScale=t.bumpScale),void 0!==t.normalMap&&(this.normalMap=e[t.normalMap]||null),void 0!==t.normalMapType&&(this.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),this.normalScale=new ie().fromArray(e)}return void 0!==t.displacementMap&&(this.displacementMap=e[t.displacementMap]||null),void 0!==t.displacementScale&&(this.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(this.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(this.roughnessMap=e[t.roughnessMap]||null),void 0!==t.metalnessMap&&(this.metalnessMap=e[t.metalnessMap]||null),void 0!==t.emissiveMap&&(this.emissiveMap=e[t.emissiveMap]||null),void 0!==t.emissiveIntensity&&(this.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(this.specularMap=e[t.specularMap]||null),void 0!==t.specularIntensityMap&&(this.specularIntensityMap=e[t.specularIntensityMap]||null),void 0!==t.specularColorMap&&(this.specularColorMap=e[t.specularColorMap]||null),void 0!==t.envMap&&(this.envMap=e[t.envMap]||null),void 0!==t.envMapRotation&&this.envMapRotation.fromArray(t.envMapRotation),void 0!==t.envMapIntensity&&(this.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(this.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(this.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(this.lightMap=e[t.lightMap]||null),void 0!==t.lightMapIntensity&&(this.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(this.aoMap=e[t.aoMap]||null),void 0!==t.aoMapIntensity&&(this.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(this.gradientMap=e[t.gradientMap]||null),void 0!==t.clearcoatMap&&(this.clearcoatMap=e[t.clearcoatMap]||null),void 0!==t.clearcoatRoughnessMap&&(this.clearcoatRoughnessMap=e[t.clearcoatRoughnessMap]||null),void 0!==t.clearcoatNormalMap&&(this.clearcoatNormalMap=e[t.clearcoatNormalMap]||null),void 0!==t.clearcoatNormalScale&&(this.clearcoatNormalScale=new ie().fromArray(t.clearcoatNormalScale)),void 0!==t.iridescenceMap&&(this.iridescenceMap=e[t.iridescenceMap]||null),void 0!==t.iridescenceThicknessMap&&(this.iridescenceThicknessMap=e[t.iridescenceThicknessMap]||null),void 0!==t.transmissionMap&&(this.transmissionMap=e[t.transmissionMap]||null),void 0!==t.thicknessMap&&(this.thicknessMap=e[t.thicknessMap]||null),void 0!==t.anisotropyMap&&(this.anisotropyMap=e[t.anisotropyMap]||null),void 0!==t.sheenColorMap&&(this.sheenColorMap=e[t.sheenColorMap]||null),void 0!==t.sheenRoughnessMap&&(this.sheenRoughnessMap=e[t.sheenRoughnessMap]||null),this}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;let e=t.clippingPlanes,i=null;if(null!==e){let t=e.length;i=Array(t);for(let s=0;s!==t;++s)i[s]=e[s].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.allowOverride=t.allowOverride,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}}let s5=new is,s4=new is,s6=new is,s9=new is;class s8{constructor(t=new is,e=new is(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,s5)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);let i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){let e=s5.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(s5.copy(this.origin).addScaledVector(this.direction,e),s5.distanceToSquared(t))}distanceSqToSegment(t,e,i,s){let r,a,n,o;s4.copy(t).add(e).multiplyScalar(.5),s6.copy(e).sub(t).normalize(),s9.copy(this.origin).sub(s4);let h=.5*t.distanceTo(e),l=-this.direction.dot(s6),u=s9.dot(this.direction),c=-s9.dot(s6),p=s9.lengthSq(),d=Math.abs(1-l*l);if(d>0)if(r=l*c-u,a=l*u-c,o=h*d,r>=0)if(a>=-o)if(a<=o){let t=1/d;r*=t,a*=t,n=r*(r+l*a+2*u)+a*(l*r+a+2*c)+p}else n=-(r=Math.max(0,-(l*(a=h)+u)))*r+a*(a+2*c)+p;else n=-(r=Math.max(0,-(l*(a=-h)+u)))*r+a*(a+2*c)+p;else a<=-o?(a=(r=Math.max(0,-(-l*h+u)))>0?-h:Math.min(Math.max(-h,-c),h),n=-r*r+a*(a+2*c)+p):a<=o?(r=0,n=(a=Math.min(Math.max(-h,-c),h))*(a+2*c)+p):(a=(r=Math.max(0,-(l*h+u)))>0?h:Math.min(Math.max(-h,-c),h),n=-r*r+a*(a+2*c)+p);else a=l>0?-h:h,n=-(r=Math.max(0,-(l*a+u)))*r+a*(a+2*c)+p;return i&&i.copy(this.origin).addScaledVector(this.direction,r),s&&s.copy(s4).addScaledVector(s6,a),n}intersectSphere(t,e){if(t.radius<0)return null;s5.subVectors(t.center,this.origin);let i=s5.dot(this.direction),s=s5.dot(s5)-i*i,r=t.radius*t.radius;if(s>r)return null;let a=Math.sqrt(r-s),n=i-a,o=i+a;return o<0?null:n<0?this.at(o,e):this.at(n,e)}intersectsSphere(t){return!(t.radius<0)&&this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){let e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;let i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){let i=this.distanceToPlane(t);return null===i?null:this.at(i,e)}intersectsPlane(t){let e=t.distanceToPoint(this.origin);return!!(0===e||t.normal.dot(this.direction)*e<0)}intersectBox(t,e){let i,s,r,a,n,o,h=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,c=this.origin;return(h>=0?(i=(t.min.x-c.x)*h,s=(t.max.x-c.x)*h):(i=(t.max.x-c.x)*h,s=(t.min.x-c.x)*h),l>=0?(r=(t.min.y-c.y)*l,a=(t.max.y-c.y)*l):(r=(t.max.y-c.y)*l,a=(t.min.y-c.y)*l),i>a||r>s||((r>i||isNaN(i))&&(i=r),(a<s||isNaN(s))&&(s=a),u>=0?(n=(t.min.z-c.z)*u,o=(t.max.z-c.z)*u):(n=(t.max.z-c.z)*u,o=(t.min.z-c.z)*u),i>o||n>s||((n>i||i!=i)&&(i=n),(o<s||s!=s)&&(s=o),s<0)))?null:this.at(i>=0?i:s,e)}intersectsBox(t){return null!==this.intersectBox(t,s5)}intersectTriangle(t,e,i,s,r){let a,n,o,h,l,u,c,p,d,m,y,f,g=this.origin,x=this.direction,b=x.x,M=x.y,v=x.z,w=t.x-g.x,S=t.y-g.y,_=t.z-g.z,A=e.x-g.x,z=e.y-g.y,T=e.z-g.z,C=i.x-g.x,k=i.y-g.y,B=i.z-g.z,I=Math.abs(b),O=Math.abs(M),R=Math.abs(v);if(I>=O&&I>=R?(o=b,u=w,d=A,f=C,b>=0?(a=M,n=v,h=S,l=_,c=z,p=T,m=k,y=B):(a=v,n=M,h=_,l=S,c=T,p=z,m=B,y=k)):O>=R?(o=M,u=S,d=z,f=k,M>=0?(a=v,n=b,h=_,l=w,c=T,p=A,m=B,y=C):(a=b,n=v,h=w,l=_,c=A,p=T,m=C,y=B)):(o=v,u=_,d=T,f=B,v>=0?(a=b,n=M,h=w,l=S,c=A,p=z,m=C,y=k):(a=M,n=b,h=S,l=w,c=z,p=A,m=k,y=C)),0===o)return null;let N=a/o,P=n/o,E=1/o,V=h-N*u,F=l-P*u,L=c-N*d,D=p-P*d,j=m-N*f,U=y-P*f,W=j*D-U*L,J=V*U-F*j,X=L*F-D*V;if(s){if(W<0||J<0||X<0)return null}else if((W<0||J<0||X<0)&&(W>0||J>0||X>0))return null;let Y=W+J+X;if(0===Y)return null;let q=E*(W*u+J*d+X*f);return(Y>0?q<0:q>0)?null:this.at(q/Y,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class s7 extends s3{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new i8(0xffffff),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new iV,this.combine=tt,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}let rt=new iT,re=new s8,ri=new sD,rs=new is,rr=new is,ra=new is,rn=new is,ro=new is,rh=new is,rl=new is,ru=new is;class rc extends i0{constructor(t=new sZ,e=new s7){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){let t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){let i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=i.length;t<e;t++){let e=i[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}getVertexPosition(t,e){let i=this.geometry,s=i.attributes.position,r=i.morphAttributes.position,a=i.morphTargetsRelative;e.fromBufferAttribute(s,t);let n=this.morphTargetInfluences;if(r&&n){rh.set(0,0,0);for(let i=0,s=r.length;i<s;i++){let s=n[i],o=r[i];0!==s&&(ro.fromBufferAttribute(o,t),a?rh.addScaledVector(ro,s):rh.addScaledVector(ro.sub(e),s))}e.add(rh)}return e}intersectsFrustum(t){return t.intersectsObject(this)}raycast(t,e){let i=this.geometry,s=this.material,r=this.matrixWorld;void 0===s||(null===i.boundingSphere&&i.computeBoundingSphere(),ri.copy(i.boundingSphere),ri.applyMatrix4(r),re.copy(t.ray).recast(t.near),!1===ri.containsPoint(re.origin)&&(null===re.intersectSphere(ri,rs)||re.origin.distanceToSquared(rs)>(t.far-t.near)**2)||(rt.copy(r).invert(),re.copy(t.ray).applyMatrix4(rt),(null===i.boundingBox||!1!==re.intersectsBox(i.boundingBox))&&this._computeIntersections(t,e,re)))}_computeIntersections(t,e,i){let s,r=this.geometry,a=this.material,n=r.index,o=r.attributes.position,h=r.attributes.uv,l=r.attributes.uv1,u=r.attributes.normal,c=r.groups,p=r.drawRange;if(null!==n)if(Array.isArray(a))for(let r=0,o=c.length;r<o;r++){let o=c[r],d=a[o.materialIndex],m=Math.max(o.start,p.start),y=Math.min(n.count,Math.min(o.start+o.count,p.start+p.count));for(let r=m;r<y;r+=3)(s=rp(this,d,t,i,h,l,u,n.getX(r),n.getX(r+1),n.getX(r+2)))&&(s.faceIndex=Math.floor(r/3),s.face.materialIndex=o.materialIndex,e.push(s))}else{let r=Math.max(0,p.start),o=Math.min(n.count,p.start+p.count);for(let c=r;c<o;c+=3)(s=rp(this,a,t,i,h,l,u,n.getX(c),n.getX(c+1),n.getX(c+2)))&&(s.faceIndex=Math.floor(c/3),e.push(s))}else if(void 0!==o)if(Array.isArray(a))for(let r=0,n=c.length;r<n;r++){let n=c[r],d=a[n.materialIndex],m=Math.max(n.start,p.start),y=Math.min(o.count,Math.min(n.start+n.count,p.start+p.count));for(let r=m;r<y;r+=3)(s=rp(this,d,t,i,h,l,u,r,r+1,r+2))&&(s.faceIndex=Math.floor(r/3),s.face.materialIndex=n.materialIndex,e.push(s))}else{let r=Math.max(0,p.start),n=Math.min(o.count,p.start+p.count);for(let o=r;o<n;o+=3)(s=rp(this,a,t,i,h,l,u,o,o+1,o+2))&&(s.faceIndex=Math.floor(o/3),e.push(s))}}}function rp(t,e,i,s,r,a,n,o,h,l){t.getVertexPosition(o,rr),t.getVertexPosition(h,ra),t.getVertexPosition(l,rn);let u=function(t,e,i,s,r,a,n,o){if(null===(e.side===x?s.intersectTriangle(n,a,r,!0,o):s.intersectTriangle(r,a,n,e.side===g,o)))return null;ru.copy(o),ru.applyMatrix4(t.matrixWorld);let h=i.ray.origin.distanceTo(ru);return h<i.near||h>i.far?null:{distance:h,point:ru.clone(),object:t}}(t,e,i,s,rr,ra,rn,rl);if(u){let t=new is;sm.getBarycoord(rl,rr,ra,rn,t),r&&(u.uv=sm.getInterpolatedAttribute(r,o,h,l,t,new ie)),a&&(u.uv1=sm.getInterpolatedAttribute(a,o,h,l,t,new ie)),n&&(u.normal=sm.getInterpolatedAttribute(n,o,h,l,t,new is),u.normal.dot(s.direction)>0&&u.normal.multiplyScalar(-1));let e={a:o,b:h,c:l,normal:new is,materialIndex:0};sm.getNormal(rr,ra,rn,e.normal),u.face=e,u.barycoord=t}return u}let rd=new iw,rm=new iw,ry=new iw,rf=new iw,rg=new iT,rx=new is,rb=new sD,rM=new iT,rv=new s8;class rw extends rc{constructor(t,e){super(t,e),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=tc,this.bindMatrix=new iT,this.bindMatrixInverse=new iT,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){let t=this.geometry;null===this.boundingBox&&(this.boundingBox=new sy),this.boundingBox.makeEmpty();let e=t.getAttribute("position");for(let t=0;t<e.count;t++)this.getVertexPosition(t,rx),this.boundingBox.expandByPoint(rx)}computeBoundingSphere(){let t=this.geometry;null===this.boundingSphere&&(this.boundingSphere=new sD),this.boundingSphere.makeEmpty();let e=t.getAttribute("position");for(let t=0;t<e.count;t++)this.getVertexPosition(t,rx),this.boundingSphere.expandByPoint(rx)}copy(t,e){return super.copy(t,e),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this}raycast(t,e){let i=this.material,s=this.matrixWorld;void 0===i||(null===this.boundingSphere&&this.computeBoundingSphere(),rb.copy(this.boundingSphere),rb.applyMatrix4(s),!1===t.ray.intersectsSphere(rb)||(rM.copy(s).invert(),rv.copy(t.ray).applyMatrix4(rM),(null===this.boundingBox||!1!==rv.intersectsBox(this.boundingBox))&&this._computeIntersections(t,e,rv)))}getVertexPosition(t,e){return super.getVertexPosition(t,e),this.applyBoneTransform(t,e),e}bind(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.copy(e).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){let t=new iw,e=this.geometry.attributes.skinWeight;for(let i=0,s=e.count;i<s;i++){t.fromBufferAttribute(e,i);let s=1/t.manhattanLength();s!==1/0?t.multiplyScalar(s):t.set(1,0,0,0),e.setXYZW(i,t.x,t.y,t.z,t.w)}}updateMatrixWorld(t){super.updateMatrixWorld(t),this.bindMode===tc?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():eZ("SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(t,e){let i=this.skeleton,s=this.geometry;rm.fromBufferAttribute(s.attributes.skinIndex,t),ry.fromBufferAttribute(s.attributes.skinWeight,t),e.isVector4?(rd.copy(e),e.set(0,0,0,0)):(rd.set(...e,1),e.set(0,0,0)),rd.applyMatrix4(this.bindMatrix);for(let t=0;t<4;t++){let s=ry.getComponent(t);if(0!==s){let r=rm.getComponent(t);rg.multiplyMatrices(i.bones[r].matrixWorld,i.boneInverses[r]),e.addScaledVector(rf.copy(rd).applyMatrix4(rg),s)}}return e.isVector4&&(e.w=rd.w),e.applyMatrix4(this.bindMatrixInverse)}}class rS extends i0{constructor(){super(),this.isBone=!0,this.type="Bone"}}class r_ extends iv{constructor(t=null,e=1,i=1,s,r,a,n,o,h=tM,l=tM,u,c){super(null,a,n,o,h,l,s,r,u,c),this.isDataTexture=!0,this.image={data:t,width:e,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}let rA=new iT,rz=new iT;class rT{constructor(t=[],e=[]){this.uuid=e5(),this.bones=t.slice(0),this.boneInverses=e,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){let t=this.bones,e=this.boneInverses;if(this.boneMatrices=new Float32Array(16*t.length),0===e.length)this.calculateInverses();else if(t.length!==e.length){eZ("Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let t=0,e=this.bones.length;t<e;t++)this.boneInverses.push(new iT)}}calculateInverses(){this.boneInverses.length=0;for(let t=0,e=this.bones.length;t<e;t++){let e=new iT;this.bones[t]&&e.copy(this.bones[t].matrixWorld).invert(),this.boneInverses.push(e)}}pose(){for(let t=0,e=this.bones.length;t<e;t++){let e=this.bones[t];e&&e.matrixWorld.copy(this.boneInverses[t]).invert()}for(let t=0,e=this.bones.length;t<e;t++){let e=this.bones[t];e&&(e.parent&&e.parent.isBone?(e.matrix.copy(e.parent.matrixWorld).invert(),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))}}update(){let t=this.bones,e=this.boneInverses,i=this.boneMatrices,s=this.boneTexture;for(let s=0,r=t.length;s<r;s++){let r=t[s]?t[s].matrixWorld:rz;rA.multiplyMatrices(r,e[s]),rA.toArray(i,16*s)}null!==s&&(s.needsUpdate=!0)}clone(){return new rT(this.bones,this.boneInverses)}computeBoneTexture(){let t=Math.sqrt(4*this.bones.length),e=new Float32Array((t=Math.max(t=4*Math.ceil(t/4),4))*t*4);e.set(this.boneMatrices);let i=new r_(e,t,t,tj,tO);return i.needsUpdate=!0,this.boneMatrices=e,this.boneTexture=i,this}getBoneByName(t){for(let e=0,i=this.bones.length;e<i;e++){let i=this.bones[e];if(i.name===t)return i}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(t,e){this.uuid=t.uuid;for(let i=0,s=t.bones.length;i<s;i++){let s=t.bones[i],r=e[s];void 0===r&&(eZ("Skeleton: No bone found with UUID:",s),r=new rS),this.bones.push(r),this.boneInverses.push(new iT().fromArray(t.boneInverses[i]))}return this.init(),this}toJSON(){let t={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};t.uuid=this.uuid;let e=this.bones,i=this.boneInverses;for(let s=0,r=e.length;s<r;s++){let r=e[s];t.bones.push(r.uuid);let a=i[s];t.boneInverses.push(a.toArray())}return t}}class rC extends sR{constructor(t,e,i,s=1){super(t,e,i),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=s}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){let t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}let rk=new iT,rB=new iT,rI=[],rO=new sy,rR=new iT,rN=new rc,rP=new sD;class rE extends rc{constructor(t,e,i){super(t,e),this.isInstancedMesh=!0,this.instanceMatrix=new rC(new Float32Array(16*i),16),this.instanceColor=null,this.morphTexture=null,this.count=i,this.boundingBox=null,this.boundingSphere=null;for(let t=0;t<i;t++)this.setMatrixAt(t,rR)}computeBoundingBox(){let t=this.geometry,e=this.count;null===this.boundingBox&&(this.boundingBox=new sy),null===t.boundingBox&&t.computeBoundingBox(),this.boundingBox.makeEmpty();for(let i=0;i<e;i++)this.getMatrixAt(i,rk),rO.copy(t.boundingBox).applyMatrix4(rk),this.boundingBox.union(rO)}computeBoundingSphere(){let t=this.geometry,e=this.count;null===this.boundingSphere&&(this.boundingSphere=new sD),null===t.boundingSphere&&t.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let i=0;i<e;i++)this.getMatrixAt(i,rk),rP.copy(t.boundingSphere).applyMatrix4(rk),this.boundingSphere.union(rP)}copy(t,e){return super.copy(t,e),this.instanceMatrix.copy(t.instanceMatrix),null!==t.morphTexture&&(this.morphTexture=t.morphTexture.clone()),null!==t.instanceColor&&(this.instanceColor=t.instanceColor.clone()),this.count=t.count,null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this}getColorAt(t,e){return null===this.instanceColor?e.setRGB(1,1,1):e.fromArray(this.instanceColor.array,3*t)}getMatrixAt(t,e){return e.fromArray(this.instanceMatrix.array,16*t)}getMorphAt(t,e){let i=e.morphTargetInfluences,s=this.morphTexture.source.data.data,r=t*(i.length+1)+1;for(let t=0;t<i.length;t++)i[t]=s[r+t]}raycast(t,e){let i=this.matrixWorld,s=this.count;if((rN.geometry=this.geometry,rN.material=this.material,void 0!==rN.material)&&(null===this.boundingSphere&&this.computeBoundingSphere(),rP.copy(this.boundingSphere),rP.applyMatrix4(i),!1!==t.ray.intersectsSphere(rP)))for(let r=0;r<s;r++){this.getMatrixAt(r,rk),rB.multiplyMatrices(i,rk),rN.matrixWorld=rB,rN.raycast(t,rI);for(let t=0,i=rI.length;t<i;t++){let i=rI[t];i.instanceId=r,i.object=this,e.push(i)}rI.length=0}}setColorAt(t,e){return null===this.instanceColor&&(this.instanceColor=new rC(new Float32Array(3*this.instanceMatrix.count).fill(1),3)),e.toArray(this.instanceColor.array,3*t),this}setMatrixAt(t,e){return e.toArray(this.instanceMatrix.array,16*t),this}setMorphAt(t,e){let i=e.morphTargetInfluences,s=i.length+1;null===this.morphTexture&&(this.morphTexture=new r_(new Float32Array(s*this.count),s,this.count,tJ,tO));let r=this.morphTexture.source.data.data,a=0;for(let t=0;t<i.length;t++)a+=i[t];let n=this.geometry.morphTargetsRelative?1:1-a,o=s*t;return r[o]=n,r.set(i,o+1),this}updateMorphTargets(){}dispose(){super.dispose(),null!==this.morphTexture&&(this.morphTexture.dispose(),this.morphTexture=null)}}let rV=new sD,rF=new ie(.5,.5),rL=new is;class rD{constructor(t=new s1,e=new s1,i=new s1,s=new s1,r=new s1,a=new s1){this.planes=[t,e,i,s,r,a]}set(t,e,i,s,r,a){let n=this.planes;return n[0].copy(t),n[1].copy(e),n[2].copy(i),n[3].copy(s),n[4].copy(r),n[5].copy(a),this}copy(t){let e=this.planes;for(let i=0;i<6;i++)e[i].copy(t.planes[i]);return this}setFromProjectionMatrix(t,e=eU,i=!1){let s=this.planes,r=t.elements,a=r[0],n=r[1],o=r[2],h=r[3],l=r[4],u=r[5],c=r[6],p=r[7],d=r[8],m=r[9],y=r[10],f=r[11],g=r[12],x=r[13],b=r[14],M=r[15];if(s[0].setComponents(h-a,p-l,f-d,M-g).normalize(),s[1].setComponents(h+a,p+l,f+d,M+g).normalize(),s[2].setComponents(h+n,p+u,f+m,M+x).normalize(),s[3].setComponents(h-n,p-u,f-m,M-x).normalize(),i)s[4].setComponents(o,c,y,b).normalize(),s[5].setComponents(h-o,p-c,f-y,M-b).normalize();else if(s[4].setComponents(h-o,p-c,f-y,M-b).normalize(),e===eU)s[5].setComponents(h+o,p+c,f+y,M+b).normalize();else if(2001===e)s[5].setComponents(o,c,y,b).normalize();else throw Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),rV.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{let e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),rV.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(rV)}intersectsSprite(t){return rV.center.set(0,0,0),rV.radius=.7071067811865476+rF.distanceTo(t.center),rV.applyMatrix4(t.matrixWorld),this.intersectsSphere(rV)}intersectsSphere(t){let e=this.planes,i=t.center,s=-t.radius;for(let t=0;t<6;t++)if(e[t].distanceToPoint(i)<s)return!1;return!0}intersectsBox(t){let e=this.planes;for(let i=0;i<6;i++){let s=e[i];if(rL.x=s.normal.x>0?t.max.x:t.min.x,rL.y=s.normal.y>0?t.max.y:t.min.y,rL.z=s.normal.z>0?t.max.z:t.min.z,0>s.distanceToPoint(rL))return!1}return!0}containsPoint(t){let e=this.planes;for(let i=0;i<6;i++)if(0>e[i].distanceToPoint(t))return!1;return!0}clone(){return new this.constructor().copy(this)}}class rj extends s3{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new i8(0xffffff),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}let rU=new is,rW=new is,rJ=new iT,rX=new s8,rY=new sD,rq=new is,rZ=new is;class rH extends i0{constructor(t=new sZ,e=new rj){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){let t=this.geometry;if(null===t.index){let e=t.attributes.position,i=[0];for(let t=1,s=e.count;t<s;t++)rU.fromBufferAttribute(e,t-1),rW.fromBufferAttribute(e,t),i[t]=i[t-1],i[t]+=rU.distanceTo(rW);t.setAttribute("lineDistance",new sE(i,1))}else eZ("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}intersectsFrustum(t){return t.intersectsObject(this)}raycast(t,e){let i=this.geometry,s=this.matrixWorld,r=t.params.Line.threshold,a=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),rY.copy(i.boundingSphere),rY.applyMatrix4(s),rY.radius+=r,!1===t.ray.intersectsSphere(rY))return;rJ.copy(s).invert(),rX.copy(t.ray).applyMatrix4(rJ);let n=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=n*n,h=this.isLineSegments?2:1,l=i.index,u=i.attributes.position;if(null!==l){let i=Math.max(0,a.start),s=Math.min(l.count,a.start+a.count);for(let r=i,a=s-1;r<a;r+=h){let i=rG(this,t,rX,o,l.getX(r),l.getX(r+1),r);i&&e.push(i)}if(this.isLineLoop){let r=rG(this,t,rX,o,l.getX(s-1),l.getX(i),s-1);r&&e.push(r)}}else{let i=Math.max(0,a.start),s=Math.min(u.count,a.start+a.count);for(let r=i,a=s-1;r<a;r+=h){let i=rG(this,t,rX,o,r,r+1,r);i&&e.push(i)}if(this.isLineLoop){let r=rG(this,t,rX,o,s-1,i,s-1);r&&e.push(r)}}}updateMorphTargets(){let t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){let i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=i.length;t<e;t++){let e=i[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}}function rG(t,e,i,s,r,a,n){let o=t.geometry.attributes.position;if(rU.fromBufferAttribute(o,r),rW.fromBufferAttribute(o,a),i.distanceSqToSegment(rU,rW,rq,rZ)>s)return;rq.applyMatrix4(t.matrixWorld);let h=e.ray.origin.distanceTo(rq);if(!(h<e.near)&&!(h>e.far))return{distance:h,point:rZ.clone().applyMatrix4(t.matrixWorld),index:n,face:null,faceIndex:null,barycoord:null,object:t}}let r$=new is,rQ=new is;class rK extends rH{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){let t=this.geometry;if(null===t.index){let e=t.attributes.position,i=[];for(let t=0,s=e.count;t<s;t+=2)r$.fromBufferAttribute(e,t),rQ.fromBufferAttribute(e,t+1),i[t]=0===t?0:i[t-1],i[t+1]=i[t]+r$.distanceTo(rQ);t.setAttribute("lineDistance",new sE(i,1))}else eZ("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class r0 extends rH{constructor(t,e){super(t,e),this.isLineLoop=!0,this.type="LineLoop"}}class r1 extends s3{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new i8(0xffffff),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!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.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}let r2=new iT,r3=new s8,r5=new sD,r4=new is;class r6 extends i0{constructor(t=new sZ,e=new r1){super(),this.isPoints=!0,this.type="Points",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}intersectsFrustum(t){return t.intersectsObject(this)}raycast(t,e){let i=this.geometry,s=this.matrixWorld,r=t.params.Points.threshold,a=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),r5.copy(i.boundingSphere),r5.applyMatrix4(s),r5.radius+=r,!1===t.ray.intersectsSphere(r5))return;r2.copy(s).invert(),r3.copy(t.ray).applyMatrix4(r2);let n=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=n*n,h=i.index,l=i.attributes.position;if(null!==h){let i=Math.max(0,a.start),r=Math.min(h.count,a.start+a.count);for(let a=i;a<r;a++){let i=h.getX(a);r4.fromBufferAttribute(l,i),r9(r4,i,o,s,t,e,this)}}else{let i=Math.max(0,a.start),r=Math.min(l.count,a.start+a.count);for(let a=i;a<r;a++)r4.fromBufferAttribute(l,a),r9(r4,a,o,s,t,e,this)}}updateMorphTargets(){let t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){let i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=i.length;t<e;t++){let e=i[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}}function r9(t,e,i,s,r,a,n){let o=r3.distanceSqToPoint(t);if(o<i){let i=new is;r3.closestPointToPoint(t,i),i.applyMatrix4(s);let h=r.ray.origin.distanceTo(i);if(h<r.near||h>r.far)return;a.push({distance:h,distanceToRay:Math.sqrt(o),point:i,index:e,face:null,faceIndex:null,barycoord:null,object:n})}}class r8 extends iv{constructor(t=[],e=tp,i,s,r,a,n,o,h,l){super(t,e,i,s,r,a,n,o,h,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class r7 extends iv{constructor(t,e,i=tI,s,r,a,n=tM,o=tM,h,l=tU,u=1){if(l!==tU&&l!==tW)throw Error("THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super({width:t,height:e,depth:u},s,r,a,n,o,l,i,h),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.source=new ig(Object.assign({},t.image)),this.compareFunction=t.compareFunction,this}toJSON(t){let e=super.toJSON(t);return e.compareFunction=this.compareFunction,e}}class at extends r7{constructor(t,e=tI,i=tp,s,r,a=tM,n=tM,o,h=tU){const l={width:t,height:t,depth:1};super(t,t,e,i,s,r,a,n,o,h),this.image=[l,l,l,l,l,l],this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(t){this.image=t}}class ae extends iv{constructor(t=null){super(),this.sourceTexture=t,this.isExternalTexture=!0}copy(t){return super.copy(t),this.sourceTexture=t.sourceTexture,this}}class ai extends sZ{constructor(t=1,e=1,i=1,s=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:s,heightSegments:r,depthSegments:a};const n=this;s=Math.floor(s),r=Math.floor(r);const o=[],h=[],l=[],u=[];let c=0,p=0;function d(t,e,i,s,r,a,d,m,y,f,g){let x=a/y,b=d/f,M=a/2,v=d/2,w=m/2,S=y+1,_=f+1,A=0,z=0,T=new is;for(let a=0;a<_;a++){let n=a*b-v;for(let o=0;o<S;o++){let c=o*x-M;T[t]=c*s,T[e]=n*r,T[i]=w,h.push(T.x,T.y,T.z),T[t]=0,T[e]=0,T[i]=m>0?1:-1,l.push(T.x,T.y,T.z),u.push(o/y),u.push(1-a/f),A+=1}}for(let t=0;t<f;t++)for(let e=0;e<y;e++){let i=c+e+S*t,s=c+e+S*(t+1),r=c+(e+1)+S*(t+1),a=c+(e+1)+S*t;o.push(i,s,a),o.push(s,r,a),z+=6}n.addGroup(p,z,g),p+=z,c+=A}d("z","y","x",-1,-1,i,e,t,a=Math.floor(a),r,0),d("z","y","x",1,-1,i,e,-t,a,r,1),d("x","z","y",1,1,t,i,e,s,a,2),d("x","z","y",1,-1,t,i,-e,s,a,3),d("x","y","z",1,-1,t,e,i,s,r,4),d("x","y","z",-1,-1,t,e,-i,s,r,5),this.setIndex(o),this.setAttribute("position",new sE(h,3)),this.setAttribute("normal",new sE(l,3)),this.setAttribute("uv",new sE(u,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new ai(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}class as extends sZ{constructor(t=1,e=1,i=1,s=32,r=1,a=!1,n=0,o=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:i,radialSegments:s,heightSegments:r,openEnded:a,thetaStart:n,thetaLength:o};const h=this;s=Math.floor(s),r=Math.floor(r);const l=[],u=[],c=[],p=[];let d=0;const m=[],y=i/2;let f=0;function g(i){let r=d,a=new ie,m=new is,g=0,x=!0===i?t:e,b=!0===i?1:-1;for(let t=1;t<=s;t++)u.push(0,y*b,0),c.push(0,b,0),p.push(.5,.5),d++;let M=d;for(let t=0;t<=s;t++){let e=t/s*o+n,i=Math.cos(e),r=Math.sin(e);m.x=x*r,m.y=y*b,m.z=x*i,u.push(m.x,m.y,m.z),c.push(0,b,0),a.x=.5*i+.5,a.y=.5*r*b+.5,p.push(a.x,a.y),d++}for(let t=0;t<s;t++){let e=r+t,s=M+t;!0===i?l.push(s,s+1,e):l.push(s+1,s,e),g+=3}h.addGroup(f,g,!0===i?1:2),f+=g}(function(){let a=new is,g=new is,x=0,b=(e-t)/i;for(let h=0;h<=r;h++){let l=[],f=h/r,x=f*(e-t)+t;for(let t=0;t<=s;t++){let e=t/s,r=e*o+n,h=Math.sin(r),m=Math.cos(r);g.x=x*h,g.y=-f*i+y,g.z=x*m,u.push(g.x,g.y,g.z),a.set(h,b,m).normalize(),c.push(a.x,a.y,a.z),p.push(e,1-f),l.push(d++)}m.push(l)}for(let i=0;i<s;i++)for(let s=0;s<r;s++){let a=m[s][i],n=m[s+1][i],o=m[s+1][i+1],h=m[s][i+1];(t>0||0!==s)&&(l.push(a,n,h),x+=3),(e>0||s!==r-1)&&(l.push(n,o,h),x+=3)}h.addGroup(f,x,0),f+=x})(),!1===a&&(t>0&&g(!0),e>0&&g(!1)),this.setIndex(l),this.setAttribute("position",new sE(u,3)),this.setAttribute("normal",new sE(c,3)),this.setAttribute("uv",new sE(p,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new as(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class ar extends sZ{constructor(t=[],e=[],i=1,s=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:i,detail:s};const r=[],a=[];function n(t){r.push(t.x,t.y,t.z)}function o(e,i){let s=3*e;i.x=t[s+0],i.y=t[s+1],i.z=t[s+2]}function h(t,e,i,s){s<0&&1===t.x&&(a[e]=t.x-1),0===i.x&&0===i.z&&(a[e]=s/2/Math.PI+.5)}function l(t){return Math.atan2(t.z,-t.x)}(function(t){let i=new is,s=new is,r=new is;for(let a=0;a<e.length;a+=3)o(e[a+0],i),o(e[a+1],s),o(e[a+2],r),function(t,e,i,s){let r=s+1,a=[];for(let s=0;s<=r;s++){a[s]=[];let n=t.clone().lerp(i,s/r),o=e.clone().lerp(i,s/r),h=r-s;for(let t=0;t<=h;t++)0===t&&s===r?a[s][t]=n:a[s][t]=n.clone().lerp(o,t/h)}for(let t=0;t<r;t++)for(let e=0;e<2*(r-t)-1;e++){let i=Math.floor(e/2);e%2==0?(n(a[t][i+1]),n(a[t+1][i]),n(a[t][i])):(n(a[t][i+1]),n(a[t+1][i+1]),n(a[t+1][i]))}}(i,s,r,t)})(s),function(t){let e=new is;for(let i=0;i<r.length;i+=3)e.x=r[i+0],e.y=r[i+1],e.z=r[i+2],e.normalize().multiplyScalar(t),r[i+0]=e.x,r[i+1]=e.y,r[i+2]=e.z}(i),function(){let t=new is;for(let i=0;i<r.length;i+=3){var e;t.x=r[i+0],t.y=r[i+1],t.z=r[i+2];let s=l(t)/2/Math.PI+.5,n=Math.atan2(-(e=t).y,Math.sqrt(e.x*e.x+e.z*e.z))/Math.PI+.5;a.push(s,1-n)}(function(){let t=new is,e=new is,i=new is,s=new is,n=new ie,o=new ie,u=new ie;for(let c=0,p=0;c<r.length;c+=9,p+=6){t.set(r[c+0],r[c+1],r[c+2]),e.set(r[c+3],r[c+4],r[c+5]),i.set(r[c+6],r[c+7],r[c+8]),n.set(a[p+0],a[p+1]),o.set(a[p+2],a[p+3]),u.set(a[p+4],a[p+5]),s.copy(t).add(e).add(i).divideScalar(3);let d=l(s);h(n,p+0,t,d),h(o,p+2,e,d),h(u,p+4,i,d)}})(),function(){for(let t=0;t<a.length;t+=6){let e=a[t+0],i=a[t+2],s=a[t+4],r=Math.max(e,i,s),n=Math.min(e,i,s);r>.9&&n<.1&&(e<.2&&(a[t+0]+=1),i<.2&&(a[t+2]+=1),s<.2&&(a[t+4]+=1))}}()}(),this.setAttribute("position",new sE(r,3)),this.setAttribute("normal",new sE(r.slice(),3)),this.setAttribute("uv",new sE(a,2)),0===s?this.computeVertexNormals():this.normalizeNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new ar(t.vertices,t.indices,t.radius,t.detail)}}let aa=new is,an=new is,ao=new is,ah=new sm;class al extends sZ{constructor(t=null,e=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:t,thresholdAngle:e},null!==t){const i=Math.cos(e2*e),s=t.getIndex(),r=t.getAttribute("position"),a=s?s.count:r.count,n=[0,0,0],o=["a","b","c"],h=[,,,],l={},u=[];for(let t=0;t<a;t+=3){s?(n[0]=s.getX(t),n[1]=s.getX(t+1),n[2]=s.getX(t+2)):(n[0]=t,n[1]=t+1,n[2]=t+2);const{a:e,b:a,c}=ah;if(e.fromBufferAttribute(r,n[0]),a.fromBufferAttribute(r,n[1]),c.fromBufferAttribute(r,n[2]),ah.getNormal(ao),h[0]=`${Math.round(1e4*e.x)},${Math.round(1e4*e.y)},${Math.round(1e4*e.z)}`,h[1]=`${Math.round(1e4*a.x)},${Math.round(1e4*a.y)},${Math.round(1e4*a.z)}`,h[2]=`${Math.round(1e4*c.x)},${Math.round(1e4*c.y)},${Math.round(1e4*c.z)}`,h[0]!==h[1]&&h[1]!==h[2]&&h[2]!==h[0])for(let t=0;t<3;t++){const e=(t+1)%3,s=h[t],r=h[e],a=ah[o[t]],c=ah[o[e]],p=`${s}_${r}`,d=`${r}_${s}`;d in l&&l[d]?(ao.dot(l[d].normal)<=i&&(u.push(a.x,a.y,a.z),u.push(c.x,c.y,c.z)),l[d]=null):p in l||(l[p]={index0:n[t],index1:n[e],normal:ao.clone()})}}for(const t in l)if(l[t]){const{index0:e,index1:i}=l[t];aa.fromBufferAttribute(r,e),an.fromBufferAttribute(r,i),u.push(aa.x,aa.y,aa.z),u.push(an.x,an.y,an.z)}this.setAttribute("position",new sE(u,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}class au{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){eZ("Curve: .getPoint() not implemented.")}getPointAt(t,e){let i=this.getUtoTmapping(t);return this.getPoint(i,e)}getPoints(t=5){let e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e}getSpacedPoints(t=5){let e=[];for(let i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e}getLength(){let t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let e=[],i,s=this.getPoint(0),r=0;e.push(0);for(let a=1;a<=t;a++)e.push(r+=(i=this.getPoint(a/t)).distanceTo(s)),s=i;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e=null){let i,s=this.getLengths(),r=0,a=s.length;i=e||t*s[a-1];let n=0,o=a-1,h;for(;n<=o;)if((h=s[r=Math.floor(n+(o-n)/2)]-i)<0)n=r+1;else if(h>0)o=r-1;else{o=r;break}if(s[r=o]===i)return r/(a-1);let l=s[r],u=s[r+1];return(r+(i-l)/(u-l))/(a-1)}getTangent(t,e){let i=t-1e-4,s=t+1e-4;i<0&&(i=0),s>1&&(s=1);let r=this.getPoint(i),a=this.getPoint(s),n=e||(r.isVector2?new ie:new is);return n.copy(a).sub(r).normalize(),n}getTangentAt(t,e){let i=this.getUtoTmapping(t);return this.getTangent(i,e)}computeFrenetFrames(t,e=!1){let i=new is,s=[],r=[],a=[],n=new is,o=new iT;for(let e=0;e<=t;e++){let i=e/t;s[e]=this.getTangentAt(i,new is)}r[0]=new is,a[0]=new is;let h=Number.MAX_VALUE,l=Math.abs(s[0].x),u=Math.abs(s[0].y),c=Math.abs(s[0].z);l<=h&&(h=l,i.set(1,0,0)),u<=h&&(h=u,i.set(0,1,0)),c<=h&&i.set(0,0,1),n.crossVectors(s[0],i).normalize(),r[0].crossVectors(s[0],n),a[0].crossVectors(s[0],r[0]);for(let e=1;e<=t;e++){if(r[e]=r[e-1].clone(),a[e]=a[e-1].clone(),n.crossVectors(s[e-1],s[e]),n.length()>Number.EPSILON){n.normalize();let t=Math.acos(e4(s[e-1].dot(s[e]),-1,1));r[e].applyMatrix4(o.makeRotationAxis(n,t))}a[e].crossVectors(s[e],r[e])}if(!0===e){let e=Math.acos(e4(r[0].dot(r[t]),-1,1));e/=t,s[0].dot(n.crossVectors(r[0],r[t]))>0&&(e=-e);for(let i=1;i<=t;i++)r[i].applyMatrix4(o.makeRotationAxis(s[i],e*i)),a[i].crossVectors(s[i],r[i])}return{tangents:s,normals:r,binormals:a}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){let t={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class ac extends au{constructor(t=0,e=0,i=1,s=1,r=0,a=2*Math.PI,n=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=s,this.aStartAngle=r,this.aEndAngle=a,this.aClockwise=n,this.aRotation=o}getPoint(t,e=new ie){let i=2*Math.PI,s=this.aEndAngle-this.aStartAngle,r=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=i;for(;s>i;)s-=i;s<Number.EPSILON&&(s=r?0:i),!0!==this.aClockwise||r||(s===i?s=-i:s-=i);let a=this.aStartAngle+t*s,n=this.aX+this.xRadius*Math.cos(a),o=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){let t=Math.cos(this.aRotation),e=Math.sin(this.aRotation),i=n-this.aX,s=o-this.aY;n=i*t-s*e+this.aX,o=i*e+s*t+this.aY}return e.set(n,o)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){let t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}class ap extends ac{constructor(t,e,i,s,r,a){super(t,e,i,i,s,r,a),this.isArcCurve=!0,this.type="ArcCurve"}}function ad(){let t=0,e=0,i=0,s=0;function r(r,a,n,o){t=r,e=n,i=-3*r+3*a-2*n-o,s=2*r-2*a+n+o}return{initCatmullRom:function(t,e,i,s,a){r(e,i,a*(i-t),a*(s-e))},initNonuniformCatmullRom:function(t,e,i,s,a,n,o){let h=(e-t)/a-(i-t)/(a+n)+(i-e)/n,l=(i-e)/n-(s-e)/(n+o)+(s-i)/o;r(e,i,h*=n,l*=n)},calc:function(r){let a=r*r;return t+e*r+i*a+a*r*s}}}let am=new is,ay=new is,af=new ad,ag=new ad,ax=new ad;class ab extends au{constructor(t=[],e=!1,i="centripetal",s=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=i,this.tension=s}getPoint(t,e=new is){let i,s,r=this.points,a=r.length,n=(a-!this.closed)*t,o=Math.floor(n),h=n-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/a)+1)*a:0===h&&o===a-1&&(o=a-2,h=1),this.closed||o>0?i=r[(o-1)%a]:(ay.subVectors(r[0],r[1]).add(r[0]),i=ay);let l=r[o%a],u=r[(o+1)%a];if(this.closed||o+2<a?s=r[(o+2)%a]:(am.subVectors(r[a-1],r[a-2]).add(r[a-1]),s=am),"centripetal"===this.curveType||"chordal"===this.curveType){let t="chordal"===this.curveType?.5:.25,e=Math.pow(i.distanceToSquared(l),t),r=Math.pow(l.distanceToSquared(u),t),a=Math.pow(u.distanceToSquared(s),t);r<1e-4&&(r=1),e<1e-4&&(e=r),a<1e-4&&(a=r),af.initNonuniformCatmullRom(i.x,l.x,u.x,s.x,e,r,a),ag.initNonuniformCatmullRom(i.y,l.y,u.y,s.y,e,r,a),ax.initNonuniformCatmullRom(i.z,l.z,u.z,s.z,e,r,a)}else"catmullrom"===this.curveType&&(af.initCatmullRom(i.x,l.x,u.x,s.x,this.tension),ag.initCatmullRom(i.y,l.y,u.y,s.y,this.tension),ax.initCatmullRom(i.z,l.z,u.z,s.z,this.tension));return e.set(af.calc(h),ag.calc(h),ax.calc(h)),e}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let i=t.points[e];this.points.push(i.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){let t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){let i=this.points[e];t.points.push(i.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let i=t.points[e];this.points.push(new is().fromArray(i))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}}function aM(t,e,i,s,r){let a=(s-e)*.5,n=(r-i)*.5,o=t*t;return t*o*(2*i-2*s+a+n)+(-3*i+3*s-2*a-n)*o+a*t+i}function av(t,e,i,s){let r;return(r=1-t)*r*e+2*(1-t)*t*i+t*t*s}function aw(t,e,i,s,r){let a,n;return(a=1-t)*a*a*e+3*(n=1-t)*n*t*i+3*(1-t)*t*t*s+t*t*t*r}class aS extends au{constructor(t=new ie,e=new ie,i=new ie,s=new ie){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=i,this.v3=s}getPoint(t,e=new ie){let i=this.v0,s=this.v1,r=this.v2,a=this.v3;return e.set(aw(t,i.x,s.x,r.x,a.x),aw(t,i.y,s.y,r.y,a.y)),e}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class a_ extends au{constructor(t=new is,e=new is,i=new is,s=new is){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=i,this.v3=s}getPoint(t,e=new is){let i=this.v0,s=this.v1,r=this.v2,a=this.v3;return e.set(aw(t,i.x,s.x,r.x,a.x),aw(t,i.y,s.y,r.y,a.y),aw(t,i.z,s.z,r.z,a.z)),e}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class aA extends au{constructor(t=new ie,e=new ie){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new ie){return 1===t?e.copy(this.v2):(e.copy(this.v2).sub(this.v1),e.multiplyScalar(t).add(this.v1)),e}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new ie){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class az extends au{constructor(t=new is,e=new is){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=t,this.v2=e}getPoint(t,e=new is){return 1===t?e.copy(this.v2):(e.copy(this.v2).sub(this.v1),e.multiplyScalar(t).add(this.v1)),e}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new is){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class aT extends au{constructor(t=new ie,e=new ie,i=new ie){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new ie){let i=this.v0,s=this.v1,r=this.v2;return e.set(av(t,i.x,s.x,r.x),av(t,i.y,s.y,r.y)),e}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class aC extends au{constructor(t=new is,e=new is,i=new is){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new is){let i=this.v0,s=this.v1,r=this.v2;return e.set(av(t,i.x,s.x,r.x),av(t,i.y,s.y,r.y),av(t,i.z,s.z,r.z)),e}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class ak extends au{constructor(t=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=t}getPoint(t,e=new ie){let i=this.points,s=(i.length-1)*t,r=Math.floor(s),a=s-r,n=i[0===r?r:r-1],o=i[r],h=i[r>i.length-2?i.length-1:r+1],l=i[r>i.length-3?i.length-1:r+2];return e.set(aM(a,n.x,o.x,h.x,l.x),aM(a,n.y,o.y,h.y,l.y)),e}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let i=t.points[e];this.points.push(i.clone())}return this}toJSON(){let t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){let i=this.points[e];t.points.push(i.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let i=t.points[e];this.points.push(new ie().fromArray(i))}return this}}class aB extends ar{constructor(t=1,e=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new aB(t.radius,t.detail)}}class aI extends sZ{constructor(t=1,e=1,i=1,s=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:s};const r=t/2,a=e/2,n=Math.floor(i),o=Math.floor(s),h=n+1,l=o+1,u=t/n,c=e/o,p=[],d=[],m=[],y=[];for(let t=0;t<l;t++){const e=t*c-a;for(let i=0;i<h;i++){const s=i*u-r;d.push(s,-e,0),m.push(0,0,1),y.push(i/n),y.push(1-t/o)}}for(let t=0;t<o;t++)for(let e=0;e<n;e++){const i=e+h*t,s=e+h*(t+1),r=e+1+h*(t+1),a=e+1+h*t;p.push(i,s,a),p.push(s,r,a)}this.setIndex(p),this.setAttribute("position",new sE(d,3)),this.setAttribute("normal",new sE(m,3)),this.setAttribute("uv",new sE(y,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new aI(t.width,t.height,t.widthSegments,t.heightSegments)}}class aO extends sZ{constructor(t=1,e=32,i=16,s=0,r=2*Math.PI,a=0,n=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:i,phiStart:s,phiLength:r,thetaStart:a,thetaLength:n},e=Math.max(3,Math.floor(e)),i=Math.max(2,Math.floor(i));const o=Math.min(a+n,Math.PI);let h=0;const l=[],u=new is,c=new is,p=[],d=[],m=[],y=[];for(let p=0;p<=i;p++){const f=[],g=p/i,x=t*Math.cos(a+g*n),b=Math.sqrt(t*t-x*x);let M=0;0===p&&0===a?M=.5/e:p===i&&o===Math.PI&&(M=-.5/e);for(let t=0;t<=e;t++){const i=t/e,a=s+i*r;u.x=-b*Math.cos(a),u.y=x,u.z=b*Math.sin(a),d.push(u.x,u.y,u.z),c.copy(u).normalize(),m.push(c.x,c.y,c.z),y.push(i+M,1-g),f.push(h++)}l.push(f)}for(let t=0;t<i;t++)for(let s=0;s<e;s++){const e=l[t][s+1],r=l[t][s],n=l[t+1][s],h=l[t+1][s+1];(0!==t||a>0)&&p.push(e,r,h),(t!==i-1||o<Math.PI)&&p.push(r,n,h)}this.setIndex(p),this.setAttribute("position",new sE(d,3)),this.setAttribute("normal",new sE(m,3)),this.setAttribute("uv",new sE(y,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new aO(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class aR extends sZ{constructor(t=1,e=.4,i=12,s=48,r=2*Math.PI,a=0,n=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:i,tubularSegments:s,arc:r,thetaStart:a,thetaLength:n},i=Math.floor(i),s=Math.floor(s);const o=[],h=[],l=[],u=[],c=new is,p=new is,d=new is;for(let o=0;o<=i;o++){const m=a+o/i*n;for(let a=0;a<=s;a++){const n=a/s*r;p.x=(t+e*Math.cos(m))*Math.cos(n),p.y=(t+e*Math.cos(m))*Math.sin(n),p.z=e*Math.sin(m),h.push(p.x,p.y,p.z),c.x=t*Math.cos(n),c.y=t*Math.sin(n),d.subVectors(p,c).normalize(),l.push(d.x,d.y,d.z),u.push(a/s),u.push(o/i)}}for(let t=1;t<=i;t++)for(let e=1;e<=s;e++){const i=(s+1)*t+e-1,r=(s+1)*(t-1)+e-1,a=(s+1)*(t-1)+e,n=(s+1)*t+e;o.push(i,r,n),o.push(r,a,n)}this.setIndex(o),this.setAttribute("position",new sE(h,3)),this.setAttribute("normal",new sE(l,3)),this.setAttribute("uv",new sE(u,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new aR(t.radius,t.tube,t.radialSegments,t.tubularSegments,t.arc,t.thetaStart,t.thetaLength)}}function aN(t){let e={};for(let i in t)for(let s in e[i]={},t[i]){let r=t[i][s];if(aE(r))r.isRenderTargetTexture?(eZ("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[i][s]=null):e[i][s]=r.clone();else if(Array.isArray(r))if(aE(r[0])){let t=[];for(let e=0,i=r.length;e<i;e++)t[e]=r[e].clone();e[i][s]=t}else e[i][s]=r.slice();else e[i][s]=r}return e}function aP(t){let e={};for(let i=0;i<t.length;i++){let s=aN(t[i]);for(let t in s)e[t]=s[t]}return e}function aE(t){return t&&(t.isColor||t.isMatrix3||t.isMatrix4||t.isVector2||t.isVector3||t.isVector4||t.isTexture||t.isQuaternion)}function aV(t){let e=t.getRenderTarget();return null===e?t.outputColorSpace:!0===e.isXRRenderTarget?e.texture.colorSpace:ic.workingColorSpace}let aF={clone:aN,merge:aP};class aL extends s3{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==t&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=aN(t.uniforms),this.uniformsGroups=function(t){let e=[];for(let i=0;i<t.length;i++)e.push(t[i].clone());return e}(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this.defaultAttributeValues=Object.assign({},t.defaultAttributeValues),this.index0AttributeName=t.index0AttributeName,this.uniformsNeedUpdate=t.uniformsNeedUpdate,this}toJSON(t){let e=super.toJSON(t);for(let i in e.glslVersion=this.glslVersion,e.uniforms={},this.uniforms){let s=this.uniforms[i].value;s&&s.isTexture?e.uniforms[i]={type:"t",value:s.toJSON(t).uuid}:s&&s.isColor?e.uniforms[i]={type:"c",value:s.getHex()}:s&&s.isVector2?e.uniforms[i]={type:"v2",value:s.toArray()}:s&&s.isVector3?e.uniforms[i]={type:"v3",value:s.toArray()}:s&&s.isVector4?e.uniforms[i]={type:"v4",value:s.toArray()}:s&&s.isMatrix3?e.uniforms[i]={type:"m3",value:s.toArray()}:s&&s.isMatrix4?e.uniforms[i]={type:"m4",value:s.toArray()}:e.uniforms[i]={value:s}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;let i={};for(let t in this.extensions)!0===this.extensions[t]&&(i[t]=!0);return Object.keys(i).length>0&&(e.extensions=i),e}fromJSON(t,e){if(super.fromJSON(t,e),void 0!==t.uniforms)for(let i in t.uniforms){let s=t.uniforms[i];switch(this.uniforms[i]={},s.type){case"t":this.uniforms[i].value=e[s.value]||null;break;case"c":this.uniforms[i].value=new i8().setHex(s.value);break;case"v2":this.uniforms[i].value=new ie().fromArray(s.value);break;case"v3":this.uniforms[i].value=new is().fromArray(s.value);break;case"v4":this.uniforms[i].value=new iw().fromArray(s.value);break;case"m3":this.uniforms[i].value=new io().fromArray(s.value);break;case"m4":this.uniforms[i].value=new iT().fromArray(s.value);break;default:this.uniforms[i].value=s.value}}if(void 0!==t.defines&&(this.defines=t.defines),void 0!==t.vertexShader&&(this.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(this.fragmentShader=t.fragmentShader),void 0!==t.glslVersion&&(this.glslVersion=t.glslVersion),void 0!==t.extensions)for(let e in t.extensions)this.extensions[e]=t.extensions[e];return void 0!==t.lights&&(this.lights=t.lights),void 0!==t.clipping&&(this.clipping=t.clipping),this}}class aD extends aL{constructor(t){super(t),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class aj extends s3{constructor(t){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new i8(0xffffff),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new i8(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ez,this.normalScale=new ie(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new iV,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.envMapIntensity=t.envMapIntensity,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class aU extends aj{constructor(t){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new ie(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return e4(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new i8(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new i8(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new i8(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._retroreflectivity=0,this._sheen=0,this._transmission=0,this.setValues(t)}get anisotropy(){return this._anisotropy}set anisotropy(t){this._anisotropy>0!=t>0&&this.version++,this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get dispersion(){return this._dispersion}set dispersion(t){this._dispersion>0!=t>0&&this.version++,this._dispersion=t}get retroreflectivity(){return this._retroreflectivity}set retroreflectivity(t){this._retroreflectivity>0!=t>0&&this.version++,this._retroreflectivity=t}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.dispersion=t.dispersion,this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.retroreflectivity=t.retroreflectivity,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class aW extends s3{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new i8(0xffffff),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new i8(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ez,this.normalScale=new ie(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new iV,this.combine=tt,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class aJ extends s3{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class aX extends s3{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}function aY(t,e){return t&&t.constructor!==e?"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t):t}function aq(t){return void 0!==t&&void 0!==t.inTangents&&void 0!==t.outTangents}function aZ(t,e,i){let s=t.length,r=new t.constructor(s);for(let a=0,n=0;n!==s;++a){let s=i[a]*e;for(let i=0;i!==e;++i)r[n++]=t[s+i]}return r}class aH{constructor(t,e,i,s){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==s?s:new e.constructor(i),this.sampleValues=e,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,i=this._cachedIndex,s=e[i],r=e[i-1];t:{e:{let a;i:{s:if(!(t<s)){for(let a=i+2;;){if(void 0===s){if(t<r)break s;return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===a)break;if(r=s,t<(s=e[++i]))break e}a=e.length;break i}if(!(t>=r)){let n=e[1];t<n&&(i=2,r=n);for(let a=i-2;;){if(void 0===r)return this._cachedIndex=0,this.copySampleValue_(0);if(i===a)break;if(s=r,t>=(r=e[--i-1]))break e}a=i,i=0;break i}break t}for(;i<a;){let s=i+a>>>1;t<e[s]?a=s:i=s+1}if(s=e[i],void 0===(r=e[i-1]))return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===s)return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,r,s)}return this.interpolate_(i,r,t,s)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,i=this.sampleValues,s=this.valueSize,r=t*s;for(let t=0;t!==s;++t)e[t]=i[r+t];return e}interpolate_(){throw Error("THREE.Interpolant: Call to abstract method.")}intervalChanged_(){}}class aG extends aH{constructor(t,e,i,s){super(t,e,i,s),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:2400,endingEnd:2400}}intervalChanged_(t,e,i){let s=this.parameterPositions,r=t-2,a=t+1,n=s[r],o=s[a];if(void 0===n)switch(this.getSettings_().endingStart){case 2401:r=t,n=2*e-i;break;case 2402:r=s.length-2,n=e+s[r]-s[r+1];break;default:r=t,n=i}if(void 0===o)switch(this.getSettings_().endingEnd){case 2401:a=t,o=2*i-e;break;case 2402:a=1,o=i+s[1]-s[0];break;default:a=t-1,o=e}let h=(i-e)*.5,l=this.valueSize;this._weightPrev=h/(e-n),this._weightNext=h/(o-i),this._offsetPrev=r*l,this._offsetNext=a*l}interpolate_(t,e,i,s){let r=this.resultBuffer,a=this.sampleValues,n=this.valueSize,o=t*n,h=o-n,l=this._offsetPrev,u=this._offsetNext,c=this._weightPrev,p=this._weightNext,d=(i-e)/(s-e),m=d*d,y=m*d,f=-c*y+2*c*m-c*d,g=(1+c)*y+(-1.5-2*c)*m+(-.5+c)*d+1,x=(-1-p)*y+(1.5+p)*m+.5*d,b=p*y-p*m;for(let t=0;t!==n;++t)r[t]=f*a[l+t]+g*a[h+t]+x*a[o+t]+b*a[u+t];return r}}class a$ extends aH{constructor(t,e,i,s){super(t,e,i,s)}interpolate_(t,e,i,s){let r=this.resultBuffer,a=this.sampleValues,n=this.valueSize,o=t*n,h=o-n,l=(i-e)/(s-e),u=1-l;for(let t=0;t!==n;++t)r[t]=a[h+t]*u+a[o+t]*l;return r}}class aQ extends aH{constructor(t,e,i,s){super(t,e,i,s)}interpolate_(t){return this.copySampleValue_(t-1)}}class aK extends aH{interpolate_(t,e,i,s){let r=this.resultBuffer,a=this.sampleValues,n=this.valueSize,o=t*n,h=o-n,l=this.inTangents,u=this.outTangents;if(!l||!u){let t=(i-e)/(s-e),l=1-t;for(let e=0;e!==n;++e)r[e]=a[h+e]*l+a[o+e]*t;return r}let c=2*n,p=t-1;for(let d=0;d!==n;++d){let n=a[h+d],m=a[o+d],y=p*c+2*d,f=u[y],g=u[y+1],x=t*c+2*d,b=l[x],M=l[x+1],v=function(t,e,i,s,r){let a=(t-e)/(r-e);for(let n=0;n<8;n++){let n=a0(a,e,i,s,r)-t;if(1e-10>Math.abs(n))break;let o=function(t,e,i,s,r){let a=1-t;return 3*a*a*(i-e)+6*a*t*(s-i)+3*t*t*(r-s)}(a,e,i,s,r);if(1e-10>Math.abs(o))break;a=Math.max(0,Math.min(1,a-n/o))}return a}(i,e,f,b,s);r[d]=a0(v,n,g,M,m)}return r}}function a0(t,e,i,s,r){let a=1-t;return a*a*a*e+3*a*a*t*i+3*a*t*t*s+t*t*t*r}class a1{constructor(t,e,i,s){if(void 0===t)throw Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=aY(e,this.TimeBufferType),this.values=aY(i,this.ValueBufferType),this.setInterpolation(s||this.DefaultInterpolation)}static toJSON(t){let e,i=t.constructor;if(i.toJSON!==this.toJSON)e=i.toJSON(t);else{e={name:t.name,times:aY(t.times,Array),values:aY(t.values,Array)};let i=t.getInterpolation();i!==t.DefaultInterpolation&&(e.interpolation=i),aq(t.settings)&&(e.settings={inTangents:aY(t.settings.inTangents,Array),outTangents:aY(t.settings.outTangents,Array)})}return e.type=t.ValueTypeName,e}InterpolantFactoryMethodDiscrete(t){return new aQ(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new a$(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new aG(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodBezier(t){let e=new aK(this.times,this.values,this.getValueSize(),t);return this.settings&&(e.inTangents=this.settings.inTangents,e.outTangents=this.settings.outTangents),e}setInterpolation(t){let e;switch(t){case ev:e=this.InterpolantFactoryMethodDiscrete;break;case ew:e=this.InterpolantFactoryMethodLinear;break;case 2302:e=this.InterpolantFactoryMethodSmooth;break;case 2303:e=this.InterpolantFactoryMethodBezier}if(void 0===e){let e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw Error(e);return eZ("KeyframeTrack:",e),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ev;case this.InterpolantFactoryMethodLinear:return ew;case this.InterpolantFactoryMethodSmooth:return 2302;case this.InterpolantFactoryMethodBezier:return 2303}}getValueSize(){return this.values.length/this.times.length}shift(t){if(0!==t){let e=this.times;for(let i=0,s=e.length;i!==s;++i)e[i]+=t}return this}scale(t){if(1!==t){let e=this.times;for(let i=0,s=e.length;i!==s;++i)e[i]*=t;aq(this.settings)&&(a2(this.settings.inTangents,t),a2(this.settings.outTangents,t))}return this}trim(t,e){let i=this.times,s=i.length,r=0,a=s-1;for(;r!==s&&i[r]<t;)++r;for(;-1!==a&&i[a]>e;)--a;if(++a,0!==r||a!==s){r>=a&&(r=(a=Math.max(a,1))-1);let t=this.getValueSize();this.times=i.slice(r,a),this.values=this.values.slice(r*t,a*t)}return this}validate(){var t;let e=!0,i=this.getValueSize();i-Math.floor(i)!=0&&(eH("KeyframeTrack: Invalid value size in track.",this),e=!1);let s=this.times,r=this.values,a=s.length;0===a&&(eH("KeyframeTrack: Track is empty.",this),e=!1);let n=null;for(let t=0;t!==a;t++){let i=s[t];if("number"==typeof i&&isNaN(i)){eH("KeyframeTrack: Time is not a valid number.",this,t,i),e=!1;break}if(null!==n&&n>i){eH("KeyframeTrack: Out of order keys.",this,t,i,n),e=!1;break}n=i}if(void 0!==r&&ArrayBuffer.isView(t=r)&&!(t instanceof DataView))for(let t=0,i=r.length;t!==i;++t){let i=r[t];if(isNaN(i)){eH("KeyframeTrack: Value is not a valid number.",this,t,i),e=!1;break}}return e}optimize(){let t=this.times.slice(),e=this.values.slice(),i=this.getValueSize(),s=2302===this.getInterpolation(),r=t.length-1,a=1;for(let n=1;n<r;++n){let r=!1,o=t[n];if(o!==t[n+1]&&(1!==n||o!==t[0]))if(s)r=!0;else{let t=n*i,s=t-i,a=t+i;for(let n=0;n!==i;++n){let i=e[t+n];if(i!==e[s+n]||i!==e[a+n]){r=!0;break}}}if(r){if(n!==a){t[a]=t[n];let s=n*i,r=a*i;for(let t=0;t!==i;++t)e[r+t]=e[s+t]}++a}}if(r>0){t[a]=t[r];for(let t=r*i,s=a*i,n=0;n!==i;++n)e[s+n]=e[t+n];++a}return a!==t.length?(this.times=t.slice(0,a),this.values=e.slice(0,a*i)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),i=new this.constructor(this.name,t,e);return i.createInterpolant=this.createInterpolant,aq(this.settings)&&(i.settings={inTangents:this.settings.inTangents.slice(),outTangents:this.settings.outTangents.slice()}),i}}function a2(t,e){for(let i=0,s=t.length;i!==s;i+=2)t[i]*=e}a1.prototype.ValueTypeName="",a1.prototype.TimeBufferType=Float32Array,a1.prototype.ValueBufferType=Float32Array,a1.prototype.DefaultInterpolation=ew;class a3 extends a1{constructor(t,e,i){super(t,e,i)}}a3.prototype.ValueTypeName="bool",a3.prototype.ValueBufferType=Array,a3.prototype.DefaultInterpolation=ev,a3.prototype.InterpolantFactoryMethodLinear=void 0,a3.prototype.InterpolantFactoryMethodSmooth=void 0;class a5 extends a1{constructor(t,e,i,s){super(t,e,i,s)}}a5.prototype.ValueTypeName="color";class a4 extends a1{constructor(t,e,i,s){super(t,e,i,s)}}a4.prototype.ValueTypeName="number";class a6 extends aH{constructor(t,e,i,s){super(t,e,i,s)}interpolate_(t,e,i,s){let r=this.resultBuffer,a=this.sampleValues,n=this.valueSize,o=(i-e)/(s-e),h=t*n;for(let t=h+n;h!==t;h+=4)ii.slerpFlat(r,0,a,h-n,a,h,o);return r}}class a9 extends a1{constructor(t,e,i,s){super(t,e,i,s)}InterpolantFactoryMethodLinear(t){return new a6(this.times,this.values,this.getValueSize(),t)}}a9.prototype.ValueTypeName="quaternion",a9.prototype.InterpolantFactoryMethodSmooth=void 0;class a8 extends a1{constructor(t,e,i){super(t,e,i)}}a8.prototype.ValueTypeName="string",a8.prototype.ValueBufferType=Array,a8.prototype.DefaultInterpolation=ev,a8.prototype.InterpolantFactoryMethodLinear=void 0,a8.prototype.InterpolantFactoryMethodSmooth=void 0;class a7 extends a1{constructor(t,e,i,s){super(t,e,i,s)}}a7.prototype.ValueTypeName="vector";class nt{constructor(t="",e=-1,i=[],s=2500){this.name=t,this.tracks=i,this.duration=e,this.blendMode=s,this.uuid=e5(),this.userData={},this.duration<0&&this.resetDuration()}static parse(t){let e=[],i=t.tracks,s=1/(t.fps||1);for(let t=0,r=i.length;t!==r;++t)e.push((function(t){let e;if(void 0===t.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");let i=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return a4;case"vector":case"vector2":case"vector3":case"vector4":return a7;case"color":return a5;case"quaternion":return a9;case"bool":case"boolean":return a3;case"string":return a8}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){let e=[],i=[];!function(t,e,i,s){let r=1,a=t[0];for(;void 0!==a&&void 0===a[s];)a=t[r++];if(void 0===a)return;let n=a[s];if(void 0!==n)if(Array.isArray(n))do void 0!==(n=a[s])&&(e.push(a.time),i.push(...n)),a=t[r++];while(void 0!==a);else if(void 0!==n.toArray)do void 0!==(n=a[s])&&(e.push(a.time),n.toArray(i,i.length)),a=t[r++];while(void 0!==a);else do void 0!==(n=a[s])&&(e.push(a.time),i.push(n)),a=t[r++];while(void 0!==a)}(t.keys,e,i,"value"),t.times=e,t.values=i}return e=void 0!==i.parse?i.parse(t):new i(t.name,t.times,t.values,t.interpolation),aq(t.settings)&&(e.settings={inTangents:aY(t.settings.inTangents,Float32Array),outTangents:aY(t.settings.outTangents,Float32Array)}),e})(i[t]).scale(s));let r=new this(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r.userData=JSON.parse(t.userData||"{}"),r}static toJSON(t){let e=[],i=t.tracks,s={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode,userData:JSON.stringify(t.userData)};for(let t=0,s=i.length;t!==s;++t)e.push(a1.toJSON(i[t]));return s}static CreateFromMorphTargetSequence(t,e,i,s){let r=e.length,a=[];for(let t=0;t<r;t++){let n=[],o=[];n.push((t+r-1)%r,t,(t+1)%r),o.push(0,1,0);let h=function(t){let e=t.length,i=Array(e);for(let t=0;t!==e;++t)i[t]=t;return i.sort(function(e,i){return t[e]-t[i]}),i}(n);n=aZ(n,1,h),o=aZ(o,1,h),s||0!==n[0]||(n.push(r),o.push(o[0])),a.push(new a4(".morphTargetInfluences["+e[t].name+"]",n,o).scale(1/i))}return new this(t,-1,a)}static findByName(t,e){let i=t;Array.isArray(t)||(i=t.geometry&&t.geometry.animations||t.animations);for(let t=0;t<i.length;t++)if(i[t].name===e)return i[t];return null}static CreateClipsFromMorphTargetSequences(t,e,i){let s={},r=/^([\w-]*?)([\d]+)$/;for(let e=0,i=t.length;e<i;e++){let i=t[e],a=i.name.match(r);if(a&&a.length>1){let t=a[1],e=s[t];e||(s[t]=e=[]),e.push(i)}}let a=[];for(let t in s)a.push(this.CreateFromMorphTargetSequence(t,s[t],e,i));return a}resetDuration(){let t=this.tracks,e=0;for(let i=0,s=t.length;i!==s;++i){let t=this.tracks[i];e=Math.max(e,t.times[t.times.length-1])}return this.duration=e,this}trim(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}clone(){let t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());let e=new this.constructor(this.name,this.duration,t,this.blendMode);return e.userData=JSON.parse(JSON.stringify(this.userData)),e}toJSON(){return this.constructor.toJSON(this)}}let ne={enabled:!1,files:{},add:function(t,e){!1===this.enabled||ni(t)||(this.files[t]=e)},get:function(t){if(!1!==this.enabled&&!ni(t))return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};function ni(t){try{let e=t.slice(t.indexOf(":")+1),i=new URL(e);return"blob:"===i.protocol}catch(t){return!1}}class ns{constructor(t,e,i){let s;const r=this;let a=!1,n=0,o=0;const h=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this._abortController=null,this.itemStart=function(t){o++,!1===a&&void 0!==r.onStart&&r.onStart(t,n,o),a=!0},this.itemEnd=function(t){n++,void 0!==r.onProgress&&r.onProgress(t,n,o),n===o&&(a=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(t){void 0!==r.onError&&r.onError(t)},this.resolveURL=function(t){return(t=t.normalize("NFC"),s)?s(t):t},this.setURLModifier=function(t){return s=t,this},this.addHandler=function(t,e){return h.push(t,e),this},this.removeHandler=function(t){let e=h.indexOf(t);return -1!==e&&h.splice(e,2),this},this.getHandler=function(t){for(let e=0,i=h.length;e<i;e+=2){let i=h[e],s=h[e+1];if(i.global&&(i.lastIndex=0),i.test(t))return s}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}}let nr=new ns;class na{constructor(t){this.manager=void 0!==t?t:nr,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={},"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}load(){}loadAsync(t,e){let i=this;return new Promise(function(s,r){i.load(t,s,e,r)})}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}abort(){return this}}na.DEFAULT_MATERIAL_NAME="__DEFAULT";let nn={};class no extends Error{constructor(t,e){super(t),this.response=e}}class nh extends na{constructor(t){super(t),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(t,e,i,s){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);let r=ne.get(`file:${t}`);if(void 0!==r){this.manager.itemStart(t),setTimeout(()=>{e&&e(r),this.manager.itemEnd(t)},0);return}if(void 0!==nn[t])return void nn[t].push({onLoad:e,onProgress:i,onError:s});nn[t]=[],nn[t].push({onLoad:e,onProgress:i,onError:s});let a=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:"function"==typeof AbortSignal.any?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),n=this.mimeType,o=this.responseType;fetch(a).then(e=>{if(200===e.status||0===e.status){if(0===e.status&&eZ("FileLoader: HTTP Status 0 received."),"u"<typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;let i=nn[t],s=e.body.getReader(),r=e.headers.get("X-File-Size")||e.headers.get("Content-Length"),a=r?parseInt(r):0,n=0!==a,o=0;return new Response(new ReadableStream({start(t){!function e(){s.read().then(({done:s,value:r})=>{if(s)t.close();else{let s=new ProgressEvent("progress",{lengthComputable:n,loaded:o+=r.byteLength,total:a});for(let t=0,e=i.length;t<e;t++){let e=i[t];e.onProgress&&e.onProgress(s)}t.enqueue(r),e()}},e=>{t.error(e)})}()}}))}throw new no(`fetch for "${e.url}" responded with ${e.status}: ${e.statusText}`,e)}).then(t=>{switch(o){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then(t=>new DOMParser().parseFromString(t,n));case"json":return t.json();default:if(""===n)return t.text();{let e=/charset="?([^;"\s]*)"?/i.exec(n),i=new TextDecoder(e&&e[1]?e[1].toLowerCase():void 0);return t.arrayBuffer().then(t=>i.decode(t))}}}).then(e=>{ne.add(`file:${t}`,e);let i=nn[t];delete nn[t];for(let t=0,s=i.length;t<s;t++){let s=i[t];s.onLoad&&s.onLoad(e)}}).catch(e=>{let i=nn[t];if(void 0===i)throw this.manager.itemError(t),e;delete nn[t];for(let t=0,s=i.length;t<s;t++){let s=i[t];s.onError&&s.onError(e)}this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}let nl=new WeakMap;class nu extends na{constructor(t){super(t)}load(t,e,i,s){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);let r=this,a=ne.get(`image:${t}`);if(void 0!==a){if(!0===a.complete)r.manager.itemStart(t),setTimeout(function(){e&&e(a),r.manager.itemEnd(t)},0);else{let t=nl.get(a);void 0===t&&(t=[],nl.set(a,t)),t.push({onLoad:e,onError:s})}return a}let n=eW("img");function o(){l(),e&&e(this);let i=nl.get(this)||[];for(let t=0;t<i.length;t++){let e=i[t];e.onLoad&&e.onLoad(this)}nl.delete(this),r.manager.itemEnd(t)}function h(e){l(),s&&s(e),ne.remove(`image:${t}`);let i=nl.get(this)||[];for(let t=0;t<i.length;t++){let s=i[t];s.onError&&s.onError(e)}nl.delete(this),r.manager.itemError(t),r.manager.itemEnd(t)}function l(){n.removeEventListener("load",o,!1),n.removeEventListener("error",h,!1)}return n.addEventListener("load",o,!1),n.addEventListener("error",h,!1),"data:"!==t.slice(0,5)&&void 0!==this.crossOrigin&&(n.crossOrigin=this.crossOrigin),ne.add(`image:${t}`,n),r.manager.itemStart(t),n.src=t,n}}class nc extends na{constructor(t){super(t)}load(t,e,i,s){let r=new iv,a=new nu(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(t,function(t){r.image=t,r.needsUpdate=!0,void 0!==e&&e(r)},i,s),r}}class np extends i0{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new i8(t),this.intensity=e}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){let e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,e}}let nd=new iT,nm=new is,ny=new is;class nf{constructor(t){this.camera=t,this.intensity=1,this.bias=0,this.biasNode=null,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new ie(512,512),this.mapType=tz,this.map=null,this.mapPass=null,this.matrix=new iT,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new rD,this._frameExtents=new ie(1,1),this._viewportCount=1,this._viewports=[new iw(0,0,1,1)]}getViewportCount(){return this._viewportCount}getCamera(){return this.camera}getFrustum(){return this._frustum}updateMatrices(t){let e=this.camera;nm.setFromMatrixPosition(t.matrixWorld),e.position.copy(nm),ny.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(ny),e.updateMatrixWorld(),this._updateMatrix(e,this.matrix,this._frustum)}_updateMatrix(t,e,i,s){nd.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),i.setFromProjectionMatrix(nd,t.coordinateSystem,t.reversedDepth);let r=this._frameExtents,a=s?s.z/r.x:1,n=s?s.w/r.y:1,o=s?s.x/r.x:0,h=s?s.y/r.y:0;2001===t.coordinateSystem||t.reversedDepth?e.set(.5*a,0,0,.5*a+o,0,.5*n,0,.5*n+h,0,0,1,0,0,0,0,1):e.set(.5*a,0,0,.5*a+o,0,.5*n,0,.5*n+h,0,0,.5,.5,0,0,0,1),e.multiply(nd)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.intensity=t.intensity,this.bias=t.bias,this.radius=t.radius,this.autoUpdate=t.autoUpdate,this.needsUpdate=t.needsUpdate,this.normalBias=t.normalBias,this.blurSamples=t.blurSamples,this.mapSize.copy(t.mapSize),this.biasNode=t.biasNode,this}clone(){return new this.constructor().copy(this)}toJSON(){let t={};return t.intensity=this.intensity,t.bias=this.bias,t.normalBias=this.normalBias,t.radius=this.radius,t.blurSamples=this.blurSamples,t.mapSize=this.mapSize.toArray(),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}let ng=new is,nx=new ii,nb=new is;class nM extends i0{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new iT,this.projectionMatrix=new iT,this.projectionMatrixInverse=new iT,this.coordinateSystem=eU,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorld.decompose(ng,nx,nb),1===nb.x&&1===nb.y&&1===nb.z?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(ng,nx,nb.set(1,1,1)).invert()}updateWorldMatrix(t,e,i=!1){super.updateWorldMatrix(t,e,i),this.matrixWorld.decompose(ng,nx,nb),1===nb.x&&1===nb.y&&1===nb.z?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(ng,nx,nb.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}}let nv=new is,nw=new ie,nS=new ie;class n_ extends nM{constructor(t=50,e=1,i=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=i,this.far=s,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){let e=.5*this.getFilmHeight()/t;this.fov=2*e3*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){let t=Math.tan(.5*e2*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*e3*Math.atan(Math.tan(.5*e2*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,i){nv.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(nv.x,nv.y).multiplyScalar(-t/nv.z),nv.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(nv.x,nv.y).multiplyScalar(-t/nv.z)}getViewSize(t,e){return this.getViewBounds(t,nw,nS),e.subVectors(nS,nw)}setViewOffset(t,e,i,s,r,a){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=s,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=this.near,e=t*Math.tan(.5*e2*this.fov)/this.zoom,i=2*e,s=this.aspect*i,r=-.5*s,a=this.view;if(null!==this.view&&this.view.enabled){let t=a.fullWidth,n=a.fullHeight;r+=a.offsetX*s/t,e-=a.offsetY*i/n,s*=a.width/t,i*=a.height/n}let n=this.filmOffset;0!==n&&(r+=t*n/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,e,e-i,t,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}class nA extends nf{constructor(){super(new n_(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(t){let e=this.camera,i=2*e3*t.angle*this.focus,s=this.mapSize.width/this.mapSize.height*this.aspect,r=t.distance||e.far;(i!==e.fov||s!==e.aspect||r!==e.far)&&(e.fov=i,e.aspect=s,e.far=r,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this.aspect=t.aspect,this}toJSON(){let t=super.toJSON();return t.focus=this.focus,t.aspect=this.aspect,t}}class nz extends np{constructor(t,e,i=0,s=Math.PI/3,r=0,a=2){super(t,e),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(i0.DEFAULT_UP),this.updateMatrix(),this.target=new i0,this.distance=i,this.angle=s,this.penumbra=r,this.decay=a,this.map=null,this.shadow=new nA}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.map=t.map,this.shadow=t.shadow.clone(),this}toJSON(t){let e=super.toJSON(t);return e.object.distance=this.distance,e.object.angle=this.angle,e.object.decay=this.decay,e.object.penumbra=this.penumbra,e.object.target=this.target.uuid,this.map&&this.map.isTexture&&(e.object.map=this.map.toJSON(t).uuid),e.object.shadow=this.shadow.toJSON(),e}}class nT extends nf{constructor(){super(new n_(90,1,.5,500)),this.isPointLightShadow=!0}}class nC extends np{constructor(t,e,i=0,s=2){super(t,e),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=s,this.shadow=new nT}get power(){return 4*this.intensity*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}toJSON(t){let e=super.toJSON(t);return e.object.distance=this.distance,e.object.decay=this.decay,e.object.shadow=this.shadow.toJSON(),e}}class nk extends nM{constructor(t=-1,e=1,i=1,s=-1,r=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=i,this.bottom=s,this.near=r,this.far=a,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,i,s,r,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=s,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,s=(this.top+this.bottom)/2,r=i-t,a=i+t,n=s+e,o=s-e;if(null!==this.view&&this.view.enabled){let t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX,a=r+t*this.view.width,n-=e*this.view.offsetY,o=n-e*this.view.height}this.projectionMatrix.makeOrthographic(r,a,n,o,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}class nB extends nf{constructor(){super(new nk(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class nI extends np{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(i0.DEFAULT_UP),this.updateMatrix(),this.target=new i0,this.shadow=new nB}dispose(){super.dispose(),this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}toJSON(t){let e=super.toJSON(t);return e.object.shadow=this.shadow.toJSON(),e.object.target=this.target.uuid,e}}class nO extends np{constructor(t,e){super(t,e),this.isAmbientLight=!0,this.type="AmbientLight"}}class nR{static extractUrlBase(t){let e=t.lastIndexOf("/");return -1===e?"./":t.slice(0,e+1)}static resolveURL(t,e){return"string"!=typeof t||""===t?"":(/^https?:\/\//i.test(e)&&/^\//.test(t)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t))?t:e+t}}let nN=new WeakMap;class nP extends na{constructor(t){super(t),this.isImageBitmapLoader=!0,"u"<typeof createImageBitmap&&eZ("ImageBitmapLoader: createImageBitmap() not supported."),"u"<typeof fetch&&eZ("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"},this._abortController=new AbortController}setOptions(t){return this.options=t,this}load(t,e,i,s){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);let r=this,a=ne.get(`image-bitmap:${t}`);if(void 0!==a)return(r.manager.itemStart(t),a.then)?void a.then(i=>{!0===nN.has(a)?(s&&s(nN.get(a)),r.manager.itemError(t)):e&&e(i),r.manager.itemEnd(t)}):void setTimeout(function(){e&&e(a),r.manager.itemEnd(t)},0);let n={};n.credentials="anonymous"===this.crossOrigin?"same-origin":"include",n.headers=this.requestHeader,n.signal="function"==typeof AbortSignal.any?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;let o=fetch(t,n).then(function(t){return t.blob()}).then(function(t){return createImageBitmap(t,Object.assign({},r.options,{colorSpaceConversion:"none"}))}).then(function(i){return ne.add(`image-bitmap:${t}`,i),e&&e(i),r.manager.itemEnd(t),i}).catch(function(e){s&&s(e),nN.set(o,e),ne.remove(`image-bitmap:${t}`),r.manager.itemError(t),r.manager.itemEnd(t)});ne.add(`image-bitmap:${t}`,o),r.manager.itemStart(t)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class nE extends i0{constructor(t,e,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new n_(-90,1,t,e);s.layers=this.layers,this.add(s);const r=new n_(-90,1,t,e);r.layers=this.layers,this.add(r);const a=new n_(-90,1,t,e);a.layers=this.layers,this.add(a);const n=new n_(-90,1,t,e);n.layers=this.layers,this.add(n);const o=new n_(-90,1,t,e);o.layers=this.layers,this.add(o);const h=new n_(-90,1,t,e);h.layers=this.layers,this.add(h)}updateCoordinateSystem(){let t=this.coordinateSystem,e=this.children.concat(),[i,s,r,a,n,o]=e;for(let t of e)this.remove(t);if(t===eU)i.up.set(0,1,0),i.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),n.up.set(0,1,0),n.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else if(2001===t)i.up.set(0,-1,0),i.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),n.up.set(0,-1,0),n.lookAt(0,0,1),o.up.set(0,-1,0),o.lookAt(0,0,-1);else throw Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(let t of e)this.add(t),t.updateMatrixWorld()}update(t,e){null===this.parent&&this.updateMatrixWorld();let{renderTarget:i,activeMipmapLevel:s}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());let[r,a,n,o,h,l]=this.children,u=t.getRenderTarget(),c=t.getActiveCubeFace(),p=t.getActiveMipmapLevel(),d=t.xr.enabled;t.xr.enabled=!1;let m=i.texture.generateMipmaps;i.texture.generateMipmaps=!1;let y=!1;y=!0===t.isWebGLRenderer?t.state.buffers.depth.getReversed():t.reversedDepthBuffer,t.setRenderTarget(i,0,s),y&&!1===t.autoClear&&t.clearDepth(),t.render(e,r),t.setRenderTarget(i,1,s),y&&!1===t.autoClear&&t.clearDepth(),t.render(e,a),t.setRenderTarget(i,2,s),y&&!1===t.autoClear&&t.clearDepth(),t.render(e,n),t.setRenderTarget(i,3,s),y&&!1===t.autoClear&&t.clearDepth(),t.render(e,o),t.setRenderTarget(i,4,s),y&&!1===t.autoClear&&t.clearDepth(),t.render(e,h),i.texture.generateMipmaps=m,t.setRenderTarget(i,5,s),y&&!1===t.autoClear&&t.clearDepth(),t.render(e,l),t.setRenderTarget(u,c,p),t.xr.enabled=d,i.texture.needsPMREMUpdate=!0}}class nV extends n_{constructor(t=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=t}}let nF="\\[\\]\\.:\\/",nL=RegExp("["+nF+"]","g"),nD="[^"+nF+"]",nj="[^"+nF.replace("\\.","")+"]",nU=RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",nD)+/(WCOD+)?/.source.replace("WCOD",nj)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",nD)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",nD)+"$"),nW=["material","materials","bones","map"];class nJ{constructor(t,e,i){const s=i||nX.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,s)}getValue(t,e){this.bind();let i=this._targetGroup.nCachedObjects_,s=this._bindings[i];void 0!==s&&s.getValue(t,e)}setValue(t,e){let i=this._bindings;for(let s=this._targetGroup.nCachedObjects_,r=i.length;s!==r;++s)i[s].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}}class nX{constructor(t,e,i){this.path=e,this.parsedPath=i||nX.parseTrackName(e),this.node=nX.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,i){return t&&t.isAnimationObjectGroup?new nX.Composite(t,e,i):new nX(t,e,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(nL,"")}static parseTrackName(t){let e=nU.exec(t);if(null===e)throw Error("THREE.PropertyBinding: Cannot parse trackName: "+t);let i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},s=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==s&&-1!==s){let t=i.nodeName.substring(s+1);-1!==nW.indexOf(t)&&(i.nodeName=i.nodeName.substring(0,s),i.objectName=t)}if(null===i.propertyName||0===i.propertyName.length)throw Error("THREE.PropertyBinding: can not parse propertyName from trackName: "+t);return i}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){let i=t.skeleton.getBoneByName(e);if(void 0!==i)return i}if(t.children){let i=function(t){for(let s=0;s<t.length;s++){let r=t[s];if(r.name===e||r.uuid===e)return r;let a=i(r.children);if(a)return a}return null},s=i(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 i=this.resolvedProperty;for(let s=0,r=i.length;s!==r;++s)t[e++]=i[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 i=this.resolvedProperty;for(let s=0,r=i.length;s!==r;++s)i[s]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let i=this.resolvedProperty;for(let s=0,r=i.length;s!==r;++s)i[s]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let i=this.resolvedProperty;for(let s=0,r=i.length;s!==r;++s)i[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,i=e.objectName,s=e.propertyName,r=e.propertyIndex;if(t||(t=nX.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void eZ("PropertyBinding: No target node found for track: "+this.path+".");if(i){let s=e.objectIndex;switch(i){case"materials":if(!t.material)return void eH("PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void eH("PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void eH("PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(let e=0;e<t.length;e++)if(t[e].name===s){s=e;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material)return void eH("PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.map)return void eH("PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);t=t.material.map;break;default:if(void 0===t[i])return void eH("PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[i]}if(void 0!==s){if(void 0===t[s])return void eH("PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[s]}}let a=t[s];if(void 0===a)return void eH("PropertyBinding: Trying to update property for track: "+e.nodeName+"."+s+" but it wasn't found.",t);let n=this.Versioning.None;this.targetObject=t,!0===t.isMaterial?n=this.Versioning.NeedsUpdate:!0===t.isObject3D&&(n=this.Versioning.MatrixWorldNeedsUpdate);let o=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===s){if(!t.geometry)return void eH("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.morphAttributes)return void eH("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[r]&&(r=t.morphTargetDictionary[r])}o=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=r}else void 0!==a.fromArray&&void 0!==a.toArray?(o=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(o=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=s;this.getValue=this.GetterByBindingType[o],this.setValue=this.SetterByBindingTypeAndVersioning[o][n]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}nX.Composite=nJ,nX.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},nX.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},nX.prototype.GetterByBindingType=[nX.prototype._getValue_direct,nX.prototype._getValue_array,nX.prototype._getValue_arrayElement,nX.prototype._getValue_toArray],nX.prototype.SetterByBindingTypeAndVersioning=[[nX.prototype._setValue_direct,nX.prototype._setValue_direct_setNeedsUpdate,nX.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[nX.prototype._setValue_array,nX.prototype._setValue_array_setNeedsUpdate,nX.prototype._setValue_array_setMatrixWorldNeedsUpdate],[nX.prototype._setValue_arrayElement,nX.prototype._setValue_arrayElement_setNeedsUpdate,nX.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[nX.prototype._setValue_fromArray,nX.prototype._setValue_fromArray_setNeedsUpdate,nX.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]],new Float32Array(1);let nY=new iT;class nq{constructor(t,e,i=0,s=1/0){this.ray=new s8(t,e),this.near=i,this.far=s,this.camera=null,this.layers=new iF,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,e.projectionMatrix.elements[14]).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):eH("Raycaster: Unsupported camera type: "+e.type)}setFromXRController(t){return nY.identity().extractRotation(t.matrixWorld),this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(nY),this}intersectObject(t,e=!0,i=[]){return nH(t,this,i,e),i.sort(nZ),i}intersectObjects(t,e=!0,i=[]){for(let s=0,r=t.length;s<r;s++)nH(t[s],this,i,e);return i.sort(nZ),i}}function nZ(t,e){return t.distance-e.distance}function nH(t,e,i,s){let r=!0;if(t.layers.test(e.layers)&&!1===t.raycast(e,i)&&(r=!1),!0===r&&!0===s){let s=t.children;for(let t=0,r=s.length;t<r;t++)nH(s[t],e,i,!0)}}class nG{constructor(t=1,e=0,i=0){this.radius=t,this.phi=e,this.theta=i}set(t,e,i){return this.radius=t,this.phi=e,this.theta=i,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){return this.phi=e4(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,i){return this.radius=Math.sqrt(t*t+e*e+i*i),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,i),this.phi=Math.acos(e4(e/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class n${static{n$.prototype.isMatrix2=!0}constructor(t,e,i,s){this.elements=[1,0,0,1],void 0!==t&&this.set(t,e,i,s)}identity(){return this.set(1,0,0,1),this}fromArray(t,e=0){for(let i=0;i<4;i++)this.elements[i]=t[i+e];return this}set(t,e,i,s){let r=this.elements;return r[0]=t,r[2]=e,r[1]=i,r[3]=s,this}}class nQ extends rK{constructor(t=10,e=10,i=4473924,s=8947848){i=new i8(i),s=new i8(s);const r=e/2,a=t/e,n=t/2,o=[],h=[];for(let t=0,l=0,u=-n;t<=e;t++,u+=a){o.push(-n,0,u,n,0,u),o.push(u,0,-n,u,0,n);const e=t===r?i:s;e.toArray(h,l),l+=3,e.toArray(h,l),l+=3,e.toArray(h,l),l+=3,e.toArray(h,l),l+=3}const l=new sZ;l.setAttribute("position",new sE(o,3)),l.setAttribute("color",new sE(h,3)),super(l,new rj({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}dispose(){super.dispose(),this.geometry.dispose(),this.material.dispose()}}let nK=new is,n0=new nM;class n1 extends rK{constructor(t){const e=new sZ,i=new rj({color:0xffffff,vertexColors:!0,toneMapped:!1}),s=[],r=[],a={};function n(t,e){o(t),o(e)}function o(t){s.push(0,0,0),r.push(0,0,0),void 0===a[t]&&(a[t]=[]),a[t].push(s.length/3-1)}n("n1","n2"),n("n2","n4"),n("n4","n3"),n("n3","n1"),n("f1","f2"),n("f2","f4"),n("f4","f3"),n("f3","f1"),n("n1","f1"),n("n2","f2"),n("n3","f3"),n("n4","f4"),n("p","n1"),n("p","n2"),n("p","n3"),n("p","n4"),n("u1","u2"),n("u2","u3"),n("u3","u1"),n("c","t"),n("p","c"),n("cn1","cn2"),n("cn3","cn4"),n("cf1","cf2"),n("cf3","cf4"),e.setAttribute("position",new sE(s,3)),e.setAttribute("color",new sE(r,3)),super(e,i),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update();const h=new i8(0xffaa00),l=new i8(0xff0000),u=new i8(43775),c=new i8(0xffffff),p=new i8(3355443);this.setColors(h,l,u,c,p)}setColors(t,e,i,s,r){let a=this.geometry.getAttribute("color");return a.setXYZ(0,t.r,t.g,t.b),a.setXYZ(1,t.r,t.g,t.b),a.setXYZ(2,t.r,t.g,t.b),a.setXYZ(3,t.r,t.g,t.b),a.setXYZ(4,t.r,t.g,t.b),a.setXYZ(5,t.r,t.g,t.b),a.setXYZ(6,t.r,t.g,t.b),a.setXYZ(7,t.r,t.g,t.b),a.setXYZ(8,t.r,t.g,t.b),a.setXYZ(9,t.r,t.g,t.b),a.setXYZ(10,t.r,t.g,t.b),a.setXYZ(11,t.r,t.g,t.b),a.setXYZ(12,t.r,t.g,t.b),a.setXYZ(13,t.r,t.g,t.b),a.setXYZ(14,t.r,t.g,t.b),a.setXYZ(15,t.r,t.g,t.b),a.setXYZ(16,t.r,t.g,t.b),a.setXYZ(17,t.r,t.g,t.b),a.setXYZ(18,t.r,t.g,t.b),a.setXYZ(19,t.r,t.g,t.b),a.setXYZ(20,t.r,t.g,t.b),a.setXYZ(21,t.r,t.g,t.b),a.setXYZ(22,t.r,t.g,t.b),a.setXYZ(23,t.r,t.g,t.b),a.setXYZ(24,e.r,e.g,e.b),a.setXYZ(25,e.r,e.g,e.b),a.setXYZ(26,e.r,e.g,e.b),a.setXYZ(27,e.r,e.g,e.b),a.setXYZ(28,e.r,e.g,e.b),a.setXYZ(29,e.r,e.g,e.b),a.setXYZ(30,e.r,e.g,e.b),a.setXYZ(31,e.r,e.g,e.b),a.setXYZ(32,i.r,i.g,i.b),a.setXYZ(33,i.r,i.g,i.b),a.setXYZ(34,i.r,i.g,i.b),a.setXYZ(35,i.r,i.g,i.b),a.setXYZ(36,i.r,i.g,i.b),a.setXYZ(37,i.r,i.g,i.b),a.setXYZ(38,s.r,s.g,s.b),a.setXYZ(39,s.r,s.g,s.b),a.setXYZ(40,r.r,r.g,r.b),a.setXYZ(41,r.r,r.g,r.b),a.setXYZ(42,r.r,r.g,r.b),a.setXYZ(43,r.r,r.g,r.b),a.setXYZ(44,r.r,r.g,r.b),a.setXYZ(45,r.r,r.g,r.b),a.setXYZ(46,r.r,r.g,r.b),a.setXYZ(47,r.r,r.g,r.b),a.setXYZ(48,r.r,r.g,r.b),a.setXYZ(49,r.r,r.g,r.b),a.needsUpdate=!0,this}update(){let t,e,i=this.geometry,s=this.pointMap;if(n0.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),!0===this.camera.reversedDepth)t=1,e=0;else if(this.camera.coordinateSystem===eU)t=-1,e=1;else if(2001===this.camera.coordinateSystem)t=0,e=1;else throw Error("THREE.CameraHelper.update(): Invalid coordinate system: "+this.camera.coordinateSystem);n2("c",s,i,n0,0,0,t),n2("t",s,i,n0,0,0,e),n2("n1",s,i,n0,-1,-1,t),n2("n2",s,i,n0,1,-1,t),n2("n3",s,i,n0,-1,1,t),n2("n4",s,i,n0,1,1,t),n2("f1",s,i,n0,-1,-1,e),n2("f2",s,i,n0,1,-1,e),n2("f3",s,i,n0,-1,1,e),n2("f4",s,i,n0,1,1,e),n2("u1",s,i,n0,.7,1.1,t),n2("u2",s,i,n0,-.7,1.1,t),n2("u3",s,i,n0,0,2,t),n2("cf1",s,i,n0,-1,0,e),n2("cf2",s,i,n0,1,0,e),n2("cf3",s,i,n0,0,-1,e),n2("cf4",s,i,n0,0,1,e),n2("cn1",s,i,n0,-1,0,t),n2("cn2",s,i,n0,1,0,t),n2("cn3",s,i,n0,0,-1,t),n2("cn4",s,i,n0,0,1,t),i.getAttribute("position").needsUpdate=!0}dispose(){super.dispose(),this.geometry.dispose(),this.material.dispose()}}function n2(t,e,i,s,r,a,n){nK.set(r,a,n).unproject(s);let o=e[t];if(void 0!==o){let t=i.getAttribute("position");for(let e=0,i=o.length;e<i;e++)t.setXYZ(o[e],nK.x,nK.y,nK.z)}}class n3 extends rK{constructor(t=1){const e=new sZ;e.setAttribute("position",new sE([0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],3)),e.setAttribute("color",new sE([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(e,new rj({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(t,e,i){let s=new i8,r=this.geometry.attributes.color.array;return s.set(t),s.toArray(r,0),s.toArray(r,3),s.set(e),s.toArray(r,6),s.toArray(r,9),s.set(i),s.toArray(r,12),s.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){super.dispose(),this.geometry.dispose(),this.material.dispose()}}class n5 extends eK{constructor(t,e=null){super(),this.object=t,this.domElement=e,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(t){null!==this.domElement&&this.disconnect(),this.domElement=t}disconnect(){}dispose(){}update(){}}function n4(t,e,i,s){let r=function(t){switch(t){case tz:case tT:return{byteLength:1,components:1};case tk:case tC:case tR:return{byteLength:2,components:1};case tN:case tP:return{byteLength:2,components:4};case tI:case tB:case tO:return{byteLength:4,components:1};case tV:case tF:return{byteLength:4,components:3}}throw Error(`THREE.TextureUtils: Unknown texture type ${t}.`)}(s);switch(i){case tL:return t*e;case tJ:case tX:return t*e/r.components*r.byteLength;case tY:case tq:return t*e*2/r.components*r.byteLength;case tD:return t*e*3/r.components*r.byteLength;case tj:case tZ:return t*e*4/r.components*r.byteLength;case tH:case tG:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case t$:case tQ:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case t0:case t2:return Math.max(t,16)*Math.max(e,8)/4;case tK:case t1:return Math.max(t,8)*Math.max(e,8)/2;case t3:case t5:case t6:case t9:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case t4:case t8:case t7:case et:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case ee:return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16;case ei:return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16;case es:return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16;case er:return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16;case ea:return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16;case en:return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16;case eo:return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16;case eh:return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16;case el:return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16;case eu:return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16;case ec:return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16;case ep:return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16;case ed:return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16;case em:case ey:case ef:return Math.ceil(t/4)*Math.ceil(e/4)*16;case eg:case ex:return Math.ceil(t/4)*Math.ceil(e/4)*8;case eb:case eM:return Math.ceil(t/4)*Math.ceil(e/4)*16}throw Error(`Unable to determine texture byte length for ${i} format.`)}"u">typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:h}})),"u">typeof window&&(window.__THREE__?eZ("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=h)}}]);
|