1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2934],{74250:function(t,e,i){let r,s;i.d(e,{$TI:function(){return hB},$V:function(){return hN},$YQ:function(){return ac},ACn:function(){return iV},BFQ:function(){return tY},BG$:function(){return ee},BVF:function(){return J},Bf4:function(){return tm},Bgp:function(){return to},BtG:function(){return sP},CaW:function(){return t2},CdI:function(){return tr},CtA:function(){return tq},Cy:function(){return D},D1R:function(){return t_},D67:function(){return eH},D9w:function(){return tJ},Djp:function(){return et},DvJ:function(){return sS},E2K:function(){return tX},EJi:function(){return oM},EcG:function(){return hW},EoG:function(){return ti},F1y:function(){return eq},F5G:function(){return tG},F5T:function(){return rK},FDw:function(){return tA},FM8:function(){return ia},FT0:function(){return oC},FUD:function(){return eo},GG6:function(){return en},GUF:function(){return eA},Gih:function(){return ea},Gql:function(){return hf},H7L:function(){return id},HdW:function(){return ed},HkE:function(){return hb},Hy8:function(){return N},Hyl:function(){return aS},I3e:function(){return e7},IEO:function(){return nc},IKL:function(){return oS},ILR:function(){return tQ},IOt:function(){return eM},Ilk:function(){return rY},JCZ:function(){return e2},JOQ:function(){return nz},JQ4:function(){return tB},JUT:function(){return ij},Jjb:function(){return eY},KI_:function(){return e_},KhW:function(){return B},Kj0:function(){return sM},Kz5:function(){return tk},L5s:function(){return hm},LSk:function(){return e0},LY2:function(){return tn},LgZ:function(){return R},LsT:function(){return tC},Ltg:function(){return iN},Lun:function(){return oz},M$G:function(){return eG},M5h:function(){return w},M6v:function(){return $},M8C:function(){return is},Mig:function(){return hh},MyG:function(){return eN},N4l:function(){return M},NDo:function(){return tt},NKc:function(){return W},NYV:function(){return ei},NiX:function(){return sF},Ns1:function(){return Q},O4K:function(){return ib},O5A:function(){return ix},O78:function(){return eZ},O7d:function(){return oi},OAl:function(){return ej},ORg:function(){return th},OTo:function(){return tL},OoA:function(){return tx},Ox3:function(){return ho},PA7:function(){return ew},PMe:function(){return o9},Pa4:function(){return ih},PeU:function(){return h},QO2:function(){return ep},Qey:function(){return iM},QmN:function(){return o},RSm:function(){return o_},Rhp:function(){return sA},RlZ:function(){return F},RsA:function(){return a},RvT:function(){return eD},S2y:function(){return u},S9g:function(){return ry},SUY:function(){return hM},Se2:function(){return H},Sm8:function(){return I},SvJ:function(){return el},T6w:function(){return e$},T95:function(){return tz},T_1:function(){return hD},T_J:function(){return eR},T_f:function(){return hl},TlE:function(){return r7},Tme:function(){return rB},Tn7:function(){return ox},TyD:function(){return tv},UCm:function(){return tF},USm:function(){return rm},UY4:function(){return ar},UZH:function(){return n},UcC:function(){return hV},Uk6:function(){return oy},UlW:function(){return ex},V1s:function(){return sC},Vdb:function(){return V},Vkp:function(){return ic},VzW:function(){return tO},W2J:function(){return eQ},WMw:function(){return b},WXh:function(){return om},Wbm:function(){return A},Wid:function(){return ob},Wl3:function(){return y},Wpd:function(){return L},WwZ:function(){return eg},Wzm:function(){return au},Xaj:function(){return S},YBo:function(){return oA},YGz:function(){return ts},YLQ:function(){return tb},ZAu:function(){return sV},ZRs:function(){return eB},ZTh:function(){return ey},ZXd:function(){return hU},Zen:function(){return eX},Zr5:function(){return q},ZzF:function(){return iD},Zzh:function(){return hj},_12:function(){return oo},_AM:function(){return tK},_Li:function(){return f},_MY:function(){return c},_RZ:function(){return e1},_am:function(){return sR},_fP:function(){return io},_iA:function(){return p},_wr:function(){return j},a$l:function(){return se},aCh:function(){return eS},aH4:function(){return tM},aLr:function(){return i4},aNw:function(){return oZ},ad5:function(){return eI},av9:function(){return tH},bGH:function(){return _},bdR:function(){return v},brP:function(){return tU},bsb:function(){return eu},c8b:function(){return C},cLu:function(){return tE},cPb:function(){return sE},cac:function(){return ig},ce8:function(){return ek},cek:function(){return hs},cum:function(){return eW},dSO:function(){return td},dZ3:function(){return ta},dd2:function(){return iL},dj0:function(){return eK},dpR:function(){return o1},dwf:function(){return s_},dwk:function(){return m},e62:function(){return st},eD:function(){return X},eMJ:function(){return eP},eaV:function(){return t1},ehD:function(){return g},ejS:function(){return ae},ekQ:function(){return t4},epp:function(){return iT},f2y:function(){return ec},fHI:function(){return am},fSK:function(){return P},fY$:function(){return tc},fto:function(){return t3},g8_:function(){return ty},gJg:function(){return nR},ghN:function(){return k},gi4:function(){return t9},hEm:function(){return tW},hH6:function(){return oQ},iAb:function(){return tI},iKG:function(){return hn},iMs:function(){return hE},iWC:function(){return O},iWj:function(){return nB},iiP:function(){return eh},irR:function(){return tP},j17:function(){return ez},j4z:function(){return eU},jFi:function(){return x},jZA:function(){return t7}
1,jes:function(){return U},jfJ:function(){return eO},jwo:function(){return eL},jyz:function(){return sI},k0A:function(){return tR},k74:function(){return E},kB5:function(){return sH},kaV:function(){return oI},ksN:function(){return Z},l0P:function(){return t5},l6D:function(){return eT},lCJ:function(){return r9},lGU:function(){return ef},lRF:function(){return oT},lb7:function(){return ny},lk7:function(){return hc},mSO:function(){return eb},nls:function(){return nK},ntZ:function(){return d},oAp:function(){return sN},oDz:function(){return sT},oqc:function(){return eE},p3g:function(){return iF},pBf:function(){return e3},pKu:function(){return es},ptH:function(){return t6},qhX:function(){return K},qkB:function(){return tD},qlB:function(){return r8},qyh:function(){return tS},rDY:function(){return sz},rOj:function(){return T},r_:function(){return z},rpg:function(){return tf},tNt:function(){return iw},tQZ:function(){return tV},tm_:function(){return l},u7G:function(){return hp},u9r:function(){return sl},uL9:function(){return te},uWy:function(){return tg},uXU:function(){return eV},v3W:function(){return t$},vBJ:function(){return r0},vCF:function(){return G},vCx:function(){return t0},vmT:function(){return o3},vpT:function(){return sW},vuL:function(){return em},vxC:function(){return tp},w$m:function(){return Y},wJv:function(){return tN},wem:function(){return tw},wk1:function(){return tj},woe:function(){return ah},wuA:function(){return tZ},x12:function(){return n7},x5V:function(){return eC},xEZ:function(){return iP},xJs:function(){return er},xeV:function(){return sq},xfE:function(){return tu},xo$:function(){return ou},xoQ:function(){return eJ},xoR:function(){return ow},xsS:function(){return sU},y2t:function(){return t8},yGw:function(){return rs},yHo:function(){return iS},yj7:function(){return aN},yt0:function(){return eF},ywz:function(){return tT},z$h:function(){return ev},zHn:function(){return rr},zf8:function(){return ad}});/** 2 * @license 3 * Copyright 2010-2025 Three.js Authors 4 * SPDX-License-Identifier: MIT 5 */let n="178",a={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},o={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},h=0,l=1,u=2,c=0,p=1,d=2,m=3,y=0,f=1,g=2,x=0,v=1,b=2,M=3,w=4,S=5,_=100,A=101,T=102,z=103,I=104,C=200,k=201,B=202,O=203,E=204,R=205,P=206,N=207,V=208,L=209,F=210,j=211,D=212,U=213,W=214,J=0,H=1,q=2,G=3,X=4,Z=5,Y=6,$=7,Q=0,K=1,tt=2,te=0,ti=1,tr=2,ts=3,tn=4,ta=5,to=6,th=7,tl="attached",tu=300,tc=301,tp=302,td=303,tm=304,ty=306,tf=1e3,tg=1001,tx=1002,tv=1003,tb=1004,tM=1005,tw=1006,tS=1007,t_=1008,tA=1008,tT=1009,tz=1010,tI=1011,tC=1012,tk=1013,tB=1014,tO=1015,tE=1016,tR=1017,tP=1018,tN=1020,tV=35902,tL=1021,tF=1022,tj=1023,tD=1026,tU=1027,tW=1028,tJ=1029,tH=1030,tq=1031,tG=1032,tX=1033,tZ=33776,tY=33777,t$=33778,tQ=33779,tK=35840,t0=35841,t1=35842,t2=35843,t3=36196,t5=37492,t4=37496,t6=37808,t7=37809,t8=37810,t9=37811,et=37812,ee=37813,ei=37814,er=37815,es=37816,en=37817,ea=37818,eo=37819,eh=37820,el=37821,eu=36492,ec=36494,ep=36495,ed=36283,em=36284,ey=36285,ef=36286,eg=0,ex=1,ev=2,eb=3201,eM=0,ew=1,eS="",e_="srgb",eA="srgb-linear",eT="linear",ez="srgb",eI=0,eC=7680,ek=7681,eB=7682,eO=7683,eE=34055,eR=34056,eP=5386,eN=512,eV=513,eL=514,eF=515,ej=516,eD=517,eU=518,eW=519,eJ=512,eH=513,eq=514,eG=515,eX=516,eZ=517,eY=518,e$=519,eQ=35044,eK=35048,e0="300 es",e1=2e3,e2=2001;class e3{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 r=i[t];if(void 0!==r){let t=r.indexOf(e);-1!==t&&r.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,r=e.length;i<r;i++)e[i].call(this,t);t.target=null}}}let e5=["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","5
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"],e4=1234567,e6=Math.PI/180,e7=180/Math.PI;function e8(){let t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(e5[255&t]+e5[t>>8&255]+e5[t>>16&255]+e5[t>>24&255]+"-"+e5[255&e]+e5[e>>8&255]+"-"+e5[e>>16&15|64]+e5[e>>24&255]+"-"+e5[63&i|128]+e5[i>>8&255]+"-"+e5[i>>16&255]+e5[i>>24&255]+e5[255&r]+e5[r>>8&255]+e5[r>>16&255]+e5[r>>24&255]).toLowerCase()}function e9(t,e,i){return Math.max(e,Math.min(i,t))}function it(t,e){return(t%e+e)%e}function ie(t,e,i){return(1-i)*t+i*e}function ii(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 ir(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 is={DEG2RAD:e6,RAD2DEG:e7,generateUUID:e8,clamp:e9,euclideanModulo:it,mapLinear:function(t,e,i,r,s){return r+(t-e)*(s-r)/(i-e)},inverseLerp:function(t,e,i){return t!==e?(i-t)/(e-t):0},lerp:ie,damp:function(t,e,i,r){return ie(t,e,1-Math.exp(-i*r))},pingpong:function(t,e=1){return e-Math.abs(it(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&&(e4=t);let e=e4+=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*e6},radToDeg:function(t){return t*e7},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,r,s){let n=Math.cos,a=Math.sin,o=n(i/2),h=a(i/2),l=n((e+r)/2),u=a((e+r)/2),c=n((e-r)/2),p=a((e-r)/2),d=n((r-e)/2),m=a((r-e)/2);switch(s){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: "+s)}},normalize:ir,denormalize:ii};class ia{constructor(t=0,e=0){ia.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,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6],this.y=r[1]*e+r[4]*i+r[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=e9(this.x,t.x,e.x),this.y=e9(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=e9(this.x,t,e),this.y=e9(this.y,t,e),this}clampLength(t,e){let i=this.length();return this.divideScalar(i||1).multiplyScalar(e9(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}
vendor: 10,495 bytes, line 5
5round(){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(e9(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),r=Math.sin(e),s=this.x-t.x,n=this.y-t.y;return this.x=s*i-n*r+t.x,this.y=s*r+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 io{constructor(t=0,e=0,i=0,r=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=i,this._w=r}static slerpFlat(t,e,i,r,s,n,a){let o=i[r+0],h=i[r+1],l=i[r+2],u=i[r+3],c=s[n+0],p=s[n+1],d=s[n+2],m=s[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,r=1-e*e;if(r>Number.EPSILON){let s=Math.sqrt(r),n=Math.atan2(s,e*i);t=Math.sin(t*n)/s,a=Math.sin(a*n)/s}let s=a*i;if(o=o*t+c*s,h=h*t+p*s,l=l*t+d*s,u=u*t+m*s,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,r,s,n){let a=i[r],o=i[r+1],h=i[r+2],l=i[r+3],u=s[n],c=s[n+1],p=s[n+2],d=s[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,r){return this._x=t,this._y=e,this._z=i,this._w=r,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,r=t._y,s=t._z,n=t._order,a=Math.cos,o=Math.sin,h=a(i/2),l=a(r/2),u=a(s/2),c=o(i/2),p=o(r/2),d=o(s/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,r=Math.sin(i);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,i=e[0],r=e[4],s=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=(s-h)*t,this._z=(n-r)*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=(r+n)/t,this._z=(s+h)/t}else if(a>u){let t=2*Math.sqrt(1+a-i-u);this._w=(s-h)/t,this._x=(r+n)/t,this._y=.25*t,this._z=(o+l)/t}else{let t=2*Math.sqrt(1+u-i-a);this._w=(n-r)/t,this._x=(s+h)/t,this._y=(o+l)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return i<1e-8?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0):(this._x=0,this._y=-t.z,this._z=t.y)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x),this._w=i,this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(e9(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,r=t._y,s=t._z,n=t._w,a=e._x,o=e._y,h=e._z,l=e._w;return this._x=i*l+n*a+r*h-s*o,this._y=r*l+n*o+s*a-i*h,this._z=s*l+n*h+i*o-r*a,this._w=n*l-i*a-r*o-s*h,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);let i=this._x,r=this._y,s=this._z,n=this._w,a=n*t._w+i*t._x+r*t._y+s*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=r,this._z=s,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*r+e*this._y,this._z=t*s+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=r*u+this._y*c,this._z=s*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(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(t),r*Math.cos(t),s*Math.sin(e),s*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 ih{constructor(t=0,e=0,i=0){ih.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(iu.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(iu.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,i=this.y,r=this.z,s=t.elements;return this.x=s[0]*e+s[3]*i+s[6]*r,this.y=s[1]*e+s[4]*i+s[7]*r,this.z=s[2]*e+s[5]*i+s[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,i=this.y,r=this.z,s=t.elements,n=1/(s[3]*e+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*e+s[4]*i+s[8]*r+s[12])*n,this.y=(s[1]*e+s[5]*i+s[9]*r+s[13])*n,this.z=(s[2]*e+s[6]*i+s[10]*r+s[14])*n,this}applyQuaternion(t){let e=this.x,i=this.y,r=this.z,s=t.x,n=t.y,a=t.z,o=t.w,h=2*(n*r-a*i),l=2*(a*e-s*r),u=2*(s*i-n*e);return this.x=e+o*h+n*u-a*l,this.y=i+o*l+a*h-s*u,this.z=r+o*u+s*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,r=this.z,s=t.elements;return this.x=s[0]*e+s[4]*i+s[8]*r,this.y=s[1]*e+s[5]*i+s[9]*r,this.z=s[2]*e+s[6]*i+s[10]*r,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=e9(this.x,t.x,e.x),this.y=e9(this.y,t.y,e.y),this.z=e9(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=e9(this.x,t,e),this.y=e9(this.y,t,e),this.z=e9(this.z,t,e),this}clampLength(t,e){let i=this.length();return this.divideScalar(i||1).multiplyScalar(e9(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}
vendor: 4,236 bytes, line 5
5round(){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,r=t.y,s=t.z,n=e.x,a=e.y,o=e.z;return this.x=r*o-s*a,this.y=s*n-i*o,this.z=i*a-r*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 il.copy(this).projectOnVector(t),this.sub(il)}reflect(t){return this.sub(il.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(e9(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,r=this.z-t.z;return e*e+i*i+r*r}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 r=Math.sin(e)*t;return this.x=r*Math.sin(i),this.y=Math.cos(e)*t,this.z=r*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(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=r,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 il=new ih,iu=new io;class ic{constructor(t,e,i,r,s,n,a,o,h){ic.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,i,r,s,n,a,o,h)}set(t,e,i,r,s,n,a,o,h){let l=this.elements;return l[0]=t,l[1]=r,l[2]=a,l[3]=e,l[4]=s,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,r=e.elements,s=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=r[0],y=r[3],f=r[6],g=r[1],x=r[4],v=r[7],b=r[2],M=r[5],w=r[8];return s[0]=n*m+a*g+o*b,s[3]=n*y+a*x+o*M,s[6]=n*f+a*v+o*w,s[1]=h*m+l*g+u*b,s[4]=h*y+l*x+u*M,s[7]=h*f+l*v+u*w,s[2]=c*m+p*g+d*b,s[5]=c*y+p*x+d*M,s[8]=c*f+p
5*v+d*w,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){let t=this.elements,e=t[0],i=t[1],r=t[2],s=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*s*l+i*a*o+r*s*h-r*n*o}invert(){let t=this.elements,e=t[0],i=t[1],r=t[2],s=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*s,p=h*s-n*o,d=e*u+i*c+r*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]=(r*h-l*i)*m,t[2]=(a*i-r*n)*m,t[3]=c*m,t[4]=(l*e-r*o)*m,t[5]=(r*s-a*e)*m,t[6]=p*m,t[7]=(i*o-h*e)*m,t[8]=(n*e-i*s)*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,r,s,n,a){let o=Math.cos(s),h=Math.sin(s);return this.set(i*o,i*h,-i*(o*n+h*a)+n+t,-r*h,r*o,-r*(-h*n+o*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(ip.makeScale(t,e)),this}rotate(t){return this.premultiply(ip.makeRotation(-t)),this}translate(t,e){return this.premultiply(ip.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 ip=new ic;function id(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}let im={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function iy(t,e){return new im[t](e)}function ig(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function ix(){let t=ig("canvas");return t.style.display="block",t}let iv={};function ib(t){t in iv||(iv[t]=!0,console.warn(t))}function iM(t,e,i){return new Promise(function(r,s){setTimeout(function n(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:s();break;case t.TIMEOUT_EXPIRED:setTimeout(n,i);break;default:r()}},i)})}function iw(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 iS(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 i_=new ic().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),iA=new ic().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),iT=function(){let t={enabled:!0,workingColorSpace:eA,spaces:{},convert:function(t,e,i){return!1!==this.enabled&&e!==i&&e&&i&&(this.spaces[e].transfer===ez&&(t.r=iz(t.r),t.g=iz(t.g),t.b=iz(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===ez&&(t.r=iI(t.r),t.g=iI(t.g),t.b=iI(t.b))),t},workingToColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},colorSpaceToWorking:function(t,e){return this.convert(t,e,this.workingColorSpace)},getPrimaries:function(t){return this.spaces[t].primaries},getTransfer:function(t){return t===eS?eT: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},fromWorkingColorSpace:function(e,i){return ib("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),t.w
5orkingToColorSpace(e,i)},toWorkingColorSpace:function(e,i){return ib("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),t.colorSpaceToWorking(e,i)}},e=[.64,.33,.3,.6,.15,.06],i=[.2126,.7152,.0722],r=[.3127,.329];return t.define({[eA]:{primaries:e,whitePoint:r,transfer:eT,toXYZ:i_,fromXYZ:iA,luminanceCoefficients:i,workingColorSpaceConfig:{unpackColorSpace:e_},outputColorSpaceConfig:{drawingBufferColorSpace:e_}},[e_]:{primaries:e,whitePoint:r,transfer:ez,toXYZ:i_,fromXYZ:iA,luminanceCoefficients:i,outputColorSpaceConfig:{drawingBufferColorSpace:e_}}}),t}();function iz(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function iI(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}class iC{static getDataURL(t,e="image/png"){let i;if(/^data:/i.test(t.src)||"undefined"==typeof HTMLCanvasElement)return t.src;if(t instanceof HTMLCanvasElement)i=t;else{void 0===r&&(r=ig("canvas")),r.width=t.width,r.height=t.height;let e=r.getContext("2d");t instanceof ImageData?e.putImageData(t,0,0):e.drawImage(t,0,0,t.width,t.height),i=r}return i.toDataURL(e)}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){let e=ig("canvas");e.width=t.width,e.height=t.height;let i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);let r=i.getImageData(0,0,t.width,t.height),s=r.data;for(let t=0;t<s.length;t++)s[t]=255*iz(s[t]/255);return i.putImageData(r,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*iz(e[t]/255)):e[t]=iz(e[t]);return{data:e,width:t.width,height:t.height}}}}let ik=0;class iB{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:ik++}),this.uuid=e8(),this.data=t,this.dataReady=!0,this.version=0}getSize(t){let e=this.data;return e instanceof HTMLVideoElement?t.set(e.videoWidth,e.videoHeight):null!==e?t.set(e.width,e.height,e.depth||0):t.set(0,0,0),t}set needsUpdate(t){!0===t&&this.version++}toJSON(t){let e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];let i={uuid:this.uuid,url:""},r=this.data;if(null!==r){let t;if(Array.isArray(r)){t=[];for(let e=0,i=r.length;e<i;e++)r[e].isDataTexture?t.push(iO(r[e].image)):t.push(iO(r[e]))}else t=iO(r);i.url=t}return e||(t.images[this.uuid]=i),i}}function iO(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?iC.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 iE=0,iR=new ih;class iP extends e3{constructor(t=iP.DEFAULT_IMAGE,e=iP.DEFAULT_MAPPING,i=tg,r=tg,s=tw,n=t_,a=tj,o=tT,h=iP.DEFAULT_ANISOTROPY,l=eS){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:iE++}),this.uuid=e8(),this.name="",this.source=new iB(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=n,this.anisotropy=h,this.format=a,this.internalFormat=null,this.type=o,this.offset=new ia(0,0),this.repeat=new ia(1,1),this.center=new ia(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ic,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=l,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!t&&!!t.depth&&t.depth>1,this.pmremVersion=0}get width(){return this.source.getSize(iR).x}get height(){return this.source.getSize(iR).y}get depth(){return this.source.getSize(iR).z}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)}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.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
5=t.colorSpace,this.renderTarget=t.renderTarget,this.isRenderTargetTexture=t.isRenderTargetTexture,this.isArrayTexture=t.isArrayTexture,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}setValues(t){for(let e in t){let i=t[e];if(void 0===i){console.warn(`THREE.Texture.setValues(): parameter '${e}' has value of undefined.`);continue}let r=this[e];if(void 0===r){console.warn(`THREE.Texture.setValues(): property '${e}' does not exist.`);continue}r&&i&&r.isVector2&&i.isVector2?r.copy(i):r&&i&&r.isVector3&&i.isVector3?r.copy(i):r&&i&&r.isMatrix3&&i.isMatrix3?r.copy(i):this[e]=i}}toJSON(t){let e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];let i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,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!==tu)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case tf:t.x=t.x-Math.floor(t.x);break;case tg:t.x=t.x<0?0:1;break;case tx: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 tf:t.y=t.y-Math.floor(t.y);break;case tg:t.y=t.y<0?0:1;break;case tx: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++}}iP.DEFAULT_IMAGE=null,iP.DEFAULT_MAPPING=tu,iP.DEFAULT_ANISOTROPY=1;class iN{constructor(t=0,e=0,i=0,r=1){iN.prototype.isVector4=!0,this.x=t,this.y=e,this.z=i,this.w=r}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,r){return this.x=t,this.y=e,this.z=i,this.w=r,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,r=this.z,s=this.w,n=t.elements;return this.x=n[0]*e+n[4]*i+n[8]*r+n[12]*s,this.y=n[1]*e+n[5]*i+n[9]*r+n[13]*s,this.z=n[2]*e+n[6]*i+n[10]*r+n[14]*s,this.w=n[3]*e+n[7]*i+n[11]*r+n[15]*s,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,r,s;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,y=(m+1)/2,f=(o+l)/4,g=(h+p)/4,x=(c+d)/4;return t>n&&t>y?t<.01?(i=0,r=.707106781,s=.707106781):(r=f/(i=Math.sqrt(t)),s=g/i):n>y?n<.01?(i=.707106781,r=0,s=.707106781):(i=f/(r=Math.sqrt(n)),s=x/r):y<.01?(i=.707106781,r=.707106781,s=0):(i=g/(s=Math.sqrt(y)),r=x/s),this.set(i,r,s,e),this}let y=Math.sqrt((d-c)*(d-c)+(h-p)*(h-p)+(l-o)*(l-o));return .001>Math.abs(y)&&(y=1),this.x=(d-c)/y,this.y=(h-p)/y,this.z=(l-o)/y,this.w=Math.acos((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=e9(this.x,t.x,e.x),this.y=e9(this.y,t.y,e.y),this.z=e9(this.z,t.z,e.z),this.w=e9(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=e9(this.x,t,e),this.y=e9(this.y,t,e),this.z=e9(this.z,t,e),this.w=e9(this.w,t,e),this}clampLength(t,e){let i=this.length();return this.divideScalar(i||1).multiplyScalar(e9(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}
vendor: 4,615 bytes, line 5
5round(){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 iV extends e3{constructor(t=1,e=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:tw,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=i.depth,this.scissor=new iN(0,0,t,e),this.scissorTest=!1,this.viewport=new iN(0,0,t,e);let r=new iP({width:t,height:e,depth:i.depth});this.textures=[];let s=i.count;for(let t=0;t<s;t++)this.textures[t]=r.clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;this._setTextureOptions(i),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,this.multiview=i.multiview}_setTextureOptions(t={}){let e={minFilter:tw,generateMipmaps:!1,flipY:!1,internalFormat:null};void 0!==t.mapping&&(e.mapping=t.mapping),void 0!==t.wrapS&&(e.wrapS=t.wrapS),void 0!==t.wrapT&&(e.wrapT=t.wrapT),void 0!==t.wrapR&&(e.wrapR=t.wrapR),void 0!==t.magFilter&&(e.magFilter=t.magFilter),void 0!==t.minFilter&&(e.minFilter=t.minFilter),void 0!==t.format&&(e.format=t.format),void 0!==t.type&&(e.type=t.type),void 0!==t.anisotropy&&(e.anisotropy=t.anisotropy),void 0!==t.colorSpace&&(e.colorSpace=t.colorSpace),void 0!==t.flipY&&(e.flipY=t.flipY),void 0!==t.generateMipmaps&&(e.generateMipmaps=t.generateMipmaps),void 0!==t.internalFormat&&(e.internalFormat=t.internalFormat);for(let t=0;t<this.textures.length;t++)this.textures[t].setValues(e)}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}set depthTexture(t){null!==this._depthTexture&&(this._depthTexture.renderTarget=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 r=0,s=this.textures.length;r<s;r++)this.textures[r].image.width=t,this.textures[r].image.height=e,this.textures[r].image.depth=i,this.textures[r].isArrayTexture=this.textures[r].image.depth>1;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,i=t.textures.length;e<i;e++){this.textures[e]=t.textures[e].clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;let i=Object.assign({},t.textures[e].image);this.textures[e].source=new iB(i)}return 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 iL extends iV{constructor(t=1,e=1,i={}
vendor: 4,442 bytes, line 5
5){super(t,e,i),this.isWebGLRenderTarget=!0}}class iF extends iP{constructor(t=null,e=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:i,depth:r},this.magFilter=tv,this.minFilter=tv,this.wrapR=tg,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class ij extends iP{constructor(t=null,e=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:i,depth:r},this.magFilter=tv,this.minFilter=tv,this.wrapR=tg,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class iD{constructor(t=new ih(Infinity,Infinity,Infinity),e=new ih(-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(iW.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,i=t.count;e<i;e++)this.expandByPoint(iW.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=iW.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 r=i.getAttribute("position");if(!0===e&&void 0!==r&&!0!==t.isInstancedMesh)for(let e=0,i=r.count;e<i;e++)!0===t.isMesh?t.getVertexPosition(e,iW):iW.fromBufferAttribute(r,e),iW.applyMatrix4(t.matrixWorld),this.expandByPoint(iW);else void 0!==t.boundingBox?(null===t.boundingBox&&t.computeBoundingBox(),iJ.copy(t.boundingBox)):(null===i.boundingBox&&i.computeBoundingBox(),iJ.copy(i.boundingBox)),iJ.applyMatrix4(t.matrixWorld),this.union(iJ)}let r=t.children;for(let t=0,i=r.length;t<i;t++)this.expandByObject(r[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,iW),iW.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(i$),iQ.subVectors(this.max,i$),iH.subVectors(t.a,i$),iq.subVectors(t.b,i$),iG.subVectors(t.c,i$),iX.subVectors(iq,iH),iZ.subVectors(iG,iq),iY.subVectors(iH,iG);let e=[0,-iX.z,iX.y,0,-iZ.z,iZ.y,0,-iY.z,iY.y,iX.z,0,-iX.x,iZ.z,0,-iZ.x,iY.z,0,-iY.x,-iX.y,iX.x,0,-iZ.y,iZ.x,0,-iY.y,iY.x,0];return!!(i1(e,iH,iq,iG,iQ)&&i1(e=[1,0,0,0,1,0,0,0,1],iH,iq,iG,iQ))&&(iK.crossVectors(iX,iZ),i1(e=[iK.x,iK.y,iK.z],iH,iq,iG,iQ))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,iW).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radiu
5s=.5*this.getSize(iW).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()||(iU[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),iU[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),iU[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),iU[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),iU[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),iU[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),iU[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),iU[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(iU)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(t){return this.min.fromArray(t.min),this.max.fromArray(t.max),this}}let iU=[new ih,new ih,new ih,new ih,new ih,new ih,new ih,new ih],iW=new ih,iJ=new iD,iH=new ih,iq=new ih,iG=new ih,iX=new ih,iZ=new ih,iY=new ih,i$=new ih,iQ=new ih,iK=new ih,i0=new ih;function i1(t,e,i,r,s){for(let n=0,a=t.length-3;n<=a;n+=3){i0.fromArray(t,n);let a=s.x*Math.abs(i0.x)+s.y*Math.abs(i0.y)+s.z*Math.abs(i0.z),o=e.dot(i0),h=i.dot(i0),l=r.dot(i0);if(Math.max(-Math.max(o,h,l),Math.min(o,h,l))>a)return!1}return!0}let i2=new iD,i3=new ih,i5=new ih;class i4{constructor(t=new ih,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):i2.setFromPoints(t).getCenter(i);let r=0;for(let e=0,s=t.length;e<s;e++)r=Math.max(r,i.distanceToSquared(t[e]));return this.radius=Math.sqrt(r),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;i3.subVectors(t,this.center);let e=i3.lengthSq();if(e>this.radius*this.radius){let t=Math.sqrt(e),i=(t-this.radius)*.5;this.center.addScaledVector(i3,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):(i5.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(i3.copy(t.center).add(i5)),this.expandByPoint(i3.copy(t.center).sub(i5)))),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(t){return this.radius=t.radius,this.center.fromArray(t.center),this}}let i6=new ih,i7=new ih,i8=new ih,i9=new ih,rt=new ih,re=new ih,ri=new ih;class rr{constructor(t=new ih,e=new ih(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,i6)),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=i6.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(i6.copy(this.origin).addScaledVector(this.direction,e),i6.distanceToSquared(t))}distanceSqToSegment(t,e,i,r){let s,n,a,o;i7.copy(t).add(e).multiplyScalar(.5),i8.copy(e).sub(t).normalize(),i9.copy(this.origin).sub(i7);
5let h=.5*t.distanceTo(e),l=-this.direction.dot(i8),u=i9.dot(this.direction),c=-i9.dot(i8),p=i9.lengthSq(),d=Math.abs(1-l*l);if(d>0){if(s=l*c-u,n=l*u-c,o=h*d,s>=0){if(n>=-o){if(n<=o){let t=1/d;s*=t,n*=t,a=s*(s+l*n+2*u)+n*(l*s+n+2*c)+p}else a=-(s=Math.max(0,-(l*(n=h)+u)))*s+n*(n+2*c)+p}else a=-(s=Math.max(0,-(l*(n=-h)+u)))*s+n*(n+2*c)+p}else n<=-o?(n=(s=Math.max(0,-(-l*h+u)))>0?-h:Math.min(Math.max(-h,-c),h),a=-s*s+n*(n+2*c)+p):n<=o?(s=0,a=(n=Math.min(Math.max(-h,-c),h))*(n+2*c)+p):(n=(s=Math.max(0,-(l*h+u)))>0?h:Math.min(Math.max(-h,-c),h),a=-s*s+n*(n+2*c)+p)}else n=l>0?-h:h,a=-(s=Math.max(0,-(l*n+u)))*s+n*(n+2*c)+p;return i&&i.copy(this.origin).addScaledVector(this.direction,s),r&&r.copy(i7).addScaledVector(i8,n),a}intersectSphere(t,e){i6.subVectors(t.center,this.origin);let i=i6.dot(this.direction),r=i6.dot(i6)-i*i,s=t.radius*t.radius;if(r>s)return null;let n=Math.sqrt(s-r),a=i-n,o=i+n;return o<0?null:a<0?this.at(o,e):this.at(a,e)}intersectsSphere(t){return!(t.radius<0)&&this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){let e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;let i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){let i=this.distanceToPlane(t);return null===i?null:this.at(i,e)}intersectsPlane(t){let e=t.distanceToPoint(this.origin);return!!(0===e||t.normal.dot(this.direction)*e<0)}intersectBox(t,e){let i,r,s,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,r=(t.max.x-c.x)*h):(i=(t.max.x-c.x)*h,r=(t.min.x-c.x)*h),l>=0?(s=(t.min.y-c.y)*l,n=(t.max.y-c.y)*l):(s=(t.max.y-c.y)*l,n=(t.min.y-c.y)*l),i>n||s>r)?null:((s>i||isNaN(i))&&(i=s),(n<r||isNaN(r))&&(r=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>r)?null:((a>i||i!=i)&&(i=a),(o<r||r!=r)&&(r=o),r<0)?null:this.at(i>=0?i:r,e)}intersectsBox(t){return null!==this.intersectBox(t,i6)}intersectTriangle(t,e,i,r,s){let n;rt.subVectors(e,t),re.subVectors(i,t),ri.crossVectors(rt,re);let a=this.direction.dot(ri);if(a>0){if(r)return null;n=1}else{if(!(a<0))return null;n=-1,a=-a}i9.subVectors(this.origin,t);let o=n*this.direction.dot(re.crossVectors(i9,re));if(o<0)return null;let h=n*this.direction.dot(rt.cross(i9));if(h<0||o+h>a)return null;let l=-n*i9.dot(ri);return l<0?null:this.at(l/a,s)}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 rs{constructor(t,e,i,r,s,n,a,o,h,l,u,c,p,d,m,y){rs.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,r,s,n,a,o,h,l,u,c,p,d,m,y)}set(t,e,i,r,s,n,a,o,h,l,u,c,p,d,m,y){let f=this.elements;return f[0]=t,f[4]=e,f[8]=i,f[12]=r,f[1]=s,f[5]=n,f[9]=a,f[13]=o,f[2]=h,f[6]=l,f[10]=u,f[14]=c,f[3]=p,f[7]=d,f[11]=m,f[15]=y,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new rs().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,r=1/rn.setFromMatrixColumn(t,0).length(),s=1/rn.setFromMatrixColumn(t,1).length(),n=1/rn.setFromMatrixColumn(t,2).length();return e[0]=i[0]*r,e[1]=i[1]*r,e[2]=i[2]*r,e[3]=0,e[4]=i[4]*s,e[5]=i[5]*s,e[6]=i[6]*s,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,r=t.y,s=t.z,n=Math.cos(i),a=Math.sin(i),o=Math.cos(r),h=Math.sin(r),l=Math.cos(s),u=Math.sin(s);if("XYZ"===t.order){let t=n*l,i=n*u,r=a*l,s=a*u;e[0]=o*l,e[4]=-o*u,e[8]=h,e[1]=i+r*h,e[5]=t-s*h,e[9]=-a*o,e[2]=s-t*h,e[6]=r+i*h,e[10]=n*o}else if("YXZ"===t.order){let t=o*l,i=o*u,r=h*l,s=h*u;e[0]=t+s*a,e[4]=r*a-i,e[8]=n*h,e[1]=n*u,e[5]=n*l,e[9]=-a,e[2]=i*a-r,e[6]=s+t*a,e[10]=n*o}else if("ZXY"===t.order){let t=o*l,i=o*u,r=h*l,s=h*u;e[0]=t-s*a,e[4]=-n*u,e[8]=r+i*a,e[1]=i+r*a,e[5]=n*l,e[9]=s-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,r=a*l,s=a*u;e[0]=o*l,e[4]=r*h-i,e[8]=t*h+s,e[1]=o*u,e[5]=s*h+t,e[9]=i*h-r,e[2]=-h,e[6]=a*o,e[10]=n*o}else if("YZX"===t.order){let t=n*o,i=n*h,r=a*o,s=a*h;e[0]=o*l,e[4]=s-t*u,e[8]=r*u+i,e[1]=u,e[5]=n*l,e[9]=-a*l,e[2]=-h*l,e[6]=i*u+r,e[10]=t-s*u}
5else if("XZY"===t.order){let t=n*o,i=n*h,r=a*o,s=a*h;e[0]=o*l,e[4]=-u,e[8]=h*l,e[1]=t*u+s,e[5]=n*l,e[9]=i*u-r,e[2]=r*u-i,e[6]=a*l,e[10]=s*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(ro,t,rh)}lookAt(t,e,i){let r=this.elements;return rc.subVectors(t,e),0===rc.lengthSq()&&(rc.z=1),rc.normalize(),rl.crossVectors(i,rc),0===rl.lengthSq()&&(1===Math.abs(i.z)?rc.x+=1e-4:rc.z+=1e-4,rc.normalize(),rl.crossVectors(i,rc)),rl.normalize(),ru.crossVectors(rc,rl),r[0]=rl.x,r[4]=ru.x,r[8]=rc.x,r[1]=rl.y,r[5]=ru.y,r[9]=rc.y,r[2]=rl.z,r[6]=ru.z,r[10]=rc.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let i=t.elements,r=e.elements,s=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],y=i[10],f=i[14],g=i[3],x=i[7],v=i[11],b=i[15],M=r[0],w=r[4],S=r[8],_=r[12],A=r[1],T=r[5],z=r[9],I=r[13],C=r[2],k=r[6],B=r[10],O=r[14],E=r[3],R=r[7],P=r[11],N=r[15];return s[0]=n*M+a*A+o*C+h*E,s[4]=n*w+a*T+o*k+h*R,s[8]=n*S+a*z+o*B+h*P,s[12]=n*_+a*I+o*O+h*N,s[1]=l*M+u*A+c*C+p*E,s[5]=l*w+u*T+c*k+p*R,s[9]=l*S+u*z+c*B+p*P,s[13]=l*_+u*I+c*O+p*N,s[2]=d*M+m*A+y*C+f*E,s[6]=d*w+m*T+y*k+f*R,s[10]=d*S+m*z+y*B+f*P,s[14]=d*_+m*I+y*O+f*N,s[3]=g*M+x*A+v*C+b*E,s[7]=g*w+x*T+v*k+b*R,s[11]=g*S+x*z+v*B+b*P,s[15]=g*_+x*I+v*O+b*N,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],r=t[8],s=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*(+s*o*u-r*h*u-s*a*c+i*h*c+r*a*p-i*o*p)+t[7]*(+e*o*p-e*h*c+s*n*c-r*n*p+r*h*l-s*o*l)+t[11]*(+e*h*u-e*a*p-s*n*u+i*n*p+s*a*l-i*h*l)+t[15]*(-r*a*l-e*o*u+e*a*c+r*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 r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=i),this}invert(){let t=this.elements,e=t[0],i=t[1],r=t[2],s=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],y=t[14],f=t[15],g=u*y*h-m*c*h+m*o*p-a*y*p-u*o*f+a*c*f,x=d*c*h-l*y*h-d*o*p+n*y*p+l*o*f-n*c*f,v=l*m*h-d*u*h+d*a*p-n*m*p-l*a*f+n*u*f,b=d*u*o-l*m*o-d*a*c+n*m*c+l*a*y-n*u*y,M=e*g+i*x+r*v+s*b;if(0===M)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let w=1/M;return t[0]=g*w,t[1]=(m*c*s-u*y*s-m*r*p+i*y*p+u*r*f-i*c*f)*w,t[2]=(a*y*s-m*o*s+m*r*h-i*y*h-a*r*f+i*o*f)*w,t[3]=(u*o*s-a*c*s-u*r*h+i*c*h+a*r*p-i*o*p)*w,t[4]=x*w,t[5]=(l*y*s-d*c*s+d*r*p-e*y*p-l*r*f+e*c*f)*w,t[6]=(d*o*s-n*y*s-d*r*h+e*y*h+n*r*f-e*o*f)*w,t[7]=(n*c*s-l*o*s+l*r*h-e*c*h-n*r*p+e*o*p)*w,t[8]=v*w,t[9]=(d*u*s-l*m*s-d*i*p+e*m*p+l*i*f-e*u*f)*w,t[10]=(n*m*s-d*a*s+d*i*h-e*m*h-n*i*f+e*a*f)*w,t[11]=(l*a*s-n*u*s-l*i*h+e*u*h+n*i*p-e*a*p)*w,t[12]=b*w,t[13]=(l*m*r-d*u*r+d*i*c-e*m*c-l*i*y+e*u*y)*w,t[14]=(d*a*r-n*m*r-d*i*o+e*m*o+n*i*y-e*a*y)*w,t[15]=(n*u*r-l*a*r+l*i*o-e*u*o-n*i*c+e*a*c)*w,this}scale(t){let e=this.elements,i=t.x,r=t.y,s=t.z;return e[0]*=i,e[4]*=r,e[8]*=s,e[1]*=i,e[5]*=r,e[9]*=s,e[2]*=i,e[6]*=r,e[10]*=s,e[3]*=i,e[7]*=r,e[11]*=s,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),r=Math.sin(e),s=1-i,n=t.x,a=t.y,o=t.z,h=s*n,l=s*a;return this.set(h*n+i,h*a-r*o,h*o+r*a,0,h*a+r*o,l*a+i,l*o-r*n,0,h*o-r*a,l*o+r*n,s*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,r,s,n){return this.set(1,i,s,0,t,1,n,0,e,r,1,0,0,0,0,1),this}compose(t,e,i){let r=this.elements,s=e._x,n=e._y,a=e._z,o=e._w,h=s+s,l=n+n,u=a+a,c=s*h,p=s*l,d=s*u,m=n*l,y=n*u,f=a*u,g=o*h,x=o*l,v=o*u,b=i.x,M=i.y,w=i.z;return r[0]=(1-(m+f))*b,r[1]=(p+v)*b,r[2]=(d-x)*b,r[3]=0,r[4]=(p-v)*M,r[5]=(1-(c+f))*M,r[6]=(y+g)*M,r[7]=0,r[8]=(d+x)*w,r[9]=(y-g)*w,r[10]=(1-(c+m))*w,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,i){let r=this.elements,s=rn.set(r[0],r[1],r[2]).length(),n=rn.set(r[4],r[5],r[6]).length(),a=rn.set(r[8],r[9],r[10]).length();0>this.determinant()&&(s=-s),t.x=r[12],t.y=r[13],t.z=r[14],ra.copy(this);let o=1/s,h=1/n,l=1/a;return ra.elements[0]*=o,ra.elements[1]*=o,ra.elements[2]*=o,ra.elements[4]*=h,ra.elements[5]*=h,ra.elements[6]*=h,ra.elements[8]*=l,ra.elements[9]*=l,ra.elements[10]*=l,e.setFromRotationMatrix(ra),i.x=s,i.y=n,i.z=a,this}makePerspective(t,e,i,r,s,n,a=e1){let o,h;let l=this.elements;if(a===e1)o=-(n+s)/(n-s),h=-2*n*s/(n-s);else if(a===e2)o=-n/(n-s),h=-n*s/(n-s);else throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=2*s/(e-t),l[4]=0,l[8]=(e+t)/(e-t),l[12]=0,l[1]=0,l[5]=2*s/(i-r),l[9]=(i+r)/(i-r),l[13]=0,l[2]=0,l[6]=0,l[10
5]=o,l[14]=h,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,i,r,s,n,a=e1){let o,h;let l=this.elements,u=1/(e-t),c=1/(i-r),p=1/(n-s);if(a===e1)o=(n+s)*p,h=-2*p;else if(a===e2)o=s*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+r)*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 rn=new ih,ra=new rs,ro=new ih(0,0,0),rh=new ih(1,1,1),rl=new ih,ru=new ih,rc=new ih,rp=new rs,rd=new io;class rm{constructor(t=0,e=0,i=0,r=rm.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=r}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,r=this._order){return this._x=t,this._y=e,this._z=i,this._order=r,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 r=t.elements,s=r[0],n=r[4],a=r[8],o=r[1],h=r[5],l=r[9],u=r[2],c=r[6],p=r[10];switch(e){case"XYZ":this._y=Math.asin(e9(a,-1,1)),.9999999>Math.abs(a)?(this._x=Math.atan2(-l,p),this._z=Math.atan2(-n,s)):(this._x=Math.atan2(c,h),this._z=0);break;case"YXZ":this._x=Math.asin(-e9(l,-1,1)),.9999999>Math.abs(l)?(this._y=Math.atan2(a,p),this._z=Math.atan2(o,h)):(this._y=Math.atan2(-u,s),this._z=0);break;case"ZXY":this._x=Math.asin(e9(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,s));break;case"ZYX":this._y=Math.asin(-e9(u,-1,1)),.9999999>Math.abs(u)?(this._x=Math.atan2(c,p),this._z=Math.atan2(o,s)):(this._x=0,this._z=Math.atan2(-n,h));break;case"YZX":this._z=Math.asin(e9(o,-1,1)),.9999999>Math.abs(o)?(this._x=Math.atan2(-l,h),this._y=Math.atan2(-u,s)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-e9(n,-1,1)),.9999999>Math.abs(n)?(this._x=Math.atan2(c,h),this._y=Math.atan2(a,s)):(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 rp.makeRotationFromQuaternion(t),this.setFromRotationMatrix(rp,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return rd.setFromEuler(this),this.setFromQuaternion(rd,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}}rm.DEFAULT_ORDER="XYZ";class ry{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 rf=0,rg=new ih,rx=new io,rv=new rs,rb=new ih,rM=new ih,rw=new ih,rS=new io,r_=new ih(1,0,0),rA=new ih(0,1,0),rT=new ih(0,0,1),rz={type:"added"},rI={type:"removed"},rC={type:"childadded",child:null},rk={type:"childremoved",child:null};
vendor: 11,177 bytes, line 5
5class rB extends e3{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:rf++}),this.uuid=e8(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=rB.DEFAULT_UP.clone();let t=new ih,e=new rm,i=new io,r=new ih(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:r},modelViewMatrix:{value:new rs},normalMatrix:{value:new ic}}),this.matrix=new rs,this.matrixWorld=new rs,this.matrixAutoUpdate=rB.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=rB.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new ry,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.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 rx.setFromAxisAngle(t,e),this.quaternion.multiply(rx),this}rotateOnWorldAxis(t,e){return rx.setFromAxisAngle(t,e),this.quaternion.premultiply(rx),this}rotateX(t){return this.rotateOnAxis(r_,t)}rotateY(t){return this.rotateOnAxis(rA,t)}rotateZ(t){return this.rotateOnAxis(rT,t)}translateOnAxis(t,e){return rg.copy(t).applyQuaternion(this.quaternion),this.position.add(rg.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(r_,t)}translateY(t){return this.translateOnAxis(rA,t)}translateZ(t){return this.translateOnAxis(rT,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(rv.copy(this.matrixWorld).invert())}lookAt(t,e,i){t.isVector3?rb.copy(t):rb.set(t,e,i);let r=this.parent;this.updateWorldMatrix(!0,!1),rM.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?rv.lookAt(rM,rb,this.up):rv.lookAt(rb,rM,this.up),this.quaternion.setFromRotationMatrix(rv),r&&(rv.extractRotation(r.matrixWorld),rx.setFromRotationMatrix(rv),this.quaternion.premultiply(rx.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(rz),rC.child=t,this.dispatchEvent(rC),rC.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(rI),rk.child=t,this.dispatchEvent(rk),rk.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),rv.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),rv.multiply(t.parent.matrixWorld)),t.applyMatrix4(rv),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(rz),rC.child=t,this.dispatchEvent(rC),rC.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,r=this.children.length;i<r;i++){let r=this.children[i].getObjectByProperty(t,e);if(void 0!==r)return r}}getObjectsByProperty(t,e,i=[]){this[t]===e&&i.push(this);let r=this.children;for(let s=0,n=r.length;s<n;s++)r[s].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(rM,t,rw),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(rM,rS,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,r=e.length;i<r;i++)e[i].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);let e=this.children;for(let i=0,r=e.length;i<r;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,r=e.length;i<r;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.7,type:"Object",generator:"Object3D.toJSON"});let r={};function s(e,i){return void 0===e[i.uuid]&&(e[i.uuid]=i.toJSON(t)),i.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(t=>({...t,boundingBox:t.boundingBox?t.boundingBox.toJSON():void 0,boundingSphere:t.boundingSphere?t.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(t=>({...t})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(t),r.indirectTexture=this._indirectTexture.toJSON(t),null!==this._colorsTexture&&(r.colorsTexture=this._colorsTexture.toJSON(t)),null!==this.boundingSphere&&(r.boundingSphere=this.boundingSphere.toJSON()),null!==this.boundingBox&&(r.boundingBox=this.boundingBox.toJSON())),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(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,r=i.length;e<r;e++){let r=i[e];s(t.shapes,r)}else s(t.shapes,i)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(s(t.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material){if(Array.isArray(this.material)){let e=[];for(let i=0,r=this.material.length;i<r;i++)e.push(s(t.materials,this.material[i]));r.material=e}else r.material=s(t.materials,this.material)}if(this.children.length>0){r.children=[];for(let e=0;e<this.children.length;e++)r.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){r.animations=[];for(let e=0;e<this.animations.length;e++){let i=this.animations[e];r.animations.push(s(t.animations,i))}}if(e){let e=n(t.geometries),r=n(t.materials),s=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),r.length>0&&(i.materials=r),s.length>0&&(i.textures=s),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=r,i;function n(t){let e=[];for(let i in t){let r=t[i];delete r.metadata,e.push(r)}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}}rB.DEFAULT_UP=new ih(0,1,0),rB.DEFAULT_MATRIX_AUTO_UPDATE=!0,rB.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;let rO=new ih,rE=new ih,rR=new ih,rP=new ih,rN=new ih,rV=new ih,rL=new ih,rF=new ih,rj=new ih,rD=new ih,rU=new iN,rW=new iN,rJ=new iN;class rH{constructor(t=new ih,e=new ih,i=new ih){this.a=t,this.b=e,this.c=i}static getNormal(t,e,i,r){r.subVectors(i,e),rO.subVectors(t,e),r.cross(rO);let s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(t,e,i,r,s){rO.subVectors(r,e),rE.subVectors(i,e),rR.subVectors(t,e);let n=rO.dot(rO),a=rO.dot(rE),o=rO.dot(rR),h=rE.dot(rE),l=rE.dot(rR),u=n*h-a*a;if(0===u)return s.set(0,0,0),null;
5let c=1/u,p=(h*o-a*l)*c,d=(n*l-a*o)*c;return s.set(1-p-d,d,p)}static containsPoint(t,e,i,r){return null!==this.getBarycoord(t,e,i,r,rP)&&rP.x>=0&&rP.y>=0&&rP.x+rP.y<=1}static getInterpolation(t,e,i,r,s,n,a,o){return null===this.getBarycoord(t,e,i,r,rP)?(o.x=0,o.y=0,"z"in o&&(o.z=0),"w"in o&&(o.w=0),null):(o.setScalar(0),o.addScaledVector(s,rP.x),o.addScaledVector(n,rP.y),o.addScaledVector(a,rP.z),o)}static getInterpolatedAttribute(t,e,i,r,s,n){return rU.setScalar(0),rW.setScalar(0),rJ.setScalar(0),rU.fromBufferAttribute(t,e),rW.fromBufferAttribute(t,i),rJ.fromBufferAttribute(t,r),n.setScalar(0),n.addScaledVector(rU,s.x),n.addScaledVector(rW,s.y),n.addScaledVector(rJ,s.z),n}static isFrontFacing(t,e,i,r){return rO.subVectors(i,e),rE.subVectors(t,e),0>rO.cross(rE).dot(r)}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,r){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[r]),this}setFromAttributeAndIndices(t,e,i,r){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,r),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 rO.subVectors(this.c,this.b),rE.subVectors(this.a,this.b),.5*rO.cross(rE).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return rH.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return rH.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,i,r,s){return rH.getInterpolation(t,this.a,this.b,this.c,e,i,r,s)}containsPoint(t){return rH.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return rH.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let i,r;let s=this.a,n=this.b,a=this.c;rN.subVectors(n,s),rV.subVectors(a,s),rF.subVectors(t,s);let o=rN.dot(rF),h=rV.dot(rF);if(o<=0&&h<=0)return e.copy(s);rj.subVectors(t,n);let l=rN.dot(rj),u=rV.dot(rj);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(s).addScaledVector(rN,i);rD.subVectors(t,a);let p=rN.dot(rD),d=rV.dot(rD);if(d>=0&&p<=d)return e.copy(a);let m=p*h-o*d;if(m<=0&&h>=0&&d<=0)return r=h/(h-d),e.copy(s).addScaledVector(rV,r);let y=l*d-p*u;if(y<=0&&u-l>=0&&p-d>=0)return rL.subVectors(a,n),r=(u-l)/(u-l+(p-d)),e.copy(n).addScaledVector(rL,r);let f=1/(y+m+c);return i=m*f,r=c*f,e.copy(s).addScaledVector(rN,i).addScaledVector(rV,r)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let rq={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 rZ(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 rY{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,
vendor: 4,689 bytes, line 5
5i),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=e_){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,iT.colorSpaceToWorking(this,e),this}setRGB(t,e,i,r=iT.workingColorSpace){return this.r=t,this.g=e,this.b=i,iT.colorSpaceToWorking(this,r),this}setHSL(t,e,i,r=iT.workingColorSpace){if(t=it(t,1),e=e9(e,0,1),i=e9(i,0,1),0===e)this.r=this.g=this.b=i;else{let r=i<=.5?i*(1+e):i+e-i*e,s=2*i-r;this.r=rZ(s,r,t+1/3),this.g=rZ(s,r,t),this.b=rZ(s,r,t-1/3)}return iT.colorSpaceToWorking(this,r),this}setStyle(t,e=e_){let i;function r(e){void 0!==e&&1>parseFloat(e)&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let s;let n=i[1],a=i[2];switch(n){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,e);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,e);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){let r=i[1],s=r.length;if(3===s)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,e);if(6===s)return this.setHex(parseInt(r,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=e_){let i=rq[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=iz(t.r),this.g=iz(t.g),this.b=iz(t.b),this}copyLinearToSRGB(t){return this.r=iI(t.r),this.g=iI(t.g),this.b=iI(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=e_){return iT.workingToColorSpace(r$.copy(this),t),65536*Math.round(e9(255*r$.r,0,255))+256*Math.round(e9(255*r$.g,0,255))+Math.round(e9(255*r$.b,0,255))}getHexString(t=e_){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=iT.workingColorSpace){let i,r;iT.workingToColorSpace(r$.copy(this),e);let s=r$.r,n=r$.g,a=r$.b,o=Math.max(s,n,a),h=Math.min(s,n,a),l=(h+o)/2;if(h===o)i=0,r=0;else{let t=o-h;switch(r=l<=.5?t/(o+h):t/(2-o-h),o){case s:i=(n-a)/t+(n<a?6:0);break;case n:i=(a-s)/t+2;break;case a:i=(s-n)/t+4}i/=6}return t.h=i,t.s=r,t.l=l,t}getRGB(t,e=iT.workingColorSpace){return iT.workingToColorSpace(r$.copy(this),e),t.r=r$.r,t.g=r$.g,t.b=r$.b,t}getStyle(t=e_){iT.workingToColorSpace(r$.copy(this),t);let e=r$.r,i=r$.g,r=r$.b;return t!==e_?`color(${t} ${e.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(255*e)},${Math.round(255*i)},${Math.round(255*r)})`}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=ie(rG.h,rX.h,e),r=ie(rG.s,rX.s,e),s=ie(rG.l,rX.l,e);return this.setHSL(i,r,s),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,r=this.b,s=t.elements;return this.r=s[0]*e+s[3]*i+s[6]*r,this.g=s[1]*e+s[4]*i+s[7]*r,this.b=s[2]*e+s[5]*i+s[8]*r,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 r$=new rY;rY.NAMES=rq;let rQ=0;
5class rK extends e3{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:rQ++}),this.uuid=e8(),this.name="",this.type="Material",this.blending=v,this.side=y,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=E,this.blendDst=R,this.blendEquation=_,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new rY(0,0,0),this.blendAlpha=0,this.depthFunc=G,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=eW,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=eC,this.stencilZFail=eC,this.stencilZPass=eC,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(let e in t){let i=t[e];if(void 0===i){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}let r=this[e];if(void 0===r){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[e]=i}}toJSON(t){let e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});let i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};function r(t){let e=[];for(let i in t){let r=t[i];delete r.metadata,e.push(r)}return e}
vendor: 12,607 bytes, line 5
5if(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!==v&&(i.blending=this.blending),this.side!==y&&(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!==E&&(i.blendSrc=this.blendSrc),this.blendDst!==R&&(i.blendDst=this.blendDst),this.blendEquation!==_&&(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!==G&&(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!==eW&&(i.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(i.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==eC&&(i.stencilFail=this.stencilFail),this.stencilZFail!==eC&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==eC&&(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=r(t.textures),s=r(t.images);e.length>0&&(i.textures=e),s.length>0&&(i.images=s)}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 r=0;r!==t;++r)i[r]=e[r].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++}}class r0 extends rK{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new rY(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 rm,this.combine=Q,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 r1=function(){let t=new ArrayBuffer(4),e=new Float32Array(t),i=new Uint32Array(t),r=new Uint32Array(512),s=new Uint32Array(512);for(let t=0;t<256;++t){let e=t-127;e<-27?(r[t]=0,r[256|t]=32768,s[t]=24,s[256|t]=24):e<-14?(r[t]=1024>>-e-14,r[256|t]=1024>>-e-14|32768,s[t]=-e-1,s[256|t]=-e-1):e<=15?(r[t]=e+15<<10,r[256|t]=e+15<<10|32768,s[t]=13,s[256|t]=13):e<128?(r[t]=31744,r[256|t]=64512,s[t]=24,s[256|t]=24):(r[t]=31744,r[256|t]=64512,s[t]=13,s[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:r,shiftTable:s,mantissaTable:n,exponentTable:a,offsetTable:o}}();function r2(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=e9(t,-65504,65504),r1.floatView[0]=t;let e=r1.uint32View[0],i=e>>23&511;return r1.baseTable[i]+((8388607&e)>>r1.shiftTable[i])}function r3(t){let e=t>>10;return r1.uint32View[0]=r1.mantissaTable[r1.offsetTable[e]+(1023&t)]+r1.exponentTable[e],r1.floatView[0]}let r5=new ih,r4=new ia,r6=0;class r7{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:r6++}),this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=i,this.usage=eQ,this.updateRanges=[],this.gpuType=tO,this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,i){t*=this.itemSize,i*=e.itemSize;
vendor: 4,107 bytes, line 5
5for(let r=0,s=this.itemSize;r<s;r++)this.array[t+r]=e.array[i+r];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++)r4.fromBufferAttribute(this,e),r4.applyMatrix3(t),this.setXY(e,r4.x,r4.y);else if(3===this.itemSize)for(let e=0,i=this.count;e<i;e++)r5.fromBufferAttribute(this,e),r5.applyMatrix3(t),this.setXYZ(e,r5.x,r5.y,r5.z);return this}applyMatrix4(t){for(let e=0,i=this.count;e<i;e++)r5.fromBufferAttribute(this,e),r5.applyMatrix4(t),this.setXYZ(e,r5.x,r5.y,r5.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)r5.fromBufferAttribute(this,e),r5.applyNormalMatrix(t),this.setXYZ(e,r5.x,r5.y,r5.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)r5.fromBufferAttribute(this,e),r5.transformDirection(t),this.setXYZ(e,r5.x,r5.y,r5.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=ii(i,this.array)),i}setComponent(t,e,i){return this.normalized&&(i=ir(i,this.array)),this.array[t*this.itemSize+e]=i,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=ii(e,this.array)),e}setX(t,e){return this.normalized&&(e=ir(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=ii(e,this.array)),e}setY(t,e){return this.normalized&&(e=ir(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=ii(e,this.array)),e}setZ(t,e){return this.normalized&&(e=ir(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=ii(e,this.array)),e}setW(t,e){return this.normalized&&(e=ir(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,i){return t*=this.itemSize,this.normalized&&(e=ir(e,this.array),i=ir(i,this.array)),this.array[t+0]=e,this.array[t+1]=i,this}setXYZ(t,e,i,r){return t*=this.itemSize,this.normalized&&(e=ir(e,this.array),i=ir(i,this.array),r=ir(r,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=r,this}setXYZW(t,e,i,r,s){return t*=this.itemSize,this.normalized&&(e=ir(e,this.array),i=ir(i,this.array),r=ir(r,this.array),s=ir(s,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=r,this.array[t+3]=s,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!==eQ&&(t.usage=this.usage),t}}class r8 extends r7{constructor(t,e,i){super(new Uint16Array(t),e,i)}}class r9 extends r7{constructor(t,e,i){super(new Uint32Array(t),e,i)}}class st extends r7{constructor(t,e,i){super(new Uint16Array(t),e,i),this.isFloat16BufferAttribute=!0}getX(t){let e=r3(this.array[t*this.itemSize]);return this.normalized&&(e=ii(e,this.array)),e}setX(t,e){return this.normalized&&(e=ir(e,this.array)),this.array[t*this.itemSize]=r2(e),this}getY(t){let e=r3(this.array[t*this.itemSize+1]);return this.normalized&&(e=ii(e,this.array)),e}setY(t,e){return this.normalized&&(e=ir(e,this.array)),this.array[t*this.itemSize+1]=r2(e),this}getZ(t){let e=r3(this.array[t*this.itemSize+2]);return this.normalized&&(e=ii(e,this.array)),e}setZ(t,e){return this.normalized&&(e=ir(e,this.array)),this.array[t*this.itemSize+2]=r2(e),this}getW(t){let e=r3(this.array[t*this.itemSize+3]);return this.normalized&&(e=ii(e,this.array)),e}setW(t,e){return this.normalized&&(e=ir(e,this.array)),this.array[t*this.itemSize+3]=r2(e),this}setXY(t,e,i){return t*=this.itemSize,this.normalized&&(e=ir(e,this.array),i=ir(i,this.array)),this.array[t+0]=r2(e),this.array[t+1]=r2(i),this}setXYZ(t,e,i,r){return t*=this.itemSize,this.normalized&&(e=ir(e,this.array),i=ir(i,this.array),r=ir(r,this.array)),this.array[t+0]=r2(e),this.array[t+1]=r2(i),this.array[t+2]=r2(r),this}setXYZW(t,e,i,r,s){return t*=this.itemSize,this.normalized&&(e=ir(e,this.array),i=ir
5(i,this.array),r=ir(r,this.array),s=ir(s,this.array)),this.array[t+0]=r2(e),this.array[t+1]=r2(i),this.array[t+2]=r2(r),this.array[t+3]=r2(s),this}}class se extends r7{constructor(t,e,i){super(new Float32Array(t),e,i)}}let si=0,sr=new rs,ss=new rB,sn=new ih,sa=new iD,so=new iD,sh=new ih;class sl extends e3{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:si++}),this.uuid=e8(),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)?r9:r8)(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 ic().getNormalMatrix(t);i.applyNormalMatrix(e),i.needsUpdate=!0}let r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(t),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(t){return sr.makeRotationFromQuaternion(t),this.applyMatrix4(sr),this}rotateX(t){return sr.makeRotationX(t),this.applyMatrix4(sr),this}rotateY(t){return sr.makeRotationY(t),this.applyMatrix4(sr),this}rotateZ(t){return sr.makeRotationZ(t),this.applyMatrix4(sr),this}translate(t,e,i){return sr.makeTranslation(t,e,i),this.applyMatrix4(sr),this}scale(t,e,i){return sr.makeScale(t,e,i),this.applyMatrix4(sr),this}lookAt(t){return ss.lookAt(t),ss.updateMatrix(),this.applyMatrix4(ss.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(sn).negate(),this.translate(sn.x,sn.y,sn.z),this}setFromPoints(t){let e=this.getAttribute("position");if(void 0===e){let e=[];for(let i=0,r=t.length;i<r;i++){let r=t[i];e.push(r.x,r.y,r.z||0)}this.setAttribute("position",new se(e,3))}else{let i=Math.min(t.length,e.count);for(let r=0;r<i;r++){let i=t[r];e.setXYZ(r,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 iD);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 ih(-1/0,-1/0,-1/0),new ih(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];sa.setFromBufferAttribute(i),this.morphTargetsRelative?(sh.addVectors(this.boundingBox.min,sa.min),this.boundingBox.expandByPoint(sh),sh.addVectors(this.boundingBox.max,sa.max),this.boundingBox.expandByPoint(sh)):(this.boundingBox.expandByPoint(sa.min),this.boundingBox.expandByPoint(sa.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 i4);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 ih,1/0);return}if(t){let i=this.boundingSphere.center;if(sa.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){let i=e[t];so.setFromBufferAttribute(i),this.morphTargetsRelative?(sh.addVectors(sa.min,so.min),sa.expandByPoint(sh),sh.addVectors(sa.max,so.max),sa.expandByPoint(sh)):(sa.expandByPoint(so.min),sa.expandByPoint(so.max))}sa.getCenter(i);let r=0;for(let e=0,s=t.count;e<s;
5e++)sh.fromBufferAttribute(t,e),r=Math.max(r,i.distanceToSquared(sh));if(e)for(let s=0,n=e.length;s<n;s++){let n=e[s],a=this.morphTargetsRelative;for(let e=0,s=n.count;e<s;e++)sh.fromBufferAttribute(n,e),a&&(sn.fromBufferAttribute(t,e),sh.add(sn)),r=Math.max(r,i.distanceToSquared(sh))}this.boundingSphere.radius=Math.sqrt(r),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,r=e.normal,s=e.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new r7(new Float32Array(4*i.count),4));let n=this.getAttribute("tangent"),a=[],o=[];for(let t=0;t<i.count;t++)a[t]=new ih,o[t]=new ih;let h=new ih,l=new ih,u=new ih,c=new ia,p=new ia,d=new ia,m=new ih,y=new ih,f=this.groups;0===f.length&&(f=[{start:0,count:t.count}]);for(let e=0,r=f.length;e<r;++e){let r=f[e],n=r.start,g=r.count;for(let e=n,r=n+g;e<r;e+=3)!function(t,e,r){h.fromBufferAttribute(i,t),l.fromBufferAttribute(i,e),u.fromBufferAttribute(i,r),c.fromBufferAttribute(s,t),p.fromBufferAttribute(s,e),d.fromBufferAttribute(s,r),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),y.copy(u).multiplyScalar(p.x).addScaledVector(l,-d.x).multiplyScalar(n),a[t].add(m),a[e].add(m),a[r].add(m),o[t].add(y),o[e].add(y),o[r].add(y))}(t.getX(e+0),t.getX(e+1),t.getX(e+2))}let g=new ih,x=new ih,v=new ih,b=new ih;function M(t){v.fromBufferAttribute(r,t),b.copy(v);let e=a[t];g.copy(e),g.sub(v.multiplyScalar(v.dot(e))).normalize(),x.crossVectors(b,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=f.length;e<i;++e){let i=f[e],r=i.start,s=i.count;for(let e=r,i=r+s;e<i;e+=3)M(t.getX(e+0)),M(t.getX(e+1)),M(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 r7(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 r=new ih,s=new ih,n=new ih,a=new ih,o=new ih,h=new ih,l=new ih,u=new ih;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);r.fromBufferAttribute(e,p),s.fromBufferAttribute(e,d),n.fromBufferAttribute(e,m),l.subVectors(n,s),u.subVectors(r,s),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)r.fromBufferAttribute(e,t+0),s.fromBufferAttribute(e,t+1),n.fromBufferAttribute(e,t+2),l.subVectors(n,s),u.subVectors(r,s),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++)sh.fromBufferAttribute(t,e),sh.normalize(),t.setXYZ(e,sh.x,sh.y,sh.z)}toNonIndexed(){function t(t,e){let i=t.array,r=t.itemSize,s=t.normalized,n=new i.constructor(e.length*r),a=0,o=0;for(let s=0,h=e.length;s<h;s++){a=t.isInterleavedBufferAttribute?e[s]*t.data.stride+t.offset:e[s]*r;for(let t=0;t<r;t++)n[o++]=i[a++]}return new r7(n,r,s)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let e=new sl,i=this.index.array,r=this.attributes;for(let s in r){let n=t(r[s],i);e.setAttribute(s,n)}let s=this.morphAttributes;for(let r in s){let n=[],a=s[r];for(let e=0,r=a.length;e<r;e++){let r=t(a[e],i);n.push(r)}e.morphAttributes[r]=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.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};
5if(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 r=i[e];t.data.attributes[e]=r.toJSON(t.data)}let r={},s=!1;for(let e in this.morphAttributes){let i=this.morphAttributes[e],n=[];for(let e=0,r=i.length;e<r;e++){let r=i[e];n.push(r.toJSON(t.data))}n.length>0&&(r[e]=n,s=!0)}s&&(t.data.morphAttributes=r,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=a.toJSON()),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let e={};this.name=t.name;let i=t.index;null!==i&&this.setIndex(i.clone());let r=t.attributes;for(let t in r){let i=r[t];this.setAttribute(t,i.clone(e))}let s=t.morphAttributes;for(let t in s){let i=[],r=s[t];for(let t=0,s=r.length;t<s;t++)i.push(r[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 su=new rs,sc=new rr,sp=new i4,sd=new ih,sm=new ih,sy=new ih,sf=new ih,sg=new ih,sx=new ih,sv=new ih,sb=new ih;class sM extends rB{constructor(t=new sl,e=new r0){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){let t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){let i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=i.length;t<e;t++){let e=i[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}getVertexPosition(t,e){let i=this.geometry,r=i.attributes.position,s=i.morphAttributes.position,n=i.morphTargetsRelative;e.fromBufferAttribute(r,t);let a=this.morphTargetInfluences;if(s&&a){sx.set(0,0,0);for(let i=0,r=s.length;i<r;i++){let r=a[i],o=s[i];0!==r&&(sg.fromBufferAttribute(o,t),n?sx.addScaledVector(sg,r):sx.addScaledVector(sg.sub(e),r))}e.add(sx)}return e}raycast(t,e){let i=this.geometry,r=this.material,s=this.matrixWorld;if(void 0!==r){if(null===i.boundingSphere&&i.computeBoundingSphere(),sp.copy(i.boundingSphere),sp.applyMatrix4(s),sc.copy(t.ray).recast(t.near),!1===sp.containsPoint(sc.origin)&&(null===sc.intersectSphere(sp,sd)||sc.origin.distanceToSquared(sd)>(t.far-t.near)**2)||(su.copy(s).invert(),sc.copy(t.ray).applyMatrix4(su),null!==i.boundingBox&&!1===sc.intersectsBox(i.boundingBox)))return;this._computeIntersections(t,e,sc)}}_computeIntersections(t,e,i){let r;let s=this.geometry,n=this.material,a=s.index,o=s.attributes.position,h=s.attributes.uv,l=s.attributes.uv1,u=s.attributes.normal,c=s.groups,p=s.drawRange;if(null!==a){if(Array.isArray(n))for(let s=0,o=c.length;s<o;s++){let o=c[s],d=n[o.materialIndex],m=Math.max(o.start,p.start),y=Math.min(a.count,Math.min(o.start+o.count,p.start+p.count));for(let s=m;s<y;s+=3)(r=sw(this,d,t,i,h,l,u,a.getX(s),a.getX(s+1),a.getX(s+2)))&&(r.faceIndex=Math.floor(s/3),r.face.materialIndex=o.materialIndex,e.push(r))}else{let s=Math.max(0,p.start),o=Math.min(a.count,p.start+p.count);for(let c=s;c<o;c+=3)(r=sw(this,n,t,i,h,l,u,a.getX(c),a.getX(c+1),a.getX(c+2)))&&(r.faceIndex=Math.floor(c/3),e.push(r))}}else if(void 0!==o){if(Array.isArray(n))for(let s=0,a=c.length;s<a;s++){let a=c[s],d=n[a.materialIndex],m=Math.max(a.start,p.start),y=Math.min(o.count,Math.min(a.start+a.count,p.start+p.count));for(let s=m;s<y;s+=3)(r=sw(this,d,t,i,h,l,u,s,s+1,s+2))&&(r.faceIndex=Math.floor(s/3),r.face.materialIndex=a.materialIndex,e.push(r))}else{let s=Math.max(0,p.start),a=Math.min(o.count,p.start+p.count);for(let o=s;o<a;o+=3)(r=sw(this,n,t,i,h,l,u,o,o+1,o+2))&&(r.faceIndex=Math.floor(o/3),e.push(r))}}}}
5function sw(t,e,i,r,s,n,a,o,h,l){t.getVertexPosition(o,sm),t.getVertexPosition(h,sy),t.getVertexPosition(l,sf);let u=function(t,e,i,r,s,n,a,o){if(null===(e.side===f?r.intersectTriangle(a,n,s,!0,o):r.intersectTriangle(s,n,a,e.side===y,o)))return null;sb.copy(o),sb.applyMatrix4(t.matrixWorld);let h=i.ray.origin.distanceTo(sb);return h<i.near||h>i.far?null:{distance:h,point:sb.clone(),object:t}}(t,e,i,r,sm,sy,sf,sv);if(u){let t=new ih;rH.getBarycoord(sv,sm,sy,sf,t),s&&(u.uv=rH.getInterpolatedAttribute(s,o,h,l,t,new ia)),n&&(u.uv1=rH.getInterpolatedAttribute(n,o,h,l,t,new ia)),a&&(u.normal=rH.getInterpolatedAttribute(a,o,h,l,t,new ih),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));let e={a:o,b:h,c:l,normal:new ih,materialIndex:0};rH.getNormal(sm,sy,sf,e.normal),u.face=e,u.barycoord=t}return u}class sS extends sl{constructor(t=1,e=1,i=1,r=1,s=1,n=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:r,heightSegments:s,depthSegments:n};let a=this;r=Math.floor(r),s=Math.floor(s);let o=[],h=[],l=[],u=[],c=0,p=0;function d(t,e,i,r,s,n,d,m,y,f,g){let x=n/y,v=d/f,b=n/2,M=d/2,w=m/2,S=y+1,_=f+1,A=0,T=0,z=new ih;for(let n=0;n<_;n++){let a=n*v-M;for(let o=0;o<S;o++){let c=o*x-b;z[t]=c*r,z[e]=a*s,z[i]=w,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/y),u.push(1-n/f),A+=1}}for(let t=0;t<f;t++)for(let e=0;e<y;e++){let i=c+e+S*t,r=c+e+S*(t+1),s=c+(e+1)+S*(t+1),n=c+(e+1)+S*t;o.push(i,r,n),o.push(r,s,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),s,0),d("z","y","x",1,-1,i,e,-t,n,s,1),d("x","z","y",1,1,t,i,e,r,n,2),d("x","z","y",1,-1,t,i,-e,r,n,3),d("x","y","z",1,-1,t,e,i,r,s,4),d("x","y","z",-1,-1,t,e,-i,r,s,5),this.setIndex(o),this.setAttribute("position",new se(h,3)),this.setAttribute("normal",new se(l,3)),this.setAttribute("uv",new se(u,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new sS(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function s_(t){let e={};for(let i in t)for(let r in e[i]={},t[i]){let s=t[i][r];s&&(s.isColor||s.isMatrix3||s.isMatrix4||s.isVector2||s.isVector3||s.isVector4||s.isTexture||s.isQuaternion)?s.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[i][r]=null):e[i][r]=s.clone():Array.isArray(s)?e[i][r]=s.slice():e[i][r]=s}return e}function sA(t){let e={};for(let i=0;i<t.length;i++){let r=s_(t[i]);for(let t in r)e[t]=r[t]}return e}function sT(t){let e=t.getRenderTarget();return null===e?t.outputColorSpace:!0===e.isXRRenderTarget?e.texture.colorSpace:iT.workingColorSpace}let sz={clone:s_,merge:sA};class sI extends rK{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=s_(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 r=this.uniforms[i].value;r&&r.isTexture?e.uniforms[i]={type:"t",value:r.toJSON(t).uuid}:r&&r.isColor?e.uniforms[i]={type:"c",value:r.getHex()}:r&&r.isVector2?e.uniforms[i]={type:"v2",value:r.toArray()}:r&&r.isVector3?e.uniforms[i]={type:"v3",value:r.toArray()}:r&&r.isVector4?e.uniforms[i]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?e.uniforms[i]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?e.uniforms[i]={type:"m4",value:r.toArray()}:e.uniforms[i]={value:r}}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 sC extends rB{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new rs,this.projectionMatrix=new rs,this.projectionMatrixInverse=new rs,this.coordinateSystem=e1}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 sk=new ih,sB=new ia,sO=new ia;class sE extends sC{constructor(t=50,e=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=i,this.far=r,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*e7*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){let t=Math.tan(.5*e6*this.fov);return .5*this.getFilmHeight()/t}
5getEffectiveFOV(){return 2*e7*Math.atan(Math.tan(.5*e6*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){sk.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(sk.x,sk.y).multiplyScalar(-t/sk.z),sk.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(sk.x,sk.y).multiplyScalar(-t/sk.z)}getViewSize(t,e){return this.getViewBounds(t,sB,sO),e.subVectors(sO,sB)}setViewOffset(t,e,i,r,s,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=r,this.view.width=s,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*e6*this.fov)/this.zoom,i=2*e,r=this.aspect*i,s=-.5*r,n=this.view;if(null!==this.view&&this.view.enabled){let t=n.fullWidth,a=n.fullHeight;s+=n.offsetX*r/t,e-=n.offsetY*i/a,r*=n.width/t,i*=n.height/a}let a=this.filmOffset;0!==a&&(s+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,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 sR extends rB{constructor(t,e,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;let r=new sE(-90,1,t,e);r.layers=this.layers,this.add(r);let s=new sE(-90,1,t,e);s.layers=this.layers,this.add(s);let n=new sE(-90,1,t,e);n.layers=this.layers,this.add(n);let a=new sE(-90,1,t,e);a.layers=this.layers,this.add(a);let o=new sE(-90,1,t,e);o.layers=this.layers,this.add(o);let h=new sE(-90,1,t,e);h.layers=this.layers,this.add(h)}updateCoordinateSystem(){let t=this.coordinateSystem,e=this.children.concat(),[i,r,s,n,a,o]=e;for(let t of e)this.remove(t);if(t===e1)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.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===e2)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.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:r}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());let[s,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,r),t.render(e,s),t.setRenderTarget(i,1,r),t.render(e,n),t.setRenderTarget(i,2,r),t.render(e,a),t.setRenderTarget(i,3,r),t.render(e,o),t.setRenderTarget(i,4,r),t.render(e,h),i.texture.generateMipmaps=m,t.setRenderTarget(i,5,r),t.render(e,l),t.setRenderTarget(u,c,p),t.xr.enabled=d,i.texture.needsPMREMUpdate=!0}}class sP extends iP{constructor(t=[],e=tc,i,r,s,n,a,o,h,l){super(t,e,i,r,s,n,a,o,h,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class sN extends iL{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;let i={width:t,height:t,depth:1};this.texture=new sP([i,i,i,i,i,i]),this._setTextureOptions(e),this.texture.isRenderTargetTexture=!0}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:` 6 7 varying vec3 vWorldDirection; 8 9 vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 10 11 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 12 13 } 14 15 void main() { 16 17 vWorldDirection = transformDirection( position, modelMatrix ); 18 19 #include <begin_vertex> 20 #include <project_vertex> 21 22 } 23 `,fragmentShader:` 24 25 uniform sampler2D tEquirect; 26 27 varying vec3 vWorldDirection; 28 29 #include <common> 30 31 void main() { 32 33 vec3 direction = normalize( vWorldDirection ); 34 35 vec2 sampleUV = equirectUv( direction ); 36 37 gl_FragColor = texture2D( tEquirect, sampleUV ); 38 39 } 40 `},r=new sS(5,5,5),s=new sI({name:"CubemapFromEquirect",uniforms:s_(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:f,blending:x});s.uniforms.tEquirect.value=e;let n=new sM(r,s),a=e.minFilter;return e.minFilter===t_&&(e.minFilter=tw),new sR(1,10,this).update(t,n),e.minFilter=a,n.geometry.dispose(),n.material.dispose(),this}clear(t,e=!0,i=!0,r=!0){let s=t.getRenderTarget();for(let s=0;s<6;
40s++)t.setRenderTarget(this,s),t.clear(e,i,r);t.setRenderTarget(s)}}class sV extends rB{constructor(){super(),this.isGroup=!0,this.type="Group"}}let sL={type:"move"};class sF{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new sV,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new sV,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ih,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ih),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new sV,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ih,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ih),this._grip}dispatchEvent(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){let e=this._hand;if(e)for(let i of t.hand.values())this._getHandJoint(e,i)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(t,e,i){let r=null,s=null,n=null,a=this._targetRay,o=this._grip,h=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState){if(h&&t.hand){for(let r of(n=!0,t.hand.values())){let t=e.getJointPose(r,i),s=this._getHandJoint(h,r);null!==t&&(s.matrix.fromArray(t.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,s.jointRadius=t.radius),s.visible=null!==t}let r=h.joints["index-finger-tip"],s=h.joints["thumb-tip"],a=r.position.distanceTo(s.position);h.inputState.pinching&&a>.025?(h.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!h.inputState.pinching&&a<=.015&&(h.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==o&&t.gripSpace&&null!==(s=e.getPose(t.gripSpace,i))&&(o.matrix.fromArray(s.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,s.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(s.linearVelocity)):o.hasLinearVelocity=!1,s.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(s.angularVelocity)):o.hasAngularVelocity=!1);null!==a&&(null===(r=e.getPose(t.targetRaySpace,i))&&null!==s&&(r=s),null!==r&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(sL)))}return null!==a&&(a.visible=null!==r),null!==o&&(o.visible=null!==s),null!==h&&(h.visible=null!==n),this}_getHandJoint(t,e){if(void 0===t.joints[e.jointName]){let i=new sV;i.matrixAutoUpdate=!1,i.visible=!1,t.joints[e.jointName]=i,t.add(i)}return t.joints[e.jointName]}}class sj{constructor(t,e=25e-5){this.isFogExp2=!0,this.name="",this.color=new rY(t),this.density=e}clone(){return new sj(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class sD{constructor(t,e=1,i=1e3){this.isFog=!0,this.name="",this.color=new rY(t),this.near=e,this.far=i}clone(){return new sD(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class sU extends rB{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new rm,this.environmentIntensity=1,this.environmentRotation=new rm,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){let e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}}class sW{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=eQ,this.updateRanges=[],this.version=0,this.uuid=e8()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,i){t*=this.stride,i*=e.stride;for(let r=0,s=this.stride;r<s;r++)this.array[t+r]=e.array[i+r];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=e8()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(e,this.stride);return i.setUsage(this.usage),i}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=e8()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}let sJ=new ih;class sH{constructor(t,e,i,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=i,this.normalized=r}
40get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,i=this.data.count;e<i;e++)sJ.fromBufferAttribute(this,e),sJ.applyMatrix4(t),this.setXYZ(e,sJ.x,sJ.y,sJ.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)sJ.fromBufferAttribute(this,e),sJ.applyNormalMatrix(t),this.setXYZ(e,sJ.x,sJ.y,sJ.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)sJ.fromBufferAttribute(this,e),sJ.transformDirection(t),this.setXYZ(e,sJ.x,sJ.y,sJ.z);return this}getComponent(t,e){let i=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(i=ii(i,this.array)),i}setComponent(t,e,i){return this.normalized&&(i=ir(i,this.array)),this.data.array[t*this.data.stride+this.offset+e]=i,this}setX(t,e){return this.normalized&&(e=ir(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=ir(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=ir(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=ir(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=ii(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=ii(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=ii(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=ii(e,this.array)),e}setXY(t,e,i){return t=t*this.data.stride+this.offset,this.normalized&&(e=ir(e,this.array),i=ir(i,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this}setXYZ(t,e,i,r){return t=t*this.data.stride+this.offset,this.normalized&&(e=ir(e,this.array),i=ir(i,this.array),r=ir(r,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=r,this}setXYZW(t,e,i,r,s){return t=t*this.data.stride+this.offset,this.normalized&&(e=ir(e,this.array),i=ir(i,this.array),r=ir(r,this.array),s=ir(s,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=r,this.data.array[t+3]=s,this}clone(t){if(void 0!==t)return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new sH(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized);{console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let t=[];for(let e=0;e<this.count;e++){let i=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[i+e])}return new r7(new this.array.constructor(t),this.itemSize,this.normalized)}}toJSON(t){if(void 0!==t)return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized};{console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let t=[];for(let e=0;e<this.count;e++){let i=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[i+e])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}}}class sq extends rK{constructor(t){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new rY(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}let sG=new ih,sX=new ih,sZ=new ih,sY=new ia,s$=new ia,sQ=new rs,sK=new ih,s0=new ih,s1=new ih,s2=new ia,s3=new ia,s5=new ia;class s4 extends rB{constructor(t=new sq){if(super(),this.isSprite=!0,this.type="Sprite",void 0===s){s=new sl;let t=new sW(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);s.setIndex([0,1,2,0,2,3]),s.setAttribute("position",new sH(t,3,0,!1)),s.setAttribute("uv",new sH(t,2,3,!1))}this.geometry=s,this.material=t,this.center=new ia(.5,.5),this.count=1}raycast(t,e){let i,r;null===t.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),sX.setFromMatrixScale(this.matrixWorld),sQ.c
40opy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),sZ.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&sX.multiplyScalar(-sZ.z);let s=this.material.rotation;0!==s&&(r=Math.cos(s),i=Math.sin(s));let n=this.center;s6(sK.set(-.5,-.5,0),sZ,n,sX,i,r),s6(s0.set(.5,-.5,0),sZ,n,sX,i,r),s6(s1.set(.5,.5,0),sZ,n,sX,i,r),s2.set(0,0),s3.set(1,0),s5.set(1,1);let a=t.ray.intersectTriangle(sK,s0,s1,!1,sG);if(null===a&&(s6(s0.set(-.5,.5,0),sZ,n,sX,i,r),s3.set(0,1),null===(a=t.ray.intersectTriangle(sK,s1,s0,!1,sG))))return;let o=t.ray.origin.distanceTo(sG);o<t.near||o>t.far||e.push({distance:o,point:sG.clone(),uv:rH.getInterpolation(sG,sK,s0,s1,s2,s3,s5,new ia),face:null,object:this})}copy(t,e){return super.copy(t,e),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}}function s6(t,e,i,r,s,n){sY.subVectors(t,i).addScalar(.5).multiply(r),void 0!==s?(s$.x=n*sY.x-s*sY.y,s$.y=s*sY.x+n*sY.y):s$.copy(sY),t.copy(e),t.x+=s$.x,t.y+=s$.y,t.applyMatrix4(sQ)}let s7=new ih,s8=new ih;class s9 extends rB{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);let e=t.levels;for(let t=0,i=e.length;t<i;t++){let i=e[t];this.addLevel(i.object.clone(),i.distance,i.hysteresis)}return this.autoUpdate=t.autoUpdate,this}addLevel(t,e=0,i=0){let r;e=Math.abs(e);let s=this.levels;for(r=0;r<s.length&&!(e<s[r].distance);r++);return s.splice(r,0,{distance:e,hysteresis:i,object:t}),this.add(t),this}removeLevel(t){let e=this.levels;for(let i=0;i<e.length;i++)if(e[i].distance===t){let t=e.splice(i,1);return this.remove(t[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(t){let e=this.levels;if(e.length>0){let i,r;for(i=1,r=e.length;i<r;i++){let r=e[i].distance;if(e[i].object.visible&&(r-=r*e[i].hysteresis),t<r)break}return e[i-1].object}return null}raycast(t,e){if(this.levels.length>0){s7.setFromMatrixPosition(this.matrixWorld);let i=t.ray.origin.distanceTo(s7);this.getObjectForDistance(i).raycast(t,e)}}update(t){let e=this.levels;if(e.length>1){let i,r;s7.setFromMatrixPosition(t.matrixWorld),s8.setFromMatrixPosition(this.matrixWorld);let s=s7.distanceTo(s8)/t.zoom;for(i=1,e[0].object.visible=!0,r=e.length;i<r;i++){let t=e[i].distance;if(e[i].object.visible&&(t-=t*e[i].hysteresis),s>=t)e[i-1].object.visible=!1,e[i].object.visible=!0;else break}for(this._currentLevel=i-1;i<r;i++)e[i].object.visible=!1}}toJSON(t){let e=super.toJSON(t);!1===this.autoUpdate&&(e.object.autoUpdate=!1),e.object.levels=[];let i=this.levels;for(let t=0,r=i.length;t<r;t++){let r=i[t];e.object.levels.push({object:r.object.uuid,distance:r.distance,hysteresis:r.hysteresis})}return e}}let nt=new ih,ne=new iN,ni=new iN,nr=new ih,ns=new rs,nn=new ih,na=new i4,no=new rs,nh=new rr;class nl extends sM{constructor(t,e){super(t,e),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=tl,this.bindMatrix=new rs,this.bindMatrixInverse=new rs,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){let t=this.geometry;null===this.boundingBox&&(this.boundingBox=new iD),this.boundingBox.makeEmpty();let e=t.getAttribute("position");for(let t=0;t<e.count;t++)this.getVertexPosition(t,nn),this.boundingBox.expandByPoint(nn)}computeBoundingSphere(){let t=this.geometry;null===this.boundingSphere&&(this.boundingSphere=new i4),this.boundingSphere.makeEmpty();let e=t.getAttribute("position");for(let t=0;t<e.count;t++)this.getVertexPosition(t,nn),this.boundingSphere.expandByPoint(nn)}copy(t,e){return super.copy(t,e),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this}raycast(t,e){let i=this.material,r=this.matrixWorld;if(void 0!==i&&(null===this.boundingSphere&&this.computeBoundingSphere(),na.copy(this.boundingSphere),na.applyMatrix4(r),!1!==t.ray.intersectsSphere(na))){if(no.copy(r).invert(),nh.copy(t.ray).applyMatrix4(no),null!==this.boundingBox&&!1===nh.intersectsBox(this.boundingBox))return;this._computeIntersections(t,e,nh)}}getVertexPosition(t,e){return super.getVertexPosition(t,e),this.applyBoneTransform(t,e),e}bind(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.copy(e).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){let t=new iN,e=this.geometry.attributes.skinWeight;for(let i=0,r=e.count;i<r;i++){t.fromBufferAttribute(e,i);let r=1/t.manhattanLength();r!==1/0?t.multiplyScalar(r):t.set(1,0,0,0),e.setXYZW(i,t.x,t.y,t.z,t.w)}}updateMatrixWorld(t){super.updateMatrixWorld(t),this.bindMode===tl?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}
40applyBoneTransform(t,e){let i=this.skeleton,r=this.geometry;ne.fromBufferAttribute(r.attributes.skinIndex,t),ni.fromBufferAttribute(r.attributes.skinWeight,t),nt.copy(e).applyMatrix4(this.bindMatrix),e.set(0,0,0);for(let t=0;t<4;t++){let r=ni.getComponent(t);if(0!==r){let s=ne.getComponent(t);ns.multiplyMatrices(i.bones[s].matrixWorld,i.boneInverses[s]),e.addScaledVector(nr.copy(nt).applyMatrix4(ns),r)}}return e.applyMatrix4(this.bindMatrixInverse)}}class nu extends rB{constructor(){super(),this.isBone=!0,this.type="Bone"}}class nc extends iP{constructor(t=null,e=1,i=1,r,s,n,a,o,h=tv,l=tv,u,c){super(null,n,a,o,h,l,r,s,u,c),this.isDataTexture=!0,this.image={data:t,width:e,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}let np=new rs,nd=new rs;class nm{constructor(t=[],e=[]){this.uuid=e8(),this.bones=t.slice(0),this.boneInverses=e,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){let t=this.bones,e=this.boneInverses;if(this.boneMatrices=new Float32Array(16*t.length),0===e.length)this.calculateInverses();else if(t.length!==e.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let t=0,e=this.bones.length;t<e;t++)this.boneInverses.push(new rs)}}calculateInverses(){this.boneInverses.length=0;for(let t=0,e=this.bones.length;t<e;t++){let e=new rs;this.bones[t]&&e.copy(this.bones[t].matrixWorld).invert(),this.boneInverses.push(e)}}pose(){for(let t=0,e=this.bones.length;t<e;t++){let e=this.bones[t];e&&e.matrixWorld.copy(this.boneInverses[t]).invert()}for(let t=0,e=this.bones.length;t<e;t++){let e=this.bones[t];e&&(e.parent&&e.parent.isBone?(e.matrix.copy(e.parent.matrixWorld).invert(),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))}}update(){let t=this.bones,e=this.boneInverses,i=this.boneMatrices,r=this.boneTexture;for(let r=0,s=t.length;r<s;r++){let s=t[r]?t[r].matrixWorld:nd;np.multiplyMatrices(s,e[r]),np.toArray(i,16*r)}null!==r&&(r.needsUpdate=!0)}clone(){return new nm(this.bones,this.boneInverses)}computeBoneTexture(){let t=Math.sqrt(4*this.bones.length),e=new Float32Array((t=Math.max(t=4*Math.ceil(t/4),4))*t*4);e.set(this.boneMatrices);let i=new nc(e,t,t,tj,tO);return i.needsUpdate=!0,this.boneMatrices=e,this.boneTexture=i,this}getBoneByName(t){for(let e=0,i=this.bones.length;e<i;e++){let i=this.bones[e];if(i.name===t)return i}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(t,e){this.uuid=t.uuid;for(let i=0,r=t.bones.length;i<r;i++){let r=t.bones[i],s=e[r];void 0===s&&(console.warn("THREE.Skeleton: No bone found with UUID:",r),s=new nu),this.bones.push(s),this.boneInverses.push(new rs().fromArray(t.boneInverses[i]))}return this.init(),this}toJSON(){let t={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};t.uuid=this.uuid;let e=this.bones,i=this.boneInverses;for(let r=0,s=e.length;r<s;r++){let s=e[r];t.bones.push(s.uuid);let n=i[r];t.boneInverses.push(n.toArray())}return t}}class ny extends r7{constructor(t,e,i,r=1){super(t,e,i),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){let t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}let nf=new rs,ng=new rs,nx=[],nv=new iD,nb=new rs,nM=new sM,nw=new i4;class nS extends sM{constructor(t,e,i){super(t,e),this.isInstancedMesh=!0,this.instanceMatrix=new ny(new Float32Array(16*i),16),this.instanceColor=null,this.morphTexture=null,this.count=i,this.boundingBox=null,this.boundingSphere=null;for(let t=0;t<i;t++)this.setMatrixAt(t,nb)}computeBoundingBox(){let t=this.geometry,e=this.count;null===this.boundingBox&&(this.boundingBox=new iD),null===t.boundingBox&&t.computeBoundingBox(),this.boundingBox.makeEmpty();for(let i=0;i<e;i++)this.getMatrixAt(i,nf),nv.copy(t.boundingBox).applyMatrix4(nf),this.boundingBox.union(nv)}computeBoundingSphere(){let t=this.geometry,e=this.count;null===this.boundingSphere&&(this.boundingSphere=new i4),null===t.boundingSphere&&t.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let i=0;i<e;i++)this.getMatrixAt(i,nf),nw.copy(t.boundingSphere).applyMatrix4(nf),this.boundingSphere.union(nw)}copy(t,e){return super.copy(t,e),this.instanceMatrix.copy(t.instanceMatrix),null!==t.morphTexture&&(this.morphTexture=t.morphTexture.clone()),null!==t.instanceColor&&(this.instanceColor=t.instanceColor.clone()),this.count=t.count,null!==t.boundingBox&&
40(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this}getColorAt(t,e){e.fromArray(this.instanceColor.array,3*t)}getMatrixAt(t,e){e.fromArray(this.instanceMatrix.array,16*t)}getMorphAt(t,e){let i=e.morphTargetInfluences,r=this.morphTexture.source.data.data,s=t*(i.length+1)+1;for(let t=0;t<i.length;t++)i[t]=r[s+t]}raycast(t,e){let i=this.matrixWorld,r=this.count;if(nM.geometry=this.geometry,nM.material=this.material,void 0!==nM.material&&(null===this.boundingSphere&&this.computeBoundingSphere(),nw.copy(this.boundingSphere),nw.applyMatrix4(i),!1!==t.ray.intersectsSphere(nw)))for(let s=0;s<r;s++){this.getMatrixAt(s,nf),ng.multiplyMatrices(i,nf),nM.matrixWorld=ng,nM.raycast(t,nx);for(let t=0,i=nx.length;t<i;t++){let i=nx[t];i.instanceId=s,i.object=this,e.push(i)}nx.length=0}}setColorAt(t,e){null===this.instanceColor&&(this.instanceColor=new ny(new Float32Array(3*this.instanceMatrix.count).fill(1),3)),e.toArray(this.instanceColor.array,3*t)}setMatrixAt(t,e){e.toArray(this.instanceMatrix.array,16*t)}setMorphAt(t,e){let i=e.morphTargetInfluences,r=i.length+1;null===this.morphTexture&&(this.morphTexture=new nc(new Float32Array(r*this.count),r,this.count,tW,tO));let s=this.morphTexture.source.data.data,n=0;for(let t=0;t<i.length;t++)n+=i[t];let a=this.geometry.morphTargetsRelative?1:1-n,o=r*t;s[o]=a,s.set(i,o+1)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),null!==this.morphTexture&&(this.morphTexture.dispose(),this.morphTexture=null)}}let n_=new ih,nA=new ih,nT=new ic;class nz{constructor(t=new ih(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,i,r){return this.normal.set(t,e,i),this.constant=r,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,i){let r=n_.subVectors(i,e).cross(nA.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(r,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){let t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){let i=t.delta(n_),r=this.normal.dot(i);if(0===r)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;let s=-(t.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:e.copy(t.start).addScaledVector(i,s)}intersectsLine(t){let e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){let i=e||nT.getNormalMatrix(t),r=this.coplanarPoint(n_).applyMatrix4(t),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}let nI=new i4,nC=new ia(.5,.5),nk=new ih;class nB{constructor(t=new nz,e=new nz,i=new nz,r=new nz,s=new nz,n=new nz){this.planes=[t,e,i,r,s,n]}set(t,e,i,r,s,n){let a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(i),a[3].copy(r),a[4].copy(s),a[5].copy(n),this}copy(t){let e=this.planes;for(let i=0;i<6;i++)e[i].copy(t.planes[i]);return this}setFromProjectionMatrix(t,e=e1){let i=this.planes,r=t.elements,s=r[0],n=r[1],a=r[2],o=r[3],h=r[4],l=r[5],u=r[6],c=r[7],p=r[8],d=r[9],m=r[10],y=r[11],f=r[12],g=r[13],x=r[14],v=r[15];if(i[0].setComponents(o-s,c-h,y-p,v-f).normalize(),i[1].setComponents(o+s,c+h,y+p,v+f).normalize(),i[2].setComponents(o+n,c+l,y+d,v+g).normalize(),i[3].setComponents(o-n,c-l,y-d,v-g).normalize(),i[4].setComponents(o-a,c-u,y-m,v-x).normalize(),e===e1)i[5].setComponents(o+a,c+u,y+m,v+x).normalize();else if(e===e2)i[5].setComponents(a,u,m,x).normalize();else throw Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),nI.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{let e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),nI.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(nI)}intersectsSprite(t){nI.center.set(0,0,0);let e=nC.distanceTo(t.center);return nI.radius=.7071067811865476+e,nI.applyMatrix4(t.matrixWorld),this.intersectsSphere(nI)}intersectsSphere(t){let e=this.planes,i=t.center,r=-t.radius;for(let t=0;t<6;t++)if(e[t].distanceToPoint(i)<r)return!1;return!0}intersectsBox(t){let e=this.planes;for(let i=0;i<6;i++){let r=e[i];if(nk.x=r.normal.x>0?t.max.x:t.min.x,nk.y=r.normal.y>0?t.max.y:t.min.y,nk.z=r.normal.z>0?t.max.z:t.min.z,0>r.distanceToPoint(nk))return!1}return!0}containsPoint(t){let e=this.planes;for(let i=0;i<6;i++)if(0>e[i].distanceToPoint(t))return!1;return!0}clone(){return new this.constructor().copy(this)}}let nO=new rs,nE=new nB;
40class nR{constructor(){this.coordinateSystem=e1}intersectsObject(t,e){if(!e.isArrayCamera||0===e.cameras.length)return!1;for(let i=0;i<e.cameras.length;i++){let r=e.cameras[i];if(nO.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),nE.setFromProjectionMatrix(nO,this.coordinateSystem),nE.intersectsObject(t))return!0}return!1}intersectsSprite(t,e){if(!e||!e.cameras||0===e.cameras.length)return!1;for(let i=0;i<e.cameras.length;i++){let r=e.cameras[i];if(nO.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),nE.setFromProjectionMatrix(nO,this.coordinateSystem),nE.intersectsSprite(t))return!0}return!1}intersectsSphere(t,e){if(!e||!e.cameras||0===e.cameras.length)return!1;for(let i=0;i<e.cameras.length;i++){let r=e.cameras[i];if(nO.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),nE.setFromProjectionMatrix(nO,this.coordinateSystem),nE.intersectsSphere(t))return!0}return!1}intersectsBox(t,e){if(!e||!e.cameras||0===e.cameras.length)return!1;for(let i=0;i<e.cameras.length;i++){let r=e.cameras[i];if(nO.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),nE.setFromProjectionMatrix(nO,this.coordinateSystem),nE.intersectsBox(t))return!0}return!1}containsPoint(t,e){if(!e||!e.cameras||0===e.cameras.length)return!1;for(let i=0;i<e.cameras.length;i++){let r=e.cameras[i];if(nO.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),nE.setFromProjectionMatrix(nO,this.coordinateSystem),nE.containsPoint(t))return!0}return!1}clone(){return new nR}}function nP(t,e){return t-e}function nN(t,e){return t.z-e.z}function nV(t,e){return e.z-t.z}class nL{constructor(){this.index=0,this.pool=[],this.list=[]}push(t,e,i,r){let s=this.pool,n=this.list;this.index>=s.length&&s.push({start:-1,count:-1,z:-1,index:-1});let a=s[this.index];n.push(a),this.index++,a.start=t,a.count=e,a.z=i,a.index=r}reset(){this.list.length=0,this.index=0}}let nF=new rs,nj=new rY(1,1,1),nD=new nB,nU=new nR,nW=new iD,nJ=new i4,nH=new ih,nq=new ih,nG=new ih,nX=new nL,nZ=new sM,nY=[];function n$(t,e){if(t.constructor!==e.constructor){let i=Math.min(t.length,e.length);for(let r=0;r<i;r++)e[r]=t[r]}else{let i=Math.min(t.length,e.length);e.set(new t.constructor(t.buffer,0,i))}}class nQ extends sM{constructor(t,e,i=2*e,r){super(new sl,r),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._instanceInfo=[],this._geometryInfo=[],this._availableInstanceIds=[],this._availableGeometryIds=[],this._nextIndexStart=0,this._nextVertexStart=0,this._geometryCount=0,this._visibilityChanged=!0,this._geometryInitialized=!1,this._maxInstanceCount=t,this._maxVertexCount=e,this._maxIndexCount=i,this._multiDrawCounts=new Int32Array(t),this._multiDrawStarts=new Int32Array(t),this._multiDrawCount=0,this._multiDrawInstances=null,this._matricesTexture=null,this._indirectTexture=null,this._colorsTexture=null,this._initMatricesTexture(),this._initIndirectTexture()}get maxInstanceCount(){return this._maxInstanceCount}get instanceCount(){return this._instanceInfo.length-this._availableInstanceIds.length}get unusedVertexCount(){return this._maxVertexCount-this._nextVertexStart}get unusedIndexCount(){return this._maxIndexCount-this._nextIndexStart}_initMatricesTexture(){let t=Math.sqrt(4*this._maxInstanceCount),e=new nc(new Float32Array((t=Math.max(t=4*Math.ceil(t/4),4))*t*4),t,t,tj,tO);this._matricesTexture=e}_initIndirectTexture(){let t=Math.sqrt(this._maxInstanceCount),e=new nc(new Uint32Array((t=Math.ceil(t))*t),t,t,tJ,tB);this._indirectTexture=e}_initColorsTexture(){let t=Math.sqrt(this._maxInstanceCount),e=new nc(new Float32Array((t=Math.ceil(t))*t*4).fill(1),t,t,tj,tO);e.colorSpace=iT.workingColorSpace,this._colorsTexture=e}_initializeGeometry(t){let e=this.geometry,i=this._maxVertexCount,r=this._maxIndexCount;if(!1===this._geometryInitialized){for(let r in t.attributes){let{array:s,itemSize:n,normalized:a}=t.getAttribute(r),o=new r7(new s.constructor(i*n),n,a);e.setAttribute(r,o)}if(null!==t.getIndex()){let t=i>65535?new Uint32Array(r):new Uint16Array(r);e.setIndex(new r7(t,1))}this._geometryInitialized=!0}}_validateGeometry(t){let e=this.geometry;if(!!t.getIndex()!=!!e.getIndex())throw Error('THREE.BatchedMesh: All geometries must consistently have "index".');
40for(let i in e.attributes){if(!t.hasAttribute(i))throw Error(`THREE.BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);let r=t.getAttribute(i),s=e.getAttribute(i);if(r.itemSize!==s.itemSize||r.normalized!==s.normalized)throw Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(t){let e=this._instanceInfo;if(t<0||t>=e.length||!1===e[t].active)throw Error(`THREE.BatchedMesh: Invalid instanceId ${t}. Instance is either out of range or has been deleted.`)}validateGeometryId(t){let e=this._geometryInfo;if(t<0||t>=e.length||!1===e[t].active)throw Error(`THREE.BatchedMesh: Invalid geometryId ${t}. Geometry is either out of range or has been deleted.`)}setCustomSort(t){return this.customSort=t,this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new iD);let t=this.boundingBox,e=this._instanceInfo;t.makeEmpty();for(let i=0,r=e.length;i<r;i++){if(!1===e[i].active)continue;let r=e[i].geometryIndex;this.getMatrixAt(i,nF),this.getBoundingBoxAt(r,nW).applyMatrix4(nF),t.union(nW)}}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new i4);let t=this.boundingSphere,e=this._instanceInfo;t.makeEmpty();for(let i=0,r=e.length;i<r;i++){if(!1===e[i].active)continue;let r=e[i].geometryIndex;this.getMatrixAt(i,nF),this.getBoundingSphereAt(r,nJ).applyMatrix4(nF),t.union(nJ)}}addInstance(t){if(this._instanceInfo.length>=this.maxInstanceCount&&0===this._availableInstanceIds.length)throw Error("THREE.BatchedMesh: Maximum item count reached.");let e={visible:!0,active:!0,geometryIndex:t},i=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(nP),i=this._availableInstanceIds.shift(),this._instanceInfo[i]=e):(i=this._instanceInfo.length,this._instanceInfo.push(e));let r=this._matricesTexture;nF.identity().toArray(r.image.data,16*i),r.needsUpdate=!0;let s=this._colorsTexture;return s&&(nj.toArray(s.image.data,4*i),s.needsUpdate=!0),this._visibilityChanged=!0,i}addGeometry(t,e=-1,i=-1){let r;this._initializeGeometry(t),this._validateGeometry(t);let s={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},n=this._geometryInfo;s.vertexStart=this._nextVertexStart,s.reservedVertexCount=-1===e?t.getAttribute("position").count:e;let a=t.getIndex();if(null!==a&&(s.indexStart=this._nextIndexStart,s.reservedIndexCount=-1===i?a.count:i),-1!==s.indexStart&&s.indexStart+s.reservedIndexCount>this._maxIndexCount||s.vertexStart+s.reservedVertexCount>this._maxVertexCount)throw Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(nP),n[r=this._availableGeometryIds.shift()]=s):(r=this._geometryCount,this._geometryCount++,n.push(s)),this.setGeometryAt(r,t),this._nextIndexStart=s.indexStart+s.reservedIndexCount,this._nextVertexStart=s.vertexStart+s.reservedVertexCount,r}setGeometryAt(t,e){if(t>=this._geometryCount)throw Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(e);let i=this.geometry,r=null!==i.getIndex(),s=i.getIndex(),n=e.getIndex(),a=this._geometryInfo[t];if(r&&n.count>a.reservedIndexCount||e.attributes.position.count>a.reservedVertexCount)throw Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");let o=a.vertexStart,h=a.reservedVertexCount;for(let t in a.vertexCount=e.getAttribute("position").count,i.attributes){let r=e.getAttribute(t),s=i.getAttribute(t);!function(t,e,i=0){let r=e.itemSize;if(t.isInterleavedBufferAttribute||t.array.constructor!==e.array.constructor){let s=t.count;for(let n=0;n<s;n++)for(let s=0;s<r;s++)e.setComponent(n+i,s,t.getComponent(n,s))}else e.array.set(t.array,i*r);e.needsUpdate=!0}(r,s,o);let n=r.itemSize;for(let t=r.count;t<h;t++){let e=o+t;for(let t=0;t<n;t++)s.setComponent(e,t,0)}s.needsUpdate=!0,s.addUpdateRange(o*n,h*n)}if(r){let t=a.indexStart,i=a.reservedIndexCount;a.indexCount=e.getIndex().count;for(let e=0;e<n.count;e++)s.setX(t+e,o+n.getX(e));for(let e=n.count;e<i;e++)s.setX(t+e,o);s.needsUpdate=!0,s.addUpdateRange(t,a.reservedIndexCount)}
40return a.start=r?a.indexStart:a.vertexStart,a.count=r?a.indexCount:a.vertexCount,a.boundingBox=null,null!==e.boundingBox&&(a.boundingBox=e.boundingBox.clone()),a.boundingSphere=null,null!==e.boundingSphere&&(a.boundingSphere=e.boundingSphere.clone()),this._visibilityChanged=!0,t}deleteGeometry(t){let e=this._geometryInfo;if(t>=e.length||!1===e[t].active)return this;let i=this._instanceInfo;for(let e=0,r=i.length;e<r;e++)i[e].active&&i[e].geometryIndex===t&&this.deleteInstance(e);return e[t].active=!1,this._availableGeometryIds.push(t),this._visibilityChanged=!0,this}deleteInstance(t){return this.validateInstanceId(t),this._instanceInfo[t].active=!1,this._availableInstanceIds.push(t),this._visibilityChanged=!0,this}optimize(){let t=0,e=0,i=this._geometryInfo,r=i.map((t,e)=>e).sort((t,e)=>i[t].vertexStart-i[e].vertexStart),s=this.geometry;for(let n=0,a=i.length;n<a;n++){let a=i[r[n]];if(!1!==a.active){if(null!==s.index){if(a.indexStart!==e){let{indexStart:i,vertexStart:r,reservedIndexCount:n}=a,o=s.index,h=o.array,l=t-r;for(let t=i;t<i+n;t++)h[t]=h[t]+l;o.array.copyWithin(e,i,i+n),o.addUpdateRange(e,n),a.indexStart=e}e+=a.reservedIndexCount}if(a.vertexStart!==t){let{vertexStart:e,reservedVertexCount:i}=a,r=s.attributes;for(let s in r){let n=r[s],{array:a,itemSize:o}=n;a.copyWithin(t*o,e*o,(e+i)*o),n.addUpdateRange(t*o,i*o)}a.vertexStart=t}t+=a.reservedVertexCount,a.start=s.index?a.indexStart:a.vertexStart,this._nextIndexStart=s.index?a.indexStart+a.reservedIndexCount:0,this._nextVertexStart=a.vertexStart+a.reservedVertexCount}}return this}getBoundingBoxAt(t,e){if(t>=this._geometryCount)return null;let i=this.geometry,r=this._geometryInfo[t];if(null===r.boundingBox){let t=new iD,e=i.index,s=i.attributes.position;for(let i=r.start,n=r.start+r.count;i<n;i++){let r=i;e&&(r=e.getX(r)),t.expandByPoint(nH.fromBufferAttribute(s,r))}r.boundingBox=t}return e.copy(r.boundingBox),e}getBoundingSphereAt(t,e){if(t>=this._geometryCount)return null;let i=this.geometry,r=this._geometryInfo[t];if(null===r.boundingSphere){let e=new i4;this.getBoundingBoxAt(t,nW),nW.getCenter(e.center);let s=i.index,n=i.attributes.position,a=0;for(let t=r.start,i=r.start+r.count;t<i;t++){let i=t;s&&(i=s.getX(i)),nH.fromBufferAttribute(n,i),a=Math.max(a,e.center.distanceToSquared(nH))}e.radius=Math.sqrt(a),r.boundingSphere=e}return e.copy(r.boundingSphere),e}setMatrixAt(t,e){this.validateInstanceId(t);let i=this._matricesTexture,r=this._matricesTexture.image.data;return e.toArray(r,16*t),i.needsUpdate=!0,this}getMatrixAt(t,e){return this.validateInstanceId(t),e.fromArray(this._matricesTexture.image.data,16*t)}setColorAt(t,e){return this.validateInstanceId(t),null===this._colorsTexture&&this._initColorsTexture(),e.toArray(this._colorsTexture.image.data,4*t),this._colorsTexture.needsUpdate=!0,this}getColorAt(t,e){return this.validateInstanceId(t),e.fromArray(this._colorsTexture.image.data,4*t)}setVisibleAt(t,e){return this.validateInstanceId(t),this._instanceInfo[t].visible===e||(this._instanceInfo[t].visible=e,this._visibilityChanged=!0),this}getVisibleAt(t){return this.validateInstanceId(t),this._instanceInfo[t].visible}setGeometryIdAt(t,e){return this.validateInstanceId(t),this.validateGeometryId(e),this._instanceInfo[t].geometryIndex=e,this}getGeometryIdAt(t){return this.validateInstanceId(t),this._instanceInfo[t].geometryIndex}getGeometryRangeAt(t,e={}){this.validateGeometryId(t);let i=this._geometryInfo[t];return e.vertexStart=i.vertexStart,e.vertexCount=i.vertexCount,e.reservedVertexCount=i.reservedVertexCount,e.indexStart=i.indexStart,e.indexCount=i.indexCount,e.reservedIndexCount=i.reservedIndexCount,e.start=i.start,e.count=i.count,e}setInstanceCount(t){let e=this._availableInstanceIds,i=this._instanceInfo;for(e.sort(nP);e[e.length-1]===i.length;)i.pop(),e.pop();if(t<i.length)throw Error(`BatchedMesh: Instance ids outside the range ${t} are being used. Cannot shrink instance count.`);let r=new Int32Array(t),s=new Int32Array(t);n$(this._multiDrawCounts,r),n$(this._multiDrawStarts,s),this._multiDrawCounts=r,this._multiDrawStarts=s,this._maxInstanceCount=t;let n=this._indirectTexture,a=this._matricesTexture,o=this._colorsTexture;n.dispose(),this._initIndirectTexture(),n$(n.image.data,this._indirectTexture.image.data),a.dispose(),this._initMatricesTexture(),n$(a.image.data,this._matricesTexture.image.data),o&&(o.dispose(),this._initColorsTexture(),n$(o.image.data,this._colorsTexture.image.data))}setGeometrySize(t,e){let i=[...this._geometryInfo].filter(t=>t.active);if(Math.max(...i.map(t=>t.vertexStart+t.reservedVertexCount))>t)throw Error(`BatchedMesh: Geometry vertex values are being used outside the range ${e}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...i.map(t=>t.indexStart+t.reservedIndexCount))>e)throw Error(`BatchedMesh: Geometry index values are being used outside the range ${e}. Cannot shrink further.`);let r=this.geometry;r.dispose(),this._maxVertexCount=t,this._maxIndexCount=e,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new sl,this._initializeGeometry(r));let s=this.geometry;for(let t in r.index&&n$(r.index.array,s.index.array),r.attributes)n$(r.attributes[t].array,s.attributes[t].array)}raycast(t,e){let i=this._instanceInfo,r=this._geometryInfo,s=this.matrixWorld,n=this.geometry;nZ.material=this.material,nZ.geometry.index=n.index,nZ.geometry.attributes=n.attributes,null===nZ.geometry.boundingBox&&
40(nZ.geometry.boundingBox=new iD),null===nZ.geometry.boundingSphere&&(nZ.geometry.boundingSphere=new i4);for(let n=0,a=i.length;n<a;n++){if(!i[n].visible||!i[n].active)continue;let a=i[n].geometryIndex,o=r[a];nZ.geometry.setDrawRange(o.start,o.count),this.getMatrixAt(n,nZ.matrixWorld).premultiply(s),this.getBoundingBoxAt(a,nZ.geometry.boundingBox),this.getBoundingSphereAt(a,nZ.geometry.boundingSphere),nZ.raycast(t,nY);for(let t=0,i=nY.length;t<i;t++){let i=nY[t];i.object=this,i.batchId=n,e.push(i)}nY.length=0}nZ.material=null,nZ.geometry.index=null,nZ.geometry.attributes={},nZ.geometry.setDrawRange(0,1/0)}copy(t){return super.copy(t),this.geometry=t.geometry.clone(),this.perObjectFrustumCulled=t.perObjectFrustumCulled,this.sortObjects=t.sortObjects,this.boundingBox=null!==t.boundingBox?t.boundingBox.clone():null,this.boundingSphere=null!==t.boundingSphere?t.boundingSphere.clone():null,this._geometryInfo=t._geometryInfo.map(t=>({...t,boundingBox:null!==t.boundingBox?t.boundingBox.clone():null,boundingSphere:null!==t.boundingSphere?t.boundingSphere.clone():null})),this._instanceInfo=t._instanceInfo.map(t=>({...t})),this._availableInstanceIds=t._availableInstanceIds.slice(),this._availableGeometryIds=t._availableGeometryIds.slice(),this._nextIndexStart=t._nextIndexStart,this._nextVertexStart=t._nextVertexStart,this._geometryCount=t._geometryCount,this._maxInstanceCount=t._maxInstanceCount,this._maxVertexCount=t._maxVertexCount,this._maxIndexCount=t._maxIndexCount,this._geometryInitialized=t._geometryInitialized,this._multiDrawCounts=t._multiDrawCounts.slice(),this._multiDrawStarts=t._multiDrawStarts.slice(),this._indirectTexture=t._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=t._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),null!==this._colorsTexture&&(this._colorsTexture=t._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,null!==this._colorsTexture&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(t,e,i,r,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;let n=r.getIndex(),a=null===n?1:n.array.BYTES_PER_ELEMENT,o=this._instanceInfo,h=this._multiDrawStarts,l=this._multiDrawCounts,u=this._geometryInfo,c=this.perObjectFrustumCulled,p=this._indirectTexture,d=p.image.data,m=i.isArrayCamera?nU:nD;c&&!i.isArrayCamera&&(nF.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),nD.setFromProjectionMatrix(nF,t.coordinateSystem));let y=0;if(this.sortObjects){nF.copy(this.matrixWorld).invert(),nH.setFromMatrixPosition(i.matrixWorld).applyMatrix4(nF),nq.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(nF);for(let t=0,e=o.length;t<e;t++)if(o[t].visible&&o[t].active){let e=o[t].geometryIndex;this.getMatrixAt(t,nF),this.getBoundingSphereAt(e,nJ).applyMatrix4(nF);let r=!1;if(c&&(r=!m.intersectsSphere(nJ,i)),!r){let i=u[e],r=nG.subVectors(nJ.center,nH).dot(nq);nX.push(i.start,i.count,r,t)}}let t=nX.list,e=this.customSort;null===e?t.sort(s.transparent?nV:nN):e.call(this,t,i);for(let e=0,i=t.length;e<i;e++){let i=t[e];h[y]=i.start*a,l[y]=i.count,d[y]=i.index,y++}nX.reset()}else for(let t=0,e=o.length;t<e;t++)if(o[t].visible&&o[t].active){let e=o[t].geometryIndex,r=!1;if(c&&(this.getMatrixAt(t,nF),this.getBoundingSphereAt(e,nJ).applyMatrix4(nF),r=!m.intersectsSphere(nJ,i)),!r){let i=u[e];h[y]=i.start*a,l[y]=i.count,d[y]=t,y++}}p.needsUpdate=!0,this._multiDrawCount=y,this._visibilityChanged=!1}onBeforeShadow(t,e,i,r,s,n){this.onBeforeRender(t,null,r,s,n)}}class nK extends rK{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new rY(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}let n0=new ih,n1=new ih,n2=new rs,n3=new rr,n5=new i4,n4=new ih,n6=new ih;
40class n7 extends rB{constructor(t=new sl,e=new nK){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){let t=this.geometry;if(null===t.index){let e=t.attributes.position,i=[0];for(let t=1,r=e.count;t<r;t++)n0.fromBufferAttribute(e,t-1),n1.fromBufferAttribute(e,t),i[t]=i[t-1],i[t]+=n0.distanceTo(n1);t.setAttribute("lineDistance",new se(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(t,e){let i=this.geometry,r=this.matrixWorld,s=t.params.Line.threshold,n=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),n5.copy(i.boundingSphere),n5.applyMatrix4(r),n5.radius+=s,!1===t.ray.intersectsSphere(n5))return;n2.copy(r).invert(),n3.copy(t.ray).applyMatrix4(n2);let a=s/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,h=this.isLineSegments?2:1,l=i.index,u=i.attributes.position;if(null!==l){let i=Math.max(0,n.start),r=Math.min(l.count,n.start+n.count);for(let s=i,n=r-1;s<n;s+=h){let i=n8(this,t,n3,o,l.getX(s),l.getX(s+1),s);i&&e.push(i)}if(this.isLineLoop){let s=n8(this,t,n3,o,l.getX(r-1),l.getX(i),r-1);s&&e.push(s)}}else{let i=Math.max(0,n.start),r=Math.min(u.count,n.start+n.count);for(let s=i,n=r-1;s<n;s+=h){let i=n8(this,t,n3,o,s,s+1,s);i&&e.push(i)}if(this.isLineLoop){let s=n8(this,t,n3,o,r-1,i,r-1);s&&e.push(s)}}}updateMorphTargets(){let t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){let i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=i.length;t<e;t++){let e=i[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}}function n8(t,e,i,r,s,n,a){let o=t.geometry.attributes.position;if(n0.fromBufferAttribute(o,s),n1.fromBufferAttribute(o,n),i.distanceSqToSegment(n0,n1,n4,n6)>r)return;n4.applyMatrix4(t.matrixWorld);let h=e.ray.origin.distanceTo(n4);if(!(h<e.near)&&!(h>e.far))return{distance:h,point:n6.clone().applyMatrix4(t.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:t}}let n9=new ih,at=new ih;class ae extends n7{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){let t=this.geometry;if(null===t.index){let e=t.attributes.position,i=[];for(let t=0,r=e.count;t<r;t+=2)n9.fromBufferAttribute(e,t),at.fromBufferAttribute(e,t+1),i[t]=0===t?0:i[t-1],i[t+1]=i[t]+n9.distanceTo(at);t.setAttribute("lineDistance",new se(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class ai extends n7{constructor(t,e){super(t,e),this.isLineLoop=!0,this.type="LineLoop"}}class ar extends rK{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new rY(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}let as=new rs,an=new rr,aa=new i4,ao=new ih;class ah extends rB{constructor(t=new sl,e=new ar){super(),this.isPoints=!0,this.type="Points",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}raycast(t,e){let i=this.geometry,r=this.matrixWorld,s=t.params.Points.threshold,n=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),aa.copy(i.boundingSphere),aa.applyMatrix4(r),aa.radius+=s,!1===t.ray.intersectsSphere(aa))return;as.copy(r).invert(),an.copy(t.ray).applyMatrix4(as);let a=s/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,h=i.index,l=i.attributes.position;if(null!==h){let i=Math.max(0,n.start),s=Math.min(h.count,n.start+n.count);for(let n=i;n<s;n++){let i=h.getX(n);ao.fromBufferAttribute(l,i),al(ao,i,o,r,t,e,this)}}else{let i=Math.max(0,n.start),s=Math.min(l.count,n.start+n.count);for(let n=i;n<s;n++)ao.fromBufferAttribute(l,n),al(ao,n,o,r,t,e,this)}}updateMorphTargets(){let t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){let i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=i.length;t<e;t++){let e=i[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}}function al(t,e,i,r,s,n,a){let o=an.distanceSqToPoint(t);if(o<i){let i=new ih;an.closestPointToPoint(t,i),i.applyMatrix4(r);let h=s.ray.origin.distanceTo(i);if(h<s.near||h>s.far)return;n.push({distance:h,distanceToRay:Math.sqrt(o),point:i,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class au extends iP{constructor(t,e){super({width:t,height:e}),this.isFramebufferTexture=!0,this.magFilter=tv,this.minFilter=tv,this.generateMipmaps=!1,this.needsUpdate=!0}}class ac extends iP{constructor(t,e,i=tB,r,s,n,a=tv,o=tv,h,l=tD,u=1){if(l!==tD&&l!==tU)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super({width:t,height:e,depth:u},r,s,n,a,o,l,i,h),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.source=new iB(Object.assign({},t.image)),this.compareFunction=t.compareFunction,this}toJSON(t){let e=super.toJSON(t);return null!==this.compareFunction&&(e.compareFunction=this.compareFunction),e}}class ap extends sl{constructor(t=1,e=1,i=4,r=8,s=1){super(),this.type="CapsuleGeometry",this.parameters={radiu
40s:t,height:e,capSegments:i,radialSegments:r,heightSegments:s},e=Math.max(0,e),i=Math.max(1,Math.floor(i)),r=Math.max(3,Math.floor(r));let n=[],a=[],o=[],h=[],l=e/2,u=Math.PI/2*t,c=e,p=2*u+c,d=2*i+(s=Math.max(1,Math.floor(s))),m=r+1,y=new ih,f=new ih;for(let g=0;g<=d;g++){let x=0,v=0,b=0,M=0;if(g<=i){let e=g/i,r=e*Math.PI/2;v=-l-t*Math.cos(r),b=t*Math.sin(r),M=-t*Math.cos(r),x=e*u}else if(g<=i+s){let r=(g-i)/s;v=-l+r*e,b=t,M=0,x=u+r*c}else{let e=(g-i-s)/i,r=e*Math.PI/2;v=l+t*Math.sin(r),b=t*Math.cos(r),M=t*Math.sin(r),x=u+c+e*u}let w=Math.max(0,Math.min(1,x/p)),S=0;0===g?S=.5/r:g===d&&(S=-.5/r);for(let t=0;t<=r;t++){let e=t/r,i=e*Math.PI*2,s=Math.sin(i),n=Math.cos(i);f.x=-b*n,f.y=v,f.z=b*s,a.push(f.x,f.y,f.z),y.set(-b*n,M,b*s),y.normalize(),o.push(y.x,y.y,y.z),h.push(e+S,w)}if(g>0){let t=(g-1)*m;for(let e=0;e<r;e++){let i=t+e,r=t+e+1,s=g*m+e,a=g*m+e+1;n.push(i,r,s),n.push(r,a,s)}}}this.setIndex(n),this.setAttribute("position",new se(a,3)),this.setAttribute("normal",new se(o,3)),this.setAttribute("uv",new se(h,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new ap(t.radius,t.height,t.capSegments,t.radialSegments,t.heightSegments)}}class ad extends sl{constructor(t=1,e=32,i=0,r=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:i,thetaLength:r},e=Math.max(3,e);let s=[],n=[],a=[],o=[],h=new ih,l=new ia;n.push(0,0,0),a.push(0,0,1),o.push(.5,.5);for(let s=0,u=3;s<=e;s++,u+=3){let c=i+s/e*r;h.x=t*Math.cos(c),h.y=t*Math.sin(c),n.push(h.x,h.y,h.z),a.push(0,0,1),l.x=(n[u]/t+1)/2,l.y=(n[u+1]/t+1)/2,o.push(l.x,l.y)}for(let t=1;t<=e;t++)s.push(t,t+1,0);this.setIndex(s),this.setAttribute("position",new se(n,3)),this.setAttribute("normal",new se(a,3)),this.setAttribute("uv",new se(o,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new ad(t.radius,t.segments,t.thetaStart,t.thetaLength)}}class am extends sl{constructor(t=1,e=1,i=1,r=32,s=1,n=!1,a=0,o=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:i,radialSegments:r,heightSegments:s,openEnded:n,thetaStart:a,thetaLength:o};let h=this;r=Math.floor(r),s=Math.floor(s);let l=[],u=[],c=[],p=[],d=0,m=[],y=i/2,f=0;function g(i){let s=d,n=new ia,m=new ih,g=0,x=!0===i?t:e,v=!0===i?1:-1;for(let t=1;t<=r;t++)u.push(0,y*v,0),c.push(0,v,0),p.push(.5,.5),d++;let b=d;for(let t=0;t<=r;t++){let e=t/r*o+a,i=Math.cos(e),s=Math.sin(e);m.x=x*s,m.y=y*v,m.z=x*i,u.push(m.x,m.y,m.z),c.push(0,v,0),n.x=.5*i+.5,n.y=.5*s*v+.5,p.push(n.x,n.y),d++}for(let t=0;t<r;t++){let e=s+t,r=b+t;!0===i?l.push(r,r+1,e):l.push(r+1,r,e),g+=3}h.addGroup(f,g,!0===i?1:2),f+=g}(function(){let n=new ih,g=new ih,x=0,v=(e-t)/i;for(let h=0;h<=s;h++){let l=[],f=h/s,x=f*(e-t)+t;for(let t=0;t<=r;t++){let e=t/r,s=e*o+a,h=Math.sin(s),m=Math.cos(s);g.x=x*h,g.y=-f*i+y,g.z=x*m,u.push(g.x,g.y,g.z),n.set(h,v,m).normalize(),c.push(n.x,n.y,n.z),p.push(e,1-f),l.push(d++)}m.push(l)}for(let i=0;i<r;i++)for(let r=0;r<s;r++){let n=m[r][i],a=m[r+1][i],o=m[r+1][i+1],h=m[r][i+1];(t>0||0!==r)&&(l.push(n,a,h),x+=3),(e>0||r!==s-1)&&(l.push(a,o,h),x+=3)}h.addGroup(f,x,0),f+=x})(),!1===n&&(t>0&&g(!0),e>0&&g(!1)),this.setIndex(l),this.setAttribute("position",new se(u,3)),this.setAttribute("normal",new se(c,3)),this.setAttribute("uv",new se(p,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new am(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class ay extends am{constructor(t=1,e=1,i=32,r=1,s=!1,n=0,a=2*Math.PI){super(0,t,e,i,r,s,n,a),this.type="C
40oneGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:r,openEnded:s,thetaStart:n,thetaLength:a}}static fromJSON(t){return new ay(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class af extends sl{constructor(t=[],e=[],i=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:i,detail:r};let s=[],n=[];function a(t){s.push(t.x,t.y,t.z)}function o(e,i){let r=3*e;i.x=t[r+0],i.y=t[r+1],i.z=t[r+2]}function h(t,e,i,r){r<0&&1===t.x&&(n[e]=t.x-1),0===i.x&&0===i.z&&(n[e]=r/2/Math.PI+.5)}function l(t){return Math.atan2(t.z,-t.x)}(function(t){let i=new ih,r=new ih,s=new ih;for(let n=0;n<e.length;n+=3)o(e[n+0],i),o(e[n+1],r),o(e[n+2],s),function(t,e,i,r){let s=r+1,n=[];for(let r=0;r<=s;r++){n[r]=[];let a=t.clone().lerp(i,r/s),o=e.clone().lerp(i,r/s),h=s-r;for(let t=0;t<=h;t++)0===t&&r===s?n[r][t]=a:n[r][t]=a.clone().lerp(o,t/h)}for(let t=0;t<s;t++)for(let e=0;e<2*(s-t)-1;e++){let i=Math.floor(e/2);e%2==0?(a(n[t][i+1]),a(n[t+1][i]),a(n[t][i])):(a(n[t][i+1]),a(n[t+1][i+1]),a(n[t+1][i]))}}(i,r,s,t)})(r),function(t){let e=new ih;for(let i=0;i<s.length;i+=3)e.x=s[i+0],e.y=s[i+1],e.z=s[i+2],e.normalize().multiplyScalar(t),s[i+0]=e.x,s[i+1]=e.y,s[i+2]=e.z}(i),function(){let t=new ih;for(let e=0;e<s.length;e+=3){t.x=s[e+0],t.y=s[e+1],t.z=s[e+2];let i=l(t)/2/Math.PI+.5,r=Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))/Math.PI+.5;n.push(i,1-r)}(function(){let t=new ih,e=new ih,i=new ih,r=new ih,a=new ia,o=new ia,u=new ia;for(let c=0,p=0;c<s.length;c+=9,p+=6){t.set(s[c+0],s[c+1],s[c+2]),e.set(s[c+3],s[c+4],s[c+5]),i.set(s[c+6],s[c+7],s[c+8]),a.set(n[p+0],n[p+1]),o.set(n[p+2],n[p+3]),u.set(n[p+4],n[p+5]),r.copy(t).add(e).add(i).divideScalar(3);let d=l(r);h(a,p+0,t,d),h(o,p+2,e,d),h(u,p+4,i,d)}})(),function(){for(let t=0;t<n.length;t+=6){let e=n[t+0],i=n[t+2],r=n[t+4],s=Math.max(e,i,r),a=Math.min(e,i,r);s>
40.9&&a<.1&&(e<.2&&(n[t+0]+=1),i<.2&&(n[t+2]+=1),r<.2&&(n[t+4]+=1))}}()}(),this.setAttribute("position",new se(s,3)),this.setAttribute("normal",new se(s.slice(),3)),this.setAttribute("uv",new se(n,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new af(t.vertices,t.indices,t.radius,t.details)}}class ag extends af{constructor(t=1,e=0){let i=(1+Math.sqrt(5))/2,r=1/i;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new ag(t.radius,t.detail)}}let ax=new ih,av=new ih,ab=new ih,aM=new rH;class aw extends sl{constructor(t=null,e=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:t,thresholdAngle:e},null!==t){let i=Math.cos(e6*e),r=t.getIndex(),s=t.getAttribute("position"),n=r?r.count:s.count,a=[0,0,0],o=["a","b","c"],h=[,,,],l={},u=[];for(let t=0;t<n;t+=3){r?(a[0]=r.getX(t),a[1]=r.getX(t+1),a[2]=r.getX(t+2)):(a[0]=t,a[1]=t+1,a[2]=t+2);let{a:e,b:n,c}=aM;if(e.fromBufferAttribute(s,a[0]),n.fromBufferAttribute(s,a[1]),c.fromBufferAttribute(s,a[2]),aM.getNormal(ab),h[0]=`${Math.round(1e4*e.x)},${Math.round(1e4*e.y)},${Math.round(1e4*e.z)}`,h[1]=`${Math.round(1e4*n.x)},${Math.round(1e4*n.y)},${Math.round(1e4*n.z)}`,h[2]=`${Math.round(1e4*c.x)},${Math.round(1e4*c.y)},${Math.round(1e4*c.z)}`,h[0]!==h[1]&&h[1]!==h[2]&&h[2]!==h[0])for(let t=0;t<3;t++){let e=(t+1)%3,r=h[t],s=h[e],n=aM[o[t]],c=aM[o[e]],p=`${r}_${s}`,d=`${s}_${r}`;d in l&&l[d]?(ab.dot(l[d].normal)<=i&&(u.push(n.x,n.y,n.z),u.push(c.x,c.y,c.z)),l[d]=null):p in l||(l[p]={index0:a[t],index1:a[e],normal:ab.clone()})}}for(let t in l)if(l[t]){let{index0:e,index1:i}=l[t];ax.fromBufferAttribute(s,e),av.fromBufferAttribute(s,i),u.push(ax.x,ax.y,ax.z),u.push(av.x,av.y,av.z)}this.setAttribute("position",new se(u,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}class aS{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){console.warn("THREE.Curve: .getPoint() not implemented.")}getPointAt(t,e){let i=this.getUtoTmapping(t);return this.getPoint(i,e)}getPoints(t=5){let e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e}getSpacedPoints(t=5){let e=[];for(let i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e}getLength(){let t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let e=[],i,r=this.getPoint(0),s=0;e.push(0);for(let n=1;n<=t;n++)e.push(s+=(i=this.getPoint(n/t)).distanceTo(r)),r=i;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e=null){let i;let r=this.getLengths(),s=0,n=r.length;i=e||t*r[n-1];let a=0,o=n-1,h;for(;a<=o;)if((h=r[s=Math.floor(a+(o-a)/2)]-i)<0)a=s+1;else if(h>0)o=s-1;else{o=s;break}if(r[s=o]===i)return s/(n-1);let l=r[s],u=r[s+1];return(s+(i-l)/(u-l))/(n-1)}getTangent(t,e){let i=t-1e-4,r=t+1e-4;i<0&&(i=0),r>1&&(r=1);let s=this.getPoint(i),n=this.getPoint(r),a=e||(s.isVector2?new ia:new ih);return a.copy(n).sub(s).normalize(),a}getTangentAt(t,e){let i=this.getUtoTmapping(t);return this.getTangent(i,e)}computeFrenetFrames(t,e=!1){let i=new ih,r=[],s=[],n=[],a=new ih,o=new rs;for(let e=0;e<=t;e++){let i=e/t;r[e]=this.getTangentAt(i,new ih)}s[0]=new ih,n[0]=new ih;let h=Number.MAX_VALUE,l=Math.abs(r[0].x),u=Math.abs(r[0].y),c=Math.abs(r[0].z);l<=h&&(h=l,i.set(1,0,0)),u<=h&&(h=u,i.set(0,1,0)),c<=h&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],a),n[0].crossVectors(r[0],s[0]);for(let e=1;e<=t;e++){if(s[e]=s[e-1].clone(),n[e]=n[e-1].clone(),a.crossVectors(r[e-1],r[e]),a.length()>Number.EPSILON){a.normalize();let t=Math.acos(e9(r[e-1].dot(r[e]),-1,1));s[e].applyMatrix4(o.makeRotationAxis(a,t))}n[e].crossVectors(r[e],s[e])}if(!0===e){let e=Math.acos(e9(s[0].dot(s[t]),-1,1));e/=t,r[0].dot(a.crossVectors(s[0],s[t]))>0&&(e=-e);for(let i=1;i<=t;i++)s[i].applyMatrix4(o.makeRotationAxis(r[i],e*i)),n[i].crossVectors(r[i],s[i])}return{tangents:r,normals:s,binormals:n}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){let t={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.t
40ype,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class a_ extends aS{constructor(t=0,e=0,i=1,r=1,s=0,n=2*Math.PI,a=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=n,this.aClockwise=a,this.aRotation=o}getPoint(t,e=new ia){let i=2*Math.PI,r=this.aEndAngle-this.aStartAngle,s=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=i;for(;r>i;)r-=i;r<Number.EPSILON&&(r=s?0:i),!0!==this.aClockwise||s||(r===i?r=-i:r-=i);let n=this.aStartAngle+t*r,a=this.aX+this.xRadius*Math.cos(n),o=this.aY+this.yRadius*Math.sin(n);if(0!==this.aRotation){let t=Math.cos(this.aRotation),e=Math.sin(this.aRotation),i=a-this.aX,r=o-this.aY;a=i*t-r*e+this.aX,o=i*e+r*t+this.aY}return e.set(a,o)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){let t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}class aA extends a_{constructor(t,e,i,r,s,n){super(t,e,i,i,r,s,n),this.isArcCurve=!0,this.type="ArcCurve"}}function aT(){let t=0,e=0,i=0,r=0;function s(s,n,a,o){t=s,e=a,i=-3*s+3*n-2*a-o,r=2*s-2*n+a+o}return{initCatmullRom:function(t,e,i,r,n){s(e,i,n*(i-t),n*(r-e))},initNonuniformCatmullRom:function(t,e,i,r,n,a,o){let h=(e-t)/n-(i-t)/(n+a)+(i-e)/a,l=(i-e)/a-(r-e)/(a+o)+(r-i)/o;s(e,i,h*=a,l*=a)},calc:function(s){let n=s*s;return t+e*s+i*n+n*s*r}}}let az=new ih,aI=new aT,aC=new aT,ak=new aT;class aB extends aS{constructor(t=[],e=!1,i="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=i,this.tension=r}getPoint(t,e=new ih){let i,r;let s=this.points,n=s.length,a=(n-(this.closed?0:1))*t,o=Math.floor(a),h=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/n)+1)*n:0===h&&o===n-1&&(o=n-2,h=1),this.closed||o>0?i=s[(o-1)%n]:(az.subVectors(s[0],s[1]).add(s[0]),i=az);let l=s[o%n],u=s[(o+1)%n];if(this.closed||o+2<n?r=s[(o+2)%n]:(az.subVectors(s[n-1],s[n-2]).add(s[n-1]),r=az),"centripetal"===this.curveType||"chordal"===this.curveType){let t="chordal"===this.curveType?.5:.25,e=Math.pow(i.distanceToSquared(l),t),s=Math.pow(l.distanceToSquared(u),t),n=Math.pow(u.distanceToSquared(r),t);s<1e-4&&(s=1),e<1e-4&&(e=s),n<1e-4&&(n=s),aI.initNonuniformCatmullRom(i.x,l.x,u.x,r.x,e,s,n),aC.initNonuniformCatmullRom(i.y,l.y,u.y,r.y,e,s,n),ak.initNonuniformCatmullRom(i.z,l.z,u.z,r.z,e,s,n)}else"catmullrom"===this.curveType&&(aI.initCatmullRom(i.x,l.x,u.x,r.x,this.tension),aC.initCatmullRom(i.y,l.y,u.y,r.y,this.tension),ak.initCatmullRom(i.z,l.z,u.z,r.z,this.tension));return e.set(aI.calc(h),aC.calc(h),ak.calc(h)),e}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let i=t.points[e];this.points.push(i.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){let t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){let i=this.points[e];t.points.push(i.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let i=t.points[e];this.points.push(new ih().fromArray(i))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}}function aO(t,e,i,r,s){let n=(r-e)*.5,a=(s-i)*.5,o=t*t;return t*o*(2*i-2*r+n+a)+(-3*i+3*r-2*n-a)*o+n*t+i}function aE(t,e,i,r){return function(t,e){let i=1-t;return i*i*e}(t,e)+2*(1-t)*t*i+t*t*r}function aR(t,e,i,r,s){return function(t,e){let i=1-t;return i*i*i*e}(t,e)+function(t,e){let i=1-t;return 3*i*i*t*e}(t,i)+3*(1-t)*t*t*r+t*t*t*s}class aP extends aS{constructor(t=new ia,e=new ia,i=new ia,r=new ia){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=i,this.v3=r}getPoint(t,e=new ia){let i=this.v0,r=this.v1,s=this.v2,n=this.v3;return e.set(aR(t,i.x,r.x,s.x,n.x),aR(t,i.y,r.y,s.y,n.y)),e}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class aN extends aS{constructor(t=new ih,e=new ih,i=new ih,r=new ih){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=i,this.v3=r}getPoint(t,e=new ih){let i=this.v0,r=this.v1,s=this.v2,n=this.v3;return e.set(aR(t,i.x,r.x,s.x,n.x),aR(t,i.y,r.y,s.y,n.y),aR(t,i.z,r.z,s.z,n.z)),e}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class aV extends aS{constructor(t=new ia,e=new ia){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new ia){return 1===t?e.copy(this.v2):(e.copy(this.v2).sub(this.v1),e.multiplyScalar(t).add(this.v1)),e}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new ia){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class aL extends aS{constructor(t=new ih,e=new ih){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=t,this.v2=e}getPoint(t,e=new ih){return 1===t?e.copy(this.v2):(e.copy(this.v2).sub(this.v1),e.multiplyScalar(t).add(this.v1)),e}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new ih){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class aF extends aS{constructor(t=new ia,e=new ia,i=new ia){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=i}
40getPoint(t,e=new ia){let i=this.v0,r=this.v1,s=this.v2;return e.set(aE(t,i.x,r.x,s.x),aE(t,i.y,r.y,s.y)),e}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class aj extends aS{constructor(t=new ih,e=new ih,i=new ih){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new ih){let i=this.v0,r=this.v1,s=this.v2;return e.set(aE(t,i.x,r.x,s.x),aE(t,i.y,r.y,s.y),aE(t,i.z,r.z,s.z)),e}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class aD extends aS{constructor(t=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=t}getPoint(t,e=new ia){let i=this.points,r=(i.length-1)*t,s=Math.floor(r),n=r-s,a=i[0===s?s:s-1],o=i[s],h=i[s>i.length-2?i.length-1:s+1],l=i[s>i.length-3?i.length-1:s+2];return e.set(aO(n,a.x,o.x,h.x,l.x),aO(n,a.y,o.y,h.y,l.y)),e}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let i=t.points[e];this.points.push(i.clone())}return this}toJSON(){let t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){let i=this.points[e];t.points.push(i.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let i=t.points[e];this.points.push(new ia().fromArray(i))}return this}}var aU=Object.freeze({__proto__:null,ArcCurve:aA,CatmullRomCurve3:aB,CubicBezierCurve:aP,CubicBezierCurve3:aN,EllipseCurve:a_,LineCurve:aV,LineCurve3:aL,QuadraticBezierCurve:aF,QuadraticBezierCurve3:aj,SplineCurve:aD});class aW extends aS{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){let t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);if(!t.equals(e)){let i=!0===t.isVector2?"LineCurve":"LineCurve3";this.curves.push(new aU[i](e,t))}return this}getPoint(t,e){let i=t*this.getLength(),r=this.getCurveLengths(),s=0;for(;s<r.length;){if(r[s]>=i){let t=r[s]-i,n=this.curves[s],a=n.getLength(),o=0===a?0:1-t/a;return n.getPointAt(o,e)}s++}return null}getLength(){let t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let t=[],e=0;for(let i=0,r=this.curves.length;i<r;i++)t.push(e+=this.curves[i].getLength());return this.cacheLengths=t,t}getSpacedPoints(t=40){let e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){let e;let i=[];for(let r=0,s=this.curves;r<s.length;r++){let n=s[r],a=n.isEllipseCurve?2*t:n.isLineCurve||n.isLineCurve3?1:n.isSplineCurve?t*n.points.length:t,o=n.getPoints(a);for(let t=0;t<o.length;t++){let r=o[t];e&&e.equals(r)||(i.push(r),e=r)}}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}copy(t){super.copy(t),this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){let i=t.curves[e];this.curves.push(i.clone())}return this.autoClose=t.autoClose,this}toJSON(){let t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,i=this.curves.length;e<i;e++){let i=this.curves[e];t.curves.push(i.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){let i=t.curves[e];this.curves.push(new aU[i.type]().fromJSON(i))}return this}}class aJ extends aW{constructor(t){super(),this.type="Path",this.currentPoint=new ia,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,i=t.length;e<i;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){let i=new aV(this.currentPoint.clone(),new ia(t,e));return this.curves.push(i),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,i,r){let s=new aF(this.currentPoint.clone(),new ia(t,e),new ia(i,r));return this.curves.push(s),this.currentPoint.set(i,r),this}bezierCurveTo(t,e,i,r,s,n){let a=new aP(this.currentPoint.clone(),new ia(t,e),new ia(i,r),new ia(s,n));return this.curves.push(a),this.currentPoint.set(s,n),this}splineThru(t){let e=new aD([this.currentPoint.clone()].concat(t));return this.curves.push(e),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,i,r,s,n){let a=this.currentPoint.x,o=this.currentPoint.y;return this.absarc(t+a,e+o,i,r,s,n),this}absarc(t,e,i,r,s,n){return this.absellipse(t,e,i,i,r,s,n),this}ellipse(t,e,i,r,s,n,a,o){let h=this.currentPoint.x,l=this.currentPoint.y;return this.absellipse(t+h,e+l,i,r,s,n,a,o),this}absellipse(t,e,i,r,s,n,a,o){let h=new a_(t,e,i,r,s,n,a,o);if(this.curves.length>0){let t=h.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(h);let l=h.getPoint(1);return this.currentPoint.copy(l),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){let t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class aH extends aJ{constructor(t){super(t),this.uuid=e8(),this.type="Shape",this.holes=[]}getPointsHoles(t){let e=[];for(let i=0,r=this.holes.length;i<r;i++)e[i]=this.holes[i].getPoints(t);return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,i=t.holes.length;e<i;e++){let i=t.holes[e];this.holes.push(i.clone())}return this}toJSON(){let t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,i=this.holes.length;e<i;e++){let i=this.holes[e];t.holes.push(i.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,i=t.holes.length;e<i;e++){let i=t.holes[e];this.holes.push(new aJ().fromJSON(i))}return this}}function aq(t,e,i,r,s){let n;
40if(s===function(t,e,i,r){let s=0;for(let n=e,a=i-r;n<i;n+=r)s+=(t[a]-t[n])*(t[n+1]+t[a+1]),a=n;return s}(t,e,i,r)>0)for(let s=e;s<i;s+=r)n=a4(s/r|0,t[s],t[s+1],n);else for(let s=i-r;s>=e;s-=r)n=a4(s/r|0,t[s],t[s+1],n);return n&&aK(n,n.next)&&(a6(n),n=n.next),n}function aG(t,e){if(!t)return t;e||(e=t);let i=t,r;do if(r=!1,!i.steiner&&(aK(i,i.next)||0===aQ(i.prev,i,i.next))){if(a6(i),(i=e=i.prev)===i.next)break;r=!0}else i=i.next;while(r||i!==e);return e}function aX(t,e){let i=t.x-e.x;return 0===i&&0==(i=t.y-e.y)&&(i=(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)),i}function aZ(t,e,i,r,s){return(t=((t=((t=((t=((t=(t-i)*s|0)|t<<8)&16711935)|t<<4)&252645135)|t<<2)&858993459)|t<<1)&1431655765)|(e=((e=((e=((e=((e=(e-r)*s|0)|e<<8)&16711935)|e<<4)&252645135)|e<<2)&858993459)|e<<1)&1431655765)<<1}function aY(t,e,i,r,s,n,a,o){return(s-a)*(e-o)>=(t-a)*(n-o)&&(t-a)*(r-o)>=(i-a)*(e-o)&&(i-a)*(n-o)>=(s-a)*(r-o)}function a$(t,e,i,r,s,n,a,o){return!(t===a&&e===o)&&aY(t,e,i,r,s,n,a,o)}function aQ(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function aK(t,e){return t.x===e.x&&t.y===e.y}function a0(t,e,i,r){let s=a2(aQ(t,e,i)),n=a2(aQ(t,e,r)),a=a2(aQ(i,r,t)),o=a2(aQ(i,r,e));return!!(s!==n&&a!==o||0===s&&a1(t,i,e)||0===n&&a1(t,r,e)||0===a&&a1(i,t,r)||0===o&&a1(i,e,r))}function a1(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function a2(t){return t>0?1:t<0?-1:0}function a3(t,e){return 0>aQ(t.prev,t,t.next)?aQ(t,e,t.next)>=0&&aQ(t,t.prev,e)>=0:0>aQ(t,e,t.prev)||0>aQ(t,t.next,e)}function a5(t,e){let i=a7(t.i,t.x,t.y),r=a7(e.i,e.x,e.y),s=t.next,n=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,r.next=i,i.prev=r,n.next=r,r.prev=n,r}function a4(t,e,i,r){let s=a7(t,e,i);return r?(s.next=r.next,s.prev=r,r.next.prev=s,r.next=s):(s.prev=s,s.next=s),s}function a6(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function a7(t,e,i){return{i:t,x:e,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class a8{static triangulate(t,e,i=2){return function(t,e,i=2){let r,s,n;let a=e&&e.length,o=a?e[0]*i:t.length,h=aq(t,0,o,i,!0),l=[];if(!h||h.next===h.prev)return l;if(a&&(h=function(t,e,i,r){let s=[];for(let i=0,n=e.length;i<n;i++){let a=e[i]*r,o=i<n-1?e[i+1]*r:t.length,h=aq(t,a,o,r,!1);h===h.next&&(h.steiner=!0),s.push(function(t){let e=t,i=t;do(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next;while(e!==t);return i}(h))}s.sort(aX);for(let t=0;t<s.length;t++)i=function(t,e){let i=function(t,e){let i,r=e,s=t.x,n=t.y,a=-1/0;if(aK(t,r))return r;do{if(aK(t,r.next))return r.next;if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){let t=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y
40);if(t<=s&&t>a&&(a=t,i=r.x<r.next.x?r:r.next,t===s))return i}r=r.next}while(r!==e);if(!i)return null;let o=i,h=i.x,l=i.y,u=1/0;r=i;do{if(s>=r.x&&r.x>=h&&s!==r.x&&aY(n<l?s:a,n,h,l,n<l?a:s,n,r.x,r.y)){var c,p;let e=Math.abs(n-r.y)/(s-r.x);a3(r,t)&&(e<u||e===u&&(r.x>i.x||r.x===i.x&&(c=i,p=r,0>aQ(c.prev,c,p.prev)&&0>aQ(p.next,c,c.next))))&&(i=r,u=e)}r=r.next}while(r!==o);return i}(t,e);if(!i)return e;let r=a5(i,t);return aG(r,r.next),aG(i,i.next)}(s[t],i);return i}(t,e,h,i)),t.length>80*i){r=1/0,s=1/0;let e=-1/0,a=-1/0;for(let n=i;n<o;n+=i){let i=t[n],o=t[n+1];i<r&&(r=i),o<s&&(s=o),i>e&&(e=i),o>a&&(a=o)}n=0!==(n=Math.max(e-r,a-s))?32767/n:0}return function t(e,i,r,s,n,a,o){if(!e)return;!o&&a&&function(t,e,i,r){let s=t;do 0===s.z&&(s.z=aZ(s.x,s.y,e,i,r)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){let e;let i=1;do{let r,s=t;t=null;let n=null;for(e=0;s;){e++;let a=s,o=0;for(let t=0;t<i&&(o++,a=a.nextZ);t++);let h=i;for(;o>0||h>0&&a;)0!==o&&(0===h||!a||s.z<=a.z)?(r=s,s=s.nextZ,o--):(r=a,a=a.nextZ,h--),n?n.nextZ=r:t=r,r.prevZ=n,n=r;s=a}n.nextZ=null,i*=2}while(e>1)}(s)}(e,s,n,a);let h=e;for(;e.prev!==e.next;){let l=e.prev,u=e.next;if(a?function(t,e,i,r){let s=t.prev,n=t.next;if(aQ(s,t,n)>=0)return!1;let a=s.x,o=t.x,h=n.x,l=s.y,u=t.y,c=n.y,p=Math.min(a,o,h),d=Math.min(l,u,c),m=Math.max(a,o,h),y=Math.max(l,u,c),f=aZ(p,d,e,i,r),g=aZ(m,y,e,i,r),x=t.prevZ,v=t.nextZ;for(;x&&x.z>=f&&v&&v.z<=g;){if(x.x>=p&&x.x<=m&&x.y>=d&&x.y<=y&&x!==s&&x!==n&&a$(a,l,o,u,h,c,x.x,x.y)&&aQ(x.prev,x,x.next)>=0||(x=x.prevZ,v.x>=p&&v.x<=m&&v.y>=d&&v.y<=y&&v!==s&&v!==n&&a$(a,l,o,u,h,c,v.x,v.y)&&aQ(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;x&&x.z>=f;){if(x.x>=p&&x.x<=m&&x.y>=d&&x.y<=y&&x!==s&&x!==n&&a$(a,l,o,u,h,c,x.x,x.y)&&aQ(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;v&&v.z<=g;){if(v.x>=p&&v.x<=m&&v.y>=d&&v.y<=y&&v!==s&&v!==n&&a$(a,l,o,u,h,c,v.x,v.y)&&aQ(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}(e,s,n,a):function(t){let e=t.prev,i=t.next;if(aQ(e,t,i)>=0)return!1;let r=e.x,s=t.x,n=i.x,a=e.y,o=t.y,h=i.y,l=Math.min(r,s,n),u=Math.min(a,o,h),c=Math.max(r,s,n),p=Math.max(a,o,h),d=i.next;for(;d!==e;){if(d.x>=l&&d.x<=c&&d.y>=u&&d.y<=p&&a$(r,a,s,o,n,h,d.x,d.y)&&aQ(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}(e)){i.push(l.i,e.i,u.i),a6(e),e=u.next,h=u.next;continue}if((e=u)===h){o?1===o?t(e=function(t,e){let i=t;do{let r=i.prev,s=i.next.next;!aK(r,s)&&a0(r,i,i.next,s)&&a3(r,s)&&a3(s,r)&&(e.push(r.i,i.i,s.i),a6(i),a6(i.next),i=t=s),i=i.next}while(i!==t);return aG(i)}(aG(e),i),i,r,s,n,a,2):2===o&&function(e,i,r,s,n,a){let o=e;do{let e=o.next.next;for(;e!==o.prev;){var h,l;if(o.i!==e.i&&(h=o,l=e,h.next.i!==l.i&&h.prev.i!==l.i&&!function(t,e){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&a0(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(h,l)&&(a3(h,l)&&a3(l,h)&&function(t,e){let i=t,r=!1,s=(t.x+e.x)/2,n=(t.y+e.y)/2;do i.y>n!=i.next.y>n&&i.next.y!==i.y&&s<(i.next.x-i.x)*(n-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next;while(i!==t);return r}(h,l)&&(aQ(h.prev,h,l.prev)||aQ(h,l.prev,l))||aK(h,l)&&aQ(h.prev,h,h.next)>0&&aQ(l.prev,l,l.next)>0))){let h=a5(o,e);o=aG(o,o.next),h=aG(h,h.next),t(o,i,r,s,n,a,0),t(h,i,r,s,n,a,0);return}e=e.next}o=o.next}while(o!==e)}(e,i,r,s,n,a):t(aG(e),i,r,s,n,a,1);break}}}(h,l,i,r,s,n,0),l}(t,e,i)}}class a9{static area(t){let e=t.length,i=0;for(let r=e-1,s=0;s<e;r=s++)i+=t[r].x*t[s].y-t[s].x*t[r].y;return .5*i}static isClockWise(t){return 0>a9.area(t)}static triangulateShape(t,e){let i=[],r=[],s=[];ot(t),oe(i,t);let n=t.length;e.forEach(ot);for(let t=0;t<e.length;t++)r.push(n),n+=e[t].length,oe(i,e[t]);let a=a8.triangulate(i,r);for(let t=0;t<a.length;t+=3)s.push(a.slice(t,t+3));return s}}function ot(t){let e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function oe(t,e){for(let i=0;i<e.length;i++)t.push(e[i].x),t.push(e[i].y)}class oi extends sl{constructor(t=new aH([new ia(.5,.5),new ia(-.5,.5),new ia(-.5,-.5),new ia(.5,-.5)]),e={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];let i=this,r=[],s=[];for(let n=0,a=t.length;n<a;n++)!function(t){let n,a,o,h,l;let u=[],c=void 0!==e.curveSegments?e.curveSegments:12,p=void 0!==e.steps?e.steps:1,d=void 0!==e.depth?e.depth:1,m=void 0===e.bevelEnabled||e.bevelEnabled,y=void 0!==e.bevelThickness?e.bevelThickness:.2,f=void 0!==e.bevelSize?e.bevelSize:y-.1,g=void 0!==e.bevelOffset?e.bevelOffset:0,x=void 0!==e.bevelSegments?e.bevelSegments:3,v=e.extrudePath,b=void 0!==e.UVGenerator?e.UVGenerator:or,M,w=!1;v&&(M=v.getSpacedPoints(p),w=!0,m=!1,n=v.computeFrenetFrames(p,!1),a=new ih,o=new ih,h=new ih),m||(x=0,y=0,f=0,g=0);let S=t.extractPoints(c),_=S.shape,A=S.holes;if(!a9.isClockWise(_)){_=_.reverse();for(let t=0,e=A.length;t<e;t++){let e=A[t];a9.isClockWise(e)&&(A[t]=e.reverse())}}function T(t){let e=1e-10*1e-10,i=t[0];for(let r=1;r<=t.length;r++){let s=r%t.length,n=t[s],a=n.x-i.x,o=n.y-i.y,h=a*a+o*o,l=Math.max(Math.abs(n.x),Math.abs(n.y),Math.abs(i.x),Math.abs(i.y));if(h<=e*l*l){t.splice(s,1),r--;continue}i=n}}T(_),A.forEach(T);let z=A.length,I=_;for(let t=0;t<z;t++){let e=A[t];_=_.concat(e)}function C(t,e,i){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().addScaledVector(e,i)}let k=_.length;function B(t,e,i){let r,s,n;let a=t.x-e.x,o=t.y-e.y,h=i.x-t.x,l=i.y-t.y,u=a*a+o*o;if(Math.abs(a*l-o*h)>Number.EPSILON){let c=Math.sqrt(u),p=Math.sqrt(h*h+l*l),d=e.x-o/c,m=e.y+a/c,y=((i.x-l/p-d)*l-(i.y+h
40/p-m)*h)/(a*l-o*h),f=(r=d+a*y-t.x)*r+(s=m+o*y-t.y)*s;if(f<=2)return new ia(r,s);n=Math.sqrt(f/2)}else{let t=!1;a>Number.EPSILON?h>Number.EPSILON&&(t=!0):a<-Number.EPSILON?h<-Number.EPSILON&&(t=!0):Math.sign(o)===Math.sign(l)&&(t=!0),t?(r=-o,s=a,n=Math.sqrt(u)):(r=a,s=o,n=Math.sqrt(u/2))}return new ia(r/n,s/n)}let O=[];for(let t=0,e=I.length,i=e-1,r=t+1;t<e;t++,i++,r++)i===e&&(i=0),r===e&&(r=0),O[t]=B(I[t],I[i],I[r]);let E=[],R,P=O.concat();for(let t=0;t<z;t++){let e=A[t];R=[];for(let t=0,i=e.length,r=i-1,s=t+1;t<i;t++,r++,s++)r===i&&(r=0),s===i&&(s=0),R[t]=B(e[t],e[r],e[s]);E.push(R),P=P.concat(R)}if(0===x)l=a9.triangulateShape(I,A);else{let t=[],e=[];for(let i=0;i<x;i++){let r=i/x,s=y*Math.cos(r*Math.PI/2),n=f*Math.sin(r*Math.PI/2)+g;for(let e=0,i=I.length;e<i;e++){let i=C(I[e],O[e],n);F(i.x,i.y,-s),0===r&&t.push(i)}for(let t=0;t<z;t++){let i=A[t];R=E[t];let a=[];for(let t=0,e=i.length;t<e;t++){let e=C(i[t],R[t],n);F(e.x,e.y,-s),0===r&&a.push(e)}0===r&&e.push(a)}}l=a9.triangulateShape(t,e)}let N=l.length,V=f+g;for(let t=0;t<k;t++){let e=m?C(_[t],P[t],V):_[t];w?(o.copy(n.normals[0]).multiplyScalar(e.x),a.copy(n.binormals[0]).multiplyScalar(e.y),h.copy(M[0]).add(o).add(a),F(h.x,h.y,h.z)):F(e.x,e.y,0)}for(let t=1;t<=p;t++)for(let e=0;e<k;e++){let i=m?C(_[e],P[e],V):_[e];w?(o.copy(n.normals[t]).multiplyScalar(i.x),a.copy(n.binormals[t]).multiplyScalar(i.y),h.copy(M[t]).add(o).add(a),F(h.x,h.y,h.z)):F(i.x,i.y,d/p*t)}for(let t=x-1;t>=0;t--){let e=t/x,i=y*Math.cos(e*Math.PI/2),r=f*Math.sin(e*Math.PI/2)+g;for(let t=0,e=I.length;t<e;t++){let e=C(I[t],O[t],r);F(e.x,e.y,d+i)}for(let t=0,e=A.length;t<e;t++){let e=A[t];R=E[t];for(let t=0,s=e.length;t<s;t++){let s=C(e[t],R[t],r);w?F(s.x,s.y+M[p-1].y,M[p-1].x+i):F(s.x,s.y,d+i)}}}function L(t,e){let s=t.length;for(;--s>=0;){let n=s,a=s-1;a<0&&(a=t.length-1);for(let t=0,s=p+2*x;t<s;t++){let s=k*t,o=k*(t+1);!function(t,e,s,n){D(t),D(e),D(n),D(e),D(s),D(n);let a=r.length/3,o=b.generateSideWallUV(i,r,a-6,a-3,a-2,a-1);U(o[0]),U(o[1]),U(o[3]),U(o[1]),U(o[2]),U(o[3])}(e+n+s,e+a+s,e+a+o,e+n+o)}}}function F(t,e,i){u.push(t),u.push(e),u.push(i)}function j(t,e,s){D(t),D(e),D(s);let n=r.length/3,a=b.generateTopUV(i,r,n-3,n-2,n-1);U(a[0]),U(a[1]),U(a[2])}function D(t){r.push(u[3*t+0]),r.push(u[3*t+1]),r.push(u[3*t+2])}function U(t){s.push(t.x),s.push(t.y)}(function(){let t=r.length/3;if(m){let t=0*k;for(let e=0;e<N;e++){let i=l[e];j(i[2]+t,i[1]+t,i[0]+t)}t=k*(p+2*x);for(let e=0;e<N;e++){let i=l[e];j(i[0]+t,i[1]+t,i[2]+t)}}else{for(let t=0;t<N;t++){let e=l[t];j(e[2],e[1],e[0])}for(let t=0;t<N;t++){let e=l[t];j(e[0]+k*p,e[1]+k*p,e[2]+k*p)}}i.addGroup(t,r.length/3-t,0)})(),function(){let t=r.length/3,e=0;L(I,0),e+=I.length;for(let t=0,i=A.length;t<i;t++){let i=A[t];L(i,e),e+=i.length}i.addGroup(t,r.length/3-t,1)}()}(t[n]);this.setAttribute("position",new se(r,3)),this.setAttribute("uv",new se(s,2)),this.computeVertexNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){let t=super.toJSON();return function(t,e,i){if(i.shapes=[],Array.isArray(t))for(let e=0,r=t.length;e<r;e++){let r=t[e];i.shapes.push(r.uuid)}else i.shapes.push(t.uuid);return i.options=Object.assign({},e),void 0!==e.extrudePath&&(i.options.extrudePath=e.extrudePath.toJSON()),i}(this.parameters.shapes,this.parameters.options,t)}static fromJSON(t,e){let i=[];for(let r=0,s=t.shapes.length;r<s;r++){let s=e[t.shapes[r]];i.push(s)}let r=t.options.extrudePath;return void 0!==r&&(t.options.extrudePath=new aU[r.type]().fromJSON(r)),new oi(i,t.options)}}let or={generateTopUV:function(t,e,i,r,s){let n=e[3*i],a=e[3*i+1],o=e[3*r],h=e[3*r+1],l=e[3*s],u=e[3*s+1];return[new ia(n,a),new ia(o,h),new ia(l,u)]},generateSideWallUV:function(t,e,i,r,s,n){let a=e[3*i],o=e[3*i+1],h=e[3*i+2],l=e[3*r],u=e[3*r+1],c=e[3*r+2],p=e[3*s],d=e[3*s+1],m=e[3*s+2],y=e[3*n],f=e[3*n+1],g=e[3*n+2];return Math.abs(o-u)<Math.abs(a-l)?[new ia(a,1-h),new ia(l,1-c),new ia(p,1-m),new ia(y,1-g)]:[new ia(o,1-h),new ia(u,1-c),new ia(d,1-m),new ia(f,1-g)]}};class os extends af{constructor(t=1,e=0){let i=(1+Math.sqrt(5))/2;super([-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronGeometry",this.parameters={radiu
40s:t,detail:e}}static fromJSON(t){return new os(t.radius,t.detail)}}class on extends sl{constructor(t=[new ia(0,-.5),new ia(.5,0),new ia(0,.5)],e=12,i=0,r=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:i,phiLength:r},e=Math.floor(e),r=e9(r,0,2*Math.PI);let s=[],n=[],a=[],o=[],h=[],l=1/e,u=new ih,c=new ia,p=new ih,d=new ih,m=new ih,y=0,f=0;for(let e=0;e<=t.length-1;e++)switch(e){case 0:y=t[e+1].x-t[e].x,f=t[e+1].y-t[e].y,p.x=1*f,p.y=-y,p.z=0*f,m.copy(p),p.normalize(),o.push(p.x,p.y,p.z);break;case t.length-1:o.push(m.x,m.y,m.z);break;default:y=t[e+1].x-t[e].x,f=t[e+1].y-t[e].y,p.x=1*f,p.y=-y,p.z=0*f,d.copy(p),p.x+=m.x,p.y+=m.y,p.z+=m.z,p.normalize(),o.push(p.x,p.y,p.z),m.copy(d)}for(let s=0;s<=e;s++){let p=i+s*l*r,d=Math.sin(p),m=Math.cos(p);for(let i=0;i<=t.length-1;i++){u.x=t[i].x*d,u.y=t[i].y,u.z=t[i].x*m,n.push(u.x,u.y,u.z),c.x=s/e,c.y=i/(t.length-1),a.push(c.x,c.y);let r=o[3*i+0]*d,l=o[3*i+1],p=o[3*i+0]*m;h.push(r,l,p)}}for(let i=0;i<e;i++)for(let e=0;e<t.length-1;e++){let r=e+i*t.length,n=r+t.length,a=r+t.length+1,o=r+1;s.push(r,n,o),s.push(a,o,n)}this.setIndex(s),this.setAttribute("position",new se(n,3)),this.setAttribute("uv",new se(a,2)),this.setAttribute("normal",new se(h,3))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new on(t.points,t.segments,t.phiStart,t.phiLength)}}class oa extends af{constructor(t=1,e=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new oa(t.radius,t.detail)}}class oo extends sl{constructor(t=1,e=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:r};let s=t/2,n=e/2,a=Math.floor(i),o=Math.floor(r),h=a+1,l=o+1,u=t/a,c=e/o,p=[],d=[],m=[],y=[];for(let t=0;t<l;t++){let e=t*c-n;for(let i=0;i<h;i++){let r=i*u-s;d.push(r,-e,0),m.push(0,0,1),y.push(i/a),y.push(1-t/o)}}for(let t=0;t<o;t++)for(let e=0;e<a;e++){let i=e+h*t,r=e+h*(t+1),s=e+1+h*(t+1),n=e+1+h*t;p.push(i,r,n),p.push(r,s,n)}this.setIndex(p),this.setAttribute("position",new se(d,3)),this.setAttribute("normal",new se(m,3)),this.setAttribute("uv",new se(y,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new oo(t.width,t.height,t.widthSegments,t.heightSegments)}}class oh extends sl{constructor(t=.5,e=1,i=32,r=1,s=0,n=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:i,phiSegments:r,thetaStart:s,thetaLength:n},i=Math.max(3,i);let a=[],o=[],h=[],l=[],u=t,c=(e-t)/(r=Math.max(1,r)),p=new ih,d=new ia;for(let t=0;t<=r;t++){for(let t=0;t<=i;t++){let r=s+t/i*n;p.x=u*Math.cos(r),p.y=u*Math.sin(r),o.push(p.x,p.y,p.z),h.push(0,0,1),d.x=(p.x/e+1)/2,d.y=(p.y/e+1)/2,l.push(d.x,d.y)}u+=c}for(let t=0;t<r;t++){let e=t*(i+1);for(let t=0;t<i;t++){let r=t+e,s=r+i+1,n=r+i+2,o=r+1;a.push(r,s,o),a.push(s,n,o)}}this.setIndex(a),this.setAttribute("position",new se(o,3)),this.setAttribute("normal",new se(h,3)),this.setAttribute("uv",new se(l,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new oh(t.innerRadius,t.outerRadius,t.thetaSegments,t.phiSegments,t.thetaStart,t.thetaLength)}}class ol extends sl{constructor(t=new aH([new ia(0,.5),new ia(-.5,-.5),new ia(.5,-.5)]),e=12){super(),this.type="ShapeGeometry",this.parameters={shapes:t,curveSegments:e};let i=[],r=[],s=[],n=[],a=0,o=0;if(!1===Array.isArray(t))h(t);else for(let e=0;e<t.length;e++)h(t[e]),this.addGroup(a,o,e),a+=o,o=0;function h(t){let a=r.length/3,h=t.extractPoints(e),l=h.shape,u=h.holes;!1===a9.isClockWise(l)&&(l=l.reverse());for(let t=0,e=u.length;t<e;t++){let e=u[t];!0===a9.isClockWise(e)&&(u[t]=e.reverse())}let c=a9.triangulateShape(l,u);for(let t=0,e=u.length;t<e;t++){let e=u[t];l=l.concat(e)}for(let t=0,e=l.length;t<e;t++){let e=l[t];r.push(e.x,e.y,0),s.push(0,0,1),n.push(e.x,e.y)}for(let t=0,e=c.length;t<e;t++){let e=c[t],r=e[0]+a,s=e[1]+a,n=e[2]+a;i.push(r,s,n),o+=3}}this.setIndex(i),this.setAttribute("position",new se(r,3)),this.setAttribute("normal",new se(s,3)),this.setAttribute("uv",new se(n,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){let t=super.toJSON();return function(t,e){if(e.shapes=[],Array.isArray(t))for(let i=0,r=t.length;i<r;i++){let r=t[i];e.shapes.push(r.uuid)}else e.shapes.push(t.uuid);return e}(this.parameters.shapes,t)}static fromJSON(t,e){let i=[];for(let r=0,s=t.shapes.length;r<s;r++){let s=e[t.shapes[r]];i.push(s)}return new ol(i,t.curveSegments)}}class ou extends sl{constructor(t=1,e=32,i=16,r=0,s=2*Math.PI,n=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radiu
40s:t,widthSegments:e,heightSegments:i,phiStart:r,phiLength:s,thetaStart:n,thetaLength:a},e=Math.max(3,Math.floor(e)),i=Math.max(2,Math.floor(i));let o=Math.min(n+a,Math.PI),h=0,l=[],u=new ih,c=new ih,p=[],d=[],m=[],y=[];for(let p=0;p<=i;p++){let f=[],g=p/i,x=0;0===p&&0===n?x=.5/e:p===i&&o===Math.PI&&(x=-.5/e);for(let i=0;i<=e;i++){let o=i/e;u.x=-t*Math.cos(r+o*s)*Math.sin(n+g*a),u.y=t*Math.cos(n+g*a),u.z=t*Math.sin(r+o*s)*Math.sin(n+g*a),d.push(u.x,u.y,u.z),c.copy(u).normalize(),m.push(c.x,c.y,c.z),y.push(o+x,1-g),f.push(h++)}l.push(f)}for(let t=0;t<i;t++)for(let r=0;r<e;r++){let e=l[t][r+1],s=l[t][r],a=l[t+1][r],h=l[t+1][r+1];(0!==t||n>0)&&p.push(e,s,h),(t!==i-1||o<Math.PI)&&p.push(s,a,h)}this.setIndex(p),this.setAttribute("position",new se(d,3)),this.setAttribute("normal",new se(m,3)),this.setAttribute("uv",new se(y,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new ou(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class oc extends af{constructor(t=1,e=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new oc(t.radius,t.detail)}}class op extends sl{constructor(t=1,e=.4,i=12,r=48,s=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:i,tubularSegments:r,arc:s},i=Math.floor(i),r=Math.floor(r);let n=[],a=[],o=[],h=[],l=new ih,u=new ih,c=new ih;for(let n=0;n<=i;n++)for(let p=0;p<=r;p++){let d=p/r*s,m=n/i*Math.PI*2;u.x=(t+e*Math.cos(m))*Math.cos(d),u.y=(t+e*Math.cos(m))*Math.sin(d),u.z=e*Math.sin(m),a.push(u.x,u.y,u.z),l.x=t*Math.cos(d),l.y=t*Math.sin(d),c.subVectors(u,l).normalize(),o.push(c.x,c.y,c.z),h.push(p/r),h.push(n/i)}for(let t=1;t<=i;t++)for(let e=1;e<=r;e++){let i=(r+1)*t+e-1,s=(r+1)*(t-1)+e-1,a=(r+1)*(t-1)+e,o=(r+1)*t+e;n.push(i,s,o),n.push(s,a,o)}this.setIndex(n),this.setAttribute("position",new se(a,3)),this.setAttribute("normal",new se(o,3)),this.setAttribute("uv",new se(h,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new op(t.radius,t.tube,t.radialSegments,t.tubularSegments,t.arc)}}class od extends sl{constructor(t=1,e=.4,i=64,r=8,s=2,n=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:i,radialSegments:r,p:s,q:n},i=Math.floor(i),r=Math.floor(r);let a=[],o=[],h=[],l=[],u=new ih,c=new ih,p=new ih,d=new ih,m=new ih,y=new ih,f=new ih;for(let a=0;a<=i;++a){let x=a/i*s*Math.PI*2;g(x,s,n,t,p),g(x+.01,s,n,t,d),y.subVectors(d,p),f.addVectors(d,p),m.crossVectors(y,f),f.crossVectors(m,y),m.normalize(),f.normalize();for(let t=0;t<=r;++t){let s=t/r*Math.PI*2,n=-e*Math.cos(s),d=e*Math.sin(s);u.x=p.x+(n*f.x+d*m.x),u.y=p.y+(n*f.y+d*m.y),u.z=p.z+(n*f.z+d*m.z),o.push(u.x,u.y,u.z),c.subVectors(u,p).normalize(),h.push(c.x,c.y,c.z),l.push(a/i),l.push(t/r)}}for(let t=1;t<=i;t++)for(let e=1;e<=r;e++){let i=(r+1)*(t-1)+(e-1),s=(r+1)*t+(e-1),n=(r+1)*t+e,o=(r+1)*(t-1)+e;a.push(i,s,o),a.push(s,n,o)}function g(t,e,i,r,s){let n=i/e*t,a=Math.cos(n);s.x=r*(2+a)*.5*Math.cos(t),s.y=r*(2+a)*Math.sin(t)*.5,s.z=r*Math.sin(n)*.5}this.setIndex(a),this.setAttribute("position",new se(o,3)),this.setAttribute("normal",new se(h,3)),this.setAttribute("uv",new se(l,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new od(t.radius,t.tube,t.tubularSegments,t.radialSegments,t.p,t.q)}}class om extends sl{constructor(t=new aj(new ih(-1,-1,0),new ih(-1,1,0),new ih(1,1,0)),e=64,i=1,r=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:i,radialSegments:r,closed:s};let n=t.computeFrenetFrames(e,s);this.tangents=n.tangents,this.normals=n.normals,this.binormals=n.binormals;let a=new ih,o=new ih,h=new ia,l=new ih,u=[],c=[],p=[],d=[];function m(s){l=t.getPointAt(s/e,l);let h=n.normals[s],p=n.binormals[s];for(let t=0;t<=r;t++){let e=t/r*Math.PI*2,s=Math.sin(e),n=-Math.cos(e);o.x=n*h.x+s*p.x,o.y=n*h.y+s*p.y,o.z=n*h.z+s*p.z,o.normalize(),c.push(o.x,o.y,o.z),a.x=l.x+i*o.x,a.y=l.y+i*o.y,a.z=l.z+i*o.z,u.push(a.x,a.y,a.z)}}(function(){for(let t=0;t<e;t++)m(t);m(!1===s?e:0),function(){for(let t=0;t<=e;t++)for(let i=0;i<=r;i++)h.x=t/e,h.y=i/r,p.push(h.x,h.y)}(),function(){for(let t=1;t<=e;t++)for(let e=1;e<=r;e++){let i=(r+1)*(t-1)+(e-1),s=(r+1)*t+(e-1),n=(r+1)*t+e,a=(r+1)*(t-1)+e;d.push(i,s,a),d.push(s,n,a)}}()})(),this.setIndex(d),this.setAttribute("position",new se(u,3)),this.setAttribute("normal",new se(c,3)),this.setAttribute("uv",new se(p,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){let t=super.toJSON();return t.path=this.parameters.path.toJSON(),t}static fromJSON(t){return new om(new aU[t.path.type]().fromJSON(t.path),t.tubularSegments,t.radiu
vendor: 13,774 bytes, line 40
40s,t.radialSegments,t.closed)}}class oy extends sl{constructor(t=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:t},null!==t){let e=[],i=new Set,r=new ih,s=new ih;if(null!==t.index){let n=t.attributes.position,a=t.index,o=t.groups;0===o.length&&(o=[{start:0,count:a.count,materialIndex:0}]);for(let t=0,h=o.length;t<h;++t){let h=o[t],l=h.start,u=h.count;for(let t=l,o=l+u;t<o;t+=3)for(let o=0;o<3;o++){let h=a.getX(t+o),l=a.getX(t+(o+1)%3);r.fromBufferAttribute(n,h),s.fromBufferAttribute(n,l),!0===of(r,s,i)&&(e.push(r.x,r.y,r.z),e.push(s.x,s.y,s.z))}}}else{let n=t.attributes.position;for(let t=0,a=n.count/3;t<a;t++)for(let a=0;a<3;a++){let o=3*t+a,h=3*t+(a+1)%3;r.fromBufferAttribute(n,o),s.fromBufferAttribute(n,h),!0===of(r,s,i)&&(e.push(r.x,r.y,r.z),e.push(s.x,s.y,s.z))}}this.setAttribute("position",new se(e,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}function of(t,e,i){let r=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`,s=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`;return!0!==i.has(r)&&!0!==i.has(s)&&(i.add(r),i.add(s),!0)}var og=Object.freeze({__proto__:null,BoxGeometry:sS,CapsuleGeometry:ap,CircleGeometry:ad,ConeGeometry:ay,CylinderGeometry:am,DodecahedronGeometry:ag,EdgesGeometry:aw,ExtrudeGeometry:oi,IcosahedronGeometry:os,LatheGeometry:on,OctahedronGeometry:oa,PlaneGeometry:oo,PolyhedronGeometry:af,RingGeometry:oh,ShapeGeometry:ol,SphereGeometry:ou,TetrahedronGeometry:oc,TorusGeometry:op,TorusKnotGeometry:od,TubeGeometry:om,WireframeGeometry:oy});class ox extends rK{constructor(t){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new rY(0),this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.fog=t.fog,this}}class ov extends sI{constructor(t){super(t),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class ob extends rK{constructor(t){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new rY(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new rY(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=eM,this.normalScale=new ia(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new rm,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.envMapIntensity=t.envMapIntensity,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class oM extends ob{constructor(t){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new ia(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return e9(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new rY(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new rY(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new rY(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(t)}get anisotropy(){return this._anisotropy}set anisotropy(t){this._anisotropy>0!=t>0&&this.version++,this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get dispersion(){return this._dispersion}set dispersion(t){this._dispersion>0!=t>0&&this.version++,this._dispersion=t}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.dispersion=t.dispersion,this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class ow extends rK{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new rY(16777215),this.specular=new rY(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new rY(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=eM,this.normalScale=new ia(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new rm,this.combine=Q,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class oS extends rK{constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new rY(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new rY(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=eM,this.normalScale=new ia(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,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.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}class o_ extends rK{constructor(t){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=eM,this.normalScale=new ia(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}class oA extends rK{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new rY(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new rY(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=eM,this.normalScale=new ia(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new rm,this.combine=Q,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class oT extends rK{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class oz extends rK{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}
40class oI extends rK{constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new rY(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=eM,this.normalScale=new ia(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.flatShading=t.flatShading,this.fog=t.fog,this}}class oC extends nK{constructor(t){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}function ok(t,e){return t&&t.constructor!==e?"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t):t}function oB(t,e,i){let r=t.length,s=new t.constructor(r);for(let n=0,a=0;a!==r;++n){let r=i[n]*e;for(let i=0;i!==e;++i)s[a++]=t[r+i]}return s}function oO(t,e,i,r){let s=1,n=t[0];for(;void 0!==n&&void 0===n[r];)n=t[s++];if(void 0===n)return;let a=n[r];if(void 0!==a){if(Array.isArray(a))do void 0!==(a=n[r])&&(e.push(n.time),i.push(...a)),n=t[s++];while(void 0!==n);else if(void 0!==a.toArray)do void 0!==(a=n[r])&&(e.push(n.time),a.toArray(i,i.length)),n=t[s++];while(void 0!==n);else do void 0!==(a=n[r])&&(e.push(n.time),i.push(a)),n=t[s++];while(void 0!==n)}}class oE{constructor(t,e,i,r){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new e.constructor(i),this.sampleValues=e,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,i=this._cachedIndex,r=e[i],s=e[i-1];t:{e:{let n;i:{r:if(!(t<r)){for(let n=i+2;;){if(void 0===r){if(t<s)break r;return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===n)break;if(s=r,t<(r=e[++i]))break e}n=e.length;break i}if(!(t>=s)){let a=e[1];t<a&&(i=2,s=a);for(let n=i-2;;){if(void 0===s)return this._cachedIndex=0,this.copySampleValue_(0);if(i===n)break;if(r=s,t>=(s=e[--i-1]))break e}n=i,i=0;break i}break t}for(;i<n;){let r=i+n>>>1;t<e[r]?n=r:i=r+1}if(r=e[i],void 0===(s=e[i-1]))return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===r)return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,s,r)}return this.interpolate_(i,s,t,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,i=this.sampleValues,r=this.valueSize,s=t*r;for(let t=0;t!==r;++t)e[t]=i[s+t];return e}interpolate_(){throw Error("call to abstract method")}intervalChanged_(){}}class oR extends oE{constructor(t,e,i,r){super(t,e,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:2400,endingEnd:2400}}intervalChanged_(t,e,i){let r=this.parameterPositions,s=t-2,n=t+1,a=r[s],o=r[n];if(void 0===a)switch(this.getSettings_().endingStart){case 2401:s=t,a=2*e-i;break;case 2402:s=r.length-2,a=e+r[s]-r[s+1];break;default:s=t,a=i}if(void 0===o)switch(this.getSettings_().endingEnd){case 2401:n=t,o=2*i-e;break;case 2402:n=1,o=i+r[1]-r[0];break;default:n=t-1,o=e}let h=(i-e)*.5,l=this.valueSize;this._weightPrev=h/(e-a),this._weightNext=h/(o-i),this._offsetPrev=s*l,this._offsetNext=n*l}interpolate_(t,e,i,r){let s=this.resultBuffer,n=this.sampleValues,a=this.valueSize,o=t*a,h=o-a,l=this._offsetPrev,u=this._offsetNext,c=this._weightPrev,p=this._weightNext,d=(i-e)/(r-e),m=d*d,y=m*d,f=-c*y+2*c*m-c*d,g=(1+c)*y+(-1.5-2*c)*m+(-.5+c)*d+1,x=(-1-p)*y+(1.5+p)*m+.5*d,v=p*y-p*m;for(let t=0;t!==a;++t)s[t]=f*n[l+t]+g*n[h+t]+x*n[o+t]+v*n[u+t];return s}}class oP extends oE{constructor(t,e,i,r){super(t,e,i,r)}interpolate_(t,e,i,r){let s=this.resultBuffer,n=this.sampleValues,a=this.valueSize,o=t*a,h=o-a,l=(i-e)/(r-e),u=1-l;for(let t=0;t!==a;++t)s[t]=n[h+t]*u+n[o+t]*l;return s}}class oN extends oE{constructor(t,e,i,r){super(t,e,i,r)}interpolate_(t){return this.copySampleValue_(t-1)}}class oV{constructor(t,e,i,r){if(void 0===t)throw Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=ok(e,this.TimeBufferType),this.values=ok(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(t){let e;let i=t.constructor;if(i.toJSON!==this.toJSON)e=i.toJSON(t);else{e={name:t.name,times:ok(t.times,Array),values:ok(t.values,Array)};let i=t.getInterpolation();i!==t.DefaultInterpolation&&(e.interpolation=i)}return e.type=t.ValueTypeName,e}InterpolantFactoryMethodDiscrete(t){return new oN(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new oP(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new oR(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case 2300:e=this.InterpolantFactoryMethodDiscrete;break;case 2301:e=this.InterpolantFactoryMethodLinear;break;case 2302:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){let e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw Error(e)}return console.warn("THREE.KeyframeTrack:",e),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}}getValueSize(){return this.values.length/this.times.length}shift(t){if(0!==t){let e=this.times;for(let i=0,r=e.length;i!==r;++i)e[i]+=t}return this}scale(t){if(1!==t){let e=this.times;for(let i=0,r=e.length;i!==r;++i)e[i]*=t}return this}trim(t,e){let i=this.times,r=i.length,s=0,n=r-1;for(;s!==r&&i[s]<t;)++s;for(;-1!==n&&i[n]>e;)--n;if(++n,0!==s||n!==r){s>=n&&(s=(n=Math.max(n,1))-1);let t=this.getValueSize();this.times=i.slice(s,n),this.values=this.values.slice(s*t,n*t)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);let i=this.times,r=this.values,s=i.length;0===s&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let n=null;for(let e=0;e!==s;e++){let r=i[e];if("number"==typeof r&&isNaN(r)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,r),t=!1;break}if(null!==n&&n>r){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,r,n),t=!1;break}n=r}if(void 0!==r&&ArrayBuffer.isView(r)&&!(r instanceof DataView))for(let e=0,i=r.length;e!==i;++e){let i=r[e];if(isNaN(i)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,i),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),i=this.getValueSize(),r=2302===this.getInterpolation(),s=t.length-1,n=1;for(let a=1;a<s;++a){let s=!1,o=t[a];if(o!==t[a+1]&&(1!==a||o!==t[0])){if(r)s=!0;else{let t=a*i,r=t-i,n=t+i;for(let a=0;a!==i;++a){let i=e[t+a];if(i!==e[r+a]||i!==e[n+a]){s=!0;break}}}}if(s){if(a!==n){t[n]=t[a];let r=a*i,s=n*i;for(let t=0;t!==i;++t)e[s+t]=e[r+t]}++n}}if(s>0){t[n]=t[s];for(let t=s*i,r=n*i,a=0;a!==i;++a)e[r+a]=e[t+a];++n}return n!==t.length?(this.times=t.slice(0,n),this.values=e.slice(0,n*i)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),i=new this.constructor(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}oV.prototype.ValueTypeName="",oV.prototype.TimeBufferType=Float32Array,oV.prototype.ValueBufferType=Float32Array,oV.prototype.DefaultInterpolation=2301;class oL extends oV{constructor(t,e,i){super(t,e,i)}}oL.prototype.ValueTypeName="bool",oL.prototype.ValueBufferType=Array,oL.prototype.DefaultInterpolation=2300,oL.prototype.InterpolantFactoryMethodLinear=void 0,oL.prototype.InterpolantFactoryMethodSmooth=void 0;class oF extends oV{constructor(t,e,i,r){super(t,e,i,r)}}oF.prototype.ValueTypeName="color";class oj extends oV{constructor(t,e,i,r){super(t,e,i,r)}}oj.prototype.ValueTypeName="number";class oD extends oE{constructor(t,e,i,r){super(t,e,i,r)}interpolate_(t,e,i,r){let s=this.resultBuffer,n=this.sampleValues,a=this.valueSize,o=(i-e)/(r-e),h=t*a;for(let t=h+a;h!==t;h+=4)io.slerpFlat(s,0,n,h-a,n,h,o);return s}}class oU extends oV{constructor(t,e,i,r){super(t,e,i,r)}InterpolantFactoryMethodLinear(t){return new oD(this.times,this.values,this.getValueSize(),t)}}oU.prototype.ValueTypeName="quaternion",oU.prototype.InterpolantFactoryMethodSmooth=void 0;class oW extends oV{constructor(t,e,i){super(t,e,i)}}oW.prototype.ValueTypeName="string",oW.prototype.ValueBufferType=Array,oW.prototype.DefaultInterpolation=2300,oW.prototype.InterpolantFactoryMethodLinear=void 0,oW.prototype.InterpolantFactoryMethodSmooth=void 0;class oJ extends oV{constructor(t,e,i,r){super(t,e,i,r)}}oJ.prototype.ValueTypeName="vector";class oH{constructor(t="",e=-1,i=[],r=2500){this.name=t,this.tracks=i,this.duration=e,this.blendMode=r,this.uuid=e8(),this.duration<0&&this.resetDuration()}static parse(t){let e=[],i=t.tracks,r=1/(t.fps||1);for(let t=0,s=i.length;t!==s;++t)e.push((function(t){if(void 0===t.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");let e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return oj;
40case"vector":case"vector2":case"vector3":case"vector4":return oJ;case"color":return oF;case"quaternion":return oU;case"bool":case"boolean":return oL;case"string":return oW}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){let e=[],i=[];oO(t.keys,e,i,"value"),t.times=e,t.values=i}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)})(i[t]).scale(r));let s=new this(t.name,t.duration,e,t.blendMode);return s.uuid=t.uuid,s}static toJSON(t){let e=[],i=t.tracks,r={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,r=i.length;t!==r;++t)e.push(oV.toJSON(i[t]));return r}static CreateFromMorphTargetSequence(t,e,i,r){let s=e.length,n=[];for(let t=0;t<s;t++){let a=[],o=[];a.push((t+s-1)%s,t,(t+1)%s),o.push(0,1,0);let h=function(t){let e=t.length,i=Array(e);for(let t=0;t!==e;++t)i[t]=t;return i.sort(function(e,i){return t[e]-t[i]}),i}(a);a=oB(a,1,h),o=oB(o,1,h),r||0!==a[0]||(a.push(s),o.push(o[0])),n.push(new oj(".morphTargetInfluences["+e[t].name+"]",a,o).scale(1/i))}return new this(t,-1,n)}static findByName(t,e){let i=t;Array.isArray(t)||(i=t.geometry&&t.geometry.animations||t.animations);for(let t=0;t<i.length;t++)if(i[t].name===e)return i[t];return null}static CreateClipsFromMorphTargetSequences(t,e,i){let r={},s=/^([\w-]*?)([\d]+)$/;for(let e=0,i=t.length;e<i;e++){let i=t[e],n=i.name.match(s);if(n&&n.length>1){let t=n[1],e=r[t];e||(r[t]=e=[]),e.push(i)}}let n=[];for(let t in r)n.push(this.CreateFromMorphTargetSequence(t,r[t],e,i));return n}static parseAnimation(t,e){if(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let i=function(t,e,i,r,s){if(0!==i.length){let n=[],a=[];oO(i,n,a,r),0!==n.length&&s.push(new t(e,n,a))}},r=[],s=t.name||"default",n=t.fps||30,a=t.blendMode,o=t.length||-1,h=t.hierarchy||[];for(let t=0;t<h.length;t++){let s=h[t].keys;if(s&&0!==s.length){if(s[0].morphTargets){let t;let e={};for(t=0;t<s.length;t++)if(s[t].morphTargets)for(let i=0;i<s[t].morphTargets.length;i++)e[s[t].morphTargets[i]]=-1;for(let i in e){let e=[],n=[];for(let r=0;r!==s[t].morphTargets.length;++r){let r=s[t];e.push(r.time),n.push(r.morphTarget===i?1:0)}r.push(new oj(".morphTargetInfluence["+i+"]",e,n))}o=e.length*n}else{let n=".bones["+e[t].name+"]";i(oJ,n+".position",s,"pos",r),i(oU,n+".quaternion",s,"rot",r),i(oJ,n+".scale",s,"scl",r)}}}return 0===r.length?null:new this(s,o,r,a)}resetDuration(){let t=this.tracks,e=0;for(let i=0,r=t.length;i!==r;++i){let t=this.tracks[i];e=Math.max(e,t.times[t.times.length-1])}return this.duration=e,this}trim(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}clone(){let t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new this.constructor(this.name,this.duration,t,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}let oq={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]}};class oG{constructor(t,e,i){let r;let s=this,n=!1,a=0,o=0,h=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this.itemStart=function(t){o++,!1===n&&void 0!==s.onStart&&s.onStart(t,a,o),n=!0},this.itemEnd=function(t){a++,void 0!==s.onProgress&&s.onProgress(t,a,o),a===o&&(n=!1,void 0!==s.onLoad&&s.onLoad())},this.itemError=function(t){void 0!==s.onError&&s.onError(t)},this.resolveURL=function(t){return r?r(t):t},this.setURLModifier=function(t){return r=t,this},this.addHandler=function(t,e){return h.push(t,e),this},this.removeHandler=function(t){let e=h.indexOf(t);return -1!==e&&h.splice(e,2),this},this.getHandler=function(t){for(let e=0,i=h.length;e<i;e+=2){let i=h[e],r=h[e+1];if(i.global&&(i.lastIndex=0),i.test(t))return r}return null}}}let oX=new oG;class oZ{constructor(t){this.manager=void 0!==t?t:oX,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){let i=this;return new Promise(function(r,s){i.load(t,r,e,s)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}oZ.DEFAULT_MATERIAL_NAME="__DEFAULT";let oY={};
40class o$ extends Error{constructor(t,e){super(t),this.response=e}}class oQ extends oZ{constructor(t){super(t),this.mimeType="",this.responseType=""}load(t,e,i,r){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);let s=oq.get(`file:${t}`);if(void 0!==s)return this.manager.itemStart(t),setTimeout(()=>{e&&e(s),this.manager.itemEnd(t)},0),s;if(void 0!==oY[t]){oY[t].push({onLoad:e,onProgress:i,onError:r});return}oY[t]=[],oY[t].push({onLoad:e,onProgress:i,onError:r});let n=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,o=this.responseType;fetch(n).then(e=>{if(200===e.status||0===e.status){if(0===e.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;let i=oY[t],r=e.body.getReader(),s=e.headers.get("X-File-Size")||e.headers.get("Content-Length"),n=s?parseInt(s):0,a=0!==n,o=0;return new Response(new ReadableStream({start(t){(function e(){r.read().then(({done:r,value:s})=>{if(r)t.close();else{let r=new ProgressEvent("progress",{lengthComputable:a,loaded:o+=s.byteLength,total:n});for(let t=0,e=i.length;t<e;t++){let e=i[t];e.onProgress&&e.onProgress(r)}t.enqueue(s),e()}},e=>{t.error(e)})})()}}))}throw new o$(`fetch for "${e.url}" responded with ${e.status}: ${e.statusText}`,e)}).then(t=>{switch(o){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then(t=>new DOMParser().parseFromString(t,a));case"json":return t.json();default:if(""===a)return t.text();{let e=/charset="?([^;"\s]*)"?/i.exec(a),i=new TextDecoder(e&&e[1]?e[1].toLowerCase():void 0);return t.arrayBuffer().then(t=>i.decode(t))}}}).then(e=>{oq.add(`file:${t}`,e);let i=oY[t];delete oY[t];for(let t=0,r=i.length;t<r;t++){let r=i[t];r.onLoad&&r.onLoad(e)}}).catch(e=>{let i=oY[t];if(void 0===i)throw this.manager.itemError(t),e;delete oY[t];for(let t=0,r=i.length;t<r;t++){let r=i[t];r.onError&&r.onError(e)}this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}let oK=new WeakMap;class o0 extends oZ{constructor(t){super(t)}load(t,e,i,r){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);let s=this,n=oq.get(`image:${t}`);if(void 0!==n){if(!0===n.complete)s.manager.itemStart(t),setTimeout(function(){e&&e(n),s.manager.itemEnd(t)},0);else{let t=oK.get(n);void 0===t&&(t=[],oK.set(n,t)),t.push({onLoad:e,onError:r})}return n}let a=ig("img");function o(){l(),e&&e(this);let i=oK.get(this)||[];for(let t=0;t<i.length;t++){let e=i[t];e.onLoad&&e.onLoad(this)}oK.delete(this),s.manager.itemEnd(t)}function h(e){l(),r&&r(e),oq.remove(`image:${t}`);let i=oK.get(this)||[];for(let t=0;t<i.length;t++){let r=i[t];r.onError&&r.onError(e)}oK.delete(this),s.manager.itemError(t),s.manager.itemEnd(t)}function l(){a.removeEventListener("load",o,!1),a.removeEventListener("error",h,!1)}return a.addEventListener("load",o,!1),a.addEventListener("error",h,!1),"data:"!==t.slice(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),oq.add(`image:${t}`,a),s.manager.itemStart(t),a.src=t,a}}class o1 extends oZ{constructor(t){super(t)}load(t,e,i,r){let s=new iP,n=new o0(this.manager);return n.setCrossOrigin(this.crossOrigin),n.setPath(this.path),n.load(t,function(t){s.image=t,s.needsUpdate=!0,void 0!==e&&e(s)},i,r),s}}class o2 extends rB{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new rY(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){let e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),void 0!==this.target&&(e.object.target=this.target.uuid),e}}class o3 extends o2{constructor(t,e,i){super(t,i),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(rB.DEFAULT_UP),this.updateMatrix(),this.groundColor=new rY(e)}copy(t,e){return super.copy(t,e),this.groundColor.copy(t.groundColor),this}}let o5=new rs,o4=new ih,o6=new ih;class o7{constructor(t){this.camera=t,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new ia(512,512),this.mapType=tT,this.map=null,this.mapPass=null,this.matrix=new rs,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new nB,this._frameExtents=new ia(1,1),this._viewportCount=1,this._viewports=[new iN(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){let e=this.camera,i=this.matrix;o4.setFromMatrixPosition(t.matrixWorld),e.position.copy(o4),o6.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(o6),e.updateMatrixWorld(),o5.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(o5),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(o5)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.intensity=t.intensity,this.bias=t.bias,this.radius=t.radius,this.autoUpdate=t.autoUpdate,this.needsUpdate=t.needsUpdate,this.normalBias=t.normalBias,this.blurSamples=t.blurSamples,this.mapSize.copy(t.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){let t={};return 1!==this.intensity&&(t.intensity=this.intensity),0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),(512!==this.mapSize.x||512!==this.mapSize.y)&&(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class o8 extends o7{constructor(){super(new sE(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(t){let e=this.camera,i=2*e7*t.angle*this.focus,r=this.mapSize.width/this.mapSize.height*this.aspect,s=t.distance||e.far;(i!==e.fov||r!==e.aspect||s!==e.far)&&(e.fov=i,e.aspect=r,e.far=s,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}}class o9 extends o2{constructor(t,e,i=0,r=Math.PI/3,s=0,n=2){super(t,e),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(rB.DEFAULT_UP),this.updateMatrix(),this.target=new rB,this.distance=i,this.angle=r,this.penumbra=s,this.decay=n,this.map=null,this.shadow=new o8}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}let ht=new rs,he=new ih,hi=new ih;class hr extends o7{constructor(){super(new sE(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new ia(4,2),this._viewportCount=6,this._viewports=[new iN(2,1,1,1),new iN(0,1,1,1),new iN(3,1,1,1),new iN(1,1,1,1),new iN(3,0,1,1),new iN(1,0,1,1)],this._cubeDirections=[new ih(1,0,0),new ih(-1,0,0),new ih(0,0,1),new ih(0,0,-1),new ih(0,1,0),new ih(0,-1,0)],this._cubeUps=[new ih(0,1,0),new ih(0,1,0),new ih(0,1,0),new ih(0,1,0),new ih(0,0,1),new ih(0,0,-1)]}updateMatrices(t,e=0){let i=this.camera,r=this.matrix,s=t.distance||i.far;s!==i.far&&(i.far=s,i.updateProjectionMatrix()),he.setFromMatrixPosition(t.matrixWorld),i.position.copy(he),hi.copy(i.position),hi.add(this._cubeDirections[e]),i.up.copy(this._cubeUps[e]),i.lookAt(hi),i.updateMatrixWorld(),r.makeTranslation(-he.x,-he.y,-he.z),ht.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ht)}}class hs extends o2{constructor(t,e,i=0,r=2){super(t,e),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new hr}get power(){return 4*this.intensity*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}class hn extends sC{constructor(t=-1,e=1,i=1,r=-1,s=.1,n=2e3){super(),this.isOrthographicCamera=!0,this.type="Orthogra
40phicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=i,this.bottom=r,this.near=s,this.far=n,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,i,r,s,n){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=r,this.view.width=s,this.view.height=n,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2,s=i-t,n=i+t,a=r+e,o=r-e;if(null!==this.view&&this.view.enabled){let t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=t*this.view.offsetX,n=s+t*this.view.width,a-=e*this.view.offsetY,o=a-e*this.view.height}this.projectionMatrix.makeOrthographic(s,n,a,o,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}class ha extends o7{constructor(){super(new hn(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class ho extends o2{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(rB.DEFAULT_UP),this.updateMatrix(),this.target=new rB,this.shadow=new ha}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}class hh extends o2{constructor(t,e){super(t,e),this.isAmbientLight=!0,this.type="AmbientLight"}}class hl extends o2{constructor(t,e,i=10,r=10){super(t,e),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=i,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(t){this.intensity=t/(this.width*this.height*Math.PI)}copy(t){return super.copy(t),this.width=t.width,this.height=t.height,this}toJSON(t){let e=super.toJSON(t);return e.object.width=this.width,e.object.height=this.height,e}}class hu{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new ih)}set(t){for(let e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this}zero(){for(let t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this}getAt(t,e){let i=t.x,r=t.y,s=t.z,n=this.coefficients;return e.copy(n[0]).multiplyScalar(.282095),e.addScaledVector(n[1],.488603*r),e.addScaledVector(n[2],.488603*s),e.addScaledVector(n[3],.488603*i),e.addScaledVector(n[4],i*r*1.092548),e.addScaledVector(n[5],r*s*1.092548),e.addScaledVector(n[6],.315392*(3*s*s-1)),e.addScaledVector(n[7],i*s*1.092548),e.addScaledVector(n[8],.546274*(i*i-r*r)),e}getIrradianceAt(t,e){let i=t.x,r=t.y,s=t.z,n=this.coefficients;return e.copy(n[0]).multiplyScalar(.886227),e.addScaledVector(n[1],1.023328*r),e.addScaledVector(n[2],1.023328*s),e.addScaledVector(n[3],1.023328*i),e.addScaledVector(n[4],.858086*i*r),e.addScaledVector(n[5],.858086*r*s),e.addScaledVector(n[6],.743125*s*s-.247708),e.addScaledVector(n[7],.858086*i*s),e.addScaledVector(n[8],.429043*(i*i-r*r)),e}add(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this}addScaledSH(t,e){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(t.coefficients[i],e);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,e){for(let i=0;i<9;i++)this.coefficients[i].lerp(t.coefficients[i],e);return this}equals(t){for(let e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0}copy(t){return this.set(t.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(t,e=0){let i=this.coefficients;for(let r=0;r<9;r++)i[r].fromArray(t,e+3*r);return this}toArray(t=[],e=0){let i=this.coefficients;for(let r=0;r<9;r++)i[r].toArray(t,e+3*r);return t}static getBasisAt(t,e){let i=t.x,r=t.y,s=t.z;e[0]=.282095,e[1]=.488603*r,e[2]=.488603*s,e[3]=.488603*i,e[4]=1.092548*i*r,e[5]=1.092548*r*s,e[6]=.315392*(3*s*s-1),e[7]=1.092548*i*s,e[8]=.546274*(i*i-r*r)}}class hc extends o2{constructor(t=new hu,e=1){super(void 0,e),this.isLightProbe=!0,this.sh=t}copy(t){return super.copy(t),this.sh.copy(t.sh),this}fromJSON(t){return this.intensity=t.intensity,this.sh.fromArray(t.sh),this}toJSON(t){let e=super.toJSON(t);return e.object.sh=this.sh.toArray(),e}}class hp extends oZ{constructor(t){super(t),this.textures={}}load(t,e,i,r){let s=this,n=new oQ(s.manager);n.setPath(s.path),n.setRequestHeader(s.requestHeader),n.setWithCredentials(s.withCredentials),n.load(t,function(i){try{e(s.parse(JSON.parse(i)))}catch(e){r?r(e):console.error(e),s.manager.itemError(t)}},i,r)}parse(t){let e=this.textures;function i(t){return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]}let r=this.createMaterialFromType(t.type);if(void 0!==t.uuid&&(r.uuid=t.uuid),void 0!==t.name&&(r.name=t.name),void 0!==t.color&&void 0!==r.color&&r.color.setHex(t.color),void 0!==t.roughness&&(r.roughness=t.roughness),void 0!==t.metalness&&(r.metalness=t.metalness),void 0!==t.sheen&&(r.sheen=t.sheen),void 0!==t.sheenColor&&(r.sheenColor=new rY().setHex(t.sheenColor)),void 0!==t.sheenRoughness&&(r.sheenRoughness=t.sheenRoughness),void 0!==t.emissive&&void 0!==r.emissive&&r.emissive.setHex(t.emissive),void 0!==t.specular&&void 0!==r.specular&&r.specular.setHex(t.specular),void 0!==t.specularIntensity&&(r.specularIntensity=t.specularIntensity),void 0!==t.specularColor&&void 0!==r.specularColor&&r.specularColor.setHex(t.specularColor),void 0!==t.shininess&&(r.shininess=t.shininess),void 0!==t.clearcoat&&(r.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(r.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.dispersion&&(r.dispersion=t.dispersion),void 0!==t.iridescence&&(r.iridescence=t.iridescence),void 0!==t.iridescenceIOR&&(r.iridescenceIOR=t.iridescenceIOR),void 0!==t.iridescenceThicknessRange&&(r.iridescenceThicknessRange=t.iridescenceThicknessRange),void 0!==t.transmission&&(r.transmission=t.transmission),void 0!==t.thickness&&(r.thickness=t.thickness),void 0!==t.attenuationDistance&&(r.attenuationDistance=t.attenuationDistance),void 0!==t.attenuationColor&&void 0!==r.attenuationColor&&r.attenuationColor.setHex(t.attenuationColor),void 0!==t.anisotropy&&(r.anisotropy=t.anisotropy),void 0!==t.anisotropyRotation&&(r.anisotropyRotation=t.anisotropyRotation),void 0!==t.fog&&(r.fog=t.fog),void 0!==t.flatShading&&(r.flatShading=t.flatShading),void 0!==t.blending&&(r.blending=t.blending),void 0!==t.combine&&(r.combine=t.combine),void 0!==t.side&&(r.side=t.side),void 0!==t.shadowSide&&(r.shadowSide=t.shadowSide),void 0!==t.opacity&&(r.opacity=t.opacity),void 0!==t.transparent&&(r.transparent=t.transparent),void 0!==t.alphaTest&&(r.alphaTest=t.alphaTest),void 0!==t.alphaHash&&(r.alphaHash=t.alphaHash),void 0!==t.depthFunc&&(r.depthFunc=t.depthFunc),void 0!==t.depthTest&&(r.depthTest=t.depthTest),void 0!==t.depthWrite&&(r.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(r.colorWrite=t.colorWrite),void 0!==t.blendSrc&&(r.blendSrc=t.blendSrc),void 0!==t.blendDst&&(r.blendDst=t.blendDst),void 0!==t.blendEquation&&(r.blendEquation=t.blendEquation),void 0!==t.blendSrcAlpha&&(r.blendSrcAlpha=t.blendSrcAlpha),void 0!==t.blendDstAlpha&&
40(r.blendDstAlpha=t.blendDstAlpha),void 0!==t.blendEquationAlpha&&(r.blendEquationAlpha=t.blendEquationAlpha),void 0!==t.blendColor&&void 0!==r.blendColor&&r.blendColor.setHex(t.blendColor),void 0!==t.blendAlpha&&(r.blendAlpha=t.blendAlpha),void 0!==t.stencilWriteMask&&(r.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(r.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(r.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(r.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(r.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(r.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(r.stencilZPass=t.stencilZPass),void 0!==t.stencilWrite&&(r.stencilWrite=t.stencilWrite),void 0!==t.wireframe&&(r.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(r.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(r.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(r.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(r.rotation=t.rotation),void 0!==t.linewidth&&(r.linewidth=t.linewidth),void 0!==t.dashSize&&(r.dashSize=t.dashSize),void 0!==t.gapSize&&(r.gapSize=t.gapSize),void 0!==t.scale&&(r.scale=t.scale),void 0!==t.polygonOffset&&(r.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(r.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(r.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.dithering&&(r.dithering=t.dithering),void 0!==t.alphaToCoverage&&(r.alphaToCoverage=t.alphaToCoverage),void 0!==t.premultipliedAlpha&&(r.premultipliedAlpha=t.premultipliedAlpha),void 0!==t.forceSinglePass&&(r.forceSinglePass=t.forceSinglePass),void 0!==t.visible&&(r.visible=t.visible),void 0!==t.toneMapped&&(r.toneMapped=t.toneMapped),void 0!==t.userData&&(r.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?r.vertexColors=t.vertexColors>0:r.vertexColors=t.vertexColors),void 0!==t.uniforms)for(let e in t.uniforms){let s=t.uniforms[e];switch(r.uniforms[e]={},s.type){case"t":r.uniforms[e].value=i(s.value);break;case"c":r.uniforms[e].value=new rY().setHex(s.value);break;case"v2":r.uniforms[e].value=new ia().fromArray(s.value);break;case"v3":r.uniforms[e].value=new ih().fromArray(s.value);break;case"v4":r.uniforms[e].value=new iN().fromArray(s.value);break;case"m3":r.uniforms[e].value=new ic().fromArray(s.value);break;
40case"m4":r.uniforms[e].value=new rs().fromArray(s.value);break;default:r.uniforms[e].value=s.value}}if(void 0!==t.defines&&(r.defines=t.defines),void 0!==t.vertexShader&&(r.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(r.fragmentShader=t.fragmentShader),void 0!==t.glslVersion&&(r.glslVersion=t.glslVersion),void 0!==t.extensions)for(let e in t.extensions)r.extensions[e]=t.extensions[e];if(void 0!==t.lights&&(r.lights=t.lights),void 0!==t.clipping&&(r.clipping=t.clipping),void 0!==t.size&&(r.size=t.size),void 0!==t.sizeAttenuation&&(r.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(r.map=i(t.map)),void 0!==t.matcap&&(r.matcap=i(t.matcap)),void 0!==t.alphaMap&&(r.alphaMap=i(t.alphaMap)),void 0!==t.bumpMap&&(r.bumpMap=i(t.bumpMap)),void 0!==t.bumpScale&&(r.bumpScale=t.bumpScale),void 0!==t.normalMap&&(r.normalMap=i(t.normalMap)),void 0!==t.normalMapType&&(r.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),r.normalScale=new ia().fromArray(e)}return void 0!==t.displacementMap&&(r.displacementMap=i(t.displacementMap)),void 0!==t.displacementScale&&(r.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(r.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(r.roughnessMap=i(t.roughnessMap)),void 0!==t.metalnessMap&&(r.metalnessMap=i(t.metalnessMap)),void 0!==t.emissiveMap&&(r.emissiveMap=i(t.emissiveMap)),void 0!==t.emissiveIntensity&&(r.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(r.specularMap=i(t.specularMap)),void 0!==t.specularIntensityMap&&(r.specularIntensityMap=i(t.specularIntensityMap)),void 0!==t.specularColorMap&&(r.specularColorMap=i(t.specularColorMap)),void 0!==t.envMap&&(r.envMap=i(t.envMap)),void 0!==t.envMapRotation&&r.envMapRotation.fromArray(t.envMapRotation),void 0!==t.envMapIntensity&&(r.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(r.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(r.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(r.lightMap=i(t.lightMap)),void 0!==t.lightMapIntensity&&(r.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(r.aoMap=i(t.aoMap)),void 0!==t.aoMapIntensity&&(r.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(r.gradientMap=i(t.gradientMap)),void 0!==t.clearcoatMap&&(r.clearcoatMap=i(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=i(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(r.clearcoatNormalMap=i(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(r.clearcoatNormalScale=new ia().fromArray(t.clearcoatNormalScale)),void 0!==t.iridescenceMap&&(r.iridescenceMap=i(t.iridescenceMap)),void 0!==t.iridescenceThicknessMap&&(r.iridescenceThicknessMap=i(t.iridescenceThicknessMap)),void 0!==t.transmissionMap&&(r.transmissionMap=i(t.transmissionMap)),void 0!==t.thicknessMap&&(r.thicknessMap=i(t.thicknessMap)),void 0!==t.anisotropyMap&&(r.anisotropyMap=i(t.anisotropyMap)),void 0!==t.sheenColorMap&&(r.sheenColorMap=i(t.sheenColorMap)),void 0!==t.sheenRoughnessMap&&(r.sheenRoughnessMap=i(t.sheenRoughnessMap)),r}setTextures(t){return this.textures=t,this}createMaterialFromType(t){return hp.createMaterialFromType(t)}static createMaterialFromType(t){return new({ShadowMaterial:ox,SpriteMaterial:sq,RawShaderMaterial:ov,ShaderMaterial:sI,PointsMaterial:ar,MeshPhysicalMaterial:oM,MeshStandardMaterial:ob,MeshPhongMaterial:ow,MeshToonMaterial:oS,MeshNormalMaterial:o_,MeshLambertMaterial:oA,MeshDepthMaterial:oT,MeshDistanceMaterial:oz,MeshBasicMaterial:r0,MeshMatcapMaterial:oI,LineDashedMaterial:oC,LineBasicMaterial:nK,Material:rK})[t]}}class hd{static extractUrlBase(t){let e=t.lastIndexOf("/");return -1===e?"./":t.slice(0,e+1)}static resolveURL(t,e){return"string"!=typeof t||""===t?"":(/^https?:\/\//i.test(e)&&/^\//.test(t)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t))?t:e+t}}class hm extends sl{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}toJSON(){let t=super.toJSON();return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}class hy extends oZ{constructor(t){super(t)}load(t,e,i,r){let s=this,n=new oQ(s.manager);n.setPath(s.path),n.setRequestHeader(s.requestHeader),n.setWithCredentials(s.withCredentials),n.load(t,function(i){try{e(s.parse(JSON.parse(i)))}catch(e){r?r(e):console.error(e),s.manager.itemError(t)}},i,r)}parse(t){let e={},i={};function r(t,r){if(void 0!==e[r])return e[r];let s=t.interleavedBuffers[r],n=function(t,e){if(void 0!==i[e])return i[e];let r=new Uint32Array(t.arrayBuffers[e]).buffer;return i[e]=r,r}(t,s.buffer),a=new sW(iy(s.type,n),s.stride);return a.uuid=s.uuid,e[r]=a,a}let s=t.isInstancedBufferGeometry?new hm:new sl,n=t.data.index;if(void 0!==n){let t=iy(n.type,n.array);s.setIndex(new r7(t,1))}let a=t.data.attributes;for(let e in a){let i;let n=a[e];if(n.isInterleavedBufferAttribute)i=new sH(r(t.data,n.data),n.itemSize,n.offset,n.normalized);else{let t=iy(n.type,n.array);i=new(n.isInstancedBufferAttribute?ny:r7)(t,n.itemSize,n.normalized)}void 0!==n.name&&(i.name=n.name),void 0!==n.usage&&i.setUsage(n.usage),s.setAttribute(e,i)}let o=t.data.morphAttributes;if(o)for(let e in o){let i=o[e],n=[];for(let e=0,s=i.length;e<s;e++){let s;let a=i[e];s=a.isInterleavedBufferAttribute?new sH(r(t.data,a.data),a.itemSize,a.offset,a.normalized):new r7(iy(a.type,a.array),a.itemSize,a.normalized),void 0!==a.name&&(s.name=a.name),n.push(s)}s.morphAttributes[e]=n}t.data.morphTargetsRelative&&(s.morphTargetsRelative=!0);let h=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==h)for(let t=0,e=h.length;t!==e;++t){let e=h[t];s.addGroup(e.start,e.count,e.materialIndex)}let l=t.data.boundingSphere;return void 0!==l&&(s.boundingSphere=new i4().fromJSON(l)),t.name&&(s.name=t.name),t.userData&&(s.userData=t.userData),s}}class hf extends oZ{constructor(t){super(t)}load(t,e,i,r){let s=this,n=""===this.path?hd.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||n;let a=new oQ(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(t,function(i){let n=null;try{n=JSON.parse(i)}catch(e){void 0!==r&&r(e),console.error("THREE:ObjectLoader: Can't parse "+t+".",e.message);return}let a=n.metadata;if(void 0===a||void 0===a.type||"geometry"===a.type.toLowerCase()){void 0!==r&&r(Error("THREE.ObjectLoader: Can't load "+t)),console.error("THREE.ObjectLoader: Can't load "+t);return}s.parse(n,e)},i,r)}async loadAsync(t,e){let i=""===this.path?hd.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||i;let r=new oQ(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials);let s=JSON.parse(await r.loadAsync(t,e)),n=s.metadata;if(void 0===n||void 0===n.type||"geometry"===n.type.toLowerCase())throw Error("THREE.ObjectLoader: Can't load "+t);return await this.parseAsync(s)}parse(t,e){let i=this.parseAnimations(t.animations),r=this.parseShapes(t.shapes),s=this.parseGeometries(t.geometries,r),n=this.parseImages(t.images,function(){void 0!==e&&e(h)}),a=this.parseTextures(t.textures,n),o=this.parseMaterials(t.materials,a),h=this.parseObject(t.object,s,o,a,i),l=this.parseSkeletons(t.skeletons,h);if(this.bindSkeletons(h,l),this.bindLightTargets(h),void 0!==e){let t=!1;for(let e in n)if(n[e].data instanceof HTMLImageElement){t=!0;break}!1===t&&e(h)}return h}async parseAsync(t){let e=this.parseAnimations(t.animations),i=this.parseShapes(t.shapes),r=this.parseGeometries(t.geometries,i),s=await this.parseImagesAsync(t.images),n=this.parseTextures(t.textures,s),a=this.parseMaterials(t.materials,n),o=this.parseObject(t.object,r,a,n,e),h=this.parseSkeletons(t.skeletons,o);return this.bindSkeletons(o,h),this.bindLightTargets(o),o}parseShapes(t){let e={};if(void 0!==t)for(let i=0,r=t.length;i<r;i++){let r=new aH().fromJSON(t[i]);e[r.uuid]=r}return e}parseSkeletons(t,e){let i={},r={};if(e.traverse(function(t){t.isBone&&(r[t.uuid]=t)}),void 0!==t)for(let e=0,s=t.length;e<s;e++){let s=new nm().fromJSON(t[e],r);i[s.uuid]=s}return i}parseGeometries(t,e){let i={};if(void 0!==t){let r=new hy;for(let s=0,n=t.length;s<n;s++){let n;let a=t[s];switch(a.type){case"BufferGeometry":case"InstancedBufferGeometry":n=r.parse(a);break;default:a.type in og?n=og[a.type].fromJSON(a,e):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${a.type}"`)}n.uuid=a.uuid,void 0!==a.name&&(n.name=a.name),void 0!==a.userData&&(n.userData=a.userData),i[a.uuid]=n}}return i}parseMaterials(t,e){let i={},r={};if(void 0!==t){let s=new hp;s.setTextures(e);for(let e=0,n=t.length;e<n;e++){let n=t[e];void 0===i[n.uuid]&&(i[n.uuid]=s.parse(n)),r[n.uuid]=i[n.uuid]}}return r}parseAnimations(t){let e={};if(void 0!==t)for(let i=0;i<t.length;i++){let r=t[i],s=oH.parse(r);e[s.uuid]=s}return e}parseImages(t,e){let i;let r=this,s={};function n(t){if("string"==typeof t){var e;return e=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t)?t:r.resourcePath+t,r.manager.itemStart(e),i.load(e,function(){r.manager.itemEnd(e)},void 0,function(){r.manager.itemError(e),r.manager.itemEnd(e)})}return t.data?{data:iy(t.type,t.data),width:t.width,height:t.height}:null}if(void 0!==t&&t.length>0){(i=new o0(new oG(e))).setCrossOrigin(this.crossOrigin);for(let e=0,i=t.length;e<i;e++){let i=t[e],r=i.url;if(Array.isArray(r)){let t=[];for(let e=0,i=r.length;e<i;e++){let i=n(r[e]);null!==i&&(i instanceof HTMLImageElement?t.push(i):t.push(new nc(i.data,i.width,i.height)))}s[i.uuid]=new iB(t)}else{let t=n(i.url);s[i.uuid]=new iB(t)}}}return s}async parseImagesAsync(t){let e;let i=this,r={};async function s(t){if("string"==typeof t){let r=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t)?t:i.resourcePath+t;return await e.loadAsync(r)}return t.data?{data:iy(t.type,t.data),width:t.width,height:t.height}:null}if(void 0!==t&&t.length>0){(e=new o0(this.manager)).setCrossOrigin(this.crossOrigin);for(let e=0,i=t.length;e<i;e++){let i=t[e],n=i.url;if(Array.isArray(n)){let t=[];for(let e=0,i=n.length;e<i;e++){let i=n[e],r=await s(i);null!==r&&(r instanceof HTMLImageElement?t.push(r):t.push(new nc(r.data,r.width,r.height)))}r[i.uuid]=new iB(t)}else{let t=await s(i.url);r[i.uuid]=new iB(t)}}}return r}parseTextures(t,e){function i(t,e){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}let r={};if(void 0!==t)for(let s=0,n=t.length;s<n;s++){let n;let a=t[s];void 0===a.image&&console.warn('THREE.ObjectLoader: No "image" specified for',a.uuid),void 0===e[a.image]&&console.warn("THREE.ObjectLoader: Undefined image",a.image);let o=e[a.image],h=o.data;Array.isArray(h)?(n=new sP,6===h.length&&(n.needsUpdate=!0)):(n=h&&h.data?new nc:new iP,h&&(n.needsUpdate=!0)),n.source=o,n.uuid=a.uuid,void 0!==a.name&&(n.name=a.name),void 0!==a.mapping&&(n.mapping=i(a.mapping,hg)),void 0!==a.channel&&(n.channel=a.channel),void 0!==a.offset&&n.offset.fromArray(a.offset),void 0!==a.repeat&&n.repeat.fromArray(a.repeat),void 0!==a.center&&n.center.fromArray(a.center),void 0!==a.rotation&&(n.rotation=a.rotation),void 0!==a.wrap&&(n.wrapS=i(a.wrap[0],hx),n.wrapT=i(a.wrap[1],hx)),void 0!==a.format&&(n.format=a.format),void 0!==a.internalFormat&&(n.internalFormat=a.internalFormat),void 0!==a.type&&(n.type=a.type),void 0!==a.colorSpace&&(n.colorSpace
40=a.colorSpace),void 0!==a.minFilter&&(n.minFilter=i(a.minFilter,hv)),void 0!==a.magFilter&&(n.magFilter=i(a.magFilter,hv)),void 0!==a.anisotropy&&(n.anisotropy=a.anisotropy),void 0!==a.flipY&&(n.flipY=a.flipY),void 0!==a.generateMipmaps&&(n.generateMipmaps=a.generateMipmaps),void 0!==a.premultiplyAlpha&&(n.premultiplyAlpha=a.premultiplyAlpha),void 0!==a.unpackAlignment&&(n.unpackAlignment=a.unpackAlignment),void 0!==a.compareFunction&&(n.compareFunction=a.compareFunction),void 0!==a.userData&&(n.userData=a.userData),r[a.uuid]=n}return r}parseObject(t,e,i,r,s){let n,a,o;function h(t){return void 0===e[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),e[t]}function l(t){if(void 0!==t){if(Array.isArray(t)){let e=[];for(let r=0,s=t.length;r<s;r++){let s=t[r];void 0===i[s]&&console.warn("THREE.ObjectLoader: Undefined material",s),e.push(i[s])}return e}return void 0===i[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),i[t]}}function u(t){return void 0===r[t]&&console.warn("THREE.ObjectLoader: Undefined texture",t),r[t]}switch(t.type){case"Scene":n=new sU,void 0!==t.background&&(Number.isInteger(t.background)?n.background=new rY(t.background):n.background=u(t.background)),void 0!==t.environment&&(n.environment=u(t.environment)),void 0!==t.fog&&("Fog"===t.fog.type?n.fog=new sD(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(n.fog=new sj(t.fog.color,t.fog.density)),""!==t.fog.name&&(n.fog.name=t.fog.name)),void 0!==t.backgroundBlurriness&&(n.backgroundBlurriness=t.backgroundBlurriness),void 0!==t.backgroundIntensity&&(n.backgroundIntensity=t.backgroundIntensity),void 0!==t.backgroundRotation&&n.backgroundRotation.fromArray(t.backgroundRotation),void 0!==t.environmentIntensity&&(n.environmentIntensity=t.environmentIntensity),void 0!==t.environmentRotation&&n.environmentRotation.fromArray(t.environmentRotation);break;case"PerspectiveCamera":n=new sE(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(n.focus=t.focus),void 0!==t.zoom&&(n.zoom=t.zoom),void 0!==t.filmGauge&&(n.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(n.filmOffset=t.filmOffset),void 0!==t.view&&(n.view=Object.assign({},t.view));break;case"OrthographicCamera":n=new hn(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(n.zoom=t.zoom),void 0!==t.view&&(n.view=Object.assign({},t.view));break;case"AmbientLight":n=new hh(t.color,t.intensity);break;case"DirectionalLight":(n=new ho(t.color,t.intensity)).target=t.target||"";break;case"PointLight":n=new hs(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":n=new hl(t.color,t.intensity,t.width,t.height);break;case"SpotLight":(n=new o9(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay)).target=t.target||"";break;case"HemisphereLight":n=new o3(t.color,t.groundColor,t.intensity);break;case"LightProbe":n=new hc().fromJSON(t);break;case"SkinnedMesh":n=new nl(a=h(t.geometry),o=l(t.material)),void 0!==t.bindMode&&(n.bindMode=t.bindMode),void 0!==t.bindMatrix&&n.bindMatrix.fromArray(t.bindMatrix),void 0!==t.skeleton&&(n.skeleton=t.skeleton);break;case"Mesh":n=new sM(a=h(t.geometry),o=l(t.material));break;case"InstancedMesh":a=h(t.geometry),o=l(t.material);let c=t.count,p=t.instanceMatrix,d=t.instanceColor;(n=new nS(a,o,c)).instanceMatrix=new ny(new Float32Array(p.array),16),void 0!==d&&(n.instanceColor=new ny(new Float32Array(d.array),d.itemSize));break;case"BatchedMesh":a=h(t.geometry),o=l(t.material),(n=new nQ(t.maxInstanceCount,t.maxVertexCount,t.maxIndexCount,o)).geometry=a,n.perObjectFrustumCulled=t.perObjectFrustumCulled,n.sortObjects=t.sortObjects,n._drawRanges=t.drawRanges,n._reservedRanges=t.reservedRanges,n._geometryInfo=t.geometryInfo.map(t=>{let e=null,i=null;return void 0!==t.boundingBox&&(e=new iD().fromJSON(t.boundingBox)),void 0!==t.boundingSphere&&(i=new i4().fromJSON(t.boundingSphere)),{...t,boundingBox:e,boundingSphere:i}}),n._instanceInfo=t.instanceInfo,n._availableInstanceIds=t._availableInstanceIds,n._availableGeometryIds=t._availableGeometryIds,n._nextIndexStart=t.nextIndexStart,n._nextVertexStart=t.nextVertexStart,n._geometryCount=t.geometryCount,n._maxInstanceCount=t.maxInstanceCount,n._maxVertexCount=t.maxVertexCount,n._maxIndexCount=t.maxIndexCount,n._geometryInitialized=t.geometryInitialized,n._matricesTexture=u(t.matricesTexture.uuid),n._indirectTexture=u(t.indirectTexture.uuid),void 0!==t.colorsTexture&&(n._c
40olorsTexture=u(t.colorsTexture.uuid)),void 0!==t.boundingSphere&&(n.boundingSphere=new i4().fromJSON(t.boundingSphere)),void 0!==t.boundingBox&&(n.boundingBox=new iD().fromJSON(t.boundingBox));break;case"LOD":n=new s9;break;case"Line":n=new n7(h(t.geometry),l(t.material));break;case"LineLoop":n=new ai(h(t.geometry),l(t.material));break;case"LineSegments":n=new ae(h(t.geometry),l(t.material));break;case"PointCloud":case"Points":n=new ah(h(t.geometry),l(t.material));break;case"Sprite":n=new s4(l(t.material));break;case"Group":n=new sV;break;case"Bone":n=new nu;break;default:n=new rB}if(n.uuid=t.uuid,void 0!==t.name&&(n.name=t.name),void 0!==t.matrix?(n.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(n.matrixAutoUpdate=t.matrixAutoUpdate),n.matrixAutoUpdate&&n.matrix.decompose(n.position,n.quaternion,n.scale)):(void 0!==t.position&&n.position.fromArray(t.position),void 0!==t.rotation&&n.rotation.fromArray(t.rotation),void 0!==t.quaternion&&n.quaternion.fromArray(t.quaternion),void 0!==t.scale&&n.scale.fromArray(t.scale)),void 0!==t.up&&n.up.fromArray(t.up),void 0!==t.castShadow&&(n.castShadow=t.castShadow),void 0!==t.receiveShadow&&(n.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.intensity&&(n.shadow.intensity=t.shadow.intensity),void 0!==t.shadow.bias&&(n.shadow.bias=t.shadow.bias),void 0!==t.shadow.normalBias&&(n.shadow.normalBias=t.shadow.normalBias),void 0!==t.shadow.radius&&(n.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&n.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(n.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(n.visible=t.visible),void 0!==t.frustumCulled&&(n.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(n.renderOrder=t.renderOrder),void 0!==t.userData&&(n.userData=t.userData),void 0!==t.layers&&(n.layers.mask=t.layers),void 0!==t.children){let a=t.children;for(let t=0;t<a.length;t++)n.add(this.parseObject(a[t],e,i,r,s))}if(void 0!==t.animations){let e=t.animations;for(let t=0;t<e.length;t++){let i=e[t];n.animations.push(s[i])}}if("LOD"===t.type){void 0!==t.autoUpdate&&(n.autoUpdate=t.autoUpdate);let e=t.levels;for(let t=0;t<e.length;t++){let i=e[t],r=n.getObjectByProperty("uuid",i.object);void 0!==r&&n.addLevel(r,i.distance,i.hysteresis)}}return n}bindSkeletons(t,e){0!==Object.keys(e).length&&t.traverse(function(t){if(!0===t.isSkinnedMesh&&void 0!==t.skeleton){let i=e[t.skeleton];void 0===i?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",t.skeleton):t.bind(i,t.bindMatrix)}})}bindLightTargets(t){t.traverse(function(e){if(e.isDirectionalLight||e.isSpotLight){let i=e.target,r=t.getObjectByProperty("uuid",i);void 0!==r?e.target=r:e.target=new rB}})}}let hg={UVMapping:tu,CubeReflectionMapping:tc,CubeRefractionMapping:tp,EquirectangularReflectionMapping:td,EquirectangularRefractionMapping:tm,CubeUVReflectionMapping:ty},hx={RepeatWrapping:tf,ClampToEdgeWrapping:tg,MirroredRepeatWrapping:tx},hv={NearestFilter:tv,NearestMipmapNearestFilter:tb,NearestMipmapLinearFilter:tM,LinearFilter:tw,LinearMipmapNearestFilter:tS,LinearMipmapLinearFilter:t_};new WeakMap;class hb extends sE{constructor(t=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=t}}class hM{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=performance.now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){let e=performance.now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}let hw="\\[\\]\\.:\\/",hS=RegExp("["+hw+"]","g"),h_="[^"+hw+"]",hA="[^"+hw.replace("\\.","")+"]",hT=/((?:WC+[\/:])*)/.source.replace("WC",h_),hz=RegExp("^"+hT+/(WCOD+)?/.source.replace("WCOD",hA)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",h_)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",h_)+"$"),hI=["material","materials","bones","map"];class hC{constructor(t,e,i){let r=i||hk.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,r)}getValue(t,e){this.bind();let i=this._targetGroup.nCachedObjects_,r=this._bindings[i];void 0!==r&&r.getValue(t,e)}setValue(t,e){let i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}}class hk{constructor(t,e,i){this.path=e,this.parsedPath=i||hk.parseTrackName(e),this.node=hk.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,i){return t&&t.isAnimationObjectGroup?new hk.Composite(t,e,i):new hk(t,e,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(hS,"")}static parseTrackName(t){let e=hz.exec(t);if(null===e)throw Error("PropertyBinding: Cannot parse trackName: "+t);let i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){let t=i.nodeName.substring(r+1);-1!==hI.indexOf(t)&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=t)}if(null===i.propertyName||0===i.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){let i=t.skeleton.getBoneByName(e);
40if(void 0!==i)return i}if(t.children){let i=function(t){for(let r=0;r<t.length;r++){let s=t[r];if(s.name===e||s.uuid===e)return s;let n=i(s.children);if(n)return n}return null},r=i(t.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){let i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)t[e++]=i[r]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){let i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node,e=this.parsedPath,i=e.objectName,r=e.propertyName,s=e.propertyIndex;if(t||(t=hk.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(i){let r=e.objectIndex;switch(i){case"materials":if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}t=t.material.materials;break;case"bones":if(!t.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}t=t.skeleton.bones;for(let e=0;e<t.length;e++)if(t[e].name===r){r=e;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}t=t.material.map;break;default:if(void 0===t[i]){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}t=t[i]}if(void 0!==r){if(void 0===t[r]){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);return}t=t[r]}}let n=t[r];
40if(void 0===n){console.error("THREE.PropertyBinding: Trying to update property for track: "+e.nodeName+"."+r+" but it wasn't found.",t);return}let a=this.Versioning.None;this.targetObject=t,!0===t.isMaterial?a=this.Versioning.NeedsUpdate:!0===t.isObject3D&&(a=this.Versioning.MatrixWorldNeedsUpdate);let o=this.BindingType.Direct;if(void 0!==s){if("morphTargetInfluences"===r){if(!t.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!t.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}void 0!==t.morphTargetDictionary[s]&&(s=t.morphTargetDictionary[s])}o=this.BindingType.ArrayElement,this.resolvedProperty=n,this.propertyIndex=s}else void 0!==n.fromArray&&void 0!==n.toArray?(o=this.BindingType.HasFromToArray,this.resolvedProperty=n):Array.isArray(n)?(o=this.BindingType.EntireArray,this.resolvedProperty=n):this.propertyName=r;this.getValue=this.GetterByBindingType[o],this.setValue=this.SetterByBindingTypeAndVersioning[o][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}hk.Composite=hC,hk.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},hk.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},hk.prototype.GetterByBindingType=[hk.prototype._getValue_direct,hk.prototype._getValue_array,hk.prototype._getValue_arrayElement,hk.prototype._getValue_toArray],hk.prototype.SetterByBindingTypeAndVersioning=[[hk.prototype._setValue_direct,hk.prototype._setValue_direct_setNeedsUpdate,hk.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[hk.prototype._setValue_array,hk.prototype._setValue_array_setNeedsUpdate,hk.prototype._setValue_array_setMatrixWorldNeedsUpdate],[hk.prototype._setValue_arrayElement,hk.prototype._setValue_arrayElement_setNeedsUpdate,hk.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[hk.prototype._setValue_fromArray,hk.prototype._setValue_fromArray_setNeedsUpdate,hk.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]],new Float32Array(1);class hB extends sW{constructor(t,e,i=1){super(t,e),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=i}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){let e=super.clone(t);return e.meshPerAttribute=this.meshPerAttribute,e}toJSON(t){let e=super.toJSON(t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}}let hO=new rs;class hE{constructor(t,e,i=0,r=1/0){this.ray=new rr(t,e),this.near=i,this.far=r,this.camera=null,this.layers=new ry,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type: "+e.type)}setFromXRController(t){return hO.identity().extractRotation(t.matrixWorld),this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(hO),this}intersectObject(t,e=!0,i=[]){return hP(t,this,i,e),i.sort(hR),i}intersectObjects(t,e=!0,i=[]){for(let r=0,s=t.length;r<s;r++)hP(t[r],this,i,e);return i.sort(hR),i}}function hR(t,e){return t.distance-e.distance}function hP(t,e,i,r){let s=!0;if(t.layers.test(e.layers)&&!1===t.raycast(e,i)&&(s=!1),!0===s&&!0===r){let r=t.children;for(let t=0,s=r.length;t<s;t++)hP(r[t],e,i,!0)}}class hN{constructor(t=1,e=0,i=0){this.radius=t,this.phi=e,this.theta=i}set(t,e,i){return this.radius=t,this.phi=e,this.theta=i,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){return this.phi=e9(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,i){return this.radius=Math.sqrt(t*t+e*e+i*i),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,i),this.phi=Math.acos(e9(e/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class hV{constructor(t,e,i,r){hV.prototype.isMatrix2=!0,this.elements=[1,0,0,1],void 0!==t&&this.set(t,e,i,r)}identity(){return this.set(1,0,0,1),this}fromArray(t,e=0){for(let i=0;i<4;i++)this.elements[i]=t[i+e];return this}set(t,e,i,r){let s=this.elements;return s[0]=t,s[2]=e,s[1]=i,s[3]=r,this}}let hL=new ih,hF=new ih;class hj{constructor(t=new ih,e=new ih){this.start=t,this.end=e}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){hL.subVectors(t,this.start),hF.subVectors(this.end,this.start);let i=hF.dot(hF),r=hF.dot(hL)/i;return e&&(r=e9(r,0,1)),r}closestPointToPoint(t,e,i){let r=this.closestPointToPointParameter(t,e);return this.delta(i).multiplyScalar(r).add(this.start)}
40applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}class hD{constructor(){this.type="ShapePath",this.color=new rY,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new aJ,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,i,r){return this.currentPath.quadraticCurveTo(t,e,i,r),this}bezierCurveTo(t,e,i,r,s,n){return this.currentPath.bezierCurveTo(t,e,i,r,s,n),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){let e,i,r,s,n;let a=a9.isClockWise,o=this.subPaths;if(0===o.length)return[];let h=[];if(1===o.length)return i=o[0],(r=new aH).curves=i.curves,h.push(r),h;let l=!a(o[0].getPoints());l=t?!l:l;let u=[],c=[],p=[],d=0;c[0]=void 0,p[d]=[];for(let r=0,n=o.length;r<n;r++)e=a(s=(i=o[r]).getPoints()),(e=t?!e:e)?(!l&&c[d]&&d++,c[d]={s:new aH,p:s},c[d].s.curves=i.curves,l&&d++,p[d]=[]):p[d].push({h:i,p:s[0]});if(!c[0])return function(t){let e=[];for(let i=0,r=t.length;i<r;i++){let r=t[i],s=new aH;s.curves=r.curves,e.push(s)}return e}(o);if(c.length>1){let t=!1,e=0;for(let t=0,e=c.length;t<e;t++)u[t]=[];for(let i=0,r=c.length;i<r;i++){let r=p[i];for(let s=0;s<r.length;s++){let n=r[s],a=!0;for(let r=0;r<c.length;r++)(function(t,e){let i=e.length,r=!1;for(let s=i-1,n=0;n<i;s=n++){let i=e[s],a=e[n],o=a.x-i.x,h=a.y-i.y;if(Math.abs(h)>Number.EPSILON){if(h<0&&(i=e[n],o=-o,a=e[s],h=-h),t.y<i.y||t.y>a.y)continue;if(t.y===i.y){if(t.x===i.x)return!0}else{let e=h*(t.x-i.x)-o*(t.y-i.y);if(0===e)return!0;if(e<0)continue;r=!r}}else{if(t.y!==i.y)continue;if(a.x<=t.x&&t.x<=i.x||i.x<=t.x&&t.x<=a.x)return!0}}return r})(n.p,c[r].p)&&(i!==r&&e++,a?(a=!1,u[r].push(n)):t=!0);a&&u[i].push(n)}}e>0&&!1===t&&(p=u)}for(let t=0,e=c.length;t<e;t++){r=c[t].s,h.push(r),n=p[t];for(let t=0,e=n.length;t<e;t++)r.holes.push(n[t].h)}return h}}class hU extends e3{constructor(t,e=null){super(),this.object=t,this.domElement=e,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(t){if(void 0===t){console.warn("THREE.Controls: connect() now requires an element.");return}null!==this.domElement&&this.disconnect(),this.domElement=t}disconnect(){}dispose(){}update(){}}function hW(t,e,i,r){let s=function(t){switch(t){case tT:case tz:return{byteLength:1,components:1};case tC:case tI:case tE:return{byteLength:2,components:1};case tR:case tP:return{byteLength:2,components:4};case tB:case tk:case tO:return{byteLength:4,components:1};case tV:return{byteLength:4,components:3}}throw Error(`Unknown texture type ${t}.`)}(r);switch(i){case tL:return t*e;case tW:case tJ:return t*e/s.components*s.byteLength;case tH:case tq:return t*e*2/s.components*s.byteLength;case tF:return t*e*3/s.components*s.byteLength;case tj:case tX:return t*e*4/s.components*s.byteLength;case tZ:case tY:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case t$:case tQ:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case t0:case t2:return Math.max(t,16)*Math.max(e,8)/4;case tK:case t1:return Math.max(t,8)*Math.max(e,8)/2;case t3:case t5:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case t4:case t6:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case t7:return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16;case t8:return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16;case t9:return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16;case et:return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16;case ee:return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16;case ei:return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16;case er:return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16;case es:return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16;case en:return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16;case ea:return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16;case eo:return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16;case eh:return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16;case el:return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16;case eu:case ec:case ep:return Math.ceil(t/4)*Math.ceil(e/4)*16;case ed:case em:return Math.ceil(t/4)*Math.ceil(e/4)*8;case ey:case ef:return Math.ceil(t/4)*Math.ceil(e/4)*16}throw Error(`Unable to determine texture byte length for ${i} format.`)}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:n}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=n)}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.