1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5132],{97389:(t,e,i)=>{let s,r;i.d(e,{$EB:()=>m,$Yl:()=>E,$_I:()=>tb,$ei:()=>z,A$4:()=>s_,BH$:()=>rR,BKk:()=>ac,BVL:()=>t0,BXX:()=>tX,B_h:()=>t4,CSG:()=>ap,CVz:()=>tQ,CWW:()=>em,Cfg:()=>tf,D$Q:()=>ad,Dmk:()=>tO,EZo:()=>g,EdD:()=>b,F1T:()=>aU,FFZ:()=>ek,FV:()=>ti,FXf:()=>w,Fn:()=>eo,GJx:()=>tc,GOR:()=>rj,GWd:()=>tR,GYF:()=>rg,Gc6:()=>rq,Gu$:()=>aa,Gwm:()=>X,H23:()=>el,HIg:()=>tI,HO_:()=>ep,HXV:()=>tZ,I9Y:()=>e1,IE4:()=>tj,IUQ:()=>ic,Iit:()=>ah,Jnc:()=>o,K52:()=>Y,KDk:()=>t$,KLL:()=>eM,KRh:()=>G,Kef:()=>ec,Kwu:()=>x,LAk:()=>tr,LiQ:()=>k,LlO:()=>au,LoY:()=>sE,MW4:()=>sz,Mjd:()=>tt,NTi:()=>f,Nex:()=>a0,Nt7:()=>N,Nz6:()=>tJ,ONl:()=>rL,OUM:()=>tv,Om:()=>tu,OtU:()=>t2,OuU:()=>O,PPD:()=>rI,PTz:()=>e2,Pq0:()=>e3,Q1f:()=>iK,QP0:()=>l,Qev:()=>ej,Qrf:()=>t8,R3r:()=>iY,R8M:()=>eE,RQf:()=>tA,Riy:()=>tK,Rm2:()=>eP,RoJ:()=>sJ,RrE:()=>F,RyA:()=>c,S$4:()=>eh,THS:()=>sS,TdN:()=>eV,TiK:()=>ez,TkQ:()=>tU,U3G:()=>q,V3x:()=>tB,V9B:()=>rs,VCu:()=>rJ,VT0:()=>tE,Vb5:()=>h,Vnu:()=>eB,VxR:()=>ev,W9U:()=>eu,WNZ:()=>n,Wdf:()=>eO,Wew:()=>tC,Wk7:()=>u,XG_:()=>ed,XIg:()=>y,XrR:()=>Q,YJl:()=>iq,Yuy:()=>t_,Z58:()=>i0,ZLX:()=>rA,ZQM:()=>tD,Zcv:()=>rB,Zr2:()=>eb,_QJ:()=>ee,_Ut:()=>al,a55:()=>eY,a5J:()=>et,aEY:()=>R,aJ8:()=>ta,aVO:()=>am,amv:()=>ew,b4q:()=>rW,bC7:()=>er,bCz:()=>v,bI3:()=>ey,bdM:()=>ar,bkx:()=>tz,brA:()=>j,bw0:()=>H,c90:()=>tW,cHt:()=>tS,caT:()=>Z,cj9:()=>e0,czI:()=>t6,dYF:()=>iy,dcC:()=>tF,dwI:()=>e6,e0p:()=>D,eHc:()=>U,eaF:()=>ry,eoi:()=>eA,er$:()=>ex,f4X:()=>C,fBL:()=>tw,g7M:()=>ts,gJ2:()=>tk,gO9:()=>M,gPd:()=>iu,gWB:()=>eC,gZr:()=>t1,ghU:()=>td,hB5:()=>d,hdd:()=>V,hgQ:()=>P,hsX:()=>p,hxR:()=>tm,hy7:()=>tn,iNn:()=>rY,ie2:()=>B,ix0:()=>tT,jR7:()=>tq,jSS:()=>t3,jej:()=>eU,jf0:()=>eg,jzd:()=>eT,k6Q:()=>tY,k6q:()=>tg,kO0:()=>e_,kRr:()=>tx,kTW:()=>tp,kTp:()=>tH,kn4:()=>ig,kxk:()=>s3,kyO:()=>$,lGu:()=>W,lPF:()=>eI,lxW:()=>an,lyL:()=>es,mcG:()=>eL,nNL:()=>te,nST:()=>S,nWS:()=>ip,nZQ:()=>aW,ojh:()=>A,ojs:()=>en,ov9:()=>L,pBf:()=>tG,pHI:()=>ty,paN:()=>tL,ppV:()=>it,psI:()=>t7,qUd:()=>aL,qa3:()=>t5,qad:()=>T,qq$:()=>eN,qtW:()=>sA,rFo:()=>im,rSH:()=>t9,ri6:()=>eW,rjZ:()=>rX,sPf:()=>a,tJf:()=>tM,uB5:()=>ei,uV5:()=>tl,ubm:()=>aD,vim:()=>eS,vyJ:()=>ef,wfO:()=>to,wn6:()=>I,wrO:()=>tN,xFO:()=>th,xSv:()=>J,y3Z:()=>ea,yT7:()=>tV,y_p:()=>K,z3S:()=>eD,zdS:()=>tP,zgK:()=>iC,znC:()=>_});let a="184",n=0,h=1,o=2,l=1,u=2,c=3,d=0,p=1,m=2,y=0,f=1,g=2,x=3,b=4,v=5,M=100,w=101,S=102,_=103,z=104,A=200,T=201,C=202,k=203,B=204,O=205,V=206,N=207,I=208,R=209,P=210,F=211,E=212,D=213,L=214,U=0,W=1,j=2,J=3,q=4,X=5,Y=6,H=7,Z=0,G=1,Q=2,K=0,$=1,tt=2,te=3,ti=4,ts=5,tr=6,ta=7,tn=301,th=302,to=303,tl=304,tu=306,tc=1e3,td=1001,tp=1002,tm=1003,ty=1004,tf=1005,tg=1006,tx=1007,tb=1008,tv=1009,tM=1010,tw=1011,tS=1012,t_=1013,tz=1014,tA=1015,tT=1016,tC=1017,tk=1018,tB=1020,tO=35902,tV=35899,tN=1021,tI=1022,tR=1023,tP=1026,tF=1027,tE=1028,tD=1029,tL=1030,tU=1031,tW=1033,tj=33776,tJ=33777,tq=33778,tX=33779,tY=35840,tH=35841,tZ=35842,tG=35843,tQ=36196,tK=37492,t$=37496,t0=37488,t1=37489,t2=37490,t3=37491,t5=37808,t4=37809,t6=37810,t9=37811,t8=37812,t7=37813,et=37814,ee=37815,ei=37816,es=37817,er=37818,ea=37819,en=37820,eh=37821,eo=36492,el=36494,eu=36495,ec=36283,ed=36284,ep=36285,em=36286,ey=0,ef=1,eg="",ex="srgb",eb="srgb-linear",ev="linear",eM="srgb",ew=512,eS=513,e_=514,ez=515,eA=516,eT=517,eC=518,ek=519,eB=35048,eO="300 es",eV=2e3;function eN(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function eI(){let t=eN("canvas");return t.style.display="block",t}Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;let eR={};function eP(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];console.log("THREE."+e.shift(),...e)}function eF(t){let e=t[0];if("string"==typeof e&&e.startsWith("TSL:")){let e=t[1];e&&e.isStackTrace?t[0]+=" "+e.getLocation():t[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return t}function eE(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];let s="THREE."+(e=eF(e)).shift();{let t=e[0];t&&t.isStackTrace?console.warn(t.getError(s)):console.warn(s,...e)}}function eD(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];let s="THREE."+(e=eF(e)).shift();{let t=e[0];t&&t.isStackTrace?console.error(t.getError(s)):console.error(s,...e)}}function eL(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];let s=e.join(" ");s in eR||(eR[s]=!0,eE(...e))}function eU(t,e,i){return new Promise(function(s,r){setTimeout(function a(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:r();break;case t.TIMEOUT_EXPIRED:setTimeout(a,i);break;default:s()}},i)})}let eW={0:1,2:6,4:7,3:5,1:0,6:2,7:4,5:3};class ej{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});let i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)}hasEventListener(t,e){let i=this._listeners;return void 0!==i&&void 0!==i[t]&&-1!==i[t].indexOf(e)}removeEventListener(t,e){let i=this._listeners;if(void 0===i)return;let s=i[t];if(void 0!==s){let t=s.indexOf(e);-1!==t&&s.splice(t,1)}}dispatchEvent(t){let e=this._listeners;if(void 0===e)return;let i=e[t.type];if(void 0!==i){t.target=this;let e=i.slice(0);for(let i=0,s=e.length;i<s;i++)e[i].call(this,t);t.target=null}}}let eJ=["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
15","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"],eq=1234567,eX=Math.PI/180,eY=180/Math.PI;function eH(){let t=0xffffffff*Math.random()|0,e=0xffffffff*Math.random()|0,i=0xffffffff*Math.random()|0,s=0xffffffff*Math.random()|0;return(eJ[255&t]+eJ[t>>8&255]+eJ[t>>16&255]+eJ[t>>24&255]+"-"+eJ[255&e]+eJ[e>>8&255]+"-"+eJ[e>>16&15|64]+eJ[e>>24&255]+"-"+eJ[63&i|128]+eJ[i>>8&255]+"-"+eJ[i>>16&255]+eJ[i>>24&255]+eJ[255&s]+eJ[s>>8&255]+eJ[s>>16&255]+eJ[s>>24&255]).toLowerCase()}function eZ(t,e,i){return Math.max(e,Math.min(i,t))}function eG(t,e){return(t%e+e)%e}function eQ(t,e,i){return(1-i)*t+i*e}function eK(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/0xffffffff;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/0x7fffffff,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw Error("Invalid component type.")}}function e$(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(0xffffffff*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(0x7fffffff*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw Error("Invalid component type.")}}let e0={DEG2RAD:eX,RAD2DEG:eY,generateUUID:eH,clamp:eZ,euclideanModulo:eG,mapLinear:function(t,e,i,s,r){return s+(t-e)*(r-s)/(i-e)},inverseLerp:function(t,e,i){return t!==e?(i-t)/(e-t):0},lerp:eQ,damp:function(t,e,i,s){return eQ(t,e,1-Math.exp(-i*s))},pingpong:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e-Math.abs(eG(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&&(eq=t);let e=eq+=0x6d2b79f5;return e=Math.imul(e^e>>>15,1|e),(((e^=e+Math.imul(e^e>>>7,61|e))^e>>>14)>>>0)/0x100000000},degToRad:function(t){return t*eX},radToDeg:function(t){return t*eY},isPowerOfTwo:function(t){return(t&t-1)==0&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,i,s,r){let a=Math.cos,n=Math.sin,h=a(i/2),o=n(i/2),l=a((e+s)/2),u=n((e+s)/2),c=a((e-s)/2),d=n((e-s)/2),p=a((s-e)/2),m=n((s-e)/2);switch(r){case"XYX":t.set(h*u,o*c,o*d,h*l);break;case"YZY":t.set(o*d,h*u,o*c,h*l);break;case"ZXZ":t.set(o*c,o*d,h*u,h*l);break;case"XZX":t.set(h*u,o*m,o*p,h*l);break;case"YXY":t.set(o*p,h*u,o*m,h*l);break;case"ZYZ":t.set(o*m,o*p,h*u,h*l);break;default:eE("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},normalize:e$,denormalize:eK};class e1{get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){let e=this.x,i=this.y,s=t.elements;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=eZ(this.x,t.x,e.x),this.y=eZ(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=eZ(this.x,t,e),this.y=eZ(this.y,t,e),this}clampLength(t,e){let i=this.length();return this.divideScalar(i||1).multiplyScalar(eZ(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}
1round(){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(eZ(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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=t[e],this.y=t[e+1],this}toArray(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){let i=Math.cos(e),s=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*i-a*s+t.x,this.y=r*s+a*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}constructor(t=0,e=0){this.x=t,this.y=e}}e1.prototype.isVector2=!0;class e2{static slerpFlat(t,e,i,s,r,a,n){let h=i[s+0],o=i[s+1],l=i[s+2],u=i[s+3],c=r[a+0],d=r[a+1],p=r[a+2],m=r[a+3];if(u!==m||h!==c||o!==d||l!==p){let t=h*c+o*d+l*p+u*m;t<0&&(c=-c,d=-d,p=-p,m=-m,t=-t);let e=1-n;if(t<.9995){let i=Math.acos(t),s=Math.sin(i);h=h*(e=Math.sin(e*i)/s)+c*(n=Math.sin(n*i)/s),o=o*e+d*n,l=l*e+p*n,u=u*e+m*n}else{let t=1/Math.sqrt((h=h*e+c*n)*h+(o=o*e+d*n)*o+(l=l*e+p*n)*l+(u=u*e+m*n)*u);h*=t,o*=t,l*=t,u*=t}}t[e]=h,t[e+1]=o,t[e+2]=l,t[e+3]=u}static multiplyQuaternionsFlat(t,e,i,s,r,a){let n=i[s],h=i[s+1],o=i[s+2],l=i[s+3],u=r[a],c=r[a+1],d=r[a+2],p=r[a+3];return t[e]=n*p+l*u+h*d-o*c,t[e+1]=h*p+l*c+o*u-n*d,t[e+2]=o*p+l*d+n*c-h*u,t[e+3]=l*p-n*u-h*c-o*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,i,s){return this._x=t,this._y=e,this._z=i,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t){let e=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i=t._x,s=t._y,r=t._z,a=t._order,n=Math.cos,h=Math.sin,o=n(i/2),l=n(s/2),u=n(r/2),c=h(i/2),d=h(s/2),p=h(r/2);switch(a){case"XYZ":this._x=c*l*u+o*d*p,this._y=o*d*u-c*l*p,this._z=o*l*p+c*d*u,this._w=o*l*u-c*d*p;break;case"YXZ":this._x=c*l*u+o*d*p,this._y=o*d*u-c*l*p,this._z=o*l*p-c*d*u,this._w=o*l*u+c*d*p;break;case"ZXY":this._x=c*l*u-o*d*p,this._y=o*d*u+c*l*p,this._z=o*l*p+c*d*u,this._w=o*l*u-c*d*p;break;case"ZYX":this._x=c*l*u-o*d*p,this._y=o*d*u+c*l*p,this._z=o*l*p-c*d*u,this._w=o*l*u+c*d*p;break;case"YZX":this._x=c*l*u+o*d*p,this._y=o*d*u+c*l*p,this._z=o*l*p-c*d*u,this._w=o*l*u-c*d*p;break;case"XZY":this._x=c*l*u-o*d*p,this._y=o*d*u-c*l*p,this._z=o*l*p+c*d*u,this._w=o*l*u+c*d*p;break;default:eE("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!0===e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){let i=e/2,s=Math.sin(i);return this._x=t.x*s,this._y=t.y*s,this._z=t.z*s,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,i=e[0],s=e[4],r=e[8],a=e[1],n=e[5],h=e[9],o=e[2],l=e[6],u=e[10],c=i+n+u;if(c>0){let t=.5/Math.sqrt(c+1);this._w=.25/t,this._x=(l-h)*t,this._y=(r-o)*t,this._z=(a-s)*t}else if(i>n&&i>u){let t=2*Math.sqrt(1+i-n-u);this._w=(l-h)/t,this._x=.25*t,this._y=(s+a)/t,this._z=(r+o)/t}else if(n>u){let t=2*Math.sqrt(1+n-i-u);this._w=(r-o)/t,this._x=(s+a)/t,this._y=.25*t,this._z=(h+l)/t}else{let t=2*Math.sqrt(1+u-i-n);this._w=(a-s)/t,this._x=(r+o)/t,this._y=(h+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(eZ(this.dot(t),-1,1)))}rotateTowards(t,e){let i=this.angleTo(t);if(0===i)return this;let s=Math.min(1,e/i);return this.slerp(t,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}
vendor: 5,540 bytes, line 1
1conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){let i=t._x,s=t._y,r=t._z,a=t._w,n=e._x,h=e._y,o=e._z,l=e._w;return this._x=i*l+a*n+s*o-r*h,this._y=s*l+a*h+r*n-i*o,this._z=r*l+a*o+i*h-s*n,this._w=a*l-i*n-s*h-r*o,this._onChangeCallback(),this}slerp(t,e){let i=t._x,s=t._y,r=t._z,a=t._w,n=this.dot(t);n<0&&(i=-i,s=-s,r=-r,a=-a,n=-n);let h=1-e;if(n<.9995){let t=Math.acos(n),o=Math.sin(t);h=Math.sin(h*t)/o,e=Math.sin(e*t)/o,this._x=this._x*h+i*e,this._y=this._y*h+s*e,this._z=this._z*h+r*e,this._w=this._w*h+a*e,this._onChangeCallback()}else this._x=this._x*h+i*e,this._y=this._y*h+s*e,this._z=this._z*h+r*e,this._w=this._w*h+a*e,this.normalize();return this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){let t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),i=Math.random(),s=Math.sqrt(1-i),r=Math.sqrt(i);return this.set(s*Math.sin(t),s*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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}constructor(t=0,e=0,i=0,s=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=i,this._w=s}}class e3{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(e4.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(e4.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,i=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*s,this.y=r[1]*e+r[4]*i+r[7]*s,this.z=r[2]*e+r[5]*i+r[8]*s,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,i=this.y,s=this.z,r=t.elements,a=1/(r[3]*e+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*s+r[12])*a,this.y=(r[1]*e+r[5]*i+r[9]*s+r[13])*a,this.z=(r[2]*e+r[6]*i+r[10]*s+r[14])*a,this}applyQuaternion(t){let e=this.x,i=this.y,s=this.z,r=t.x,a=t.y,n=t.z,h=t.w,o=2*(a*s-n*i),l=2*(n*e-r*s),u=2*(r*i-a*e);return this.x=e+h*o+a*u-n*l,this.y=i+h*l+n*o-r*u,this.z=s+h*u+r*l-a*o,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let e=this.x,i=this.y,s=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*s,this.y=r[1]*e+r[5]*i+r[9]*s,this.z=r[2]*e+r[6]*i+r[10]*s,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=eZ(this.x,t.x,e.x),this.y=eZ(this.y,t.y,e.y),this.z=eZ(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=eZ(this.x,t,e),this.y=eZ(this.y,t,e),this.z=eZ(this.z,t,e),this}clampLength(t,e){let i=this.length();return this.divideScalar(i||1).multiplyScalar(eZ(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: 6,560 bytes, line 1
1round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){let i=t.x,s=t.y,r=t.z,a=e.x,n=e.y,h=e.z;return this.x=s*h-r*n,this.y=r*a-i*h,this.z=i*n-s*a,this}projectOnVector(t){let e=t.lengthSq();if(0===e)return this.set(0,0,0);let i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return e5.copy(this).projectOnVector(t),this.sub(e5)}reflect(t){return this.sub(e5.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(eZ(this.dot(t)/e,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,i=this.y-t.y,s=this.z-t.z;return e*e+i*i+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){let s=Math.sin(e)*t;return this.x=s*Math.sin(i),this.y=Math.cos(e)*t,this.z=s*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){let e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),s=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=s,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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}constructor(t=0,e=0,i=0){this.x=t,this.y=e,this.z=i}}e3.prototype.isVector3=!0;let e5=new e3,e4=new e2;class e6{set(t,e,i,s,r,a,n,h,o){let l=this.elements;return l[0]=t,l[1]=s,l[2]=n,l[3]=e,l[4]=r,l[5]=h,l[6]=i,l[7]=a,l[8]=o,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let i=t.elements,s=e.elements,r=this.elements,a=i[0],n=i[3],h=i[6],o=i[1],l=i[4],u=i[7],c=i[2],d=i[5],p=i[8],m=s[0],y=s[3],f=s[6],g=s[1],x=s[4],b=s[7],v=s[2],M=s[5],w=s[8];return r[0]=a*m+n*g+h*v,r[3]=a*y+n*x+h*M,r[6]=a*f+n*b+h*w,r[1]=o*m+l*g+u*v,r[4]=o*y+l*x+u*M,r[7]=o*f+l*b+u*w,r[2]=c*m+d*g+p*v,r[5]=c*y+d*x+p*M,r[8]=c*f+d*b+p*w,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){let t=this.elements,e=t[0],i=t[1],s=t[2],r=t[3],a=t[4],n=t[5],h=t[6],o=t[7],l=t[8];return e*a*l-e*n*o-i*r*l+i*n*h+s*r*o-s*a*h}invert(){let t=this.elements,e=t[0],i=t[1],s=t[2],r=t[3],a=t[4],n=t[5],h=t[6],o=t[7],l=t[8],u=l*a-n*o,c=n*h-l*r,d=o*r-a*h,p=e*u+i*c+s*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return t[0]=u*m,t[1]=(s*o-l*i)*m,t[2]=(n*i-s*a)*m,t[3]=c*m,t[4]=(l*e-s*h)*m,t[5]=(s*r-n*e)*m,t[6]=d*m,t[7]=(i*h-o*e)*m,t[8]=(a*e-i*r)*m,this}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){let e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,i,s,r,a,n){let h=Math.cos(r),o=Math.sin(r);return this.set(i*h,i*o,-i*(h*a+o*n)+a+t,-s*o,s*h,-s*(-o*a+h*n)+n+e,0,0,1),this}scale(t,e){return this.premultiply(e9.makeScale(t,e)),this}rotate(t){return this.premultiply(e9.makeRotation(-t)),this}translate(t,e){return this.premultiply(e9.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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,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)}constructor(t,e,i,s,r,a,n,h,o){this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,i,s,r,a,n,h,o)}}e6.prototype.isMatrix3=!0;
1let e9=new e6,e8=new e6().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),e7=new e6().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),it=function(){let t={enabled:!0,workingColorSpace:eb,spaces:{},convert:function(t,e,i){return!1!==this.enabled&&e!==i&&e&&i&&(this.spaces[e].transfer===eM&&(t.r=ie(t.r),t.g=ie(t.g),t.b=ie(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===eM&&(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===eg?ev:this.spaces[t].transfer},getToneMappingMode:function(t){return this.spaces[t].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.workingColorSpace;return this.spaces[t].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(e,i){return eL("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),t.workingToColorSpace(e,i)},toWorkingColorSpace:function(e,i){return eL("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),t.colorSpaceToWorking(e,i)}},e=[.64,.33,.3,.6,.15,.06],i=[.2126,.7152,.0722],s=[.3127,.329];return t.define({[eb]:{primaries:e,whitePoint:s,transfer:ev,toXYZ:e8,fromXYZ:e7,luminanceCoefficients:i,workingColorSpaceConfig:{unpackColorSpace:ex},outputColorSpaceConfig:{drawingBufferColorSpace:ex}},[ex]:{primaries:e,whitePoint:s,transfer:eM,toXYZ:e8,fromXYZ:e7,luminanceCoefficients:i,outputColorSpaceConfig:{drawingBufferColorSpace:ex}}}),t}();function ie(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}
1function ii(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}class is{static getDataURL(t){let e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image/png";if(/^data:/i.test(t.src)||"undefined"==typeof HTMLCanvasElement)return t.src;if(t instanceof HTMLCanvasElement)e=t;else{void 0===s&&(s=eN("canvas")),s.width=t.width,s.height=t.height;let i=s.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=s}return e.toDataURL(i)}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){let e=eN("canvas");e.width=t.width,e.height=t.height;let i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);let s=i.getImageData(0,0,t.width,t.height),r=s.data;for(let t=0;t<r.length;t++)r[t]=255*ie(r[t]/255);return i.putImageData(s,0,0),e}if(!t.data)return eE("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*ie(e[t]/255)):e[t]=ie(e[t]);return{data:e,width:t.width,height:t.height}}}}let ir=0;class ia{getSize(t){let e=this.data;return"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement?t.set(e.videoWidth,e.videoHeight,0):"undefined"!=typeof VideoFrame&&e instanceof VideoFrame?t.set(e.displayWidth,e.displayHeight,0):null!==e?t.set(e.width,e.height,e.depth||0):t.set(0,0,0),t}set needsUpdate(t){!0===t&&this.version++}toJSON(t){let e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];let i={uuid:this.uuid,url:""},s=this.data;if(null!==s){let t;if(Array.isArray(s)){t=[];for(let e=0,i=s.length;e<i;e++)s[e].isDataTexture?t.push(ih(s[e].image)):t.push(ih(s[e]))}else t=ih(s);i.url=t}return e||(t.images[this.uuid]=i),i}constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:ir++}),this.uuid=eH(),this.data=t,this.dataReady=!0,this.version=0}}function ih(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?is.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(eE("Texture: Unable to serialize Texture."),{})}let io=0,il=new e3;class iu extends ej{get width(){return this.source.getSize(il).x}get height(){return this.source.getSize(il).y}get depth(){return this.source.getSize(il).z}get image(){return this.source.data}set image(t){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.normalized=t.normalized,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.renderTarget=t.renderTarget,this.isRenderTargetTexture=t.isRenderTargetTexture,this.isArrayTexture=t.isArrayTexture,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}setValues(t){for(let e in t){let i=t[e];if(void 0===i){eE("Texture.setValues(): parameter '".concat(e,"' has value of undefined."));continue}let s=this[e];if(void 0===s){eE("Texture.setValues(): property '".concat(e,"' does not exist."));continue}s&&i&&s.isVector2&&i.isVector2||s&&i&&s.isVector3&&i.isVector3||s&&i&&s.isMatrix3&&i.isMatrix3?s.c
1opy(i):this[e]=i}}toJSON(t){let e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];let i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,normalized:this.normalized,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),e||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case tc:t.x=t.x-Math.floor(t.x);break;case td:t.x=t.x<0?0:1;break;case tp: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 tc:t.y=t.y-Math.floor(t.y);break;case td:t.y=t.y<0?0:1;break;case tp: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++}constructor(t=iu.DEFAULT_IMAGE,e=iu.DEFAULT_MAPPING,i=td,s=td,r=tg,a=tb,n=tR,h=tv,o=iu.DEFAULT_ANISOTROPY,l=eg){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:io++}),this.uuid=eH(),this.name="",this.source=new ia(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=i,this.wrapT=s,this.magFilter=r,this.minFilter=a,this.anisotropy=o,this.format=n,this.internalFormat=null,this.type=h,this.offset=new e1(0,0),this.repeat=new e1(1,1),this.center=new e1(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new e6,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=l,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!t&&!!t.depth&&t.depth>1,this.pmremVersion=0,this.normalized=!1}}iu.DEFAULT_IMAGE=null,iu.DEFAULT_MAPPING=300,iu.DEFAULT_ANISOTROPY=1;class ic{get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,i,s){return this.x=t,this.y=e,this.z=i,this.w=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){let e=this.x,i=this.y,s=this.z,r=this.w,a=t.elements;return this.x=a[0]*e+a[4]*i+a[8]*s+a[12]*r,this.y=a[1]*e+a[5]*i+a[9]*s+a[13]*r,this.z=a[2]*e+a[6]*i+a[10]*s+a[14]*r,this.w=a[3]*e+a[7]*i+a[11]*s+a[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,i,s,r,a=t.elements,n=a[0],h=a[4],o=a[8],l=a[1],u=a[5],c=a[9],d=a[2],p=a[6],m=a[10];if(.01>Math.abs(h-l)&&.01>Math.abs(o-d)&&.01>Math.abs(c-p)){if(.1>Math.abs(h+l)&&.1>Math.abs(o+d)&&.1>Math.abs(c+p)&&.1>Math.abs(n+u+m-3))return this.set(1,0,0,0),this;e=Math.PI;let t=(n+1)/2,a=(u+1)/2,y=(m+1)/2,f=(h+l)/4,g=(o+d)/4,x=(c+p)/4;return t>a&&t>y?t<.01?(i=0,s=.707106781,r=.707106781):(s=f/(i=Math.sqrt(t)),r=g/i):a>y?a<.01?(i=.707106781,s=0,r=.707106781):(i=f/(s=Math.sqrt(a)),r=x/s):y<.01?(i=.707106781,s=.707106781,r=0):(i=g/(r=Math.sqrt(y)),s=x/r),this.set(i,s,r,e),this}let y=Math.sqrt((p-c)*(p-c)+(o-d)*(o-d)+(l-h)*(l-h));return .001>Math.abs(y)&&(y=1),this.x=(p-c)/y,this.y=(o-d)/y,this.z=(l-h)/y,this.w=Math.acos((n+u+m-1)/2),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=eZ(this.x,t.x,e.x),this.y=eZ(this.y,t.y,e.y),this.z=eZ(this.z,t.z,e.z),this.w=eZ(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=eZ(this.x,t,e),this.y=eZ(this.y,t,e),this.z=eZ(this.z,t,e),this.w=eZ(this.w,t,e),this}clampLength(t,e){let i=this.length();return this.divideScalar(i||1).multiplyScalar(eZ(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}
1round(){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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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}constructor(t=0,e=0,i=0,s=1){this.x=t,this.y=e,this.z=i,this.w=s}}ic.prototype.isVector4=!0;class id extends ej{_setTextureOptions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={minFilter:tg,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){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(this.width!==t||this.height!==e||this.depth!==i){this.width=t,this.height=e,this.depth=i;for(let s=0,r=this.textures.length;s<r;s++)this.textures[s].image.width=t,this.textures[s].image.height=e,this.textures[s].image.depth=i,!0!==this.textures[s].isData3DTexture&&(this.textures[s].isArrayTexture=this.textures[s].image.depth>1);this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,i=t.textures.length;e<i;e++){this.textures[e]=t.textures[e].clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;let i=Object.assign({},t.textures[e].image);this.textures[e].source=new ia(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.multiview=t.multiview,this}dispose(){this.dispatchEvent({type:"dispose"})}constructor(t=1,e=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:tg,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 ic(0,0,t,e),this.scissorTest=!1,this.viewport=new ic(0,0,t,e),this.textures=[];let s=new iu({width:t,height:e,depth:i.depth}),r=i.count;for(let t=0;t<r;t++)this.textures[t]=s.clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;this._setTextureOptions(i),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples,this.multiview=i.multiview}}class ip extends id{constructor(t=1,e=1,i={}
1){super(t,e,i),this.isWebGLRenderTarget=!0}}class im extends iu{addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}constructor(t=null,e=1,i=1,s=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:i,depth:s},this.magFilter=tm,this.minFilter=tm,this.wrapR=td,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}}class iy extends iu{constructor(t=null,e=1,i=1,s=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:i,depth:s},this.magFilter=tm,this.minFilter=tm,this.wrapR=td,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ig{set(t,e,i,s,r,a,n,h,o,l,u,c,d,p,m,y){let f=this.elements;return f[0]=t,f[4]=e,f[8]=i,f[12]=s,f[1]=r,f[5]=a,f[9]=n,f[13]=h,f[2]=o,f[6]=l,f[10]=u,f[14]=c,f[3]=d,f[7]=p,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 ig().fromArray(this.elements)}copy(t){let e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){let e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){let e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,i){return 0===this.determinant()?(t.set(1,0,0),e.set(0,1,0),i.set(0,0,1)):(t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2)),this}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){if(0===t.determinant())return this.identity();let e=this.elements,i=t.elements,s=1/ix.setFromMatrixColumn(t,0).length(),r=1/ix.setFromMatrixColumn(t,1).length(),a=1/ix.setFromMatrixColumn(t,2).length();return e[0]=i[0]*s,e[1]=i[1]*s,e[2]=i[2]*s,e[3]=0,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[7]=0,e[8]=i[8]*a,e[9]=i[9]*a,e[10]=i[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){let e=this.elements,i=t.x,s=t.y,r=t.z,a=Math.cos(i),n=Math.sin(i),h=Math.cos(s),o=Math.sin(s),l=Math.cos(r),u=Math.sin(r);if("XYZ"===t.order){let t=a*l,i=a*u,s=n*l,r=n*u;e[0]=h*l,e[4]=-h*u,e[8]=o,e[1]=i+s*o,e[5]=t-r*o,e[9]=-n*h,e[2]=r-t*o,e[6]=s+i*o,e[10]=a*h}else if("YXZ"===t.order){let t=h*l,i=h*u,s=o*l,r=o*u;e[0]=t+r*n,e[4]=s*n-i,e[8]=a*o,e[1]=a*u,e[5]=a*l,e[9]=-n,e[2]=i*n-s,e[6]=r+t*n,e[10]=a*h}else if("ZXY"===t.order){let t=h*l,i=h*u,s=o*l,r=o*u;e[0]=t-r*n,e[4]=-a*u,e[8]=s+i*n,e[1]=i+s*n,e[5]=a*l,e[9]=r-t*n,e[2]=-a*o,e[6]=n,e[10]=a*h}else if("ZYX"===t.order){let t=a*l,i=a*u,s=n*l,r=n*u;e[0]=h*l,e[4]=s*o-i,e[8]=t*o+r,e[1]=h*u,e[5]=r*o+t,e[9]=i*o-s,e[2]=-o,e[6]=n*h,e[10]=a*h}else if("YZX"===t.order){let t=a*h,i=a*o,s=n*h,r=n*o;e[0]=h*l,e[4]=r-t*u,e[8]=s*u+i,e[1]=u,e[5]=a*l,e[9]=-n*l,e[2]=-o*l,e[6]=i*u+s,e[10]=t-r*u}else if("XZY"===t.order){let t=a*h,i=a*o,s=n*h,r=n*o;e[0]=h*l,e[4]=-u,e[8]=o*l,e[1]=t*u+r,e[5]=a*l,e[9]=i*u-s,e[2]=s*u-i,e[6]=n*l,e[10]=r*u+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(iv,t,iM)}lookAt(t,e,i){let s=this.elements;return i_.subVectors(t,e),0===i_.lengthSq()&&(i_.z=1),i_.normalize(),iw.crossVectors(i,i_),0===iw.lengthSq()&&(1===Math.abs(i.z)?i_.x+=1e-4:i_.z+=1e-4,i_.normalize(),iw.crossVectors(i,i_)),iw.normalize(),iS.crossVectors(i_,iw),s[0]=iw.x,s[4]=iS.x,s[8]=i_.x,s[1]=iw.y,s[5]=iS.y,s[9]=i_.y,s[2]=iw.z,s[6]=iS.z,s[10]=i_.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let i=t.elements,s=e.elements,r=this.elements,a=i[0],n=i[4],h=i[8],o=i[12],l=i[1],u=i[5],c=i[9],d=i[13],p=i[2],m=i[6],y=i[10],f=i[14],g=i[3],x=i[7],b=i[11],v=i[15],M=s[0],w=s[4],S=s[8],_=s[12],z=s[1],A=s[5],T=s[9],C=s[13],k=s[2],B=s[6],O=s[10],V=s[14],N=s[3],I=s[7],R=s[11],P=s[15];
1return r[0]=a*M+n*z+h*k+o*N,r[4]=a*w+n*A+h*B+o*I,r[8]=a*S+n*T+h*O+o*R,r[12]=a*_+n*C+h*V+o*P,r[1]=l*M+u*z+c*k+d*N,r[5]=l*w+u*A+c*B+d*I,r[9]=l*S+u*T+c*O+d*R,r[13]=l*_+u*C+c*V+d*P,r[2]=p*M+m*z+y*k+f*N,r[6]=p*w+m*A+y*B+f*I,r[10]=p*S+m*T+y*O+f*R,r[14]=p*_+m*C+y*V+f*P,r[3]=g*M+x*z+b*k+v*N,r[7]=g*w+x*A+b*B+v*I,r[11]=g*S+x*T+b*O+v*R,r[15]=g*_+x*C+b*V+v*P,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){let t=this.elements,e=t[0],i=t[4],s=t[8],r=t[12],a=t[1],n=t[5],h=t[9],o=t[13],l=t[2],u=t[6],c=t[10],d=t[14],p=t[3],m=t[7],y=t[11],f=t[15],g=h*d-o*c,x=n*d-o*u,b=n*c-h*u,v=a*d-o*l,M=a*c-h*l,w=a*u-n*l;return e*(m*g-y*x+f*b)-i*(p*g-y*v+f*M)+s*(p*x-m*v+f*w)-r*(p*b-m*M+y*w)}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(t,e,i){let s=this.elements;return t.isVector3?(s[12]=t.x,s[13]=t.y,s[14]=t.z):(s[12]=t,s[13]=e,s[14]=i),this}invert(){let t=this.elements,e=t[0],i=t[1],s=t[2],r=t[3],a=t[4],n=t[5],h=t[6],o=t[7],l=t[8],u=t[9],c=t[10],d=t[11],p=t[12],m=t[13],y=t[14],f=t[15],g=e*n-i*a,x=e*h-s*a,b=e*o-r*a,v=i*h-s*n,M=i*o-r*n,w=s*o-r*h,S=l*m-u*p,_=l*y-c*p,z=l*f-d*p,A=u*y-c*m,T=u*f-d*m,C=c*f-d*y,k=g*C-x*T+b*A+v*z-M*_+w*S;if(0===k)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let B=1/k;return t[0]=(n*C-h*T+o*A)*B,t[1]=(s*T-i*C-r*A)*B,t[2]=(m*w-y*M+f*v)*B,t[3]=(c*M-u*w-d*v)*B,t[4]=(h*z-a*C-o*_)*B,t[5]=(e*C-s*z+r*_)*B,t[6]=(y*b-p*w-f*x)*B,t[7]=(l*w-c*b+d*x)*B,t[8]=(a*T-n*z+o*S)*B,t[9]=(i*z-e*T-r*S)*B,t[10]=(p*M-m*b+f*g)*B,t[11]=(u*b-l*M-d*g)*B,t[12]=(n*_-a*A-h*S)*B,t[13]=(e*A-i*_+s*S)*B,t[14]=(m*x-p*v-y*g)*B,t[15]=(l*v-u*x+c*g)*B,this}scale(t){let e=this.elements,i=t.x,s=t.y,r=t.z;return e[0]*=i,e[4]*=s,e[8]*=r,e[1]*=i,e[5]*=s,e[9]*=r,e[2]*=i,e[6]*=s,e[10]*=r,e[3]*=i,e[7]*=s,e[11]*=r,this}getMaxScaleOnAxis(){let t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2];return Math.sqrt(Math.max(e,t[4]*t[4]+t[5]*t[5]+t[6]*t[6],t[8]*t[8]+t[9]*t[9]+t[10]*t[10]))}makeTranslation(t,e,i){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){let e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){let e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){let e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){let i=Math.cos(e),s=Math.sin(e),r=1-i,a=t.x,n=t.y,h=t.z,o=r*a,l=r*n;return this.set(o*a+i,o*n-s*h,o*h+s*n,0,o*n+s*h,l*n+i,l*h-s*a,0,o*h-s*n,l*h+s*a,r*h*h+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i,s,r,a){return this.set(1,i,r,0,t,1,a,0,e,s,1,0,0,0,0,1),this}compose(t,e,i){let s=this.elements,r=e._x,a=e._y,n=e._z,h=e._w,o=r+r,l=a+a,u=n+n,c=r*o,d=r*l,p=r*u,m=a*l,y=a*u,f=n*u,g=h*o,x=h*l,b=h*u,v=i.x,M=i.y,w=i.z;return s[0]=(1-(m+f))*v,s[1]=(d+b)*v,s[2]=(p-x)*v,s[3]=0,s[4]=(d-b)*M,s[5]=(1-(c+f))*M,s[6]=(y+g)*M,s[7]=0,s[8]=(p+x)*w,s[9]=(y-g)*w,s[10]=(1-(c+m))*w,s[11]=0,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=1,this}decompose(t,e,i){let s=this.elements;t.x=s[12],t.y=s[13],t.z=s[14];let r=this.determinant();if(0===r)return i.set(1,1,1),e.identity(),this;let a=ix.set(s[0],s[1],s[2]).length(),n=ix.set(s[4],s[5],s[6]).length(),h=ix.set(s[8],s[9],s[10]).length();r<0&&(a=-a),ib.copy(this);let o=1/a,l=1/n,u=1/h;return ib.elements[0]*=o,ib.elements[1]*=o,ib.elements[2]*=o,ib.elements[4]*=l,ib.elements[5]*=l,ib.elements[6]*=l,ib.elements[8]*=u,ib.elements[9]*=u,ib.elements[10]*=u,e.setFromRotationMatrix(ib),i.x=a,i.y=n,i.z=h,this}makePerspective(t,e,i,s,r,a){let n,h,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:eV,l=arguments.length>7&&void 0!==arguments[7]&&arguments[7],u=this.elements;if(l)n=r/(a-r),h=a*r/(a-r);else if(o===eV)n=-(a+r)/(a-r),h=-2*a*r/(a-r);else if(2001===o)n=-a/(a-r),h=-a*r/(a-r);else throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return u[0]=2*r/(e-t),u[4]=0,u[8]=(e+t)/(e-t),u[12]=0,u[1]=0,u[5]=2*r/(i-s),u[9]=(i+s)/(i-s),u[13]=0,u[2]=0,u[6]=0,u[10]=n,u[14]=h,u[3]=0,u[7]=0,u[11]=-1,u[15]=0,this}
1makeOrthographic(t,e,i,s,r,a){let n,h,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:eV,l=arguments.length>7&&void 0!==arguments[7]&&arguments[7],u=this.elements;if(l)n=1/(a-r),h=a/(a-r);else if(o===eV)n=-2/(a-r),h=-(a+r)/(a-r);else if(2001===o)n=-1/(a-r),h=-r/(a-r);else throw Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return u[0]=2/(e-t),u[4]=0,u[8]=0,u[12]=-(e+t)/(e-t),u[1]=0,u[5]=2/(i-s),u[9]=0,u[13]=-(i+s)/(i-s),u[2]=0,u[6]=0,u[10]=n,u[14]=h,u[3]=0,u[7]=0,u[11]=0,u[15]=1,this}equals(t){let e=this.elements,i=t.elements;for(let t=0;t<16;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,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}constructor(t,e,i,s,r,a,n,h,o,l,u,c,d,p,m,y){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,i,s,r,a,n,h,o,l,u,c,d,p,m,y)}}ig.prototype.isMatrix4=!0;let ix=new e3,ib=new ig,iv=new e3(0,0,0),iM=new e3(1,1,1),iw=new e3,iS=new e3,i_=new e3,iz=new ig,iA=new e2;class iT{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){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._order;return this._x=t,this._y=e,this._z=i,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order,i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],s=t.elements,r=s[0],a=s[4],n=s[8],h=s[1],o=s[5],l=s[9],u=s[2],c=s[6],d=s[10];switch(e){case"XYZ":this._y=Math.asin(eZ(n,-1,1)),.9999999>Math.abs(n)?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(c,o),this._z=0);break;case"YXZ":this._x=Math.asin(-eZ(l,-1,1)),.9999999>Math.abs(l)?(this._y=Math.atan2(n,d),this._z=Math.atan2(h,o)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(eZ(c,-1,1)),.9999999>Math.abs(c)?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-a,o)):(this._y=0,this._z=Math.atan2(h,r));break;case"ZYX":this._y=Math.asin(-eZ(u,-1,1)),.9999999>Math.abs(u)?(this._x=Math.atan2(c,d),this._z=Math.atan2(h,r)):(this._x=0,this._z=Math.atan2(-a,o));break;case"YZX":this._z=Math.asin(eZ(h,-1,1)),.9999999>Math.abs(h)?(this._x=Math.atan2(-l,o),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(n,d));break;case"XZY":this._z=Math.asin(-eZ(a,-1,1)),.9999999>Math.abs(a)?(this._x=Math.atan2(c,o),this._y=Math.atan2(n,r)):(this._x=Math.atan2(-l,d),this._y=0);break;default:eE("Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===i&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return iz.makeRotationFromQuaternion(t),this.setFromRotationMatrix(iz,e,i)}setFromVector3(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order;return this.set(t.x,t.y,t.z,e)}reorder(t){return iA.setFromEuler(this),this.setFromQuaternion(iA,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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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}
1constructor(t=0,e=0,i=0,s=iT.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=s}}iT.DEFAULT_ORDER="XYZ";class iC{set(t){this.mask=1<<t>>>0}enable(t){this.mask|=1<<t}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t}disable(t){this.mask&=~(1<<t)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!=0}isEnabled(t){return(this.mask&1<<t)!=0}constructor(){this.mask=1}}let ik=0,iB=new e3,iO=new e2,iV=new ig,iN=new e3,iI=new e3,iR=new e3,iP=new e2,iF=new e3(1,0,0),iE=new e3(0,1,0),iD=new e3(0,0,1),iL={type:"added"},iU={type:"removed"},iW={type:"childadded",child:null},ij={type:"childremoved",child:null};class iJ extends ej{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 iO.setFromAxisAngle(t,e),this.quaternion.multiply(iO),this}rotateOnWorldAxis(t,e){return iO.setFromAxisAngle(t,e),this.quaternion.premultiply(iO),this}rotateX(t){return this.rotateOnAxis(iF,t)}rotateY(t){return this.rotateOnAxis(iE,t)}rotateZ(t){return this.rotateOnAxis(iD,t)}translateOnAxis(t,e){return iB.copy(t).applyQuaternion(this.quaternion),this.position.add(iB.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(iF,t)}translateY(t){return this.translateOnAxis(iE,t)}translateZ(t){return this.translateOnAxis(iD,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(iV.copy(this.matrixWorld).invert())}lookAt(t,e,i){t.isVector3?iN.copy(t):iN.set(t,e,i);let s=this.parent;this.updateWorldMatrix(!0,!1),iI.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?iV.lookAt(iI,iN,this.up):iV.lookAt(iN,iI,this.up),this.quaternion.setFromRotationMatrix(iV),s&&(iV.extractRotation(s.matrixWorld),iO.setFromRotationMatrix(iV),this.quaternion.premultiply(iO.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?eD("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(iL),iW.child=t,this.dispatchEvent(iW),iW.child=null):eD("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(iU),ij.child=t,this.dispatchEvent(ij),ij.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),iV.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),iV.multiply(t.parent.matrixWorld)),t.applyMatrix4(iV),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(iL),iW.child=t,this.dispatchEvent(iW),iW.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let i=0,s=this.children.length;i<s;i++){let s=this.children[i].getObjectByProperty(t,e);if(void 0!==s)return s}}getObjectsByProperty(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];this[t]===e&&i.push(this);let s=this.children;for(let r=0,a=s.length;r<a;r++)s[r].getObjectsByProperty(t,e,i);return i}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(iI,t,iR),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(iI,iP,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);let e=this.children;for(let i=0,s=e.length;i<s;i++)e[i].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);let e=this.children;for(let i=0,s=e.length;i<s;i++)e[i].traverseVisible(t)}traverseAncestors(t){let e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);let t=this.pivot;if(null!==t){let e=t.x,i=t.y,s=t.z,r=this.matrix.elements;r[12]+=e-r[0]*e-r[4]*i-r[8]*s,r[13]+=i-r[1]*e-r[5]*i-r[9]*s,r[14]+=s-r[2]*e-r[6]*i-r[10]*s}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix
1):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);let e=this.children;for(let i=0,s=e.length;i<s;i++)e[i].updateMatrixWorld(t)}updateWorldMatrix(t,e){let i=this.parent;if(!0===t&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),!0===e){let t=this.children;for(let e=0,i=t.length;e<i;e++)t[e].updateWorldMatrix(!1,!0)}}toJSON(t){let e=void 0===t||"string"==typeof t,i={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});let s={};function r(e,i){return void 0===e[i.uuid]&&(e[i.uuid]=i.toJSON(t)),i.uuid}if(s.uuid=this.uuid,s.type=this.type,""!==this.name&&(s.name=this.name),!0===this.castShadow&&(s.castShadow=!0),!0===this.receiveShadow&&(s.receiveShadow=!0),!1===this.visible&&(s.visible=!1),!1===this.frustumCulled&&(s.frustumCulled=!1),0!==this.renderOrder&&(s.renderOrder=this.renderOrder),!1!==this.static&&(s.static=this.static),Object.keys(this.userData).length>0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),null!==this.pivot&&(s.pivot=this.pivot.toArray()),!1===this.matrixAutoUpdate&&(s.matrixAutoUpdate=!1),void 0!==this.morphTargetDictionary&&(s.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),void 0!==this.morphTargetInfluences&&(s.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.geometryInfo=this._geometryInfo.map(t=>({...t,boundingBox:t.boundingBox?t.boundingBox.toJSON():void 0,boundingSphere:t.boundingSphere?t.boundingSphere.toJSON():void 0})),s.instanceInfo=this._instanceInfo.map(t=>({...t})),s.availableInstanceIds=this._availableInstanceIds.slice(),s.availableGeometryIds=this._availableGeometryIds.slice(),s.nextIndexStart=this._nextIndexStart,s.nextVertexStart=this._nextVertexStart,s.geometryCount=this._geometryCount,s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.matricesTexture=this._matricesTexture.toJSON(t),s.indirectTexture=this._indirectTexture.toJSON(t),null!==this._colorsTexture&&(s.colorsTexture=this._colorsTexture.toJSON(t)),null!==this.boundingSphere&&(s.boundingSphere=this.boundingSphere.toJSON()),null!==this.boundingBox&&(s.boundingBox=this.boundingBox.toJSON())),this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(s.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(t.geometries,this.geometry);let e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){let i=e.shapes;if(Array.isArray(i))for(let e=0,s=i.length;e<s;e++){let s=i[e];r(t.shapes,s)}else r(t.shapes,i)}}if(this.isSkinnedMesh&&(s.bindMode=this.bindMode,s.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(t.skeletons,this.skeleton),s.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){let e=[];for(let i=0,s=this.material.length;i<s;i++)e.push(r(t.materials,this.material[i]));s.material=e}else s.material=r(t.materials,this.material);if(this.children.length>0){s.children=[];for(let e=0;e<this.children.length;e++)s.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){s.animations=[];for(let e=0;e<this.animations.length;e++){let i=this.animations[e];s.animations.push(r(t.animations,i))}}if(e){let e=a(t.geometries),s=a(t.materials),r=a(t.textures),n=a(t.images),h=a(t.shapes),o=a(t.skeletons),l=a(t.animations),u=a(t.nodes);e.length>0&&(i.geometries=e),s.length>0&&(i.materials=s),r.length>0&&(i.textures=r),n.length>0&&(i.images=n),h.length>0&&(i.shapes=h),o.length>0&&(i.skeletons=o),l.length>0&&(i.animations=l),u.length>0&&(i.nodes=u)}return i.object=s,i;function a(t){let e=[];for(let i in t){let s=t[i];delete s.metadata,e.push(s)}return e}}clone(t){return new this.constructor().copy(this,t)}copy(t){let e=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.pivot=null!==t.pivot?t.pivot.clone():null,this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.static=t.static,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){let i=t.children[e];this.add(i.clone())}return this}constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:ik++}),this.uuid=eH(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=iJ.DEFAULT_UP.clone();let t=new e3,e=new iT,i=new e2,s=new e3(1,1,1);e._onChange(function(){i.setFromEuler(e,!1)}),i._onChange(function(){e.setFromQuaternion(i,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:s},modelViewMatrix:{value:new ig},normalMatrix:{value:new e6}}),this.matrix=new ig,this.matrixWorld=new ig,this.matrixAutoUpdate=iJ.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=iJ.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new iC,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}}iJ.DEFAULT_UP=new e3(0,1,0),iJ.DEFAULT_MATRIX_AUTO_UPDATE=!0,iJ.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class iq extends iJ{constructor(){super(),this.isGroup=!0,this.type="Group"}}let iX={type:"move"};class iY{getHandSpace(){return null===this._hand&&(this._hand=new iq,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 iq,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new e3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new e3),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new iq,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new e3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new e3,this._grip.eventsEnabled=!1),this._grip}dispatchEvent(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){let e=this._hand;if(e)for(let i of t.hand.values())this._getHandJoint(e,i)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(t,e,i){let s=null,r=null,a=null,n=this._targetRay,h=this._grip,o=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState){if(o&&t.hand){for(let s of(a=!0,t.hand.values())
1){let t=e.getJointPose(s,i),r=this._getHandJoint(o,s);null!==t&&(r.matrix.fromArray(t.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.matrixWorldNeedsUpdate=!0,r.jointRadius=t.radius),r.visible=null!==t}let s=o.joints["index-finger-tip"],r=o.joints["thumb-tip"],n=s.position.distanceTo(r.position);o.inputState.pinching&&n>.025?(o.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!o.inputState.pinching&&n<=.015&&(o.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==h&&t.gripSpace&&null!==(r=e.getPose(t.gripSpace,i))&&(h.matrix.fromArray(r.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale),h.matrixWorldNeedsUpdate=!0,r.linearVelocity?(h.hasLinearVelocity=!0,h.linearVelocity.copy(r.linearVelocity)):h.hasLinearVelocity=!1,r.angularVelocity?(h.hasAngularVelocity=!0,h.angularVelocity.copy(r.angularVelocity)):h.hasAngularVelocity=!1,h.eventsEnabled&&h.dispatchEvent({type:"gripUpdated",data:t,target:this}));null!==n&&(null===(s=e.getPose(t.targetRaySpace,i))&&null!==r&&(s=r),null!==s&&(n.matrix.fromArray(s.transform.matrix),n.matrix.decompose(n.position,n.rotation,n.scale),n.matrixWorldNeedsUpdate=!0,s.linearVelocity?(n.hasLinearVelocity=!0,n.linearVelocity.copy(s.linearVelocity)):n.hasLinearVelocity=!1,s.angularVelocity?(n.hasAngularVelocity=!0,n.angularVelocity.copy(s.angularVelocity)):n.hasAngularVelocity=!1,this.dispatchEvent(iX)))}return null!==n&&(n.visible=null!==s),null!==h&&(h.visible=null!==r),null!==o&&(o.visible=null!==a),this}_getHandJoint(t,e){if(void 0===t.joints[e.jointName]){let i=new iq;i.matrixAutoUpdate=!1,i.visible=!1,t.joints[e.jointName]=i,t.add(i)}return t.joints[e.jointName]}constructor(){this._targetRay=null,this._grip=null,this._hand=null}}let iH={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32},iZ={h:0,s:0,l:0},iG={h:0,s:0,l:0};function iQ(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 iK{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,
1i),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ex;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){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:it.workingColorSpace;return this.r=t,this.g=e,this.b=i,it.colorSpaceToWorking(this,s),this}setHSL(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:it.workingColorSpace;if(t=eG(t,1),e=eZ(e,0,1),i=eZ(i,0,1),0===e)this.r=this.g=this.b=i;else{let s=i<=.5?i*(1+e):i+e-i*e,r=2*i-s;this.r=iQ(r,s,t+1/3),this.g=iQ(r,s,t),this.b=iQ(r,s,t-1/3)}return it.colorSpaceToWorking(this,s),this}setStyle(t){let e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ex;function s(e){void 0!==e&&1>parseFloat(e)&&eE("Color: Alpha component of "+t+" will be ignored.")}if(e=/^(\w+)\(([^\)]*)\)/.exec(t)){let r,a=e[1],n=e[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(n))return s(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,i);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(n))return s(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,i);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(n))return s(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,i);break;default:eE("Color: Unknown color model "+t)}}else if(e=/^\#([A-Fa-f\d]+)$/.exec(t)){let s=e[1],r=s.length;if(3===r)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,i);if(6===r)return this.setHex(parseInt(s,16),i);eE("Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,i);return this}setColorName(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ex,i=iH[t.toLowerCase()];return void 0!==i?this.setHex(i,e):eE("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=ie(t.r),this.g=ie(t.g),this.b=ie(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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ex;return it.workingToColorSpace(i$.copy(this),t),65536*Math.round(eZ(255*i$.r,0,255))+256*Math.round(eZ(255*i$.g,0,255))+Math.round(eZ(255*i$.b,0,255))}getHexString(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ex;return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t){let e,i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:it.workingColorSpace;it.workingToColorSpace(i$.copy(this),s);let r=i$.r,a=i$.g,n=i$.b,h=Math.max(r,a,n),o=Math.min(r,a,n),l=(o+h)/2;if(o===h)e=0,i=0;else{let t=h-o;switch(i=l<=.5?t/(h+o):t/(2-h-o),h){case r:e=(a-n)/t+6*(a<n);break;case a:e=(n-r)/t+2;break;case n:e=(r-a)/t+4}e/=6}return t.h=e,t.s=i,t.l=l,t}getRGB(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:it.workingColorSpace;return it.workingToColorSpace(i$.copy(this),e),t.r=i$.r,t.g=i$.g,t.b=i$.b,t}getStyle(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ex;it.workingToColorSpace(i$.copy(this),t);let e=i$.r,i=i$.g,s=i$.b;return t!==ex?"color(".concat(t," ").concat(e.toFixed(3)," ").concat(i.toFixed(3)," ").concat(s.toFixed(3),")"):"rgb(".concat(Math.round(255*e),",").concat(Math.round(255*i),",").concat(Math.round(255*s),")")}offsetHSL(t,e,i){return this.getHSL(iZ),this.setHSL(iZ.h+t,iZ.s+e,iZ.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(iZ),t.getHSL(iG);let i=eQ(iZ.h,iG.h,e),s=eQ(iZ.s,iG.s,e),r=eQ(iZ.l,iG.l,e);return this.setHSL(i,s,r),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){let e=this.r,i=this.g,s=this.b,r=t.elements;return this.r=r[0]*e+r[3]*i+r[6]*s,this.g=r[1]*e+r[4]*i+r[7]*s,this.b=r[2]*e+r[5]*i+r[8]*s,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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}constructor(t,e,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,i)}}let i$=new iK;
1iK.NAMES=iH;class i0 extends iJ{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}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 iT,this.environmentIntensity=1,this.environmentRotation=new iT,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}}let i1=new e3,i2=new e3,i3=new e3,i5=new e3,i4=new e3,i6=new e3,i9=new e3,i8=new e3,i7=new e3,st=new e3,se=new ic,si=new ic,ss=new ic;class sr{static getNormal(t,e,i,s){s.subVectors(i,e),i1.subVectors(t,e),s.cross(i1);let r=s.lengthSq();return r>0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(t,e,i,s,r){i1.subVectors(s,e),i2.subVectors(i,e),i3.subVectors(t,e);let a=i1.dot(i1),n=i1.dot(i2),h=i1.dot(i3),o=i2.dot(i2),l=i2.dot(i3),u=a*o-n*n;if(0===u)return r.set(0,0,0),null;
vendor: 6,156 bytes, line 1
1let c=1/u,d=(o*h-n*l)*c,p=(a*l-n*h)*c;return r.set(1-d-p,p,d)}static containsPoint(t,e,i,s){return null!==this.getBarycoord(t,e,i,s,i5)&&i5.x>=0&&i5.y>=0&&i5.x+i5.y<=1}static getInterpolation(t,e,i,s,r,a,n,h){return null===this.getBarycoord(t,e,i,s,i5)?(h.x=0,h.y=0,"z"in h&&(h.z=0),"w"in h&&(h.w=0),null):(h.setScalar(0),h.addScaledVector(r,i5.x),h.addScaledVector(a,i5.y),h.addScaledVector(n,i5.z),h)}static getInterpolatedAttribute(t,e,i,s,r,a){return se.setScalar(0),si.setScalar(0),ss.setScalar(0),se.fromBufferAttribute(t,e),si.fromBufferAttribute(t,i),ss.fromBufferAttribute(t,s),a.setScalar(0),a.addScaledVector(se,r.x),a.addScaledVector(si,r.y),a.addScaledVector(ss,r.z),a}static isFrontFacing(t,e,i,s){return i1.subVectors(i,e),i2.subVectors(t,e),0>i1.cross(i2).dot(s)}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,s){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[s]),this}setFromAttributeAndIndices(t,e,i,s){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,s),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return i1.subVectors(this.c,this.b),i2.subVectors(this.a,this.b),.5*i1.cross(i2).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return sr.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return sr.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,i,s,r){return sr.getInterpolation(t,this.a,this.b,this.c,e,i,s,r)}containsPoint(t){return sr.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return sr.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let i,s,r=this.a,a=this.b,n=this.c;i4.subVectors(a,r),i6.subVectors(n,r),i8.subVectors(t,r);let h=i4.dot(i8),o=i6.dot(i8);if(h<=0&&o<=0)return e.copy(r);i7.subVectors(t,a);let l=i4.dot(i7),u=i6.dot(i7);if(l>=0&&u<=l)return e.copy(a);let c=h*u-l*o;if(c<=0&&h>=0&&l<=0)return i=h/(h-l),e.copy(r).addScaledVector(i4,i);st.subVectors(t,n);let d=i4.dot(st),p=i6.dot(st);if(p>=0&&d<=p)return e.copy(n);let m=d*o-h*p;if(m<=0&&o>=0&&p<=0)return s=o/(o-p),e.copy(r).addScaledVector(i6,s);let y=l*p-d*u;if(y<=0&&u-l>=0&&d-p>=0)return i9.subVectors(n,a),s=(u-l)/(u-l+(d-p)),e.copy(a).addScaledVector(i9,s);let f=1/(y+m+c);return i=m*f,s=c*f,e.copy(r).addScaledVector(i4,i).addScaledVector(i6,s)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}constructor(t=new e3,e=new e3,i=new e3){this.a=t,this.b=e,this.c=i}}class sa{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(sh.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,i=t.count;e<i;e++)this.expandByPoint(sh.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=sh.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}setFromObject(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.updateWorldMatrix(!1,!1);let i=t.geometry;if(void 0!==i){let s=i.getAttribute("position");if(!0===e&&void 0!==s&&!0!==t.isInstancedMesh)for(let e=0,i=s.count;e<i;e++)!0===t.isMesh?t.getVertexPosition(e,sh):sh.fromBufferAttribute(s,e),sh.applyMatrix4(t.matrixWorld),this.expandByPoint(sh);else void 0!==t.boundingBox?(null===t.boundingBox&&t.computeBoundingBox(),so.copy(t.boundingBox)):(null===i.boundingBox&&i.computeBoundingBox(),so.copy(i.boundingBox)),so.applyMatrix4(t.matrixWorld),this.union(so)}let s=t.children;for(let t=0,i=s.length;t<i;t++)this.expandByObject(s[t],e);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,sh),sh.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(sy),sf.subVectors(this.max,sy),sl.subVectors(t.a,sy),su.subVectors(t.b,sy),sc.subVectors(t.c,sy),sd.subVectors(su,sl),sp.subVectors(sc,su),sm.subVectors(sl,sc);let e=[0,-sd.z,sd.y,0,-sp.z,sp.y,0,-sm.z,sm.y,sd.z,0,-sd.x,sp.z,0,-sp.x,sm.z,0,-sm.x,-sd.y,sd.x,0,-sp.y,sp.x,0,-sm.y,sm.x,0];
1return!!sb(e,sl,su,sc,sf)&&!!sb(e=[1,0,0,0,1,0,0,0,1],sl,su,sc,sf)&&(sg.crossVectors(sd,sp),sb(e=[sg.x,sg.y,sg.z],sl,su,sc,sf))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,sh).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(sh).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()||(sn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),sn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),sn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),sn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),sn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),sn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),sn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),sn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(sn)),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}constructor(t=new e3(Infinity,Infinity,Infinity),e=new e3(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}}let sn=[new e3,new e3,new e3,new e3,new e3,new e3,new e3,new e3],sh=new e3,so=new sa,sl=new e3,su=new e3,sc=new e3,sd=new e3,sp=new e3,sm=new e3,sy=new e3,sf=new e3,sg=new e3,sx=new e3;function sb(t,e,i,s,r){for(let a=0,n=t.length-3;a<=n;a+=3){sx.fromArray(t,a);let n=r.x*Math.abs(sx.x)+r.y*Math.abs(sx.y)+r.z*Math.abs(sx.z),h=e.dot(sx),o=i.dot(sx),l=s.dot(sx);if(Math.max(-Math.max(h,o,l),Math.min(h,o,l))>n)return!1}return!0}let sv=new e3,sM=new e1,sw=0;class sS extends ej{onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let s=0,r=this.itemSize;s<r;s++)this.array[t+s]=e.array[i+s];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,i=this.count;e<i;e++)sM.fromBufferAttribute(this,e),sM.applyMatrix3(t),this.setXY(e,sM.x,sM.y);else if(3===this.itemSize)for(let e=0,i=this.count;e<i;e++)sv.fromBufferAttribute(this,e),sv.applyMatrix3(t),this.setXYZ(e,sv.x,sv.y,sv.z);return this}applyMatrix4(t){for(let e=0,i=this.count;e<i;e++)sv.fromBufferAttribute(this,e),sv.applyMatrix4(t),this.setXYZ(e,sv.x,sv.y,sv.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)sv.fromBufferAttribute(this,e),sv.applyNormalMatrix(t),this.setXYZ(e,sv.x,sv.y,sv.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)sv.fromBufferAttribute(this,e),sv.transformDirection(t),this.setXYZ(e,sv.x,sv.y,sv.z);return this}set(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(t,e),this}getComponent(t,e){let i=this.array[t*this.itemSize+e];return this.normalized&&(i=eK(i,this.array)),i}setComponent(t,e,i){return this.normalized&&(i=e$(i,this.array)),this.array[t*this.itemSize+e]=i,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=eK(e,this.array)),e}setX(t,e){return this.normalized&&(e=e$(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=eK(e,this.array)),e}setY(t,e){return this.normalized&&(e=e$(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=eK(e,this.array)),e}setZ(t,e){return this.normalized&&(e=e$(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=eK(e,this.array)),e}setW(t,e){return this.normalized&&(e=e$(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,i){return t*=this.itemSize,this.normalized&&(e=e$(e,this.array),i=e$(i,this.array)),this.array[t+0]=e,this.array[t+1]=i,this}
1setXYZ(t,e,i,s){return t*=this.itemSize,this.normalized&&(e=e$(e,this.array),i=e$(i,this.array),s=e$(s,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=s,this}setXYZW(t,e,i,s,r){return t*=this.itemSize,this.normalized&&(e=e$(e,this.array),i=e$(i,this.array),s=e$(s,this.array),r=e$(r,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=s,this.array[t+3]=r,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),35044!==this.usage&&(t.usage=this.usage),t}dispose(){this.dispatchEvent({type:"dispose"})}constructor(t,e,i=!1){if(super(),Array.isArray(t))throw TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:sw++}),this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=i,this.usage=35044,this.updateRanges=[],this.gpuType=tA,this.version=0}}class s_ extends sS{constructor(t,e,i){super(new Uint16Array(t),e,i)}}class sz extends sS{constructor(t,e,i){super(new Uint32Array(t),e,i)}}class sA extends sS{constructor(t,e,i){super(new Float32Array(t),e,i)}}let sT=new sa,sC=new e3,sk=new e3;class sB{set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){let i=this.center;void 0!==e?i.copy(e):sT.setFromPoints(t).getCenter(i);let s=0;for(let e=0,r=t.length;e<r;e++)s=Math.max(s,i.distanceToSquared(t[e]));return this.radius=Math.sqrt(s),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){let e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){let i=this.center.distanceToSquared(t);return e.copy(t),i>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?t.makeEmpty():(t.set(this.center,this.center),t.expandByScalar(this.radius)),t}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;sC.subVectors(t,this.center);let e=sC.lengthSq();if(e>this.radius*this.radius){let t=Math.sqrt(e),i=(t-this.radius)*.5;this.center.addScaledVector(sC,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):(sk.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(sC.copy(t.center).add(sk)),this.expandByPoint(sC.copy(t.center).sub(sk)))),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}constructor(t=new e3,e=-1){this.isSphere=!0,this.center=t,this.radius=e}}let sO=0,sV=new ig,sN=new iJ,sI=new e3,sR=new sa,sP=new sa,sF=new e3;class sE extends ej{getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(!function(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}(t)?s_:sz)(t,1):this.index=t,this}setIndirect(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.indirect=t,this.indirectOffset=e,this}getIndirect(){return this.indirect}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return void 0!==this.attributes[t]}addGroup(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]: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;
1void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);let i=this.attributes.normal;if(void 0!==i){let e=new e6().getNormalMatrix(t);i.applyNormalMatrix(e),i.needsUpdate=!0}let s=this.attributes.tangent;return void 0!==s&&(s.transformDirection(t),s.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(t){return sV.makeRotationFromQuaternion(t),this.applyMatrix4(sV),this}rotateX(t){return sV.makeRotationX(t),this.applyMatrix4(sV),this}rotateY(t){return sV.makeRotationY(t),this.applyMatrix4(sV),this}rotateZ(t){return sV.makeRotationZ(t),this.applyMatrix4(sV),this}translate(t,e,i){return sV.makeTranslation(t,e,i),this.applyMatrix4(sV),this}scale(t,e,i){return sV.makeScale(t,e,i),this.applyMatrix4(sV),this}lookAt(t){return sN.lookAt(t),sN.updateMatrix(),this.applyMatrix4(sN.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(sI).negate(),this.translate(sI.x,sI.y,sI.z),this}setFromPoints(t){let e=this.getAttribute("position");if(void 0===e){let e=[];for(let i=0,s=t.length;i<s;i++){let s=t[i];e.push(s.x,s.y,s.z||0)}this.setAttribute("position",new sA(e,3))}else{let i=Math.min(t.length,e.count);for(let s=0;s<i;s++){let i=t[s];e.setXYZ(s,i.x,i.y,i.z||0)}t.length>e.count&&eE("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 sa);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){eD("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new e3(-1/0,-1/0,-1/0),new e3(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];sR.setFromBufferAttribute(i),this.morphTargetsRelative?(sF.addVectors(this.boundingBox.min,sR.min),this.boundingBox.expandByPoint(sF),sF.addVectors(this.boundingBox.max,sR.max),this.boundingBox.expandByPoint(sF)):(this.boundingBox.expandByPoint(sR.min),this.boundingBox.expandByPoint(sR.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&eD('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 sB);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){eD("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new e3,1/0);return}if(t){let i=this.boundingSphere.center;if(sR.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){let i=e[t];sP.setFromBufferAttribute(i),this.morphTargetsRelative?(sF.addVectors(sR.min,sP.min),sR.expandByPoint(sF),sF.addVectors(sR.max,sP.max),sR.expandByPoint(sF)):(sR.expandByPoint(sP.min),sR.expandByPoint(sP.max))}sR.getCenter(i);let s=0;for(let e=0,r=t.count;e<r;e++)sF.fromBufferAttribute(t,e),s=Math.max(s,i.distanceToSquared(sF));if(e)for(let r=0,a=e.length;r<a;r++){let a=e[r],n=this.morphTargetsRelative;for(let e=0,r=a.count;e<r;e++)sF.fromBufferAttribute(a,e),n&&(sI.fromBufferAttribute(t,e),sF.add(sI)),s=Math.max(s,i.distanceToSquared(sF))}this.boundingSphere.radius=Math.sqrt(s),isNaN(this.boundingSphere.radius)&&eD('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return void eD("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");let i=e.position,s=e.normal,r=e.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new sS(new Float32Array(4*i.count),4));let a=this.getAttribute("tangent"),n=[],h=[];for(let t=0;t<i.count;t++)n[t]=new e3,h[t]=new e3;
1let o=new e3,l=new e3,u=new e3,c=new e1,d=new e1,p=new e1,m=new e3,y=new e3,f=this.groups;0===f.length&&(f=[{start:0,count:t.count}]);for(let e=0,s=f.length;e<s;++e){let s=f[e],a=s.start,g=s.count;for(let e=a,s=a+g;e<s;e+=3)!function(t,e,s){o.fromBufferAttribute(i,t),l.fromBufferAttribute(i,e),u.fromBufferAttribute(i,s),c.fromBufferAttribute(r,t),d.fromBufferAttribute(r,e),p.fromBufferAttribute(r,s),l.sub(o),u.sub(o),d.sub(c),p.sub(c);let a=1/(d.x*p.y-p.x*d.y);isFinite(a)&&(m.copy(l).multiplyScalar(p.y).addScaledVector(u,-d.y).multiplyScalar(a),y.copy(u).multiplyScalar(d.x).addScaledVector(l,-p.x).multiplyScalar(a),n[t].add(m),n[e].add(m),n[s].add(m),h[t].add(y),h[e].add(y),h[s].add(y))}(t.getX(e+0),t.getX(e+1),t.getX(e+2))}let g=new e3,x=new e3,b=new e3,v=new e3;function M(t){b.fromBufferAttribute(s,t),v.copy(b);let e=n[t];g.copy(e),g.sub(b.multiplyScalar(b.dot(e))).normalize(),x.crossVectors(v,e);let i=x.dot(h[t]);a.setXYZW(t,g.x,g.y,g.z,i<0?-1:1)}for(let e=0,i=f.length;e<i;++e){let i=f[e],s=i.start,r=i.count;for(let e=s,i=s+r;e<i;e+=3)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 sS(new Float32Array(3*e.count),3),this.setAttribute("normal",i);else for(let t=0,e=i.count;t<e;t++)i.setXYZ(t,0,0,0);let s=new e3,r=new e3,a=new e3,n=new e3,h=new e3,o=new e3,l=new e3,u=new e3;if(t)for(let c=0,d=t.count;c<d;c+=3){let d=t.getX(c+0),p=t.getX(c+1),m=t.getX(c+2);s.fromBufferAttribute(e,d),r.fromBufferAttribute(e,p),a.fromBufferAttribute(e,m),l.subVectors(a,r),u.subVectors(s,r),l.cross(u),n.fromBufferAttribute(i,d),h.fromBufferAttribute(i,p),o.fromBufferAttribute(i,m),n.add(l),h.add(l),o.add(l),i.setXYZ(d,n.x,n.y,n.z),i.setXYZ(p,h.x,h.y,h.z),i.setXYZ(m,o.x,o.y,o.z)}else for(let t=0,n=e.count;t<n;t+=3)s.fromBufferAttribute(e,t+0),r.fromBufferAttribute(e,t+1),a.fromBufferAttribute(e,t+2),l.subVectors(a,r),u.subVectors(s,r),l.cross(u),i.setXYZ(t+0,l.x,l.y,l.z),i.setXYZ(t+1,l.x,l.y,l.z),i.setXYZ(t+2,l.x,l.y,l.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){let t=this.attributes.normal;for(let e=0,i=t.count;e<i;e++)sF.fromBufferAttribute(t,e),sF.normalize(),t.setXYZ(e,sF.x,sF.y,sF.z)}toNonIndexed(){function t(t,e){let i=t.array,s=t.itemSize,r=t.normalized,a=new i.constructor(e.length*s),n=0,h=0;for(let r=0,o=e.length;r<o;r++){n=t.isInterleavedBufferAttribute?e[r]*t.data.stride+t.offset:e[r]*s;for(let t=0;t<s;t++)a[h++]=i[n++]}return new sS(a,s,r)}if(null===this.index)return eE("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let e=new sE,i=this.index.array,s=this.attributes;for(let r in s){let a=t(s[r],i);e.setAttribute(r,a)}let r=this.morphAttributes;for(let s in r){let a=[],n=r[s];for(let e=0,s=n.length;e<s;e++){let s=t(n[e],i);a.push(s)}e.morphAttributes[s]=a}e.morphTargetsRelative=this.morphTargetsRelative;let a=this.groups;for(let t=0,i=a.length;t<i;t++){let i=a[t];e.addGroup(i.start,i.count,i.materialIndex)}return e}toJSON(){let t={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){let e=this.parameters;for(let i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};let e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});let i=this.attributes;for(let e in i){let s=i[e];t.data.attributes[e]=s.toJSON(t.data)}let s={},r=!1;for(let e in this.morphAttributes){let i=this.morphAttributes[e],a=[];for(let e=0,s=i.length;e<s;e++){let s=i[e];a.push(s.toJSON(t.data))}a.length>0&&(s[e]=a,r=!0)}r&&(t.data.morphAttributes=s,t.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));let n=this.boundingSphere;return null!==n&&(t.data.boundingSphere=n.toJSON()),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let e={};this.name=t.name;let i=t.index;null!==i&&this.setIndex(i.clone());let s=t.attributes;for(let t in s){let i=s[t];this.setAttribute(t,i.clone(e))}let r=t.morphAttributes;for(let t in r){let i=[],s=r[t];for(let t=0,r=s.length;t<r;t++)i.push(s[t].clone(e));this.morphAttributes[t]=i}this.morphTargetsRelative=t.morphTargetsRelative;let a=t.groups;for(let t=0,e=a.length;t<e;t++){let e=a[t];this.addGroup(e.start,e.count,e.materialIndex)}let n=t.boundingBox;
1null!==n&&(this.boundingBox=n.clone());let h=t.boundingSphere;return null!==h&&(this.boundingSphere=h.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:sO++}),this.uuid=eH(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}}class sD{onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,i){t*=this.stride,i*=e.stride;for(let s=0,r=this.stride;s<r;s++)this.array[t+s]=e.array[i+s];return this}set(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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=eH()),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=eH()),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}}constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=35044,this.updateRanges=[],this.version=0,this.uuid=eH()}}let sL=new e3;class sU{get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,i=this.data.count;e<i;e++)sL.fromBufferAttribute(this,e),sL.applyMatrix4(t),this.setXYZ(e,sL.x,sL.y,sL.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)sL.fromBufferAttribute(this,e),sL.applyNormalMatrix(t),this.setXYZ(e,sL.x,sL.y,sL.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)sL.fromBufferAttribute(this,e),sL.transformDirection(t),this.setXYZ(e,sL.x,sL.y,sL.z);return this}getComponent(t,e){let i=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(i=eK(i,this.array)),i}setComponent(t,e,i){return this.normalized&&(i=e$(i,this.array)),this.data.array[t*this.data.stride+this.offset+e]=i,this}setX(t,e){return this.normalized&&(e=e$(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=e$(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=e$(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=e$(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=eK(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=eK(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=eK(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=eK(e,this.array)),e}setXY(t,e,i){return t=t*this.data.stride+this.offset,this.normalized&&(e=e$(e,this.array),i=e$(i,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this}setXYZ(t,e,i,s){return t=t*this.data.stride+this.offset,this.normalized&&(e=e$(e,this.array),i=e$(i,this.array),s=e$(s,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=s,this}setXYZW(t,e,i,s,r){return t=t*this.data.stride+this.offset,this.normalized&&(e=e$(e,this.array),i=e$(i,this.array),s=e$(s,this.array),r=e$(r,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=s,this.data.array[t+3]=r,this}clone(t){if(void 0!==t)return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new sU(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized);{eP("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 sS(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};{eP("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}}}constructor(t,e,i,s=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=i,this.normalized=s}}let sW=0;class sj extends ej{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){eE("Material: parameter '".concat(e,"' has value of undefined."));continue}let s=this[e];if(void 0===s){eE("Material: '".concat(e,"' is not a property of THREE.").concat(this.t
vendor: 5,975 bytes, line 1
1ype,"."));continue}s&&s.isColor?s.set(i):s&&s.isVector3&&i&&i.isVector3?s.copy(i):this[e]=i}}toJSON(t){let e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});let i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};function s(t){let e=[];for(let i in t){let s=t[i];delete s.metadata,e.push(s)}return e}if(i.uuid=this.uuid,i.type=this.type,""!==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()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(t).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(t).uuid),void 0!==this.dispersion&&(i.dispersion=this.dispersion),void 0!==this.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!==f&&(i.blending=this.blending),this.side!==d&&(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!==B&&(i.blendSrc=this.blendSrc),this.blendDst!==O&&(i.blendDst=this.blendDst),this.blendEquation!==M&&(i.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(i.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&
1(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!==J&&(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),519!==this.stencilFunc&&(i.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(i.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(i.stencilFuncMask=this.stencilFuncMask),7680!==this.stencilFail&&(i.stencilFail=this.stencilFail),7680!==this.stencilZFail&&(i.stencilZFail=this.stencilZFail),7680!==this.stencilZPass&&(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),!1===this.allowOverride&&(i.allowOverride=!1),!0===this.wireframe&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=!0),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),!1===this.fog&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData),e){let e=s(t.textures),r=s(t.images);e.length>0&&(i.textures=e),r.length>0&&(i.images=r)}return i}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;let e=t.clippingPlanes,i=null;if(null!==e){let t=e.length;i=Array(t);for(let s=0;s!==t;++s)i[s]=e[s].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.allowOverride=t.allowOverride,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:sW++}),this.uuid=eH(),this.name="",this.type="Material",this.blending=f,this.side=d,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=B,this.blendDst=O,this.blendEquation=M,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new iK(0,0,0),this.blendAlpha=0,this.depthFunc=J,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}}class sJ extends sj{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}constructor(t){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new iK(0xffffff),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(t)}}let sq=new e3,sX=new e3,sY=new e3,sH=new e1,sZ=new e1,sG=new ig,sQ=new e3,sK=new e3,s$=new e3,s0=new e1,s1=new e1,s2=ne
1w e1;class s3 extends iJ{raycast(t,e){let i,s;null===t.camera&&eD('Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),sX.setFromMatrixScale(this.matrixWorld),sG.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),sY.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&sX.multiplyScalar(-sY.z);let r=this.material.rotation;0!==r&&(s=Math.cos(r),i=Math.sin(r));let a=this.center;s5(sQ.set(-.5,-.5,0),sY,a,sX,i,s),s5(sK.set(.5,-.5,0),sY,a,sX,i,s),s5(s$.set(.5,.5,0),sY,a,sX,i,s),s0.set(0,0),s1.set(1,0),s2.set(1,1);let n=t.ray.intersectTriangle(sQ,sK,s$,!1,sq);if(null===n&&(s5(sK.set(-.5,.5,0),sY,a,sX,i,s),s1.set(0,1),null===(n=t.ray.intersectTriangle(sQ,s$,sK,!1,sq))))return;let h=t.ray.origin.distanceTo(sq);h<t.near||h>t.far||e.push({distance:h,point:sq.clone(),uv:sr.getInterpolation(sq,sQ,sK,s$,s0,s1,s2,new e1),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}constructor(t=new sJ){if(super(),this.isSprite=!0,this.type="Sprite",void 0===r){r=new sE;let t=new sD(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);r.setIndex([0,1,2,0,2,3]),r.setAttribute("position",new sU(t,3,0,!1)),r.setAttribute("uv",new sU(t,2,3,!1))}this.geometry=r,this.material=t,this.center=new e1(.5,.5),this.count=1}}function s5(t,e,i,s,r,a){sH.subVectors(t,i).addScalar(.5).multiply(s),void 0!==r?(sZ.x=a*sH.x-r*sH.y,sZ.y=r*sH.x+a*sH.y):sZ.copy(sH),t.copy(e),t.x+=sZ.x,t.y+=sZ.y,t.applyMatrix4(sG)}let s4=new e3,s6=new e3,s9=new e3,s8=new e3,s7=new e3,rt=new e3,re=new e3;class ri{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,s4)),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=s4.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(s4.copy(this.origin).addScaledVector(this.direction,e),s4.distanceToSquared(t))}distanceSqToSegment(t,e,i,s){let r,a,n,h;s6.copy(t).add(e).multiplyScalar(.5),s9.copy(e).sub(t).normalize(),s8.copy(this.origin).sub(s6);let o=.5*t.distanceTo(e),l=-this.direction.dot(s9),u=s8.dot(this.direction),c=-s8.dot(s9),d=s8.lengthSq(),p=Math.abs(1-l*l);if(p>0)if(r=l*c-u,a=l*u-c,h=o*p,r>=0)if(a>=-h)if(a<=h){let t=1/p;r*=t,a*=t,n=r*(r+l*a+2*u)+a*(l*r+a+2*c)+d}else n=-(r=Math.max(0,-(l*(a=o)+u)))*r+a*(a+2*c)+d;else n=-(r=Math.max(0,-(l*(a=-o)+u)))*r+a*(a+2*c)+d;else a<=-h?(a=(r=Math.max(0,-(-l*o+u)))>0?-o:Math.min(Math.max(-o,-c),o),n=-r*r+a*(a+2*c)+d):a<=h?(r=0,n=(a=Math.min(Math.max(-o,-c),o))*(a+2*c)+d):(a=(r=Math.max(0,-(l*o+u)))>0?o:Math.min(Math.max(-o,-c),o),n=-r*r+a*(a+2*c)+d);else a=l>0?-o:o,n=-(r=Math.max(0,-(l*a+u)))*r+a*(a+2*c)+d;return i&&i.copy(this.origin).addScaledVector(this.direction,r),s&&s.copy(s6).addScaledVector(s9,a),n}intersectSphere(t,e){s4.subVectors(t.center,this.origin);let i=s4.dot(this.direction),s=s4.dot(s4)-i*i,r=t.radius*t.radius;if(s>r)return null;let a=Math.sqrt(r-s),n=i-a,h=i+a;return h<0?null:n<0?this.at(h,e):this.at(n,e)}intersectsSphere(t){return!(t.radius<0)&&this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){let e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;let i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){let i=this.distanceToPlane(t);return null===i?null:this.at(i,e)}intersectsPlane(t){let e=t.distanceToPoint(this.origin);return!!(0===e||t.normal.dot(this.direction)*e<0)}intersectBox(t,e){let i,s,r,a,n,h,o=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,c=this.origin;return(o>=0?(i=(t.min.x-c.x)*o,s=(t.max.x-c.x)*o):(i=(t.max.x-c.x)*o,s=(t.min.x-c.x)*o),l>=0?(r=(t.min.y-c.y)*l,a=(t.max.y-c.y)*l):(r=(t.max.y-c.y)*l,a=(t.min.y-c.y)*l),i>a||r>s||((r>i||isNaN(i))&&(i=r),(a<s||isNaN(s))&&(s=a),u>=0?(n=(t.min.z-c.z)*u,h=(t.max.z-c.z)*u):(n=(t.max.z-c.z)*u,h=(t.min.z-c.z)*u),i>h||n>s||((n>i||i!=i)&&(i=n),(h<s||s!=s)&&(s=h),s<0)))?null:this.at(i>=0?i:s,e)}
1intersectsBox(t){return null!==this.intersectBox(t,s4)}intersectTriangle(t,e,i,s,r){let a;s7.subVectors(e,t),rt.subVectors(i,t),re.crossVectors(s7,rt);let n=this.direction.dot(re);if(n>0){if(s)return null;a=1}else{if(!(n<0))return null;a=-1,n=-n}s8.subVectors(this.origin,t);let h=a*this.direction.dot(rt.crossVectors(s8,rt));if(h<0)return null;let o=a*this.direction.dot(s7.cross(s8));if(o<0||h+o>n)return null;let l=-a*s8.dot(re);return l<0?null:this.at(l/n,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}constructor(t=new e3,e=new e3(0,0,-1)){this.origin=t,this.direction=e}}class rs extends sj{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}constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new iK(0xffffff),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new iT,this.combine=Z,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}}let rr=new ig,ra=new ri,rn=new sB,rh=new e3,ro=new e3,rl=new e3,ru=new e3,rc=new e3,rd=new e3,rp=new e3,rm=new e3;class ry extends iJ{copy(t,e){return super.copy(t,e),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){let t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){let i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=i.length;t<e;t++){let e=i[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}getVertexPosition(t,e){let i=this.geometry,s=i.attributes.position,r=i.morphAttributes.position,a=i.morphTargetsRelative;e.fromBufferAttribute(s,t);let n=this.morphTargetInfluences;if(r&&n){rd.set(0,0,0);for(let i=0,s=r.length;i<s;i++){let s=n[i],h=r[i];0!==s&&(rc.fromBufferAttribute(h,t),a?rd.addScaledVector(rc,s):rd.addScaledVector(rc.sub(e),s))}e.add(rd)}return e}raycast(t,e){let i=this.geometry,s=this.material,r=this.matrixWorld;if(void 0!==s)null===i.boundingSphere&&i.computeBoundingSphere(),rn.copy(i.boundingSphere),rn.applyMatrix4(r),ra.copy(t.ray).recast(t.near),!1===rn.containsPoint(ra.origin)&&(null===ra.intersectSphere(rn,rh)||ra.origin.distanceToSquared(rh)>(t.far-t.near)**2)||(rr.copy(r).invert(),ra.copy(t.ray).applyMatrix4(rr),(null===i.boundingBox||!1!==ra.intersectsBox(i.boundingBox))&&this._computeIntersections(t,e,ra))}_computeIntersections(t,e,i){let s,r=this.geometry,a=this.material,n=r.index,h=r.attributes.position,o=r.attributes.uv,l=r.attributes.uv1,u=r.attributes.normal,c=r.groups,d=r.drawRange;if(null!==n)if(Array.isArray(a))for(let r=0,h=c.length;r<h;r++){let h=c[r],p=a[h.materialIndex],m=Math.max(h.start,d.start),y=Math.min(n.count,Math.min(h.start+h.count,d.start+d.count));for(let r=m;r<y;r+=3){let a=n.getX(r);(s=rf(this,p,t,i,o,l,u,a,n.getX(r+1),n.getX(r+2)))&&(s.faceIndex=Math.floor(r/3),s.face.materialIndex=h.materialIndex,e.push(s))}}else{let r=Math.max(0,d.start),h=Math.min(n.count,d.start+d.count);for(let c=r;c<h;c+=3){let r=n.getX(c);(s=rf(this,a,t,i,o,l,u,r,n.getX(c+1),n.getX(c+2)))&&(s.faceIndex=Math.floor(c/3),e.push(s))}}else if(void 0!==h)if(Array.isArray(a))for(let r=0,n=c.length;r<n;r++){let n=c[r],p=a[n.materialIndex],m=Math.max(n.start,d.start),y=Math.min(h.count,Math.min(n.start+n.count,d.start+d.count));for(let r=m;r<y;r+=3)(s=rf(this,p,t,i,o,l,u,r,r+1,r+2))&&(s.faceIndex=Math.floor(r/3),s.face.materialIndex=n.materialIndex,e.push(s))}else{let r=Math.max(0,d.start),n=Math.min(h.count,d.start+d.count);for(let h=r;h<n;h+=3)(s=rf(this,a,t,i,o,l,u,h,h+1,h+2))&&(s.faceIndex=Math.floor(h/3),e.push(s))}}constructor(t=new sE,e=new rs){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()}}function rf(t,e,i,s,r,a,n,h,o,l){t.getVertexPosition(h,ro),t.getVertexPosition(o,rl),t.getVertexPosition(l,ru);
1let u=function(t,e,i,s,r,a,n,h){if(null===(e.side===p?s.intersectTriangle(n,a,r,!0,h):s.intersectTriangle(r,a,n,e.side===d,h)))return null;rm.copy(h),rm.applyMatrix4(t.matrixWorld);let o=i.ray.origin.distanceTo(rm);return o<i.near||o>i.far?null:{distance:o,point:rm.clone(),object:t}}(t,e,i,s,ro,rl,ru,rp);if(u){let t=new e3;sr.getBarycoord(rp,ro,rl,ru,t),r&&(u.uv=sr.getInterpolatedAttribute(r,h,o,l,t,new e1)),a&&(u.uv1=sr.getInterpolatedAttribute(a,h,o,l,t,new e1)),n&&(u.normal=sr.getInterpolatedAttribute(n,h,o,l,t,new e3),u.normal.dot(s.direction)>0&&u.normal.multiplyScalar(-1));let e={a:h,b:o,c:l,normal:new e3,materialIndex:0};sr.getNormal(ro,rl,ru,e.normal),u.face=e,u.barycoord=t}return u}class rg extends iu{constructor(t=null,e=1,i=1,s,r,a,n,h,o=tm,l=tm,u,c){super(null,a,n,h,o,l,s,r,u,c),this.isDataTexture=!0,this.image={data:t,width:e,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class rx extends sS{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}constructor(t,e,i,s=1){super(t,e,i),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=s}}let rb=new ig,rv=new ig,rM=[],rw=new sa,rS=new ig,r_=new ry,rz=new sB;class rA extends ry{computeBoundingBox(){let t=this.geometry,e=this.count;null===this.boundingBox&&(this.boundingBox=new sa),null===t.boundingBox&&t.computeBoundingBox(),this.boundingBox.makeEmpty();for(let i=0;i<e;i++)this.getMatrixAt(i,rb),rw.copy(t.boundingBox).applyMatrix4(rb),this.boundingBox.union(rw)}computeBoundingSphere(){let t=this.geometry,e=this.count;null===this.boundingSphere&&(this.boundingSphere=new sB),null===t.boundingSphere&&t.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let i=0;i<e;i++)this.getMatrixAt(i,rb),rz.copy(t.boundingSphere).applyMatrix4(rb),this.boundingSphere.union(rz)}copy(t,e){return super.copy(t,e),this.instanceMatrix.copy(t.instanceMatrix),null!==t.previousInstanceMatrix&&(this.previousInstanceMatrix=t.previousInstanceMatrix.clone()),null!==t.morphTexture&&(this.morphTexture=t.morphTexture.clone()),null!==t.instanceColor&&(this.instanceColor=t.instanceColor.clone()),this.count=t.count,null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this}getColorAt(t,e){return null===this.instanceColor?e.setRGB(1,1,1):e.fromArray(this.instanceColor.array,3*t)}getMatrixAt(t,e){return e.fromArray(this.instanceMatrix.array,16*t)}getMorphAt(t,e){let i=e.morphTargetInfluences,s=this.morphTexture.source.data.data,r=t*(i.length+1)+1;for(let t=0;t<i.length;t++)i[t]=s[r+t]}raycast(t,e){let i=this.matrixWorld,s=this.count;if((r_.geometry=this.geometry,r_.material=this.material,void 0!==r_.material)&&(null===this.boundingSphere&&this.computeBoundingSphere(),rz.copy(this.boundingSphere),rz.applyMatrix4(i),!1!==t.ray.intersectsSphere(rz)))for(let r=0;r<s;r++){this.getMatrixAt(r,rb),rv.multiplyMatrices(i,rb),r_.matrixWorld=rv,r_.raycast(t,rM);for(let t=0,i=rM.length;t<i;t++){let i=rM[t];i.instanceId=r,i.object=this,e.push(i)}rM.length=0}}setColorAt(t,e){return null===this.instanceColor&&(this.instanceColor=new rx(new Float32Array(3*this.instanceMatrix.count).fill(1),3)),e.toArray(this.instanceColor.array,3*t),this}setMatrixAt(t,e){return e.toArray(this.instanceMatrix.array,16*t),this}setMorphAt(t,e){let i=e.morphTargetInfluences,s=i.length+1;null===this.morphTexture&&(this.morphTexture=new rg(new Float32Array(s*this.count),s,this.count,tE,tA));let r=this.morphTexture.source.data.data,a=0;for(let t=0;t<i.length;t++)a+=i[t];let n=this.geometry.morphTargetsRelative?1:1-a,h=s*t;return r[h]=n,r.set(i,h+1),this}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),null!==this.morphTexture&&(this.morphTexture.dispose(),this.morphTexture=null)}constructor(t,e,i){super(t,e),this.isInstancedMesh=!0,this.instanceMatrix=new rx(new Float32Array(16*i),16),this.previousInstanceMatrix=null,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,rS)}}let rT=new e3,rC=new e3,rk=new e6;class rB{set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,i,s){return this.normal.set(t,e,i),this.constant=s,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,i){let s=rT.subVectors(i,e).cross(rC.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(s,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){let t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],s=t.delta(rT),r=this.normal.dot(s);if(0===r)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;
1let a=-(t.start.dot(this.normal)+this.constant)/r;return!0===i&&(a<0||a>1)?null:e.copy(t.start).addScaledVector(s,a)}intersectsLine(t){let e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){let i=e||rk.getNormalMatrix(t),s=this.coplanarPoint(rT).applyMatrix4(t),r=this.normal.applyMatrix3(i).normalize();return this.constant=-s.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}constructor(t=new e3(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}}let rO=new sB,rV=new e1(.5,.5),rN=new e3;class rI{set(t,e,i,s,r,a){let n=this.planes;return n[0].copy(t),n[1].copy(e),n[2].copy(i),n[3].copy(s),n[4].copy(r),n[5].copy(a),this}copy(t){let e=this.planes;for(let i=0;i<6;i++)e[i].copy(t.planes[i]);return this}setFromProjectionMatrix(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eV,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=this.planes,r=t.elements,a=r[0],n=r[1],h=r[2],o=r[3],l=r[4],u=r[5],c=r[6],d=r[7],p=r[8],m=r[9],y=r[10],f=r[11],g=r[12],x=r[13],b=r[14],v=r[15];if(s[0].setComponents(o-a,d-l,f-p,v-g).normalize(),s[1].setComponents(o+a,d+l,f+p,v+g).normalize(),s[2].setComponents(o+n,d+u,f+m,v+x).normalize(),s[3].setComponents(o-n,d-u,f-m,v-x).normalize(),i)s[4].setComponents(h,c,y,b).normalize(),s[5].setComponents(o-h,d-c,f-y,v-b).normalize();else if(s[4].setComponents(o-h,d-c,f-y,v-b).normalize(),e===eV)s[5].setComponents(o+h,d+c,f+y,v+b).normalize();else if(2001===e)s[5].setComponents(h,c,y,b).normalize();else throw Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),rO.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{let e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),rO.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(rO)}intersectsSprite(t){return rO.center.set(0,0,0),rO.radius=.7071067811865476+rV.distanceTo(t.center),rO.applyMatrix4(t.matrixWorld),this.intersectsSphere(rO)}intersectsSphere(t){let e=this.planes,i=t.center,s=-t.radius;for(let t=0;t<6;t++)if(e[t].distanceToPoint(i)<s)return!1;return!0}intersectsBox(t){let e=this.planes;for(let i=0;i<6;i++){let s=e[i];if(rN.x=s.normal.x>0?t.max.x:t.min.x,rN.y=s.normal.y>0?t.max.y:t.min.y,rN.z=s.normal.z>0?t.max.z:t.min.z,0>s.distanceToPoint(rN))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)}constructor(t=new rB,e=new rB,i=new rB,s=new rB,r=new rB,a=new rB){this.planes=[t,e,i,s,r,a]}}class rR extends sj{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}constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new iK(0xffffff),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(t)}}let rP=new ig,rF=new ri,rE=new sB,rD=new e3;class rL extends iJ{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,s=this.matrixWorld,r=t.params.Points.threshold,a=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),rE.copy(i.boundingSphere),rE.applyMatrix4(s),rE.radius+=r,!1===t.ray.intersectsSphere(rE))return;rP.copy(s).invert(),rF.copy(t.ray).applyMatrix4(rP);let n=r/((this.scale.x+this.scale.y+this.scale.z)/3),h=n*n,o=i.index,l=i.attributes.position;if(null!==o){let i=Math.max(0,a.start),r=Math.min(o.count,a.start+a.count);for(let a=i;a<r;a++){let i=o.getX(a);rD.fromBufferAttribute(l,i),rU(rD,i,h,s,t,e,this)}}else{let i=Math.max(0,a.start),r=Math.min(l.count,a.start+a.count);for(let a=i;a<r;a++)rD.fromBufferAttribute(l,a),rU(rD,a,h,s,t,e,this)}}updateMorphTargets(){let t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){let i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=i.length;t<e;t++){let e=i[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}constructor(t=new sE,e=new rR){super(),this.isPoints=!0,this.type="Points",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}}function rU(t,e,i,s,r,a,n){let h=rF.distanceSqToPoint(t);if(h<i){let i=new e3;rF.closestPointToPoint(t,i),i.applyMatrix4(s);let o=r.ray.origin.distanceTo(i);if(o<r.near||o>r.far)return;a.push({distance:o,distanceToRay:Math.sqrt(h),point:i,index:e,face:null,faceIndex:null,barycoord:null,object:n})}}class rW extends iu{get images(){return this.image}set images(t){this.image=t}constructor(t=[],e=tn,i,s,r,a,n,h,o,l){super(t,e,i,s,r,a,n,h,o,l),this.isCubeTexture=!0,this.flipY=!1}}class rj extends iu{constructor(t,e,i,s,r,a,n,h,o){super(t,e,i,s,r,a,n,h,o),this.isCanvasTexture=!0,this.needsUpdate=!0}}class rJ extends iu{copy(t){return super.copy(t),this.source=new ia(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}constructor(t,e,i=tz,s,r,a,n=tm,h=tm,o,l=tP,u=1){if(l!==tP&&l!==tF)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super({width:t,height:e,depth:u},s,r,a,n,h,l,i,o),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}}class rq extends rJ{get images(){return this.image}set images(t){this.image=t}constructor(t,e=tz,i=tn,s,r,a=tm,n=tm,h,o=tP){let l={width:t,height:t,depth:1};super(t,t,e,i,s,r,a,n,h,o),this.image=[l,l,l,l,l,l],this.isCubeDepthTexture=!0,this.isCubeTexture=!0}}class rX extends iu{copy(t){return super.copy(t),this.sourceTexture=t.sourceTexture,this}constructor(t=null){super(),this.sourceTexture=t,this.isExternalTexture=!0}}class rY extends sE{copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new rY(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}constructor(t=1,e=1,i=1,s=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:s,heightSegments:r,depthSegments:a};let n=this;s=Math.floor(s),r=Math.floor(r);let h=[],o=[],l=[],u=[],c=0,d=0;
1function p(t,e,i,s,r,a,p,m,y,f,g){let x=a/y,b=p/f,v=a/2,M=p/2,w=m/2,S=y+1,_=f+1,z=0,A=0,T=new e3;for(let a=0;a<_;a++){let n=a*b-M;for(let h=0;h<S;h++){let c=h*x-v;T[t]=c*s,T[e]=n*r,T[i]=w,o.push(T.x,T.y,T.z),T[t]=0,T[e]=0,T[i]=m>0?1:-1,l.push(T.x,T.y,T.z),u.push(h/y),u.push(1-a/f),z+=1}}for(let t=0;t<f;t++)for(let e=0;e<y;e++){let i=c+e+S*t,s=c+e+S*(t+1),r=c+(e+1)+S*(t+1),a=c+(e+1)+S*t;h.push(i,s,a),h.push(s,r,a),A+=6}n.addGroup(d,A,g),d+=A,c+=z}p("z","y","x",-1,-1,i,e,t,a=Math.floor(a),r,0),p("z","y","x",1,-1,i,e,-t,a,r,1),p("x","z","y",1,1,t,i,e,s,a,2),p("x","z","y",1,-1,t,i,-e,s,a,3),p("x","y","z",1,-1,t,e,i,s,r,4),p("x","y","z",-1,-1,t,e,-i,s,r,5),this.setIndex(h),this.setAttribute("position",new sA(o,3)),this.setAttribute("normal",new sA(l,3)),this.setAttribute("uv",new sA(u,2))}}class rH{getPoint(){eE("Curve: .getPoint() not implemented.")}getPointAt(t,e){let i=this.getUtoTmapping(t);return this.getPoint(i,e)}getPoints(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e}getSpacedPoints(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.arcLengthDivisions;if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let e=[],i,s=this.getPoint(0),r=0;e.push(0);for(let a=1;a<=t;a++)e.push(r+=(i=this.getPoint(a/t)).distanceTo(s)),s=i;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t){let e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=this.getLengths(),r=0,a=s.length;e=i||t*s[a-1];let n=0,h=a-1,o;for(;n<=h;)if((o=s[r=Math.floor(n+(h-n)/2)]-e)<0)n=r+1;else if(o>0)h=r-1;else{h=r;break}if(s[r=h]===e)return r/(a-1);let l=s[r],u=s[r+1];return(r+(e-l)/(u-l))/(a-1)}getTangent(t,e){let i=t-1e-4,s=t+1e-4;i<0&&(i=0),s>1&&(s=1);let r=this.getPoint(i),a=this.getPoint(s),n=e||(r.isVector2?new e1:new e3);return n.copy(a).sub(r).normalize(),n}getTangentAt(t,e){let i=this.getUtoTmapping(t);return this.getTangent(i,e)}computeFrenetFrames(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=new e3,s=[],r=[],a=[],n=new e3,h=new ig;for(let e=0;e<=t;e++){let i=e/t;s[e]=this.getTangentAt(i,new e3)}r[0]=new e3,a[0]=new e3;let o=Number.MAX_VALUE,l=Math.abs(s[0].x),u=Math.abs(s[0].y),c=Math.abs(s[0].z);l<=o&&(o=l,i.set(1,0,0)),u<=o&&(o=u,i.set(0,1,0)),c<=o&&i.set(0,0,1),n.crossVectors(s[0],i).normalize(),r[0].crossVectors(s[0],n),a[0].crossVectors(s[0],r[0]);for(let e=1;e<=t;e++){if(r[e]=r[e-1].clone(),a[e]=a[e-1].clone(),n.crossVectors(s[e-1],s[e]),n.length()>Number.EPSILON){n.normalize();let t=Math.acos(eZ(s[e-1].dot(s[e]),-1,1));r[e].applyMatrix4(h.makeRotationAxis(n,t))}a[e].crossVectors(s[e],r[e])}if(!0===e){let e=Math.acos(eZ(r[0].dot(r[t]),-1,1));e/=t,s[0].dot(n.crossVectors(r[0],r[t]))>0&&(e=-e);for(let i=1;i<=t;i++)r[i].applyMatrix4(h.makeRotationAxis(s[i],e*i)),a[i].crossVectors(s[i],r[i])}return{tangents:s,normals:r,binormals:a}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){let t={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}}class rZ extends rH{getPoint(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new e1,i=2*Math.PI,s=this.aEndAngle-this.aStartAngle,r=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=i;for(;s>i;)s-=i;s<Number.EPSILON&&(s=r?0:i),!0!==this.aClockwise||r||(s===i?s=-i:s-=i);let a=this.aStartAngle+t*s,n=this.aX+this.xRadius*Math.cos(a),h=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){let t=Math.cos(this.aRotation),e=Math.sin(this.aRotation),i=n-this.aX,s=h-this.aY;n=i*t-s*e+this.aX,h=i*e+s*t+this.aY}return e.set(n,h)}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}constructor(t=0,e=0,i=1,s=1,r=0,a=2*Math.PI,n=!1,h=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=s,this.aStartAngle=r,this.aEndAngle=a,this.aClockwise=n,this.aRotation=h}}class rG extends rZ{constructor(t,e,i,s,r,a){super(t,e,i,i,s,r,a),this.isArcCurve=!0,this.type="ArcCurve"}}function rQ(){let t=0,e=0,i=0,s=0;function r(r,a,n,h){t=r,e=n,i=-3*r+3*a-2*n-h,s=2*r-2*a+n+h}
1return{initCatmullRom:function(t,e,i,s,a){r(e,i,a*(i-t),a*(s-e))},initNonuniformCatmullRom:function(t,e,i,s,a,n,h){let o=(e-t)/a-(i-t)/(a+n)+(i-e)/n,l=(i-e)/n-(s-e)/(n+h)+(s-i)/h;r(e,i,o*=n,l*=n)},calc:function(r){let a=r*r;return t+e*r+i*a+a*r*s}}}let rK=new e3,r$=new e3,r0=new rQ,r1=new rQ,r2=new rQ;class r3 extends rH{getPoint(t){let e,i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new e3,r=this.points,a=r.length,n=(a-!this.closed)*t,h=Math.floor(n),o=n-h;this.closed?h+=h>0?0:(Math.floor(Math.abs(h)/a)+1)*a:0===o&&h===a-1&&(h=a-2,o=1),this.closed||h>0?e=r[(h-1)%a]:(r$.subVectors(r[0],r[1]).add(r[0]),e=r$);let l=r[h%a],u=r[(h+1)%a];if(this.closed||h+2<a?i=r[(h+2)%a]:(rK.subVectors(r[a-1],r[a-2]).add(r[a-1]),i=rK),"centripetal"===this.curveType||"chordal"===this.curveType){let t="chordal"===this.curveType?.5:.25,s=Math.pow(e.distanceToSquared(l),t),r=Math.pow(l.distanceToSquared(u),t),a=Math.pow(u.distanceToSquared(i),t);r<1e-4&&(r=1),s<1e-4&&(s=r),a<1e-4&&(a=r),r0.initNonuniformCatmullRom(e.x,l.x,u.x,i.x,s,r,a),r1.initNonuniformCatmullRom(e.y,l.y,u.y,i.y,s,r,a),r2.initNonuniformCatmullRom(e.z,l.z,u.z,i.z,s,r,a)}else"catmullrom"===this.curveType&&(r0.initCatmullRom(e.x,l.x,u.x,i.x,this.tension),r1.initCatmullRom(e.y,l.y,u.y,i.y,this.tension),r2.initCatmullRom(e.z,l.z,u.z,i.z,this.tension));return s.set(r0.calc(o),r1.calc(o),r2.calc(o)),s}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 e3().fromArray(i))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}constructor(t=[],e=!1,i="centripetal",s=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=i,this.tension=s}}function r5(t,e,i,s,r){let a=(s-e)*.5,n=(r-i)*.5,h=t*t;return t*h*(2*i-2*s+a+n)+(-3*i+3*s-2*a-n)*h+a*t+i}function r4(t,e,i,s){return function(t,e){let i=1-t;return i*i*e}(t,e)+2*(1-t)*t*i+t*t*s}function r6(t,e,i,s,r){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*s+t*t*t*r}class r9 extends rH{getPoint(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new e1,i=this.v0,s=this.v1,r=this.v2,a=this.v3;return e.set(r6(t,i.x,s.x,r.x,a.x),r6(t,i.y,s.y,r.y,a.y)),e}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}constructor(t=new e1,e=new e1,i=new e1,s=new e1){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=i,this.v3=s}}class r8 extends rH{getPoint(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new e3,i=this.v0,s=this.v1,r=this.v2,a=this.v3;return e.set(r6(t,i.x,s.x,r.x,a.x),r6(t,i.y,s.y,r.y,a.y),r6(t,i.z,s.z,r.z,a.z)),e}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}constructor(t=new e3,e=new e3,i=new e3,s=new e3){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=i,this.v3=s}}class r7 extends rH{getPoint(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new e1;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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new e1;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}constructor(t=new e1,e=new e1){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=t,this.v2=e}}class at extends rH{getPoint(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new e3;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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new e3;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}constructor(t=new e3,e=new e3){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=t,this.v2=e}}class ae extends rH{getPoint(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new e1,i=this.v0,s=this.v1,r=this.v2;
1return e.set(r4(t,i.x,s.x,r.x),r4(t,i.y,s.y,r.y)),e}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}constructor(t=new e1,e=new e1,i=new e1){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=i}}class ai extends rH{getPoint(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new e3,i=this.v0,s=this.v1,r=this.v2;return e.set(r4(t,i.x,s.x,r.x),r4(t,i.y,s.y,r.y),r4(t,i.z,s.z,r.z)),e}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}constructor(t=new e3,e=new e3,i=new e3){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=i}}class as extends rH{getPoint(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new e1,i=this.points,s=(i.length-1)*t,r=Math.floor(s),a=s-r,n=i[0===r?r:r-1],h=i[r],o=i[r>i.length-2?i.length-1:r+1],l=i[r>i.length-3?i.length-1:r+2];return e.set(r5(a,n.x,h.x,o.x,l.x),r5(a,n.y,h.y,o.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 e1().fromArray(i))}return this}constructor(t=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=t}}class ar extends sE{copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new ar(t.width,t.height,t.widthSegments,t.heightSegments)}constructor(t=1,e=1,i=1,s=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:s};let r=t/2,a=e/2,n=Math.floor(i),h=Math.floor(s),o=n+1,l=h+1,u=t/n,c=e/h,d=[],p=[],m=[],y=[];for(let t=0;t<l;t++){let e=t*c-a;for(let i=0;i<o;i++){let s=i*u-r;p.push(s,-e,0),m.push(0,0,1),y.push(i/n),y.push(1-t/h)}}for(let t=0;t<h;t++)for(let e=0;e<n;e++){let i=e+o*t,s=e+o*(t+1),r=e+1+o*(t+1),a=e+1+o*t;d.push(i,s,a),d.push(s,r,a)}this.setIndex(d),this.setAttribute("position",new sA(p,3)),this.setAttribute("normal",new sA(m,3)),this.setAttribute("uv",new sA(y,2))}}class aa extends sE{copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new aa(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}constructor(t=1,e=32,i=16,s=0,r=2*Math.PI,a=0,n=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:i,phiStart:s,phiLength:r,thetaStart:a,thetaLength:n},e=Math.max(3,Math.floor(e)),i=Math.max(2,Math.floor(i));let h=Math.min(a+n,Math.PI),o=0,l=[],u=new e3,c=new e3,d=[],p=[],m=[],y=[];for(let d=0;d<=i;d++){let f=[],g=d/i,x=0;0===d&&0===a?x=.5/e:d===i&&h===Math.PI&&(x=-.5/e);for(let i=0;i<=e;i++){let h=i/e;u.x=-t*Math.cos(s+h*r)*Math.sin(a+g*n),u.y=t*Math.cos(a+g*n),u.z=t*Math.sin(s+h*r)*Math.sin(a+g*n),p.push(u.x,u.y,u.z),c.copy(u).normalize(),m.push(c.x,c.y,c.z),y.push(h+x,1-g),f.push(o++)}l.push(f)}for(let t=0;t<i;t++)for(let s=0;s<e;s++){let e=l[t][s+1],r=l[t][s],n=l[t+1][s],o=l[t+1][s+1];(0!==t||a>0)&&d.push(e,r,o),(t!==i-1||h<Math.PI)&&d.push(r,n,o)}this.setIndex(d),this.setAttribute("position",new sA(p,3)),this.setAttribute("normal",new sA(m,3)),this.setAttribute("uv",new sA(y,2))}}function an(t){let e={};for(let i in t)for(let s in e[i]={},t[i]){let r=t[i][s];if(ao(r))r.isRenderTargetTexture?(eE("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[i][s]=null):e[i][s]=r.clone();else if(Array.isArray(r))if(ao(r[0])){let t=[];for(let e=0,i=r.length;e<i;
1e++)t[e]=r[e].clone();e[i][s]=t}else e[i][s]=r.slice();else e[i][s]=r}return e}function ah(t){let e={};for(let i=0;i<t.length;i++){let s=an(t[i]);for(let t in s)e[t]=s[t]}return e}function ao(t){return t&&(t.isColor||t.isMatrix3||t.isMatrix4||t.isVector2||t.isVector3||t.isVector4||t.isTexture||t.isQuaternion)}function al(t){let e=t.getRenderTarget();return null===e?t.outputColorSpace:!0===e.isXRRenderTarget?e.texture.colorSpace:it.workingColorSpace}let au={clone:an,merge:ah};class ac extends sj{copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=an(t.uniforms),this.uniformsGroups=function(t){let e=[];for(let i=0;i<t.length;i++)e.push(t[i].clone());return e}(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this.defaultAttributeValues=Object.assign({},t.defaultAttributeValues),this.index0AttributeName=t.index0AttributeName,this.uniformsNeedUpdate=t.uniformsNeedUpdate,this}toJSON(t){let e=super.toJSON(t);for(let i in e.glslVersion=this.glslVersion,e.uniforms={},this.uniforms){let s=this.uniforms[i].value;s&&s.isTexture?e.uniforms[i]={type:"t",value:s.toJSON(t).uuid}:s&&s.isColor?e.uniforms[i]={type:"c",value:s.getHex()}:s&&s.isVector2?e.uniforms[i]={type:"v2",value:s.toArray()}:s&&s.isVector3?e.uniforms[i]={type:"v3",value:s.toArray()}:s&&s.isVector4?e.uniforms[i]={type:"v4",value:s.toArray()}:s&&s.isMatrix3?e.uniforms[i]={type:"m3",value:s.toArray()}:s&&s.isMatrix4?e.uniforms[i]={type:"m4",value:s.toArray()}:e.uniforms[i]={value:s}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;let i={};for(let t in this.extensions)!0===this.extensions[t]&&(i[t]=!0);return Object.keys(i).length>0&&(e.extensions=i),e}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)}}class ad extends ac{constructor(t){super(t),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class ap extends sj{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}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)}}class am extends sj{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}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)}}function ay(t,e){return t&&t.constructor!==e?"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t):t}class af{evaluate(t){let e=this.parameterPositions,i=this._cachedIndex,s=e[i],r=e[i-1];t:{e:{let a;i:{s:if(!(t<s)){for(let a=i+2;;){if(void 0===s){if(t<r)break s;return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===a)break;if(r=s,t<(s=e[++i]))break e}a=e.length;break i}if(!(t>=r)){let n=e[1];t<n&&(i=2,r=n);for(let a=i-2;;){if(void 0===r)return this._cachedIndex=0,this.copySampleValue_(0);if(i===a)break;if(s=r,t>=(r=e[--i-1]))break e}a=i,i=0;break i}break t}for(;i<a;){let s=i+a>>>1;t<e[s]?a=s:i=s+1}if(s=e[i],void 0===(r=e[i-1]))return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===s)return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,r,s)}return this.interpolate_(i,r,t,s)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,i=this.sampleValues,s=this.valueSize,r=t*s;for(let t=0;t!==s;++t)e[t]=i[r+t];return e}interpolate_(){throw Error("call to abstract method")}intervalChanged_(){}constructor(t,e,i,s){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==s?s:new e.constructor(i),this.sampleValues=e,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}}class ag extends af{intervalChanged_(t,e,i){let s=this.parameterPositions,r=t-2,a=t+1,n=s[r],h=s[a];if(void 0===n)switch(this.getSettings_().endingStart){case 2401:r=t,n=2*e-i;break;case 2402:r=s.length-2,n=e+s[r]-s[r+1];break;default:r=t,n=i}if(void 0===h)switch(this.getSettings_().endingEnd){case 2401:a=t,h=2*i-e;break;case 2402:a=1,h=i+s[1]-s[0];break;default:a=t-1,h=e}let o=(i-e)*.5,l=this.valueSize;this._weightPrev=o/(e-n),this._weightNext=o/(h-i),this._offsetPrev=r*l,this._offsetNext=a*l}interpolate_(t,e,i,s){let r=this.resultBuffer,a=this.sampleValues,n=this.valueSize,h=t*n,o=h-n,l=this._offsetPrev,u=this._offsetNext,c=this._weightPrev,d=this._weightNext,p=(i-e)/(s-e),m=p*p,y=m*p,f=-c*y+2*c*m-c*p,g=(1+c)*y+(-1.5-2*c)*m+(-.5+c)*p+1,x=(-1-d)*y+(1.5+d)*m+.5*p,b=d*y-d*m;for(let t=0;t!==n;++t)r[t]=f*a[l+t]+g*a[o+t]+x*a[h+t]+b*a[u+t];return r}constructor(t,e,i,s){super(t,e,i,s),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:2400,endingEnd:2400}}}class ax extends af{interpolate_(t,e,i,s){let r=this.resultBuffer,a=this.sampleValues,n=this.valueSize,h=t*n,o=h-n,l=(i-e)/(s-e),u=1-l;for(let t=0;t!==n;++t)r[t]=a[o+t]*u+a[h+t]*l;return r}constructor(t,e,i,s){super(t,e,i,s)}}class ab extends af{interpolate_(t){return this.copySampleValue_(t-1)}constructor(t,e,i,s){super(t,e,i,s)}}class av extends af{interpolate_(t,e,i,s){let r=this.resultBuffer,a=this.sampleValues,n=this.valueSize,h=t*n,o=h-n,l=this.settings||this.DefaultSettings_,u=l.inTangents,c=l.outTangents;if(!u||!c){let t=(i-e)/(s-e),l=1-t;for(let e=0;e!==n;++e)r[e]=a[o+e]*l+a[h+e]*t;return r}let d=2*n,p=t-1;for(let l=0;l!==n;
1++l){let n,m,y,f,g,x=a[o+l],b=a[h+l],v=p*d+2*l,M=c[v],w=c[v+1],S=t*d+2*l,_=u[S],z=u[S+1],A=(i-e)/(s-e);for(let t=0;t<8;t++){m=(n=A*A)*A;let t=(g=(f=(y=1-A)*y)*y)*e+3*f*A*M+3*y*n*_+m*s-i;if(1e-10>Math.abs(t))break;let r=3*f*(M-e)+6*y*A*(_-M)+3*n*(s-_);if(1e-10>Math.abs(r))break;A-=t/r,A=Math.max(0,Math.min(1,A))}r[l]=g*x+3*f*A*w+3*y*n*z+m*b}return r}}class aM{static toJSON(t){let e,i=t.constructor;if(i.toJSON!==this.toJSON)e=i.toJSON(t);else{e={name:t.name,times:ay(t.times,Array),values:ay(t.values,Array)};let i=t.getInterpolation();i!==t.DefaultInterpolation&&(e.interpolation=i)}return e.type=t.ValueTypeName,e}InterpolantFactoryMethodDiscrete(t){return new ab(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new ax(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new ag(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodBezier(t){let e=new av(this.times,this.values,this.getValueSize(),t);return this.settings&&(e.settings=this.settings),e}setInterpolation(t){let e;switch(t){case 2300:e=this.InterpolantFactoryMethodDiscrete;break;case 2301:e=this.InterpolantFactoryMethodLinear;break;case 2302:e=this.InterpolantFactoryMethodSmooth;break;case 2303:e=this.InterpolantFactoryMethodBezier}if(void 0===e){let e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw Error(e);return eE("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;case this.InterpolantFactoryMethodBezier:return 2303}}getValueSize(){return this.values.length/this.times.length}shift(t){if(0!==t){let e=this.times;for(let i=0,s=e.length;i!==s;++i)e[i]+=t}return this}scale(t){if(1!==t){let e=this.times;for(let i=0,s=e.length;i!==s;++i)e[i]*=t}return this}trim(t,e){let i=this.times,s=i.length,r=0,a=s-1;for(;r!==s&&i[r]<t;)++r;for(;-1!==a&&i[a]>e;)--a;if(++a,0!==r||a!==s){r>=a&&(r=(a=Math.max(a,1))-1);let t=this.getValueSize();this.times=i.slice(r,a),this.values=this.values.slice(r*t,a*t)}return this}validate(){var t;let e=!0,i=this.getValueSize();i-Math.floor(i)!=0&&(eD("KeyframeTrack: Invalid value size in track.",this),e=!1);let s=this.times,r=this.values,a=s.length;0===a&&(eD("KeyframeTrack: Track is empty.",this),e=!1);let n=null;for(let t=0;t!==a;t++){let i=s[t];if("number"==typeof i&&isNaN(i)){eD("KeyframeTrack: Time is not a valid number.",this,t,i),e=!1;break}if(null!==n&&n>i){eD("KeyframeTrack: Out of order keys.",this,t,i,n),e=!1;break}n=i}if(void 0!==r&&ArrayBuffer.isView(t=r)&&!(t instanceof DataView))for(let t=0,i=r.length;t!==i;++t){let i=r[t];if(isNaN(i)){eD("KeyframeTrack: Value is not a valid number.",this,t,i),e=!1;break}}return e}optimize(){let t=this.times.slice(),e=this.values.slice(),i=this.getValueSize(),s=2302===this.getInterpolation(),r=t.length-1,a=1;for(let n=1;n<r;++n){let r=!1,h=t[n];if(h!==t[n+1]&&(1!==n||h!==t[0]))if(s)r=!0;else{let t=n*i,s=t-i,a=t+i;for(let n=0;n!==i;++n){let i=e[t+n];if(i!==e[s+n]||i!==e[a+n]){r=!0;break}}}if(r){if(n!==a){t[a]=t[n];let s=n*i,r=a*i;for(let t=0;t!==i;++t)e[r+t]=e[s+t]}++a}}if(r>0){t[a]=t[r];for(let t=r*i,s=a*i,n=0;n!==i;++n)e[s+n]=e[t+n];++a}return a!==t.length?(this.times=t.slice(0,a),this.values=e.slice(0,a*i)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),i=new this.constructor(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}constructor(t,e,i,s){if(void 0===t)throw Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=ay(e,this.TimeBufferType),this.values=ay(i,this.ValueBufferType),this.setInterpolation(s||this.DefaultInterpolation)}}aM.prototype.ValueTypeName="",aM.prototype.TimeBufferType=Float32Array,aM.prototype.ValueBufferType=Float32Array,aM.prototype.DefaultInterpolation=2301;class aw extends aM{constructor(t,e,i){super(t,e,i)}}aw.prototype.ValueTypeName="bool",aw.prototype.ValueBufferType=Array,aw.prototype.DefaultInterpolation=2300,aw.prototype.InterpolantFactoryMethodLinear=void 0,aw.prototype.InterpolantFactoryMethodSmooth=void 0;class aS extends aM{constructor(t,e,i,s){super(t,e,i,s)}}aS.prototype.ValueTypeName="color";class a_ extends aM{constructor(t,e,i,s){super(t,e,i,s)}}a_.prototype.ValueTypeName="number";class az extends af{interpolate_(t,e,i,s){let r=this.resultBuffer,a=this.sampleValues,n=this.valueSize,h=(i-e)/(s-e),o=t*n;for(let t=o+n;o!==t;o+=4)e2.slerpFlat(r,0,a,o-n,a,o,h);return r}constructor(t,e,i,s){super(t,e,i,s)}}class aA extends aM{InterpolantFactoryMethodLinear(t){return new az(this.times,this.values,this.getValueSize(),t)}constructor(t,e,i,s){super(t,e,i,s)}}aA.prototype.ValueTypeName="quaternion",aA.prototype.InterpolantFactoryMethodSmooth=void 0;class aT extends aM{constructor(t,e,i){super(t,e,i)}}aT.prototype.ValueTypeName="string",aT.prototype.ValueBufferType=Array,aT.prototype.DefaultInterpolation=2300,aT.prototype.InterpolantFactoryMethodLinear=void 0,aT.prototype.InterpolantFactoryMethodSmooth=void 0;class aC extends aM{constructor(t,e,i,s){super(t,e,i,s)}}aC.prototype.ValueTypeName="vector";class ak{get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}constructor(t,e,i){let s,r=this,a=!1,n=0,h=0,o=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this._abortController=null,this.itemStart=function(t){h++,!1===a&&void 0!==r.onStart&&r.onStart(t,n,h),a=!0},this.itemEnd=function(t){n++,void 0!==r.onProgress&&r.onProgress(t,n,h),n===h&&(a=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(t){void 0!==r.onError&&r.onError(t)},this.resolveURL=function(t){return s?s(t):t},this.setURLModifier=function(t){return s=t,this},this.addHandler=function(t,e){return o.push(t,e),this},this.removeHandler=function(t){let e=o.indexOf(t);return -1!==e&&o.splice(e,2),this},this.getHandler=function(t){for(let e=0,i=o.length;e<i;e+=2){let i=o[e],s=o[e+1];if(i.global&&(i.lastIndex=0),i.test(t))return s}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}}let aB=new ak;class aO{load(){}loadAsync(t,e){let i=this;return new Promise(function(s,r){i.load(t,s,e,r)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}abort(){return this}constructor(t){this.manager=void 0!==t?t:aB,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}}aO.DEFAULT_MATERIAL_NAME="__DEFAULT",new WeakMap;let aV=new e3,aN=new e2,aI=new e3;class aR extends iJ{get reversedDepth(){return this._reversedDepth}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorld.decompose(aV,aN,aI),1===aI.x&&
11===aI.y&&1===aI.z?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(aV,aN,aI.set(1,1,1)).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorld.decompose(aV,aN,aI),1===aI.x&&1===aI.y&&1===aI.z?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(aV,aN,aI.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ig,this.projectionMatrix=new ig,this.projectionMatrixInverse=new ig,this.coordinateSystem=eV,this._reversedDepth=!1}}let aP=new e3,aF=new e1,aE=new e1;class aD extends aR{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*eY*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){let t=Math.tan(.5*eX*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*eY*Math.atan(Math.tan(.5*eX*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}
vendor: 4,912 bytes, line 1
1getViewBounds(t,e,i){aP.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(aP.x,aP.y).multiplyScalar(-t/aP.z),aP.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(aP.x,aP.y).multiplyScalar(-t/aP.z)}getViewSize(t,e){return this.getViewBounds(t,aF,aE),e.subVectors(aE,aF)}setViewOffset(t,e,i,s,r,a){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=s,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=this.near,e=t*Math.tan(.5*eX*this.fov)/this.zoom,i=2*e,s=this.aspect*i,r=-.5*s,a=this.view;if(null!==this.view&&this.view.enabled){let t=a.fullWidth,n=a.fullHeight;r+=a.offsetX*s/t,e-=a.offsetY*i/n,s*=a.width/t,i*=a.height/n}let n=this.filmOffset;0!==n&&(r+=t*n/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,e,e-i,t,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}constructor(t=50,e=1,i=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=i,this.far=s,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}}class aL extends aR{copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,i,s,r,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=s,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,s=(this.top+this.bottom)/2,r=i-t,a=i+t,n=s+e,h=s-e;if(null!==this.view&&this.view.enabled){let t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX,a=r+t*this.view.width,n-=e*this.view.offsetY,h=n-e*this.view.height}this.projectionMatrix.makeOrthographic(r,a,n,h,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}constructor(t=-1,e=1,i=1,s=-1,r=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=i,this.bottom=s,this.near=r,this.far=a,this.updateProjectionMatrix()}}new WeakMap;class aU extends iJ{updateCoordinateSystem(){let t=this.coordinateSystem,e=this.children.concat(),[i,s,r,a,n,h]=e;for(let t of e)this.remove(t);if(t===eV)i.up.set(0,1,0),i.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),n.up.set(0,1,0),n.lookAt(0,0,1),h.up.set(0,1,0),h.lookAt(0,0,-1);else if(2001===t)i.up.set(0,-1,0),i.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),n.up.set(0,-1,0),n.lookAt(0,0,1),h.up.set(0,-1,0),h.lookAt(0,0,-1);else throw Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(let t of e)this.add(t),t.updateMatrixWorld()}update(t,e){null===this.parent&&this.updateMatrixWorld();let{renderTarget:i,activeMipmapLevel:s}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());let[r,a,n,h,o,l]=this.children,u=t.getRenderTarget(),c=t.getActiveCubeFace(),d=t.getActiveMipmapLevel(),p=t.xr.enabled;t.xr.enabled=!1;let m=i.texture.generateMipmaps;i.texture.generateMipmaps=!1;let y=!1;y=!0===t.isWebGLRenderer?t.state.buffers.depth.getReversed():t.reversedDepthBuffer,t.setRenderTarget(i,0,s),y&&!1===t.autoClear&&t.clearDepth(),t.render(e,r),t.setRenderTarget(i,1,s),y&&!1===t.autoClear&&t.clearDepth(),t.render(e,a),t.setRenderTarget(i,2,s),y&&
1!1===t.autoClear&&t.clearDepth(),t.render(e,n),t.setRenderTarget(i,3,s),y&&!1===t.autoClear&&t.clearDepth(),t.render(e,h),t.setRenderTarget(i,4,s),y&&!1===t.autoClear&&t.clearDepth(),t.render(e,o),i.texture.generateMipmaps=m,t.setRenderTarget(i,5,s),y&&!1===t.autoClear&&t.clearDepth(),t.render(e,l),t.setRenderTarget(u,c,d),t.xr.enabled=p,i.texture.needsPMREMUpdate=!0}constructor(t,e,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;let s=new aD(-90,1,t,e);s.layers=this.layers,this.add(s);let r=new aD(-90,1,t,e);r.layers=this.layers,this.add(r);let a=new aD(-90,1,t,e);a.layers=this.layers,this.add(a);let n=new aD(-90,1,t,e);n.layers=this.layers,this.add(n);let h=new aD(-90,1,t,e);h.layers=this.layers,this.add(h);let o=new aD(-90,1,t,e);o.layers=this.layers,this.add(o)}}class aW extends aD{constructor(t=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=t}}let aj="\\[\\]\\.:\\/",aJ=RegExp("["+aj+"]","g"),aq="[^"+aj+"]",aX="[^"+aj.replace("\\.","")+"]",aY=/((?:WC+[\/:])*)/.source.replace("WC",aq),aH=/(WCOD+)?/.source.replace("WCOD",aX),aZ=RegExp("^"+aY+aH+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",aq)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",aq)+"$"),aG=["material","materials","bones","map"];class aQ{getValue(t,e){this.bind();let i=this._targetGroup.nCachedObjects_,s=this._bindings[i];void 0!==s&&s.getValue(t,e)}setValue(t,e){let i=this._bindings;for(let s=this._targetGroup.nCachedObjects_,r=i.length;s!==r;++s)i[s].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}constructor(t,e,i){let s=i||aK.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,s)}}class aK{static create(t,e,i){return t&&t.isAnimationObjectGroup?new aK.Composite(t,e,i):new aK(t,e,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(aJ,"")}static parseTrackName(t){let e=aZ.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]},s=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==s&&-1!==s){let t=i.nodeName.substring(s+1);-1!==aG.indexOf(t)&&(i.nodeName=i.nodeName.substring(0,s),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);if(void 0!==i)return i}if(t.children){let i=function(t){for(let s=0;s<t.length;s++){let r=t[s];if(r.name===e||r.uuid===e)return r;let a=i(r.children);if(a)return a}return null},s=i(t.children);if(s)return s}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){let i=this.resolvedProperty;for(let s=0,r=i.length;s!==r;++s)t[e++]=i[s]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){let i=this.resolvedProperty;for(let s=0,r=i.length;s!==r;++s)i[s]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let i=this.resolvedProperty;for(let s=0,r=i.length;s!==r;++s)i[s]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let i=this.resolvedProperty;for(let s=0,r=i.length;s!==r;++s)i[s]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}
vendor: 6,696 bytes, line 1
1_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node,e=this.parsedPath,i=e.objectName,s=e.propertyName,r=e.propertyIndex;if(t||(t=aK.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void eE("PropertyBinding: No target node found for track: "+this.path+".");if(i){let s=e.objectIndex;switch(i){case"materials":if(!t.material)return void eD("PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void eD("PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void eD("PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(let e=0;e<t.length;e++)if(t[e].name===s){s=e;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material)return void eD("PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.map)return void eD("PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);t=t.material.map;break;default:if(void 0===t[i])return void eD("PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[i]}if(void 0!==s){if(void 0===t[s])return void eD("PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[s]}}let a=t[s];if(void 0===a)return void eD("PropertyBinding: Trying to update property for track: "+e.nodeName+"."+s+" but it wasn't found.",t);let n=this.Versioning.None;this.targetObject=t,!0===t.isMaterial?n=this.Versioning.NeedsUpdate:!0===t.isObject3D&&(n=this.Versioning.MatrixWorldNeedsUpdate);let h=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===s){if(!t.geometry)return void eD("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.morphAttributes)return void eD("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[r]&&(r=t.morphTargetDictionary[r])}h=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=r}else void 0!==a.fromArray&&void 0!==a.toArray?(h=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(h=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=s;this.getValue=this.GetterByBindingType[h],this.setValue=this.SetterByBindingTypeAndVersioning[h][n]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}constructor(t,e,i){this.path=e,this.parsedPath=i||aK.parseTrackName(e),this.node=aK.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}aK.Composite=aQ,aK.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},aK.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},aK.prototype.GetterByBindingType=[aK.prototype._getValue_direct,aK.prototype._getValue_array,aK.prototype._getValue_arrayElement,aK.prototype._getValue_toArray],aK.prototype.SetterByBindingTypeAndVersioning=[[aK.prototype._setValue_direct,aK.prototype._setValue_direct_setNeedsUpdate,aK.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[aK.prototype._setValue_array,aK.prototype._setValue_array_setNeedsUpdate,aK.prototype._setValue_array_setMatrixWorldNeedsUpdate],[aK.prototype._setValue_arrayElement,aK.prototype._setValue_arrayElement_setNeedsUpdate,aK.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[aK.prototype._setValue_fromArray,aK.prototype._setValue_fromArray_setNeedsUpdate,aK.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]],new Float32Array(1);class a${identity(){return this.set(1,0,0,1),this}fromArray(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let i=0;i<4;i++)this.elements[i]=t[i+e];return this}set(t,e,i,s){let r=this.elements;return r[0]=t,r[2]=e,r[1]=i,r[3]=s,this}constructor(t,e,i,s){this.elements=[1,0,0,1],void 0!==t&&this.set(t,e,i,s)}}function a0(t,e,i,s){let r=function(t){switch(t){case tv:case tM:return{byteLength:1,components:1};case tS:case tw:case tT:return{byteLength:2,components:1};case tC:case tk:return{byteLength:2,components:4};case tz:case t_:case tA:return{byteLength:4,components:1};case tO:case tV:return{byteLength:4,components:3}}throw Error("Unknown texture type ".concat(t,"."))}(s);switch(i){case tN:return t*e;case tE:case tD:return t*e/r.components*r.byteLength;case tL:case tU:return t*e*2/r.components*r.byteLength;case tI:return t*e*3/r.components*r.byteLength;case tR:case tW:return t*e*4/r.components*r.byteLength;case tj:case tJ:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case tq:case tX:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case tH:case tG:return Math.max(t,16)*Math.max(e,8)/4;case tY:case tZ:return Math.max(t,8)*Math.max(e,8)/2;case tQ:case tK:case t0:case t1:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case t$:case t2:case t3:case t5:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case t4:return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16;case t6: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 t8:return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16;case t7:return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16;case et:return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16;case ee:return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16;case ei:return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16;case es:return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16;case er:return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16;case ea:return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16;case en:return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16;case eh:return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16;case eo:case el:case eu:return Math.ceil(t/4)*Math.ceil(e/4)*16;case ec:case ed:return Math.ceil(t/4)*Math.ceil(e/4)*8;case ep:case em:return Math.ceil(t/4)*Math.ceil(e/4)*16}throw Error("Unable to determine texture byte length for ".concat(i," format."))}a$.prototype.isMatrix2=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:a}})),"undefined"!=typeof window&&(window.__THREE__?eE("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=a)}}]);
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.