From ce8d6b12e4f2467b507070bd3d95937469d2aae6 Mon Sep 17 00:00:00 2001 From: Cody Brooks Date: Mon, 16 Oct 2023 17:32:00 -0400 Subject: [PATCH] Fully remove particles (#17) # Reason for Change The floaty particles that make up the background of the Ruby Central ghost theme are not universally appreciated. This change fully removes the particles. ## Description of Change This is very similar to the changes proposed in https://github.com/rubycentral/rubycentral-theme/pull/15. The only difference between the two changes is that this also removes the 'hideParticles' Javascript that I added on #16. --- assets/particles/bolt.48cc427e.png | Bin 924 -> 0 bytes assets/particles/circle.516d0062.png | Bin 1365 -> 0 bytes assets/particles/cross.36a4f529.png | Bin 1131 -> 0 bytes assets/particles/gem.b79a3ee9.png | Bin 1522 -> 0 bytes assets/particles/hadron.d57b1908.js | 15 --------------- assets/particles/hideParticles.js | 14 -------------- assets/particles/squiggle.b04d753a.png | Bin 946 -> 0 bytes default.hbs | 3 --- 8 files changed, 32 deletions(-) delete mode 100644 assets/particles/bolt.48cc427e.png delete mode 100644 assets/particles/circle.516d0062.png delete mode 100644 assets/particles/cross.36a4f529.png delete mode 100644 assets/particles/gem.b79a3ee9.png delete mode 100644 assets/particles/hadron.d57b1908.js delete mode 100644 assets/particles/hideParticles.js delete mode 100644 assets/particles/squiggle.b04d753a.png diff --git a/assets/particles/bolt.48cc427e.png b/assets/particles/bolt.48cc427e.png deleted file mode 100644 index 1bcb3846c99f100b138611a5453f6707e408a7e2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 924 zcmV;N17rM&P)DI>gn$4t{xf55WQaS0C}J6lJCiz8LDkh6*W8`+v0kATDZq80sHed^#3d0 z_?X_~s(1YP(H%?dPJtidXO5uV5qdm{p1vja0F(Zb=i?D4L_i)Q?ck^4HR4#ZNxW4c zFDm+4yB3dF5CQwlG2tuvl-MMe1msEbr(?q7ShNle@OK>p?0`7yY!*ib@-X?)G2s<@ zu2XY!rUE(V7+~^Jb1lnQGoTwrE8+{No&otDs!!X-g6B2gMK=5 zbMjXQH(}r{I6+n*(*e#*OlIZd& z(#8QQ9>$^-G*GWAax@z+oDiGDkpP?}?fPHEavV}Y0`Vwm*ZnGNoG>mniz5NJq{wS+ zE)J<60dkU5r#<8Eh)rTiK&~072pbp7#G*}T06a(9b-s#~qW%YV7CDyz z-lMN73uV)lu$#B`FObC>4A@6{4@cu41kGg(DEBm28&LLzP;ElFm%?U%1%HJ{q>A{1 zq1pf&4tJFUXdNpPJ^&qdLu9@L1IoT7W(T5=F!l=*0A6z7O^*G_41i_7G=%}Tt(!#@^V-}80dLaNct<)x1gN?T+=^FcMRRvw y!hi?X-ATm0;v2LP@PlOk_4!SfZw!9l0#NFrlPU z5<40SVnSyJg^7)gg)J4Kfr4o4^l!j|#?Bb+4HOWqtW<&;3Zo{R-;eCw?fsZHJGb8L ztoxEL%kBJl-}k-Q-Pt#DwUGf^y$d;I4!&uVllW(4@CqyS`a?P5_yUToEAbw2pT$auqFpjg^PiX zzN`M8@K)dv_g>%}k3Wo?8rSo6fk)*{VM(|wgxD`tzOP5;vyevKx(a+u*cL+UqbffU z7KIC5Cmj`NleDD|`U)|)j&*d|-$yzUb_2XamK)P(e;&JA(O1%Eh!AkjFM>MB`pth; z-ABTu?hyXX8Tw9q;46!5=khEMYgxRg4r*V`(BbIFQ1XV;?-y{czw}u<4 z+Z$X2p9sX{AE~Ou9o%PyfAgJkh%h6;XRDp<+CHl_FE+lp{YG1(h(3tB@18(x?iVN( z@`hy@cYFUZDo7N#3BEbYdQW<4$oo96nJ(kmJG4h#Pm&oHHm|EcPOc`#!OA31BbJ4?X`bYm_wV^{f!%$%ON= z!L1duDpxxxib@ipl4zr?2wSYxm57MWxe zRCkk9V`ym$Z1Phg<;8?C=#io&x zCv{B*ngk{}Ja(bR^MeVIX_`d%uYNMq3@qdyiNHL;H(64Zp&4AVZH5jB)T%3o%ow@Z z`L@=o%D@cYa0t4Tt+;~A2AW2lB2wn^r6`}+cL`B!%lbx`{kgnn`LdVdc8gfX2D7WIv#98D*i)4bP{|A8%^gX{WEeL5rX|-btChp zztz_7m{Qi`IT&M&g9BTPsW$nznYRF^49qM(hA=i4Zvl20(z5s%!q{BA1+Zo1=(R0? zqu3g%?mS*_IPW`PUofLA+iUPi=He~DkRfx|w?NI1P!bmkoE-%E3U&qp{-Aw#tycRP z@JrI{c?X;z;}Cg~lFvyUc$lXErwb5rdkj1U818lf&J+-!$lX#P?7yxqlOPkI##sZ_ zSDbwJGZB_vH+Ve)M+=b0HR}b(bx^i>32;7w$hn9-yqh0(Q%?uQt%< zs_(UM=>zSs&kVW<=D|Ya_+^o$^tu3$(+7!hAVT@hY+j10gw=U1Q!Ptc+}dW^Pgnv^ zfdrD}Jil?Q^Y;;Hb-e-dll*ZLZ1vGX{{M@8gvd2SnAL=(kCIP7r(fCB;_FU1D*gOpykvpJ>@2148Cp{-YEv38nKT0yGX^pNgHX$pto(}~JwR=7S%Ej^~cos@J zWxKZk+M)_s{yi_`m!#cWfFwz$46-diN;Rt(%li({wsgoWKA{-qc5eYJZvl&snP5jb xvLYM+9re>$cYzR~dw)EgtBnXlpd)@h{|Aiadk4$g?g9V+002ovPDHLkV1f;w-!cFI diff --git a/assets/particles/gem.b79a3ee9.png b/assets/particles/gem.b79a3ee9.png deleted file mode 100644 index d3715b0731f5ce40b8bc95261e8b9ca1aa11e732..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1522 zcmVT)Fx2vwx(5_;b)tt3FdDBgq|buhu~(9Kn>ih zXuiNV#1V_OsR0zfj$~he+bl^N!1)UgPtk;9DKE(eQ2hNQ`4-%nO4hLX^Z0q3CYaef0`DzG{VFUilpjdP8meKg z%Mc3&!KYS*z}x2%DM&_hpTnPO88k~mKHx|$>U-woeI!cP;q!n=nuL2DNk#n#)biCR z-Js84ioMY$kYbA|O`D_-q+6m%OP-WI@O&_C$+Se0HQ+L^#tDcEGLuz&P(FbCSVA?f z>9WWHb@3<5>cBb8cvn}Fns?*}$d@HlYx|YU&JN3}!1;}FMa}hQ%F7p!KTGVGN&<5T zoUyEca{;W)RBy;Z`3pW7qM@3H2KZ+~l-8cqd*{i9)ETuQpFn<7u|dDuHb%3xCtu-r z^_T74=57U_uNoX~)GOe4s!hzlZ%EcSihL((JFW&;-v2rszTtw})+HKnrUl^&l?^4T zo6pN?BEf0gG_}pg)P;z#zx5elDXg!jwh=@9o=W{znNS194XV!?I8CIae2?oh;Bex7 zqUk?@?)2O+f!`&;H$!fGpjUw9t4+W8KOv3p!a_~$3O;pFGF^rcJTzSgES(Df6JuXDw{v=NgEsKE^E#h- zyQ+1@De;~>cE<6m9Mg@G#)SL;`Le{G8OB*P2##7-2hIfJqcalKa6mqQ{8&OYW?vv> zLiYiFv1AFHvyAuFQ1i5;^nrX>Lbb*36F^uEblz``F^IQMJF0L)x~}ZhanlGFp51yMS?}(B(TOMh^1UWQC^_@ zmXPN~uI}cMNwgCDVNng7-x=@A%h$_s@+}9-YYBN>*^5r@8WIiz{e-l}j}Y(3P3V|V z9-w@dkjG(1dOMZG+bs?{IHPQ*F1JMuXgyFKYiy4uEINsc5v!BHJ6J@M90whG<)5iy zMz^FtbC?qK&0d}i7dj{NeHy87dhPjeB}r}BA+$t!Tz zr!!Ao)L0K!d`rl~a!cO6a}f3zRWak>ftV4^2OdK*%uS7H7MjE2=A_MT!YOu_W{GnA zL2$a89^KoVm8bG!Sll1AIdf8{rf-8)U?F%2yaB8iHK0!Jue{JaLCok%?8kCdQAn#< zSEn&F4}4!i1Eeu8??0o~;}}~C&Xw2%<<9*4sI~A;aSVFS*gU-|?JTp?e_yt#>S=J< zQ(c0q;;m1z^reQvNieKuk1i$(vrH>TIcIl;t4t)o_zLi~rOF)6HymG;kZJZb1?VXh z{gs*L8)7W1N&Z1c(dtVV=rl-CkFoy@SPLEo`V$;^&{Ha7Kz|i_gvW7?G0w(p2P){m Yf6i(KICmK#0?1:+e}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1;r>8&255]+Pr[e>>16&255]+Pr[e>>24&255]+"-"+Pr[255&t]+Pr[t>>8&255]+"-"+Pr[t>>16&15|64]+Pr[t>>24&255]+"-"+Pr[63&r|128]+Pr[r>>8&255]+"-"+Pr[r>>16&255]+Pr[r>>24&255]+Pr[255&n]+Pr[n>>8&255]+Pr[n>>16&255]+Pr[n>>24&255]).toUpperCase()},clamp:function(e,t,r){return Math.max(t,Math.min(r,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,r,n,i){return n+(e-t)*(i-n)/(r-t)},lerp:function(e,t,r){return(1-r)*e+r*t},smoothstep:function(e,t,r){return e<=t?0:e>=r?1:(e=(e-t)/(r-t))*e*(3-2*e)},smootherstep:function(e,t,r){return e<=t?0:e>=r?1:(e=(e-t)/(r-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*Ir.DEG2RAD},radToDeg:function(e){return e*Ir.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,r,n,i){var a=Math.cos,o=Math.sin,s=a(r/2),c=o(r/2),l=a((t+n)/2),h=o((t+n)/2),u=a((t-n)/2),p=o((t-n)/2),d=a((n-t)/2),f=o((n-t)/2);"XYX"===i?e.set(s*h,c*u,c*p,s*l):"YZY"===i?e.set(c*p,s*h,c*u,s*l):"ZXZ"===i?e.set(c*u,c*p,s*h,s*l):"XZX"===i?e.set(s*h,c*f,c*d,s*l):"YXY"===i?e.set(c*d,s*h,c*f,s*l):"ZYZ"===i?e.set(c*f,c*d,s*h,s*l):console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order.")}};function Nr(e,t){this.x=e||0,this.y=t||0}function Br(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}exports.MathUtils=exports.Math=Ir,Object.defineProperties(Nr.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),Object.assign(Nr.prototype,{isVector2:!0,set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.x=e,this.y=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},applyMatrix3:function(e){var t=this.x,r=this.y,n=e.elements;return this.x=n[0]*t+n[3]*r+n[6],this.y=n[1]*t+n[4]*r+n[7],this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this},clampLength:function(e,t){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},cross:function(e){return this.x*e.y-this.y*e.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){return Math.atan2(-this.y,-this.x)+Math.PI},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,r=this.y-e.y;return t*t+r*r},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,r){return this.subVectors(t,e).multiplyScalar(r).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute:function(e,t,r){return void 0!==r&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var r=Math.cos(t),n=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*r-a*n+e.x,this.y=i*n+a*r+e.y,this}}),Object.assign(Br.prototype,{isMatrix3:!0,set:function(e,t,r,n,i,a,o,s,c){var l=this.elements;return l[0]=e,l[1]=n,l[2]=o,l[3]=t,l[4]=i,l[5]=s,l[6]=r,l[7]=a,l[8]=c,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(e){var t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this},extractBasis:function(e,t,r){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this},setFromMatrix4:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var r=e.elements,n=t.elements,i=this.elements,a=r[0],o=r[3],s=r[6],c=r[1],l=r[4],h=r[7],u=r[2],p=r[5],d=r[8],f=n[0],m=n[3],v=n[6],g=n[1],y=n[4],x=n[7],_=n[2],b=n[5],w=n[8];return i[0]=a*f+o*g+s*_,i[3]=a*m+o*y+s*b,i[6]=a*v+o*x+s*w,i[1]=c*f+l*g+h*_,i[4]=c*m+l*y+h*b,i[7]=c*v+l*x+h*w,i[2]=u*f+p*g+d*_,i[5]=u*m+p*y+d*b,i[8]=u*v+p*x+d*w,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},determinant:function(){var e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-r*i*l+r*o*s+n*i*c-n*a*s},getInverse:function(e,t){e&&e.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var r=e.elements,n=this.elements,i=r[0],a=r[1],o=r[2],s=r[3],c=r[4],l=r[5],h=r[6],u=r[7],p=r[8],d=p*c-l*u,f=l*h-p*s,m=u*s-c*h,v=i*d+a*f+o*m;if(0===v){var g="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(g);return console.warn(g),this.identity()}var y=1/v;return n[0]=d*y,n[1]=(o*u-p*a)*y,n[2]=(l*a-o*c)*y,n[3]=f*y,n[4]=(p*i-o*h)*y,n[5]=(o*s-l*i)*y,n[6]=m*y,n[7]=(a*h-u*i)*y,n[8]=(c*i-a*s)*y,this},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},getNormalMatrix:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this},setUvTransform:function(e,t,r,n,i,a,o){var s=Math.cos(i),c=Math.sin(i);this.set(r*s,r*c,-r*(s*a+c*o)+a+e,-n*c,n*s,-n*(-c*a+s*o)+o+t,0,0,1)},scale:function(e,t){var r=this.elements;return r[0]*=e,r[3]*=e,r[6]*=e,r[1]*=t,r[4]*=t,r[7]*=t,this},rotate:function(e){var t=Math.cos(e),r=Math.sin(e),n=this.elements,i=n[0],a=n[3],o=n[6],s=n[1],c=n[4],l=n[7];return n[0]=t*i+r*s,n[3]=t*a+r*c,n[6]=t*o+r*l,n[1]=-r*i+t*s,n[4]=-r*a+t*c,n[7]=-r*o+t*l,this},translate:function(e,t){var r=this.elements;return r[0]+=e*r[2],r[3]+=e*r[5],r[6]+=e*r[8],r[1]+=t*r[2],r[4]+=t*r[5],r[7]+=t*r[8],this},equals:function(e){for(var t=this.elements,r=e.elements,n=0;n<9;n++)if(t[n]!==r[n])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var r=0;r<9;r++)this.elements[r]=e[r+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}});var Fr={getDataURL:function(e){var t;if("undefined"==typeof HTMLCanvasElement)return e.src;if(e instanceof HTMLCanvasElement)t=e;else{void 0===Dr&&(Dr=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Dr.width=e.width,Dr.height=e.height;var r=Dr.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),t=Dr}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}};exports.ImageUtils=Fr;var Ur=0;function Gr(e,t,r,n,i,a,o,s,c,l){Object.defineProperty(this,"id",{value:Ur++}),this.uuid=Ir.generateUUID(),this.name="",this.image=void 0!==e?e:Gr.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:Gr.DEFAULT_MAPPING,this.wrapS=void 0!==r?r:pe,this.wrapT=void 0!==n?n:pe,this.magFilter=void 0!==i?i:xe,this.minFilter=void 0!==a?a:we,this.anisotropy=void 0!==c?c:1,this.format=void 0!==o?o:Ue,this.internalFormat=null,this.type=void 0!==s?s:Se,this.offset=new Nr(0,0),this.repeat=new Nr(1,1),this.center=new Nr(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Br,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==l?l:Xt,this.version=0,this.onUpdate=null}function zr(e,t,r,n){this.x=e||0,this.y=t||0,this.z=r||0,this.w=void 0!==n?n:1}function Hr(e,t,r){this.width=e,this.height=t,this.scissor=new zr(0,0,e,t),this.scissorTest=!1,this.viewport=new zr(0,0,e,t),r=r||{},this.texture=new Gr(void 0,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),this.texture.image={},this.texture.image.width=e,this.texture.image.height=t,this.texture.generateMipmaps=void 0!==r.generateMipmaps&&r.generateMipmaps,this.texture.minFilter=void 0!==r.minFilter?r.minFilter:xe,this.depthBuffer=void 0===r.depthBuffer||r.depthBuffer,this.stencilBuffer=void 0===r.stencilBuffer||r.stencilBuffer,this.depthTexture=void 0!==r.depthTexture?r.depthTexture:null}function Vr(e,t,r){Hr.call(this,e,t,r),this.samples=4}function kr(e,t,r,n){this._x=e||0,this._y=t||0,this._z=r||0,this._w=void 0!==n?n:1}Gr.DEFAULT_IMAGE=void 0,Gr.DEFAULT_MAPPING=ne,Gr.prototype=Object.assign(Object.create(Cr.prototype),{constructor:Gr,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var r={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,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,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var n=this.image;if(void 0===n.uuid&&(n.uuid=Ir.generateUUID()),!t&&void 0===e.images[n.uuid]){var i;if(Array.isArray(n)){i=[];for(var a=0,o=n.length;a1)switch(this.wrapS){case ue:e.x=e.x-Math.floor(e.x);break;case pe:e.x=e.x<0?0:1;break;case de:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case ue:e.y=e.y-Math.floor(e.y);break;case pe:e.y=e.y<0?0:1;break;case de:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(Gr.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.defineProperties(zr.prototype,{width:{get:function(){return this.z},set:function(e){this.z=e}},height:{get:function(){return this.w},set:function(e){this.w=e}}}),Object.assign(zr.prototype,{isVector4:!0,set:function(e,t,r,n){return this.x=e,this.y=t,this.z=r,this.w=n,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var t=this.x,r=this.y,n=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*r+a[8]*n+a[12]*i,this.y=a[1]*t+a[5]*r+a[9]*n+a[13]*i,this.z=a[2]*t+a[6]*r+a[10]*n+a[14]*i,this.w=a[3]*t+a[7]*r+a[11]*n+a[15]*i,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){var t,r,n,i,a=e.elements,o=a[0],s=a[4],c=a[8],l=a[1],h=a[5],u=a[9],p=a[2],d=a[6],f=a[10];if(Math.abs(s-l)<.01&&Math.abs(c-p)<.01&&Math.abs(u-d)<.01){if(Math.abs(s+l)<.1&&Math.abs(c+p)<.1&&Math.abs(u+d)<.1&&Math.abs(o+h+f-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;var m=(o+1)/2,v=(h+1)/2,g=(f+1)/2,y=(s+l)/4,x=(c+p)/4,_=(u+d)/4;return m>v&&m>g?m<.01?(r=0,n=.707106781,i=.707106781):(n=y/(r=Math.sqrt(m)),i=x/r):v>g?v<.01?(r=.707106781,n=0,i=.707106781):(r=y/(n=Math.sqrt(v)),i=_/n):g<.01?(r=.707106781,n=.707106781,i=0):(r=x/(i=Math.sqrt(g)),n=_/i),this.set(r,n,i,t),this}var b=Math.sqrt((d-u)*(d-u)+(c-p)*(c-p)+(l-s)*(l-s));return Math.abs(b)<.001&&(b=1),this.x=(d-u)/b,this.y=(c-p)/b,this.z=(l-s)/b,this.w=Math.acos((o+h+f-1)/2),this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this},clampLength:function(e,t){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))},floor:function(){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:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){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:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,r){return this.subVectors(t,e).multiplyScalar(r).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromBufferAttribute:function(e,t,r){return void 0!==r&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}}),Hr.prototype=Object.assign(Object.create(Cr.prototype),{constructor:Hr,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.texture.image.width=e,this.texture.image.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Vr.prototype=Object.assign(Object.create(Hr.prototype),{constructor:Vr,isWebGLMultisampleRenderTarget:!0,copy:function(e){return Hr.prototype.copy.call(this,e),this.samples=e.samples,this}}),Object.assign(kr,{slerp:function(e,t,r,n){return r.copy(e).slerp(t,n)},slerpFlat:function(e,t,r,n,i,a,o){var s=r[n+0],c=r[n+1],l=r[n+2],h=r[n+3],u=i[a+0],p=i[a+1],d=i[a+2],f=i[a+3];if(h!==f||s!==u||c!==p||l!==d){var m=1-o,v=s*u+c*p+l*d+h*f,g=v>=0?1:-1,y=1-v*v;if(y>Number.EPSILON){var x=Math.sqrt(y),_=Math.atan2(x,v*g);m=Math.sin(m*_)/x,o=Math.sin(o*_)/x}var b=o*g;if(s=s*m+u*b,c=c*m+p*b,l=l*m+d*b,h=h*m+f*b,m===1-o){var w=1/Math.sqrt(s*s+c*c+l*l+h*h);s*=w,c*=w,l*=w,h*=w}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=h}}),Object.defineProperties(kr.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}}}),Object.assign(kr.prototype,{isQuaternion:!0,set:function(e,t,r,n){return this._x=e,this._y=t,this._z=r,this._w=n,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this},setFromEuler:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var r=e._x,n=e._y,i=e._z,a=e.order,o=Math.cos,s=Math.sin,c=o(r/2),l=o(n/2),h=o(i/2),u=s(r/2),p=s(n/2),d=s(i/2);return"XYZ"===a?(this._x=u*l*h+c*p*d,this._y=c*p*h-u*l*d,this._z=c*l*d+u*p*h,this._w=c*l*h-u*p*d):"YXZ"===a?(this._x=u*l*h+c*p*d,this._y=c*p*h-u*l*d,this._z=c*l*d-u*p*h,this._w=c*l*h+u*p*d):"ZXY"===a?(this._x=u*l*h-c*p*d,this._y=c*p*h+u*l*d,this._z=c*l*d+u*p*h,this._w=c*l*h-u*p*d):"ZYX"===a?(this._x=u*l*h-c*p*d,this._y=c*p*h+u*l*d,this._z=c*l*d-u*p*h,this._w=c*l*h+u*p*d):"YZX"===a?(this._x=u*l*h+c*p*d,this._y=c*p*h+u*l*d,this._z=c*l*d-u*p*h,this._w=c*l*h-u*p*d):"XZY"===a&&(this._x=u*l*h-c*p*d,this._y=c*p*h-u*l*d,this._z=c*l*d+u*p*h,this._w=c*l*h+u*p*d),!1!==t&&this._onChangeCallback(),this},setFromAxisAngle:function(e,t){var r=t/2,n=Math.sin(r);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(r),this._onChangeCallback(),this},setFromRotationMatrix:function(e){var t,r=e.elements,n=r[0],i=r[4],a=r[8],o=r[1],s=r[5],c=r[9],l=r[2],h=r[6],u=r[10],p=n+s+u;return p>0?(t=.5/Math.sqrt(p+1),this._w=.25/t,this._x=(h-c)*t,this._y=(a-l)*t,this._z=(o-i)*t):n>s&&n>u?(t=2*Math.sqrt(1+n-s-u),this._w=(h-c)/t,this._x=.25*t,this._y=(i+o)/t,this._z=(a+l)/t):s>u?(t=2*Math.sqrt(1+s-n-u),this._w=(a-l)/t,this._x=(i+o)/t,this._y=.25*t,this._z=(c+h)/t):(t=2*Math.sqrt(1+u-n-s),this._w=(o-i)/t,this._x=(a+l)/t,this._y=(c+h)/t,this._z=.25*t),this._onChangeCallback(),this},setFromUnitVectors:function(e,t){var r=e.dot(t)+1;return r<1e-6?(r=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=r),this.normalize()},angleTo:function(e){return 2*Math.acos(Math.abs(Ir.clamp(this.dot(e),-1,1)))},rotateTowards:function(e,t){var r=this.angleTo(e);if(0===r)return this;var n=Math.min(1,t/r);return this.slerp(e,n),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var r=e._x,n=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=r*l+a*o+n*c-i*s,this._y=n*l+a*s+i*o-r*c,this._z=i*l+a*c+r*s-n*o,this._w=a*l-r*o-n*s-i*c,this._onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var r=this._x,n=this._y,i=this._z,a=this._w,o=a*e._w+r*e._x+n*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=r,this._y=n,this._z=i,this;var s=1-o*o;if(s<=Number.EPSILON){var c=1-t;return this._w=c*a+t*this._w,this._x=c*r+t*this._x,this._y=c*n+t*this._y,this._z=c*i+t*this._z,this.normalize(),this._onChangeCallback(),this}var l=Math.sqrt(s),h=Math.atan2(l,o),u=Math.sin((1-t)*h)/l,p=Math.sin(t*h)/l;return this._w=a*u+this._w*p,this._x=r*u+this._x*p,this._y=n*u+this._y*p,this._z=i*u+this._z*p,this._onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}});var jr=new qr,Wr=new kr;function qr(e,t,r){this.x=e||0,this.y=t||0,this.z=r||0}Object.assign(qr.prototype,{isVector3:!0,set:function(e,t,r){return this.x=e,this.y=t,this.z=r,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Wr.setFromEuler(e))},applyAxisAngle:function(e,t){return this.applyQuaternion(Wr.setFromAxisAngle(e,t))},applyMatrix3:function(e){var t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6]*n,this.y=i[1]*t+i[4]*r+i[7]*n,this.z=i[2]*t+i[5]*r+i[8]*n,this},applyNormalMatrix:function(e){return this.applyMatrix3(e).normalize()},applyMatrix4:function(e){var t=this.x,r=this.y,n=this.z,i=e.elements,a=1/(i[3]*t+i[7]*r+i[11]*n+i[15]);return this.x=(i[0]*t+i[4]*r+i[8]*n+i[12])*a,this.y=(i[1]*t+i[5]*r+i[9]*n+i[13])*a,this.z=(i[2]*t+i[6]*r+i[10]*n+i[14])*a,this},applyQuaternion:function(e){var t=this.x,r=this.y,n=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=s*t+a*n-o*r,l=s*r+o*t-i*n,h=s*n+i*r-a*t,u=-i*t-a*r-o*n;return this.x=c*s+u*-i+l*-o-h*-a,this.y=l*s+u*-a+h*-i-c*-o,this.z=h*s+u*-o+c*-a-l*-i,this},project:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)},unproject:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)},transformDirection:function(e){var t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[4]*r+i[8]*n,this.y=i[1]*t+i[5]*r+i[9]*n,this.z=i[2]*t+i[6]*r+i[10]*n,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this},clampLength:function(e,t){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,r){return this.subVectors(t,e).multiplyScalar(r).add(e)},cross:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)},crossVectors:function(e,t){var r=e.x,n=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=n*s-i*o,this.y=i*a-r*s,this.z=r*o-n*a,this},projectOnVector:function(e){var t=e.lengthSq();if(0===t)return this.set(0,0,0);var r=e.dot(this)/t;return this.copy(e).multiplyScalar(r)},projectOnPlane:function(e){return jr.copy(this).projectOnVector(e),this.sub(jr)},reflect:function(e){return this.sub(jr.copy(e).multiplyScalar(2*this.dot(e)))},angleTo:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var r=this.dot(e)/t;return Math.acos(Ir.clamp(r,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,r=this.y-e.y,n=this.z-e.z;return t*t+r*r+n*n},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)},setFromSphericalCoords:function(e,t,r){var n=Math.sin(t)*e;return this.x=n*Math.sin(r),this.y=Math.cos(t)*e,this.z=n*Math.cos(r),this},setFromCylindrical:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)},setFromCylindricalCoords:function(e,t,r){return this.x=e*Math.sin(t),this.y=r,this.z=e*Math.cos(t),this},setFromMatrixPosition:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,this.z=n,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},setFromMatrix3Column:function(e,t){return this.fromArray(e.elements,3*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,r){return void 0!==r&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}});var Xr=new qr,Yr=new en,Zr=new qr(0,0,0),Jr=new qr(1,1,1),Qr=new qr,Kr=new qr,$r=new qr;function en(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}Object.assign(en.prototype,{isMatrix4:!0,set:function(e,t,r,n,i,a,o,s,c,l,h,u,p,d,f,m){var v=this.elements;return v[0]=e,v[4]=t,v[8]=r,v[12]=n,v[1]=i,v[5]=a,v[9]=o,v[13]=s,v[2]=c,v[6]=l,v[10]=h,v[14]=u,v[3]=p,v[7]=d,v[11]=f,v[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new en).fromArray(this.elements)},copy:function(e){var t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this},copyPosition:function(e){var t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[14],this},extractBasis:function(e,t,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this},makeBasis:function(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this},extractRotation:function(e){var t=this.elements,r=e.elements,n=1/Xr.setFromMatrixColumn(e,0).length(),i=1/Xr.setFromMatrixColumn(e,1).length(),a=1/Xr.setFromMatrixColumn(e,2).length();return t[0]=r[0]*n,t[1]=r[1]*n,t[2]=r[2]*n,t[3]=0,t[4]=r[4]*i,t[5]=r[5]*i,t[6]=r[6]*i,t[7]=0,t[8]=r[8]*a,t[9]=r[9]*a,t[10]=r[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromEuler:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,r=e.x,n=e.y,i=e.z,a=Math.cos(r),o=Math.sin(r),s=Math.cos(n),c=Math.sin(n),l=Math.cos(i),h=Math.sin(i);if("XYZ"===e.order){var u=a*l,p=a*h,d=o*l,f=o*h;t[0]=s*l,t[4]=-s*h,t[8]=c,t[1]=p+d*c,t[5]=u-f*c,t[9]=-o*s,t[2]=f-u*c,t[6]=d+p*c,t[10]=a*s}else if("YXZ"===e.order){var m=s*l,v=s*h,g=c*l,y=c*h;t[0]=m+y*o,t[4]=g*o-v,t[8]=a*c,t[1]=a*h,t[5]=a*l,t[9]=-o,t[2]=v*o-g,t[6]=y+m*o,t[10]=a*s}else if("ZXY"===e.order){m=s*l,v=s*h,g=c*l,y=c*h;t[0]=m-y*o,t[4]=-a*h,t[8]=g+v*o,t[1]=v+g*o,t[5]=a*l,t[9]=y-m*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if("ZYX"===e.order){u=a*l,p=a*h,d=o*l,f=o*h;t[0]=s*l,t[4]=d*c-p,t[8]=u*c+f,t[1]=s*h,t[5]=f*c+u,t[9]=p*c-d,t[2]=-c,t[6]=o*s,t[10]=a*s}else if("YZX"===e.order){var x=a*s,_=a*c,b=o*s,w=o*c;t[0]=s*l,t[4]=w-x*h,t[8]=b*h+_,t[1]=h,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=_*h+b,t[10]=x-w*h}else if("XZY"===e.order){x=a*s,_=a*c,b=o*s,w=o*c;t[0]=s*l,t[4]=-h,t[8]=c*l,t[1]=x*h+w,t[5]=a*l,t[9]=_*h-b,t[2]=b*h-_,t[6]=o*l,t[10]=w*h+x}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:function(e){return this.compose(Zr,e,Jr)},lookAt:function(e,t,r){var n=this.elements;return $r.subVectors(e,t),0===$r.lengthSq()&&($r.z=1),$r.normalize(),Qr.crossVectors(r,$r),0===Qr.lengthSq()&&(1===Math.abs(r.z)?$r.x+=1e-4:$r.z+=1e-4,$r.normalize(),Qr.crossVectors(r,$r)),Qr.normalize(),Kr.crossVectors($r,Qr),n[0]=Qr.x,n[4]=Kr.x,n[8]=$r.x,n[1]=Qr.y,n[5]=Kr.y,n[9]=$r.y,n[2]=Qr.z,n[6]=Kr.z,n[10]=$r.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var r=e.elements,n=t.elements,i=this.elements,a=r[0],o=r[4],s=r[8],c=r[12],l=r[1],h=r[5],u=r[9],p=r[13],d=r[2],f=r[6],m=r[10],v=r[14],g=r[3],y=r[7],x=r[11],_=r[15],b=n[0],w=n[4],M=n[8],S=n[12],T=n[1],E=n[5],A=n[9],L=n[13],R=n[2],C=n[6],P=n[10],O=n[14],D=n[3],I=n[7],N=n[11],B=n[15];return i[0]=a*b+o*T+s*R+c*D,i[4]=a*w+o*E+s*C+c*I,i[8]=a*M+o*A+s*P+c*N,i[12]=a*S+o*L+s*O+c*B,i[1]=l*b+h*T+u*R+p*D,i[5]=l*w+h*E+u*C+p*I,i[9]=l*M+h*A+u*P+p*N,i[13]=l*S+h*L+u*O+p*B,i[2]=d*b+f*T+m*R+v*D,i[6]=d*w+f*E+m*C+v*I,i[10]=d*M+f*A+m*P+v*N,i[14]=d*S+f*L+m*O+v*B,i[3]=g*b+y*T+x*R+_*D,i[7]=g*w+y*E+x*C+_*I,i[11]=g*M+y*A+x*P+_*N,i[15]=g*S+y*L+x*O+_*B,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},determinant:function(){var e=this.elements,t=e[0],r=e[4],n=e[8],i=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],h=e[6],u=e[10],p=e[14];return e[3]*(+i*s*h-n*c*h-i*o*u+r*c*u+n*o*p-r*s*p)+e[7]*(+t*s*p-t*c*u+i*a*u-n*a*p+n*c*l-i*s*l)+e[11]*(+t*c*h-t*o*p-i*a*h+r*a*p+i*o*l-r*c*l)+e[15]*(-n*o*l-t*s*h+t*o*u+n*a*h-r*a*u+r*s*l)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},setPosition:function(e,t,r){var n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=r),this},getInverse:function(e,t){var r=this.elements,n=e.elements,i=n[0],a=n[1],o=n[2],s=n[3],c=n[4],l=n[5],h=n[6],u=n[7],p=n[8],d=n[9],f=n[10],m=n[11],v=n[12],g=n[13],y=n[14],x=n[15],_=d*y*u-g*f*u+g*h*m-l*y*m-d*h*x+l*f*x,b=v*f*u-p*y*u-v*h*m+c*y*m+p*h*x-c*f*x,w=p*g*u-v*d*u+v*l*m-c*g*m-p*l*x+c*d*x,M=v*d*h-p*g*h-v*l*f+c*g*f+p*l*y-c*d*y,S=i*_+a*b+o*w+s*M;if(0===S){var T="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(T);return console.warn(T),this.identity()}var E=1/S;return r[0]=_*E,r[1]=(g*f*s-d*y*s-g*o*m+a*y*m+d*o*x-a*f*x)*E,r[2]=(l*y*s-g*h*s+g*o*u-a*y*u-l*o*x+a*h*x)*E,r[3]=(d*h*s-l*f*s-d*o*u+a*f*u+l*o*m-a*h*m)*E,r[4]=b*E,r[5]=(p*y*s-v*f*s+v*o*m-i*y*m-p*o*x+i*f*x)*E,r[6]=(v*h*s-c*y*s-v*o*u+i*y*u+c*o*x-i*h*x)*E,r[7]=(c*f*s-p*h*s+p*o*u-i*f*u-c*o*m+i*h*m)*E,r[8]=w*E,r[9]=(v*d*s-p*g*s-v*a*m+i*g*m+p*a*x-i*d*x)*E,r[10]=(c*g*s-v*l*s+v*a*u-i*g*u-c*a*x+i*l*x)*E,r[11]=(p*l*s-c*d*s-p*a*u+i*d*u+c*a*m-i*l*m)*E,r[12]=M*E,r[13]=(p*g*o-v*d*o+v*a*f-i*g*f-p*a*y+i*d*y)*E,r[14]=(v*l*o-c*g*o-v*a*h+i*g*h+c*a*y-i*l*y)*E,r[15]=(c*d*o-p*l*o+p*a*h-i*d*h-c*a*f+i*l*f)*E,this},scale:function(e){var t=this.elements,r=e.x,n=e.y,i=e.z;return t[0]*=r,t[4]*=n,t[8]*=i,t[1]*=r,t[5]*=n,t[9]*=i,t[2]*=r,t[6]*=n,t[10]*=i,t[3]*=r,t[7]*=n,t[11]*=i,this},getMaxScaleOnAxis:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,r,n))},makeTranslation:function(e,t,r){return this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this},makeRotationX:function(e){var t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this},makeRotationY:function(e){var t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this},makeRotationZ:function(e){var t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,t){var r=Math.cos(t),n=Math.sin(t),i=1-r,a=e.x,o=e.y,s=e.z,c=i*a,l=i*o;return this.set(c*a+r,c*o-n*s,c*s+n*o,0,c*o+n*s,l*o+r,l*s-n*a,0,c*s-n*o,l*s+n*a,i*s*s+r,0,0,0,0,1),this},makeScale:function(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this},makeShear:function(e,t,r){return this.set(1,t,r,0,e,1,r,0,e,t,1,0,0,0,0,1),this},compose:function(e,t,r){var n=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,c=i+i,l=a+a,h=o+o,u=i*c,p=i*l,d=i*h,f=a*l,m=a*h,v=o*h,g=s*c,y=s*l,x=s*h,_=r.x,b=r.y,w=r.z;return n[0]=(1-(f+v))*_,n[1]=(p+x)*_,n[2]=(d-y)*_,n[3]=0,n[4]=(p-x)*b,n[5]=(1-(u+v))*b,n[6]=(m+g)*b,n[7]=0,n[8]=(d+y)*w,n[9]=(m-g)*w,n[10]=(1-(u+f))*w,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this},decompose:function(e,t,r){var n=this.elements,i=Xr.set(n[0],n[1],n[2]).length(),a=Xr.set(n[4],n[5],n[6]).length(),o=Xr.set(n[8],n[9],n[10]).length();this.determinant()<0&&(i=-i),e.x=n[12],e.y=n[13],e.z=n[14],Yr.copy(this);var s=1/i,c=1/a,l=1/o;return Yr.elements[0]*=s,Yr.elements[1]*=s,Yr.elements[2]*=s,Yr.elements[4]*=c,Yr.elements[5]*=c,Yr.elements[6]*=c,Yr.elements[8]*=l,Yr.elements[9]*=l,Yr.elements[10]*=l,t.setFromRotationMatrix(Yr),r.x=i,r.y=a,r.z=o,this},makePerspective:function(e,t,r,n,i,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*i/(t-e),c=2*i/(r-n),l=(t+e)/(t-e),h=(r+n)/(r-n),u=-(a+i)/(a-i),p=-2*a*i/(a-i);return o[0]=s,o[4]=0,o[8]=l,o[12]=0,o[1]=0,o[5]=c,o[9]=h,o[13]=0,o[2]=0,o[6]=0,o[10]=u,o[14]=p,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(e,t,r,n,i,a){var o=this.elements,s=1/(t-e),c=1/(r-n),l=1/(a-i),h=(t+e)*s,u=(r+n)*c,p=(a+i)*l;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-h,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-u,o[2]=0,o[6]=0,o[10]=-2*l,o[14]=-p,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(e){for(var t=this.elements,r=e.elements,n=0;n<16;n++)if(t[n]!==r[n])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var r=0;r<16;r++)this.elements[r]=e[r+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e}});var tn=new en,rn=new kr;function nn(e,t,r,n){this._x=e||0,this._y=t||0,this._z=r||0,this._order=n||nn.DefaultOrder}function an(){this.mask=1}nn.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],nn.DefaultOrder="XYZ",Object.defineProperties(nn.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}}}),Object.assign(nn.prototype,{isEuler:!0,set:function(e,t,r,n){return this._x=e,this._y=t,this._z=r,this._order=n||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this},setFromRotationMatrix:function(e,t,r){var n=Ir.clamp,i=e.elements,a=i[0],o=i[4],s=i[8],c=i[1],l=i[5],h=i[9],u=i[2],p=i[6],d=i[10];return"XYZ"===(t=t||this._order)?(this._y=Math.asin(n(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-h,d),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(p,l),this._z=0)):"YXZ"===t?(this._x=Math.asin(-n(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-u,a),this._z=0)):"ZXY"===t?(this._x=Math.asin(n(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(c,a))):"ZYX"===t?(this._y=Math.asin(-n(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(p,d),this._z=Math.atan2(c,a)):(this._x=0,this._z=Math.atan2(-o,l))):"YZX"===t?(this._z=Math.asin(n(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-u,a)):(this._x=0,this._y=Math.atan2(s,d))):"XZY"===t?(this._z=Math.asin(-n(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,l),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-h,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,!1!==r&&this._onChangeCallback(),this},setFromQuaternion:function(e,t,r){return tn.makeRotationFromQuaternion(e),this.setFromRotationMatrix(tn,t,r)},setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(e){return rn.setFromEuler(this),this.setFromQuaternion(rn,e)},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new qr(this._x,this._y,this._z)},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}}),Object.assign(an.prototype,{set:function(e){this.mask=1<1){for(var t=0;t1){for(var t=0;t0){n.children=[];for(s=0;s0&&(r.geometries=u),p.length>0&&(r.materials=p),d.length>0&&(r.textures=d),f.length>0&&(r.images=f),o.length>0&&(r.shapes=o)}return r.object=n,r;function m(e){var t=[];for(var r in e){var n=e[r];delete n.metadata,t.push(n)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var r=0;rs)return!1}return!0}Object.assign(In.prototype,{isBox3:!0,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=1/0,r=1/0,n=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,c=e.length;si&&(i=l),h>a&&(a=h),u>o&&(o=u)}return this.min.set(t,r,n),this.max.set(i,a,o),this},setFromBufferAttribute:function(e){for(var t=1/0,r=1/0,n=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,c=e.count;si&&(i=l),h>a&&(a=h),u>o&&(o=u)}return this.min.set(t,r,n),this.max.set(i,a,o),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,r=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new qr),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)},intersectsSphere:function(e){return this.clampPoint(e.center,wn),wn.distanceToSquared(e.center)<=e.radius*e.radius},intersectsPlane:function(e){var t,r;return e.normal.x>0?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=-e.constant&&r>=-e.constant},intersectsTriangle:function(e){if(this.isEmpty())return!1;this.getCenter(Cn),Pn.subVectors(this.max,Cn),Sn.subVectors(e.a,Cn),Tn.subVectors(e.b,Cn),En.subVectors(e.c,Cn),An.subVectors(Tn,Sn),Ln.subVectors(En,Tn),Rn.subVectors(Sn,En);var t=[0,-An.z,An.y,0,-Ln.z,Ln.y,0,-Rn.z,Rn.y,An.z,0,-An.x,Ln.z,0,-Ln.x,Rn.z,0,-Rn.x,-An.y,An.x,0,-Ln.y,Ln.x,0,-Rn.y,Rn.x,0];return!!Nn(t,Sn,Tn,En,Pn)&&(!!Nn(t=[1,0,0,0,1,0,0,0,1],Sn,Tn,En,Pn)&&(On.crossVectors(An,Ln),Nn(t=[On.x,On.y,On.z],Sn,Tn,En,Pn)))},clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new qr),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return wn.copy(e).clamp(this.min,this.max).sub(e).length()},getBoundingSphere:function(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(wn).length(),e},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:function(e){return this.isEmpty()?this:(bn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),bn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),bn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),bn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),bn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),bn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),bn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),bn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(bn),this)},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}});var Bn=new In;function Fn(e,t){this.center=void 0!==e?e:new qr,this.radius=void 0!==t?t:0}Object.assign(Fn.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(e,t){var r=this.center;void 0!==t?r.copy(t):Bn.setFromPoints(e).getCenter(r);for(var n=0,i=0,a=e.length;ithis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t},getBoundingBox:function(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new In),e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}});var Un=new qr,Gn=new qr,zn=new qr,Hn=new qr,Vn=new qr,kn=new qr,jn=new qr;function Wn(e,t){this.origin=void 0!==e?e:new qr,this.direction=void 0!==t?t:new qr(0,0,-1)}Object.assign(Wn.prototype,{set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new qr),t.copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:function(e){return this.origin.copy(this.at(e,Un)),this},closestPointToPoint:function(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new qr),t.subVectors(e,this.origin);var r=t.dot(this.direction);return r<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(r).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(e){var t=Un.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Un.copy(this.direction).multiplyScalar(t).add(this.origin),Un.distanceToSquared(e))},distanceSqToSegment:function(e,t,r,n){Gn.copy(e).add(t).multiplyScalar(.5),zn.copy(t).sub(e).normalize(),Hn.copy(this.origin).sub(Gn);var i,a,o,s,c=.5*e.distanceTo(t),l=-this.direction.dot(zn),h=Hn.dot(this.direction),u=-Hn.dot(zn),p=Hn.lengthSq(),d=Math.abs(1-l*l);if(d>0)if(a=l*h-u,s=c*d,(i=l*u-h)>=0)if(a>=-s)if(a<=s){var f=1/d;o=(i*=f)*(i+l*(a*=f)+2*h)+a*(l*i+a+2*u)+p}else a=c,o=-(i=Math.max(0,-(l*a+h)))*i+a*(a+2*u)+p;else a=-c,o=-(i=Math.max(0,-(l*a+h)))*i+a*(a+2*u)+p;else a<=-s?o=-(i=Math.max(0,-(-l*c+h)))*i+(a=i>0?-c:Math.min(Math.max(-c,-u),c))*(a+2*u)+p:a<=s?(i=0,o=(a=Math.min(Math.max(-c,-u),c))*(a+2*u)+p):o=-(i=Math.max(0,-(l*c+h)))*i+(a=i>0?c:Math.min(Math.max(-c,-u),c))*(a+2*u)+p;else a=l>0?-c:c,o=-(i=Math.max(0,-(l*a+h)))*i+a*(a+2*u)+p;return r&&r.copy(this.direction).multiplyScalar(i).add(this.origin),n&&n.copy(zn).multiplyScalar(a).add(Gn),o},intersectSphere:function(e,t){Un.subVectors(e.center,this.origin);var r=Un.dot(this.direction),n=Un.dot(Un)-r*r,i=e.radius*e.radius;if(n>i)return null;var a=Math.sqrt(i-n),o=r-a,s=r+a;return o<0&&s<0?null:o<0?this.at(s,t):this.at(o,t)},intersectsSphere:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null},intersectPlane:function(e,t){var r=this.distanceToPlane(e);return null===r?null:this.at(r,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0},intersectBox:function(e,t){var r,n,i,a,o,s,c=1/this.direction.x,l=1/this.direction.y,h=1/this.direction.z,u=this.origin;return c>=0?(r=(e.min.x-u.x)*c,n=(e.max.x-u.x)*c):(r=(e.max.x-u.x)*c,n=(e.min.x-u.x)*c),l>=0?(i=(e.min.y-u.y)*l,a=(e.max.y-u.y)*l):(i=(e.max.y-u.y)*l,a=(e.min.y-u.y)*l),r>a||i>n?null:((i>r||r!=r)&&(r=i),(a=0?(o=(e.min.z-u.z)*h,s=(e.max.z-u.z)*h):(o=(e.max.z-u.z)*h,s=(e.min.z-u.z)*h),r>s||o>n?null:((o>r||r!=r)&&(r=o),(s=0?r:n,t)))},intersectsBox:function(e){return null!==this.intersectBox(e,Un)},intersectTriangle:function(e,t,r,n,i){Vn.subVectors(t,e),kn.subVectors(r,e),jn.crossVectors(Vn,kn);var a,o=this.direction.dot(jn);if(o>0){if(n)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}Hn.subVectors(this.origin,e);var s=a*this.direction.dot(kn.crossVectors(Hn,kn));if(s<0)return null;var c=a*this.direction.dot(Vn.cross(Hn));if(c<0)return null;if(s+c>o)return null;var l=-a*Hn.dot(jn);return l<0?null:this.at(l/o,i)},applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}});var qn=new qr,Xn=new qr,Yn=new Br;function Zn(e,t){this.normal=void 0!==e?e:new qr(1,0,0),this.constant=void 0!==t?t:0}Object.assign(Zn.prototype,{isPlane:!0,set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,r,n){return this.normal.set(e,t,r),this.constant=n,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(e,t,r){var n=qn.subVectors(r,t).cross(Xn.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(n,e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return void 0===t&&(console.warn("THREE.Plane: .projectPoint() target is now required"),t=new qr),t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(e,t){void 0===t&&(console.warn("THREE.Plane: .intersectLine() target is now required"),t=new qr);var r=e.delta(qn),n=this.normal.dot(r);if(0===n)return 0===this.distanceToPoint(e.start)?t.copy(e.start):void 0;var i=-(e.start.dot(this.normal)+this.constant)/n;return i<0||i>1?void 0:t.copy(r).multiplyScalar(i).add(e.start)},intersectsLine:function(e){var t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<0&&t>0},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new qr),e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(e,t){var r=t||Yn.getNormalMatrix(e),n=this.coplanarPoint(qn).applyMatrix4(e),i=this.normal.applyMatrix3(r).normalize();return this.constant=-n.dot(i),this},translate:function(e){return this.constant-=e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}});var Jn=new qr,Qn=new qr,Kn=new qr,$n=new qr,ei=new qr,ti=new qr,ri=new qr,ni=new qr,ii=new qr,ai=new qr;function oi(e,t,r){this.a=void 0!==e?e:new qr,this.b=void 0!==t?t:new qr,this.c=void 0!==r?r:new qr}Object.assign(oi,{getNormal:function(e,t,r,n){void 0===n&&(console.warn("THREE.Triangle: .getNormal() target is now required"),n=new qr),n.subVectors(r,t),Jn.subVectors(e,t),n.cross(Jn);var i=n.lengthSq();return i>0?n.multiplyScalar(1/Math.sqrt(i)):n.set(0,0,0)},getBarycoord:function(e,t,r,n,i){Jn.subVectors(n,t),Qn.subVectors(r,t),Kn.subVectors(e,t);var a=Jn.dot(Jn),o=Jn.dot(Qn),s=Jn.dot(Kn),c=Qn.dot(Qn),l=Qn.dot(Kn),h=a*c-o*o;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new qr),0===h)return i.set(-2,-1,-1);var u=1/h,p=(c*s-o*l)*u,d=(a*l-o*s)*u;return i.set(1-p-d,d,p)},containsPoint:function(e,t,r,n){return oi.getBarycoord(e,t,r,n,$n),$n.x>=0&&$n.y>=0&&$n.x+$n.y<=1},getUV:function(e,t,r,n,i,a,o,s){return this.getBarycoord(e,t,r,n,$n),s.set(0,0),s.addScaledVector(i,$n.x),s.addScaledVector(a,$n.y),s.addScaledVector(o,$n.z),s},isFrontFacing:function(e,t,r,n){return Jn.subVectors(r,t),Qn.subVectors(e,t),Jn.cross(Qn).dot(n)<0}}),Object.assign(oi.prototype,{set:function(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this},setFromPointsAndIndices:function(e,t,r,n){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[n]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},getArea:function(){return Jn.subVectors(this.c,this.b),Qn.subVectors(this.a,this.b),.5*Jn.cross(Qn).length()},getMidpoint:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new qr),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(e){return oi.getNormal(this.a,this.b,this.c,e)},getPlane:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new Zn),e.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(e,t){return oi.getBarycoord(e,this.a,this.b,this.c,t)},getUV:function(e,t,r,n,i){return oi.getUV(e,this.a,this.b,this.c,t,r,n,i)},containsPoint:function(e){return oi.containsPoint(e,this.a,this.b,this.c)},isFrontFacing:function(e){return oi.isFrontFacing(this.a,this.b,this.c,e)},intersectsBox:function(e){return e.intersectsTriangle(this)},closestPointToPoint:function(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new qr);var r,n,i=this.a,a=this.b,o=this.c;ei.subVectors(a,i),ti.subVectors(o,i),ni.subVectors(e,i);var s=ei.dot(ni),c=ti.dot(ni);if(s<=0&&c<=0)return t.copy(i);ii.subVectors(e,a);var l=ei.dot(ii),h=ti.dot(ii);if(l>=0&&h<=l)return t.copy(a);var u=s*h-l*c;if(u<=0&&s>=0&&l<=0)return r=s/(s-l),t.copy(i).addScaledVector(ei,r);ai.subVectors(e,o);var p=ei.dot(ai),d=ti.dot(ai);if(d>=0&&p<=d)return t.copy(o);var f=p*c-s*d;if(f<=0&&c>=0&&d<=0)return n=c/(c-d),t.copy(i).addScaledVector(ti,n);var m=l*d-p*h;if(m<=0&&h-l>=0&&p-d>=0)return ri.subVectors(o,a),n=(h-l)/(h-l+(p-d)),t.copy(a).addScaledVector(ri,n);var v=1/(m+f+u);return r=f*v,n=u*v,t.copy(i).addScaledVector(ei,r).addScaledVector(ti,n)},equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}});var si={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ci={h:0,s:0,l:0},li={h:0,s:0,l:0};function hi(e,t,r){return void 0===t&&void 0===r?this.set(e):this.setRGB(e,t,r)}function ui(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+6*(t-e)*(2/3-r):e}function pi(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function di(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}function fi(e,t,r,n,i,a){this.a=e,this.b=t,this.c=r,this.normal=n&&n.isVector3?n:new qr,this.vertexNormals=Array.isArray(n)?n:[],this.color=i&&i.isColor?i:new hi,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=void 0!==a?a:0}Object.assign(hi.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},setScalar:function(e){return this.r=e,this.g=e,this.b=e,this},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,r){return this.r=e,this.g=t,this.b=r,this},setHSL:function(e,t,r){if(e=Ir.euclideanModulo(e,1),t=Ir.clamp(t,0,1),r=Ir.clamp(r,0,1),0===t)this.r=this.g=this.b=r;else{var n=r<=.5?r*(1+t):r+t-r*t,i=2*r-n;this.r=ui(i,n,e+1/3),this.g=ui(i,n,e),this.b=ui(i,n,e-1/3)}return this},setStyle:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var r;if(r=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var n,i=r[1],a=r[2];switch(i){case"rgb":case"rgba":if(n=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,t(n[5]),this;if(n=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,t(n[5]),this;break;case"hsl":case"hsla":if(n=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(n[1])/360,s=parseInt(n[2],10)/100,c=parseInt(n[3],10)/100;return t(n[5]),this.setHSL(o,s,c)}}}else if(r=/^\#([A-Fa-f0-9]+)$/.exec(e)){var l=r[1],h=l.length;if(3===h)return this.r=parseInt(l.charAt(0)+l.charAt(0),16)/255,this.g=parseInt(l.charAt(1)+l.charAt(1),16)/255,this.b=parseInt(l.charAt(2)+l.charAt(2),16)/255,this;if(6===h)return this.r=parseInt(l.charAt(0)+l.charAt(1),16)/255,this.g=parseInt(l.charAt(2)+l.charAt(3),16)/255,this.b=parseInt(l.charAt(4)+l.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this},setColorName:function(e){var t=si[e];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){void 0===t&&(t=2);var r=t>0?1/t:1;return this.r=Math.pow(e.r,r),this.g=Math.pow(e.g,r),this.b=Math.pow(e.b,r),this},convertGammaToLinear:function(e){return this.copyGammaToLinear(this,e),this},convertLinearToGamma:function(e){return this.copyLinearToGamma(this,e),this},copySRGBToLinear:function(e){return this.r=pi(e.r),this.g=pi(e.g),this.b=pi(e.b),this},copyLinearToSRGB:function(e){return this.r=di(e.r),this.g=di(e.g),this.b=di(e.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});var t,r,n=this.r,i=this.g,a=this.b,o=Math.max(n,i,a),s=Math.min(n,i,a),c=(s+o)/2;if(s===o)t=0,r=0;else{var l=o-s;switch(r=c<=.5?l/(o+s):l/(2-o-s),o){case n:t=(i-a)/l+(i0&&(r.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(r.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(r.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(r.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(r.morphTargets=!0),!0===this.morphNormals&&(r.morphNormals=!0),!0===this.skinning&&(r.skinning=!0),!1===this.visible&&(r.visible=!1),!1===this.toneMapped&&(r.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),t){var i=n(e.textures),a=n(e.images);i.length>0&&(r.textures=i),a.length>0&&(r.images=a)}return r},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;var t=e.clippingPlanes,r=null;if(null!==t){var n=t.length;r=new Array(n);for(var i=0;i!==n;++i)r[i]=t[i].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(vi.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),gi.prototype=Object.create(vi.prototype),gi.prototype.constructor=gi,gi.prototype.isMeshBasicMaterial=!0,gi.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this};var yi=new qr;function xi(e,t,r){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===r,this.usage=br,this.updateRange={offset:0,count:-1},this.version=0}function _i(e,t,r){xi.call(this,new Int8Array(e),t,r)}function bi(e,t,r){xi.call(this,new Uint8Array(e),t,r)}function wi(e,t,r){xi.call(this,new Uint8ClampedArray(e),t,r)}function Mi(e,t,r){xi.call(this,new Int16Array(e),t,r)}function Si(e,t,r){xi.call(this,new Uint16Array(e),t,r)}function Ti(e,t,r){xi.call(this,new Int32Array(e),t,r)}function Ei(e,t,r){xi.call(this,new Uint32Array(e),t,r)}function Ai(e,t,r){xi.call(this,new Float32Array(e),t,r)}function Li(e,t,r){xi.call(this,new Float64Array(e),t,r)}function Ri(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function Ci(e){if(0===e.length)return-1/0;for(var t=e[0],r=1,n=e.length;rt&&(t=e[r]);return t}Object.defineProperty(xi.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(xi.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this},copyAt:function(e,t,r){e*=this.itemSize,r*=t.itemSize;for(var n=0,i=this.itemSize;n0,o=i[1]&&i[1].length>0,s=e.morphTargets,c=s.length;if(c>0){t=[];for(var l=0;l0){h=[];for(l=0;l0&&0===r.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(l=0;l65535?Ei:Si)(e,1):this.index=e},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,t){return this.attributes[e]=t,this},deleteAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,r){this.groups.push({start:e,count:t,materialIndex:void 0!==r?r:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix4:function(e){var t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);var r=this.attributes.normal;if(void 0!==r){var n=(new Br).getNormalMatrix(e);r.applyNormalMatrix(n),r.needsUpdate=!0}var i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(e){return Oi.makeRotationX(e),this.applyMatrix4(Oi),this},rotateY:function(e){return Oi.makeRotationY(e),this.applyMatrix4(Oi),this},rotateZ:function(e){return Oi.makeRotationZ(e),this.applyMatrix4(Oi),this},translate:function(e,t,r){return Oi.makeTranslation(e,t,r),this.applyMatrix4(Oi),this},scale:function(e,t,r){return Oi.makeScale(e,t,r),this.applyMatrix4(Oi),this},lookAt:function(e){return Di.lookAt(e),Di.updateMatrix(),this.applyMatrix4(Di.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ii).negate(),this.translate(Ii.x,Ii.y,Ii.z),this},setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var r=new Ai(3*t.vertices.length,3),n=new Ai(3*t.colors.length,3);if(this.setAttribute("position",r.copyVector3sArray(t.vertices)),this.setAttribute("color",n.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var i=new Ai(t.lineDistances.length,1);this.setAttribute("lineDistance",i.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){for(var t=[],r=0,n=e.length;r0){var r=new Float32Array(3*e.normals.length);this.setAttribute("normal",new xi(r,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var n=new Float32Array(3*e.colors.length);this.setAttribute("color",new xi(n,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var i=new Float32Array(2*e.uvs.length);this.setAttribute("uv",new xi(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var a=new Float32Array(2*e.uvs2.length);this.setAttribute("uv2",new xi(a,2).copyVector2sArray(e.uvs2))}for(var o in this.groups=e.groups,e.morphTargets){for(var s=[],c=e.morphTargets[o],l=0,h=c.length;l0){var d=new Ai(4*e.skinIndices.length,4);this.setAttribute("skinIndex",d.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var f=new Ai(4*e.skinWeights.length,4);this.setAttribute("skinWeight",f.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new In);var e=this.attributes.position,t=this.morphAttributes.position;if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(var r=0,n=t.length;r0&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var r in t)void 0!==t[r]&&(e[r]=t[r]);return e}e.data={attributes:{}};var n=this.index;null!==n&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});var i=this.attributes;for(var r in i){var a=(p=i[r]).toJSON();""!==p.name&&(a.name=p.name),e.data.attributes[r]=a}var o={},s=!1;for(var r in this.morphAttributes){for(var c=this.morphAttributes[r],l=[],h=0,u=c.length;h0&&(o[r]=l,s=!0)}s&&(e.data.morphAttributes=o,e.data.morphTargetsRelative=this.morphTargetsRelative);var d=this.groups;d.length>0&&(e.data.groups=JSON.parse(JSON.stringify(d)));var f=this.boundingSphere;return null!==f&&(e.data.boundingSphere={center:f.center.toArray(),radius:f.radius}),e},clone:function(){return(new Ui).copy(this)},copy:function(e){var t,r,n;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var i=e.index;null!==i&&this.setIndex(i.clone());var a=e.attributes;for(t in a){var o=a[t];this.setAttribute(t,o.clone())}var s=e.morphAttributes;for(t in s){var c=[],l=s[t];for(r=0,n=l.length;rr.far?null:{distance:c,point:ta.clone(),object:e}}function ia(e,t,r,n,i,a,o,s,c,l,h,u){Vi.fromBufferAttribute(i,l),ki.fromBufferAttribute(i,h),ji.fromBufferAttribute(i,u);var p=e.morphTargetInfluences;if(t.morphTargets&&a&&p){Yi.set(0,0,0),Zi.set(0,0,0),Ji.set(0,0,0);for(var d=0,f=a.length;d0){var o=i[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,t){var r,n=this.geometry,i=this.material,a=this.matrixWorld;if(void 0!==i&&(null===n.boundingSphere&&n.computeBoundingSphere(),Hi.copy(n.boundingSphere),Hi.applyMatrix4(a),!1!==e.ray.intersectsSphere(Hi)&&(Gi.getInverse(a),zi.copy(e.ray).applyMatrix4(Gi),null===n.boundingBox||!1!==zi.intersectsBox(n.boundingBox))))if(n.isBufferGeometry){var o,s,c,l,h,u,p,d,f,m=n.index,v=n.attributes.position,g=n.morphAttributes.position,y=n.morphTargetsRelative,x=n.attributes.uv,_=n.attributes.uv2,b=n.groups,w=n.drawRange;if(null!==m)if(Array.isArray(i))for(l=0,u=b.length;l0&&(E=C);for(var P=0,O=R.length;P0)for(l=0;l0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var e,t,r;for(this.computeFaceNormals(),e=0,t=this.faces.length;e0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,t,r,n,i;for(r=0,n=this.faces.length;r=0;r--){var f=p[r];for(this.faces.splice(f,1),o=0,s=this.faceVertexUvs.length;o0,v=d.vertexNormals.length>0,g=1!==d.color.r||1!==d.color.g||1!==d.color.b,y=d.vertexColors.length>0,x=0;if(x=M(x,0,0),x=M(x,1,!0),x=M(x,2,!1),x=M(x,3,f),x=M(x,4,m),x=M(x,5,v),x=M(x,6,g),x=M(x,7,y),o.push(x),o.push(d.a,d.b,d.c),o.push(d.materialIndex),f){var _=this.faceVertexUvs[0][i];o.push(E(_[0]),E(_[1]),E(_[2]))}if(m&&o.push(S(d.normal)),v){var b=d.vertexNormals;o.push(S(b[0]),S(b[1]),S(b[2]))}if(g&&o.push(T(d.color)),y){var w=d.vertexColors;o.push(T(w[0]),T(w[1]),T(w[2]))}}function M(e,t,r){return r?e|1<0&&(e.data.colors=l),u.length>0&&(e.data.uvs=[u]),e.data.faces=o,e},clone:function(){return(new la).copy(this)},copy:function(e){var t,r,n,i,a,o;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var s=e.vertices;for(t=0,r=s.length;t0?1:-1,l.push(R.x,R.y,R.z),h.push(y/m),h.push(1-x/v),A+=1}}for(x=0;x0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;var i={};for(var a in this.extensions)!0===this.extensions[a]&&(i[a]=!0);return Object.keys(i).length>0&&(t.extensions=i),t},ya.prototype=Object.assign(Object.create(xn.prototype),{constructor:ya,isCamera:!0,copy:function(e,t){return xn.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new qr),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){xn.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(e,t){xn.prototype.updateWorldMatrix.call(this,e,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),xa.prototype=Object.assign(Object.create(ya.prototype),{constructor:xa,isPerspectiveCamera:!0,copy:function(e,t){return ya.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*Ir.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*Ir.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*Ir.RAD2DEG*Math.atan(Math.tan(.5*Ir.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,r,n,i,a){this.aspect=e/t,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=e,this.view.fullHeight=t,this.view.offsetX=r,this.view.offsetY=n,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*Ir.DEG2RAD*this.fov)/this.zoom,r=2*t,n=this.aspect*r,i=-.5*n,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;i+=a.offsetX*n/o,t-=a.offsetY*r/s,n*=a.width/o,r*=a.height/s}var c=this.filmOffset;0!==c&&(i+=e*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+n,t,t-r,e,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=xn.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}});var _a=90,ba=1;function wa(e,t,r,n){xn.call(this),this.type="CubeCamera";var i=new xa(_a,ba,e,t);i.up.set(0,-1,0),i.lookAt(new qr(1,0,0)),this.add(i);var a=new xa(_a,ba,e,t);a.up.set(0,-1,0),a.lookAt(new qr(-1,0,0)),this.add(a);var o=new xa(_a,ba,e,t);o.up.set(0,0,1),o.lookAt(new qr(0,1,0)),this.add(o);var s=new xa(_a,ba,e,t);s.up.set(0,0,-1),s.lookAt(new qr(0,-1,0)),this.add(s);var c=new xa(_a,ba,e,t);c.up.set(0,-1,0),c.lookAt(new qr(0,0,1)),this.add(c);var l=new xa(_a,ba,e,t);l.up.set(0,-1,0),l.lookAt(new qr(0,0,-1)),this.add(l),n=n||{format:Fe,magFilter:xe,minFilter:xe},this.renderTarget=new Ma(r,n),this.renderTarget.texture.name="CubeCamera",this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var r=e.getRenderTarget(),n=this.renderTarget,h=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,i),e.setRenderTarget(n,1),e.render(t,a),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,s),e.setRenderTarget(n,4),e.render(t,c),n.texture.generateMipmaps=h,e.setRenderTarget(n,5),e.render(t,l),e.setRenderTarget(r)},this.clear=function(e,t,r,n){for(var i=e.getRenderTarget(),a=this.renderTarget,o=0;o<6;o++)e.setRenderTarget(a,o),e.clear(t,r,n);e.setRenderTarget(i)}}function Ma(e,t,r){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=r),Hr.call(this,e,e,t)}function Sa(e,t,r,n,i,a,o,s,c,l,h,u){Gr.call(this,null,a,o,s,c,l,n,i,h,u),this.image={data:e||null,width:t||1,height:r||1},this.magFilter=void 0!==c?c:fe,this.minFilter=void 0!==l?l:fe,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}wa.prototype=Object.create(xn.prototype),wa.prototype.constructor=wa,Ma.prototype=Object.create(Hr.prototype),Ma.prototype.constructor=Ma,Ma.prototype.isWebGLCubeRenderTarget=!0,Ma.prototype.fromEquirectangularTexture=function(e,t){this.texture.type=t.type,this.texture.format=t.format,this.texture.encoding=t.encoding;var r=new _n,n={uniforms:{tEquirect:{value:null}},vertexShader:["varying vec3 vWorldDirection;","vec3 transformDirection( in vec3 dir, in mat4 matrix ) {","\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );","}","void main() {","\tvWorldDirection = transformDirection( position, modelMatrix );","\t#include ","\t#include ","}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","varying vec3 vWorldDirection;","#define RECIPROCAL_PI 0.31830988618","#define RECIPROCAL_PI2 0.15915494","void main() {","\tvec3 direction = normalize( vWorldDirection );","\tvec2 sampleUV;","\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;","\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;","\tgl_FragColor = texture2D( tEquirect, sampleUV );","}"].join("\n")},i=new ga({type:"CubemapFromEquirect",uniforms:pa(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:f,blending:y});i.uniforms.tEquirect.value=t;var a=new ra(new ua(5,5,5),i);r.add(a);var o=new wa(1,10,1);return o.renderTarget=this,o.renderTarget.texture.name="CubeCameraTexture",o.update(e,r),a.geometry.dispose(),a.material.dispose(),this},Sa.prototype=Object.create(Gr.prototype),Sa.prototype.constructor=Sa,Sa.prototype.isDataTexture=!0;var Ta=new Fn,Ea=new qr;function Aa(e,t,r,n,i,a){this.planes=[void 0!==e?e:new Zn,void 0!==t?t:new Zn,void 0!==r?r:new Zn,void 0!==n?n:new Zn,void 0!==i?i:new Zn,void 0!==a?a:new Zn]}Object.assign(Aa.prototype,{set:function(e,t,r,n,i,a){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(r),o[3].copy(n),o[4].copy(i),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){for(var t=this.planes,r=0;r<6;r++)t[r].copy(e.planes[r]);return this},setFromProjectionMatrix:function(e){var t=this.planes,r=e.elements,n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],c=r[5],l=r[6],h=r[7],u=r[8],p=r[9],d=r[10],f=r[11],m=r[12],v=r[13],g=r[14],y=r[15];return t[0].setComponents(o-n,h-s,f-u,y-m).normalize(),t[1].setComponents(o+n,h+s,f+u,y+m).normalize(),t[2].setComponents(o+i,h+c,f+p,y+v).normalize(),t[3].setComponents(o-i,h-c,f-p,y-v).normalize(),t[4].setComponents(o-a,h-l,f-d,y-g).normalize(),t[5].setComponents(o+a,h+l,f+d,y+g).normalize(),this},intersectsObject:function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),Ta.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Ta)},intersectsSprite:function(e){return Ta.center.set(0,0,0),Ta.radius=.7071067811865476,Ta.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ta)},intersectsSphere:function(e){for(var t=this.planes,r=e.center,n=-e.radius,i=0;i<6;i++){if(t[i].distanceToPoint(r)0?e.max.x:e.min.x,Ea.y=n.normal.y>0?e.max.y:e.min.y,Ea.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(Ea)<0)return!1}return!0},containsPoint:function(e){for(var t=this.planes,r=0;r<6;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0}});var La={common:{diffuse:{value:new hi(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new Br},uv2Transform:{value:new Br},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Nr(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new hi(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new hi(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Br}},sprite:{diffuse:{value:new hi(15658734)},opacity:{value:1},center:{value:new Nr(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Br}}};function Ra(){var e=null,t=!1,r=null;function n(i,a){!1!==t&&(r(i,a),e.requestAnimationFrame(n))}return{start:function(){!0!==t&&null!==r&&(e.requestAnimationFrame(n),t=!0)},stop:function(){t=!1},setAnimationLoop:function(e){r=e},setContext:function(t){e=t}}}function Ca(e,t){var r=t.isWebGL2,n=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),n.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);var r=n.get(t);r&&(e.deleteBuffer(r.buffer),n.delete(t))},update:function(t,i){t.isInterleavedBufferAttribute&&(t=t.data);var a=n.get(t);void 0===a?n.set(t,function(t,r){var n=t.array,i=t.usage,a=e.createBuffer();e.bindBuffer(r,a),e.bufferData(r,n,i),t.onUploadCallback();var o=5126;return n instanceof Float32Array?o=5126:n instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):n instanceof Uint16Array?o=5123:n instanceof Int16Array?o=5122:n instanceof Uint32Array?o=5125:n instanceof Int32Array?o=5124:n instanceof Int8Array?o=5120:n instanceof Uint8Array&&(o=5121),{buffer:a,type:o,bytesPerElement:n.BYTES_PER_ELEMENT,version:t.version}}(t,i)):a.version0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var a="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext,o=void 0!==r.precision?r.precision:"highp",s=i(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var c=!0===r.logarithmicDepthBuffer,l=e.getParameter(34930),h=e.getParameter(35660),u=e.getParameter(3379),p=e.getParameter(34076),d=e.getParameter(34921),f=e.getParameter(36347),m=e.getParameter(36348),v=e.getParameter(36349),g=h>0,y=a||!!t.get("OES_texture_float");return{isWebGL2:a,getMaxAnisotropy:function(){if(void 0!==n)return n;var r=t.get("EXT_texture_filter_anisotropic");return n=null!==r?e.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:o,logarithmicDepthBuffer:c,maxTextures:l,maxVertexTextures:h,maxTextureSize:u,maxCubemapSize:p,maxAttributes:d,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:v,vertexTextures:g,floatFragmentTextures:y,floatVertexTextures:g&&y,maxSamples:a?e.getParameter(36183):0}}function ic(){var e=this,t=null,r=0,n=!1,i=!1,a=new Zn,o=new Br,s={value:null,needsUpdate:!1};function c(){s.value!==t&&(s.value=t,s.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function l(t,r,n,i){var c=null!==t?t.length:0,l=null;if(0!==c){if(l=s.value,!0!==i||null===l){var h=n+4*c,u=r.matrixWorldInverse;o.getNormalMatrix(u),(null===l||l.length65535?Ei:Si)(r,1);d.version=o,t.update(d,34963);var f=i.get(e);f&&t.remove(f),i.set(e,d)}return{get:function(e,t){var i=n.get(t);return i||(t.addEventListener("dispose",a),t.isBufferGeometry?i=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new Ui).setFromObject(e)),i=t._bufferGeometry),n.set(t,i),r.memory.geometries++,i)},update:function(e){var r=e.index,n=e.attributes;for(var i in null!==r&&t.update(r,34963),n)t.update(n[i],34962);var a=e.morphAttributes;for(var i in a)for(var o=a[i],s=0,c=o.length;s0)return e;var i=t*r,a=xc[i];if(void 0===a&&(a=new Float32Array(i),xc[i]=a),0!==t){n.toArray(a,0);for(var o=1,s=0;o!==t;++o)s+=r,e[o].toArray(a,s)}return a}function Tc(e,t){if(e.length!==t.length)return!1;for(var r=0,n=e.length;r/gm;function Al(e){return e.replace(El,Ll)}function Ll(e,t){var r=$s[t];if(void 0===r)throw new Error("Can not resolve #include <"+t+">");return Al(r)}var Rl=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;function Cl(e){return e.replace(Rl,Pl)}function Pl(e,t,r,n){for(var i="",a=parseInt(t);a0?e.gammaFactor:1,f=r.isWebGL2?"":_l(r),m=bl(o),v=a.createProgram();if(r.isRawShaderMaterial?((n=[m].filter(Ml).join("\n")).length>0&&(n+="\n"),(i=[f,m].filter(Ml).join("\n")).length>0&&(i+="\n")):(n=[Ol(r),"#define SHADER_NAME "+r.shaderName,m,r.instancing?"#define USE_INSTANCING":"",r.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+r.maxBones,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+u:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMap&&r.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",r.normalMap&&r.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.displacementMap&&r.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.vertexTangents?"#define USE_TANGENT":"",r.vertexColors?"#define USE_COLOR":"",r.vertexUvs?"#define USE_UV":"",r.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",r.flatShading?"#define FLAT_SHADED":"",r.skinning?"#define USE_SKINNING":"",r.useVertexTexture?"#define BONE_TEXTURE":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.morphNormals&&!1===r.flatShading?"#define USE_MORPHNORMALS":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+l:"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Ml).join("\n"),i=[f,Ol(r),"#define SHADER_NAME "+r.shaderName,m,r.alphaTest?"#define ALPHATEST "+r.alphaTest+(r.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.matcap?"#define USE_MATCAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+h:"",r.envMap?"#define "+u:"",r.envMap?"#define "+p:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMap&&r.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",r.normalMap&&r.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.sheen?"#define USE_SHEEN":"",r.vertexTangents?"#define USE_TANGENT":"",r.vertexColors?"#define USE_COLOR":"",r.vertexUvs?"#define USE_UV":"",r.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",r.gradientMap?"#define USE_GRADIENTMAP":"",r.flatShading?"#define FLAT_SHADED":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+l:"",r.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",r.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(r.extensionShaderTextureLOD||r.envMap)&&r.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",r.toneMapping!==Q?"#define TONE_MAPPING":"",r.toneMapping!==Q?$s.tonemapping_pars_fragment:"",r.toneMapping!==Q?xl("toneMapping",r.toneMapping):"",r.dithering?"#define DITHERING":"",r.outputEncoding||r.mapEncoding||r.matcapEncoding||r.envMapEncoding||r.emissiveMapEncoding||r.lightMapEncoding?$s.encodings_pars_fragment:"",r.mapEncoding?gl("mapTexelToLinear",r.mapEncoding):"",r.matcapEncoding?gl("matcapTexelToLinear",r.matcapEncoding):"",r.envMapEncoding?gl("envMapTexelToLinear",r.envMapEncoding):"",r.emissiveMapEncoding?gl("emissiveMapTexelToLinear",r.emissiveMapEncoding):"",r.lightMapEncoding?gl("lightMapTexelToLinear",r.lightMapEncoding):"",r.outputEncoding?yl("linearToOutputTexel",r.outputEncoding):"",r.depthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(Ml).join("\n")),s=Tl(s=Sl(s=Al(s),r),r),c=Tl(c=Sl(c=Al(c),r),r),s=Cl(s),c=Cl(c),r.isWebGL2&&!r.isRawShaderMaterial){var g=!1,y=/^\s*#version\s+300\s+es\s*\n/;r.isShaderMaterial&&null!==s.match(y)&&null!==c.match(y)&&(g=!0,s=s.replace(y,""),c=c.replace(y,"")),n=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+n,i=["#version 300 es\n","#define varying in",g?"":"out highp vec4 pc_fragColor;",g?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+i}var x,_,b=i+c,w=pl(a,35633,n+s),M=pl(a,35632,b);if(a.attachShader(v,w),a.attachShader(v,M),void 0!==r.index0AttributeName?a.bindAttribLocation(v,0,r.index0AttributeName):!0===r.morphTargets&&a.bindAttribLocation(v,0,"position"),a.linkProgram(v),e.debug.checkShaderErrors){var S=a.getProgramInfoLog(v).trim(),T=a.getShaderInfoLog(w).trim(),E=a.getShaderInfoLog(M).trim(),A=!0,L=!0;if(!1===a.getProgramParameter(v,35714)){A=!1;var R=vl(a,w,"vertex"),C=vl(a,M,"fragment");console.error("THREE.WebGLProgram: shader error: ",a.getError(),"35715",a.getProgramParameter(v,35715),"gl.getProgramInfoLog",S,R,C)}else""!==S?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",S):""!==T&&""!==E||(L=!1);L&&(this.diagnostics={runnable:A,programLog:S,vertexShader:{log:T,prefix:n},fragmentShader:{log:E,prefix:i}})}return a.detachShader(v,w),a.detachShader(v,M),a.deleteShader(w),a.deleteShader(M),this.getUniforms=function(){return void 0===x&&(x=new ul(a,v)),x},this.getAttributes=function(){return void 0===_&&(_=wl(a,v)),_},this.destroy=function(){a.deleteProgram(v),this.program=void 0},this.name=r.shaderName,this.id=dl++,this.cacheKey=t,this.usedTimes=1,this.program=v,this.vertexShader=w,this.fragmentShader=M,this}function Ul(e,t,r){var n=[],i=r.isWebGL2,a=r.logarithmicDepthBuffer,o=r.floatVertexTextures,s=r.precision,c=r.maxVertexUniforms,l=r.vertexTextures,h={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},u=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen"];function p(e){var t;return e?e.isTexture?t=e.encoding:e.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),t=e.texture.encoding):t=Xt,t}this.getParameters=function(n,u,d,v,g,y,x){var _=v.fog,b=n.isMeshStandardMaterial?v.environment:null,w=n.envMap||b,M=h[n.type],S=x.isSkinnedMesh?function(e){var t=e.skeleton.bones;if(o)return 1024;var r=c,n=Math.floor((r-20)/4),i=Math.min(n,t.length);return i0,maxBones:S,useVertexTexture:o,morphTargets:n.morphTargets,morphNormals:n.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:u.directional.length,numPointLights:u.point.length,numSpotLights:u.spot.length,numRectAreaLights:u.rectArea.length,numHemiLights:u.hemi.length,numDirLightShadows:u.directionalShadowMap.length,numPointLightShadows:u.pointShadowMap.length,numSpotLightShadows:u.spotShadowMap.length,numClippingPlanes:g,numClipIntersection:y,dithering:n.dithering,shadowMapEnabled:e.shadowMap.enabled&&d.length>0,shadowMapType:e.shadowMap.type,toneMapping:n.toneMapped?e.toneMapping:Q,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:n.premultipliedAlpha,alphaTest:n.alphaTest,doubleSided:n.side===m,flipSided:n.side===f,depthPacking:void 0!==n.depthPacking&&n.depthPacking,index0AttributeName:n.index0AttributeName,extensionDerivatives:n.extensions&&n.extensions.derivatives,extensionFragDepth:n.extensions&&n.extensions.fragDepth,extensionDrawbuffers:n.extensions&&n.extensions.drawBuffers,extensionShaderTextureLOD:n.extensions&&n.extensions.shaderTextureLOD,rendererExtensionFragDepth:i||null!==t.get("EXT_frag_depth"),rendererExtensionDrawBuffers:i||null!==t.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:i||null!==t.get("EXT_shader_texture_lod"),onBeforeCompile:n.onBeforeCompile}},this.getProgramCacheKey=function(t){var r=[];if(t.shaderID?r.push(t.shaderID):(r.push(t.fragmentShader),r.push(t.vertexShader)),void 0!==t.defines)for(var n in t.defines)r.push(n),r.push(t.defines[n]);if(void 0===t.isRawShaderMaterial){for(var i=0;i1&&r.sort(e||zl),n.length>1&&n.sort(t||Hl)}}}function kl(){var e=new WeakMap;function t(r){var n=r.target;n.removeEventListener("dispose",t),e.delete(n)}return{get:function(r,n){var i,a=e.get(r);return void 0===a?(i=new Vl,e.set(r,new WeakMap),e.get(r).set(n,i),r.addEventListener("dispose",t)):void 0===(i=a.get(n))&&(i=new Vl,a.set(n,i)),i},dispose:function(){e=new WeakMap}}}function jl(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var r;switch(t.type){case"DirectionalLight":r={direction:new qr,color:new hi};break;case"SpotLight":r={position:new qr,direction:new qr,color:new hi,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":r={position:new qr,color:new hi,distance:0,decay:0};break;case"HemisphereLight":r={direction:new qr,skyColor:new hi,groundColor:new hi};break;case"RectAreaLight":r={color:new hi,position:new qr,halfWidth:new qr,halfHeight:new qr}}return e[t.id]=r,r}}}function Wl(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var r;switch(t.type){case"DirectionalLight":case"SpotLight":r={shadowBias:0,shadowRadius:1,shadowMapSize:new Nr};break;case"PointLight":r={shadowBias:0,shadowRadius:1,shadowMapSize:new Nr,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=r,r}}}var ql=0;function Xl(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function Yl(){for(var e=new jl,t=Wl(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},n=0;n<9;n++)r.probe.push(new qr);var i=new qr,a=new en,o=new en;return{setup:function(n,s,c){for(var l=0,h=0,u=0,p=0;p<9;p++)r.probe[p].set(0,0,0);var d=0,f=0,m=0,v=0,g=0,y=0,x=0,_=0,b=c.matrixWorldInverse;n.sort(Xl),p=0;for(var w=n.length;p0:!0===s.isGeometry&&(f=s.morphTargets&&s.morphTargets.length>0));var m=!1;!0===t.isSkinnedMesh&&(!0===r.skinning?m=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t)),c=h(f,m,!0===t.isInstancedMesh)}else c=d;if(e.localClippingEnabled&&!0===r.clipShadows&&0!==r.clippingPlanes.length){var v=c.uuid,g=r.uuid,y=l[v];void 0===y&&(y={},l[v]=y);var x=y[g];void 0===x&&(x=c.clone(),y[g]=x),c=x}return c.visible=r.visible,c.wireframe=r.wireframe,c.side=o===p?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:u[r.side],c.clipShadows=r.clipShadows,c.clippingPlanes=r.clippingPlanes,c.clipIntersection=r.clipIntersection,c.wireframeLinewidth=r.wireframeLinewidth,c.linewidth=r.linewidth,!0===n.isPointLight&&!0===c.isMeshDistanceMaterial&&(c.referencePosition.setFromMatrixPosition(n.matrixWorld),c.nearDistance=i,c.farDistance=a),c}function E(r,i,a,o,s){if(!1!==r.visible){if(r.layers.test(i.layers)&&(r.isMesh||r.isLine||r.isPoints)&&(r.castShadow||r.receiveShadow&&s===p)&&(!r.frustumCulled||n.intersectsObject(r))){r.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,r.matrixWorld);var c=t.update(r),l=r.material;if(Array.isArray(l))for(var h=c.groups,u=0,d=h.length;ur||i.y>r)&&(console.warn("THREE.WebGLShadowMap:",v,"has shadow exceeding max texture size, reducing"),i.x>r&&(a.x=Math.floor(r/x.x),i.x=a.x*x.x,g.mapSize.x=a.x),i.y>r&&(a.y=Math.floor(r/x.y),i.y=a.y*x.y,g.mapSize.y=a.y)),null===g.map&&!g.isPointLightShadow&&this.type===p){var _={minFilter:xe,magFilter:xe,format:Ue};g.map=new Hr(i.x,i.y,_),g.map.texture.name=v.name+".shadowMap",g.mapPass=new Hr(i.x,i.y,_),g.camera.updateProjectionMatrix()}if(null===g.map){_={minFilter:fe,magFilter:fe,format:Ue};g.map=new Hr(i.x,i.y,_),g.map.texture.name=v.name+".shadowMap",g.camera.updateProjectionMatrix()}e.setRenderTarget(g.map),e.clear();for(var M=g.getViewportCount(),S=0;S=1):-1!==ue.indexOf("OpenGL ES")&&(he=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(ue)[1]),le=he>=2);var pe=null,de={},fe=new zr,me=new zr;function ve(t,r,n){var i=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(var o=0;on||e.height>n)&&(i=n/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){var a=t?Ir.floorPowerOfTwo:Math.floor,o=a(i*e.width),c=a(i*e.height);void 0===s&&(s=m(o,c));var l=r?m(o,c):s;return l.width=o,l.height=c,l.getContext("2d").drawImage(e,0,0,o,c),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+o+"x"+c+")."),l}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function g(e){return Ir.isPowerOfTwo(e.width)&&Ir.isPowerOfTwo(e.height)}function y(e,t){return e.generateMipmaps&&t&&e.minFilter!==fe&&e.minFilter!==xe}function x(t,r,i,a){e.generateMipmap(t),n.get(r).__maxMipLevel=Math.log(Math.max(i,a))*Math.LOG2E}function _(r,n,i){if(!1===c)return n;if(null!==r){if(void 0!==e[r])return e[r];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+r+"'")}var a=n;return 6403===n&&(5126===i&&(a=33326),5131===i&&(a=33325),5121===i&&(a=33321)),6407===n&&(5126===i&&(a=34837),5131===i&&(a=34843),5121===i&&(a=32849)),6408===n&&(5126===i&&(a=34836),5131===i&&(a=34842),5121===i&&(a=32856)),33325===a||33326===a||34842===a||34836===a?t.get("EXT_color_buffer_float"):34843!==a&&34837!==a||console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."),a}function b(e){return e===fe||e===me||e===ge?9728:9729}function w(t){var r=t.target;r.removeEventListener("dispose",w),function(t){var r=n.get(t);if(void 0===r.__webglInit)return;e.deleteTexture(r.__webglTexture),n.remove(t)}(r),r.isVideoTexture&&d.delete(r),o.memory.textures--}function M(t){var r=t.target;r.removeEventListener("dispose",M),function(t){var r=n.get(t),i=n.get(t.texture);if(!t)return;void 0!==i.__webglTexture&&e.deleteTexture(i.__webglTexture);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(var a=0;a<6;a++)e.deleteFramebuffer(r.__webglFramebuffer[a]),r.__webglDepthbuffer&&e.deleteRenderbuffer(r.__webglDepthbuffer[a]);else e.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&e.deleteRenderbuffer(r.__webglDepthbuffer);n.remove(t.texture),n.remove(t)}(r),o.memory.textures--}var S=0;function T(e,t){var i=n.get(e);if(e.isVideoTexture&&function(e){var t=o.render.frame;d.get(e)!==t&&(d.set(e,t),e.update())}(e),e.version>0&&i.__version!==e.version){var a=e.image;if(void 0===a)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==a.complete)return void O(i,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}r.activeTexture(33984+t),r.bindTexture(3553,i.__webglTexture)}function E(t,i){if(6===t.image.length){var o=n.get(t);if(t.version>0&&o.__version!==t.version){P(o,t),r.activeTexture(33984+i),r.bindTexture(34067,o.__webglTexture),e.pixelStorei(37440,t.flipY);for(var s=t&&(t.isCompressedTexture||t.image[0].isCompressedTexture),l=t.image[0]&&t.image[0].isDataTexture,u=[],p=0;p<6;p++)u[p]=s||l?l?t.image[p].image:t.image[p]:v(t.image[p],!1,!0,h);var d,f=u[0],m=g(f)||c,b=a.convert(t.format),w=a.convert(t.type),M=_(t.internalFormat,b,w);if(C(34067,t,m),s){for(p=0;p<6;p++){d=u[p].mipmaps;for(var S=0;S1||n.get(a).__currentAnisotropy)&&(e.texParameterf(r,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),n.get(a).__currentAnisotropy=a.anisotropy)}}function P(t,r){void 0===t.__webglInit&&(t.__webglInit=!0,r.addEventListener("dispose",w),t.__webglTexture=e.createTexture(),o.memory.textures++)}function O(t,n,i){var o=3553;n.isDataTexture2DArray&&(o=35866),n.isDataTexture3D&&(o=32879),P(t,n),r.activeTexture(33984+i),r.bindTexture(o,t.__webglTexture),e.pixelStorei(37440,n.flipY),e.pixelStorei(37441,n.premultiplyAlpha),e.pixelStorei(3317,n.unpackAlignment);var s=function(e){return!c&&(e.wrapS!==pe||e.wrapT!==pe||e.minFilter!==fe&&e.minFilter!==xe)}(n)&&!1===g(n.image),l=v(n.image,s,!1,u),h=g(l)||c,p=a.convert(n.format),d=a.convert(n.type),f=_(n.internalFormat,p,d);C(o,n,h);var m,b=n.mipmaps;if(n.isDepthTexture){if(f=6402,n.type===Ce){if(!1===c)throw new Error("Float Depth Texture only supported in WebGL2.0");f=36012}else c&&(f=33189);n.format===Ve&&6402===f&&n.type!==Ae&&n.type!==Re&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=Ae,d=a.convert(n.type)),n.format===ke&&(f=34041,n.type!==Ne&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=Ne,d=a.convert(n.type))),r.texImage2D(3553,0,f,l.width,l.height,0,p,d,null)}else if(n.isDataTexture)if(b.length>0&&h){for(var w=0,M=b.length;w0&&h){for(w=0,M=b.length;w=l&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+l),S+=1,e},this.resetTextureUnits=function(){S=0},this.setTexture2D=T,this.setTexture2DArray=function(e,t){var i=n.get(e);e.version>0&&i.__version!==e.version?O(i,e,t):(r.activeTexture(33984+t),r.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(e,t){var i=n.get(e);e.version>0&&i.__version!==e.version?O(i,e,t):(r.activeTexture(33984+t),r.bindTexture(32879,i.__webglTexture))},this.setTextureCube=E,this.setTextureCubeDynamic=A,this.setupRenderTarget=function(t){var i=n.get(t),s=n.get(t.texture);t.addEventListener("dispose",M),s.__webglTexture=e.createTexture(),o.memory.textures++;var l=!0===t.isWebGLCubeRenderTarget,h=!0===t.isWebGLMultisampleRenderTarget,u=g(t)||c;if(l){i.__webglFramebuffer=[];for(var p=0;p<6;p++)i.__webglFramebuffer[p]=e.createFramebuffer()}else if(i.__webglFramebuffer=e.createFramebuffer(),h)if(c){i.__webglMultisampledFramebuffer=e.createFramebuffer(),i.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,i.__webglColorRenderbuffer);var d=a.convert(t.texture.format),f=a.convert(t.texture.type),m=_(t.texture.internalFormat,d,f),v=B(t);e.renderbufferStorageMultisample(36161,v,m,t.width,t.height),e.bindFramebuffer(36160,i.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,i.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),t.depthBuffer&&(i.__webglDepthRenderbuffer=e.createRenderbuffer(),I(i.__webglDepthRenderbuffer,t,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(l){for(r.bindTexture(34067,s.__webglTexture),C(34067,t.texture,u),p=0;p<6;p++)D(i.__webglFramebuffer[p],t,36064,34069+p);y(t.texture,u)&&x(34067,t.texture,t.width,t.height),r.bindTexture(34067,null)}else r.bindTexture(3553,s.__webglTexture),C(3553,t.texture,u),D(i.__webglFramebuffer,t,36064,3553),y(t.texture,u)&&x(3553,t.texture,t.width,t.height),r.bindTexture(3553,null);t.depthBuffer&&N(t)},this.updateRenderTargetMipmap=function(e){var t=e.texture;if(y(t,g(e)||c)){var i=e.isWebGLCubeRenderTarget?34067:3553,a=n.get(t).__webglTexture;r.bindTexture(i,a),x(i,t,e.width,e.height),r.bindTexture(i,null)}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(c){var r=n.get(t);e.bindFramebuffer(36008,r.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,r.__webglFramebuffer);var i=t.width,a=t.height,o=16384;t.depthBuffer&&(o|=256),t.stencilBuffer&&(o|=1024),e.blitFramebuffer(0,0,i,a,0,0,i,a,o,9728)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===F&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),F=!0),e=e.texture),T(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLCubeRenderTarget&&(!1===U&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),U=!0),e=e.texture),e&&e.isCubeTexture||Array.isArray(e.image)&&6===e.image.length?E(e,t):A(e,t)}}function ih(e,t,r){var n=r.isWebGL2;return{convert:function(e){var r;if(e===Se)return 5121;if(e===Oe)return 32819;if(e===De)return 32820;if(e===Ie)return 33635;if(e===Te)return 5120;if(e===Ee)return 5122;if(e===Ae)return 5123;if(e===Le)return 5124;if(e===Re)return 5125;if(e===Ce)return 5126;if(e===Pe)return n?5131:null!==(r=t.get("OES_texture_half_float"))?r.HALF_FLOAT_OES:null;if(e===Be)return 6406;if(e===Fe)return 6407;if(e===Ue)return 6408;if(e===Ge)return 6409;if(e===ze)return 6410;if(e===Ve)return 6402;if(e===ke)return 34041;if(e===je)return 6403;if(e===We)return 36244;if(e===qe)return 33319;if(e===Xe)return 33320;if(e===Ye)return 36248;if(e===Ze)return 36249;if(e===Je||e===Qe||e===Ke||e===$e){if(null===(r=t.get("WEBGL_compressed_texture_s3tc")))return null;if(e===Je)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===Qe)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===Ke)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===$e)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(e===et||e===tt||e===rt||e===nt){if(null===(r=t.get("WEBGL_compressed_texture_pvrtc")))return null;if(e===et)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===tt)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===rt)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===nt)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(e===it)return null!==(r=t.get("WEBGL_compressed_texture_etc1"))?r.COMPRESSED_RGB_ETC1_WEBGL:null;if((e===at||e===ot)&&null!==(r=t.get("WEBGL_compressed_texture_etc"))){if(e===at)return r.COMPRESSED_RGB8_ETC2;if(e===ot)return r.COMPRESSED_RGBA8_ETC2_EAC}return e===st||e===ct||e===lt||e===ht||e===ut||e===pt||e===dt||e===ft||e===mt||e===vt||e===gt||e===yt||e===xt||e===_t||e===bt||e===wt||e===Mt||e===St||e===Tt||e===Et||e===At||e===Lt||e===Rt||e===Ct||e===Pt||e===Ot||e===Dt||e===It?null!==(r=t.get("WEBGL_compressed_texture_astc"))?e:null:e===Ne?n?34042:null!==(r=t.get("WEBGL_depth_texture"))?r.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function ah(e){xa.call(this),this.cameras=e||[]}function oh(){xn.call(this),this.type="Group"}function sh(e,t){var r=this,n=null,i=1,a=null,o="local-floor",s=null,c=[],l=new Map,h=new xa;h.layers.enable(1),h.viewport=new zr;var u=new xa;u.layers.enable(2),u.viewport=new zr;var p=new ah([h,u]);p.layers.enable(1),p.layers.enable(2);var d=null,f=null;function m(e){var t=l.get(e.inputSource);t&&(t.targetRay&&t.targetRay.dispatchEvent({type:e.type}),t.grip&&t.grip.dispatchEvent({type:e.type}))}function v(){l.forEach(function(e,t){e.targetRay&&(e.targetRay.dispatchEvent({type:"disconnected",data:t}),e.targetRay.visible=!1),e.grip&&(e.grip.dispatchEvent({type:"disconnected",data:t}),e.grip.visible=!1)}),l.clear(),e.setFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),M.stop(),r.isPresenting=!1,r.dispatchEvent({type:"sessionend"})}function g(e){a=e,M.setContext(n),M.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}function y(e){for(var t=n.inputSources,r=0;r=0){var l=i[s];if(void 0!==l){var h=l.normalized,u=l.itemSize,p=b.get(l);if(void 0===p)continue;var f=p.buffer,y=p.type,x=p.bytesPerElement;if(l.isInterleavedBufferAttribute){var _=l.data,w=_.stride,M=l.offset;_&&_.isInstancedInterleavedBuffer?(g.enableAttributeAndDivisor(c,_.meshPerAttribute),void 0===t.maxInstancedCount&&(t.maxInstancedCount=_.meshPerAttribute*_.count)):g.enableAttribute(c),d.bindBuffer(34962,f),d.vertexAttribPointer(c,u,y,h,w*x,M*x)}else l.isInstancedBufferAttribute?(g.enableAttributeAndDivisor(c,l.meshPerAttribute),void 0===t.maxInstancedCount&&(t.maxInstancedCount=l.meshPerAttribute*l.count)):g.enableAttribute(c),d.bindBuffer(34962,f),d.vertexAttribPointer(c,u,y,h,0,0)}else if("instanceMatrix"===s){var p=b.get(e.instanceMatrix);if(void 0===p)continue;var f=p.buffer,y=p.type;g.enableAttributeAndDivisor(c+0,1),g.enableAttributeAndDivisor(c+1,1),g.enableAttributeAndDivisor(c+2,1),g.enableAttributeAndDivisor(c+3,1),d.bindBuffer(34962,f),d.vertexAttribPointer(c+0,4,y,!1,64,0),d.vertexAttribPointer(c+1,4,y,!1,64,16),d.vertexAttribPointer(c+2,4,y,!1,64,32),d.vertexAttribPointer(c+3,4,y,!1,64,48)}else if(void 0!==o){var S=o[s];if(void 0!==S)switch(S.length){case 2:d.vertexAttrib2fv(c,S);break;case 3:d.vertexAttrib3fv(c,S);break;case 4:d.vertexAttrib4fv(c,S);break;default:d.vertexAttrib1fv(c,S)}}}}g.disableUnusedAttributes()}(i,r,n,s),null!==l&&d.bindBuffer(34963,u.buffer));var y=null!==l?l.count:h.count,x=r.drawRange.start*p,_=r.drawRange.count*p,M=null!==a?a.start*p:0,S=null!==a?a.count*p:1/0,T=Math.max(x,M),E=Math.min(y,x+_,M+S)-1,A=Math.max(0,E-T+1);if(0!==A){if(i.isMesh)!0===n.wireframe?(g.setLineWidth(n.wireframeLinewidth*se()),f.setMode(1)):f.setMode(4);else if(i.isLine){var P=n.linewidth;void 0===P&&(P=1),g.setLineWidth(P*se()),i.isLineSegments?f.setMode(1):i.isLineLoop?f.setMode(2):f.setMode(3)}else i.isPoints?f.setMode(0):i.isSprite&&f.setMode(4);i.isInstancedMesh?f.renderInstances(r,T,A,i.count):r.isInstancedBufferGeometry?f.renderInstances(r,T,A,r.maxInstancedCount):f.render(T,A)}},this.compile=function(e,t){(p=E.get(e,t)).init(),e.traverse(function(e){e.isLight&&(p.pushLight(e),e.castShadow&&p.pushShadow(e))}),p.setupLights(t);var r={};e.traverse(function(t){if(t.material)if(Array.isArray(t.material))for(var n=0;n=0&&e.numSupportedMorphTargets++}if(e.morphNormals){e.numSupportedMorphNormals=0;for(d=0;d=0&&e.numSupportedMorphNormals++}var f=n.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(n.numClippingPlanes=re.numPlanes,n.numIntersection=re.numIntersection,f.clippingPlanes=re.uniform),n.fog=t.fog,n.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),n.lightsStateVersion=o,n.needsLights&&(f.ambientLightColor.value=i.state.ambient,f.lightProbe.value=i.state.probe,f.directionalLights.value=i.state.directional,f.directionalLightShadows.value=i.state.directionalShadow,f.spotLights.value=i.state.spot,f.spotLightShadows.value=i.state.spotShadow,f.rectAreaLights.value=i.state.rectArea,f.pointLights.value=i.state.point,f.pointLightShadows.value=i.state.pointShadow,f.hemisphereLights.value=i.state.hemi,f.directionalShadowMap.value=i.state.directionalShadowMap,f.directionalShadowMatrix.value=i.state.directionalShadowMatrix,f.spotShadowMap.value=i.state.spotShadowMap,f.spotShadowMatrix.value=i.state.spotShadowMatrix,f.pointShadowMap.value=i.state.pointShadowMap,f.pointShadowMatrix.value=i.state.pointShadowMatrix);var m=n.program.getUniforms(),v=ul.seqWithValue(m.seq,f);n.uniformsList=v}function we(e,t,r,n){_.resetTextureUnits();var i=t.fog,a=r.isMeshStandardMaterial?t.environment:null,o=x.get(r),s=p.state.lights;if(ne&&(ie||e!==H)){var c=e===H&&r.id===G;re.setState(r.clippingPlanes,r.clipIntersection,r.clipShadows,e,o,c)}r.version===o.__version?void 0===o.program?be(r,t,n):r.fog&&o.fog!==i?be(r,t,n):o.environment!==a?be(r,t,n):o.needsLights&&o.lightsStateVersion!==s.state.version?be(r,t,n):void 0===o.numClippingPlanes||o.numClippingPlanes===re.numPlanes&&o.numIntersection===re.numIntersection?o.outputEncoding!==O.outputEncoding&&be(r,t,n):be(r,t,n):(be(r,t,n),o.__version=r.version);var l,h,u=!1,m=!1,y=!1,b=o.program,w=b.getUniforms(),M=o.uniforms;if(g.useProgram(b.program)&&(u=!0,m=!0,y=!0),r.id!==G&&(G=r.id,m=!0),u||H!==e){if(w.setValue(d,"projectionMatrix",e.projectionMatrix),v.logarithmicDepthBuffer&&w.setValue(d,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),H!==e&&(H=e,m=!0,y=!0),r.isShaderMaterial||r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshStandardMaterial||r.envMap){var S=w.map.cameraPosition;void 0!==S&&S.setValue(d,oe.setFromMatrixPosition(e.matrixWorld))}(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&w.setValue(d,"isOrthographic",!0===e.isOrthographicCamera),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial||r.skinning)&&w.setValue(d,"viewMatrix",e.matrixWorldInverse)}if(r.skinning){w.setOptional(d,n,"bindMatrix"),w.setOptional(d,n,"bindMatrixInverse");var T=n.skeleton;if(T){var E=T.bones;if(v.floatVertexTextures){if(void 0===T.boneTexture){var A=Math.sqrt(4*E.length);A=Ir.ceilPowerOfTwo(A),A=Math.max(A,4);var L=new Float32Array(A*A*4);L.set(T.boneMatrices);var R=new Sa(L,A,A,Ue,Ce);T.boneMatrices=L,T.boneTexture=R,T.boneTextureSize=A}w.setValue(d,"boneTexture",T.boneTexture,_),w.setValue(d,"boneTextureSize",T.boneTextureSize)}else w.setOptional(d,T,"boneMatrices")}}return(m||o.receiveShadow!==n.receiveShadow)&&(o.receiveShadow=n.receiveShadow,w.setValue(d,"receiveShadow",n.receiveShadow)),m&&(w.setValue(d,"toneMappingExposure",O.toneMappingExposure),w.setValue(d,"toneMappingWhitePoint",O.toneMappingWhitePoint),o.needsLights&&(h=y,(l=M).ambientLightColor.needsUpdate=h,l.lightProbe.needsUpdate=h,l.directionalLights.needsUpdate=h,l.directionalLightShadows.needsUpdate=h,l.pointLights.needsUpdate=h,l.pointLightShadows.needsUpdate=h,l.spotLights.needsUpdate=h,l.spotLightShadows.needsUpdate=h,l.rectAreaLights.needsUpdate=h,l.hemisphereLights.needsUpdate=h),i&&r.fog&&function(e,t){e.fogColor.value.copy(t.color),t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)}(M,i),r.isMeshBasicMaterial?Me(M,r):r.isMeshLambertMaterial?(Me(M,r),function(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}(M,r)):r.isMeshToonMaterial?(Me(M,r),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.gradientMap&&(e.gradientMap.value=t.gradientMap);t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap);t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===f&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===f&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(M,r)):r.isMeshPhongMaterial?(Me(M,r),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap);t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===f&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===f&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(M,r)):r.isMeshStandardMaterial?(Me(M,r,a),r.isMeshPhysicalMaterial?function(e,t,r){Te(e,t,r),e.reflectivity.value=t.reflectivity,e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.sheen&&e.sheen.value.copy(t.sheen);t.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),e.clearcoatNormalMap.value=t.clearcoatNormalMap,t.side===f&&e.clearcoatNormalScale.value.negate());e.transparency.value=t.transparency}(M,r,a):Te(M,r,a)):r.isMeshMatcapMaterial?(Me(M,r),function(e,t){t.matcap&&(e.matcap.value=t.matcap);t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===f&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===f&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(M,r)):r.isMeshDepthMaterial?(Me(M,r),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(M,r)):r.isMeshDistanceMaterial?(Me(M,r),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias);e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(M,r)):r.isMeshNormalMaterial?(Me(M,r),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===f&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===f&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(M,r)):r.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}(M,r),r.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(M,r)):r.isPointsMaterial?function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*Y,e.scale.value=.5*X,t.map&&(e.map.value=t.map);t.alphaMap&&(e.alphaMap.value=t.alphaMap);var r;t.map?r=t.map:t.alphaMap&&(r=t.alphaMap);void 0!==r&&(!0===r.matrixAutoUpdate&&r.updateMatrix(),e.uvTransform.value.copy(r.matrix))}(M,r):r.isSpriteMaterial?function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map);t.alphaMap&&(e.alphaMap.value=t.alphaMap);var r;t.map?r=t.map:t.alphaMap&&(r=t.alphaMap);void 0!==r&&(!0===r.matrixAutoUpdate&&r.updateMatrix(),e.uvTransform.value.copy(r.matrix))}(M,r):r.isShadowMaterial&&(M.color.value.copy(r.color),M.opacity.value=r.opacity),void 0!==M.ltc_1&&(M.ltc_1.value=La.LTC_1),void 0!==M.ltc_2&&(M.ltc_2.value=La.LTC_2),ul.upload(d,o.uniformsList,M,_),r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)),r.isShaderMaterial&&!0===r.uniformsNeedUpdate&&(ul.upload(d,o.uniformsList,M,_),r.uniformsNeedUpdate=!1),r.isSpriteMaterial&&w.setValue(d,"center",n.center),w.setValue(d,"modelViewMatrix",n.modelViewMatrix),w.setValue(d,"normalMatrix",n.normalMatrix),w.setValue(d,"modelMatrix",n.matrixWorld),b}function Me(e,t,r){e.opacity.value=t.opacity,t.color&&e.diffuse.value.copy(t.color),t.emissive&&e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.specularMap&&(e.specularMap.value=t.specularMap);var n,i,a=t.envMap||r;a&&(e.envMap.value=a,e.flipEnvMap.value=a.isCubeTexture?-1:1,e.reflectivity.value=t.reflectivity,e.refractionRatio.value=t.refractionRatio,e.maxMipLevel.value=x.get(a).__maxMipLevel),t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.aoMap&&(e.aoMap.value=t.aoMap,e.aoMapIntensity.value=t.aoMapIntensity),t.map?n=t.map:t.specularMap?n=t.specularMap:t.displacementMap?n=t.displacementMap:t.normalMap?n=t.normalMap:t.bumpMap?n=t.bumpMap:t.roughnessMap?n=t.roughnessMap:t.metalnessMap?n=t.metalnessMap:t.alphaMap?n=t.alphaMap:t.emissiveMap&&(n=t.emissiveMap),void 0!==n&&(n.isWebGLRenderTarget&&(n=n.texture),!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix)),t.aoMap?i=t.aoMap:t.lightMap&&(i=t.lightMap),void 0!==i&&(i.isWebGLRenderTarget&&(i=i.texture),!0===i.matrixAutoUpdate&&i.updateMatrix(),e.uv2Transform.value.copy(i.matrix))}function Te(e,t,r){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===f&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===f&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),(t.envMap||r)&&(e.envMapIntensity.value=t.envMapIntensity)}ye.setAnimationLoop(function(e){he.isPresenting||ge&&ge(e)}),"undefined"!=typeof window&&ye.setContext(window),this.setAnimationLoop=function(e){ge=e,he.setAnimationLoop(e),ye.start()},this.render=function(e,t){var r,n;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),r=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),n=arguments[3]),t&&t.isCamera){if(!D){z.geometry=null,z.program=null,z.wireframe=!1,G=-1,H=null,!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),he.enabled&&he.isPresenting&&(t=he.getCamera(t)),(p=E.get(e,t)).init(),e.onBeforeRender(O,e,t,r||F),ae.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),te.setFromProjectionMatrix(ae),ie=this.localClippingEnabled,ne=re.init(this.clippingPlanes,ie,t),(u=T.get(e,t)).init(),function e(t,r,n,i){if(!1===t.visible)return;var a=t.layers.test(r.layers);if(a)if(t.isGroup)n=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(r);else if(t.isLight)p.pushLight(t),t.castShadow&&p.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||te.intersectsSprite(t)){i&&oe.setFromMatrixPosition(t.matrixWorld).applyMatrix4(ae);var o=M.update(t),s=t.material;s.visible&&u.push(t,o,s,n,oe.z,null)}}else if(t.isImmediateRenderObject)i&&oe.setFromMatrixPosition(t.matrixWorld).applyMatrix4(ae),u.push(t,null,t.material,n,oe.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.frame!==y.render.frame&&(t.skeleton.update(),t.skeleton.frame=y.render.frame),!t.frustumCulled||te.intersectsObject(t))){i&&oe.setFromMatrixPosition(t.matrixWorld).applyMatrix4(ae);var o=M.update(t),s=t.material;if(Array.isArray(s))for(var c=o.groups,l=0,h=c.length;l=0&&t<=e.width-n&&r>=0&&r<=e.height-i&&d.readPixels(t,r,n,i,P.convert(h),P.convert(u),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{c&&d.bindFramebuffer(36160,U)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t,r){void 0===r&&(r=0);var n=Math.pow(2,-r),i=Math.floor(t.image.width*n),a=Math.floor(t.image.height*n),o=P.convert(t.format);_.setTexture2D(t,0),d.copyTexImage2D(3553,r,o,e.x,e.y,i,a,0),g.unbindTexture()},this.copyTextureToTexture=function(e,t,r,n){var i=t.image.width,a=t.image.height,o=P.convert(r.format),s=P.convert(r.type);_.setTexture2D(r,0),t.isDataTexture?d.texSubImage2D(3553,n||0,e.x,e.y,i,a,o,s,t.image.data):d.texSubImage2D(3553,n||0,e.x,e.y,o,s,t.image),g.unbindTexture()},this.initTexture=function(e){_.setTexture2D(e,0),g.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function lh(e,t){this.name="",this.color=new hi(e),this.density=void 0!==t?t:25e-5}function hh(e,t,r){this.name="",this.color=new hi(e),this.near=void 0!==t?t:1,this.far=void 0!==r?r:1e3}function uh(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=br,this.updateRange={offset:0,count:-1},this.version=0}ah.prototype=Object.assign(Object.create(xa.prototype),{constructor:ah,isArrayCamera:!0}),oh.prototype=Object.assign(Object.create(xn.prototype),{constructor:oh,isGroup:!0}),Object.assign(sh.prototype,Cr.prototype),Object.assign(lh.prototype,{isFogExp2:!0,clone:function(){return new lh(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(hh.prototype,{isFog:!0,clone:function(){return new hh(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(uh.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(uh.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this},copyAt:function(e,t,r){e*=this.stride,r*=t.stride;for(var n=0,i=this.stride;ne.far||t.push({distance:s,point:vh.clone(),uv:oi.getUV(vh,wh,Mh,Sh,Th,Eh,Ah,new Nr),face:null,object:this})}},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(e){return xn.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this}});var Ch=new qr,Ph=new qr;function Oh(){xn.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function Dh(e,t){e&&e.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),ra.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new en,this.bindMatrixInverse=new en}Oh.prototype=Object.assign(Object.create(xn.prototype),{constructor:Oh,isLOD:!0,copy:function(e){xn.prototype.copy.call(this,e,!1);for(var t=e.levels,r=0,n=t.length;r0){for(var r=1,n=t.length;r0){Ch.setFromMatrixPosition(this.matrixWorld);var r=e.ray.origin.distanceTo(Ch);this.getObjectForDistance(r).raycast(e,t)}},update:function(e){var t=this.levels;if(t.length>1){Ch.setFromMatrixPosition(e.matrixWorld),Ph.setFromMatrixPosition(this.matrixWorld);var r=Ch.distanceTo(Ph)/e.zoom;t[0].object.visible=!0;for(var n=1,i=t.length;n=t[n].distance;n++)t[n-1].object.visible=!1,t[n].object.visible=!0;for(this._currentLevel=n-1;n0&&(zh[0].instanceId=i,zh[0].object=this,t.push(zh[0]),zh.length=0)},setMatrixAt:function(e,t){t.toArray(this.instanceMatrix.array,16*e)},updateMorphTargets:function(){}}),kh.prototype=Object.create(vi.prototype),kh.prototype.constructor=kh,kh.prototype.isLineBasicMaterial=!0,kh.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this};var jh=new qr,Wh=new qr,qh=new en,Xh=new Wn,Yh=new Fn;function Zh(e,t,r){1===r&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),xn.call(this),this.type="Line",this.geometry=void 0!==e?e:new Ui,this.material=void 0!==t?t:new kh}Zh.prototype=Object.assign(Object.create(xn.prototype),{constructor:Zh,isLine:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,r=[0],n=1,i=t.count;no))h.applyMatrix4(this.matrixWorld),(b=e.ray.origin.distanceTo(h))e.far||t.push({distance:b,point:l.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}else for(m=0,v=d.length/3-1;mo))h.applyMatrix4(this.matrixWorld),(b=e.ray.origin.distanceTo(h))e.far||t.push({distance:b,point:l.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}else if(r.isGeometry){var x=r.vertices,_=x.length;for(m=0;m<_-1;m+=u){var b;if(!(Xh.distanceSqToSegment(x[m],x[m+1],h,l)>o))h.applyMatrix4(this.matrixWorld),(b=e.ray.origin.distanceTo(h))e.far||t.push({distance:b,point:l.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Jh=new qr,Qh=new qr;function Kh(e,t){Zh.call(this,e,t),this.type="LineSegments"}function $h(e,t){Zh.call(this,e,t),this.type="LineLoop"}function eu(e){vi.call(this),this.type="PointsMaterial",this.color=new hi(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}Kh.prototype=Object.assign(Object.create(Zh.prototype),{constructor:Kh,isLineSegments:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,r=[],n=0,i=t.count;ni.far)return;a.push({distance:l,distanceToRay:Math.sqrt(s),point:c,index:t,face:null,object:o})}}function su(e,t,r,n,i,a,o,s,c){Gr.call(this,e,t,r,n,i,a,o,s,c),this.format=void 0!==o?o:Fe,this.minFilter=void 0!==a?a:xe,this.magFilter=void 0!==i?i:xe,this.generateMipmaps=!1}function cu(e,t,r,n,i,a,o,s,c,l,h,u){Gr.call(this,null,a,o,s,c,l,n,i,h,u),this.image={width:t,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function lu(e,t,r,n,i,a,o,s,c){Gr.call(this,e,t,r,n,i,a,o,s,c),this.needsUpdate=!0}function hu(e,t,r,n,i,a,o,s,c,l){if((l=void 0!==l?l:Ve)!==Ve&&l!==ke)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===r&&l===Ve&&(r=Ae),void 0===r&&l===ke&&(r=Ne),Gr.call(this,null,n,i,a,o,s,l,r,c),this.image={width:e,height:t},this.magFilter=void 0!==o?o:fe,this.minFilter=void 0!==s?s:fe,this.flipY=!1,this.generateMipmaps=!1}function uu(e){Ui.call(this),this.type="WireframeGeometry";var t,r,n,i,a,o,s,c,l,h,u=[],p=[0,0],d={},f=["a","b","c"];if(e&&e.isGeometry){var m=e.faces;for(t=0,n=m.length;t=0?(e(v-1e-5,m,u),p.subVectors(h,u)):(e(v+1e-5,m,u),p.subVectors(u,h)),m-1e-5>=0?(e(v,m-1e-5,u),d.subVectors(h,u)):(e(v,m+1e-5,u),d.subVectors(u,h)),l.crossVectors(p,d).normalize(),s.push(l.x,l.y,l.z),c.push(v,m)}}for(n=0;n.9&&o<.1&&(t<.2&&(a[e+0]+=1),r<.2&&(a[e+2]+=1),n<.2&&(a[e+4]+=1))}}()}(),this.setAttribute("position",new Ai(i,3)),this.setAttribute("normal",new Ai(i.slice(),3)),this.setAttribute("uv",new Ai(a,2)),0===n?this.computeVertexNormals():this.normalizeNormals()}function vu(e,t){la.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new gu(e,t)),this.mergeVertices()}function gu(e,t){mu.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}function yu(e,t){la.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new xu(e,t)),this.mergeVertices()}function xu(e,t){mu.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}function _u(e,t){la.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new bu(e,t)),this.mergeVertices()}function bu(e,t){var r=(1+Math.sqrt(5))/2,n=[-1,r,0,1,r,0,-1,-r,0,1,-r,0,0,-1,r,0,1,r,0,-1,-r,0,1,-r,r,0,-1,r,0,1,-r,0,-1,-r,0,1];mu.call(this,n,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}function wu(e,t){la.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Mu(e,t)),this.mergeVertices()}function Mu(e,t){var r=(1+Math.sqrt(5))/2,n=1/r,i=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-r,0,-n,r,0,n,-r,0,n,r,-n,-r,0,-n,r,0,n,-r,0,n,r,0,-r,0,-n,r,0,-n,-r,0,n,r,0,n];mu.call(this,i,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Su(e,t,r,n,i,a){la.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:r,radialSegments:n,closed:i},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new Tu(e,t,r,n,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function Tu(e,t,r,n,i){Ui.call(this),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:r,radialSegments:n,closed:i},t=t||64,r=r||1,n=n||8,i=i||!1;var a=e.computeFrenetFrames(t,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;var o,s,c=new qr,l=new qr,h=new Nr,u=new qr,p=[],d=[],f=[],m=[];function v(i){u=e.getPointAt(i/t,u);var o=a.normals[i],h=a.binormals[i];for(s=0;s<=n;s++){var f=s/n*Math.PI*2,m=Math.sin(f),v=-Math.cos(f);l.x=v*o.x+m*h.x,l.y=v*o.y+m*h.y,l.z=v*o.z+m*h.z,l.normalize(),d.push(l.x,l.y,l.z),c.x=u.x+r*l.x,c.y=u.y+r*l.y,c.z=u.z+r*l.z,p.push(c.x,c.y,c.z)}}!function(){for(o=0;o0){var o=i[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),su.prototype=Object.assign(Object.create(Gr.prototype),{constructor:su,isVideoTexture:!0,update:function(){var e=this.image;e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),cu.prototype=Object.create(Gr.prototype),cu.prototype.constructor=cu,cu.prototype.isCompressedTexture=!0,lu.prototype=Object.create(Gr.prototype),lu.prototype.constructor=lu,lu.prototype.isCanvasTexture=!0,hu.prototype=Object.create(Gr.prototype),hu.prototype.constructor=hu,hu.prototype.isDepthTexture=!0,uu.prototype=Object.create(Ui.prototype),uu.prototype.constructor=uu,pu.prototype=Object.create(la.prototype),pu.prototype.constructor=pu,du.prototype=Object.create(Ui.prototype),du.prototype.constructor=du,fu.prototype=Object.create(la.prototype),fu.prototype.constructor=fu,mu.prototype=Object.create(Ui.prototype),mu.prototype.constructor=mu,vu.prototype=Object.create(la.prototype),vu.prototype.constructor=vu,gu.prototype=Object.create(mu.prototype),gu.prototype.constructor=gu,yu.prototype=Object.create(la.prototype),yu.prototype.constructor=yu,xu.prototype=Object.create(mu.prototype),xu.prototype.constructor=xu,_u.prototype=Object.create(la.prototype),_u.prototype.constructor=_u,bu.prototype=Object.create(mu.prototype),bu.prototype.constructor=bu,wu.prototype=Object.create(la.prototype),wu.prototype.constructor=wu,Mu.prototype=Object.create(mu.prototype),Mu.prototype.constructor=Mu,Su.prototype=Object.create(la.prototype),Su.prototype.constructor=Su,Tu.prototype=Object.create(Ui.prototype),Tu.prototype.constructor=Tu,Tu.prototype.toJSON=function(){var e=Ui.prototype.toJSON.call(this);return e.path=this.parameters.path.toJSON(),e},Eu.prototype=Object.create(la.prototype),Eu.prototype.constructor=Eu,Au.prototype=Object.create(Ui.prototype),Au.prototype.constructor=Au,Lu.prototype=Object.create(la.prototype),Lu.prototype.constructor=Lu,Ru.prototype=Object.create(Ui.prototype),Ru.prototype.constructor=Ru;var Cu={triangulate:function(e,t,r){r=r||2;var n,i,a,o,s,c,l,h=t&&t.length,u=h?t[0]*r:e.length,p=Pu(e,0,u,r,!0),d=[];if(!p||p.next===p.prev)return d;if(h&&(p=Uu(e,t,p,r)),e.length>80*r){n=a=e[0],i=o=e[1];for(var f=r;fa&&(a=s),c>o&&(o=c);l=0!==(l=Math.max(a-n,o-i))?1/l:0}return Du(p,d,r,n,i,l),d}};function Pu(e,t,r,n,i){var a,o;if(i===ip(e,t,r,n)>0)for(a=t;a=t;a-=n)o=tp(a,e[a],e[a+1],o);return o&&Zu(o,o.next)&&(rp(o),o=o.next),o}function Ou(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!Zu(n,n.next)&&0!==Yu(n.prev,n,n.next))n=n.next;else{if(rp(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function Du(e,t,r,n,i,a,o){if(e){!o&&a&&Vu(e,n,i,a);for(var s,c,l=e;e.prev!==e.next;)if(s=e.prev,c=e.next,a?Nu(e,n,i,a):Iu(e))t.push(s.i/r),t.push(e.i/r),t.push(c.i/r),rp(e),e=c.next,l=c.next;else if((e=c)===l){o?1===o?Du(e=Bu(e,t,r),t,r,n,i,a,2):2===o&&Fu(e,t,r,n,i,a):Du(Ou(e),t,r,n,i,a,1);break}}}function Iu(e){var t=e.prev,r=e,n=e.next;if(Yu(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(qu(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&Yu(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Nu(e,t,r,n){var i=e.prev,a=e,o=e.next;if(Yu(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,h=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,u=ju(s,c,t,r,n),p=ju(l,h,t,r,n),d=e.prevZ,f=e.nextZ;d&&d.z>=u&&f&&f.z<=p;){if(d!==e.prev&&d!==e.next&&qu(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Yu(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,f!==e.prev&&f!==e.next&&qu(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Yu(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;d&&d.z>=u;){if(d!==e.prev&&d!==e.next&&qu(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Yu(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;f&&f.z<=p;){if(f!==e.prev&&f!==e.next&&qu(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Yu(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Bu(e,t,r){var n=e;do{var i=n.prev,a=n.next.next;!Zu(i,a)&&Ju(i,n,n.next,a)&&Ku(i,a)&&Ku(a,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(a.i/r),rp(n),rp(n.next),n=e=a),n=n.next}while(n!==e);return n}function Fu(e,t,r,n,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Xu(o,s)){var c=ep(o,s);return o=Ou(o,o.next),c=Ou(c,c.next),Du(o,t,r,n,i,a),void Du(c,t,r,n,i,a)}s=s.next}o=o.next}while(o!==e)}function Uu(e,t,r,n){var i,a,o,s=[];for(i=0,a=t.length;i=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=h&&i!==n.x&&qu(ar.x)&&Ku(n,e)&&(r=n,p=c),n=n.next;return r}function Vu(e,t,r,n){var i=e;do{null===i.z&&(i.z=ju(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,ku(i)}function ku(e){var t,r,n,i,a,o,s,c,l=1;do{for(r=e,e=null,a=null,o=0;r;){for(o++,n=r,s=0,t=0;t0||c>0&&n;)0!==s&&(0===c||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=n}a.nextZ=null,l*=2}while(o>1);return e}function ju(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Wu(e){var t=e,r=e;do{(t.x=0&&(e-o)*(n-s)-(r-o)*(t-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function Xu(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!Qu(e,t)&&Ku(e,t)&&Ku(t,e)&&$u(e,t)}function Yu(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Zu(e,t){return e.x===t.x&&e.y===t.y}function Ju(e,t,r,n){return!!(Zu(e,r)&&Zu(t,n)||Zu(e,n)&&Zu(r,t))||Yu(e,t,r)>0!=Yu(e,t,n)>0&&Yu(r,n,e)>0!=Yu(r,n,t)>0}function Qu(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Ju(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function Ku(e,t){return Yu(e.prev,e,e.next)<0?Yu(e,t,e.next)>=0&&Yu(e,e.prev,t)>=0:Yu(e,t,e.prev)<0||Yu(e,e.next,t)<0}function $u(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}function ep(e,t){var r=new np(e.i,e.x,e.y),n=new np(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function tp(e,t,r,n){var i=new np(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function rp(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function np(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ip(e,t,r,n){for(var i=0,a=t,o=r-n;a2&&e[t-1].equals(e[0])&&e.pop()}function sp(e,t){for(var r=0;rNumber.EPSILON){var p=Math.sqrt(h),d=Math.sqrt(c*c+l*l),f=t.x-s/p,m=t.y+o/p,v=((r.x-l/d-f)*l-(r.y+c/d-m)*c)/(o*l-s*c),g=(n=f+o*v-e.x)*n+(i=m+s*v-e.y)*i;if(g<=2)return new Nr(n,i);a=Math.sqrt(g/2)}else{var y=!1;o>Number.EPSILON?c>Number.EPSILON&&(y=!0):o<-Number.EPSILON?c<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(l)&&(y=!0),y?(n=-s,i=o,a=Math.sqrt(h)):(n=o,i=s,a=Math.sqrt(h/2))}return new Nr(n/a,i/a)}for(var z=[],H=0,V=R.length,k=V-1,j=H+1;H=0;P--){for(D=P/d,I=h*Math.cos(D*Math.PI/2),O=u*Math.sin(D*Math.PI/2)+p,H=0,V=R.length;H=0;){r=H,(n=H-1)<0&&(n=e.length-1);var i=0,a=s+2*d;for(i=0;i0)&&f.push(w,M,T),(c!==r-1||l0&&g(!0),t>0&&g(!1)),this.setIndex(l),this.setAttribute("position",new Ai(h,3)),this.setAttribute("normal",new Ai(u,3)),this.setAttribute("uv",new Ai(p,2))}function Ep(e,t,r,n,i,a,o){Sp.call(this,0,e,t,r,n,i,a,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:r,heightSegments:n,openEnded:i,thetaStart:a,thetaLength:o}}function Ap(e,t,r,n,i,a,o){Tp.call(this,0,e,t,r,n,i,a,o),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:r,heightSegments:n,openEnded:i,thetaStart:a,thetaLength:o}}function Lp(e,t,r,n){la.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:r,thetaLength:n},this.fromBufferGeometry(new Rp(e,t,r,n)),this.mergeVertices()}function Rp(e,t,r,n){Ui.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:r,thetaLength:n},e=e||1,t=void 0!==t?Math.max(3,t):8,r=void 0!==r?r:0,n=void 0!==n?n:2*Math.PI;var i,a,o=[],s=[],c=[],l=[],h=new qr,u=new Nr;for(s.push(0,0,0),c.push(0,0,1),l.push(.5,.5),a=0,i=3;a<=t;a++,i+=3){var p=r+a/t*n;h.x=e*Math.cos(p),h.y=e*Math.sin(p),s.push(h.x,h.y,h.z),c.push(0,0,1),u.x=(s[i]/e+1)/2,u.y=(s[i+1]/e+1)/2,l.push(u.x,u.y)}for(i=1;i<=t;i++)o.push(i,i+1,0);this.setIndex(o),this.setAttribute("position",new Ai(s,3)),this.setAttribute("normal",new Ai(c,3)),this.setAttribute("uv",new Ai(l,2))}pp.prototype=Object.create(la.prototype),pp.prototype.constructor=pp,dp.prototype=Object.create(lp.prototype),dp.prototype.constructor=dp,fp.prototype=Object.create(la.prototype),fp.prototype.constructor=fp,mp.prototype=Object.create(Ui.prototype),mp.prototype.constructor=mp,vp.prototype=Object.create(la.prototype),vp.prototype.constructor=vp,gp.prototype=Object.create(Ui.prototype),gp.prototype.constructor=gp,yp.prototype=Object.create(la.prototype),yp.prototype.constructor=yp,xp.prototype=Object.create(Ui.prototype),xp.prototype.constructor=xp,_p.prototype=Object.create(la.prototype),_p.prototype.constructor=_p,_p.prototype.toJSON=function(){var e=la.prototype.toJSON.call(this);return wp(this.parameters.shapes,e)},bp.prototype=Object.create(Ui.prototype),bp.prototype.constructor=bp,bp.prototype.toJSON=function(){var e=Ui.prototype.toJSON.call(this);return wp(this.parameters.shapes,e)},Mp.prototype=Object.create(Ui.prototype),Mp.prototype.constructor=Mp,Sp.prototype=Object.create(la.prototype),Sp.prototype.constructor=Sp,Tp.prototype=Object.create(Ui.prototype),Tp.prototype.constructor=Tp,Ep.prototype=Object.create(Sp.prototype),Ep.prototype.constructor=Ep,Ap.prototype=Object.create(Tp.prototype),Ap.prototype.constructor=Ap,Lp.prototype=Object.create(la.prototype),Lp.prototype.constructor=Lp,Rp.prototype=Object.create(Ui.prototype),Rp.prototype.constructor=Rp;var Cp=Object.freeze({__proto__:null,WireframeGeometry:uu,ParametricGeometry:pu,ParametricBufferGeometry:du,TetrahedronGeometry:vu,TetrahedronBufferGeometry:gu,OctahedronGeometry:yu,OctahedronBufferGeometry:xu,IcosahedronGeometry:_u,IcosahedronBufferGeometry:bu,DodecahedronGeometry:wu,DodecahedronBufferGeometry:Mu,PolyhedronGeometry:fu,PolyhedronBufferGeometry:mu,TubeGeometry:Su,TubeBufferGeometry:Tu,TorusKnotGeometry:Eu,TorusKnotBufferGeometry:Au,TorusGeometry:Lu,TorusBufferGeometry:Ru,TextGeometry:pp,TextBufferGeometry:dp,SphereGeometry:fp,SphereBufferGeometry:mp,RingGeometry:vp,RingBufferGeometry:gp,PlaneGeometry:Pa,PlaneBufferGeometry:Oa,LatheGeometry:yp,LatheBufferGeometry:xp,ShapeGeometry:_p,ShapeBufferGeometry:bp,ExtrudeGeometry:cp,ExtrudeBufferGeometry:lp,EdgesGeometry:Mp,ConeGeometry:Ep,ConeBufferGeometry:Ap,CylinderGeometry:Sp,CylinderBufferGeometry:Tp,CircleGeometry:Lp,CircleBufferGeometry:Rp,BoxGeometry:ha,BoxBufferGeometry:ua});function Pp(e){vi.call(this),this.type="ShadowMaterial",this.color=new hi(0),this.transparent=!0,this.setValues(e)}function Op(e){ga.call(this,e),this.type="RawShaderMaterial"}function Dp(e){vi.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new hi(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new hi(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=nr,this.normalScale=new Nr(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.vertexTangents=!1,this.setValues(e)}function Ip(e){Dp.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearcoat=0,this.clearcoatRoughness=0,this.sheen=null,this.clearcoatNormalScale=new Nr(1,1),this.clearcoatNormalMap=null,this.transparency=0,this.setValues(e)}function Np(e){vi.call(this),this.type="MeshPhongMaterial",this.color=new hi(16777215),this.specular=new hi(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new hi(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=nr,this.normalScale=new Nr(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Y,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Bp(e){vi.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new hi(16777215),this.specular=new hi(1118481),this.shininess=30,this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new hi(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=nr,this.normalScale=new Nr(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Fp(e){vi.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=nr,this.normalScale=new Nr(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Up(e){vi.call(this),this.type="MeshLambertMaterial",this.color=new hi(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new hi(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Y,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Gp(e){vi.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new hi(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=nr,this.normalScale=new Nr(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function zp(e){kh.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}Pp.prototype=Object.create(vi.prototype),Pp.prototype.constructor=Pp,Pp.prototype.isShadowMaterial=!0,Pp.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.color.copy(e.color),this},Op.prototype=Object.create(ga.prototype),Op.prototype.constructor=Op,Op.prototype.isRawShaderMaterial=!0,Dp.prototype=Object.create(vi.prototype),Dp.prototype.constructor=Dp,Dp.prototype.isMeshStandardMaterial=!0,Dp.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.vertexTangents=e.vertexTangents,this},Ip.prototype=Object.create(Dp.prototype),Ip.prototype.constructor=Ip,Ip.prototype.isMeshPhysicalMaterial=!0,Ip.prototype.copy=function(e){return Dp.prototype.copy.call(this,e),this.defines={STANDARD:"",PHYSICAL:""},this.reflectivity=e.reflectivity,this.clearcoat=e.clearcoat,this.clearcoatRoughness=e.clearcoatRoughness,e.sheen?this.sheen=(this.sheen||new hi).copy(e.sheen):this.sheen=null,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.transparency=e.transparency,this},Np.prototype=Object.create(vi.prototype),Np.prototype.constructor=Np,Np.prototype.isMeshPhongMaterial=!0,Np.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Bp.prototype=Object.create(vi.prototype),Bp.prototype.constructor=Bp,Bp.prototype.isMeshToonMaterial=!0,Bp.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Fp.prototype=Object.create(vi.prototype),Fp.prototype.constructor=Fp,Fp.prototype.isMeshNormalMaterial=!0,Fp.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Up.prototype=Object.create(vi.prototype),Up.prototype.constructor=Up,Up.prototype.isMeshLambertMaterial=!0,Up.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Gp.prototype=Object.create(vi.prototype),Gp.prototype.constructor=Gp,Gp.prototype.isMeshMatcapMaterial=!0,Gp.prototype.copy=function(e){return vi.prototype.copy.call(this,e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},zp.prototype=Object.create(kh.prototype),zp.prototype.constructor=zp,zp.prototype.isLineDashedMaterial=!0,zp.prototype.copy=function(e){return kh.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var Hp=Object.freeze({__proto__:null,ShadowMaterial:Pp,SpriteMaterial:mh,RawShaderMaterial:Op,ShaderMaterial:ga,PointsMaterial:eu,MeshPhysicalMaterial:Ip,MeshStandardMaterial:Dp,MeshPhongMaterial:Np,MeshToonMaterial:Bp,MeshNormalMaterial:Fp,MeshLambertMaterial:Up,MeshDepthMaterial:Ql,MeshDistanceMaterial:Kl,MeshBasicMaterial:gi,MeshMatcapMaterial:Gp,LineDashedMaterial:zp,LineBasicMaterial:kh,Material:vi}),Vp={arraySlice:function(e,t,r){return Vp.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==r?r:e.length)):e.slice(t,r)},convertArray:function(e,t,r){return!e||!r&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){for(var t=e.length,r=new Array(t),n=0;n!==t;++n)r[n]=n;return r.sort(function(t,r){return e[t]-e[r]}),r},sortedArray:function(e,t,r){for(var n=e.length,i=new e.constructor(n),a=0,o=0;o!==n;++a)for(var s=r[a]*t,c=0;c!==t;++c)i[o++]=e[s+c];return i},flattenJSON:function(e,t,r,n){for(var i=1,a=e[0];void 0!==a&&void 0===a[n];)a=e[i++];if(void 0!==a){var o=a[n];if(void 0!==o)if(Array.isArray(o))do{void 0!==(o=a[n])&&(t.push(a.time),r.push.apply(r,o)),a=e[i++]}while(void 0!==a);else if(void 0!==o.toArray)do{void 0!==(o=a[n])&&(t.push(a.time),o.toArray(r,r.length)),a=e[i++]}while(void 0!==a);else do{void 0!==(o=a[n])&&(t.push(a.time),r.push(o)),a=e[i++]}while(void 0!==a)}},subclip:function(e,t,r,n,i){i=i||30;var a=e.clone();a.name=t;for(var o=[],s=0;s=n)){h.push(c.times[p]);for(var f=0;fa.tracks[s].times[0]&&(m=a.tracks[s].times[0]);for(s=0;s=i)break e;var s=t[1];e=(i=t[--r-1]))break t}a=r,r=0}for(;r>>1;et;)--a;if(++a,0!==i||a!==n){i>=a&&(i=(a=Math.max(a,1))-1);var o=this.getValueSize();this.times=Vp.arraySlice(r,i,a),this.values=Vp.arraySlice(this.values,i*o,a*o)}return this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var r=this.times,n=this.values,i=r.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var a=null,o=0;o!==i;o++){var s=r[o];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),e=!1;break}if(null!==a&&a>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),e=!1;break}a=s}if(void 0!==n&&Vp.isTypedArray(n)){o=0;for(var c=n.length;o!==c;++o){var l=n[o];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,l),e=!1;break}}}return e},optimize:function(){for(var e=Vp.arraySlice(this.times),t=Vp.arraySlice(this.values),r=this.getValueSize(),n=this.getInterpolation()===zt,i=1,a=e.length-1,o=1;o0){e[i]=e[a];for(f=a*r,m=i*r,p=0;p!==r;++p)t[m+p]=t[f+p];++i}return i!==e.length?(this.times=Vp.arraySlice(e,0,i),this.values=Vp.arraySlice(t,0,i*r)):(this.times=e,this.values=t),this},clone:function(){var e=Vp.arraySlice(this.times,0),t=Vp.arraySlice(this.values,0),r=new(0,this.constructor)(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}),Yp.prototype=Object.assign(Object.create(Xp.prototype),{constructor:Yp,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:Ut,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Zp.prototype=Object.assign(Object.create(Xp.prototype),{constructor:Zp,ValueTypeName:"color"}),Jp.prototype=Object.assign(Object.create(Xp.prototype),{constructor:Jp,ValueTypeName:"number"}),Qp.prototype=Object.assign(Object.create(kp.prototype),{constructor:Qp,interpolate_:function(e,t,r,n){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=(r-t)/(n-t),l=s+o;s!==l;s+=4)kr.slerpFlat(i,0,a,s-o,a,s,c);return i}}),Kp.prototype=Object.assign(Object.create(Xp.prototype),{constructor:Kp,ValueTypeName:"quaternion",DefaultInterpolation:Gt,InterpolantFactoryMethodLinear:function(e){return new Qp(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),$p.prototype=Object.assign(Object.create(Xp.prototype),{constructor:$p,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:Ut,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),ed.prototype=Object.assign(Object.create(Xp.prototype),{constructor:ed,ValueTypeName:"vector"}),Object.assign(td,{parse:function(e){for(var t=[],r=e.tracks,n=1/(e.fps||1),i=0,a=r.length;i!==a;++i)t.push(nd(r[i]).scale(n));return new td(e.name,e.duration,t)},toJSON:function(e){for(var t=[],r=e.tracks,n={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid},i=0,a=r.length;i!==a;++i)t.push(Xp.toJSON(r[i]));return n},CreateFromMorphTargetSequence:function(e,t,r,n){for(var i=t.length,a=[],o=0;o1){var l=n[u=c[1]];l||(n[u]=l=[]),l.push(s)}}var h=[];for(var u in n)h.push(td.CreateFromMorphTargetSequence(u,n[u],t,r));return h},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var r=function(e,t,r,n,i){if(0!==r.length){var a=[],o=[];Vp.flattenJSON(r,a,o,n),0!==a.length&&i.push(new e(t,a,o))}},n=[],i=e.name||"default",a=e.length||-1,o=e.fps||30,s=e.hierarchy||[],c=0;c0||0===e.search(/^data\:image\/jpeg/);i.format=n?Fe:Ue,i.needsUpdate=!0,void 0!==t&&t(i)},r,n),i}}),Object.assign(vd.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var r=this.getUtoTmapping(e);return this.getPoint(r,t)},getPoints:function(e){void 0===e&&(e=5);for(var t=[],r=0;r<=e;r++)t.push(this.getPoint(r/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);for(var t=[],r=0;r<=e;r++)t.push(this.getPointAt(r/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,r,n=[],i=this.getPoint(0),a=0;for(n.push(0),r=1;r<=e;r++)a+=(t=this.getPoint(r/e)).distanceTo(i),n.push(a),i=t;return this.cacheArcLengths=n,n},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var r,n=this.getLengths(),i=0,a=n.length;r=t||e*n[a-1];for(var o,s=0,c=a-1;s<=c;)if((o=n[i=Math.floor(s+(c-s)/2)]-r)<0)s=i+1;else{if(!(o>0)){c=i;break}c=i-1}if(n[i=c]===r)return i/(a-1);var l=n[i];return(i+(r-l)/(n[i+1]-l))/(a-1)},getTangent:function(e){var t=e-1e-4,r=e+1e-4;t<0&&(t=0),r>1&&(r=1);var n=this.getPoint(t);return this.getPoint(r).clone().sub(n).normalize()},getTangentAt:function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)},computeFrenetFrames:function(e,t){var r,n,i,a=new qr,o=[],s=[],c=[],l=new qr,h=new en;for(r=0;r<=e;r++)n=r/e,o[r]=this.getTangentAt(n),o[r].normalize();s[0]=new qr,c[0]=new qr;var u=Number.MAX_VALUE,p=Math.abs(o[0].x),d=Math.abs(o[0].y),f=Math.abs(o[0].z);for(p<=u&&(u=p,a.set(1,0,0)),d<=u&&(u=d,a.set(0,1,0)),f<=u&&a.set(0,0,1),l.crossVectors(o[0],a).normalize(),s[0].crossVectors(o[0],l),c[0].crossVectors(o[0],s[0]),r=1;r<=e;r++)s[r]=s[r-1].clone(),c[r]=c[r-1].clone(),l.crossVectors(o[r-1],o[r]),l.length()>Number.EPSILON&&(l.normalize(),i=Math.acos(Ir.clamp(o[r-1].dot(o[r]),-1,1)),s[r].applyMatrix4(h.makeRotationAxis(l,i))),c[r].crossVectors(o[r],s[r]);if(!0===t)for(i=Math.acos(Ir.clamp(s[0].dot(s[e]),-1,1)),i/=e,o[0].dot(l.crossVectors(s[0],s[e]))>0&&(i=-i),r=1;r<=e;r++)s[r].applyMatrix4(h.makeRotationAxis(o[r],i*r)),c[r].crossVectors(o[r],s[r]);return{tangents:o,normals:s,binormals:c}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),gd.prototype=Object.create(vd.prototype),gd.prototype.constructor=gd,gd.prototype.isEllipseCurve=!0,gd.prototype.getPoint=function(e,t){for(var r=t||new Nr,n=2*Math.PI,i=this.aEndAngle-this.aStartAngle,a=Math.abs(i)n;)i-=n;i0?0:(Math.floor(Math.abs(h)/c)+1)*c:0===u&&h===c-1&&(h=c-2,u=1),this.closed||h>0?r=s[(h-1)%c]:(_d.subVectors(s[0],s[1]).add(s[0]),r=_d),n=s[h%c],i=s[(h+1)%c],this.closed||h+2n.length-2?n.length-1:a+1],h=n[a>n.length-3?n.length-1:a+2];return r.set(Td(o,s.x,c.x,l.x,h.x),Td(o,s.y,c.y,l.y,h.y)),r},Hd.prototype.copy=function(e){vd.prototype.copy.call(this,e),this.points=[];for(var t=0,r=e.points.length;t=t){var i=r[n]-t,a=this.curves[n],o=a.getLength(),s=0===o?0:1-i/o;return a.getPointAt(s)}n++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,r=0,n=this.curves.length;r1&&!r[r.length-1].equals(r[0])&&r.push(r[0]),r},copy:function(e){vd.prototype.copy.call(this,e),this.curves=[];for(var t=0,r=e.curves.length;t0){var l=c.getPoint(0);l.equals(this.currentPoint)||this.lineTo(l.x,l.y)}this.curves.push(c);var h=c.getPoint(1);return this.currentPoint.copy(h),this},copy:function(e){return kd.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=kd.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return kd.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),Wd.prototype=Object.assign(Object.create(jd.prototype),{constructor:Wd,getPointsHoles:function(e){for(var t=[],r=0,n=this.holes.length;r0:n.vertexColors=e.vertexColors),void 0!==e.uniforms)for(var i in e.uniforms){var a=e.uniforms[i];switch(n.uniforms[i]={},a.type){case"t":n.uniforms[i].value=r(a.value);break;case"c":n.uniforms[i].value=(new hi).setHex(a.value);break;case"v2":n.uniforms[i].value=(new Nr).fromArray(a.value);break;case"v3":n.uniforms[i].value=(new qr).fromArray(a.value);break;case"v4":n.uniforms[i].value=(new zr).fromArray(a.value);break;case"m3":n.uniforms[i].value=(new Br).fromArray(a.value);case"m4":n.uniforms[i].value=(new en).fromArray(a.value);break;default:n.uniforms[i].value=a.value}}if(void 0!==e.defines&&(n.defines=e.defines),void 0!==e.vertexShader&&(n.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(n.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(var o in e.extensions)n.extensions[o]=e.extensions[o];if(void 0!==e.shading&&(n.flatShading=1===e.shading),void 0!==e.size&&(n.size=e.size),void 0!==e.sizeAttenuation&&(n.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(n.map=r(e.map)),void 0!==e.matcap&&(n.matcap=r(e.matcap)),void 0!==e.alphaMap&&(n.alphaMap=r(e.alphaMap)),void 0!==e.bumpMap&&(n.bumpMap=r(e.bumpMap)),void 0!==e.bumpScale&&(n.bumpScale=e.bumpScale),void 0!==e.normalMap&&(n.normalMap=r(e.normalMap)),void 0!==e.normalMapType&&(n.normalMapType=e.normalMapType),void 0!==e.normalScale){var s=e.normalScale;!1===Array.isArray(s)&&(s=[s,s]),n.normalScale=(new Nr).fromArray(s)}return void 0!==e.displacementMap&&(n.displacementMap=r(e.displacementMap)),void 0!==e.displacementScale&&(n.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(n.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(n.roughnessMap=r(e.roughnessMap)),void 0!==e.metalnessMap&&(n.metalnessMap=r(e.metalnessMap)),void 0!==e.emissiveMap&&(n.emissiveMap=r(e.emissiveMap)),void 0!==e.emissiveIntensity&&(n.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(n.specularMap=r(e.specularMap)),void 0!==e.envMap&&(n.envMap=r(e.envMap)),void 0!==e.envMapIntensity&&(n.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(n.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(n.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(n.lightMap=r(e.lightMap)),void 0!==e.lightMapIntensity&&(n.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(n.aoMap=r(e.aoMap)),void 0!==e.aoMapIntensity&&(n.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(n.gradientMap=r(e.gradientMap)),void 0!==e.clearcoatNormalMap&&(n.clearcoatNormalMap=r(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(n.clearcoatNormalScale=(new Nr).fromArray(e.clearcoatNormalScale)),n},setTextures:function(e){return this.textures=e,this}});var of={decodeText:function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",r=0,n=e.length;r0){var a=new dd(new ad(t));a.setCrossOrigin(this.crossOrigin);for(var o=0,s=e.length;o0?new Dh(o,s):new ra(o,s);break;case"InstancedMesh":o=i(e.geometry),s=a(e.material);var c=e.count,l=e.instanceMatrix;(n=new Vh(o,s,c)).instanceMatrix=new xi(new Float32Array(l.array),16);break;case"LOD":n=new Oh;break;case"Line":n=new Zh(i(e.geometry),a(e.material),e.mode);break;case"LineLoop":n=new $h(i(e.geometry),a(e.material));break;case"LineSegments":n=new Kh(i(e.geometry),a(e.material));break;case"PointCloud":case"Points":n=new au(i(e.geometry),a(e.material));break;case"Sprite":n=new Lh(a(e.material));break;case"Group":n=new oh;break;default:n=new xn}if(n.uuid=e.uuid,void 0!==e.name&&(n.name=e.name),void 0!==e.matrix?(n.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(n.matrixAutoUpdate=e.matrixAutoUpdate),n.matrixAutoUpdate&&n.matrix.decompose(n.position,n.quaternion,n.scale)):(void 0!==e.position&&n.position.fromArray(e.position),void 0!==e.rotation&&n.rotation.fromArray(e.rotation),void 0!==e.quaternion&&n.quaternion.fromArray(e.quaternion),void 0!==e.scale&&n.scale.fromArray(e.scale)),void 0!==e.castShadow&&(n.castShadow=e.castShadow),void 0!==e.receiveShadow&&(n.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(n.shadow.bias=e.shadow.bias),void 0!==e.shadow.radius&&(n.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&n.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(n.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(n.visible=e.visible),void 0!==e.frustumCulled&&(n.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(n.renderOrder=e.renderOrder),void 0!==e.userData&&(n.userData=e.userData),void 0!==e.layers&&(n.layers.mask=e.layers),void 0!==e.children)for(var h=e.children,u=0;uNumber.EPSILON){if(l<0&&(o=t[a],c=-c,s=t[i],l=-l),e.ys.y)continue;if(e.y===o.y){if(e.x===o.x)return!0}else{var h=l*(e.x-o.x)-c*(e.y-o.y);if(0===h)return!0;if(h<0)continue;n=!n}}else{if(e.y!==o.y)continue;if(s.x<=e.x&&e.x<=o.x||o.x<=e.x&&e.x<=s.x)return!0}}return n}var i=ap.isClockWise,a=this.subPaths;if(0===a.length)return[];if(!0===t)return r(a);var o,s,c,l=[];if(1===a.length)return s=a[0],(c=new Wd).curves=s.curves,l.push(c),l;var h=!i(a[0].getPoints());h=e?!h:h;var u,p,d=[],f=[],m=[],v=0;f[v]=void 0,m[v]=[];for(var g=0,y=a.length;g1){for(var x=!1,_=[],b=0,w=f.length;b0&&(x||(m=d))}g=0;for(var L=f.length;g0){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e=.5)for(var a=0;a!==i;++a)e[t+a]=e[r+a]},_slerp:function(e,t,r,n){kr.slerpFlat(e,t,e,t,e,r,n)},_lerp:function(e,t,r,n,i){for(var a=1-n,o=0;o!==i;++o){var s=t+o;e[s]=e[s]*a+e[r+o]*n}}});var Wf="\\[\\]\\.:\\/",qf=new RegExp("["+Wf+"]","g"),Xf="[^"+Wf+"]",Yf="[^"+Wf.replace("\\.","")+"]",Zf=/((?:WC+[\/:])*)/.source.replace("WC",Xf),Jf=/(WCOD+)?/.source.replace("WCOD",Yf),Qf=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Xf),Kf=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Xf),$f=new RegExp("^"+Zf+Jf+Qf+Kf+"$"),em=["material","materials","bones"];function tm(e,t,r){var n=r||rm.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,n)}function rm(e,t,r){this.path=t,this.parsedPath=r||rm.parseTrackName(t),this.node=rm.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function nm(){this.uuid=Ir.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,r=arguments.length;t!==r;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var n=this;this.stats={objects:{get total(){return n._objects.length},get inUse(){return this.total-n.nCachedObjects_}},get bindingsPerObject(){return n._bindings.length}}}function im(e,t,r){this._mixer=e,this._clip=t,this._localRoot=r||null;for(var n=t.tracks,i=n.length,a=new Array(i),o={endingStart:Ht,endingEnd:Ht},s=0;s!==i;++s){var c=n[s].createInterpolant(null);a[s]=c,c.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(i),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Bt,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function am(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function om(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}function sm(e,t,r){uh.call(this,e,t),this.meshPerAttribute=r||1}function cm(e,t,r,n){this.ray=new Wn(e,t),this.near=r||0,this.far=n||1/0,this.camera=null,this.layers=new an,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function lm(e,t){return e.distance-t.distance}function hm(e,t,r,n){if(e.layers.test(t.layers)&&e.raycast(t,r),!0===n)for(var i=e.children,a=0,o=i.length;a=t){var h=t++,u=e[h];r[u.uuid]=l,e[l]=u,r[c]=h,e[h]=s;for(var p=0,d=i;p!==d;++p){var f=n[p],m=f[h],v=f[l];f[l]=m,f[h]=v}}}this.nCachedObjects_=t},uncache:function(){for(var e=this._objects,t=e.length,r=this.nCachedObjects_,n=this._indicesByUUID,i=this._bindings,a=i.length,o=0,s=arguments.length;o!==s;++o){var c=arguments[o].uuid,l=n[c];if(void 0!==l)if(delete n[c],l0)for(var c=this._interpolants,l=this._propertyBindings,h=0,u=c.length;h!==u;++h)c[h].evaluate(o),l[h].accumulate(n,s)}else this._updateWeight(e)},_updateWeight:function(e){var t=0;if(this.enabled){t=this.weight;var r=this._weightInterpolant;if(null!==r){var n=r.evaluate(e)[0];t*=n,e>r.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=t,t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var r=this._timeScaleInterpolant;if(null!==r)t*=r.evaluate(e)[0],e>r.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}return this._effectiveTimeScale=t,t},_updateTime:function(e){var t=this.time+e,r=this._clip.duration,n=this.loop,i=this._loopCount,a=n===Ft;if(0===e)return-1===i?t:a&&1==(1&i)?r-t:t;if(n===Nt){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(t>=r)t=r;else{if(!(t<0)){this.time=t;break e}t=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),t>=r||t<0){var o=Math.floor(t/r);t-=r*o,i+=Math.abs(o);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,t=e>0?r:0,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){var c=e<0;this._setEndings(c,!c,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=t,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=t;if(a&&1==(1&i))return r-t}return t},_setEndings:function(e,t,r){var n=this._interpolantSettings;r?(n.endingStart=Vt,n.endingEnd=Vt):(n.endingStart=e?this.zeroSlopeAtStart?Vt:Ht:kt,n.endingEnd=t?this.zeroSlopeAtEnd?Vt:Ht:kt)},_scheduleFading:function(e,t,r){var n=this._mixer,i=n.time,a=this._weightInterpolant;null===a&&(a=n._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=t,o[1]=i+e,s[1]=r,this}}),am.prototype=Object.assign(Object.create(Cr.prototype),{constructor:am,_bindAction:function(e,t){var r=e._localRoot||this._root,n=e._clip.tracks,i=n.length,a=e._propertyBindings,o=e._interpolants,s=r.uuid,c=this._bindingsByRootAndName,l=c[s];void 0===l&&(l={},c[s]=l);for(var h=0;h!==i;++h){var u=n[h],p=u.name,d=l[p];if(void 0!==d)a[h]=d;else{if(void 0!==(d=a[h])){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,p));continue}var f=t&&t._propertyBindings[h].binding.parsedPath;++(d=new jf(rm.create(r,p,f),u.ValueTypeName,u.getValueSize())).referenceCount,this._addInactiveBinding(d,s,p),a[h]=d}o[h].resultBuffer=d.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,r=e._clip.uuid,n=this._actionsByClip[r];this._bindAction(e,n&&n.knownActions[0]),this._addInactiveAction(e,r,t)}for(var i=e._propertyBindings,a=0,o=i.length;a!==o;++a){var s=i[a];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,r=0,n=t.length;r!==n;++r){var i=t[r];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return null!==t&&tthis.max.x||e.ythis.max.y)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new Nr),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)},clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new Nr),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return dm.copy(e).clamp(this.min,this.max).sub(e).length()},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}});var mm=new qr,vm=new qr;function gm(e,t){this.start=void 0!==e?e:new qr,this.end=void 0!==t?t:new qr}function ym(e){xn.call(this),this.material=e,this.render=function(){}}Object.assign(gm.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){return void 0===e&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new qr),e.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return void 0===e&&(console.warn("THREE.Line3: .delta() target is now required"),e=new qr),e.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){return void 0===t&&(console.warn("THREE.Line3: .at() target is now required"),t=new qr),this.delta(t).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(e,t){mm.subVectors(e,this.start),vm.subVectors(this.end,this.start);var r=vm.dot(vm),n=vm.dot(mm)/r;return t&&(n=Ir.clamp(n,0,1)),n},closestPointToPoint:function(e,t,r){var n=this.closestPointToPointParameter(e,t);return void 0===r&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),r=new qr),this.delta(r).multiplyScalar(n).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}),ym.prototype=Object.create(xn.prototype),ym.prototype.constructor=ym,ym.prototype.isImmediateRenderObject=!0;var xm=new qr;function _m(e,t){xn.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;for(var r=new Ui,n=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],i=0,a=1;i<32;i++,a++){var o=i/32*Math.PI*2,s=a/32*Math.PI*2;n.push(Math.cos(o),Math.sin(o),1,Math.cos(s),Math.sin(s),1)}r.setAttribute("position",new Ai(n,3));var c=new kh({fog:!1});this.cone=new Kh(r,c),this.add(this.cone),this.update()}_m.prototype=Object.create(xn.prototype),_m.prototype.constructor=_m,_m.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},_m.prototype.update=function(){this.light.updateMatrixWorld();var e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),xm.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(xm),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var bm=new qr,wm=new en,Mm=new en;function Sm(e){var t=[];e&&e.isBone&&t.push(e);for(var r=0;r.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Xm.set(e.z,0,-e.x).normalize();var t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Xm,t)}},Ym.prototype.setLength=function(e,t,r){void 0===t&&(t=.2*e),void 0===r&&(r=.2*t),this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(r,t,r),this.cone.position.y=e,this.cone.updateMatrix()},Ym.prototype.setColor=function(e){this.line.material.color.set(e),this.cone.material.color.set(e)},Ym.prototype.copy=function(e){return xn.prototype.copy.call(this,e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this},Ym.prototype.clone=function(){return(new this.constructor).copy(this)},Zm.prototype=Object.create(Kh.prototype),Zm.prototype.constructor=Zm;var Jm=4,Qm=8,Km=Math.pow(2,Qm),$m=[.125,.215,.35,.446,.526,.582],ev=Qm-Jm+1+$m.length,tv=20,rv={[Xt]:0,[Yt]:1,[Jt]:2,[Kt]:3,[$t]:4,[er]:5,[Zt]:6},nv=new $d,iv=Lv(tv),av=null,ov=null,{_lodPlanes:sv,_sizeLods:cv,_sigmas:lv}=gv(),hv=null,uv=null,pv=null,dv=(1+Math.sqrt(5))/2,fv=1/dv,mv=[new qr(1,1,1),new qr(-1,1,1),new qr(1,1,-1),new qr(-1,1,-1),new qr(0,dv,fv),new qr(0,dv,-fv),new qr(fv,0,dv),new qr(-fv,0,dv),new qr(dv,fv,0),new qr(-dv,fv,0)];function vv(e){uv=e,wv(iv)}function gv(){for(var e=[],t=[],r=[],n=Qm,i=0;iQm-Jm?o=$m[i-Qm+Jm-1]:0==i&&(o=0),r.push(o);for(var s=1/(a-1),c=-s/2,l=1+s/2,h=[c,c,l,c,l,l,c,c,l,l,c,l],u=new Float32Array(108),p=new Float32Array(72),d=new Float32Array(36),f=0;f<6;f++){var m=f%3*2/3-1,v=f>2?0:-1,g=[m,v,0,m+2/3,v,0,m+2/3,v+1,0,m,v,0,m+2/3,v+1,0,m,v+1,0];u.set(g,18*f),p.set(h,12*f);var y=[f,f,f,f,f,f];d.set(y,6*f)}var x=new Ui;x.setAttribute("position",new xi(u,3)),x.setAttribute("uv",new xi(p,2)),x.setAttribute("faceIndex",new xi(d,1)),e.push(x),n>Jm&&n--}return{_lodPlanes:e,_sizeLods:t,_sigmas:r}}function yv(e){var t={magFilter:fe,minFilter:fe,generateMipmaps:!1,type:e?e.type:Se,format:e?e.format:He,encoding:e?e.encoding:Jt,depthBuffer:!1,stencilBuffer:!1},r=Mv(t);return r.depthBuffer=!e,hv=Mv(t),r}function xv(e){hv.dispose(),uv.setRenderTarget(pv),e.scissorTest=!1,e.setSize(e.width,e.height)}function _v(e,t,r,n){var i=new xa(90,1,t,r),a=[1,1,1,1,-1,1],o=[1,1,-1,-1,-1,1],s=uv.outputEncoding,c=uv.toneMapping,l=uv.toneMappingExposure,h=uv.getClearColor(),u=uv.getClearAlpha();uv.toneMapping=K,uv.toneMappingExposure=1,uv.outputEncoding=Xt,e.scale.z*=-1;var p=e.background;if(p&&p.isColor){p.convertSRGBToLinear();var d=Math.max(p.r,p.g,p.b),f=Math.min(Math.max(Math.ceil(Math.log2(d)),-128),127);p=p.multiplyScalar(Math.pow(2,-f));var m=(f+128)/255;uv.setClearColor(p,m),e.background=null}for(var v=0;v<6;v++){var g=v%3;0==g?(i.up.set(0,a[v],0),i.lookAt(o[v],0,0)):1==g?(i.up.set(0,0,a[v]),i.lookAt(0,o[v],0)):(i.up.set(0,a[v],0),i.lookAt(0,0,o[v])),Sv(n,g*Km,v>2?Km:0,Km,Km),uv.setRenderTarget(n),uv.render(e,i)}uv.toneMapping=c,uv.toneMappingExposure=l,uv.outputEncoding=s,uv.setClearColor(h,u),e.scale.z*=-1}function bv(e,t){var r=new _n;e.isCubeTexture?null==ov&&(ov=Cv()):null==av&&(av=Rv());var n=e.isCubeTexture?ov:av;r.add(new ra(sv[0],n));var i=n.uniforms;i.envMap.value=e,e.isCubeTexture||i.texelSize.value.set(1/e.image.width,1/e.image.height),i.inputEncoding.value=rv[e.encoding],i.outputEncoding.value=rv[e.encoding],Sv(t,0,0,3*Km,2*Km),uv.setRenderTarget(t),uv.render(r,nv)}function wv(e){var t=new _n;t.add(new ra(sv[0],e)),uv.compile(t,nv)}function Mv(e){var t=new Hr(3*Km,3*Km,e);return t.texture.mapping=le,t.texture.name="PMREM.cubeUv",t.scissorTest=!0,t}function Sv(e,t,r,n,i){e.viewport.set(t,r,n,i),e.scissor.set(t,r,n,i)}function Tv(e){var t=uv.autoClear;uv.autoClear=!1;for(var r=1;rtv&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${p} samples when the maximum is set to ${tv}`);for(var d=[],f=0,m=0;mQm-Jm?n-Qm+Jm:0),3*y,2*y),uv.setRenderTarget(t),uv.render(s,nv)}function Lv(e){var t=new Op({defines:{n:e},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:new Float32Array(e)},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:new qr(0,1,0)},inputEncoding:{value:rv[Xt]},outputEncoding:{value:rv[Xt]}},vertexShader:Pv(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform int samples;\nuniform float weights[n];\nuniform bool latitudinal;\nuniform float dTheta;\nuniform float mipInt;\nuniform vec3 poleAxis;\n\n${Ov()}\n\n#define ENVMAP_TYPE_CUBE_UV\n#include \n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tfor (int i = 0; i < n; i++) {\n\t\tif (i >= samples)\n\t\t\tbreak;\n\t\tfor (int dir = -1; dir < 2; dir += 2) {\n\t\t\tif (i == 0 && dir == 1)\n\t\t\t\tcontinue;\n\t\t\tvec3 axis = latitudinal ? poleAxis : cross(poleAxis, vOutputDirection);\n\t\t\tif (all(equal(axis, vec3(0.0))))\n\t\t\t\taxis = cross(vec3(0.0, 1.0, 0.0), vOutputDirection);\n\t\t\taxis = normalize(axis);\n\t\t\tfloat theta = dTheta * float(dir * i);\n\t\t\tfloat cosTheta = cos(theta);\n\t\t\t// Rodrigues' axis-angle rotation\n\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross(axis, vOutputDirection) * sin(theta)\n\t\t\t\t\t+ axis * dot(axis, vOutputDirection) * (1.0 - cosTheta);\n\t\t\tgl_FragColor.rgb +=\n\t\t\t\t\tweights[i] * bilinearCubeUV(envMap, sampleDirection, mipInt);\n\t\t}\n\t}\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t`,blending:y,depthTest:!1,depthWrite:!1});return t.type="SphericalGaussianBlur",t}function Rv(){var e=new Op({uniforms:{envMap:{value:null},texelSize:{value:new Nr(1,1)},inputEncoding:{value:rv[Xt]},outputEncoding:{value:rv[Xt]}},vertexShader:Pv(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform vec2 texelSize;\n\n${Ov()}\n\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tvec3 outputDirection = normalize(vOutputDirection);\n\tvec2 uv;\n\tuv.y = asin(clamp(outputDirection.y, -1.0, 1.0)) * RECIPROCAL_PI + 0.5;\n\tuv.x = atan(outputDirection.z, outputDirection.x) * RECIPROCAL_PI2 + 0.5;\n\tvec2 f = fract(uv / texelSize - 0.5);\n\tuv -= f * texelSize;\n\tvec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x += texelSize.x;\n\tvec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.y += texelSize.y;\n\tvec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x -= texelSize.x;\n\tvec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tvec3 tm = mix(tl, tr, f.x);\n\tvec3 bm = mix(bl, br, f.x);\n\tgl_FragColor.rgb = mix(tm, bm, f.y);\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t`,blending:y,depthTest:!1,depthWrite:!1});return e.type="EquirectangularToCubeUV",e}function Cv(){var e=new Op({uniforms:{envMap:{value:null},inputEncoding:{value:rv[Xt]},outputEncoding:{value:rv[Xt]}},vertexShader:Pv(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform samplerCube envMap;\n\n${Ov()}\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tgl_FragColor.rgb = envMapTexelToLinear(textureCube(envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ))).rgb;\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t`,blending:y,depthTest:!1,depthWrite:!1});return e.type="CubemapToCubeUV",e}function Pv(){return"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.x *= -1.0;\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.y *= -1.0;\n\t} else if (face == 5.0) {\n\t\tdirection.xz *= -1.0;\n\t}\n\treturn direction;\n}\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t"}function Ov(){return"\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include \n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t"}function Dv(e,t,r,n,i,a,o){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new fi(e,t,r,i,a,o)}vv.prototype={constructor:vv,fromScene:function(e,t=0,r=.1,n=100){pv=uv.getRenderTarget();var i=yv();return _v(e,r,n,i),t>0&&Ev(i,0,0,t),Tv(i),xv(i),i},fromEquirectangular:function(e){return e.magFilter=fe,e.minFilter=fe,e.generateMipmaps=!1,this.fromCubemap(e)},fromCubemap:function(e){pv=uv.getRenderTarget();var t=yv(e);return bv(e,t),Tv(t),xv(t),t},compileCubemapShader:function(){null==ov&&wv(ov=Cv())},compileEquirectangularShader:function(){null==av&&wv(av=Rv())},dispose:function(){iv.dispose(),null!=ov&&ov.dispose(),null!=av&&av.dispose();for(var e=0;e1as8V#8BJ$MOhm?zbp zbH-T*4%z!InRA|ZX7=8>yLVu~sdc;ELB*KjeG~S&%8iCFw3@~X@F%nhXpkv}EkZV+W{Yyckyi2j5NVO%22f(0uWI^6Xer#Po4%ow0k;*Y_Cw;P>P-;jPK8bRRJ-75fahs& znXA+3OzPmlve5hDSnpw_M;iJQso|G4qo{w6AjlELFGZ^D^BVV%C17w`1`GQ00zloC zL6`vz_+v0&FX*ky(FVK%qRpVUE=L>i5s2Kb1)>d@1q1qK2F!o~eKP~Tg8}P6Z(WXF z0t8CNRA&IK_4(FGp~L7IKv#UzP;cvUv;l{J=nd$t%V7p+17I7T(?IkZ^m=3&a5S|G zYP9Y3kOGN7$H9QN@Gteq0v}b-9ihwhkOGO|@4)E)l z7y17TaIyJs5}E;Yh3Hb6=L~oUMD^bXFmUbo4#RG6Ryv&`!Lxr*7Np${qo2sqJ|R1) z+Y->0cTqI-tFSZKNg;uo0Zsm=P{&2hj0cGw+Rs{0j{>x7f(Zq+zIcFY ztLW)r%FhLjSH4nYz)6?_Q~9zM*0T(_kuc#(VP)nkNAN?6F~xKf_IfB^#@?R)07Q5f Up_k093jhEB07*qoM6N<$g1X0@!2kdN diff --git a/default.hbs b/default.hbs index cba801e..6ac0fc4 100644 --- a/default.hbs +++ b/default.hbs @@ -57,9 +57,6 @@ section.addEventListener("click", handleClick); }); -
- - {{!-- Outputs important scripts - should always be included before closing body tag --}} {{ghost_foot}}