ocearo-ui 0.1.13 → 0.1.15
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/404.html +1 -1
- package/README.md +4 -0
- package/_next/static/chunks/0f8af13e.a3c5ee19dacc5d8a.js +158 -0
- package/_next/static/chunks/1268.5bf414e7f9ec61db.js +1 -0
- package/_next/static/chunks/1909.df96cdfa30c5e1a8.js +1 -0
- package/_next/static/chunks/2012.3c05163686cc3992.js +1 -0
- package/_next/static/chunks/2117-56c2fb7501b81a48.js +2 -0
- package/_next/static/chunks/2197.03c63df4706ac55a.js +1 -0
- package/_next/static/chunks/2274.20f7a66d87bbe5ba.js +1 -0
- package/_next/static/chunks/2353.0703bc2167f53e87.js +1 -0
- package/_next/static/chunks/2591.86dc5c0cabce74d9.js +1 -0
- package/_next/static/chunks/2687.03575a688467298f.js +26 -0
- package/_next/static/chunks/2936.32b491d885b0a1fa.js +1 -0
- package/_next/static/chunks/2967.b78077975c0ab30f.js +1 -0
- package/_next/static/chunks/2975.38e51d12034b0e56.js +1 -0
- package/_next/static/chunks/3059.7f8277e00847ad2a.js +1 -0
- package/_next/static/chunks/3145.636d8a0b59460f06.js +1 -0
- package/_next/static/chunks/3746-5b56cb222d7759f3.js +1 -0
- package/_next/static/chunks/4203.53016264f2cd3444.js +114 -0
- package/_next/static/chunks/5221.21b657b6a08aa489.js +1 -0
- package/_next/static/chunks/5322.ea4bebffcd8aa1cc.js +1 -0
- package/_next/static/chunks/5487.0ca3e1f29bec024a.js +1 -0
- package/_next/static/chunks/5751.f0376bcce7ec1e3d.js +1 -0
- package/_next/static/chunks/6108.ed2af8245ea73350.js +1 -0
- package/_next/static/chunks/6154.08319169fda8a96c.js +1 -0
- package/_next/static/chunks/6412.751c9a217112d729.js +1 -0
- package/_next/static/chunks/6496.d879aa3456fbe689.js +1 -0
- package/_next/static/chunks/6728.df40db4a2492c80a.js +1 -0
- package/_next/static/chunks/6949.54ab1a3c1db751ad.js +1 -0
- package/_next/static/chunks/7188.dd19efec20eb1ffd.js +1 -0
- package/_next/static/chunks/7252.9960bb9dcab56410.js +1 -0
- package/_next/static/chunks/767.c121402a31d61693.js +38 -0
- package/_next/static/chunks/{79.c90ea1de476d64c2.js → 8079.cd1d32892d355219.js} +1 -1
- package/_next/static/chunks/8341.a4bbd4563a858c62.js +1 -0
- package/_next/static/chunks/8610.a69a39b4e8210145.js +1 -0
- package/_next/static/chunks/870fdd6f.9cc7f4d7d53d0ee1.js +1 -0
- package/_next/static/chunks/9073.8e46e378467c398c.js +1 -0
- package/_next/static/chunks/9138.615379e543873c20.js +1 -0
- package/_next/static/chunks/{250.b26c37701919cf5c.js → 9250.e4a1a448563bce56.js} +3 -3
- package/_next/static/chunks/9483.c52ef3c126f89d4a.js +1 -0
- package/_next/static/chunks/9677.e29a54e257683481.js +1 -0
- package/_next/static/chunks/app/_not-found/page-02dd9834e02ff180.js +1 -0
- package/_next/static/chunks/app/layout-df29b07cc8d7ff8a.js +1 -0
- package/_next/static/chunks/app/page-8193fd4d93865082.js +1 -0
- package/_next/static/chunks/{b536a0f1.0563944ec53282b3.js → b536a0f1.7481d3b6ed8a124b.js} +1 -1
- package/_next/static/chunks/{bd904a5c-fce155daf9e9ba55.js → bd904a5c-ee5c73978aa69cb5.js} +1 -1
- package/_next/static/chunks/fd9d1056-c7da0d4e0db639a1.js +1 -0
- package/_next/static/chunks/framework-dbde1fe7fb0f4567.js +1 -0
- package/_next/static/chunks/main-app-01921a295932d28c.js +1 -0
- package/_next/static/chunks/main-de6ed997e06652b4.js +1 -0
- package/_next/static/chunks/pages/_app-78ddf957b9a9b996.js +1 -0
- package/_next/static/chunks/pages/_error-af28e299b63bd305.js +1 -0
- package/_next/static/chunks/webpack-fe2d60e504e1ce3b.js +1 -0
- package/_next/static/css/9c269b560e97b443.css +3 -0
- package/_next/static/jLQbcwqenN1fr_0feCPZa/_buildManifest.js +1 -0
- package/boats/boats.json +5 -0
- package/index.html +1 -1
- package/index.txt +4 -4
- package/{ocearo-ui-0.1.13.tgz → ocearo-ui-0.1.15.tgz} +0 -0
- package/package.json +2 -2
- package/_next/static/chunks/0f8af13e.6652bd734d04208b.js +0 -158
- package/_next/static/chunks/117-35a8eb6f9457406b.js +0 -2
- package/_next/static/chunks/12.a4273af9b82657f2.js +0 -1
- package/_next/static/chunks/138.b9389f70773e44e6.js +0 -1
- package/_next/static/chunks/145.9caac3d586b84999.js +0 -1
- package/_next/static/chunks/154.4e0902ce8b0f7ad1.js +0 -1
- package/_next/static/chunks/188.1839b14fedef7718.js +0 -1
- package/_next/static/chunks/197.bcdd8d0debcb7089.js +0 -1
- package/_next/static/chunks/221.a545399d0aaf207f.js +0 -1
- package/_next/static/chunks/226.8e9a3229837caa21.js +0 -151
- package/_next/static/chunks/252.d7cc856ebccc7381.js +0 -1
- package/_next/static/chunks/268.8ed821c518bf7977.js +0 -1
- package/_next/static/chunks/274.f21dd1bea1190823.js +0 -1
- package/_next/static/chunks/353.c2bc481b7d81054f.js +0 -1
- package/_next/static/chunks/412.47bfcc49cfe552a4.js +0 -1
- package/_next/static/chunks/413.69878f8910eb07d8.js +0 -1
- package/_next/static/chunks/487.c2062e37ef29da57.js +0 -1
- package/_next/static/chunks/496.c440e137e5877fb7.js +0 -1
- package/_next/static/chunks/59.c2dfec0c5e965cb5.js +0 -1
- package/_next/static/chunks/610.44fac6b8e6928564.js +0 -1
- package/_next/static/chunks/677.b3c43a3f32b247f4.js +0 -1
- package/_next/static/chunks/687.798c6b33d9165736.js +0 -26
- package/_next/static/chunks/728.3987afab39b00f4e.js +0 -1
- package/_next/static/chunks/73.a6b96572b40c5751.js +0 -1
- package/_next/static/chunks/746-f1a5b23db9004a46.js +0 -1
- package/_next/static/chunks/751.a180d553d77914d3.js +0 -1
- package/_next/static/chunks/870fdd6f.5b9af4fe6d08a9fb.js +0 -1
- package/_next/static/chunks/909.1e4c462123ae73e4.js +0 -1
- package/_next/static/chunks/936.e779b5632883831e.js +0 -1
- package/_next/static/chunks/949.e273523eaad35cc5.js +0 -1
- package/_next/static/chunks/967.83ea5cd9e6c9bb4c.js +0 -1
- package/_next/static/chunks/975.8821fdf115b619c5.js +0 -1
- package/_next/static/chunks/app/_not-found/page-1beaea75cf9b93d1.js +0 -1
- package/_next/static/chunks/app/layout-5065440b6db19cf5.js +0 -1
- package/_next/static/chunks/app/page-32b46c3e73a86694.js +0 -1
- package/_next/static/chunks/fd9d1056-50d0a3499460e502.js +0 -1
- package/_next/static/chunks/framework-cf2d8f6f8d843863.js +0 -1
- package/_next/static/chunks/main-8dbe8bddfa3a978c.js +0 -1
- package/_next/static/chunks/main-app-ed02033afba81a43.js +0 -1
- package/_next/static/chunks/pages/_app-15e2daefa259f0b5.js +0 -1
- package/_next/static/chunks/pages/_error-28b803cb2479b966.js +0 -1
- package/_next/static/chunks/webpack-9a92f476391a516d.js +0 -1
- package/_next/static/css/ac42e9cb9892c616.css +0 -3
- package/_next/static/d0q-Qivu1-sUFcVbdHKxk/_buildManifest.js +0 -1
- /package/_next/static/{d0q-Qivu1-sUFcVbdHKxk → jLQbcwqenN1fr_0feCPZa}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[870],{72079:function(t,e,i){let s,r,n,a,o;i.d(e,{$TI:function(){return lD},$V:function(){return lY},$YQ:function(){return aQ},$wi:function(){return td},A5E:function(){return rC},ACn:function(){return se},AXT:function(){return oe},B02:function(){return m},BFQ:function(){return t6},BG$:function(){return ec},BVF:function(){return X},BVQ:function(){return op},BbS:function(){return lg},Bf4:function(){return tb},Bgp:function(){return tc},BtG:function(){return nc},CJI:function(){return rf},CaW:function(){return ei},CdI:function(){return to},CtA:function(){return t2},CtF:function(){return hA},Cy:function(){return q},D1R:function(){return tR},D67:function(){return ia},D9w:function(){return t0},Djp:function(){return eu},DqL:function(){return hE},DvJ:function(){return r9},E2K:function(){return t5},EB7:function(){return aX},EJi:function(){return o7},EcG:function(){return uS},EoG:function(){return ta},F1y:function(){return io},F5G:function(){return t3},F5T:function(){return rS},FDw:function(){return tE},FE5:function(){return oK},FIo:function(){return o4},FM8:function(){return ij},FT0:function(){return hn},FUD:function(){return eg},FvO:function(){return l5},GG6:function(){return ef},GQ:function(){return uy},GUF:function(){return eY},GVz:function(){return sr},Gih:function(){return ey},Gql:function(){return h8},H$k:function(){return o$},H7L:function(){return iD},HTd:function(){return tT},HdW:function(){return eS},HgB:function(){return iv},HkE:function(){return ll},Hmr:function(){return ls},Hw6:function(){return i6},Hy8:function(){return j},Hyl:function(){return aK},I3e:function(){return iR},IEO:function(){return n$},IFH:function(){return eF},IKL:function(){return o9},ILR:function(){return t8},IOt:function(){return eq},Ilk:function(){return rv},Ir4:function(){return ib},JCZ:function(){return iT},JOQ:function(){return as},JQ4:function(){return tV},JUT:function(){return sn},JWc:function(){return ig},Jjb:function(){return ic},KI_:function(){return eX},Kgo:function(){return og},KhW:function(){return O},Kj0:function(){return r7},Kz5:function(){return tL},L5s:function(){return h6},LBq:function(){return lG},LSk:function(){return i_},LY2:function(){return tl},LgZ:function(){return L},LsT:function(){return tN},Ltg:function(){return st},Lun:function(){return hs},M$G:function(){return ih},M5h:function(){return T},M6v:function(){return te},M8C:function(){return iV},Mig:function(){return h0},MyG:function(){return e6},N$j:function(){return nG},N4l:function(){return A},NDo:function(){return tr},NKc:function(){return Z},NMF:function(){return eB},NYV:function(){return ep},NiX:function(){return nf},Ns1:function(){return ti},NwF:function(){return hM},Ny0:function(){return a0},O4K:function(){return iY},O5A:function(){return iZ},O78:function(){return iu},O7d:function(){return oD},OAl:function(){return it},ORg:function(){return tp},OTo:function(){return tJ},Oau:function(){return u_},OdW:function(){return n0},OoA:function(){return tS},Ox3:function(){return hK},PA7:function(){return eJ},PMe:function(){return hq},Pa4:function(){return sh},PeU:function(){return c},Pnf:function(){return eE},PpQ:function(){return i5},PzK:function(){return eH},QM0:function(){return ix},QO2:function(){return eM},QRU:function(){return li},QZ1:function(){return iy},Qey:function(){return iG},QmN:function(){return u},Qpg:function(){return us},R2R:function(){return hx},RNb:function(){return rE},ROQ:function(){return a$},RSm:function(){return ht},Rhp:function(){return ne},Rki:function(){return up},RlZ:function(){return D},RsA:function(){return l},RvT:function(){return ie},S2y:function(){return d},S3k:function(){return hP},S9g:function(){return sY},SJI:function(){return ly},SPe:function(){return n9},SUY:function(){return lu},Se2:function(){return Y},Sm8:function(){return R},SvJ:function(){return eb},Syv:function(){return ek},T6w:function(){return ip},T95:function(){return tO},TOt:function(){return oM},TUj:function(){return lK},TUv:function(){return nY},T_1:function(){return uw},T_J:function(){return e5},T__:function(){return a1},T_f:function(){return h1},TlE:function(){return rR},Tme:function(){return re},Tn7:function(){return o5},TyD:function(){return t_},U7:function(){return or},UCm:function(){return tZ},USm:function(){return sX},UY4:function(){return aL},UZH:function(){return h},UcC:function(){return l$},Uk6:function(){return o1},UlW:function(){return eV},Uol:function(){return oy},V1s:function(){return nn},VLJ:function(){return ur},VYz:function(){return lM},Vdb:function(){return U},Vkp:function(){return iU},VzW:function(){return tj},W2J:function(){return id},WMw:function(){return _},WTc:function(){return rP},WXh:function(){return o0},Wbm:function(){return I},Wid:function(){return o6},Wl3:function(){return b},Wpd:function(){return W},Wqd:function(){return ol},WwZ:function(){return eL},Wzm:function(){return aZ},Xaj:function(){return z},Xcj:function(){return lN},XvJ:function(){return oQ},Y8D:function(){return tY},YBo:function(){return he},YGz:function(){return th},YKA:function(){return eC},YLQ:function(){return tA},YT8:function(){return a7},Ywn:function(){return sa},Z6B:function(){return iM},ZAu:function(){return nd},ZQ6:function(){return on},ZRs:function(){return e1},ZTh:function(){return eA},ZXd:function(){return uM},ZZA:function(){return hc},Z_g:function(){return aY},Zen:function(){return il},Zp0:function(){return h4},Zr5:function(){return G},ZzF:function(){return sc},Zzh:function(){return l2},_12:function(){return oZ},_7h:function(){return eD},_AM:function(){return t9},_C8:function(){return hp},_Li:function(){return v},_MY:function(){return f},_RZ:function(){return iA},_YM:function(){return hg},_YX:function(){return l8},_am:function(){return nu},_fP:function(){return so},_iA:function(){return y},_kC:function(){return hL},_lf:function(){return eP},_sL:function(){return eO},_wr:function(){return H},a$l:function(){return rU},aCh:function(){return eZ},aH4:function(){return tz},aLr:function(){return sI},aNw:function(){return hC},aVm:function(){return rF},ad5:function(){return eQ},aq0:function(){return un},av9:function(){return t1},bBp:function(){return lO},bGH:function(){return C},b_z:function(){return of},bdR:function(){return S},blk:function(){return aN},bnF:function(){return oS},brP:function(){return tQ},bsb:function(){return ev},c8b:function(){return E},cBI:function(){return ul},cBK:function(){return hO},cJO:function(){return oq},cLu:function(){return tU},cPb:function(){return nl},cRx:function(){return tG},cU9:function(){return hf},cac:function(){return iJ},ce8:function(){return e0},cek:function(){return hG},cum:function(){return is},dSO:function(){return tx},dUE:function(){return hb},dYG:function(){return hd},dZ3:function(){return tu},dd2:function(){return si},dj0:function(){return im},dpR:function(){return hN},dwf:function(){return nt},dwk:function(){return x},e62:function(){return rj},eD:function(){return Q},eMJ:function(){return e4},eS_:function(){return iz},eaV:function(){return ee},ehD:function(){return w},ejS:function(){return aF},ekQ:function(){return en},epp:function(){return i1},f2y:function(){return ew},fHI:function(){return om},fO1:function(){return aq},fQA:function(){return uf},fSK:function(){return V},fY$:function(){return ty},fto:function(){return es},g8_:function(){return tv},gH0:function(){return lW},gSk:function(){return eN},g_z:function(){return os},ghN:function(){return P},gi4:function(){return el},gti:function(){return oo},hEm:function(){return tK},hH6:function(){return hB},iAb:function(){return tF},iDF:function(){return oj},iKG:function(){return h$},iLg:function(){return hw},iMs:function(){return lJ},iUV:function(){return lE},iWC:function(){return F},iWj:function(){return aa},iiP:function(){return ex},irR:function(){return tD},j17:function(){return e$},j4z:function(){return ii},j87:function(){return rL},jAl:function(){return ez},jFi:function(){return M},jZA:function(){return eo},jes:function(){return J},jfJ:function(){return e2},jwo:function(){return e8},jyi:function(){return nO},jyz:function(){return nr},k0A:function(){return tW},k74:function(){return N},kB5:function(){return nw},kaV:function(){return hr},kqm:function(){return lS},ksN:function(){return K},l0P:function(){return er},l6D:function(){return eG},l8J:function(){return iw},lCJ:function(){return rV},lDi:function(){return h2},lGU:function(){return eT},lLk:function(){return hT},lRF:function(){return hi},lRj:function(){return tB},lb7:function(){return n1},lfu:function(){return hm},lk7:function(){return h3},m7l:function(){return h_},mSO:function(){return eW},mTL:function(){return lr},mXe:function(){return oa},msZ:function(){return tm},mzJ:function(){return lP},nls:function(){return a_},ntZ:function(){return g},o8S:function(){return oX},oAp:function(){return np},oDz:function(){return ni},oa8:function(){return oY},oqc:function(){return e3},p3g:function(){return ss},p7y:function(){return oc},pBf:function(){return iC},pIN:function(){return eR},pKu:function(){return em},pQR:function(){return oJ},ppL:function(){return lL},ptH:function(){return ea},qVC:function(){return aG},qhX:function(){return ts},qkB:function(){return t$},qlB:function(){return rN},qyh:function(){return tk},rAo:function(){return rO},rDY:function(){return ns},rOj:function(){return k},r_:function(){return B},rpg:function(){return tw},s4_:function(){return h7},sYA:function(){return hR},tEQ:function(){return hz},tGC:function(){return ub},tJx:function(){return ug},tNt:function(){return i$},tQZ:function(){return tq},tUh:function(){return hy},tf:function(){return l_},tm_:function(){return p},u37:function(){return lh},u7G:function(){return h5},u9r:function(){return rY},uEv:function(){return eI},uL9:function(){return tn},uWy:function(){return tM},uXU:function(){return e7},v2s:function(){return aJ},v3W:function(){return t7},v9Y:function(){return iS},vBJ:function(){return r_},vCF:function(){return $},vCx:function(){return et},vZf:function(){return tC},vmT:function(){return hV},vpT:function(){return nb},vuL:function(){return e_},vxC:function(){return tg},w$m:function(){return tt},wJv:function(){return tH},wem:function(){return tI},wk1:function(){return tX},woe:function(){return aD},wuA:function(){return t4},x12:function(){return aR},x5V:function(){return eK},xEZ:function(){return i9},xG9:function(){return l9},xJs:function(){return ed},xTL:function(){return lV},xWb:function(){return lj},xeV:function(){return nM},xfE:function(){return tf},xo$:function(){return oG},xoQ:function(){return ir},xoR:function(){return o8},xsS:function(){return nx},y$t:function(){return ou},y2t:function(){return eh},y8_:function(){return uv},yC1:function(){return hS},yGw:function(){return sL},yHo:function(){return iQ},ybr:function(){return ng},yj7:function(){return oi},ylh:function(){return lH},yo9:function(){return ny},yt0:function(){return e9},ywz:function(){return tP},yxD:function(){return hF},z$h:function(){return ej},z81:function(){return eU},z8B:function(){return nV},zHn:function(){return sN},zbs:function(){return hv},zf8:function(){return od},zwN:function(){return aS}});let h="173",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=3,f=0,y=1,g=2,x=3,b=0,v=1,w=2,M=0,S=1,_=2,A=3,T=4,z=5,C=100,I=101,k=102,B=103,R=104,E=200,P=201,O=202,F=203,N=204,L=205,V=206,j=207,U=208,W=209,D=210,H=211,q=212,J=213,Z=214,X=0,Y=1,G=2,$=3,Q=4,K=5,tt=6,te=7,ti=0,ts=1,tr=2,tn=0,ta=1,to=2,th=3,tl=4,tu=5,tc=6,tp=7,td="attached",tm="detached",tf=300,ty=301,tg=302,tx=303,tb=304,tv=306,tw=1e3,tM=1001,tS=1002,t_=1003,tA=1004,tT=1004,tz=1005,tC=1005,tI=1006,tk=1007,tB=1007,tR=1008,tE=1008,tP=1009,tO=1010,tF=1011,tN=1012,tL=1013,tV=1014,tj=1015,tU=1016,tW=1017,tD=1018,tH=1020,tq=35902,tJ=1021,tZ=1022,tX=1023,tY=1024,tG=1025,t$=1026,tQ=1027,tK=1028,t0=1029,t1=1030,t2=1031,t3=1032,t5=1033,t4=33776,t6=33777,t7=33778,t8=33779,t9=35840,et=35841,ee=35842,ei=35843,es=36196,er=37492,en=37496,ea=37808,eo=37809,eh=37810,el=37811,eu=37812,ec=37813,ep=37814,ed=37815,em=37816,ef=37817,ey=37818,eg=37819,ex=37820,eb=37821,ev=36492,ew=36494,eM=36495,eS=36283,e_=36284,eA=36285,eT=36286,ez=2200,eC=2201,eI=2202,ek=2300,eB=2301,eR=2302,eE=2400,eP=2401,eO=2402,eF=2500,eN=2501,eL=0,eV=1,ej=2,eU=3200,eW=3201,eD=3202,eH=3203,eq=0,eJ=1,eZ="",eX="srgb",eY="srgb-linear",eG="linear",e$="srgb",eQ=0,eK=7680,e0=7681,e1=7682,e2=7683,e3=34055,e5=34056,e4=5386,e6=512,e7=513,e8=514,e9=515,it=516,ie=517,ii=518,is=519,ir=512,ia=513,io=514,ih=515,il=516,iu=517,ic=518,ip=519,id=35044,im=35048,iy=35040,ig=35045,ix=35049,ib=35041,iv=35046,iw=35050,iM=35042,iS="100",i_="300 es",iA=2e3,iT=2001,iz={COMPUTE:"compute",RENDER:"render"};class iC{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 iI=["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"],ik=1234567,iB=Math.PI/180,iR=180/Math.PI;function iE(){let t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,s=4294967295*Math.random()|0;return(iI[255&t]+iI[t>>8&255]+iI[t>>16&255]+iI[t>>24&255]+"-"+iI[255&e]+iI[e>>8&255]+"-"+iI[e>>16&15|64]+iI[e>>24&255]+"-"+iI[63&i|128]+iI[i>>8&255]+"-"+iI[i>>16&255]+iI[i>>24&255]+iI[255&s]+iI[s>>8&255]+iI[s>>16&255]+iI[s>>24&255]).toLowerCase()}function iP(t,e,i){return Math.max(e,Math.min(i,t))}function iO(t,e){return(t%e+e)%e}function iF(t,e,i){return(1-i)*t+i*e}function iN(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw Error("Invalid component type.")}}function iL(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw Error("Invalid component type.")}}let iV={DEG2RAD:iB,RAD2DEG:iR,generateUUID:iE,clamp:iP,euclideanModulo:iO,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:iF,damp:function(t,e,i,s){return iF(t,e,1-Math.exp(-i*s))},pingpong:function(t,e=1){return e-Math.abs(iO(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&&(ik=t);let e=ik+=1831565813;return e=Math.imul(e^e>>>15,1|e),(((e^=e+Math.imul(e^e>>>7,61|e))^e>>>14)>>>0)/4294967296},degToRad:function(t){return t*iB},radToDeg:function(t){return t*iR},isPowerOfTwo:function(t){return(t&t-1)==0&&0!==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 n=Math.cos,a=Math.sin,o=n(i/2),h=a(i/2),l=n((e+s)/2),u=a((e+s)/2),c=n((e-s)/2),p=a((e-s)/2),d=n((s-e)/2),m=a((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:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},normalize:iL,denormalize:iN};class ij{constructor(t=0,e=0){ij.prototype.isVector2=!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("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("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=iP(this.x,t.x,e.x),this.y=iP(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=iP(this.x,t,e),this.y=iP(this.y,t,e),this}clampLength(t,e){let i=this.length();return this.divideScalar(i||1).multiplyScalar(iP(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(iP(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,n=this.y-t.y;return this.x=r*i-n*s+t.x,this.y=r*s+n*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class iU{constructor(t,e,i,s,r,n,a,o,h){iU.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,i,s,r,n,a,o,h)}set(t,e,i,s,r,n,a,o,h){let l=this.elements;return l[0]=t,l[1]=s,l[2]=a,l[3]=e,l[4]=r,l[5]=o,l[6]=i,l[7]=n,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,n=i[0],a=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],f=s[3],y=s[6],g=s[1],x=s[4],b=s[7],v=s[2],w=s[5],M=s[8];return r[0]=n*m+a*g+o*v,r[3]=n*f+a*x+o*w,r[6]=n*y+a*b+o*M,r[1]=h*m+l*g+u*v,r[4]=h*f+l*x+u*w,r[7]=h*y+l*b+u*M,r[2]=c*m+p*g+d*v,r[5]=c*f+p*x+d*w,r[8]=c*y+p*b+d*M,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],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*n*l-e*a*h-i*r*l+i*a*o+s*r*h-s*n*o}invert(){let t=this.elements,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*n-a*h,c=a*o-l*r,p=h*r-n*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]=(a*i-s*n)*m,t[3]=c*m,t[4]=(l*e-s*o)*m,t[5]=(s*r-a*e)*m,t[6]=p*m,t[7]=(i*o-h*e)*m,t[8]=(n*e-i*r)*m,this}transpose(){let t;let 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,n,a){let o=Math.cos(r),h=Math.sin(r);return this.set(i*o,i*h,-i*(o*n+h*a)+n+t,-s*h,s*o,-s*(-h*n+o*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(iW.makeScale(t,e)),this}rotate(t){return this.premultiply(iW.makeRotation(-t)),this}translate(t,e){return this.premultiply(iW.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 iW=new iU;function iD(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}let iH={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function iq(t,e){return new iH[t](e)}function iJ(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function iZ(){let t=iJ("canvas");return t.style.display="block",t}let iX={};function iY(t){t in iX||(iX[t]=!0,console.warn(t))}function iG(t,e,i){return new Promise(function(s,r){setTimeout(function n(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:r();break;case t.TIMEOUT_EXPIRED:setTimeout(n,i);break;default:s()}},i)})}function i$(t){let e=t.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function iQ(t){let e=t.elements;-1===e[11]?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}let iK=new iU().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),i0=new iU().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),i1=function(){let t={enabled:!0,workingColorSpace:eY,spaces:{},convert:function(t,e,i){return!1!==this.enabled&&e!==i&&e&&i&&(this.spaces[e].transfer===e$&&(t.r=i2(t.r),t.g=i2(t.g),t.b=i2(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===e$&&(t.r=i3(t.r),t.g=i3(t.g),t.b=i3(t.b))),t},fromWorkingColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this.workingColorSpace)},getPrimaries:function(t){return this.spaces[t].primaries},getTransfer:function(t){return t===eZ?eG:this.spaces[t].transfer},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}},e=[.64,.33,.3,.6,.15,.06],i=[.2126,.7152,.0722],s=[.3127,.329];return t.define({[eY]:{primaries:e,whitePoint:s,transfer:eG,toXYZ:iK,fromXYZ:i0,luminanceCoefficients:i,workingColorSpaceConfig:{unpackColorSpace:eX},outputColorSpaceConfig:{drawingBufferColorSpace:eX}},[eX]:{primaries:e,whitePoint:s,transfer:e$,toXYZ:iK,fromXYZ:i0,luminanceCoefficients:i,outputColorSpaceConfig:{drawingBufferColorSpace:eX}}}),t}();function i2(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function i3(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}class i5{static getDataURL(t){let e;if(/^data:/i.test(t.src)||"undefined"==typeof HTMLCanvasElement)return t.src;if(t instanceof HTMLCanvasElement)e=t;else{void 0===s&&(s=iJ("canvas")),s.width=t.width,s.height=t.height;let i=s.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=s}return e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){let e=iJ("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*i2(r[t]/255);return i.putImageData(s,0,0),e}if(!t.data)return console.warn("THREE.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*i2(e[t]/255)):e[t]=i2(e[t]);return{data:e,width:t.width,height:t.height}}}}let i4=0;class i6{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:i4++}),this.uuid=iE(),this.data=t,this.dataReady=!0,this.version=0}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(i7(s[e].image)):t.push(i7(s[e]))}else t=i7(s);i.url=t}return e||(t.images[this.uuid]=i),i}}function i7(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?i5.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let i8=0;class i9 extends iC{constructor(t=i9.DEFAULT_IMAGE,e=i9.DEFAULT_MAPPING,i=tM,s=tM,r=tI,n=tR,a=tX,o=tP,h=i9.DEFAULT_ANISOTROPY,l=eZ){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:i8++}),this.uuid=iE(),this.name="",this.source=new i6(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=i,this.wrapT=s,this.magFilter=r,this.minFilter=n,this.anisotropy=h,this.format=a,this.internalFormat=null,this.type=o,this.offset=new ij(0,0),this.repeat=new ij(1,1),this.center=new ij(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new iU,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=l,this.userData={},this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(t=null){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)}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.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.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}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.6,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,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(this.mapping!==tf)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case tw:t.x=t.x-Math.floor(t.x);break;case tM:t.x=t.x<0?0:1;break;case tS: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 tw:t.y=t.y-Math.floor(t.y);break;case tM:t.y=t.y<0?0:1;break;case tS: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++}}i9.DEFAULT_IMAGE=null,i9.DEFAULT_MAPPING=tf,i9.DEFAULT_ANISOTROPY=1;class st{constructor(t=0,e=0,i=0,s=1){st.prototype.isVector4=!0,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("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("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,n=t.elements;return this.x=n[0]*e+n[4]*i+n[8]*s+n[12]*r,this.y=n[1]*e+n[5]*i+n[9]*s+n[13]*r,this.z=n[2]*e+n[6]*i+n[10]*s+n[14]*r,this.w=n[3]*e+n[7]*i+n[11]*s+n[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;let n=t.elements,a=n[0],o=n[4],h=n[8],l=n[1],u=n[5],c=n[9],p=n[2],d=n[6],m=n[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(a+u+m-3))return this.set(1,0,0,0),this;e=Math.PI;let t=(a+1)/2,n=(u+1)/2,f=(m+1)/2,y=(o+l)/4,g=(h+p)/4,x=(c+d)/4;return t>n&&t>f?t<.01?(i=0,s=.707106781,r=.707106781):(s=y/(i=Math.sqrt(t)),r=g/i):n>f?n<.01?(i=.707106781,s=0,r=.707106781):(i=y/(s=Math.sqrt(n)),r=x/s):f<.01?(i=.707106781,s=.707106781,r=0):(i=g/(r=Math.sqrt(f)),s=x/r),this.set(i,s,r,e),this}let f=Math.sqrt((d-c)*(d-c)+(h-p)*(h-p)+(l-o)*(l-o));return .001>Math.abs(f)&&(f=1),this.x=(d-c)/f,this.y=(h-p)/f,this.z=(l-o)/f,this.w=Math.acos((a+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=iP(this.x,t.x,e.x),this.y=iP(this.y,t.y,e.y),this.z=iP(this.z,t.z,e.z),this.w=iP(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=iP(this.x,t,e),this.y=iP(this.y,t,e),this.z=iP(this.z,t,e),this.w=iP(this.w,t,e),this}clampLength(t,e){let i=this.length();return this.divideScalar(i||1).multiplyScalar(iP(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 se extends iC{constructor(t=1,e=1,i={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new st(0,0,t,e),this.scissorTest=!1,this.viewport=new st(0,0,t,e);let s=new i9({width:t,height:e,depth:1},(i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:tI,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i)).mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);s.flipY=!1,s.generateMipmaps=i.generateMipmaps,s.internalFormat=i.internalFormat,this.textures=[];let 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.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}set depthTexture(t){null!==this._depthTexture&&(this._depthTexture.renderTarget=null),null!==t&&(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;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 e=Object.assign({},t.texture.image);return this.texture.source=new i6(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,null!==t.depthTexture&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class si extends se{constructor(t=1,e=1,i={}){super(t,e,i),this.isWebGLRenderTarget=!0}}class ss extends i9{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=t_,this.minFilter=t_,this.wrapR=tM,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class sr extends si{constructor(t=1,e=1,i=1,s={}){super(t,e,s),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new ss(null,t,e,i),this.texture.isRenderTargetTexture=!0}}class sn extends i9{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=t_,this.minFilter=t_,this.wrapR=tM,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class sa extends si{constructor(t=1,e=1,i=1,s={}){super(t,e,s),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new sn(null,t,e,i),this.texture.isRenderTargetTexture=!0}}class so{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,n,a){let o=i[s+0],h=i[s+1],l=i[s+2],u=i[s+3],c=r[n+0],p=r[n+1],d=r[n+2],m=r[n+3];if(0===a){t[e+0]=o,t[e+1]=h,t[e+2]=l,t[e+3]=u;return}if(1===a){t[e+0]=c,t[e+1]=p,t[e+2]=d,t[e+3]=m;return}if(u!==m||o!==c||h!==p||l!==d){let t=1-a,e=o*c+h*p+l*d+u*m,i=e>=0?1:-1,s=1-e*e;if(s>Number.EPSILON){let r=Math.sqrt(s),n=Math.atan2(r,e*i);t=Math.sin(t*n)/r,a=Math.sin(a*n)/r}let r=a*i;if(o=o*t+c*r,h=h*t+p*r,l=l*t+d*r,u=u*t+m*r,t===1-a){let t=1/Math.sqrt(o*o+h*h+l*l+u*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,n){let a=i[s],o=i[s+1],h=i[s+2],l=i[s+3],u=r[n],c=r[n+1],p=r[n+2],d=r[n+3];return t[e]=a*d+l*u+o*p-h*c,t[e+1]=o*d+l*c+h*u-a*p,t[e+2]=h*d+l*p+a*c-o*u,t[e+3]=l*d-a*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,n=t._order,a=Math.cos,o=Math.sin,h=a(i/2),l=a(s/2),u=a(r/2),c=o(i/2),p=o(s/2),d=o(r/2);switch(n){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:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+n)}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],n=e[1],a=e[5],o=e[9],h=e[2],l=e[6],u=e[10],c=i+a+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=(n-s)*t}else if(i>a&&i>u){let t=2*Math.sqrt(1+i-a-u);this._w=(l-o)/t,this._x=.25*t,this._y=(s+n)/t,this._z=(r+h)/t}else if(a>u){let t=2*Math.sqrt(1+a-i-u);this._w=(r-h)/t,this._x=(s+n)/t,this._y=.25*t,this._z=(o+l)/t}else{let t=2*Math.sqrt(1+u-i-a);this._w=(n-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<Number.EPSILON?(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(iP(this.dot(t),-1,1)))}rotateTowards(t,e){let i=this.angleTo(t);return 0===i||this.slerp(t,Math.min(1,e/i)),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,n=t._w,a=e._x,o=e._y,h=e._z,l=e._w;return this._x=i*l+n*a+s*h-r*o,this._y=s*l+n*o+r*a-i*h,this._z=r*l+n*h+i*o-s*a,this._w=n*l-i*a-s*o-r*h,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);let i=this._x,s=this._y,r=this._z,n=this._w,a=n*t._w+i*t._x+s*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=n,this._x=i,this._y=s,this._z=r,this;let o=1-a*a;if(o<=Number.EPSILON){let t=1-e;return this._w=t*n+e*this._w,this._x=t*i+e*this._x,this._y=t*s+e*this._y,this._z=t*r+e*this._z,this.normalize(),this}let h=Math.sqrt(o),l=Math.atan2(h,a),u=Math.sin((1-e)*l)/h,c=Math.sin(e*l)/h;return this._w=n*u+this._w*c,this._x=i*u+this._x*c,this._y=s*u+this._y*c,this._z=r*u+this._z*c,this._onChangeCallback(),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 sh{constructor(t=0,e=0,i=0){sh.prototype.isVector3=!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("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("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(su.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(su.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,n=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])*n,this.y=(r[1]*e+r[5]*i+r[9]*s+r[13])*n,this.z=(r[2]*e+r[6]*i+r[10]*s+r[14])*n,this}applyQuaternion(t){let e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z,o=t.w,h=2*(n*s-a*i),l=2*(a*e-r*s),u=2*(r*i-n*e);return this.x=e+o*h+n*u-a*l,this.y=i+o*l+a*h-r*u,this.z=s+o*u+r*l-n*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=iP(this.x,t.x,e.x),this.y=iP(this.y,t.y,e.y),this.z=iP(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=iP(this.x,t,e),this.y=iP(this.y,t,e),this.z=iP(this.z,t,e),this}clampLength(t,e){let i=this.length();return this.divideScalar(i||1).multiplyScalar(iP(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,n=e.x,a=e.y,o=e.z;return this.x=s*o-r*a,this.y=r*n-i*o,this.z=i*a-s*n,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 sl.copy(this).projectOnVector(t),this.sub(sl)}reflect(t){return this.sub(sl.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(iP(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 sl=new sh,su=new so;class sc{constructor(t=new sh(Infinity,Infinity,Infinity),e=new sh(-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(sd.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,i=t.count;e<i;e++)this.expandByPoint(sd.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=sd.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,sd):sd.fromBufferAttribute(s,e),sd.applyMatrix4(t.matrixWorld),this.expandByPoint(sd);else void 0!==t.boundingBox?(null===t.boundingBox&&t.computeBoundingBox(),sm.copy(t.boundingBox)):(null===i.boundingBox&&i.computeBoundingBox(),sm.copy(i.boundingBox)),sm.applyMatrix4(t.matrixWorld),this.union(sm)}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,sd),sd.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(sw),sM.subVectors(this.max,sw),sf.subVectors(t.a,sw),sy.subVectors(t.b,sw),sg.subVectors(t.c,sw),sx.subVectors(sy,sf),sb.subVectors(sg,sy),sv.subVectors(sf,sg);let e=[0,-sx.z,sx.y,0,-sb.z,sb.y,0,-sv.z,sv.y,sx.z,0,-sx.x,sb.z,0,-sb.x,sv.z,0,-sv.x,-sx.y,sx.x,0,-sb.y,sb.x,0,-sv.y,sv.x,0];return!!(sA(e,sf,sy,sg,sM)&&sA(e=[1,0,0,0,1,0,0,0,1],sf,sy,sg,sM))&&(sS.crossVectors(sx,sb),sA(e=[sS.x,sS.y,sS.z],sf,sy,sg,sM))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,sd).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(sd).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()||(sp[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),sp[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),sp[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),sp[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),sp[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),sp[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),sp[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),sp[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(sp)),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)}}let sp=[new sh,new sh,new sh,new sh,new sh,new sh,new sh,new sh],sd=new sh,sm=new sc,sf=new sh,sy=new sh,sg=new sh,sx=new sh,sb=new sh,sv=new sh,sw=new sh,sM=new sh,sS=new sh,s_=new sh;function sA(t,e,i,s,r){for(let n=0,a=t.length-3;n<=a;n+=3){s_.fromArray(t,n);let a=r.x*Math.abs(s_.x)+r.y*Math.abs(s_.y)+r.z*Math.abs(s_.z),o=e.dot(s_),h=i.dot(s_),l=s.dot(s_);if(Math.max(-Math.max(o,h,l),Math.min(o,h,l))>a)return!1}return!0}let sT=new sc,sz=new sh,sC=new sh;class sI{constructor(t=new sh,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):sT.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;sz.subVectors(t,this.center);let e=sz.lengthSq();if(e>this.radius*this.radius){let t=Math.sqrt(e),i=(t-this.radius)*.5;this.center.addScaledVector(sz,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):(sC.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(sz.copy(t.center).add(sC)),this.expandByPoint(sz.copy(t.center).sub(sC)))),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}let sk=new sh,sB=new sh,sR=new sh,sE=new sh,sP=new sh,sO=new sh,sF=new sh;class sN{constructor(t=new sh,e=new sh(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,sk)),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=sk.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(sk.copy(this.origin).addScaledVector(this.direction,e),sk.distanceToSquared(t))}distanceSqToSegment(t,e,i,s){let r,n,a,o;sB.copy(t).add(e).multiplyScalar(.5),sR.copy(e).sub(t).normalize(),sE.copy(this.origin).sub(sB);let h=.5*t.distanceTo(e),l=-this.direction.dot(sR),u=sE.dot(this.direction),c=-sE.dot(sR),p=sE.lengthSq(),d=Math.abs(1-l*l);if(d>0){if(r=l*c-u,n=l*u-c,o=h*d,r>=0){if(n>=-o){if(n<=o){let t=1/d;r*=t,n*=t,a=r*(r+l*n+2*u)+n*(l*r+n+2*c)+p}else a=-(r=Math.max(0,-(l*(n=h)+u)))*r+n*(n+2*c)+p}else a=-(r=Math.max(0,-(l*(n=-h)+u)))*r+n*(n+2*c)+p}else n<=-o?(n=(r=Math.max(0,-(-l*h+u)))>0?-h:Math.min(Math.max(-h,-c),h),a=-r*r+n*(n+2*c)+p):n<=o?(r=0,a=(n=Math.min(Math.max(-h,-c),h))*(n+2*c)+p):(n=(r=Math.max(0,-(l*h+u)))>0?h:Math.min(Math.max(-h,-c),h),a=-r*r+n*(n+2*c)+p)}else n=l>0?-h:h,a=-(r=Math.max(0,-(l*n+u)))*r+n*(n+2*c)+p;return i&&i.copy(this.origin).addScaledVector(this.direction,r),s&&s.copy(sB).addScaledVector(sR,n),a}intersectSphere(t,e){sk.subVectors(t.center,this.origin);let i=sk.dot(this.direction),s=sk.dot(sk)-i*i,r=t.radius*t.radius;if(s>r)return null;let n=Math.sqrt(r-s),a=i-n,o=i+n;return o<0?null:a<0?this.at(o,e):this.at(a,e)}intersectsSphere(t){return 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,n,a,o;let 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,n=(t.max.y-c.y)*l):(r=(t.max.y-c.y)*l,n=(t.min.y-c.y)*l),i>n||r>s)?null:((r>i||isNaN(i))&&(i=r),(n<s||isNaN(s))&&(s=n),u>=0?(a=(t.min.z-c.z)*u,o=(t.max.z-c.z)*u):(a=(t.max.z-c.z)*u,o=(t.min.z-c.z)*u),i>o||a>s)?null:((a>i||i!=i)&&(i=a),(o<s||s!=s)&&(s=o),s<0)?null:this.at(i>=0?i:s,e)}intersectsBox(t){return null!==this.intersectBox(t,sk)}intersectTriangle(t,e,i,s,r){let n;sP.subVectors(e,t),sO.subVectors(i,t),sF.crossVectors(sP,sO);let a=this.direction.dot(sF);if(a>0){if(s)return null;n=1}else{if(!(a<0))return null;n=-1,a=-a}sE.subVectors(this.origin,t);let o=n*this.direction.dot(sO.crossVectors(sE,sO));if(o<0)return null;let h=n*this.direction.dot(sP.cross(sE));if(h<0||o+h>a)return null;let l=-n*sE.dot(sF);return l<0?null:this.at(l/a,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 sL{constructor(t,e,i,s,r,n,a,o,h,l,u,c,p,d,m,f){sL.prototype.isMatrix4=!0,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,n,a,o,h,l,u,c,p,d,m,f)}set(t,e,i,s,r,n,a,o,h,l,u,c,p,d,m,f){let y=this.elements;return y[0]=t,y[4]=e,y[8]=i,y[12]=s,y[1]=r,y[5]=n,y[9]=a,y[13]=o,y[2]=h,y[6]=l,y[10]=u,y[14]=c,y[3]=p,y[7]=d,y[11]=m,y[15]=f,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 sL().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 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){let e=this.elements,i=t.elements,s=1/sV.setFromMatrixColumn(t,0).length(),r=1/sV.setFromMatrixColumn(t,1).length(),n=1/sV.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]*n,e[9]=i[9]*n,e[10]=i[10]*n,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,n=Math.cos(i),a=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=n*l,i=n*u,s=a*l,r=a*u;e[0]=o*l,e[4]=-o*u,e[8]=h,e[1]=i+s*h,e[5]=t-r*h,e[9]=-a*o,e[2]=r-t*h,e[6]=s+i*h,e[10]=n*o}else if("YXZ"===t.order){let t=o*l,i=o*u,s=h*l,r=h*u;e[0]=t+r*a,e[4]=s*a-i,e[8]=n*h,e[1]=n*u,e[5]=n*l,e[9]=-a,e[2]=i*a-s,e[6]=r+t*a,e[10]=n*o}else if("ZXY"===t.order){let t=o*l,i=o*u,s=h*l,r=h*u;e[0]=t-r*a,e[4]=-n*u,e[8]=s+i*a,e[1]=i+s*a,e[5]=n*l,e[9]=r-t*a,e[2]=-n*h,e[6]=a,e[10]=n*o}else if("ZYX"===t.order){let t=n*l,i=n*u,s=a*l,r=a*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]=a*o,e[10]=n*o}else if("YZX"===t.order){let t=n*o,i=n*h,s=a*o,r=a*h;e[0]=o*l,e[4]=r-t*u,e[8]=s*u+i,e[1]=u,e[5]=n*l,e[9]=-a*l,e[2]=-h*l,e[6]=i*u+s,e[10]=t-r*u}else if("XZY"===t.order){let t=n*o,i=n*h,s=a*o,r=a*h;e[0]=o*l,e[4]=-u,e[8]=h*l,e[1]=t*u+r,e[5]=n*l,e[9]=i*u-s,e[2]=s*u-i,e[6]=a*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(sU,t,sW)}lookAt(t,e,i){let s=this.elements;return sq.subVectors(t,e),0===sq.lengthSq()&&(sq.z=1),sq.normalize(),sD.crossVectors(i,sq),0===sD.lengthSq()&&(1===Math.abs(i.z)?sq.x+=1e-4:sq.z+=1e-4,sq.normalize(),sD.crossVectors(i,sq)),sD.normalize(),sH.crossVectors(sq,sD),s[0]=sD.x,s[4]=sH.x,s[8]=sq.x,s[1]=sD.y,s[5]=sH.y,s[9]=sq.y,s[2]=sD.z,s[6]=sH.z,s[10]=sq.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,n=i[0],a=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],f=i[10],y=i[14],g=i[3],x=i[7],b=i[11],v=i[15],w=s[0],M=s[4],S=s[8],_=s[12],A=s[1],T=s[5],z=s[9],C=s[13],I=s[2],k=s[6],B=s[10],R=s[14],E=s[3],P=s[7],O=s[11],F=s[15];return r[0]=n*w+a*A+o*I+h*E,r[4]=n*M+a*T+o*k+h*P,r[8]=n*S+a*z+o*B+h*O,r[12]=n*_+a*C+o*R+h*F,r[1]=l*w+u*A+c*I+p*E,r[5]=l*M+u*T+c*k+p*P,r[9]=l*S+u*z+c*B+p*O,r[13]=l*_+u*C+c*R+p*F,r[2]=d*w+m*A+f*I+y*E,r[6]=d*M+m*T+f*k+y*P,r[10]=d*S+m*z+f*B+y*O,r[14]=d*_+m*C+f*R+y*F,r[3]=g*w+x*A+b*I+v*E,r[7]=g*M+x*T+b*k+v*P,r[11]=g*S+x*z+b*B+v*O,r[15]=g*_+x*C+b*R+v*F,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],n=t[1],a=t[5],o=t[9],h=t[13],l=t[2],u=t[6],c=t[10],p=t[14],d=t[3];return d*(+r*o*u-s*h*u-r*a*c+i*h*c+s*a*p-i*o*p)+t[7]*(+e*o*p-e*h*c+r*n*c-s*n*p+s*h*l-r*o*l)+t[11]*(+e*h*u-e*a*p-r*n*u+i*n*p+r*a*l-i*h*l)+t[15]*(-s*a*l-e*o*u+e*a*c+s*n*u-i*n*c+i*o*l)}transpose(){let t;let 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],n=t[4],a=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],f=t[14],y=t[15],g=u*f*h-m*c*h+m*o*p-a*f*p-u*o*y+a*c*y,x=d*c*h-l*f*h-d*o*p+n*f*p+l*o*y-n*c*y,b=l*m*h-d*u*h+d*a*p-n*m*p-l*a*y+n*u*y,v=d*u*o-l*m*o-d*a*c+n*m*c+l*a*f-n*u*f,w=e*g+i*x+s*b+r*v;if(0===w)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let M=1/w;return t[0]=g*M,t[1]=(m*c*r-u*f*r-m*s*p+i*f*p+u*s*y-i*c*y)*M,t[2]=(a*f*r-m*o*r+m*s*h-i*f*h-a*s*y+i*o*y)*M,t[3]=(u*o*r-a*c*r-u*s*h+i*c*h+a*s*p-i*o*p)*M,t[4]=x*M,t[5]=(l*f*r-d*c*r+d*s*p-e*f*p-l*s*y+e*c*y)*M,t[6]=(d*o*r-n*f*r-d*s*h+e*f*h+n*s*y-e*o*y)*M,t[7]=(n*c*r-l*o*r+l*s*h-e*c*h-n*s*p+e*o*p)*M,t[8]=b*M,t[9]=(d*u*r-l*m*r-d*i*p+e*m*p+l*i*y-e*u*y)*M,t[10]=(n*m*r-d*a*r+d*i*h-e*m*h-n*i*y+e*a*y)*M,t[11]=(l*a*r-n*u*r-l*i*h+e*u*h+n*i*p-e*a*p)*M,t[12]=v*M,t[13]=(l*m*s-d*u*s+d*i*c-e*m*c-l*i*f+e*u*f)*M,t[14]=(d*a*s-n*m*s-d*i*o+e*m*o+n*i*f-e*a*f)*M,t[15]=(n*u*s-l*a*s+l*i*o-e*u*o-n*i*c+e*a*c)*M,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,n=t.x,a=t.y,o=t.z,h=r*n,l=r*a;return this.set(h*n+i,h*a-s*o,h*o+s*a,0,h*a+s*o,l*a+i,l*o-s*n,0,h*o-s*a,l*o+s*n,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,n){return this.set(1,i,r,0,t,1,n,0,e,s,1,0,0,0,0,1),this}compose(t,e,i){let s=this.elements,r=e._x,n=e._y,a=e._z,o=e._w,h=r+r,l=n+n,u=a+a,c=r*h,p=r*l,d=r*u,m=n*l,f=n*u,y=a*u,g=o*h,x=o*l,b=o*u,v=i.x,w=i.y,M=i.z;return s[0]=(1-(m+y))*v,s[1]=(p+b)*v,s[2]=(d-x)*v,s[3]=0,s[4]=(p-b)*w,s[5]=(1-(c+y))*w,s[6]=(f+g)*w,s[7]=0,s[8]=(d+x)*M,s[9]=(f-g)*M,s[10]=(1-(c+m))*M,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,r=sV.set(s[0],s[1],s[2]).length(),n=sV.set(s[4],s[5],s[6]).length(),a=sV.set(s[8],s[9],s[10]).length();0>this.determinant()&&(r=-r),t.x=s[12],t.y=s[13],t.z=s[14],sj.copy(this);let o=1/r,h=1/n,l=1/a;return sj.elements[0]*=o,sj.elements[1]*=o,sj.elements[2]*=o,sj.elements[4]*=h,sj.elements[5]*=h,sj.elements[6]*=h,sj.elements[8]*=l,sj.elements[9]*=l,sj.elements[10]*=l,e.setFromRotationMatrix(sj),i.x=r,i.y=n,i.z=a,this}makePerspective(t,e,i,s,r,n,a=iA){let o,h;let l=this.elements;if(a===iA)o=-(n+r)/(n-r),h=-2*n*r/(n-r);else if(a===iT)o=-n/(n-r),h=-n*r/(n-r);else throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=2*r/(e-t),l[4]=0,l[8]=(e+t)/(e-t),l[12]=0,l[1]=0,l[5]=2*r/(i-s),l[9]=(i+s)/(i-s),l[13]=0,l[2]=0,l[6]=0,l[10]=o,l[14]=h,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,i,s,r,n,a=iA){let o,h;let l=this.elements,u=1/(e-t),c=1/(i-s),p=1/(n-r);if(a===iA)o=(n+r)*p,h=-2*p;else if(a===iT)o=r*p,h=-1*p;else throw Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-((e+t)*u),l[1]=0,l[5]=2*c,l[9]=0,l[13]=-((i+s)*c),l[2]=0,l[6]=0,l[10]=h,l[14]=-o,l[3]=0,l[7]=0,l[11]=0,l[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 sV=new sh,sj=new sL,sU=new sh(0,0,0),sW=new sh(1,1,1),sD=new sh,sH=new sh,sq=new sh,sJ=new sL,sZ=new so;class sX{constructor(t=0,e=0,i=0,s=sX.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],n=s[4],a=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(iP(a,-1,1)),.9999999>Math.abs(a)?(this._x=Math.atan2(-l,p),this._z=Math.atan2(-n,r)):(this._x=Math.atan2(c,h),this._z=0);break;case"YXZ":this._x=Math.asin(-iP(l,-1,1)),.9999999>Math.abs(l)?(this._y=Math.atan2(a,p),this._z=Math.atan2(o,h)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(iP(c,-1,1)),.9999999>Math.abs(c)?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-n,h)):(this._y=0,this._z=Math.atan2(o,r));break;case"ZYX":this._y=Math.asin(-iP(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(-n,h));break;case"YZX":this._z=Math.asin(iP(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(a,p));break;case"XZY":this._z=Math.asin(-iP(n,-1,1)),.9999999>Math.abs(n)?(this._x=Math.atan2(c,h),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-l,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===i&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return sJ.makeRotationFromQuaternion(t),this.setFromRotationMatrix(sJ,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return sZ.setFromEuler(this),this.setFromQuaternion(sZ,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}}sX.DEFAULT_ORDER="XYZ";class sY{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!=0}isEnabled(t){return(this.mask&(1<<t|0))!=0}}let sG=0,s$=new sh,sQ=new so,sK=new sL,s0=new sh,s1=new sh,s2=new sh,s3=new so,s5=new sh(1,0,0),s4=new sh(0,1,0),s6=new sh(0,0,1),s7={type:"added"},s8={type:"removed"},s9={type:"childadded",child:null},rt={type:"childremoved",child:null};class re extends iC{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:sG++}),this.uuid=iE(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=re.DEFAULT_UP.clone();let t=new sh,e=new sX,i=new so,s=new sh(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 sL},normalMatrix:{value:new iU}}),this.matrix=new sL,this.matrixWorld=new sL,this.matrixAutoUpdate=re.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=re.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new sY,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}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 sQ.setFromAxisAngle(t,e),this.quaternion.multiply(sQ),this}rotateOnWorldAxis(t,e){return sQ.setFromAxisAngle(t,e),this.quaternion.premultiply(sQ),this}rotateX(t){return this.rotateOnAxis(s5,t)}rotateY(t){return this.rotateOnAxis(s4,t)}rotateZ(t){return this.rotateOnAxis(s6,t)}translateOnAxis(t,e){return s$.copy(t).applyQuaternion(this.quaternion),this.position.add(s$.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(s5,t)}translateY(t){return this.translateOnAxis(s4,t)}translateZ(t){return this.translateOnAxis(s6,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(sK.copy(this.matrixWorld).invert())}lookAt(t,e,i){t.isVector3?s0.copy(t):s0.set(t,e,i);let s=this.parent;this.updateWorldMatrix(!0,!1),s1.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?sK.lookAt(s1,s0,this.up):sK.lookAt(s0,s1,this.up),this.quaternion.setFromRotationMatrix(sK),s&&(sK.extractRotation(s.matrixWorld),sQ.setFromRotationMatrix(sK),this.quaternion.premultiply(sQ.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?console.error("THREE.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(s7),s9.child=t,this.dispatchEvent(s9),s9.child=null):console.error("THREE.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(s8),rt.child=t,this.dispatchEvent(rt),rt.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),sK.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),sK.multiply(t.parent.matrixWorld)),t.applyMatrix4(sK),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(s7),s9.child=t,this.dispatchEvent(s9),s9.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,n=s.length;r<n;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(s1,t,s2),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(s1,s3,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}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),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){let i=this.parent;if(!0===t&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),!0===e){let t=this.children;for(let e=0,i=t.length;e<i;e++)t[e].updateWorldMatrix(!1,!0)}}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.6,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,""!==this.name&&(s.name=this.name),!0===this.castShadow&&(s.castShadow=!0),!0===this.receiveShadow&&(s.receiveShadow=!0),!1===this.visible&&(s.visible=!1),!1===this.frustumCulled&&(s.frustumCulled=!1),0!==this.renderOrder&&(s.renderOrder=this.renderOrder),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(),!1===this.matrixAutoUpdate&&(s.matrixAutoUpdate=!1),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.visibility=this._visibility,s.active=this._active,s.bounds=this._bounds.map(t=>({boxInitialized:t.boxInitialized,boxMin:t.box.min.toArray(),boxMax:t.box.max.toArray(),sphereInitialized:t.sphereInitialized,sphereRadius:t.sphere.radius,sphereCenter:t.sphere.center.toArray()})),s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(t),null!==this._colorsTexture&&(s.colorsTexture=this._colorsTexture.toJSON(t)),null!==this.boundingSphere&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),null!==this.boundingBox&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()})),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=n(t.geometries),s=n(t.materials),r=n(t.textures),a=n(t.images),o=n(t.shapes),h=n(t.skeletons),l=n(t.animations),u=n(t.nodes);e.length>0&&(i.geometries=e),s.length>0&&(i.materials=s),r.length>0&&(i.textures=r),a.length>0&&(i.images=a),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 n(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.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.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}}re.DEFAULT_UP=new sh(0,1,0),re.DEFAULT_MATRIX_AUTO_UPDATE=!0,re.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;let ri=new sh,rs=new sh,rr=new sh,rn=new sh,ra=new sh,ro=new sh,rh=new sh,rl=new sh,ru=new sh,rc=new sh,rp=new st,rd=new st,rm=new st;class rf{constructor(t=new sh,e=new sh,i=new sh){this.a=t,this.b=e,this.c=i}static getNormal(t,e,i,s){s.subVectors(i,e),ri.subVectors(t,e),s.cross(ri);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){ri.subVectors(s,e),rs.subVectors(i,e),rr.subVectors(t,e);let n=ri.dot(ri),a=ri.dot(rs),o=ri.dot(rr),h=rs.dot(rs),l=rs.dot(rr),u=n*h-a*a;if(0===u)return r.set(0,0,0),null;let c=1/u,p=(h*o-a*l)*c,d=(n*l-a*o)*c;return r.set(1-p-d,d,p)}static containsPoint(t,e,i,s){return null!==this.getBarycoord(t,e,i,s,rn)&&rn.x>=0&&rn.y>=0&&rn.x+rn.y<=1}static getInterpolation(t,e,i,s,r,n,a,o){return null===this.getBarycoord(t,e,i,s,rn)?(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,rn.x),o.addScaledVector(n,rn.y),o.addScaledVector(a,rn.z),o)}static getInterpolatedAttribute(t,e,i,s,r,n){return rp.setScalar(0),rd.setScalar(0),rm.setScalar(0),rp.fromBufferAttribute(t,e),rd.fromBufferAttribute(t,i),rm.fromBufferAttribute(t,s),n.setScalar(0),n.addScaledVector(rp,r.x),n.addScaledVector(rd,r.y),n.addScaledVector(rm,r.z),n}static isFrontFacing(t,e,i,s){return ri.subVectors(i,e),rs.subVectors(t,e),0>ri.cross(rs).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 ri.subVectors(this.c,this.b),rs.subVectors(this.a,this.b),.5*ri.cross(rs).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return rf.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return rf.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,i,s,r){return rf.getInterpolation(t,this.a,this.b,this.c,e,i,s,r)}containsPoint(t){return rf.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return rf.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let i,s;let r=this.a,n=this.b,a=this.c;ra.subVectors(n,r),ro.subVectors(a,r),rl.subVectors(t,r);let o=ra.dot(rl),h=ro.dot(rl);if(o<=0&&h<=0)return e.copy(r);ru.subVectors(t,n);let l=ra.dot(ru),u=ro.dot(ru);if(l>=0&&u<=l)return e.copy(n);let c=o*u-l*h;if(c<=0&&o>=0&&l<=0)return i=o/(o-l),e.copy(r).addScaledVector(ra,i);rc.subVectors(t,a);let p=ra.dot(rc),d=ro.dot(rc);if(d>=0&&p<=d)return e.copy(a);let m=p*h-o*d;if(m<=0&&h>=0&&d<=0)return s=h/(h-d),e.copy(r).addScaledVector(ro,s);let f=l*d-p*u;if(f<=0&&u-l>=0&&p-d>=0)return rh.subVectors(a,n),s=(u-l)/(u-l+(p-d)),e.copy(n).addScaledVector(rh,s);let y=1/(f+m+c);return i=m*y,s=c*y,e.copy(r).addScaledVector(ra,i).addScaledVector(ro,s)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let ry={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},rg={h:0,s:0,l:0},rx={h:0,s:0,l:0};function rb(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 rv{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=eX){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,i1.toWorkingColorSpace(this,e),this}setRGB(t,e,i,s=i1.workingColorSpace){return this.r=t,this.g=e,this.b=i,i1.toWorkingColorSpace(this,s),this}setHSL(t,e,i,s=i1.workingColorSpace){if(t=iO(t,1),e=iP(e,0,1),i=iP(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=rb(r,s,t+1/3),this.g=rb(r,s,t),this.b=rb(r,s,t-1/3)}return i1.toWorkingColorSpace(this,s),this}setStyle(t,e=eX){let i;function s(e){void 0!==e&&1>parseFloat(e)&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;let n=i[1],a=i[2];switch(n){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))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(a))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(a))return s(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.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);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=eX){let i=ry[t.toLowerCase()];return void 0!==i?this.setHex(i,e):console.warn("THREE.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=i2(t.r),this.g=i2(t.g),this.b=i2(t.b),this}copyLinearToSRGB(t){return this.r=i3(t.r),this.g=i3(t.g),this.b=i3(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=eX){return i1.fromWorkingColorSpace(rw.copy(this),t),65536*Math.round(iP(255*rw.r,0,255))+256*Math.round(iP(255*rw.g,0,255))+Math.round(iP(255*rw.b,0,255))}getHexString(t=eX){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=i1.workingColorSpace){let i,s;i1.fromWorkingColorSpace(rw.copy(this),e);let r=rw.r,n=rw.g,a=rw.b,o=Math.max(r,n,a),h=Math.min(r,n,a),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=(n-a)/t+(n<a?6:0);break;case n:i=(a-r)/t+2;break;case a:i=(r-n)/t+4}i/=6}return t.h=i,t.s=s,t.l=l,t}getRGB(t,e=i1.workingColorSpace){return i1.fromWorkingColorSpace(rw.copy(this),e),t.r=rw.r,t.g=rw.g,t.b=rw.b,t}getStyle(t=eX){i1.fromWorkingColorSpace(rw.copy(this),t);let e=rw.r,i=rw.g,s=rw.b;return t!==eX?`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(rg),this.setHSL(rg.h+t,rg.s+e,rg.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(rg),t.getHSL(rx);let i=iF(rg.h,rx.h,e),s=iF(rg.s,rx.s,e),r=iF(rg.l,rx.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 rw=new rv;rv.NAMES=ry;let rM=0;class rS extends iC{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:rM++}),this.uuid=iE(),this.name="",this.type="Material",this.blending=S,this.side=b,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=N,this.blendDst=L,this.blendEquation=C,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new rv(0,0,0),this.blendAlpha=0,this.depthFunc=$,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=is,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=eK,this.stencilZFail=eK,this.stencilZPass=eK,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.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){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}let s=this[e];if(void 0===s){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(i):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.6,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,""!==this.name&&(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&&1!==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()),void 0!==this.dispersion&&(i.dispersion=this.dispersion),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&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==S&&(i.blending=this.blending),this.side!==b&&(i.side=this.side),!0===this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=!0),this.blendSrc!==N&&(i.blendSrc=this.blendSrc),this.blendDst!==L&&(i.blendDst=this.blendDst),this.blendEquation!==C&&(i.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(i.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(i.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==$&&(i.depthFunc=this.depthFunc),!1===this.depthTest&&(i.depthTest=this.depthTest),!1===this.depthWrite&&(i.depthWrite=this.depthWrite),!1===this.colorWrite&&(i.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==is&&(i.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(i.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==eK&&(i.stencilFail=this.stencilFail),this.stencilZFail!==eK&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==eK&&(i.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(i.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaHash&&(i.alphaHash=!0),!0===this.alphaToCoverage&&(i.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=!0),!0===this.forceSinglePass&&(i.forceSinglePass=!0),!0===this.wireframe&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=!0),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),!1===this.fog&&(i.fog=!1),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}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.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++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class r_ extends rS{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new rv(16777215),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 sX,this.combine=ti,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 rA=function(){let t=new ArrayBuffer(4),e=new Float32Array(t),i=new Uint32Array(t),s=new Uint32Array(512),r=new Uint32Array(512);for(let t=0;t<256;++t){let e=t-127;e<-27?(s[t]=0,s[256|t]=32768,r[t]=24,r[256|t]=24):e<-14?(s[t]=1024>>-e-14,s[256|t]=1024>>-e-14|32768,r[t]=-e-1,r[256|t]=-e-1):e<=15?(s[t]=e+15<<10,s[256|t]=e+15<<10|32768,r[t]=13,r[256|t]=13):e<128?(s[t]=31744,s[256|t]=64512,r[t]=24,r[256|t]=24):(s[t]=31744,s[256|t]=64512,r[t]=13,r[256|t]=13)}let n=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let t=1;t<1024;++t){let e=t<<13,i=0;for(;(8388608&e)==0;)e<<=1,i-=8388608;e&=-8388609,i+=947912704,n[t]=e|i}for(let t=1024;t<2048;++t)n[t]=939524096+(t-1024<<13);for(let t=1;t<31;++t)a[t]=t<<23;a[31]=1199570944,a[32]=2147483648;for(let t=33;t<63;++t)a[t]=2147483648+(t-32<<23);a[63]=3347054592;for(let t=1;t<64;++t)32!==t&&(o[t]=1024);return{floatView:e,uint32View:i,baseTable:s,shiftTable:r,mantissaTable:n,exponentTable:a,offsetTable:o}}();function rT(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=iP(t,-65504,65504),rA.floatView[0]=t;let e=rA.uint32View[0],i=e>>23&511;return rA.baseTable[i]+((8388607&e)>>rA.shiftTable[i])}function rz(t){let e=t>>10;return rA.uint32View[0]=rA.mantissaTable[rA.offsetTable[e]+(1023&t)]+rA.exponentTable[e],rA.floatView[0]}let rC={toHalfFloat:rT,fromHalfFloat:rz},rI=new sh,rk=new ij,rB=0;class rR{constructor(t,e,i=!1){if(Array.isArray(t))throw TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:rB++}),this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=i,this.usage=id,this.updateRanges=[],this.gpuType=tj,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++)rk.fromBufferAttribute(this,e),rk.applyMatrix3(t),this.setXY(e,rk.x,rk.y);else if(3===this.itemSize)for(let e=0,i=this.count;e<i;e++)rI.fromBufferAttribute(this,e),rI.applyMatrix3(t),this.setXYZ(e,rI.x,rI.y,rI.z);return this}applyMatrix4(t){for(let e=0,i=this.count;e<i;e++)rI.fromBufferAttribute(this,e),rI.applyMatrix4(t),this.setXYZ(e,rI.x,rI.y,rI.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)rI.fromBufferAttribute(this,e),rI.applyNormalMatrix(t),this.setXYZ(e,rI.x,rI.y,rI.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)rI.fromBufferAttribute(this,e),rI.transformDirection(t),this.setXYZ(e,rI.x,rI.y,rI.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=iN(i,this.array)),i}setComponent(t,e,i){return this.normalized&&(i=iL(i,this.array)),this.array[t*this.itemSize+e]=i,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=iN(e,this.array)),e}setX(t,e){return this.normalized&&(e=iL(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=iN(e,this.array)),e}setY(t,e){return this.normalized&&(e=iL(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=iN(e,this.array)),e}setZ(t,e){return this.normalized&&(e=iL(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=iN(e,this.array)),e}setW(t,e){return this.normalized&&(e=iL(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,i){return t*=this.itemSize,this.normalized&&(e=iL(e,this.array),i=iL(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=iL(e,this.array),i=iL(i,this.array),s=iL(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=iL(e,this.array),i=iL(i,this.array),s=iL(s,this.array),r=iL(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""!==this.name&&(t.name=this.name),this.usage!==id&&(t.usage=this.usage),t}}class rE extends rR{constructor(t,e,i){super(new Int8Array(t),e,i)}}class rP extends rR{constructor(t,e,i){super(new Uint8Array(t),e,i)}}class rO extends rR{constructor(t,e,i){super(new Uint8ClampedArray(t),e,i)}}class rF extends rR{constructor(t,e,i){super(new Int16Array(t),e,i)}}class rN extends rR{constructor(t,e,i){super(new Uint16Array(t),e,i)}}class rL extends rR{constructor(t,e,i){super(new Int32Array(t),e,i)}}class rV extends rR{constructor(t,e,i){super(new Uint32Array(t),e,i)}}class rj extends rR{constructor(t,e,i){super(new Uint16Array(t),e,i),this.isFloat16BufferAttribute=!0}getX(t){let e=rz(this.array[t*this.itemSize]);return this.normalized&&(e=iN(e,this.array)),e}setX(t,e){return this.normalized&&(e=iL(e,this.array)),this.array[t*this.itemSize]=rT(e),this}getY(t){let e=rz(this.array[t*this.itemSize+1]);return this.normalized&&(e=iN(e,this.array)),e}setY(t,e){return this.normalized&&(e=iL(e,this.array)),this.array[t*this.itemSize+1]=rT(e),this}getZ(t){let e=rz(this.array[t*this.itemSize+2]);return this.normalized&&(e=iN(e,this.array)),e}setZ(t,e){return this.normalized&&(e=iL(e,this.array)),this.array[t*this.itemSize+2]=rT(e),this}getW(t){let e=rz(this.array[t*this.itemSize+3]);return this.normalized&&(e=iN(e,this.array)),e}setW(t,e){return this.normalized&&(e=iL(e,this.array)),this.array[t*this.itemSize+3]=rT(e),this}setXY(t,e,i){return t*=this.itemSize,this.normalized&&(e=iL(e,this.array),i=iL(i,this.array)),this.array[t+0]=rT(e),this.array[t+1]=rT(i),this}setXYZ(t,e,i,s){return t*=this.itemSize,this.normalized&&(e=iL(e,this.array),i=iL(i,this.array),s=iL(s,this.array)),this.array[t+0]=rT(e),this.array[t+1]=rT(i),this.array[t+2]=rT(s),this}setXYZW(t,e,i,s,r){return t*=this.itemSize,this.normalized&&(e=iL(e,this.array),i=iL(i,this.array),s=iL(s,this.array),r=iL(r,this.array)),this.array[t+0]=rT(e),this.array[t+1]=rT(i),this.array[t+2]=rT(s),this.array[t+3]=rT(r),this}}class rU extends rR{constructor(t,e,i){super(new Float32Array(t),e,i)}}let rW=0,rD=new sL,rH=new re,rq=new sh,rJ=new sc,rZ=new sc,rX=new sh;class rY extends iC{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:rW++}),this.uuid=iE(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(iD(t)?rV:rN)(t,1):this.index=t,this}setIndirect(t){return this.indirect=t,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 iU().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}applyQuaternion(t){return rD.makeRotationFromQuaternion(t),this.applyMatrix4(rD),this}rotateX(t){return rD.makeRotationX(t),this.applyMatrix4(rD),this}rotateY(t){return rD.makeRotationY(t),this.applyMatrix4(rD),this}rotateZ(t){return rD.makeRotationZ(t),this.applyMatrix4(rD),this}translate(t,e,i){return rD.makeTranslation(t,e,i),this.applyMatrix4(rD),this}scale(t,e,i){return rD.makeScale(t,e,i),this.applyMatrix4(rD),this}lookAt(t){return rH.lookAt(t),rH.updateMatrix(),this.applyMatrix4(rH.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(rq).negate(),this.translate(rq.x,rq.y,rq.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 rU(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&&console.warn("THREE.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 sc);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new sh(-1/0,-1/0,-1/0),new sh(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];rJ.setFromBufferAttribute(i),this.morphTargetsRelative?(rX.addVectors(this.boundingBox.min,rJ.min),this.boundingBox.expandByPoint(rX),rX.addVectors(this.boundingBox.max,rJ.max),this.boundingBox.expandByPoint(rX)):(this.boundingBox.expandByPoint(rJ.min),this.boundingBox.expandByPoint(rJ.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.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 sI);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new sh,1/0);return}if(t){let i=this.boundingSphere.center;if(rJ.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){let i=e[t];rZ.setFromBufferAttribute(i),this.morphTargetsRelative?(rX.addVectors(rJ.min,rZ.min),rJ.expandByPoint(rX),rX.addVectors(rJ.max,rZ.max),rJ.expandByPoint(rX)):(rJ.expandByPoint(rZ.min),rJ.expandByPoint(rZ.max))}rJ.getCenter(i);let s=0;for(let e=0,r=t.count;e<r;e++)rX.fromBufferAttribute(t,e),s=Math.max(s,i.distanceToSquared(rX));if(e)for(let r=0,n=e.length;r<n;r++){let n=e[r],a=this.morphTargetsRelative;for(let e=0,r=n.count;e<r;e++)rX.fromBufferAttribute(n,e),a&&(rq.fromBufferAttribute(t,e),rX.add(rq)),s=Math.max(s,i.distanceToSquared(rX))}this.boundingSphere.radius=Math.sqrt(s),isNaN(this.boundingSphere.radius)&&console.error('THREE.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){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}let i=e.position,s=e.normal,r=e.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new rR(new Float32Array(4*i.count),4));let n=this.getAttribute("tangent"),a=[],o=[];for(let t=0;t<i.count;t++)a[t]=new sh,o[t]=new sh;let h=new sh,l=new sh,u=new sh,c=new ij,p=new ij,d=new ij,m=new sh,f=new sh,y=this.groups;0===y.length&&(y=[{start:0,count:t.count}]);for(let e=0,s=y.length;e<s;++e){let s=y[e],n=s.start,g=s.count;for(let e=n,s=n+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 n=1/(p.x*d.y-d.x*p.y);isFinite(n)&&(m.copy(l).multiplyScalar(d.y).addScaledVector(u,-p.y).multiplyScalar(n),f.copy(u).multiplyScalar(p.x).addScaledVector(l,-d.x).multiplyScalar(n),a[t].add(m),a[e].add(m),a[s].add(m),o[t].add(f),o[e].add(f),o[s].add(f))}(t.getX(e+0),t.getX(e+1),t.getX(e+2))}let g=new sh,x=new sh,b=new sh,v=new sh;function w(t){b.fromBufferAttribute(s,t),v.copy(b);let e=a[t];g.copy(e),g.sub(b.multiplyScalar(b.dot(e))).normalize(),x.crossVectors(v,e);let i=x.dot(o[t]);n.setXYZW(t,g.x,g.y,g.z,i<0?-1:1)}for(let e=0,i=y.length;e<i;++e){let i=y[e],s=i.start,r=i.count;for(let e=s,i=s+r;e<i;e+=3)w(t.getX(e+0)),w(t.getX(e+1)),w(t.getX(e+2))}}computeVertexNormals(){let t=this.index,e=this.getAttribute("position");if(void 0!==e){let i=this.getAttribute("normal");if(void 0===i)i=new rR(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 sh,r=new sh,n=new sh,a=new sh,o=new sh,h=new sh,l=new sh,u=new sh;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),n.fromBufferAttribute(e,m),l.subVectors(n,r),u.subVectors(s,r),l.cross(u),a.fromBufferAttribute(i,p),o.fromBufferAttribute(i,d),h.fromBufferAttribute(i,m),a.add(l),o.add(l),h.add(l),i.setXYZ(p,a.x,a.y,a.z),i.setXYZ(d,o.x,o.y,o.z),i.setXYZ(m,h.x,h.y,h.z)}else for(let t=0,a=e.count;t<a;t+=3)s.fromBufferAttribute(e,t+0),r.fromBufferAttribute(e,t+1),n.fromBufferAttribute(e,t+2),l.subVectors(n,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++)rX.fromBufferAttribute(t,e),rX.normalize(),t.setXYZ(e,rX.x,rX.y,rX.z)}toNonIndexed(){function t(t,e){let i=t.array,s=t.itemSize,r=t.normalized,n=new i.constructor(e.length*s),a=0,o=0;for(let r=0,h=e.length;r<h;r++){a=t.isInterleavedBufferAttribute?e[r]*t.data.stride+t.offset:e[r]*s;for(let t=0;t<s;t++)n[o++]=i[a++]}return new rR(n,s,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let e=new rY,i=this.index.array,s=this.attributes;for(let r in s){let n=t(s[r],i);e.setAttribute(r,n)}let r=this.morphAttributes;for(let s in r){let n=[],a=r[s];for(let e=0,s=a.length;e<s;e++){let s=t(a[e],i);n.push(s)}e.morphAttributes[s]=n}e.morphTargetsRelative=this.morphTargetsRelative;let n=this.groups;for(let t=0,i=n.length;t<i;t++){let i=n[t];e.addGroup(i.start,i.count,i.materialIndex)}return e}toJSON(){let t={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){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],n=[];for(let e=0,s=i.length;e<s;e++){let s=i[e];n.push(s.toJSON(t.data))}n.length>0&&(s[e]=n,r=!0)}r&&(t.data.morphAttributes=s,t.data.morphTargetsRelative=this.morphTargetsRelative);let n=this.groups;n.length>0&&(t.data.groups=JSON.parse(JSON.stringify(n)));let a=this.boundingSphere;return null!==a&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),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(e));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 n=t.groups;for(let t=0,e=n.length;t<e;t++){let e=n[t];this.addGroup(e.start,e.count,e.materialIndex)}let a=t.boundingBox;null!==a&&(this.boundingBox=a.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}dispose(){this.dispatchEvent({type:"dispose"})}}let rG=new sL,r$=new sN,rQ=new sI,rK=new sh,r0=new sh,r1=new sh,r2=new sh,r3=new sh,r5=new sh,r4=new sh,r6=new sh;class r7 extends re{constructor(t=new rY,e=new r_){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,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,n=i.morphTargetsRelative;e.fromBufferAttribute(s,t);let a=this.morphTargetInfluences;if(r&&a){r5.set(0,0,0);for(let i=0,s=r.length;i<s;i++){let s=a[i],o=r[i];0!==s&&(r3.fromBufferAttribute(o,t),n?r5.addScaledVector(r3,s):r5.addScaledVector(r3.sub(e),s))}e.add(r5)}return e}raycast(t,e){let i=this.geometry,s=this.material,r=this.matrixWorld;if(void 0!==s){if(null===i.boundingSphere&&i.computeBoundingSphere(),rQ.copy(i.boundingSphere),rQ.applyMatrix4(r),r$.copy(t.ray).recast(t.near),!1===rQ.containsPoint(r$.origin)&&(null===r$.intersectSphere(rQ,rK)||r$.origin.distanceToSquared(rK)>(t.far-t.near)**2)||(rG.copy(r).invert(),r$.copy(t.ray).applyMatrix4(rG),null!==i.boundingBox&&!1===r$.intersectsBox(i.boundingBox)))return;this._computeIntersections(t,e,r$)}}_computeIntersections(t,e,i){let s;let r=this.geometry,n=this.material,a=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!==a){if(Array.isArray(n))for(let r=0,o=c.length;r<o;r++){let o=c[r],d=n[o.materialIndex],m=Math.max(o.start,p.start),f=Math.min(a.count,Math.min(o.start+o.count,p.start+p.count));for(let r=m;r<f;r+=3)(s=r8(this,d,t,i,h,l,u,a.getX(r),a.getX(r+1),a.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(a.count,p.start+p.count);for(let c=r;c<o;c+=3)(s=r8(this,n,t,i,h,l,u,a.getX(c),a.getX(c+1),a.getX(c+2)))&&(s.faceIndex=Math.floor(c/3),e.push(s))}}else if(void 0!==o){if(Array.isArray(n))for(let r=0,a=c.length;r<a;r++){let a=c[r],d=n[a.materialIndex],m=Math.max(a.start,p.start),f=Math.min(o.count,Math.min(a.start+a.count,p.start+p.count));for(let r=m;r<f;r+=3)(s=r8(this,d,t,i,h,l,u,r,r+1,r+2))&&(s.faceIndex=Math.floor(r/3),s.face.materialIndex=a.materialIndex,e.push(s))}else{let r=Math.max(0,p.start),a=Math.min(o.count,p.start+p.count);for(let o=r;o<a;o+=3)(s=r8(this,n,t,i,h,l,u,o,o+1,o+2))&&(s.faceIndex=Math.floor(o/3),e.push(s))}}}}function r8(t,e,i,s,r,n,a,o,h,l){t.getVertexPosition(o,r0),t.getVertexPosition(h,r1),t.getVertexPosition(l,r2);let u=function(t,e,i,s,r,n,a,o){if(null===(e.side===v?s.intersectTriangle(a,n,r,!0,o):s.intersectTriangle(r,n,a,e.side===b,o)))return null;r6.copy(o),r6.applyMatrix4(t.matrixWorld);let h=i.ray.origin.distanceTo(r6);return h<i.near||h>i.far?null:{distance:h,point:r6.clone(),object:t}}(t,e,i,s,r0,r1,r2,r4);if(u){let t=new sh;rf.getBarycoord(r4,r0,r1,r2,t),r&&(u.uv=rf.getInterpolatedAttribute(r,o,h,l,t,new ij)),n&&(u.uv1=rf.getInterpolatedAttribute(n,o,h,l,t,new ij)),a&&(u.normal=rf.getInterpolatedAttribute(a,o,h,l,t,new sh),u.normal.dot(s.direction)>0&&u.normal.multiplyScalar(-1));let e={a:o,b:h,c:l,normal:new sh,materialIndex:0};rf.getNormal(r0,r1,r2,e.normal),u.face=e,u.barycoord=t}return u}class r9 extends rY{constructor(t=1,e=1,i=1,s=1,r=1,n=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:s,heightSegments:r,depthSegments:n};let a=this;s=Math.floor(s),r=Math.floor(r);let o=[],h=[],l=[],u=[],c=0,p=0;function d(t,e,i,s,r,n,d,m,f,y,g){let x=n/f,b=d/y,v=n/2,w=d/2,M=m/2,S=f+1,_=y+1,A=0,T=0,z=new sh;for(let n=0;n<_;n++){let a=n*b-w;for(let o=0;o<S;o++){let c=o*x-v;z[t]=c*s,z[e]=a*r,z[i]=M,h.push(z.x,z.y,z.z),z[t]=0,z[e]=0,z[i]=m>0?1:-1,l.push(z.x,z.y,z.z),u.push(o/f),u.push(1-n/y),A+=1}}for(let t=0;t<y;t++)for(let e=0;e<f;e++){let i=c+e+S*t,s=c+e+S*(t+1),r=c+(e+1)+S*(t+1),n=c+(e+1)+S*t;o.push(i,s,n),o.push(s,r,n),T+=6}a.addGroup(p,T,g),p+=T,c+=A}d("z","y","x",-1,-1,i,e,t,n=Math.floor(n),r,0),d("z","y","x",1,-1,i,e,-t,n,r,1),d("x","z","y",1,1,t,i,e,s,n,2),d("x","z","y",1,-1,t,i,-e,s,n,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 rU(h,3)),this.setAttribute("normal",new rU(l,3)),this.setAttribute("uv",new rU(u,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new r9(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function nt(t){let e={};for(let i in t)for(let s in e[i]={},t[i]){let r=t[i][s];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[i][s]=null):e[i][s]=r.clone():Array.isArray(r)?e[i][s]=r.slice():e[i][s]=r}return e}function ne(t){let e={};for(let i=0;i<t.length;i++){let s=nt(t[i]);for(let t in s)e[t]=s[t]}return e}function ni(t){let e=t.getRenderTarget();return null===e?t.outputColorSpace:!0===e.isXRRenderTarget?e.texture.colorSpace:i1.workingColorSpace}let ns={clone:nt,merge:ne};class nr extends rS{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=nt(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}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}}class nn extends re{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new sL,this.projectionMatrix=new sL,this.projectionMatrixInverse=new sL,this.coordinateSystem=iA}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.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}let na=new sh,no=new ij,nh=new ij;class nl extends nn{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*iR*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){let t=Math.tan(.5*iB*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*iR*Math.atan(Math.tan(.5*iB*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){na.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(na.x,na.y).multiplyScalar(-t/na.z),na.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(na.x,na.y).multiplyScalar(-t/na.z)}getViewSize(t,e){return this.getViewBounds(t,no,nh),e.subVectors(nh,no)}setViewOffset(t,e,i,s,r,n){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=n,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=this.near,e=t*Math.tan(.5*iB*this.fov)/this.zoom,i=2*e,s=this.aspect*i,r=-.5*s,n=this.view;if(null!==this.view&&this.view.enabled){let t=n.fullWidth,a=n.fullHeight;r+=n.offsetX*s/t,e-=n.offsetY*i/a,s*=n.width/t,i*=n.height/a}let a=this.filmOffset;0!==a&&(r+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,e,e-i,t,this.far,this.coordinateSystem),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 nu extends re{constructor(t,e,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;let s=new nl(-90,1,t,e);s.layers=this.layers,this.add(s);let r=new nl(-90,1,t,e);r.layers=this.layers,this.add(r);let n=new nl(-90,1,t,e);n.layers=this.layers,this.add(n);let a=new nl(-90,1,t,e);a.layers=this.layers,this.add(a);let o=new nl(-90,1,t,e);o.layers=this.layers,this.add(o);let h=new nl(-90,1,t,e);h.layers=this.layers,this.add(h)}updateCoordinateSystem(){let t=this.coordinateSystem,e=this.children.concat(),[i,s,r,n,a,o]=e;for(let t of e)this.remove(t);if(t===iA)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),n.up.set(0,0,1),n.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else if(t===iT)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),n.up.set(0,0,-1),n.lookAt(0,-1,0),a.up.set(0,-1,0),a.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,n,a,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,t.setRenderTarget(i,0,s),t.render(e,r),t.setRenderTarget(i,1,s),t.render(e,n),t.setRenderTarget(i,2,s),t.render(e,a),t.setRenderTarget(i,3,s),t.render(e,o),t.setRenderTarget(i,4,s),t.render(e,h),i.texture.generateMipmaps=m,t.setRenderTarget(i,5,s),t.render(e,l),t.setRenderTarget(u,c,p),t.xr.enabled=d,i.texture.needsPMREMUpdate=!0}}class nc extends i9{constructor(t,e,i,s,r,n,a,o,h,l){super(t=void 0!==t?t:[],e=void 0!==e?e:ty,i,s,r,n,a,o,h,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class np extends si{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;let i={width:t,height:t,depth:1};this.texture=new nc([i,i,i,i,i,i],e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:tI}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;let i={uniforms:{tEquirect:{value:null}},vertexShader:`
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5870],{2079:function(t,e,i){let s,r,n,a,o;i.d(e,{$TI:function(){return lD},$V:function(){return lY},$YQ:function(){return aQ},$wi:function(){return td},A5E:function(){return rC},ACn:function(){return se},AXT:function(){return oe},B02:function(){return m},BFQ:function(){return t6},BG$:function(){return ec},BVF:function(){return X},BVQ:function(){return op},BbS:function(){return lg},Bf4:function(){return tb},Bgp:function(){return tc},BtG:function(){return nc},CJI:function(){return rf},CaW:function(){return ei},CdI:function(){return to},CtA:function(){return t2},CtF:function(){return hA},Cy:function(){return q},D1R:function(){return tR},D67:function(){return ia},D9w:function(){return t0},Djp:function(){return eu},DqL:function(){return hE},DvJ:function(){return r9},E2K:function(){return t5},EB7:function(){return aX},EJi:function(){return o7},EcG:function(){return uS},EoG:function(){return ta},F1y:function(){return io},F5G:function(){return t3},F5T:function(){return rS},FDw:function(){return tE},FE5:function(){return oK},FIo:function(){return o4},FM8:function(){return ij},FT0:function(){return hn},FUD:function(){return eg},FvO:function(){return l5},GG6:function(){return ef},GQ:function(){return uy},GUF:function(){return eY},GVz:function(){return sr},Gih:function(){return ey},Gql:function(){return h8},H$k:function(){return o$},H7L:function(){return iD},HTd:function(){return tT},HdW:function(){return eS},HgB:function(){return iv},HkE:function(){return ll},Hmr:function(){return ls},Hw6:function(){return i6},Hy8:function(){return j},Hyl:function(){return aK},I3e:function(){return iR},IEO:function(){return n$},IFH:function(){return eF},IKL:function(){return o9},ILR:function(){return t8},IOt:function(){return eq},Ilk:function(){return rv},Ir4:function(){return ib},JCZ:function(){return iT},JOQ:function(){return as},JQ4:function(){return tV},JUT:function(){return sn},JWc:function(){return ig},Jjb:function(){return ic},KI_:function(){return eX},Kgo:function(){return og},KhW:function(){return O},Kj0:function(){return r7},Kz5:function(){return tL},L5s:function(){return h6},LBq:function(){return lG},LSk:function(){return i_},LY2:function(){return tl},LgZ:function(){return L},LsT:function(){return tN},Ltg:function(){return st},Lun:function(){return hs},M$G:function(){return ih},M5h:function(){return T},M6v:function(){return te},M8C:function(){return iV},Mig:function(){return h0},MyG:function(){return e6},N$j:function(){return nG},N4l:function(){return A},NDo:function(){return tr},NKc:function(){return Z},NMF:function(){return eB},NYV:function(){return ep},NiX:function(){return nf},Ns1:function(){return ti},NwF:function(){return hM},Ny0:function(){return a0},O4K:function(){return iY},O5A:function(){return iZ},O78:function(){return iu},O7d:function(){return oD},OAl:function(){return it},ORg:function(){return tp},OTo:function(){return tJ},Oau:function(){return u_},OdW:function(){return n0},OoA:function(){return tS},Ox3:function(){return hK},PA7:function(){return eJ},PMe:function(){return hq},Pa4:function(){return sh},PeU:function(){return c},Pnf:function(){return eE},PpQ:function(){return i5},PzK:function(){return eH},QM0:function(){return ix},QO2:function(){return eM},QRU:function(){return li},QZ1:function(){return iy},Qey:function(){return iG},QmN:function(){return u},Qpg:function(){return us},R2R:function(){return hx},RNb:function(){return rE},ROQ:function(){return a$},RSm:function(){return ht},Rhp:function(){return ne},Rki:function(){return up},RlZ:function(){return D},RsA:function(){return l},RvT:function(){return ie},S2y:function(){return d},S3k:function(){return hP},S9g:function(){return sY},SJI:function(){return ly},SPe:function(){return n9},SUY:function(){return lu},Se2:function(){return Y},Sm8:function(){return R},SvJ:function(){return eb},Syv:function(){return ek},T6w:function(){return ip},T95:function(){return tO},TOt:function(){return oM},TUj:function(){return lK},TUv:function(){return nY},T_1:function(){return uw},T_J:function(){return e5},T__:function(){return a1},T_f:function(){return h1},TlE:function(){return rR},Tme:function(){return re},Tn7:function(){return o5},TyD:function(){return t_},U7:function(){return or},UCm:function(){return tZ},USm:function(){return sX},UY4:function(){return aL},UZH:function(){return h},UcC:function(){return l$},Uk6:function(){return o1},UlW:function(){return eV},Uol:function(){return oy},V1s:function(){return nn},VLJ:function(){return ur},VYz:function(){return lM},Vdb:function(){return U},Vkp:function(){return iU},VzW:function(){return tj},W2J:function(){return id},WMw:function(){return _},WTc:function(){return rP},WXh:function(){return o0},Wbm:function(){return I},Wid:function(){return o6},Wl3:function(){return b},Wpd:function(){return W},Wqd:function(){return ol},WwZ:function(){return eL},Wzm:function(){return aZ},Xaj:function(){return z},Xcj:function(){return lN},XvJ:function(){return oQ},Y8D:function(){return tY},YBo:function(){return he},YGz:function(){return th},YKA:function(){return eC},YLQ:function(){return tA},YT8:function(){return a7},Ywn:function(){return sa},Z6B:function(){return iM},ZAu:function(){return nd},ZQ6:function(){return on},ZRs:function(){return e1},ZTh:function(){return eA},ZXd:function(){return uM},ZZA:function(){return hc},Z_g:function(){return aY},Zen:function(){return il},Zp0:function(){return h4},Zr5:function(){return G},ZzF:function(){return sc},Zzh:function(){return l2},_12:function(){return oZ},_7h:function(){return eD},_AM:function(){return t9},_C8:function(){return hp},_Li:function(){return v},_MY:function(){return f},_RZ:function(){return iA},_YM:function(){return hg},_YX:function(){return l8},_am:function(){return nu},_fP:function(){return so},_iA:function(){return y},_kC:function(){return hL},_lf:function(){return eP},_sL:function(){return eO},_wr:function(){return H},a$l:function(){return rU},aCh:function(){return eZ},aH4:function(){return tz},aLr:function(){return sI},aNw:function(){return hC},aVm:function(){return rF},ad5:function(){return eQ},aq0:function(){return un},av9:function(){return t1},bBp:function(){return lO},bGH:function(){return C},b_z:function(){return of},bdR:function(){return S},blk:function(){return aN},bnF:function(){return oS},brP:function(){return tQ},bsb:function(){return ev},c8b:function(){return E},cBI:function(){return ul},cBK:function(){return hO},cJO:function(){return oq},cLu:function(){return tU},cPb:function(){return nl},cRx:function(){return tG},cU9:function(){return hf},cac:function(){return iJ},ce8:function(){return e0},cek:function(){return hG},cum:function(){return is},dSO:function(){return tx},dUE:function(){return hb},dYG:function(){return hd},dZ3:function(){return tu},dd2:function(){return si},dj0:function(){return im},dpR:function(){return hN},dwf:function(){return nt},dwk:function(){return x},e62:function(){return rj},eD:function(){return Q},eMJ:function(){return e4},eS_:function(){return iz},eaV:function(){return ee},ehD:function(){return w},ejS:function(){return aF},ekQ:function(){return en},epp:function(){return i1},f2y:function(){return ew},fHI:function(){return om},fO1:function(){return aq},fQA:function(){return uf},fSK:function(){return V},fY$:function(){return ty},fto:function(){return es},g8_:function(){return tv},gH0:function(){return lW},gSk:function(){return eN},g_z:function(){return os},ghN:function(){return P},gi4:function(){return el},gti:function(){return oo},hEm:function(){return tK},hH6:function(){return hB},iAb:function(){return tF},iDF:function(){return oj},iKG:function(){return h$},iLg:function(){return hw},iMs:function(){return lJ},iUV:function(){return lE},iWC:function(){return F},iWj:function(){return aa},iiP:function(){return ex},irR:function(){return tD},j17:function(){return e$},j4z:function(){return ii},j87:function(){return rL},jAl:function(){return ez},jFi:function(){return M},jZA:function(){return eo},jes:function(){return J},jfJ:function(){return e2},jwo:function(){return e8},jyi:function(){return nO},jyz:function(){return nr},k0A:function(){return tW},k74:function(){return N},kB5:function(){return nw},kaV:function(){return hr},kqm:function(){return lS},ksN:function(){return K},l0P:function(){return er},l6D:function(){return eG},l8J:function(){return iw},lCJ:function(){return rV},lDi:function(){return h2},lGU:function(){return eT},lLk:function(){return hT},lRF:function(){return hi},lRj:function(){return tB},lb7:function(){return n1},lfu:function(){return hm},lk7:function(){return h3},m7l:function(){return h_},mSO:function(){return eW},mTL:function(){return lr},mXe:function(){return oa},msZ:function(){return tm},mzJ:function(){return lP},nls:function(){return a_},ntZ:function(){return g},o8S:function(){return oX},oAp:function(){return np},oDz:function(){return ni},oa8:function(){return oY},oqc:function(){return e3},p3g:function(){return ss},p7y:function(){return oc},pBf:function(){return iC},pIN:function(){return eR},pKu:function(){return em},pQR:function(){return oJ},ppL:function(){return lL},ptH:function(){return ea},qVC:function(){return aG},qhX:function(){return ts},qkB:function(){return t$},qlB:function(){return rN},qyh:function(){return tk},rAo:function(){return rO},rDY:function(){return ns},rOj:function(){return k},r_:function(){return B},rpg:function(){return tw},s4_:function(){return h7},sYA:function(){return hR},tEQ:function(){return hz},tGC:function(){return ub},tJx:function(){return ug},tNt:function(){return i$},tQZ:function(){return tq},tUh:function(){return hy},tf:function(){return l_},tm_:function(){return p},u37:function(){return lh},u7G:function(){return h5},u9r:function(){return rY},uEv:function(){return eI},uL9:function(){return tn},uWy:function(){return tM},uXU:function(){return e7},v2s:function(){return aJ},v3W:function(){return t7},v9Y:function(){return iS},vBJ:function(){return r_},vCF:function(){return $},vCx:function(){return et},vZf:function(){return tC},vmT:function(){return hV},vpT:function(){return nb},vuL:function(){return e_},vxC:function(){return tg},w$m:function(){return tt},wJv:function(){return tH},wem:function(){return tI},wk1:function(){return tX},woe:function(){return aD},wuA:function(){return t4},x12:function(){return aR},x5V:function(){return eK},xEZ:function(){return i9},xG9:function(){return l9},xJs:function(){return ed},xTL:function(){return lV},xWb:function(){return lj},xeV:function(){return nM},xfE:function(){return tf},xo$:function(){return oG},xoQ:function(){return ir},xoR:function(){return o8},xsS:function(){return nx},y$t:function(){return ou},y2t:function(){return eh},y8_:function(){return uv},yC1:function(){return hS},yGw:function(){return sL},yHo:function(){return iQ},ybr:function(){return ng},yj7:function(){return oi},ylh:function(){return lH},yo9:function(){return ny},yt0:function(){return e9},ywz:function(){return tP},yxD:function(){return hF},z$h:function(){return ej},z81:function(){return eU},z8B:function(){return nV},zHn:function(){return sN},zbs:function(){return hv},zf8:function(){return od},zwN:function(){return aS}});let h="173",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=3,f=0,y=1,g=2,x=3,b=0,v=1,w=2,M=0,S=1,_=2,A=3,T=4,z=5,C=100,I=101,k=102,B=103,R=104,E=200,P=201,O=202,F=203,N=204,L=205,V=206,j=207,U=208,W=209,D=210,H=211,q=212,J=213,Z=214,X=0,Y=1,G=2,$=3,Q=4,K=5,tt=6,te=7,ti=0,ts=1,tr=2,tn=0,ta=1,to=2,th=3,tl=4,tu=5,tc=6,tp=7,td="attached",tm="detached",tf=300,ty=301,tg=302,tx=303,tb=304,tv=306,tw=1e3,tM=1001,tS=1002,t_=1003,tA=1004,tT=1004,tz=1005,tC=1005,tI=1006,tk=1007,tB=1007,tR=1008,tE=1008,tP=1009,tO=1010,tF=1011,tN=1012,tL=1013,tV=1014,tj=1015,tU=1016,tW=1017,tD=1018,tH=1020,tq=35902,tJ=1021,tZ=1022,tX=1023,tY=1024,tG=1025,t$=1026,tQ=1027,tK=1028,t0=1029,t1=1030,t2=1031,t3=1032,t5=1033,t4=33776,t6=33777,t7=33778,t8=33779,t9=35840,et=35841,ee=35842,ei=35843,es=36196,er=37492,en=37496,ea=37808,eo=37809,eh=37810,el=37811,eu=37812,ec=37813,ep=37814,ed=37815,em=37816,ef=37817,ey=37818,eg=37819,ex=37820,eb=37821,ev=36492,ew=36494,eM=36495,eS=36283,e_=36284,eA=36285,eT=36286,ez=2200,eC=2201,eI=2202,ek=2300,eB=2301,eR=2302,eE=2400,eP=2401,eO=2402,eF=2500,eN=2501,eL=0,eV=1,ej=2,eU=3200,eW=3201,eD=3202,eH=3203,eq=0,eJ=1,eZ="",eX="srgb",eY="srgb-linear",eG="linear",e$="srgb",eQ=0,eK=7680,e0=7681,e1=7682,e2=7683,e3=34055,e5=34056,e4=5386,e6=512,e7=513,e8=514,e9=515,it=516,ie=517,ii=518,is=519,ir=512,ia=513,io=514,ih=515,il=516,iu=517,ic=518,ip=519,id=35044,im=35048,iy=35040,ig=35045,ix=35049,ib=35041,iv=35046,iw=35050,iM=35042,iS="100",i_="300 es",iA=2e3,iT=2001,iz={COMPUTE:"compute",RENDER:"render"};class iC{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 iI=["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"],ik=1234567,iB=Math.PI/180,iR=180/Math.PI;function iE(){let t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,s=4294967295*Math.random()|0;return(iI[255&t]+iI[t>>8&255]+iI[t>>16&255]+iI[t>>24&255]+"-"+iI[255&e]+iI[e>>8&255]+"-"+iI[e>>16&15|64]+iI[e>>24&255]+"-"+iI[63&i|128]+iI[i>>8&255]+"-"+iI[i>>16&255]+iI[i>>24&255]+iI[255&s]+iI[s>>8&255]+iI[s>>16&255]+iI[s>>24&255]).toLowerCase()}function iP(t,e,i){return Math.max(e,Math.min(i,t))}function iO(t,e){return(t%e+e)%e}function iF(t,e,i){return(1-i)*t+i*e}function iN(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw Error("Invalid component type.")}}function iL(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw Error("Invalid component type.")}}let iV={DEG2RAD:iB,RAD2DEG:iR,generateUUID:iE,clamp:iP,euclideanModulo:iO,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:iF,damp:function(t,e,i,s){return iF(t,e,1-Math.exp(-i*s))},pingpong:function(t,e=1){return e-Math.abs(iO(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&&(ik=t);let e=ik+=1831565813;return e=Math.imul(e^e>>>15,1|e),(((e^=e+Math.imul(e^e>>>7,61|e))^e>>>14)>>>0)/4294967296},degToRad:function(t){return t*iB},radToDeg:function(t){return t*iR},isPowerOfTwo:function(t){return(t&t-1)==0&&0!==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 n=Math.cos,a=Math.sin,o=n(i/2),h=a(i/2),l=n((e+s)/2),u=a((e+s)/2),c=n((e-s)/2),p=a((e-s)/2),d=n((s-e)/2),m=a((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:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},normalize:iL,denormalize:iN};class ij{constructor(t=0,e=0){ij.prototype.isVector2=!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("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("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=iP(this.x,t.x,e.x),this.y=iP(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=iP(this.x,t,e),this.y=iP(this.y,t,e),this}clampLength(t,e){let i=this.length();return this.divideScalar(i||1).multiplyScalar(iP(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(iP(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,n=this.y-t.y;return this.x=r*i-n*s+t.x,this.y=r*s+n*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class iU{constructor(t,e,i,s,r,n,a,o,h){iU.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,i,s,r,n,a,o,h)}set(t,e,i,s,r,n,a,o,h){let l=this.elements;return l[0]=t,l[1]=s,l[2]=a,l[3]=e,l[4]=r,l[5]=o,l[6]=i,l[7]=n,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,n=i[0],a=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],f=s[3],y=s[6],g=s[1],x=s[4],b=s[7],v=s[2],w=s[5],M=s[8];return r[0]=n*m+a*g+o*v,r[3]=n*f+a*x+o*w,r[6]=n*y+a*b+o*M,r[1]=h*m+l*g+u*v,r[4]=h*f+l*x+u*w,r[7]=h*y+l*b+u*M,r[2]=c*m+p*g+d*v,r[5]=c*f+p*x+d*w,r[8]=c*y+p*b+d*M,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],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*n*l-e*a*h-i*r*l+i*a*o+s*r*h-s*n*o}invert(){let t=this.elements,e=t[0],i=t[1],s=t[2],r=t[3],n=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*n-a*h,c=a*o-l*r,p=h*r-n*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]=(a*i-s*n)*m,t[3]=c*m,t[4]=(l*e-s*o)*m,t[5]=(s*r-a*e)*m,t[6]=p*m,t[7]=(i*o-h*e)*m,t[8]=(n*e-i*r)*m,this}transpose(){let t;let 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,n,a){let o=Math.cos(r),h=Math.sin(r);return this.set(i*o,i*h,-i*(o*n+h*a)+n+t,-s*h,s*o,-s*(-h*n+o*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(iW.makeScale(t,e)),this}rotate(t){return this.premultiply(iW.makeRotation(-t)),this}translate(t,e){return this.premultiply(iW.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 iW=new iU;function iD(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}let iH={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function iq(t,e){return new iH[t](e)}function iJ(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function iZ(){let t=iJ("canvas");return t.style.display="block",t}let iX={};function iY(t){t in iX||(iX[t]=!0,console.warn(t))}function iG(t,e,i){return new Promise(function(s,r){setTimeout(function n(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:r();break;case t.TIMEOUT_EXPIRED:setTimeout(n,i);break;default:s()}},i)})}function i$(t){let e=t.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function iQ(t){let e=t.elements;-1===e[11]?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}let iK=new iU().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),i0=new iU().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),i1=function(){let t={enabled:!0,workingColorSpace:eY,spaces:{},convert:function(t,e,i){return!1!==this.enabled&&e!==i&&e&&i&&(this.spaces[e].transfer===e$&&(t.r=i2(t.r),t.g=i2(t.g),t.b=i2(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===e$&&(t.r=i3(t.r),t.g=i3(t.g),t.b=i3(t.b))),t},fromWorkingColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this.workingColorSpace)},getPrimaries:function(t){return this.spaces[t].primaries},getTransfer:function(t){return t===eZ?eG:this.spaces[t].transfer},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}},e=[.64,.33,.3,.6,.15,.06],i=[.2126,.7152,.0722],s=[.3127,.329];return t.define({[eY]:{primaries:e,whitePoint:s,transfer:eG,toXYZ:iK,fromXYZ:i0,luminanceCoefficients:i,workingColorSpaceConfig:{unpackColorSpace:eX},outputColorSpaceConfig:{drawingBufferColorSpace:eX}},[eX]:{primaries:e,whitePoint:s,transfer:e$,toXYZ:iK,fromXYZ:i0,luminanceCoefficients:i,outputColorSpaceConfig:{drawingBufferColorSpace:eX}}}),t}();function i2(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function i3(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}class i5{static getDataURL(t){let e;if(/^data:/i.test(t.src)||"undefined"==typeof HTMLCanvasElement)return t.src;if(t instanceof HTMLCanvasElement)e=t;else{void 0===s&&(s=iJ("canvas")),s.width=t.width,s.height=t.height;let i=s.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=s}return e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){let e=iJ("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*i2(r[t]/255);return i.putImageData(s,0,0),e}if(!t.data)return console.warn("THREE.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*i2(e[t]/255)):e[t]=i2(e[t]);return{data:e,width:t.width,height:t.height}}}}let i4=0;class i6{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:i4++}),this.uuid=iE(),this.data=t,this.dataReady=!0,this.version=0}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(i7(s[e].image)):t.push(i7(s[e]))}else t=i7(s);i.url=t}return e||(t.images[this.uuid]=i),i}}function i7(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?i5.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let i8=0;class i9 extends iC{constructor(t=i9.DEFAULT_IMAGE,e=i9.DEFAULT_MAPPING,i=tM,s=tM,r=tI,n=tR,a=tX,o=tP,h=i9.DEFAULT_ANISOTROPY,l=eZ){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:i8++}),this.uuid=iE(),this.name="",this.source=new i6(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=i,this.wrapT=s,this.magFilter=r,this.minFilter=n,this.anisotropy=h,this.format=a,this.internalFormat=null,this.type=o,this.offset=new ij(0,0),this.repeat=new ij(1,1),this.center=new ij(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new iU,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=l,this.userData={},this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(t=null){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)}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.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.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}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.6,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,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(this.mapping!==tf)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case tw:t.x=t.x-Math.floor(t.x);break;case tM:t.x=t.x<0?0:1;break;case tS: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 tw:t.y=t.y-Math.floor(t.y);break;case tM:t.y=t.y<0?0:1;break;case tS: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++}}i9.DEFAULT_IMAGE=null,i9.DEFAULT_MAPPING=tf,i9.DEFAULT_ANISOTROPY=1;class st{constructor(t=0,e=0,i=0,s=1){st.prototype.isVector4=!0,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("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("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,n=t.elements;return this.x=n[0]*e+n[4]*i+n[8]*s+n[12]*r,this.y=n[1]*e+n[5]*i+n[9]*s+n[13]*r,this.z=n[2]*e+n[6]*i+n[10]*s+n[14]*r,this.w=n[3]*e+n[7]*i+n[11]*s+n[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;let n=t.elements,a=n[0],o=n[4],h=n[8],l=n[1],u=n[5],c=n[9],p=n[2],d=n[6],m=n[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(a+u+m-3))return this.set(1,0,0,0),this;e=Math.PI;let t=(a+1)/2,n=(u+1)/2,f=(m+1)/2,y=(o+l)/4,g=(h+p)/4,x=(c+d)/4;return t>n&&t>f?t<.01?(i=0,s=.707106781,r=.707106781):(s=y/(i=Math.sqrt(t)),r=g/i):n>f?n<.01?(i=.707106781,s=0,r=.707106781):(i=y/(s=Math.sqrt(n)),r=x/s):f<.01?(i=.707106781,s=.707106781,r=0):(i=g/(r=Math.sqrt(f)),s=x/r),this.set(i,s,r,e),this}let f=Math.sqrt((d-c)*(d-c)+(h-p)*(h-p)+(l-o)*(l-o));return .001>Math.abs(f)&&(f=1),this.x=(d-c)/f,this.y=(h-p)/f,this.z=(l-o)/f,this.w=Math.acos((a+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=iP(this.x,t.x,e.x),this.y=iP(this.y,t.y,e.y),this.z=iP(this.z,t.z,e.z),this.w=iP(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=iP(this.x,t,e),this.y=iP(this.y,t,e),this.z=iP(this.z,t,e),this.w=iP(this.w,t,e),this}clampLength(t,e){let i=this.length();return this.divideScalar(i||1).multiplyScalar(iP(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 se extends iC{constructor(t=1,e=1,i={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new st(0,0,t,e),this.scissorTest=!1,this.viewport=new st(0,0,t,e);let s=new i9({width:t,height:e,depth:1},(i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:tI,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i)).mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);s.flipY=!1,s.generateMipmaps=i.generateMipmaps,s.internalFormat=i.internalFormat,this.textures=[];let 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.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}set depthTexture(t){null!==this._depthTexture&&(this._depthTexture.renderTarget=null),null!==t&&(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;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 e=Object.assign({},t.texture.image);return this.texture.source=new i6(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,null!==t.depthTexture&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class si extends se{constructor(t=1,e=1,i={}){super(t,e,i),this.isWebGLRenderTarget=!0}}class ss extends i9{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=t_,this.minFilter=t_,this.wrapR=tM,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class sr extends si{constructor(t=1,e=1,i=1,s={}){super(t,e,s),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new ss(null,t,e,i),this.texture.isRenderTargetTexture=!0}}class sn extends i9{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=t_,this.minFilter=t_,this.wrapR=tM,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class sa extends si{constructor(t=1,e=1,i=1,s={}){super(t,e,s),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new sn(null,t,e,i),this.texture.isRenderTargetTexture=!0}}class so{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,n,a){let o=i[s+0],h=i[s+1],l=i[s+2],u=i[s+3],c=r[n+0],p=r[n+1],d=r[n+2],m=r[n+3];if(0===a){t[e+0]=o,t[e+1]=h,t[e+2]=l,t[e+3]=u;return}if(1===a){t[e+0]=c,t[e+1]=p,t[e+2]=d,t[e+3]=m;return}if(u!==m||o!==c||h!==p||l!==d){let t=1-a,e=o*c+h*p+l*d+u*m,i=e>=0?1:-1,s=1-e*e;if(s>Number.EPSILON){let r=Math.sqrt(s),n=Math.atan2(r,e*i);t=Math.sin(t*n)/r,a=Math.sin(a*n)/r}let r=a*i;if(o=o*t+c*r,h=h*t+p*r,l=l*t+d*r,u=u*t+m*r,t===1-a){let t=1/Math.sqrt(o*o+h*h+l*l+u*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,n){let a=i[s],o=i[s+1],h=i[s+2],l=i[s+3],u=r[n],c=r[n+1],p=r[n+2],d=r[n+3];return t[e]=a*d+l*u+o*p-h*c,t[e+1]=o*d+l*c+h*u-a*p,t[e+2]=h*d+l*p+a*c-o*u,t[e+3]=l*d-a*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,n=t._order,a=Math.cos,o=Math.sin,h=a(i/2),l=a(s/2),u=a(r/2),c=o(i/2),p=o(s/2),d=o(r/2);switch(n){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:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+n)}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],n=e[1],a=e[5],o=e[9],h=e[2],l=e[6],u=e[10],c=i+a+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=(n-s)*t}else if(i>a&&i>u){let t=2*Math.sqrt(1+i-a-u);this._w=(l-o)/t,this._x=.25*t,this._y=(s+n)/t,this._z=(r+h)/t}else if(a>u){let t=2*Math.sqrt(1+a-i-u);this._w=(r-h)/t,this._x=(s+n)/t,this._y=.25*t,this._z=(o+l)/t}else{let t=2*Math.sqrt(1+u-i-a);this._w=(n-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<Number.EPSILON?(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(iP(this.dot(t),-1,1)))}rotateTowards(t,e){let i=this.angleTo(t);return 0===i||this.slerp(t,Math.min(1,e/i)),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,n=t._w,a=e._x,o=e._y,h=e._z,l=e._w;return this._x=i*l+n*a+s*h-r*o,this._y=s*l+n*o+r*a-i*h,this._z=r*l+n*h+i*o-s*a,this._w=n*l-i*a-s*o-r*h,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);let i=this._x,s=this._y,r=this._z,n=this._w,a=n*t._w+i*t._x+s*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=n,this._x=i,this._y=s,this._z=r,this;let o=1-a*a;if(o<=Number.EPSILON){let t=1-e;return this._w=t*n+e*this._w,this._x=t*i+e*this._x,this._y=t*s+e*this._y,this._z=t*r+e*this._z,this.normalize(),this}let h=Math.sqrt(o),l=Math.atan2(h,a),u=Math.sin((1-e)*l)/h,c=Math.sin(e*l)/h;return this._w=n*u+this._w*c,this._x=i*u+this._x*c,this._y=s*u+this._y*c,this._z=r*u+this._z*c,this._onChangeCallback(),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 sh{constructor(t=0,e=0,i=0){sh.prototype.isVector3=!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("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("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(su.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(su.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,n=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])*n,this.y=(r[1]*e+r[5]*i+r[9]*s+r[13])*n,this.z=(r[2]*e+r[6]*i+r[10]*s+r[14])*n,this}applyQuaternion(t){let e=this.x,i=this.y,s=this.z,r=t.x,n=t.y,a=t.z,o=t.w,h=2*(n*s-a*i),l=2*(a*e-r*s),u=2*(r*i-n*e);return this.x=e+o*h+n*u-a*l,this.y=i+o*l+a*h-r*u,this.z=s+o*u+r*l-n*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=iP(this.x,t.x,e.x),this.y=iP(this.y,t.y,e.y),this.z=iP(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=iP(this.x,t,e),this.y=iP(this.y,t,e),this.z=iP(this.z,t,e),this}clampLength(t,e){let i=this.length();return this.divideScalar(i||1).multiplyScalar(iP(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,n=e.x,a=e.y,o=e.z;return this.x=s*o-r*a,this.y=r*n-i*o,this.z=i*a-s*n,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 sl.copy(this).projectOnVector(t),this.sub(sl)}reflect(t){return this.sub(sl.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(iP(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 sl=new sh,su=new so;class sc{constructor(t=new sh(Infinity,Infinity,Infinity),e=new sh(-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(sd.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,i=t.count;e<i;e++)this.expandByPoint(sd.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=sd.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,sd):sd.fromBufferAttribute(s,e),sd.applyMatrix4(t.matrixWorld),this.expandByPoint(sd);else void 0!==t.boundingBox?(null===t.boundingBox&&t.computeBoundingBox(),sm.copy(t.boundingBox)):(null===i.boundingBox&&i.computeBoundingBox(),sm.copy(i.boundingBox)),sm.applyMatrix4(t.matrixWorld),this.union(sm)}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,sd),sd.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(sw),sM.subVectors(this.max,sw),sf.subVectors(t.a,sw),sy.subVectors(t.b,sw),sg.subVectors(t.c,sw),sx.subVectors(sy,sf),sb.subVectors(sg,sy),sv.subVectors(sf,sg);let e=[0,-sx.z,sx.y,0,-sb.z,sb.y,0,-sv.z,sv.y,sx.z,0,-sx.x,sb.z,0,-sb.x,sv.z,0,-sv.x,-sx.y,sx.x,0,-sb.y,sb.x,0,-sv.y,sv.x,0];return!!(sA(e,sf,sy,sg,sM)&&sA(e=[1,0,0,0,1,0,0,0,1],sf,sy,sg,sM))&&(sS.crossVectors(sx,sb),sA(e=[sS.x,sS.y,sS.z],sf,sy,sg,sM))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,sd).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(sd).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()||(sp[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),sp[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),sp[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),sp[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),sp[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),sp[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),sp[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),sp[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(sp)),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)}}let sp=[new sh,new sh,new sh,new sh,new sh,new sh,new sh,new sh],sd=new sh,sm=new sc,sf=new sh,sy=new sh,sg=new sh,sx=new sh,sb=new sh,sv=new sh,sw=new sh,sM=new sh,sS=new sh,s_=new sh;function sA(t,e,i,s,r){for(let n=0,a=t.length-3;n<=a;n+=3){s_.fromArray(t,n);let a=r.x*Math.abs(s_.x)+r.y*Math.abs(s_.y)+r.z*Math.abs(s_.z),o=e.dot(s_),h=i.dot(s_),l=s.dot(s_);if(Math.max(-Math.max(o,h,l),Math.min(o,h,l))>a)return!1}return!0}let sT=new sc,sz=new sh,sC=new sh;class sI{constructor(t=new sh,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):sT.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;sz.subVectors(t,this.center);let e=sz.lengthSq();if(e>this.radius*this.radius){let t=Math.sqrt(e),i=(t-this.radius)*.5;this.center.addScaledVector(sz,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):(sC.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(sz.copy(t.center).add(sC)),this.expandByPoint(sz.copy(t.center).sub(sC)))),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}let sk=new sh,sB=new sh,sR=new sh,sE=new sh,sP=new sh,sO=new sh,sF=new sh;class sN{constructor(t=new sh,e=new sh(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,sk)),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=sk.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(sk.copy(this.origin).addScaledVector(this.direction,e),sk.distanceToSquared(t))}distanceSqToSegment(t,e,i,s){let r,n,a,o;sB.copy(t).add(e).multiplyScalar(.5),sR.copy(e).sub(t).normalize(),sE.copy(this.origin).sub(sB);let h=.5*t.distanceTo(e),l=-this.direction.dot(sR),u=sE.dot(this.direction),c=-sE.dot(sR),p=sE.lengthSq(),d=Math.abs(1-l*l);if(d>0){if(r=l*c-u,n=l*u-c,o=h*d,r>=0){if(n>=-o){if(n<=o){let t=1/d;r*=t,n*=t,a=r*(r+l*n+2*u)+n*(l*r+n+2*c)+p}else a=-(r=Math.max(0,-(l*(n=h)+u)))*r+n*(n+2*c)+p}else a=-(r=Math.max(0,-(l*(n=-h)+u)))*r+n*(n+2*c)+p}else n<=-o?(n=(r=Math.max(0,-(-l*h+u)))>0?-h:Math.min(Math.max(-h,-c),h),a=-r*r+n*(n+2*c)+p):n<=o?(r=0,a=(n=Math.min(Math.max(-h,-c),h))*(n+2*c)+p):(n=(r=Math.max(0,-(l*h+u)))>0?h:Math.min(Math.max(-h,-c),h),a=-r*r+n*(n+2*c)+p)}else n=l>0?-h:h,a=-(r=Math.max(0,-(l*n+u)))*r+n*(n+2*c)+p;return i&&i.copy(this.origin).addScaledVector(this.direction,r),s&&s.copy(sB).addScaledVector(sR,n),a}intersectSphere(t,e){sk.subVectors(t.center,this.origin);let i=sk.dot(this.direction),s=sk.dot(sk)-i*i,r=t.radius*t.radius;if(s>r)return null;let n=Math.sqrt(r-s),a=i-n,o=i+n;return o<0?null:a<0?this.at(o,e):this.at(a,e)}intersectsSphere(t){return 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,n,a,o;let 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,n=(t.max.y-c.y)*l):(r=(t.max.y-c.y)*l,n=(t.min.y-c.y)*l),i>n||r>s)?null:((r>i||isNaN(i))&&(i=r),(n<s||isNaN(s))&&(s=n),u>=0?(a=(t.min.z-c.z)*u,o=(t.max.z-c.z)*u):(a=(t.max.z-c.z)*u,o=(t.min.z-c.z)*u),i>o||a>s)?null:((a>i||i!=i)&&(i=a),(o<s||s!=s)&&(s=o),s<0)?null:this.at(i>=0?i:s,e)}intersectsBox(t){return null!==this.intersectBox(t,sk)}intersectTriangle(t,e,i,s,r){let n;sP.subVectors(e,t),sO.subVectors(i,t),sF.crossVectors(sP,sO);let a=this.direction.dot(sF);if(a>0){if(s)return null;n=1}else{if(!(a<0))return null;n=-1,a=-a}sE.subVectors(this.origin,t);let o=n*this.direction.dot(sO.crossVectors(sE,sO));if(o<0)return null;let h=n*this.direction.dot(sP.cross(sE));if(h<0||o+h>a)return null;let l=-n*sE.dot(sF);return l<0?null:this.at(l/a,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 sL{constructor(t,e,i,s,r,n,a,o,h,l,u,c,p,d,m,f){sL.prototype.isMatrix4=!0,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,n,a,o,h,l,u,c,p,d,m,f)}set(t,e,i,s,r,n,a,o,h,l,u,c,p,d,m,f){let y=this.elements;return y[0]=t,y[4]=e,y[8]=i,y[12]=s,y[1]=r,y[5]=n,y[9]=a,y[13]=o,y[2]=h,y[6]=l,y[10]=u,y[14]=c,y[3]=p,y[7]=d,y[11]=m,y[15]=f,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 sL().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 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){let e=this.elements,i=t.elements,s=1/sV.setFromMatrixColumn(t,0).length(),r=1/sV.setFromMatrixColumn(t,1).length(),n=1/sV.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]*n,e[9]=i[9]*n,e[10]=i[10]*n,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,n=Math.cos(i),a=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=n*l,i=n*u,s=a*l,r=a*u;e[0]=o*l,e[4]=-o*u,e[8]=h,e[1]=i+s*h,e[5]=t-r*h,e[9]=-a*o,e[2]=r-t*h,e[6]=s+i*h,e[10]=n*o}else if("YXZ"===t.order){let t=o*l,i=o*u,s=h*l,r=h*u;e[0]=t+r*a,e[4]=s*a-i,e[8]=n*h,e[1]=n*u,e[5]=n*l,e[9]=-a,e[2]=i*a-s,e[6]=r+t*a,e[10]=n*o}else if("ZXY"===t.order){let t=o*l,i=o*u,s=h*l,r=h*u;e[0]=t-r*a,e[4]=-n*u,e[8]=s+i*a,e[1]=i+s*a,e[5]=n*l,e[9]=r-t*a,e[2]=-n*h,e[6]=a,e[10]=n*o}else if("ZYX"===t.order){let t=n*l,i=n*u,s=a*l,r=a*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]=a*o,e[10]=n*o}else if("YZX"===t.order){let t=n*o,i=n*h,s=a*o,r=a*h;e[0]=o*l,e[4]=r-t*u,e[8]=s*u+i,e[1]=u,e[5]=n*l,e[9]=-a*l,e[2]=-h*l,e[6]=i*u+s,e[10]=t-r*u}else if("XZY"===t.order){let t=n*o,i=n*h,s=a*o,r=a*h;e[0]=o*l,e[4]=-u,e[8]=h*l,e[1]=t*u+r,e[5]=n*l,e[9]=i*u-s,e[2]=s*u-i,e[6]=a*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(sU,t,sW)}lookAt(t,e,i){let s=this.elements;return sq.subVectors(t,e),0===sq.lengthSq()&&(sq.z=1),sq.normalize(),sD.crossVectors(i,sq),0===sD.lengthSq()&&(1===Math.abs(i.z)?sq.x+=1e-4:sq.z+=1e-4,sq.normalize(),sD.crossVectors(i,sq)),sD.normalize(),sH.crossVectors(sq,sD),s[0]=sD.x,s[4]=sH.x,s[8]=sq.x,s[1]=sD.y,s[5]=sH.y,s[9]=sq.y,s[2]=sD.z,s[6]=sH.z,s[10]=sq.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,n=i[0],a=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],f=i[10],y=i[14],g=i[3],x=i[7],b=i[11],v=i[15],w=s[0],M=s[4],S=s[8],_=s[12],A=s[1],T=s[5],z=s[9],C=s[13],I=s[2],k=s[6],B=s[10],R=s[14],E=s[3],P=s[7],O=s[11],F=s[15];return r[0]=n*w+a*A+o*I+h*E,r[4]=n*M+a*T+o*k+h*P,r[8]=n*S+a*z+o*B+h*O,r[12]=n*_+a*C+o*R+h*F,r[1]=l*w+u*A+c*I+p*E,r[5]=l*M+u*T+c*k+p*P,r[9]=l*S+u*z+c*B+p*O,r[13]=l*_+u*C+c*R+p*F,r[2]=d*w+m*A+f*I+y*E,r[6]=d*M+m*T+f*k+y*P,r[10]=d*S+m*z+f*B+y*O,r[14]=d*_+m*C+f*R+y*F,r[3]=g*w+x*A+b*I+v*E,r[7]=g*M+x*T+b*k+v*P,r[11]=g*S+x*z+b*B+v*O,r[15]=g*_+x*C+b*R+v*F,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],n=t[1],a=t[5],o=t[9],h=t[13],l=t[2],u=t[6],c=t[10],p=t[14],d=t[3];return d*(+r*o*u-s*h*u-r*a*c+i*h*c+s*a*p-i*o*p)+t[7]*(+e*o*p-e*h*c+r*n*c-s*n*p+s*h*l-r*o*l)+t[11]*(+e*h*u-e*a*p-r*n*u+i*n*p+r*a*l-i*h*l)+t[15]*(-s*a*l-e*o*u+e*a*c+s*n*u-i*n*c+i*o*l)}transpose(){let t;let 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],n=t[4],a=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],f=t[14],y=t[15],g=u*f*h-m*c*h+m*o*p-a*f*p-u*o*y+a*c*y,x=d*c*h-l*f*h-d*o*p+n*f*p+l*o*y-n*c*y,b=l*m*h-d*u*h+d*a*p-n*m*p-l*a*y+n*u*y,v=d*u*o-l*m*o-d*a*c+n*m*c+l*a*f-n*u*f,w=e*g+i*x+s*b+r*v;if(0===w)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let M=1/w;return t[0]=g*M,t[1]=(m*c*r-u*f*r-m*s*p+i*f*p+u*s*y-i*c*y)*M,t[2]=(a*f*r-m*o*r+m*s*h-i*f*h-a*s*y+i*o*y)*M,t[3]=(u*o*r-a*c*r-u*s*h+i*c*h+a*s*p-i*o*p)*M,t[4]=x*M,t[5]=(l*f*r-d*c*r+d*s*p-e*f*p-l*s*y+e*c*y)*M,t[6]=(d*o*r-n*f*r-d*s*h+e*f*h+n*s*y-e*o*y)*M,t[7]=(n*c*r-l*o*r+l*s*h-e*c*h-n*s*p+e*o*p)*M,t[8]=b*M,t[9]=(d*u*r-l*m*r-d*i*p+e*m*p+l*i*y-e*u*y)*M,t[10]=(n*m*r-d*a*r+d*i*h-e*m*h-n*i*y+e*a*y)*M,t[11]=(l*a*r-n*u*r-l*i*h+e*u*h+n*i*p-e*a*p)*M,t[12]=v*M,t[13]=(l*m*s-d*u*s+d*i*c-e*m*c-l*i*f+e*u*f)*M,t[14]=(d*a*s-n*m*s-d*i*o+e*m*o+n*i*f-e*a*f)*M,t[15]=(n*u*s-l*a*s+l*i*o-e*u*o-n*i*c+e*a*c)*M,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,n=t.x,a=t.y,o=t.z,h=r*n,l=r*a;return this.set(h*n+i,h*a-s*o,h*o+s*a,0,h*a+s*o,l*a+i,l*o-s*n,0,h*o-s*a,l*o+s*n,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,n){return this.set(1,i,r,0,t,1,n,0,e,s,1,0,0,0,0,1),this}compose(t,e,i){let s=this.elements,r=e._x,n=e._y,a=e._z,o=e._w,h=r+r,l=n+n,u=a+a,c=r*h,p=r*l,d=r*u,m=n*l,f=n*u,y=a*u,g=o*h,x=o*l,b=o*u,v=i.x,w=i.y,M=i.z;return s[0]=(1-(m+y))*v,s[1]=(p+b)*v,s[2]=(d-x)*v,s[3]=0,s[4]=(p-b)*w,s[5]=(1-(c+y))*w,s[6]=(f+g)*w,s[7]=0,s[8]=(d+x)*M,s[9]=(f-g)*M,s[10]=(1-(c+m))*M,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,r=sV.set(s[0],s[1],s[2]).length(),n=sV.set(s[4],s[5],s[6]).length(),a=sV.set(s[8],s[9],s[10]).length();0>this.determinant()&&(r=-r),t.x=s[12],t.y=s[13],t.z=s[14],sj.copy(this);let o=1/r,h=1/n,l=1/a;return sj.elements[0]*=o,sj.elements[1]*=o,sj.elements[2]*=o,sj.elements[4]*=h,sj.elements[5]*=h,sj.elements[6]*=h,sj.elements[8]*=l,sj.elements[9]*=l,sj.elements[10]*=l,e.setFromRotationMatrix(sj),i.x=r,i.y=n,i.z=a,this}makePerspective(t,e,i,s,r,n,a=iA){let o,h;let l=this.elements;if(a===iA)o=-(n+r)/(n-r),h=-2*n*r/(n-r);else if(a===iT)o=-n/(n-r),h=-n*r/(n-r);else throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=2*r/(e-t),l[4]=0,l[8]=(e+t)/(e-t),l[12]=0,l[1]=0,l[5]=2*r/(i-s),l[9]=(i+s)/(i-s),l[13]=0,l[2]=0,l[6]=0,l[10]=o,l[14]=h,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,i,s,r,n,a=iA){let o,h;let l=this.elements,u=1/(e-t),c=1/(i-s),p=1/(n-r);if(a===iA)o=(n+r)*p,h=-2*p;else if(a===iT)o=r*p,h=-1*p;else throw Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-((e+t)*u),l[1]=0,l[5]=2*c,l[9]=0,l[13]=-((i+s)*c),l[2]=0,l[6]=0,l[10]=h,l[14]=-o,l[3]=0,l[7]=0,l[11]=0,l[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 sV=new sh,sj=new sL,sU=new sh(0,0,0),sW=new sh(1,1,1),sD=new sh,sH=new sh,sq=new sh,sJ=new sL,sZ=new so;class sX{constructor(t=0,e=0,i=0,s=sX.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],n=s[4],a=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(iP(a,-1,1)),.9999999>Math.abs(a)?(this._x=Math.atan2(-l,p),this._z=Math.atan2(-n,r)):(this._x=Math.atan2(c,h),this._z=0);break;case"YXZ":this._x=Math.asin(-iP(l,-1,1)),.9999999>Math.abs(l)?(this._y=Math.atan2(a,p),this._z=Math.atan2(o,h)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(iP(c,-1,1)),.9999999>Math.abs(c)?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-n,h)):(this._y=0,this._z=Math.atan2(o,r));break;case"ZYX":this._y=Math.asin(-iP(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(-n,h));break;case"YZX":this._z=Math.asin(iP(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(a,p));break;case"XZY":this._z=Math.asin(-iP(n,-1,1)),.9999999>Math.abs(n)?(this._x=Math.atan2(c,h),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-l,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===i&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return sJ.makeRotationFromQuaternion(t),this.setFromRotationMatrix(sJ,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return sZ.setFromEuler(this),this.setFromQuaternion(sZ,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}}sX.DEFAULT_ORDER="XYZ";class sY{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!=0}isEnabled(t){return(this.mask&(1<<t|0))!=0}}let sG=0,s$=new sh,sQ=new so,sK=new sL,s0=new sh,s1=new sh,s2=new sh,s3=new so,s5=new sh(1,0,0),s4=new sh(0,1,0),s6=new sh(0,0,1),s7={type:"added"},s8={type:"removed"},s9={type:"childadded",child:null},rt={type:"childremoved",child:null};class re extends iC{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:sG++}),this.uuid=iE(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=re.DEFAULT_UP.clone();let t=new sh,e=new sX,i=new so,s=new sh(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 sL},normalMatrix:{value:new iU}}),this.matrix=new sL,this.matrixWorld=new sL,this.matrixAutoUpdate=re.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=re.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new sY,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}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 sQ.setFromAxisAngle(t,e),this.quaternion.multiply(sQ),this}rotateOnWorldAxis(t,e){return sQ.setFromAxisAngle(t,e),this.quaternion.premultiply(sQ),this}rotateX(t){return this.rotateOnAxis(s5,t)}rotateY(t){return this.rotateOnAxis(s4,t)}rotateZ(t){return this.rotateOnAxis(s6,t)}translateOnAxis(t,e){return s$.copy(t).applyQuaternion(this.quaternion),this.position.add(s$.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(s5,t)}translateY(t){return this.translateOnAxis(s4,t)}translateZ(t){return this.translateOnAxis(s6,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(sK.copy(this.matrixWorld).invert())}lookAt(t,e,i){t.isVector3?s0.copy(t):s0.set(t,e,i);let s=this.parent;this.updateWorldMatrix(!0,!1),s1.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?sK.lookAt(s1,s0,this.up):sK.lookAt(s0,s1,this.up),this.quaternion.setFromRotationMatrix(sK),s&&(sK.extractRotation(s.matrixWorld),sQ.setFromRotationMatrix(sK),this.quaternion.premultiply(sQ.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?console.error("THREE.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(s7),s9.child=t,this.dispatchEvent(s9),s9.child=null):console.error("THREE.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(s8),rt.child=t,this.dispatchEvent(rt),rt.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),sK.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),sK.multiply(t.parent.matrixWorld)),t.applyMatrix4(sK),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(s7),s9.child=t,this.dispatchEvent(s9),s9.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,n=s.length;r<n;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(s1,t,s2),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(s1,s3,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}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),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){let i=this.parent;if(!0===t&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),!0===e){let t=this.children;for(let e=0,i=t.length;e<i;e++)t[e].updateWorldMatrix(!1,!0)}}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.6,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,""!==this.name&&(s.name=this.name),!0===this.castShadow&&(s.castShadow=!0),!0===this.receiveShadow&&(s.receiveShadow=!0),!1===this.visible&&(s.visible=!1),!1===this.frustumCulled&&(s.frustumCulled=!1),0!==this.renderOrder&&(s.renderOrder=this.renderOrder),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(),!1===this.matrixAutoUpdate&&(s.matrixAutoUpdate=!1),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.visibility=this._visibility,s.active=this._active,s.bounds=this._bounds.map(t=>({boxInitialized:t.boxInitialized,boxMin:t.box.min.toArray(),boxMax:t.box.max.toArray(),sphereInitialized:t.sphereInitialized,sphereRadius:t.sphere.radius,sphereCenter:t.sphere.center.toArray()})),s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(t),null!==this._colorsTexture&&(s.colorsTexture=this._colorsTexture.toJSON(t)),null!==this.boundingSphere&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),null!==this.boundingBox&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()})),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=n(t.geometries),s=n(t.materials),r=n(t.textures),a=n(t.images),o=n(t.shapes),h=n(t.skeletons),l=n(t.animations),u=n(t.nodes);e.length>0&&(i.geometries=e),s.length>0&&(i.materials=s),r.length>0&&(i.textures=r),a.length>0&&(i.images=a),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 n(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.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.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}}re.DEFAULT_UP=new sh(0,1,0),re.DEFAULT_MATRIX_AUTO_UPDATE=!0,re.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;let ri=new sh,rs=new sh,rr=new sh,rn=new sh,ra=new sh,ro=new sh,rh=new sh,rl=new sh,ru=new sh,rc=new sh,rp=new st,rd=new st,rm=new st;class rf{constructor(t=new sh,e=new sh,i=new sh){this.a=t,this.b=e,this.c=i}static getNormal(t,e,i,s){s.subVectors(i,e),ri.subVectors(t,e),s.cross(ri);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){ri.subVectors(s,e),rs.subVectors(i,e),rr.subVectors(t,e);let n=ri.dot(ri),a=ri.dot(rs),o=ri.dot(rr),h=rs.dot(rs),l=rs.dot(rr),u=n*h-a*a;if(0===u)return r.set(0,0,0),null;let c=1/u,p=(h*o-a*l)*c,d=(n*l-a*o)*c;return r.set(1-p-d,d,p)}static containsPoint(t,e,i,s){return null!==this.getBarycoord(t,e,i,s,rn)&&rn.x>=0&&rn.y>=0&&rn.x+rn.y<=1}static getInterpolation(t,e,i,s,r,n,a,o){return null===this.getBarycoord(t,e,i,s,rn)?(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,rn.x),o.addScaledVector(n,rn.y),o.addScaledVector(a,rn.z),o)}static getInterpolatedAttribute(t,e,i,s,r,n){return rp.setScalar(0),rd.setScalar(0),rm.setScalar(0),rp.fromBufferAttribute(t,e),rd.fromBufferAttribute(t,i),rm.fromBufferAttribute(t,s),n.setScalar(0),n.addScaledVector(rp,r.x),n.addScaledVector(rd,r.y),n.addScaledVector(rm,r.z),n}static isFrontFacing(t,e,i,s){return ri.subVectors(i,e),rs.subVectors(t,e),0>ri.cross(rs).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 ri.subVectors(this.c,this.b),rs.subVectors(this.a,this.b),.5*ri.cross(rs).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return rf.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return rf.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,i,s,r){return rf.getInterpolation(t,this.a,this.b,this.c,e,i,s,r)}containsPoint(t){return rf.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return rf.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let i,s;let r=this.a,n=this.b,a=this.c;ra.subVectors(n,r),ro.subVectors(a,r),rl.subVectors(t,r);let o=ra.dot(rl),h=ro.dot(rl);if(o<=0&&h<=0)return e.copy(r);ru.subVectors(t,n);let l=ra.dot(ru),u=ro.dot(ru);if(l>=0&&u<=l)return e.copy(n);let c=o*u-l*h;if(c<=0&&o>=0&&l<=0)return i=o/(o-l),e.copy(r).addScaledVector(ra,i);rc.subVectors(t,a);let p=ra.dot(rc),d=ro.dot(rc);if(d>=0&&p<=d)return e.copy(a);let m=p*h-o*d;if(m<=0&&h>=0&&d<=0)return s=h/(h-d),e.copy(r).addScaledVector(ro,s);let f=l*d-p*u;if(f<=0&&u-l>=0&&p-d>=0)return rh.subVectors(a,n),s=(u-l)/(u-l+(p-d)),e.copy(n).addScaledVector(rh,s);let y=1/(f+m+c);return i=m*y,s=c*y,e.copy(r).addScaledVector(ra,i).addScaledVector(ro,s)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let ry={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},rg={h:0,s:0,l:0},rx={h:0,s:0,l:0};function rb(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 rv{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=eX){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,i1.toWorkingColorSpace(this,e),this}setRGB(t,e,i,s=i1.workingColorSpace){return this.r=t,this.g=e,this.b=i,i1.toWorkingColorSpace(this,s),this}setHSL(t,e,i,s=i1.workingColorSpace){if(t=iO(t,1),e=iP(e,0,1),i=iP(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=rb(r,s,t+1/3),this.g=rb(r,s,t),this.b=rb(r,s,t-1/3)}return i1.toWorkingColorSpace(this,s),this}setStyle(t,e=eX){let i;function s(e){void 0!==e&&1>parseFloat(e)&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;let n=i[1],a=i[2];switch(n){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))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(a))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(a))return s(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.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);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=eX){let i=ry[t.toLowerCase()];return void 0!==i?this.setHex(i,e):console.warn("THREE.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=i2(t.r),this.g=i2(t.g),this.b=i2(t.b),this}copyLinearToSRGB(t){return this.r=i3(t.r),this.g=i3(t.g),this.b=i3(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=eX){return i1.fromWorkingColorSpace(rw.copy(this),t),65536*Math.round(iP(255*rw.r,0,255))+256*Math.round(iP(255*rw.g,0,255))+Math.round(iP(255*rw.b,0,255))}getHexString(t=eX){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=i1.workingColorSpace){let i,s;i1.fromWorkingColorSpace(rw.copy(this),e);let r=rw.r,n=rw.g,a=rw.b,o=Math.max(r,n,a),h=Math.min(r,n,a),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=(n-a)/t+(n<a?6:0);break;case n:i=(a-r)/t+2;break;case a:i=(r-n)/t+4}i/=6}return t.h=i,t.s=s,t.l=l,t}getRGB(t,e=i1.workingColorSpace){return i1.fromWorkingColorSpace(rw.copy(this),e),t.r=rw.r,t.g=rw.g,t.b=rw.b,t}getStyle(t=eX){i1.fromWorkingColorSpace(rw.copy(this),t);let e=rw.r,i=rw.g,s=rw.b;return t!==eX?`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(rg),this.setHSL(rg.h+t,rg.s+e,rg.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(rg),t.getHSL(rx);let i=iF(rg.h,rx.h,e),s=iF(rg.s,rx.s,e),r=iF(rg.l,rx.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 rw=new rv;rv.NAMES=ry;let rM=0;class rS extends iC{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:rM++}),this.uuid=iE(),this.name="",this.type="Material",this.blending=S,this.side=b,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=N,this.blendDst=L,this.blendEquation=C,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new rv(0,0,0),this.blendAlpha=0,this.depthFunc=$,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=is,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=eK,this.stencilZFail=eK,this.stencilZPass=eK,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.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){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}let s=this[e];if(void 0===s){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(i):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.6,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,""!==this.name&&(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&&1!==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()),void 0!==this.dispersion&&(i.dispersion=this.dispersion),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&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==S&&(i.blending=this.blending),this.side!==b&&(i.side=this.side),!0===this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=!0),this.blendSrc!==N&&(i.blendSrc=this.blendSrc),this.blendDst!==L&&(i.blendDst=this.blendDst),this.blendEquation!==C&&(i.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(i.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(i.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==$&&(i.depthFunc=this.depthFunc),!1===this.depthTest&&(i.depthTest=this.depthTest),!1===this.depthWrite&&(i.depthWrite=this.depthWrite),!1===this.colorWrite&&(i.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==is&&(i.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(i.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==eK&&(i.stencilFail=this.stencilFail),this.stencilZFail!==eK&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==eK&&(i.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(i.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaHash&&(i.alphaHash=!0),!0===this.alphaToCoverage&&(i.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=!0),!0===this.forceSinglePass&&(i.forceSinglePass=!0),!0===this.wireframe&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=!0),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),!1===this.fog&&(i.fog=!1),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}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.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++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class r_ extends rS{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new rv(16777215),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 sX,this.combine=ti,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 rA=function(){let t=new ArrayBuffer(4),e=new Float32Array(t),i=new Uint32Array(t),s=new Uint32Array(512),r=new Uint32Array(512);for(let t=0;t<256;++t){let e=t-127;e<-27?(s[t]=0,s[256|t]=32768,r[t]=24,r[256|t]=24):e<-14?(s[t]=1024>>-e-14,s[256|t]=1024>>-e-14|32768,r[t]=-e-1,r[256|t]=-e-1):e<=15?(s[t]=e+15<<10,s[256|t]=e+15<<10|32768,r[t]=13,r[256|t]=13):e<128?(s[t]=31744,s[256|t]=64512,r[t]=24,r[256|t]=24):(s[t]=31744,s[256|t]=64512,r[t]=13,r[256|t]=13)}let n=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let t=1;t<1024;++t){let e=t<<13,i=0;for(;(8388608&e)==0;)e<<=1,i-=8388608;e&=-8388609,i+=947912704,n[t]=e|i}for(let t=1024;t<2048;++t)n[t]=939524096+(t-1024<<13);for(let t=1;t<31;++t)a[t]=t<<23;a[31]=1199570944,a[32]=2147483648;for(let t=33;t<63;++t)a[t]=2147483648+(t-32<<23);a[63]=3347054592;for(let t=1;t<64;++t)32!==t&&(o[t]=1024);return{floatView:e,uint32View:i,baseTable:s,shiftTable:r,mantissaTable:n,exponentTable:a,offsetTable:o}}();function rT(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=iP(t,-65504,65504),rA.floatView[0]=t;let e=rA.uint32View[0],i=e>>23&511;return rA.baseTable[i]+((8388607&e)>>rA.shiftTable[i])}function rz(t){let e=t>>10;return rA.uint32View[0]=rA.mantissaTable[rA.offsetTable[e]+(1023&t)]+rA.exponentTable[e],rA.floatView[0]}let rC={toHalfFloat:rT,fromHalfFloat:rz},rI=new sh,rk=new ij,rB=0;class rR{constructor(t,e,i=!1){if(Array.isArray(t))throw TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:rB++}),this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=i,this.usage=id,this.updateRanges=[],this.gpuType=tj,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++)rk.fromBufferAttribute(this,e),rk.applyMatrix3(t),this.setXY(e,rk.x,rk.y);else if(3===this.itemSize)for(let e=0,i=this.count;e<i;e++)rI.fromBufferAttribute(this,e),rI.applyMatrix3(t),this.setXYZ(e,rI.x,rI.y,rI.z);return this}applyMatrix4(t){for(let e=0,i=this.count;e<i;e++)rI.fromBufferAttribute(this,e),rI.applyMatrix4(t),this.setXYZ(e,rI.x,rI.y,rI.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)rI.fromBufferAttribute(this,e),rI.applyNormalMatrix(t),this.setXYZ(e,rI.x,rI.y,rI.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)rI.fromBufferAttribute(this,e),rI.transformDirection(t),this.setXYZ(e,rI.x,rI.y,rI.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=iN(i,this.array)),i}setComponent(t,e,i){return this.normalized&&(i=iL(i,this.array)),this.array[t*this.itemSize+e]=i,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=iN(e,this.array)),e}setX(t,e){return this.normalized&&(e=iL(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=iN(e,this.array)),e}setY(t,e){return this.normalized&&(e=iL(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=iN(e,this.array)),e}setZ(t,e){return this.normalized&&(e=iL(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=iN(e,this.array)),e}setW(t,e){return this.normalized&&(e=iL(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,i){return t*=this.itemSize,this.normalized&&(e=iL(e,this.array),i=iL(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=iL(e,this.array),i=iL(i,this.array),s=iL(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=iL(e,this.array),i=iL(i,this.array),s=iL(s,this.array),r=iL(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""!==this.name&&(t.name=this.name),this.usage!==id&&(t.usage=this.usage),t}}class rE extends rR{constructor(t,e,i){super(new Int8Array(t),e,i)}}class rP extends rR{constructor(t,e,i){super(new Uint8Array(t),e,i)}}class rO extends rR{constructor(t,e,i){super(new Uint8ClampedArray(t),e,i)}}class rF extends rR{constructor(t,e,i){super(new Int16Array(t),e,i)}}class rN extends rR{constructor(t,e,i){super(new Uint16Array(t),e,i)}}class rL extends rR{constructor(t,e,i){super(new Int32Array(t),e,i)}}class rV extends rR{constructor(t,e,i){super(new Uint32Array(t),e,i)}}class rj extends rR{constructor(t,e,i){super(new Uint16Array(t),e,i),this.isFloat16BufferAttribute=!0}getX(t){let e=rz(this.array[t*this.itemSize]);return this.normalized&&(e=iN(e,this.array)),e}setX(t,e){return this.normalized&&(e=iL(e,this.array)),this.array[t*this.itemSize]=rT(e),this}getY(t){let e=rz(this.array[t*this.itemSize+1]);return this.normalized&&(e=iN(e,this.array)),e}setY(t,e){return this.normalized&&(e=iL(e,this.array)),this.array[t*this.itemSize+1]=rT(e),this}getZ(t){let e=rz(this.array[t*this.itemSize+2]);return this.normalized&&(e=iN(e,this.array)),e}setZ(t,e){return this.normalized&&(e=iL(e,this.array)),this.array[t*this.itemSize+2]=rT(e),this}getW(t){let e=rz(this.array[t*this.itemSize+3]);return this.normalized&&(e=iN(e,this.array)),e}setW(t,e){return this.normalized&&(e=iL(e,this.array)),this.array[t*this.itemSize+3]=rT(e),this}setXY(t,e,i){return t*=this.itemSize,this.normalized&&(e=iL(e,this.array),i=iL(i,this.array)),this.array[t+0]=rT(e),this.array[t+1]=rT(i),this}setXYZ(t,e,i,s){return t*=this.itemSize,this.normalized&&(e=iL(e,this.array),i=iL(i,this.array),s=iL(s,this.array)),this.array[t+0]=rT(e),this.array[t+1]=rT(i),this.array[t+2]=rT(s),this}setXYZW(t,e,i,s,r){return t*=this.itemSize,this.normalized&&(e=iL(e,this.array),i=iL(i,this.array),s=iL(s,this.array),r=iL(r,this.array)),this.array[t+0]=rT(e),this.array[t+1]=rT(i),this.array[t+2]=rT(s),this.array[t+3]=rT(r),this}}class rU extends rR{constructor(t,e,i){super(new Float32Array(t),e,i)}}let rW=0,rD=new sL,rH=new re,rq=new sh,rJ=new sc,rZ=new sc,rX=new sh;class rY extends iC{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:rW++}),this.uuid=iE(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(iD(t)?rV:rN)(t,1):this.index=t,this}setIndirect(t){return this.indirect=t,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 iU().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}applyQuaternion(t){return rD.makeRotationFromQuaternion(t),this.applyMatrix4(rD),this}rotateX(t){return rD.makeRotationX(t),this.applyMatrix4(rD),this}rotateY(t){return rD.makeRotationY(t),this.applyMatrix4(rD),this}rotateZ(t){return rD.makeRotationZ(t),this.applyMatrix4(rD),this}translate(t,e,i){return rD.makeTranslation(t,e,i),this.applyMatrix4(rD),this}scale(t,e,i){return rD.makeScale(t,e,i),this.applyMatrix4(rD),this}lookAt(t){return rH.lookAt(t),rH.updateMatrix(),this.applyMatrix4(rH.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(rq).negate(),this.translate(rq.x,rq.y,rq.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 rU(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&&console.warn("THREE.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 sc);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new sh(-1/0,-1/0,-1/0),new sh(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];rJ.setFromBufferAttribute(i),this.morphTargetsRelative?(rX.addVectors(this.boundingBox.min,rJ.min),this.boundingBox.expandByPoint(rX),rX.addVectors(this.boundingBox.max,rJ.max),this.boundingBox.expandByPoint(rX)):(this.boundingBox.expandByPoint(rJ.min),this.boundingBox.expandByPoint(rJ.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.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 sI);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new sh,1/0);return}if(t){let i=this.boundingSphere.center;if(rJ.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){let i=e[t];rZ.setFromBufferAttribute(i),this.morphTargetsRelative?(rX.addVectors(rJ.min,rZ.min),rJ.expandByPoint(rX),rX.addVectors(rJ.max,rZ.max),rJ.expandByPoint(rX)):(rJ.expandByPoint(rZ.min),rJ.expandByPoint(rZ.max))}rJ.getCenter(i);let s=0;for(let e=0,r=t.count;e<r;e++)rX.fromBufferAttribute(t,e),s=Math.max(s,i.distanceToSquared(rX));if(e)for(let r=0,n=e.length;r<n;r++){let n=e[r],a=this.morphTargetsRelative;for(let e=0,r=n.count;e<r;e++)rX.fromBufferAttribute(n,e),a&&(rq.fromBufferAttribute(t,e),rX.add(rq)),s=Math.max(s,i.distanceToSquared(rX))}this.boundingSphere.radius=Math.sqrt(s),isNaN(this.boundingSphere.radius)&&console.error('THREE.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){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}let i=e.position,s=e.normal,r=e.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new rR(new Float32Array(4*i.count),4));let n=this.getAttribute("tangent"),a=[],o=[];for(let t=0;t<i.count;t++)a[t]=new sh,o[t]=new sh;let h=new sh,l=new sh,u=new sh,c=new ij,p=new ij,d=new ij,m=new sh,f=new sh,y=this.groups;0===y.length&&(y=[{start:0,count:t.count}]);for(let e=0,s=y.length;e<s;++e){let s=y[e],n=s.start,g=s.count;for(let e=n,s=n+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 n=1/(p.x*d.y-d.x*p.y);isFinite(n)&&(m.copy(l).multiplyScalar(d.y).addScaledVector(u,-p.y).multiplyScalar(n),f.copy(u).multiplyScalar(p.x).addScaledVector(l,-d.x).multiplyScalar(n),a[t].add(m),a[e].add(m),a[s].add(m),o[t].add(f),o[e].add(f),o[s].add(f))}(t.getX(e+0),t.getX(e+1),t.getX(e+2))}let g=new sh,x=new sh,b=new sh,v=new sh;function w(t){b.fromBufferAttribute(s,t),v.copy(b);let e=a[t];g.copy(e),g.sub(b.multiplyScalar(b.dot(e))).normalize(),x.crossVectors(v,e);let i=x.dot(o[t]);n.setXYZW(t,g.x,g.y,g.z,i<0?-1:1)}for(let e=0,i=y.length;e<i;++e){let i=y[e],s=i.start,r=i.count;for(let e=s,i=s+r;e<i;e+=3)w(t.getX(e+0)),w(t.getX(e+1)),w(t.getX(e+2))}}computeVertexNormals(){let t=this.index,e=this.getAttribute("position");if(void 0!==e){let i=this.getAttribute("normal");if(void 0===i)i=new rR(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 sh,r=new sh,n=new sh,a=new sh,o=new sh,h=new sh,l=new sh,u=new sh;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),n.fromBufferAttribute(e,m),l.subVectors(n,r),u.subVectors(s,r),l.cross(u),a.fromBufferAttribute(i,p),o.fromBufferAttribute(i,d),h.fromBufferAttribute(i,m),a.add(l),o.add(l),h.add(l),i.setXYZ(p,a.x,a.y,a.z),i.setXYZ(d,o.x,o.y,o.z),i.setXYZ(m,h.x,h.y,h.z)}else for(let t=0,a=e.count;t<a;t+=3)s.fromBufferAttribute(e,t+0),r.fromBufferAttribute(e,t+1),n.fromBufferAttribute(e,t+2),l.subVectors(n,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++)rX.fromBufferAttribute(t,e),rX.normalize(),t.setXYZ(e,rX.x,rX.y,rX.z)}toNonIndexed(){function t(t,e){let i=t.array,s=t.itemSize,r=t.normalized,n=new i.constructor(e.length*s),a=0,o=0;for(let r=0,h=e.length;r<h;r++){a=t.isInterleavedBufferAttribute?e[r]*t.data.stride+t.offset:e[r]*s;for(let t=0;t<s;t++)n[o++]=i[a++]}return new rR(n,s,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let e=new rY,i=this.index.array,s=this.attributes;for(let r in s){let n=t(s[r],i);e.setAttribute(r,n)}let r=this.morphAttributes;for(let s in r){let n=[],a=r[s];for(let e=0,s=a.length;e<s;e++){let s=t(a[e],i);n.push(s)}e.morphAttributes[s]=n}e.morphTargetsRelative=this.morphTargetsRelative;let n=this.groups;for(let t=0,i=n.length;t<i;t++){let i=n[t];e.addGroup(i.start,i.count,i.materialIndex)}return e}toJSON(){let t={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){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],n=[];for(let e=0,s=i.length;e<s;e++){let s=i[e];n.push(s.toJSON(t.data))}n.length>0&&(s[e]=n,r=!0)}r&&(t.data.morphAttributes=s,t.data.morphTargetsRelative=this.morphTargetsRelative);let n=this.groups;n.length>0&&(t.data.groups=JSON.parse(JSON.stringify(n)));let a=this.boundingSphere;return null!==a&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),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(e));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 n=t.groups;for(let t=0,e=n.length;t<e;t++){let e=n[t];this.addGroup(e.start,e.count,e.materialIndex)}let a=t.boundingBox;null!==a&&(this.boundingBox=a.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}dispose(){this.dispatchEvent({type:"dispose"})}}let rG=new sL,r$=new sN,rQ=new sI,rK=new sh,r0=new sh,r1=new sh,r2=new sh,r3=new sh,r5=new sh,r4=new sh,r6=new sh;class r7 extends re{constructor(t=new rY,e=new r_){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,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,n=i.morphTargetsRelative;e.fromBufferAttribute(s,t);let a=this.morphTargetInfluences;if(r&&a){r5.set(0,0,0);for(let i=0,s=r.length;i<s;i++){let s=a[i],o=r[i];0!==s&&(r3.fromBufferAttribute(o,t),n?r5.addScaledVector(r3,s):r5.addScaledVector(r3.sub(e),s))}e.add(r5)}return e}raycast(t,e){let i=this.geometry,s=this.material,r=this.matrixWorld;if(void 0!==s){if(null===i.boundingSphere&&i.computeBoundingSphere(),rQ.copy(i.boundingSphere),rQ.applyMatrix4(r),r$.copy(t.ray).recast(t.near),!1===rQ.containsPoint(r$.origin)&&(null===r$.intersectSphere(rQ,rK)||r$.origin.distanceToSquared(rK)>(t.far-t.near)**2)||(rG.copy(r).invert(),r$.copy(t.ray).applyMatrix4(rG),null!==i.boundingBox&&!1===r$.intersectsBox(i.boundingBox)))return;this._computeIntersections(t,e,r$)}}_computeIntersections(t,e,i){let s;let r=this.geometry,n=this.material,a=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!==a){if(Array.isArray(n))for(let r=0,o=c.length;r<o;r++){let o=c[r],d=n[o.materialIndex],m=Math.max(o.start,p.start),f=Math.min(a.count,Math.min(o.start+o.count,p.start+p.count));for(let r=m;r<f;r+=3)(s=r8(this,d,t,i,h,l,u,a.getX(r),a.getX(r+1),a.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(a.count,p.start+p.count);for(let c=r;c<o;c+=3)(s=r8(this,n,t,i,h,l,u,a.getX(c),a.getX(c+1),a.getX(c+2)))&&(s.faceIndex=Math.floor(c/3),e.push(s))}}else if(void 0!==o){if(Array.isArray(n))for(let r=0,a=c.length;r<a;r++){let a=c[r],d=n[a.materialIndex],m=Math.max(a.start,p.start),f=Math.min(o.count,Math.min(a.start+a.count,p.start+p.count));for(let r=m;r<f;r+=3)(s=r8(this,d,t,i,h,l,u,r,r+1,r+2))&&(s.faceIndex=Math.floor(r/3),s.face.materialIndex=a.materialIndex,e.push(s))}else{let r=Math.max(0,p.start),a=Math.min(o.count,p.start+p.count);for(let o=r;o<a;o+=3)(s=r8(this,n,t,i,h,l,u,o,o+1,o+2))&&(s.faceIndex=Math.floor(o/3),e.push(s))}}}}function r8(t,e,i,s,r,n,a,o,h,l){t.getVertexPosition(o,r0),t.getVertexPosition(h,r1),t.getVertexPosition(l,r2);let u=function(t,e,i,s,r,n,a,o){if(null===(e.side===v?s.intersectTriangle(a,n,r,!0,o):s.intersectTriangle(r,n,a,e.side===b,o)))return null;r6.copy(o),r6.applyMatrix4(t.matrixWorld);let h=i.ray.origin.distanceTo(r6);return h<i.near||h>i.far?null:{distance:h,point:r6.clone(),object:t}}(t,e,i,s,r0,r1,r2,r4);if(u){let t=new sh;rf.getBarycoord(r4,r0,r1,r2,t),r&&(u.uv=rf.getInterpolatedAttribute(r,o,h,l,t,new ij)),n&&(u.uv1=rf.getInterpolatedAttribute(n,o,h,l,t,new ij)),a&&(u.normal=rf.getInterpolatedAttribute(a,o,h,l,t,new sh),u.normal.dot(s.direction)>0&&u.normal.multiplyScalar(-1));let e={a:o,b:h,c:l,normal:new sh,materialIndex:0};rf.getNormal(r0,r1,r2,e.normal),u.face=e,u.barycoord=t}return u}class r9 extends rY{constructor(t=1,e=1,i=1,s=1,r=1,n=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:s,heightSegments:r,depthSegments:n};let a=this;s=Math.floor(s),r=Math.floor(r);let o=[],h=[],l=[],u=[],c=0,p=0;function d(t,e,i,s,r,n,d,m,f,y,g){let x=n/f,b=d/y,v=n/2,w=d/2,M=m/2,S=f+1,_=y+1,A=0,T=0,z=new sh;for(let n=0;n<_;n++){let a=n*b-w;for(let o=0;o<S;o++){let c=o*x-v;z[t]=c*s,z[e]=a*r,z[i]=M,h.push(z.x,z.y,z.z),z[t]=0,z[e]=0,z[i]=m>0?1:-1,l.push(z.x,z.y,z.z),u.push(o/f),u.push(1-n/y),A+=1}}for(let t=0;t<y;t++)for(let e=0;e<f;e++){let i=c+e+S*t,s=c+e+S*(t+1),r=c+(e+1)+S*(t+1),n=c+(e+1)+S*t;o.push(i,s,n),o.push(s,r,n),T+=6}a.addGroup(p,T,g),p+=T,c+=A}d("z","y","x",-1,-1,i,e,t,n=Math.floor(n),r,0),d("z","y","x",1,-1,i,e,-t,n,r,1),d("x","z","y",1,1,t,i,e,s,n,2),d("x","z","y",1,-1,t,i,-e,s,n,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 rU(h,3)),this.setAttribute("normal",new rU(l,3)),this.setAttribute("uv",new rU(u,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new r9(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function nt(t){let e={};for(let i in t)for(let s in e[i]={},t[i]){let r=t[i][s];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[i][s]=null):e[i][s]=r.clone():Array.isArray(r)?e[i][s]=r.slice():e[i][s]=r}return e}function ne(t){let e={};for(let i=0;i<t.length;i++){let s=nt(t[i]);for(let t in s)e[t]=s[t]}return e}function ni(t){let e=t.getRenderTarget();return null===e?t.outputColorSpace:!0===e.isXRRenderTarget?e.texture.colorSpace:i1.workingColorSpace}let ns={clone:nt,merge:ne};class nr extends rS{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=nt(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}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}}class nn extends re{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new sL,this.projectionMatrix=new sL,this.projectionMatrixInverse=new sL,this.coordinateSystem=iA}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.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}let na=new sh,no=new ij,nh=new ij;class nl extends nn{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*iR*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){let t=Math.tan(.5*iB*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*iR*Math.atan(Math.tan(.5*iB*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){na.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(na.x,na.y).multiplyScalar(-t/na.z),na.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(na.x,na.y).multiplyScalar(-t/na.z)}getViewSize(t,e){return this.getViewBounds(t,no,nh),e.subVectors(nh,no)}setViewOffset(t,e,i,s,r,n){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=n,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=this.near,e=t*Math.tan(.5*iB*this.fov)/this.zoom,i=2*e,s=this.aspect*i,r=-.5*s,n=this.view;if(null!==this.view&&this.view.enabled){let t=n.fullWidth,a=n.fullHeight;r+=n.offsetX*s/t,e-=n.offsetY*i/a,s*=n.width/t,i*=n.height/a}let a=this.filmOffset;0!==a&&(r+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,e,e-i,t,this.far,this.coordinateSystem),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 nu extends re{constructor(t,e,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;let s=new nl(-90,1,t,e);s.layers=this.layers,this.add(s);let r=new nl(-90,1,t,e);r.layers=this.layers,this.add(r);let n=new nl(-90,1,t,e);n.layers=this.layers,this.add(n);let a=new nl(-90,1,t,e);a.layers=this.layers,this.add(a);let o=new nl(-90,1,t,e);o.layers=this.layers,this.add(o);let h=new nl(-90,1,t,e);h.layers=this.layers,this.add(h)}updateCoordinateSystem(){let t=this.coordinateSystem,e=this.children.concat(),[i,s,r,n,a,o]=e;for(let t of e)this.remove(t);if(t===iA)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),n.up.set(0,0,1),n.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else if(t===iT)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),n.up.set(0,0,-1),n.lookAt(0,-1,0),a.up.set(0,-1,0),a.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,n,a,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,t.setRenderTarget(i,0,s),t.render(e,r),t.setRenderTarget(i,1,s),t.render(e,n),t.setRenderTarget(i,2,s),t.render(e,a),t.setRenderTarget(i,3,s),t.render(e,o),t.setRenderTarget(i,4,s),t.render(e,h),i.texture.generateMipmaps=m,t.setRenderTarget(i,5,s),t.render(e,l),t.setRenderTarget(u,c,p),t.xr.enabled=d,i.texture.needsPMREMUpdate=!0}}class nc extends i9{constructor(t,e,i,s,r,n,a,o,h,l){super(t=void 0!==t?t:[],e=void 0!==e?e:ty,i,s,r,n,a,o,h,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class np extends si{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;let i={width:t,height:t,depth:1};this.texture=new nc([i,i,i,i,i,i],e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:tI}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;let i={uniforms:{tEquirect:{value:null}},vertexShader:`
|
|
2
2
|
|
|
3
3
|
varying vec3 vWorldDirection;
|
|
4
4
|
|