1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="41d6b152-d8e7-414f-bba7-0cce0adcc1d8",e._sentryDebugIdIdentifier="sentry-dbid-41d6b152-d8e7-414f-bba7-0cce0adcc1d8")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3757],{49883:function(e,t){(function(e){"use strict";let t,i,n,r,a;let s="300 es";class o{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&i[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;let i=this._listeners;return void 0!==i[e]&&-1!==i[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;let i=this._listeners[e];if(void 0!==i){let e=i.indexOf(t);-1!==e&&i.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;let t=this._listeners[e.type];if(void 0!==t){e.target=this;let i=t.slice(0);for(let t=0,n=i.length;t<n;t++)i[t].call(this,e);e.target=null}}}let l=[];for(let e=0;e<256;e++)l[e]=(e<16?"0":"")+e.toString(16);let h=1234567,u=Math.PI/180,c=180/Math.PI;function d(){let e=0xffffffff*Math.random()|0,t=0xffffffff*Math.random()|0,i=0xffffffff*Math.random()|0,n=0xffffffff*Math.random()|0;return(l[255&e]+l[e>>8&255]+l[e>>16&255]+l[e>>24&255]+"-"+l[255&t]+l[t>>8&255]+"-"+l[t>>16&15|64]+l[t>>24&255]+"-"+l[63&i|128]+l[i>>8&255]+"-"+l[i>>16&255]+l[i>>24&255]+l[255&n]+l[n>>8&255]+l[n>>16&255]+l[n>>24&255]).toUpperCase()}function p(e,t,i){return Math.max(t,Math.min(i,e))}function m(e,t){return(e%t+t)%t}function f(e,t,i){return(1-i)*e+i*t}function g(e){return 0==(e&e-1)&&0!==e}function v(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function y(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}var x=Object.freeze({__proto__:null,DEG2RAD:u,RAD2DEG:c,generateUUID:d,clamp:p,euclideanModulo:m,mapLinear:function(e,t,i,n,r){return n+(e-t)*(r-n)/(i-t)},inverseLerp:function(e,t,i){return e!==t?(i-e)/(t-e):0},lerp:f,damp:function(e,t,i,n){return f(e,t,1-Math.exp(-i*n))},pingpong:function(e,t=1){return t-Math.abs(m(e,2*t)-t)},smoothstep:function(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t))*e*(3-2*e)},smootherstep:function(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-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())},seededRandom:function(e){return void 0!==e&&(h=e%0x7fffffff),((h=16807*h%0x7fffffff)-1)/0x7ffffffe},degToRad:function(e){return e*u},radToDeg:function(e){return e*c},isPowerOfTwo:g,ceilPowerOfTwo:v,floorPowerOfTwo:y,setQuaternionFromProperEuler:function(e,t,i,n,r){let a=Math.cos,s=Math.sin,o=a(i/2),l=s(i/2),h=a((t+n)/2),u=s((t+n)/2),c=a((t-n)/2),d=s((t-n)/2),p=a((n-t)/2),m=s((n-t)/2);switch(r){case"XYX":e.set(o*u,l*c,l*d,o*h);break;case"YZY":e.set(l*d,o*u,l*c,o*h);break;case"ZXZ":e.set(l*c,l*d,o*u,o*h);break;case"XZX":e.set(o*u,l*m,l*p,o*h);break;case"YXY":e.set(l*p,o*u,l*m,o*h);break;case"ZYZ":e.set(l*m,l*p,o*u,o*h);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}});class _{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(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(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(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.
vendor: 4,831 bytes, line 1
1y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,i=this.y,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6],this.y=n[1]*t+n[4]*i+n[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(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(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(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=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(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,i){return void 0!==i&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let i=Math.cos(t),n=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*i-a*n+e.x,this.y=r*n+a*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}_.prototype.isVector2=!0;class b{constructor(){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.")}set(e,t,i,n,r,a,s,o,l){let h=this.elements;return h[0]=e,h[1]=n,h[2]=s,h[3]=t,h[4]=r,h[5]=o,h[6]=i,h[7]=a,h[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let 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(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,n=t.elements,r=this.elements,a=i[0],s=i[3],o=i[6],l=i[1],h=i[4],u=i[7],c=i[2],d=i[5],p=i[8],m=n[0],f=n[3],g=n[6],v=n[1],y=n[4],x=n[7],_=n[2],b=n[5],M=n[8];return r[0]=a*m+s*v+o*_,r[3]=a*f+s*y+o*b,r[6]=a*g+s*x+o*M,r[1]=l*m+h*v+u*_,r[4]=l*f+h*y+u*b,r[7]=l*g+h*x+u*M,r[2]=c*m+d*v+p*_,r[5]=c*f+d*y+p*b,r[8]=c*g+d*x+p*M,this}multiplyScalar(e){let 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(){let e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],h=e[8];return t*a*h-t*s*l-i*r*h+i*s*o+n*r*l-n*a*o}invert(){let e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],h=e[8],u=h*a-s*l,c=s*o-h*r,d=l*r-a*o,p=t*u+i*c+n*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=u*m,e[1]=(n*l-h*i)*m,e[2]=(s*i-n*a)*m,e[3]=c*m,e[4]=(h*t-n*o)*m,e[5]=(n*r-s*t)*m,e[6]=d*m,e[7]=(i*o-l*t)*m,e[8]=(a*t-i*r)*m,this}transpose(){let e;let 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(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let 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(e,t,i,n,r,a,s){let o=Math.cos(r),l=Math.sin(r);return this.set(i*o,i*l,-i*(o*a+l*s)+a+e,-n*l,n*o,-n*(-l*a+o*s)+s+t,0,0,1),this}scale(e,t){let i=this.elements;
1return i[0]*=e,i[3]*=e,i[6]*=e,i[1]*=t,i[4]*=t,i[7]*=t,this}rotate(e){let t=Math.cos(e),i=Math.sin(e),n=this.elements,r=n[0],a=n[3],s=n[6],o=n[1],l=n[4],h=n[7];return n[0]=t*r+i*o,n[3]=t*a+i*l,n[6]=t*s+i*h,n[1]=-i*r+t*o,n[4]=-i*a+t*l,n[7]=-i*s+t*h,this}translate(e,t){let i=this.elements;return i[0]+=e*i[2],i[3]+=e*i[5],i[6]+=e*i[8],i[1]+=t*i[2],i[4]+=t*i[5],i[7]+=t*i[8],this}equals(e){let t=this.elements,i=e.elements;for(let e=0;e<9;e++)if(t[e]!==i[e])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}b.prototype.isMatrix3=!0;class M{static getDataURL(e){let i;if(/^data:/i.test(e.src)||"undefined"==typeof HTMLCanvasElement)return e.src;if(e instanceof HTMLCanvasElement)i=e;else{void 0===t&&(t=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),t.width=e.width,t.height=e.height;let n=t.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),i=t}return i.width>2048||i.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),i.toDataURL("image/jpeg",.6)):i.toDataURL("image/png")}}let w=0;class S extends o{constructor(e=S.DEFAULT_IMAGE,t=S.DEFAULT_MAPPING,i=1001,n=1001,r=1006,a=1008,s=1023,o=1009,l=1,h=3e3){super(),Object.defineProperty(this,"id",{value:w++}),this.uuid=d(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=i,this.wrapT=n,this.magFilter=r,this.minFilter=a,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=o,this.offset=new _(0,0),this.repeat=new _(1,1),this.center=new _(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new b,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=h,this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(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(e){let t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];let i={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){let n=this.image;if(void 0===n.uuid&&(n.uuid=d()),!t&&void 0===e.images[n.uuid]){let t;if(Array.isArray(n)){t=[];for(let e=0,i=n.length;e<i;e++)n[e].isDataTexture?t.push(T(n[e].image)):t.push(T(n[e]))}else t=T(n);e.images[n.uuid]={uuid:n.uuid,url:t}}i.image=n.uuid}return t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case 1e3:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002: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 1e3:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002: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}set needsUpdate(e){!0===e&&this.version++}}function T(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?M.getDataURL(e):e.data?{data:Array.prototype.slice.call(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}S.DEFAULT_IMAGE=void 0,S.DEFAULT_MAPPING=300,S.prototype.isTexture=!0;class E{constructor(e=0,t=0,i=0,n=1){this.x=e,this.y=t,this.z=i,this.w=n}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(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 Error("index is out of range: "+e)}return this}getComponent(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 Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(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(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(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(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(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(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.
vendor: 22,318 bytes, line 1
1y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(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}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,i=this.y,n=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*n+a[12]*r,this.y=a[1]*t+a[5]*i+a[9]*n+a[13]*r,this.z=a[2]*t+a[6]*i+a[10]*n+a[14]*r,this.w=a[3]*t+a[7]*i+a[11]*n+a[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let 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(e){let t,i,n,r;let a=e.elements,s=a[0],o=a[4],l=a[8],h=a[1],u=a[5],c=a[9],d=a[2],p=a[6],m=a[10];if(.01>Math.abs(o-h)&&.01>Math.abs(l-d)&&.01>Math.abs(c-p)){if(.1>Math.abs(o+h)&&.1>Math.abs(l+d)&&.1>Math.abs(c+p)&&.1>Math.abs(s+u+m-3))return this.set(1,0,0,0),this;t=Math.PI;let e=(s+1)/2,a=(u+1)/2,f=(m+1)/2,g=(o+h)/4,v=(l+d)/4,y=(c+p)/4;return e>a&&e>f?e<.01?(i=0,n=.707106781,r=.707106781):(n=g/(i=Math.sqrt(e)),r=v/i):a>f?a<.01?(i=.707106781,n=0,r=.707106781):(i=g/(n=Math.sqrt(a)),r=y/n):f<.01?(i=.707106781,n=.707106781,r=0):(i=v/(r=Math.sqrt(f)),n=y/r),this.set(i,n,r,t),this}let f=Math.sqrt((p-c)*(p-c)+(l-d)*(l-d)+(h-o)*(h-o));return .001>Math.abs(f)&&(f=1),this.x=(p-c)/f,this.y=(l-d)/f,this.z=(h-o)/f,this.w=Math.acos((s+u+m-1)/2),this}min(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(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(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(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(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=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(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(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(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t,i){return void 0!==i&&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}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}E.prototype.isVector4=!0;class A extends o{constructor(e,t,i={}){super(),this.width=e,this.height=t,this.depth=1,this.scissor=new E(0,0,e,t),this.scissorTest=!1,this.viewport=new E(0,0,e,t),this.texture=new S(void 0,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.isRenderTargetTexture=!0,this.texture.image={width:e,height:t,depth:1},this.texture.generateMipmaps=void 0!==i.generateMipmaps&&i.generateMipmaps,this.texture.internalFormat=void 0!==i.internalFormat?i.internalFormat:null,this.texture.minFilter=void 0!==i.minFilter?i.minFilter:1006,this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0!==i.stencilBuffer&&i.stencilBuffer,this.depthTexture=void 0!==i.depthTexture?i.depthTexture:null}setTexture(e){e.image={width:this.width,height:this.height,depth:this.depth},this.texture=e}setSize(e,t,i=1){this.width===e&&this.height===t&&this.depth===i||(this.width=e,this.height=t,this.depth=i,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.image={...this.texture.image},this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}A.prototype.isWebGLRenderTarget=!0;class L extends A{constructor(e,t,i){super(e,t);let n=this.texture;this.texture=[];for(let e=0;e<i;e++)this.texture[e]=n.clone()}setSize(e,t,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let n=0,r=this.texture.length;n<r;n++)this.texture[n].image.width=e,this.texture[n].image.height=t,this.texture[n].image.depth=i;this.dispose()}return this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t),this}copy(e){this.dispose(),this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this.texture.length=0;for(let t=0,i=e.texture.length;t<i;t++)this.texture[t]=e.texture[t].clone();return this}}L.prototype.isWebGLMultipleRenderTargets=!0;class R extends A{constructor(e,t,i){super(e,t,i),this.samples=4}copy(e){return super.copy.call(this,e),this.samples=e.samples,this}}R.prototype.isWebGLMultisampleRenderTarget=!0;class C{constructor(e=0,t=0,i=0,n=1){this._x=e,this._y=t,this._z=i,this._w=n}static slerp(e,t,i,n){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),i.slerpQuaternions(e,t,n)}static slerpFlat(e,t,i,n,r,a,s){let o=i[n+0],l=i[n+1],h=i[n+2],u=i[n+3],c=r[a+0],d=r[a+1],p=r[a+2],m=r[a+3];if(0===s)return e[t+0]=o,e[t+1]=l,e[t+2]=h,void(e[t+3]=u);if(1===s)return e[t+0]=c,e[t+1]=d,e[t+2]=p,void(e[t+3]=m);if(u!==m||o!==c||l!==d||h!==p){let e=1-s,t=o*c+l*d+h*p+u*m,i=t>=0?1:-1,n=1-t*t;if(n>Number.EPSILON){let r=Math.sqrt(n),a=Math.atan2(r,t*i);e=Math.sin(e*a)/r,s=Math.sin(s*a)/r}let r=s*i;if(o=o*e+c*r,l=l*e+d*r,h=h*e+p*r,u=u*e+m*r,e===1-s){let e=1/Math.sqrt(o*o+l*l+h*h+u*u);o*=e,l*=e,h*=e,u*=e}}e[t]=o,e[t+1]=l,e[t+2]=h,e[t+3]=u}static multiplyQuaternionsFlat(e,t,i,n,r,a){let s=i[n],o=i[n+1],l=i[n+2],h=i[n+3],u=r[a],c=r[a+1],d=r[a+2],p=r[a+3];return e[t]=s*p+h*u+o*d-l*c,e[t+1]=o*p+h*c+l*u-s*d,e[t+2]=l*p+h*d+s*c-o*u,e[t+3]=h*p-s*u-o*c-l*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!e||!e.isEuler)throw Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");let i=e._x,n=e._y,r=e._z,a=e._order,s=Math.cos,o=Math.sin,l=s(i/2),h=s(n/2),u=s(r/2),c=o(i/2),d=o(n/2),p=o(r/2);switch(a){case"XYZ":this._x=c*h*u+l*d*p,this._y=l*d*u-c*h*p,this._z=l*h*p+c*d*u,this._w=l*h*u-c*d*p;break;case"YXZ":this._x=c*h*u+l*d*p,this._y=l*d*u-c*h*p,this._z=l*h*p-c*d*u,this._w=l*h*u+c*d*p;break;case"ZXY":this._x=c*h*u-l*d*p,this._y=l*d*u+c*h*p,this._z=l*h*p+c*d*u,this._w=l*h*u-c*d*p;break;case"ZYX":this._x=c*h*u-l*d*p,this._y=l*d*u+c*h*p,this._z=l*h*p-c*d*u,this._w=l*h*u+c*d*p;break;case"YZX":this._x=c*h*u+l*d*p,this._y=l*d*u+c*h*p,this._z=l*h*p-c*d*u,this._w=l*h*u-c*d*p;break;case"XZY":this._x=c*h*u-l*d*p,this._y=l*d*u-c*h*p,this._z=l*h*p+c*d*u,this._w=l*h*u+c*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let i=t/2,n=Math.sin(i);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,i=t[0],n=t[4],r=t[8],a=t[1],s=t[5],o=t[9],l=t[2],h=t[6],u=t[10],c=i+s+u;if(c>0){let e=.5/Math.sqrt(c+1);this._w=.25/e,this._x=(h-o)*e,this._y=(r-l)*e,this._z=(a-n)*e}else if(i>s&&i>u){let e=2*Math.sqrt(1+i-s-u);this._w=(h-o)/e,this._x=.25*e,this._y=(n+a)/e,this._z=(r+l)/e}else if(s>u){let e=2*Math.sqrt(1+s-i-u);this._w=(r-l)/e,this._x=(n+a)/e,this._y=.25*e,this._z=(o+h)/e}else{let e=2*Math.sqrt(1+u-i-s);this._w=(a-n)/e,this._x=(r+l)/e,this._y=(o+h)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<Number.EPSILON?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0):(this._x=0,this._y=-e.z,this._z=e.y)):(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=i,this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(p(this.dot(e),-1,1)))}rotateTowards(e,t){let i=this.angleTo(e);if(0===i)return this;let n=Math.min(1,t/i);return this.slerp(e,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let 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(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(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let i=e._x,n=e._y,r=e._z,a=e._w,s=t._x,o=t._y,l=t._z,h=t._w;return this._x=i*h+a*s+n*l-r*o,this._y=n*h+a*o+r*s-i*l,this._z=r*h+a*l+i*o-n*s,this._w=a*h-i*s-n*o-r*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);let i=this._x,n=this._y,r=this._z,a=this._w,s=a*e._w+i*e._x+n*e._y+r*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=a,this._x=i,this._y=n,this._z=r,this;let o=1-s*s;if(o<=Number.EPSILON){let e=1-t;return this._w=e*a+t*this._w,this._x=e*i+t*this._x,this._y=e*n+t*this._y,this._z=e*r+t*this._z,this.normalize(),this._onChangeCallback(),this}let l=Math.sqrt(o),h=Math.atan2(l,s),u=Math.sin((1-t)*h)/l,c=Math.sin(t*h)/l;return this._w=a*u+this._w*c,this._x=i*u+this._x*c,this._y=n*u+this._y*c,this._z=r*u+this._z*c,this._onChangeCallback(),this}slerpQuaternions(e,t,i){this.copy(e).slerp(t,i)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}C.prototype.isQuaternion=!0;class P{constructor(e=0,t=0,i=0){this.x=e,this.y=t,this.z=i}set(e,t,i){return void 0===i&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(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(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(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(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(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(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(D.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(D.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,i=this.y,n=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*n,this.y=r[1]*t+r[4]*i+r[7]*n,this.z=r[2]*t+r[5]*i+r[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,i=this.y,n=this.z,r=e.elements,a=1/(r[3]*t+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*n+r[12])*a,this.y=(r[1]*t+r[5]*i+r[9]*n+r[13])*a,this.z=(r[2]*t+r[6]*i+r[10]*n+r[14])*a,this}applyQuaternion(e){let t=this.x,i=this.y,n=this.z,r=e.x,a=e.y,s=e.z,o=e.w,l=o*t+a*n-s*i,h=o*i+s*t-r*n,u=o*n+r*i-a*t,c=-r*t-a*i-s*n;return this.x=l*o+-(c*r)+-(h*s)- -(u*a),this.y=h*o+-(c*a)+-(u*r)- -(l*s),this.z=u*o+-(c*s)+-(l*a)- -(h*r),this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,i=this.y,n=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*n,this.y=r[1]*t+r[5]*i+r[9]*n,this.z=r[2]*t+r[6]*i+r[10]*n,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(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(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(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(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(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=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(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(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(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(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(e,t){let i=e.x,n=e.y,r=e.z,a=t.x,s=t.y,o=t.z;return this.x=n*o-r*s,this.y=r*a-i*o,this.z=i*s-n*a,this}projectOnVector(e){let t=e.lengthSq();if(0===t)return this.set(0,0,0);let i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return I.copy(this).projectOnVector(e),this.sub(I)}reflect(e){return this.sub(I.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===t?Math.PI/2:Math.acos(p(this.dot(e)/t,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){let n=Math.sin(t)*e;return this.x=n*Math.sin(i),this.y=Math.cos(t)*e,this.z=n*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=n,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,i){return void 0!==i&&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}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}P.prototype.isVector3=!0;let I=new P,D=new C;class N{constructor(e=new P(1/0,1/0,1/0),t=new P(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,i=1/0,n=1/0,r=-1/0,a=-1/0,s=-1/0;for(let o=0,l=e.length;o<l;o+=3){let l=e[o],h=e[o+1],u=e[o+2];l<t&&(t=l),h<i&&(i=h),u<n&&(n=u),l>r&&(r=l),h>a&&(a=h),u>s&&(s=u)}return this.min.set(t,i,n),this.max.set(r,a,s),this}setFromBufferAttribute(e){let t=1/0,i=1/0,n=1/0,r=-1/0,a=-1/0,s=-1/0;for(let o=0,l=e.count;o<l;o++){let l=e.getX(o),h=e.getY(o),u=e.getZ(o);l<t&&(t=l),h<i&&(i=h),u<n&&(n=u),l>r&&(r=l),h>a&&(a=h),u>s&&(s=u)}return this.min.set(t,i,n),this.max.set(r,a,s),this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let i=B.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e){return this.makeEmpty(),this.expandByObject(e)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e){e.updateWorldMatrix(!1,!1);let t=e.geometry;void 0!==t&&(null===t.boundingBox&&t.computeBoundingBox(),F.copy(t.boundingBox),F.applyMatrix4(e.matrixWorld),this.union(F));let i=e.children;for(let e=0,t=i.length;e<t;e++)this.expandByObject(i[e]);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(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(e,t){return 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(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,B),B.distanceToSquared(e.center)<=e.radius*e.radiu
1s}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(W),j.subVectors(this.max,W),O.subVectors(e.a,W),U.subVectors(e.b,W),H.subVectors(e.c,W),G.subVectors(U,O),k.subVectors(H,U),V.subVectors(O,H);let t=[0,-G.z,G.y,0,-k.z,k.y,0,-V.z,V.y,G.z,0,-G.x,k.z,0,-k.x,V.z,0,-V.x,-G.y,G.x,0,-k.y,k.x,0,-V.y,V.x,0];return!!Y(t,O,U,H,j)&&!!Y(t=[1,0,0,0,1,0,0,0,1],O,U,H,j)&&(q.crossVectors(G,k),Y(t=[q.x,q.y,q.z],O,U,H,j))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return B.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=.5*this.getSize(B).length(),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(z[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),z[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),z[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),z[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),z[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),z[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),z[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),z[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(z)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}N.prototype.isBox3=!0;let z=[new P,new P,new P,new P,new P,new P,new P,new P],B=new P,F=new N,O=new P,U=new P,H=new P,G=new P,k=new P,V=new P,W=new P,j=new P,q=new P,X=new P;function Y(e,t,i,n,r){for(let a=0,s=e.length-3;a<=s;a+=3){X.fromArray(e,a);let s=r.x*Math.abs(X.x)+r.y*Math.abs(X.y)+r.z*Math.abs(X.z),o=t.dot(X),l=i.dot(X),h=n.dot(X);if(Math.max(-Math.max(o,l,h),Math.min(o,l,h))>s)return!1}return!0}let J=new N,Z=new P,Q=new P,K=new P;class ${constructor(e=new P,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let i=this.center;void 0!==t?i.copy(t):J.setFromPoints(e).getCenter(i);let n=0;for(let t=0,r=e.length;t<r;t++)n=Math.max(n,i.distanceToSquared(e[t]));return this.radius=Math.sqrt(n),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){let t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){let i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?e.makeEmpty():(e.set(this.center,this.center),e.expandByScalar(this.radius)),e}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){K.subVectors(e,this.center);let t=K.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),i=.5*(e-this.radius);this.center.add(K.multiplyScalar(i/e)),this.radius+=i}return this}union(e){return Q.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(Z.copy(e.center).add(Q)),this.expandByPoint(Z.copy(e.center).sub(Q)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}let ee=new P,et=new P,ei=new P,en=new P,er=new P,ea=new P,es=new P;class eo{constructor(e=new P,t=new P(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ee)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(i).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=ee.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ee.copy(this.direction).multiplyScalar(t).add(this.origin),ee.distanceToSquared(e))}distanceSqToSegment(e,t,i,n){let r,a,s,o;et.copy(e).add(t).multiplyScalar(.5),ei.copy(t).sub(e).normalize(),en.copy(this.origin).sub(et);let l=.5*e.distanceTo(t),h=-this.direction.dot(ei),u=en.dot(this.direction),c=-en.dot(ei),d=en.lengthSq(),p=Math.abs(1-h*h);if(p>0){if(r=h*c-u,a=h*u-c,o=l*p,r>=0){if(a>=-o){if(a<=o){let e=1/p;r*=e,a*=e,s=r*(r+h*a+2*u)+a*(h*r+a+2*c)+d}else s=-(r=Math.max(0,-(h*(a=l)+u)))*r+a*(a+2*c)+d}else s=-(r=Math.max(0,-(h*(a=-l)+u)))*r+a*(a+2*c)+d}else a<=-o?(a=(r=Math.max(0,-(-h*l+u)))>0?-l:Math.min(Math.max(-l,-c),l),s=-r*r+a*(a+2*c)+d):a<=o?(r=0,s=(a=Math.min(Math.max(-l,-c),l))*(a+2*c)+d):(a=(r=Math.max(0,-(h*l+u)))>0?l:Math.min(Math.max(-l,-c),l),s=-r*r+a*(a+2*c)+d)}else a=h>0?-l:l,s=-(r=Math.max(0,-(h*a+u)))*r+a*(a+2*c)+d;
vendor: 4,297 bytes, line 1
1return i&&i.copy(this.direction).multiplyScalar(r).add(this.origin),n&&n.copy(ei).multiplyScalar(a).add(et),s}intersectSphere(e,t){ee.subVectors(e.center,this.origin);let i=ee.dot(this.direction),n=ee.dot(ee)-i*i,r=e.radius*e.radius;if(n>r)return null;let a=Math.sqrt(r-n),s=i-a,o=i+a;return s<0&&o<0?null:s<0?this.at(o,t):this.at(s,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;let i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){let i=this.distanceToPlane(e);return null===i?null:this.at(i,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,n,r,a,s,o;let l=1/this.direction.x,h=1/this.direction.y,u=1/this.direction.z,c=this.origin;return l>=0?(i=(e.min.x-c.x)*l,n=(e.max.x-c.x)*l):(i=(e.max.x-c.x)*l,n=(e.min.x-c.x)*l),h>=0?(r=(e.min.y-c.y)*h,a=(e.max.y-c.y)*h):(r=(e.max.y-c.y)*h,a=(e.min.y-c.y)*h),i>a||r>n?null:((r>i||i!=i)&&(i=r),(a<n||n!=n)&&(n=a),u>=0?(s=(e.min.z-c.z)*u,o=(e.max.z-c.z)*u):(s=(e.max.z-c.z)*u,o=(e.min.z-c.z)*u),i>o||s>n?null:((s>i||i!=i)&&(i=s),(o<n||n!=n)&&(n=o),n<0?null:this.at(i>=0?i:n,t)))}intersectsBox(e){return null!==this.intersectBox(e,ee)}intersectTriangle(e,t,i,n,r){er.subVectors(t,e),ea.subVectors(i,e),es.crossVectors(er,ea);let a,s=this.direction.dot(es);if(s>0){if(n)return null;a=1}else{if(!(s<0))return null;a=-1,s=-s}en.subVectors(this.origin,e);let o=a*this.direction.dot(ea.crossVectors(en,ea));if(o<0)return null;let l=a*this.direction.dot(er.cross(en));if(l<0||o+l>s)return null;let h=-a*en.dot(es);return h<0?null:this.at(h/s,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class el{constructor(){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.")}set(e,t,i,n,r,a,s,o,l,h,u,c,d,p,m,f){let g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=n,g[1]=r,g[5]=a,g[9]=s,g[13]=o,g[2]=l,g[6]=h,g[10]=u,g[14]=c,g[3]=d,g[7]=p,g[11]=m,g[15]=f,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new el).fromArray(this.elements)}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){let t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,i=e.elements,n=1/eh.setFromMatrixColumn(e,0).length(),r=1/eh.setFromMatrixColumn(e,1).length(),a=1/eh.setFromMatrixColumn(e,2).length();return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t[3]=0,t[4]=i[4]*r,t[5]=i[5]*r,t[6]=i[6]*r,t[7]=0,t[8]=i[8]*a,t[9]=i[9]*a,t[10]=i[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");let t=this.elements,i=e.x,n=e.y,r=e.z,a=Math.cos(i),s=Math.sin(i),o=Math.cos(n),l=Math.sin(n),h=Math.cos(r),u=Math.sin(r);if("XYZ"===e.order){let e=a*h,i=a*u,n=s*h,r=s*u;t[0]=o*h,t[4]=-o*u,t[8]=l,t[1]=i+n*l,t[5]=e-r*l,t[9]=-s*o,t[2]=r-e*l,t[6]=n+i*l,t[10]=a*o}else if("YXZ"===e.order){let e=o*h,i=o*u,n=l*h,r=l*u;t[0]=e+r*s,t[4]=n*s-i,t[8]=a*l,t[1]=a*u,t[5]=a*h,t[9]=-s,t[2]=i*s-n,t[6]=r+e*s,t[10]=a*o}else if("ZXY"===e.order){let e=o*h,i=o*u,n=l*h,r=l*u;t[0]=e-r*s,t[4]=-a*u,t[8]=n+i*s,t[1]=i+n*s,t[5]=a*h,t[9]=r-e*s,t[2]=-a*l,t[6]=s,t[10]=a*o}else if("ZYX"===e.order){let e=a*h,i=a*u,n=s*h,r=s*u;t[0]=o*h,t[4]=n*l-i,t[8]=e*l+r,t[1]=o*u,t[5]=r*l+e,t[9]=i*l-n,t[2]=-l,t[6]=s*o,t[10]=a*o}
1else if("YZX"===e.order){let e=a*o,i=a*l,n=s*o,r=s*l;t[0]=o*h,t[4]=r-e*u,t[8]=n*u+i,t[1]=u,t[5]=a*h,t[9]=-s*h,t[2]=-l*h,t[6]=i*u+n,t[10]=e-r*u}else if("XZY"===e.order){let e=a*o,i=a*l,n=s*o,r=s*l;t[0]=o*h,t[4]=-u,t[8]=l*h,t[1]=e*u+r,t[5]=a*h,t[9]=i*u-n,t[2]=n*u-i,t[6]=s*h,t[10]=r*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(ec,e,ed)}lookAt(e,t,i){let n=this.elements;return ef.subVectors(e,t),0===ef.lengthSq()&&(ef.z=1),ef.normalize(),ep.crossVectors(i,ef),0===ep.lengthSq()&&(1===Math.abs(i.z)?ef.x+=1e-4:ef.z+=1e-4,ef.normalize(),ep.crossVectors(i,ef)),ep.normalize(),em.crossVectors(ef,ep),n[0]=ep.x,n[4]=em.x,n[8]=ef.x,n[1]=ep.y,n[5]=em.y,n[9]=ef.y,n[2]=ep.z,n[6]=em.z,n[10]=ef.z,this}multiply(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(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,n=t.elements,r=this.elements,a=i[0],s=i[4],o=i[8],l=i[12],h=i[1],u=i[5],c=i[9],d=i[13],p=i[2],m=i[6],f=i[10],g=i[14],v=i[3],y=i[7],x=i[11],_=i[15],b=n[0],M=n[4],w=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],I=n[14],D=n[3],N=n[7],z=n[11],B=n[15];return r[0]=a*b+s*T+o*R+l*D,r[4]=a*M+s*E+o*C+l*N,r[8]=a*w+s*A+o*P+l*z,r[12]=a*S+s*L+o*I+l*B,r[1]=h*b+u*T+c*R+d*D,r[5]=h*M+u*E+c*C+d*N,r[9]=h*w+u*A+c*P+d*z,r[13]=h*S+u*L+c*I+d*B,r[2]=p*b+m*T+f*R+g*D,r[6]=p*M+m*E+f*C+g*N,r[10]=p*w+m*A+f*P+g*z,r[14]=p*S+m*L+f*I+g*B,r[3]=v*b+y*T+x*R+_*D,r[7]=v*M+y*E+x*C+_*N,r[11]=v*w+y*A+x*P+_*z,r[15]=v*S+y*L+x*I+_*B,this}multiplyScalar(e){let 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(){let e=this.elements,t=e[0],i=e[4],n=e[8],r=e[12],a=e[1],s=e[5],o=e[9],l=e[13],h=e[2],u=e[6],c=e[10],d=e[14];return e[3]*(+r*o*u-n*l*u-r*s*c+i*l*c+n*s*d-i*o*d)+e[7]*(+t*o*d-t*l*c+r*a*c-n*a*d+n*l*h-r*o*h)+e[11]*(+t*l*u-t*s*d-r*a*u+i*a*d+r*s*h-i*l*h)+e[15]*(-n*s*h-t*o*u+t*s*c+n*a*u-i*a*c+i*o*h)}transpose(){let e;let 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(e,t,i){let 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]=i),this}invert(){let e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],h=e[8],u=e[9],c=e[10],d=e[11],p=e[12],m=e[13],f=e[14],g=e[15],v=u*f*l-m*c*l+m*o*d-s*f*d-u*o*g+s*c*g,y=p*c*l-h*f*l-p*o*d+a*f*d+h*o*g-a*c*g,x=h*m*l-p*u*l+p*s*d-a*m*d-h*s*g+a*u*g,_=p*u*o-h*m*o-p*s*c+a*m*c+h*s*f-a*u*f,b=t*v+i*y+n*x+r*_;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let M=1/b;return e[0]=v*M,e[1]=(m*c*r-u*f*r-m*n*d+i*f*d+u*n*g-i*c*g)*M,e[2]=(s*f*r-m*o*r+m*n*l-i*f*l-s*n*g+i*o*g)*M,e[3]=(u*o*r-s*c*r-u*n*l+i*c*l+s*n*d-i*o*d)*M,e[4]=y*M,e[5]=(h*f*r-p*c*r+p*n*d-t*f*d-h*n*g+t*c*g)*M,e[6]=(p*o*r-a*f*r-p*n*l+t*f*l+a*n*g-t*o*g)*M,e[7]=(a*c*r-h*o*r+h*n*l-t*c*l-a*n*d+t*o*d)*M,e[8]=x*M,e[9]=(p*u*r-h*m*r-p*i*d+t*m*d+h*i*g-t*u*g)*M,e[10]=(a*m*r-p*s*r+p*i*l-t*m*l-a*i*g+t*s*g)*M,e[11]=(h*s*r-a*u*r-h*i*l+t*u*l+a*i*d-t*s*d)*M,e[12]=_*M,e[13]=(h*m*n-p*u*n+p*i*c-t*m*c-h*i*f+t*u*f)*M,e[14]=(p*s*n-a*m*n-p*i*o+t*m*o+a*i*f-t*s*f)*M,e[15]=(a*u*n-h*s*n+h*i*o-t*u*o-a*i*c+t*s*c)*M,this}scale(e){let t=this.elements,i=e.x,n=e.y,r=e.z;return t[0]*=i,t[4]*=n,t[8]*=r,t[1]*=i,t[5]*=n,t[9]*=r,t[2]*=i,t[6]*=n,t[10]*=r,t[3]*=i,t[7]*=n,t[11]*=r,this}getMaxScaleOnAxis(){let e=this.elements;return Math.sqrt(Math.max(e[0]*e[0]+e[1]*e[1]+e[2]*e[2],e[4]*e[4]+e[5]*e[5]+e[6]*e[6],e[8]*e[8]+e[9]*e[9]+e[10]*e[10]))}makeTranslation(e,t,i){return this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let i=Math.cos(t),n=Math.sin(t),r=1-i,a=e.x,s=e.y,o=e.z,l=r*a,h=r*s;return this.set(l*a+i,l*s-n*o,l*o+n*s,0,l*s+n*o,h*s+i,h*o-n*a,0,l*o-n*s,h*o+n*a,r*o*o+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,n,r,a){return this.set(1,i,r,0,e,1,a,0,t,n,1,0,0,0,0,1),this}compose(e,t,i){let n=this.elements,r=t._x,a=t._y,s=t._z,o=t._w,l=r+r,h=a+a,u=s+s,c=r*l,d=r*h,p=r*u,m=a*h,f=a*u,g=s*u,v=o*l,y=o*h,x=o*u,_=i.x,b=i.y,M=i.z;return n[0]=(1-(m+g))*_,n[1]=(d+x)*_,n[2]=(p-y)*_,n[3]=0,n[4]=(d-x)*b,n[5]=(1-(c+g))*b,n[6]=(f+v)*b,n[7]=0,n[8]=(p+y)*M,n[9]=(f-v)*M,n[10]=(1-(c+m))*M,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,i){let n=this.elements,r=eh.set(n[0],n[1],n[2]).length(),a=eh.set(n[4],n[5],n[6]).length(),s=eh.set(n[8],n[9],n[10]).length();0>this.determinant()&&(r=-r),e.x=n[12],e.y=n[13],e.z=n[14],eu.copy(this);let o=1/r,l=1/a,h=1/s;return eu.elements[0]*=o,eu.elements[1]*=o,eu.elements[2]*=o,eu.elements[4]*=l,eu.elements[5]*=l,eu.elements[6]*=l,eu.elements[8]*=h,eu.elements[9]*=h,eu.elements[10]*=h,t.setFromRotationMatrix(eu),i.x=r,i.y=a,i.z=s,this}makePerspective(e,t,i,n,r,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a
1new signature. Please check the docs.");let s=this.elements;return s[0]=2*r/(t-e),s[4]=0,s[8]=(t+e)/(t-e),s[12]=0,s[1]=0,s[5]=2*r/(i-n),s[9]=(i+n)/(i-n),s[13]=0,s[2]=0,s[6]=0,s[10]=-(a+r)/(a-r),s[14]=-2*a*r/(a-r),s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this}makeOrthographic(e,t,i,n,r,a){let s=this.elements,o=1/(t-e),l=1/(i-n),h=1/(a-r);return s[0]=2*o,s[4]=0,s[8]=0,s[12]=-((t+e)*o),s[1]=0,s[5]=2*l,s[9]=0,s[13]=-((i+n)*l),s[2]=0,s[6]=0,s[10]=-2*h,s[14]=-((a+r)*h),s[3]=0,s[7]=0,s[11]=0,s[15]=1,this}equals(e){let t=this.elements,i=e.elements;for(let e=0;e<16;e++)if(t[e]!==i[e])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}el.prototype.isMatrix4=!0;let eh=new P,eu=new el,ec=new P(0,0,0),ed=new P(1,1,1),ep=new P,em=new P,ef=new P,eg=new el,ev=new C;class ey{constructor(e=0,t=0,i=0,n=ey.DefaultOrder){this._x=e,this._y=t,this._z=i,this._order=n}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,n=this._order){return this._x=e,this._y=t,this._z=i,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){let n=e.elements,r=n[0],a=n[4],s=n[8],o=n[1],l=n[5],h=n[9],u=n[2],c=n[6],d=n[10];switch(t){case"XYZ":this._y=Math.asin(p(s,-1,1)),.9999999>Math.abs(s)?(this._x=Math.atan2(-h,d),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(c,l),this._z=0);break;case"YXZ":this._x=Math.asin(-p(h,-1,1)),.9999999>Math.abs(h)?(this._y=Math.atan2(s,d),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(p(c,-1,1)),.9999999>Math.abs(c)?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(o,r));break;case"ZYX":this._y=Math.asin(-p(u,-1,1)),.9999999>Math.abs(u)?(this._x=Math.atan2(c,d),this._z=Math.atan2(o,r)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(p(o,-1,1)),.9999999>Math.abs(o)?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-p(a,-1,1)),.9999999>Math.abs(a)?(this._x=Math.atan2(c,l),this._y=Math.atan2(s,r)):(this._x=Math.atan2(-h,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===i&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return eg.makeRotationFromQuaternion(e),this.setFromRotationMatrix(eg,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return ev.setFromEuler(this),this.setFromQuaternion(ev,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(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(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new P(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}ey.prototype.isEuler=!0,ey.DefaultOrder="XYZ",ey.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class ex{constructor(){this.mask=1}set(e){this.mask=1<<e|0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return 0!=(this.mask&e.mask)}}let e_=0,eb=new P,eM=new C,ew=new el,eS=new P,eT=new P,eE=new P,eA=new C,eL=new P(1,0,0),eR=new P(0,1,0),eC=new P(0,0,1),eP={type:"added"},eI={type:"removed"};class eD extends o{constructor(){super(),Object.defineProperty(this,"id",{value:e_++}),this.uuid=d(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=eD.DefaultUp.clone();let e=new P,t=new ey,i=new C,n=new P(1,1,1);t._onChange(function(){i.setFromEuler(t,!1)}),i._onChange(function(){t.setFromQuaternion(i,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new el},normalMatrix:{value:new b}}),this.matrix=new el,this.matrixWorld=new el,this.matrixAutoUpdate=eD.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new ex,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}
1setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return eM.setFromAxisAngle(e,t),this.quaternion.multiply(eM),this}rotateOnWorldAxis(e,t){return eM.setFromAxisAngle(e,t),this.quaternion.premultiply(eM),this}rotateX(e){return this.rotateOnAxis(eL,e)}rotateY(e){return this.rotateOnAxis(eR,e)}rotateZ(e){return this.rotateOnAxis(eC,e)}translateOnAxis(e,t){return eb.copy(e).applyQuaternion(this.quaternion),this.position.add(eb.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(eL,e)}translateY(e){return this.translateOnAxis(eR,e)}translateZ(e){return this.translateOnAxis(eC,e)}localToWorld(e){return e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return e.applyMatrix4(ew.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?eS.copy(e):eS.set(e,t,i);let n=this.parent;this.updateWorldMatrix(!0,!1),eT.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ew.lookAt(eT,eS,this.up):ew.lookAt(eS,eT,this.up),this.quaternion.setFromRotationMatrix(ew),n&&(ew.extractRotation(n.matrixWorld),eM.setFromRotationMatrix(ew),this.quaternion.premultiply(eM.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?console.error("THREE.Object3D.add: object can't be added as a child of itself.",e):e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(eP)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}let t=this.children.indexOf(e);return -1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(eI)),this}removeFromParent(){let e=this.parent;return null!==e&&e.remove(this),this}clear(){for(let e=0;e<this.children.length;e++){let t=this.children[e];t.parent=null,t.dispatchEvent(eI)}return this.children.length=0,this}attach(e){return this.updateWorldMatrix(!0,!1),ew.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),ew.multiply(e.parent.matrixWorld)),e.applyMatrix4(ew),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let i=0,n=this.children.length;i<n;i++){let n=this.children[i].getObjectByProperty(e,t);if(void 0!==n)return n}}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(eT,e,eE),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(eT,eA,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);let t=this.children;for(let i=0,n=t.length;i<n;i++)t[i].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);let t=this.children;for(let i=0,n=t.length;i<n;i++)t[i].traverseVisible(e)}traverseAncestors(e){let t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);let t=this.children;for(let i=0,n=t.length;i<n;i++)t[i].updateMatrixWorld(e)}updateWorldMatrix(e,t){let i=this.parent;if(!0===e&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t){let e=this.children;for(let t=0,i=e.length;t<i;t++)e[t].updateWorldMatrix(!1,!0)}}toJSON(e){let t=void 0===e||"string"==typeof e,i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});let n={};function r(t,i){return void 0===t[i.uuid]&&(t[i.uuid]=i.toJSON(e)),i.uuid}
1if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&(n.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=r(e.geometries,this.geometry);let t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){let i=t.shapes;if(Array.isArray(i))for(let t=0,n=i.length;t<n;t++){let n=i[t];r(e.shapes,n)}else r(e.shapes,i)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(e.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),void 0!==this.material){if(Array.isArray(this.material)){let t=[];for(let i=0,n=this.material.length;i<n;i++)t.push(r(e.materials,this.material[i]));n.material=t}else n.material=r(e.materials,this.material)}if(this.children.length>0){n.children=[];for(let t=0;t<this.children.length;t++)n.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){n.animations=[];for(let t=0;t<this.animations.length;t++){let i=this.animations[t];n.animations.push(r(e.animations,i))}}if(t){let t=a(e.geometries),n=a(e.materials),r=a(e.textures),s=a(e.images),o=a(e.shapes),l=a(e.skeletons),h=a(e.animations);t.length>0&&(i.geometries=t),n.length>0&&(i.materials=n),r.length>0&&(i.textures=r),s.length>0&&(i.images=s),o.length>0&&(i.shapes=o),l.length>0&&(i.skeletons=l),h.length>0&&(i.animations=h)}return i.object=n,i;function a(e){let t=[];for(let i in e){let n=e[i];delete n.metadata,t.push(n)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,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(let t=0;t<e.children.length;t++){let i=e.children[t];this.add(i.clone())}return this}}eD.DefaultUp=new P(0,1,0),eD.DefaultMatrixAutoUpdate=!0,eD.prototype.isObject3D=!0;let eN=new P,ez=new P,eB=new P,eF=new P,eO=new P,eU=new P,eH=new P,eG=new P,ek=new P,eV=new P;class eW{constructor(e=new P,t=new P,i=new P){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,n){n.subVectors(i,t),eN.subVectors(e,t),n.cross(eN);let r=n.lengthSq();return r>0?n.multiplyScalar(1/Math.sqrt(r)):n.set(0,0,0)}static getBarycoord(e,t,i,n,r){eN.subVectors(n,t),ez.subVectors(i,t),eB.subVectors(e,t);let a=eN.dot(eN),s=eN.dot(ez),o=eN.dot(eB),l=ez.dot(ez),h=ez.dot(eB),u=a*l-s*s;if(0===u)return r.set(-2,-1,-1);let c=1/u,d=(l*o-s*h)*c,p=(a*h-s*o)*c;return r.set(1-d-p,p,d)}static containsPoint(e,t,i,n){return this.getBarycoord(e,t,i,n,eF),eF.x>=0&&eF.y>=0&&eF.x+eF.y<=1}static getUV(e,t,i,n,r,a,s,o){return this.getBarycoord(e,t,i,n,eF),o.set(0,0),o.addScaledVector(r,eF.x),o.addScaledVector(a,eF.y),o.addScaledVector(s,eF.z),o}static isFrontFacing(e,t,i,n){return eN.subVectors(i,t),ez.subVectors(e,t),0>eN.cross(ez).dot(n)}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return eN.subVectors(this.c,this.b),ez.subVectors(this.a,this.b),.5*eN.cross(ez).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return eW.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return eW.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,n,r){return eW.getUV(e,this.a,this.b,this.c,t,i,n,r)}containsPoint(e){return eW.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return eW.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let i,n;let r=this.a,a=this.b,s=this.c;eO.subVectors(a,r),eU.subVectors(s,r),eG.subVectors(e,r);let o=eO.dot(eG),l=eU.dot(eG);if(o<=0&&l<=0)return t.copy(r);ek.subVectors(e,a);let h=eO.dot(ek),u=eU.dot(ek);if(h>=0&&u<=h)return t.copy(a);let c=o*u-h*l;if(c<=0&&o>=0&&h<=0)return i=o/(o-h),t.copy(r).addScaledVector(eO,i);eV.subVectors(e,s);let d=eO.dot(eV),p=eU.dot(eV);if(p>=0&&d<=p)return t.copy(s);let m=d*l-o*p;if(m<=0&&l>
1=0&&p<=0)return n=l/(l-p),t.copy(r).addScaledVector(eU,n);let f=h*p-d*u;if(f<=0&&u-h>=0&&d-p>=0)return eH.subVectors(s,a),n=(u-h)/(u-h+(d-p)),t.copy(a).addScaledVector(eH,n);let g=1/(f+m+c);return i=m*g,n=c*g,t.copy(r).addScaledVector(eO,i).addScaledVector(eU,n)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let ej=0;class eq extends o{constructor(){super(),Object.defineProperty(this,"id",{value:ej++}),this.uuid=d(),this.name="",this.type="Material",this.fog=!0,this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.format=1023,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(let t in e){let i=e[t];if(void 0===i){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if("shading"===t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===i;continue}let n=this[t];void 0!==n?n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[t]=i:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}}toJSON(e){let t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});let i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function n(e){let t=[];for(let i in e){let n=e[i];delete n.metadata,t.push(n)}return t}
vendor: 6,855 bytes, line 1
1if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),this.sheenTint&&this.sheenTint.isColor&&(i.sheenTint=this.sheenTint.getHex()),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularTint&&this.specularTint.isColor&&(i.specularTint=this.specularTint.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularTintMap&&this.specularTintMap.isTexture&&(i.specularTintMap=this.specularTintMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationTint&&(i.attenuationTint=this.attenuationTint.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(i.blending=this.blending),0!==this.side&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),1023!==this.format&&(i.format=this.format),!0===this.transparent&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(i.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=this.flatShading),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),t){let t=n(e.textures),r=n(e.images);t.length>0&&(i.textures=t),r.length>0&&(i.images=r)}return i}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.format=e.format,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;let t=e.clippingPlanes,i=null;if(null!==t){let e=t.length;i=Array(e);for(let n=0;n!==e;++n)i[n]=t[n].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipSh
1adows,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.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}eq.prototype.isMaterial=!0;let eX={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32},eY={h:0,s:0,l:0},eJ={h:0,s:0,l:0};function eZ(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+6*(t-e)*(2/3-i):e}function eQ(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function eK(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class e${constructor(e,t,i){return void 0===t&&void 0===i?this.set(e):this.setRGB(e,t,i)}set(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(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(e,t,i){return this.r=e,this.g=t,this.b=i,this}setHSL(e,t,i){if(e=m(e,1),t=p(t,0,1),i=p(i,0,1),0===t)this.r=this.g=this.b=i;else{let n=i<=.5?i*(1+t):i+t-i*t,r=2*i-n;this.r=eZ(r,n,e+1/3),this.g=eZ(r,n,e),this.b=eZ(r,n,e-1/3)}return this}setStyle(e){let t;function i(t){void 0!==t&&1>parseFloat(t)&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}if(t=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let e;let n=t[1],r=t[2];switch(n){case"rgb":case"rgba":if(e=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(255,parseInt(e[1],10))/255,this.g=Math.min(255,parseInt(e[2],10))/255,this.b=Math.min(255,parseInt(e[3],10))/255,i(e[4]),this;if(e=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(100,parseInt(e[1],10))/100,this.g=Math.min(100,parseInt(e[2],10))/100,this.b=Math.min(100,parseInt(e[3],10))/100,i(e[4]),this;break;case"hsl":case"hsla":if(e=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r)){let t=parseFloat(e[1])/360,n=parseInt(e[2],10)/100,r=parseInt(e[3],10)/100;return i(e[4]),this.setHSL(t,n,r)}}}else if(t=/^\#([A-Fa-f\d]+)$/.exec(e)){let e=t[1],i=e.length;if(3===i)return this.r=parseInt(e.charAt(0)+e.charAt(0),16)/255,this.g=parseInt(e.charAt(1)+e.charAt(1),16)/255,this.b=parseInt(e.charAt(2)+e.charAt(2),16)/255,this;if(6===i)return this.r=parseInt(e.charAt(0)+e.charAt(1),16)/255,this.g=parseInt(e.charAt(2)+e.charAt(3),16)/255,this.b=parseInt(e.charAt(4)+e.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){let t=eX[e.toLowerCase()];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){let i=t>0?1/t:1;return this.r=Math.pow(e.r,i),this.g=Math.pow(e.g,i),this.b=Math.pow(e.b,i),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=eQ(e.r),this.g=eQ(e.g),this.b=eQ(e.b),this}copyLinearToSRGB(e){return this.r=eK(e.r),this.g=eK(e.g),this.b=eK(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){let t,i;let n=this.r,r=this.g,a=this.b,s=Math.max(n,r,a),o=Math.min(n,r,a),l=(o+s)/2;if(o===s)t=0,i=0;else{let e=s-o;
vendor: 5,728 bytes, line 1
1switch(i=l<=.5?e/(s+o):e/(2-s-o),s){case n:t=(r-a)/e+(r<a?6:0);break;case r:t=(a-n)/e+2;break;case a:t=(n-r)/e+4}t/=6}return e.h=t,e.s=i,e.l=l,e}getStyle(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"}offsetHSL(e,t,i){return this.getHSL(eY),eY.h+=e,eY.s+=t,eY.l+=i,this.setHSL(eY.h,eY.s,eY.l),this}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(eY),e.getHSL(eJ);let i=f(eY.h,eJ.h,t),n=f(eY.s,eJ.s,t),r=f(eY.l,eJ.l,t);return this.setHSL(i,n,r),this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),!0===e.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}}e$.NAMES=eX,e$.prototype.isColor=!0,e$.prototype.r=1,e$.prototype.g=1,e$.prototype.b=1;class e0 extends eq{constructor(e){super(),this.type="MeshBasicMaterial",this.color=new e$(0xffffff),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(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}}e0.prototype.isMeshBasicMaterial=!0;let e1=new P,e3=new _;class e2{constructor(e,t,i){if(Array.isArray(e))throw 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===i,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(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(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let n=0,r=this.itemSize;n<r;n++)this.array[e+n]=t.array[i+n];return this}copyArray(e){return this.array.set(e),this}copyColorsArray(e){let t=this.array,i=0;for(let n=0,r=e.length;n<r;n++){let r=e[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",n),r=new e$),t[i++]=r.r,t[i++]=r.g,t[i++]=r.b}return this}copyVector2sArray(e){let t=this.array,i=0;for(let n=0,r=e.length;n<r;n++){let r=e[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",n),r=new _),t[i++]=r.x,t[i++]=r.y}return this}copyVector3sArray(e){let t=this.array,i=0;for(let n=0,r=e.length;n<r;n++){let r=e[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",n),r=new P),t[i++]=r.x,t[i++]=r.y,t[i++]=r.z}return this}copyVector4sArray(e){let t=this.array,i=0;for(let n=0,r=e.length;n<r;n++){let r=e[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",n),r=new E),t[i++]=r.x,t[i++]=r.y,t[i++]=r.z,t[i++]=r.w}return this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,i=this.count;t<i;t++)e3.fromBufferAttribute(this,t),e3.applyMatrix3(e),this.setXY(t,e3.x,e3.y);else if(3===this.itemSize)for(let t=0,i=this.count;t<i;t++)e1.fromBufferAttribute(this,t),e1.applyMatrix3(e),this.setXYZ(t,e1.x,e1.y,e1.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)e1.x=this.getX(t),e1.y=this.getY(t),e1.z=this.getZ(t),e1.applyMatrix4(e),this.setXYZ(t,e1.x,e1.y,e1.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)e1.x=this.getX(t),e1.y=this.getY(t),e1.z=this.getZ(t),e1.applyNormalMatrix(e),this.setXYZ(t,e1.x,e1.y,e1.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)e1.x=this.getX(t),e1.y=this.getY(t),e1.z=this.getZ(t),e1.transformDirection(e),this.setXYZ(t,e1.x,e1.y,e1.z);return this}set(e,t=0){return this.array.set(e,t),this}getX(e){return this.array[e*this.itemSize]}setX(e,t){return this.array[e*this.itemSize]=t,this}getY(e){return this.array[e*this.itemSize+1]}setY(e,t){return this.array[e*this.itemSize+1]=t,this}getZ(e){return this.array[e*this.itemSize+2]}setZ(e,t){return this.array[e*this.itemSize+2]=t,this}getW(e){return this.array[e*this.itemSize+3]}setW(e,t){return this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this}setXYZW(e,t,i,n,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this.array[e+3]=r,this}
1onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),35044!==this.usage&&(e.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(e.updateRange=this.updateRange),e}}e2.prototype.isBufferAttribute=!0;class e4 extends e2{constructor(e,t,i){super(new Int8Array(e),t,i)}}class e5 extends e2{constructor(e,t,i){super(new Uint8Array(e),t,i)}}class e6 extends e2{constructor(e,t,i){super(new Uint8ClampedArray(e),t,i)}}class e8 extends e2{constructor(e,t,i){super(new Int16Array(e),t,i)}}class e7 extends e2{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class e9 extends e2{constructor(e,t,i){super(new Int32Array(e),t,i)}}class te extends e2{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class tt extends e2{constructor(e,t,i){super(new Uint16Array(e),t,i)}}tt.prototype.isFloat16BufferAttribute=!0;class ti extends e2{constructor(e,t,i){super(new Float32Array(e),t,i)}}class tn extends e2{constructor(e,t,i){super(new Float64Array(e),t,i)}}function tr(e){if(0===e.length)return-1/0;let t=e[0];for(let i=1,n=e.length;i<n;++i)e[i]>t&&(t=e[i]);return t}let ta={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function ts(e,t){return new ta[e](t)}let to=0,tl=new el,th=new eD,tu=new P,tc=new N,td=new N,tp=new P;class tm extends o{constructor(){super(),Object.defineProperty(this,"id",{value:to++}),this.uuid=d(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(tr(e)>65535?te:e7)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);let i=this.attributes.normal;if(void 0!==i){let t=(new b).getNormalMatrix(e);i.applyNormalMatrix(t),i.needsUpdate=!0}let n=this.attributes.tangent;return void 0!==n&&(n.transformDirection(e),n.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return tl.makeRotationFromQuaternion(e),this.applyMatrix4(tl),this}rotateX(e){return tl.makeRotationX(e),this.applyMatrix4(tl),this}rotateY(e){return tl.makeRotationY(e),this.applyMatrix4(tl),this}rotateZ(e){return tl.makeRotationZ(e),this.applyMatrix4(tl),this}translate(e,t,i){return tl.makeTranslation(e,t,i),this.applyMatrix4(tl),this}scale(e,t,i){return tl.makeScale(e,t,i),this.applyMatrix4(tl),this}lookAt(e){return th.lookAt(e),th.updateMatrix(),this.applyMatrix4(th.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(tu).negate(),this.translate(tu.x,tu.y,tu.z),this}setFromPoints(e){let t=[];for(let i=0,n=e.length;i<n;i++){let n=e[i];t.push(n.x,n.y,n.z||0)}return this.setAttribute("position",new ti(t,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new N);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "fal
1se".',this),void this.boundingBox.set(new P(-1/0,-1/0,-1/0),new P(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,i=t.length;e<i;e++){let i=t[e];tc.setFromBufferAttribute(i),this.morphTargetsRelative?(tp.addVectors(this.boundingBox.min,tc.min),this.boundingBox.expandByPoint(tp),tp.addVectors(this.boundingBox.max,tc.max),this.boundingBox.expandByPoint(tp)):(this.boundingBox.expandByPoint(tc.min),this.boundingBox.expandByPoint(tc.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new $);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "fal
1se".',this),void this.boundingSphere.set(new P,1/0);if(e){let i=this.boundingSphere.center;if(tc.setFromBufferAttribute(e),t)for(let e=0,i=t.length;e<i;e++){let i=t[e];td.setFromBufferAttribute(i),this.morphTargetsRelative?(tp.addVectors(tc.min,td.min),tc.expandByPoint(tp),tp.addVectors(tc.max,td.max),tc.expandByPoint(tp)):(tc.expandByPoint(td.min),tc.expandByPoint(td.max))}tc.getCenter(i);let n=0;for(let t=0,r=e.count;t<r;t++)tp.fromBufferAttribute(e,t),n=Math.max(n,i.distanceToSquared(tp));if(t)for(let r=0,a=t.length;r<a;r++){let a=t[r],s=this.morphTargetsRelative;for(let t=0,r=a.count;t<r;t++)tp.fromBufferAttribute(a,t),s&&(tu.fromBufferAttribute(e,t),tp.add(tu)),n=Math.max(n,i.distanceToSquared(tp))}this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");let i=e.array,n=t.position.array,r=t.normal.array,a=t.uv.array,s=n.length/3;void 0===t.tangent&&this.setAttribute("tangent",new e2(new Float32Array(4*s),4));let o=t.tangent.array,l=[],h=[];for(let e=0;e<s;e++)l[e]=new P,h[e]=new P;let u=new P,c=new P,d=new P,p=new _,m=new _,f=new _,g=new P,v=new P,y=this.groups;0===y.length&&(y=[{start:0,count:i.length}]);for(let e=0,t=y.length;e<t;++e){let t=y[e],r=t.start;for(let e=r,s=r+t.count;e<s;e+=3)!function(e,t,i){u.fromArray(n,3*e),c.fromArray(n,3*t),d.fromArray(n,3*i),p.fromArray(a,2*e),m.fromArray(a,2*t),f.fromArray(a,2*i),c.sub(u),d.sub(u),m.sub(p),f.sub(p);let r=1/(m.x*f.y-f.x*m.y);isFinite(r)&&(g.copy(c).multiplyScalar(f.y).addScaledVector(d,-m.y).multiplyScalar(r),v.copy(d).multiplyScalar(m.x).addScaledVector(c,-f.x).multiplyScalar(r),l[e].add(g),l[t].add(g),l[i].add(g),h[e].add(v),h[t].add(v),h[i].add(v))}(i[e+0],i[e+1],i[e+2])}let x=new P,b=new P,M=new P,w=new P;function S(e){M.fromArray(r,3*e),w.copy(M);let t=l[e];x.copy(t),x.sub(M.multiplyScalar(M.dot(t))).normalize(),b.crossVectors(w,t);let i=0>b.dot(h[e])?-1:1;o[4*e]=x.x,o[4*e+1]=x.y,o[4*e+2]=x.z,o[4*e+3]=i}for(let e=0,t=y.length;e<t;++e){let t=y[e],n=t.start;for(let e=n,r=n+t.count;e<r;e+=3)S(i[e+0]),S(i[e+1]),S(i[e+2])}}computeVertexNormals(){let e=this.index,t=this.getAttribute("position");if(void 0!==t){let i=this.getAttribute("normal");if(void 0===i)i=new e2(new Float32Array(3*t.count),3),this.setAttribute("normal",i);else for(let e=0,t=i.count;e<t;e++)i.setXYZ(e,0,0,0);let n=new P,r=new P,a=new P,s=new P,o=new P,l=new P,h=new P,u=new P;if(e)for(let c=0,d=e.count;c<d;c+=3){let d=e.getX(c+0),p=e.getX(c+1),m=e.getX(c+2);n.fromBufferAttribute(t,d),r.fromBufferAttribute(t,p),a.fromBufferAttribute(t,m),h.subVectors(a,r),u.subVectors(n,r),h.cross(u),s.fromBufferAttribute(i,d),o.fromBufferAttribute(i,p),l.fromBufferAttribute(i,m),s.add(h),o.add(h),l.add(h),i.setXYZ(d,s.x,s.y,s.z),i.setXYZ(p,o.x,o.y,o.z),i.setXYZ(m,l.x,l.y,l.z)}else for(let e=0,s=t.count;e<s;e+=3)n.fromBufferAttribute(t,e+0),r.fromBufferAttribute(t,e+1),a.fromBufferAttribute(t,e+2),h.subVectors(a,r),u.subVectors(n,r),h.cross(u),i.setXYZ(e+0,h.x,h.y,h.z),i.setXYZ(e+1,h.x,h.y,h.z),i.setXYZ(e+2,h.x,h.y,h.z);this.normalizeNormals(),i.needsUpdate=!0}}merge(e,t){if(!e||!e.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e);void 0===t&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));let i=this.attributes;for(let n in i){if(void 0===e.attributes[n])continue;let r=i[n].array,a=e.attributes[n],s=a.array,o=a.itemSize*t,l=Math.min(s.length,r.length-o);for(let e=0,t=o;e<l;e++,t++)r[t]=s[e]}return this}normalizeNormals(){let e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)tp.fromBufferAttribute(e,t),tp.normalize(),e.setXYZ(t,tp.x,tp.y,tp.z)}toNonIndexed(){function e(e,t){let i=e.array,n=e.itemSize,r=e.normalized,a=new i.constructor(t.length*n),s=0,o=0;for(let r=0,l=t.length;r<l;r++){s=e.isInterleavedBufferAttribute?t[r]*e.data.stride+e.offset:t[r]*n;for(let e=0;e<n;e++)a[o++]=i[s++]}return new e2(a,n,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let t=new tm,i=this.index.array,n=this.attributes;for(let r in n){let a=e(n[r],i);t.setAttribute(r,a)}let r=this.morphAttributes;for(let n in r){let a=[],s=r[n];for(let t=0,n=s.length;t<n;t++){let n=e(s[t],i);a.push(n)}t.morphAttributes[n]=a}t.morphTargetsRelative=this.morphTargetsRelative;let a=this.groups;for(let e=0,i=a.length;e<i;e++){let i=a[e];t.addGroup(i.start,i.count,i.materialIndex)}return t}toJSON(){let e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};
1if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){let t=this.parameters;for(let i in t)void 0!==t[i]&&(e[i]=t[i]);return e}e.data={attributes:{}};let t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let i=this.attributes;for(let t in i){let n=i[t];e.data.attributes[t]=n.toJSON(e.data)}let n={},r=!1;for(let t in this.morphAttributes){let i=this.morphAttributes[t],a=[];for(let t=0,n=i.length;t<n;t++){let n=i[t];a.push(n.toJSON(e.data))}a.length>0&&(n[t]=a,r=!0)}r&&(e.data.morphAttributes=n,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let s=this.boundingSphere;return null!==s&&(e.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),e}clone(){return(new tm).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let i=e.index;null!==i&&this.setIndex(i.clone(t));let n=e.attributes;for(let e in n){let i=n[e];this.setAttribute(e,i.clone(t))}let r=e.morphAttributes;for(let e in r){let i=[],n=r[e];for(let e=0,r=n.length;e<r;e++)i.push(n[e].clone(t));this.morphAttributes[e]=i}this.morphTargetsRelative=e.morphTargetsRelative;let a=e.groups;for(let e=0,t=a.length;e<t;e++){let t=a[e];this.addGroup(t.start,t.count,t.materialIndex)}let s=e.boundingBox;null!==s&&(this.boundingBox=s.clone());let o=e.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}tm.prototype.isBufferGeometry=!0;let tf=new el,tg=new eo,tv=new $,ty=new P,tx=new P,t_=new P,tb=new P,tM=new P,tw=new P,tS=new P,tT=new P,tE=new P,tA=new _,tL=new _,tR=new _,tC=new P,tP=new P;class tI extends eD{constructor(e=new tm,t=new e0){super(),this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,i=Object.keys(t);if(i.length>0){let e=t[i[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,i=e.length;t<i;t++){let i=e[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=t}}}}else{let t=e.morphTargets;void 0!==t&&t.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){let i;let n=this.geometry,r=this.material,a=this.matrixWorld;if(void 0!==r&&(null===n.boundingSphere&&n.computeBoundingSphere(),tv.copy(n.boundingSphere),tv.applyMatrix4(a),!1!==e.ray.intersectsSphere(tv))&&(tf.copy(a).invert(),tg.copy(e.ray).applyMatrix4(tf),null===n.boundingBox||!1!==tg.intersectsBox(n.boundingBox))){if(n.isBufferGeometry){let a=n.index,s=n.attributes.position,o=n.morphAttributes.position,l=n.morphTargetsRelative,h=n.attributes.uv,u=n.attributes.uv2,c=n.groups,d=n.drawRange;if(null!==a){if(Array.isArray(r))for(let n=0,p=c.length;n<p;n++){let p=c[n],m=r[p.materialIndex];for(let n=Math.max(p.start,d.start),r=Math.min(p.start+p.count,d.start+d.count);n<r;n+=3)(i=tD(this,m,e,tg,s,o,l,h,u,a.getX(n),a.getX(n+1),a.getX(n+2)))&&(i.faceIndex=Math.floor(n/3),i.face.materialIndex=p.materialIndex,t.push(i))}else for(let n=Math.max(0,d.start),c=Math.min(a.count,d.start+d.count);n<c;n+=3)(i=tD(this,r,e,tg,s,o,l,h,u,a.getX(n),a.getX(n+1),a.getX(n+2)))&&(i.faceIndex=Math.floor(n/3),t.push(i))}else if(void 0!==s){if(Array.isArray(r))for(let n=0,a=c.length;n<a;n++){let a=c[n],p=r[a.materialIndex];for(let n=Math.max(a.start,d.start),r=Math.min(a.start+a.count,d.start+d.count);n<r;n+=3)(i=tD(this,p,e,tg,s,o,l,h,u,n,n+1,n+2))&&(i.faceIndex=Math.floor(n/3),i.face.materialIndex=a.materialIndex,t.push(i))}else for(let n=Math.max(0,d.start),a=Math.min(s.count,d.start+d.count);n<a;n+=3)(i=tD(this,r,e,tg,s,o,l,h,u,n,n+1,n+2))&&(i.faceIndex=Math.floor(n/3),t.pu
1sh(i))}}else n.isGeometry&&console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function tD(e,t,i,n,r,a,s,o,l,h,u,c){ty.fromBufferAttribute(r,h),tx.fromBufferAttribute(r,u),t_.fromBufferAttribute(r,c);let d=e.morphTargetInfluences;if(a&&d){tS.set(0,0,0),tT.set(0,0,0),tE.set(0,0,0);for(let e=0,t=a.length;e<t;e++){let t=d[e],i=a[e];0!==t&&(tb.fromBufferAttribute(i,h),tM.fromBufferAttribute(i,u),tw.fromBufferAttribute(i,c),s?(tS.addScaledVector(tb,t),tT.addScaledVector(tM,t),tE.addScaledVector(tw,t)):(tS.addScaledVector(tb.sub(ty),t),tT.addScaledVector(tM.sub(tx),t),tE.addScaledVector(tw.sub(t_),t)))}ty.add(tS),tx.add(tT),t_.add(tE)}e.isSkinnedMesh&&(e.boneTransform(h,ty),e.boneTransform(u,tx),e.boneTransform(c,t_));let p=function(e,t,i,n,r,a,s,o){if(null===(1===t.side?n.intersectTriangle(s,a,r,!0,o):n.intersectTriangle(r,a,s,2!==t.side,o)))return null;tP.copy(o),tP.applyMatrix4(e.matrixWorld);let l=i.ray.origin.distanceTo(tP);return l<i.near||l>i.far?null:{distance:l,point:tP.clone(),object:e}}(e,t,i,n,ty,tx,t_,tC);if(p){o&&(tA.fromBufferAttribute(o,h),tL.fromBufferAttribute(o,u),tR.fromBufferAttribute(o,c),p.uv=eW.getUV(tC,ty,tx,t_,tA,tL,tR,new _)),l&&(tA.fromBufferAttribute(l,h),tL.fromBufferAttribute(l,u),tR.fromBufferAttribute(l,c),p.uv2=eW.getUV(tC,ty,tx,t_,tA,tL,tR,new _));let e={a:h,b:u,c:c,normal:new P,materialIndex:0};eW.getNormal(ty,tx,t_,e.normal),p.face=e}return p}tI.prototype.isMesh=!0;class tN extends tm{constructor(e=1,t=1,i=1,n=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:n,heightSegments:r,depthSegments:a};let s=this;n=Math.floor(n),r=Math.floor(r);let o=[],l=[],h=[],u=[],c=0,d=0;function p(e,t,i,n,r,a,p,m,f,g,v){let y=a/f,x=p/g,_=a/2,b=p/2,M=m/2,w=f+1,S=g+1,T=0,E=0,A=new P;for(let a=0;a<S;a++){let s=a*x-b;for(let o=0;o<w;o++){let c=o*y-_;A[e]=c*n,A[t]=s*r,A[i]=M,l.push(A.x,A.y,A.z),A[e]=0,A[t]=0,A[i]=m>0?1:-1,h.push(A.x,A.y,A.z),u.push(o/f),u.push(1-a/g),T+=1}}for(let e=0;e<g;e++)for(let t=0;t<f;t++){let i=c+t+w*e,n=c+t+w*(e+1),r=c+(t+1)+w*(e+1),a=c+(t+1)+w*e;o.push(i,n,a),o.push(n,r,a),E+=6}s.addGroup(d,E,v),d+=E,c+=T}p("z","y","x",-1,-1,i,t,e,a=Math.floor(a),r,0),p("z","y","x",1,-1,i,t,-e,a,r,1),p("x","z","y",1,1,e,i,t,n,a,2),p("x","z","y",1,-1,e,i,-t,n,a,3),p("x","y","z",1,-1,e,t,i,n,r,4),p("x","y","z",-1,-1,e,t,-i,n,r,5),this.setIndex(o),this.setAttribute("position",new ti(l,3)),this.setAttribute("normal",new ti(h,3)),this.setAttribute("uv",new ti(u,2))}static fromJSON(e){return new tN(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function tz(e){let t={};for(let i in e)for(let n in t[i]={},e[i]){let r=e[i][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?t[i][n]=r.clone():Array.isArray(r)?t[i][n]=r.slice():t[i][n]=r}return t}function tB(e){let t={};for(let i=0;i<e.length;i++){let n=tz(e[i]);for(let e in n)t[e]=n[e]}return t}let tF={clone:tz,merge:tB};class tO extends eq{constructor(e){super(),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=tz(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){let t=super.toJSON(e);for(let i in t.glslVersion=this.glslVersion,t.uniforms={},this.uniforms){let n=this.uniforms[i].value;n&&n.isTexture?t.uniforms[i]={type:"t",value:n.toJSON(e).uuid}:n&&n.isColor?t.uniforms[i]={type:"c",value:n.getHex()}:n&&n.isVector2?t.uniforms[i]={type:"v2",value:n.toArray()}:n&&n.isVector3?t.uniforms[i]={type:"v3",value:n.toArray()}:n&&n.isVector4?t.uniforms[i]={type:"v4",value:n.toArray()}:n&&n.isMatrix3?t.uniforms[i]={type:"m3",value:n.toArray()}:n&&n.isMatrix4?t.uniforms[i]={type:"m4",value:n.toArray()}:t.uniforms[i]={value:n}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;let i={};for(let e in this.extensions)!0===this.extensions[e]&&(i[e]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}tO.prototype.isShaderMaterial=!0;class tU extends eD{constructor(){super(),this.type="Camera",this.matrixWorldInverse=new el,this.projectionMatrix=new el,this.projectionMatrixInverse=new el}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}tU.prototype.isCamera=!0;class tH extends tU{constructor(e=50,t=1,i=.1,n=2e3){super(),this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(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(e){let t=.5*this.getFilmHeight()/e;this.fov=2*c*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(.5*u*this.fov);return .5*this.getFilmHeight()/e}
1getEffectiveFOV(){return 2*c*Math.atan(Math.tan(.5*u*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,i,n,r,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=i,this.view.offsetY=n,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(.5*u*this.fov)/this.zoom,i=2*t,n=this.aspect*i,r=-.5*n,a=this.view;if(null!==this.view&&this.view.enabled){let e=a.fullWidth,s=a.fullHeight;r+=a.offsetX*n/e,t-=a.offsetY*i/s,n*=a.width/e,i*=a.height/s}let s=this.filmOffset;0!==s&&(r+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+n,t,t-i,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(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}}tH.prototype.isPerspectiveCamera=!0;class tG extends eD{constructor(e,t,i){if(super(),this.type="CubeCamera",!0!==i.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=i;let n=new tH(90,1,e,t);n.layers=this.layers,n.up.set(0,-1,0),n.lookAt(new P(1,0,0)),this.add(n);let r=new tH(90,1,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new P(-1,0,0)),this.add(r);let a=new tH(90,1,e,t);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(new P(0,1,0)),this.add(a);let s=new tH(90,1,e,t);s.layers=this.layers,s.up.set(0,0,-1),s.lookAt(new P(0,-1,0)),this.add(s);let o=new tH(90,1,e,t);o.layers=this.layers,o.up.set(0,-1,0),o.lookAt(new P(0,0,1)),this.add(o);let l=new tH(90,1,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new P(0,0,-1)),this.add(l)}update(e,t){null===this.parent&&this.updateMatrixWorld();let i=this.renderTarget,[n,r,a,s,o,l]=this.children,h=e.xr.enabled,u=e.getRenderTarget();e.xr.enabled=!1;let c=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0),e.render(t,n),e.setRenderTarget(i,1),e.render(t,r),e.setRenderTarget(i,2),e.render(t,a),e.setRenderTarget(i,3),e.render(t,s),e.setRenderTarget(i,4),e.render(t,o),i.texture.generateMipmaps=c,e.setRenderTarget(i,5),e.render(t,l),e.setRenderTarget(u),e.xr.enabled=h}}class tk extends S{constructor(e,t,i,n,r,a,s,o,l,h){super(e=void 0!==e?e:[],t=void 0!==t?t:301,i,n,r,a,s=void 0!==s?s:1022,o,l,h),this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}tk.prototype.isCubeTexture=!0;class tV extends A{constructor(e,t,i){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=i),super(e,e,t),t=t||{},this.texture=new tk(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:1006,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=1023,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let i=new tN(5,5,5),n=new tO({name:"CubemapFromEquirect",uniforms:tz({tEquirect:{value:null}}),vertexShader:"\n\n varying vec3 vWorldDirection;\n\n vec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n }\n\n void main() {\n\n vWorldDirection = transformDirection( position, modelMatrix );\n\n #include <begin_vertex>\n #include <project_vertex>\n\n }\n ",fragmentShader:"\n\n uniform sampler2D tEquirect;\n\n varying vec3 vWorldDirection;\n\n #include <common>\n\n void main() {\n\n vec3 direction = normalize( vWorldDirection );\n\n vec2 sampleUV = equirectUv( direction );\n\n gl_FragColor = texture2D( tEquirect, sampleUV );\n\n }\n ",side:1,blending:0});n.uniforms.tEquirect.value=t;let r=new tI(i,n),a=t.minFilter;return 1008===t.minFilter&&(t.minFilter=1006),new tG(1,10,this).update(e,r),t.minFilter=a,r.geometry.dispose(),r.material.dispose(),this}clear(e,t,i,n){let r=e.getRenderTarget();for(let r=0;r<6;r++)e.setRenderTarget(this,r),e.clear(t,i,n);e.setRenderTarget(r)}}
1tV.prototype.isWebGLCubeRenderTarget=!0;let tW=new P,tj=new P,tq=new b;class tX{constructor(e=new P(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,n){return this.normal.set(e,t,i),this.constant=n,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){let n=tW.subVectors(i,t).cross(tj.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(n,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){let i=e.delta(tW),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;let r=-(e.start.dot(this.normal)+this.constant)/n;return r<0||r>1?null:t.copy(i).multiplyScalar(r).add(e.start)}intersectsLine(e){let t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let i=t||tq.getNormalMatrix(e),n=this.coplanarPoint(tW).applyMatrix4(e),r=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}tX.prototype.isPlane=!0;let tY=new $,tJ=new P;class tZ{constructor(e=new tX,t=new tX,i=new tX,n=new tX,r=new tX,a=new tX){this.planes=[e,t,i,n,r,a]}set(e,t,i,n,r,a){let s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(i),s[3].copy(n),s[4].copy(r),s[5].copy(a),this}copy(e){let t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e){let t=this.planes,i=e.elements,n=i[0],r=i[1],a=i[2],s=i[3],o=i[4],l=i[5],h=i[6],u=i[7],c=i[8],d=i[9],p=i[10],m=i[11],f=i[12],g=i[13],v=i[14],y=i[15];return t[0].setComponents(s-n,u-o,m-c,y-f).normalize(),t[1].setComponents(s+n,u+o,m+c,y+f).normalize(),t[2].setComponents(s+r,u+l,m+d,y+g).normalize(),t[3].setComponents(s-r,u-l,m-d,y-g).normalize(),t[4].setComponents(s-a,u-h,m-p,y-v).normalize(),t[5].setComponents(s+a,u+h,m+p,y+v).normalize(),this}intersectsObject(e){let t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),tY.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(tY)}intersectsSprite(e){return tY.center.set(0,0,0),tY.radius=.7071067811865476,tY.applyMatrix4(e.matrixWorld),this.intersectsSphere(tY)}intersectsSphere(e){let t=this.planes,i=e.center,n=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(i)<n)return!1;return!0}intersectsBox(e){let t=this.planes;for(let i=0;i<6;i++){let n=t[i];if(tJ.x=n.normal.x>0?e.max.x:e.min.x,tJ.y=n.normal.y>0?e.max.y:e.min.y,tJ.z=n.normal.z>0?e.max.z:e.min.z,0>n.distanceToPoint(tJ))return!1}return!0}containsPoint(e){let t=this.planes;for(let i=0;i<6;i++)if(0>t[i].distanceToPoint(e))return!1;return!0}clone(){return(new this.constructor).copy(this)}}function tQ(){let e=null,t=!1,i=null,n=null;function r(t,a){i(t,a),n=e.requestAnimationFrame(r)}return{start:function(){!0!==t&&null!==i&&(n=e.requestAnimationFrame(r),t=!0)},stop:function(){e.cancelAnimationFrame(n),t=!1},setAnimationLoop:function(e){i=e},setContext:function(t){e=t}}}function tK(e,t){let i=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);let i=n.get(t);i&&(e.deleteBuffer(i.buffer),n.delete(t))},update:function(t,r){if(t.isGLBufferAttribute){let e=n.get(t);
1return void((!e||e.version<t.version)&&n.set(t,{buffer:t.buffer,type:t.type,bytesPerElement:t.elementSize,version:t.version}))}t.isInterleavedBufferAttribute&&(t=t.data);let a=n.get(t);void 0===a?n.set(t,function(t,n){let r=t.array,a=t.usage,s=e.createBuffer();e.bindBuffer(n,s),e.bufferData(n,r,a),t.onUploadCallback();let o=5126;return r instanceof Float32Array?o=5126:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?t.isFloat16BufferAttribute?i?o=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):o=5123:r instanceof Int16Array?o=5122:r instanceof Uint32Array?o=5125:r instanceof Int32Array?o=5124:r instanceof Int8Array?o=5120:(r instanceof Uint8Array||r instanceof Uint8ClampedArray)&&(o=5121),{buffer:s,type:o,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version}}(t,r)):a.version<t.version&&(function(t,n,r){let a=n.array,s=n.updateRange;e.bindBuffer(r,t),-1===s.count?e.bufferSubData(r,0,a):(i?e.bufferSubData(r,s.offset*a.BYTES_PER_ELEMENT,a,s.offset,s.count):e.bufferSubData(r,s.offset*a.BYTES_PER_ELEMENT,a.subarray(s.offset,s.offset+s.count)),s.count=-1)}(a.buffer,t,r),a.version=t.version)}}}class t$ extends tm{constructor(e=1,t=1,i=1,n=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:n};let r=e/2,a=t/2,s=Math.floor(i),o=Math.floor(n),l=s+1,h=o+1,u=e/s,c=t/o,d=[],p=[],m=[],f=[];for(let e=0;e<h;e++){let t=e*c-a;for(let i=0;i<l;i++){let n=i*u-r;p.push(n,-t,0),m.push(0,0,1),f.push(i/s),f.push(1-e/o)}}for(let e=0;e<o;e++)for(let t=0;t<s;t++){let i=t+l*e,n=t+l*(e+1),r=t+1+l*(e+1),a=t+1+l*e;d.push(i,n,a),d.push(n,r,a)}this.setIndex(d),this.setAttribute("position",new ti(p,3)),this.setAttribute("normal",new ti(m,3)),this.setAttribute("uv",new ti(f,2))}static fromJSON(e){return new t$(e.width,e.height,e.widthSegments,e.heightSegments)}}let t0={alphamap_fragment:"#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n if ( diffuseColor.a < alphaTest ) discard;\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n uniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n float ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n reflectedLight.indirectDiffuse *= ambientOcclusion;\n #if defined( USE_ENVMAP ) && defined( STANDARD )\n float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n #endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n uniform sampler2D aoMap;\n uniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n vec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n return RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n float a2 = pow2( alpha );\n float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n return 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n float a2 = pow2( alpha );\n float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n return RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( incidentLight.direction + viewDir );
1\n float dotNL = saturate( dot( normal, incidentLight.direction ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n return F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n const float LUT_SIZE = 64.0;\n const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n const float LUT_BIAS = 0.5 / LUT_SIZE;\n float dotNV = saturate( dot( N, V ) );\n vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n uv = uv * LUT_SCALE + LUT_BIAS;\n return uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n float l = length( f );\n return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n float x = dot( v1, v2 );\n float y = abs( x );\n float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n float b = 3.4175940 + ( 4.1616724 + y ) * y;\n float v = a / b;\n float theta_sintheta = ( x >
1 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n return cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n vec3 lightNormal = cross( v1, v2 );\n if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n vec3 T1, T2;\n T1 = normalize( V - N * dot( V, N ) );\n T2 = - cross( N, T1 );\n mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n vec3 coords[ 4 ];\n coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n coords[ 0 ] = normalize( coords[ 0 ] );\n coords[ 1 ] = normalize( coords[ 1 ] );\n coords[ 2 ] = normalize( coords[ 2 ] );\n coords[ 3 ] = normalize( coords[ 3 ] );\n vec3 vectorFormFactor = vec3( 0.0 );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n float result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n return vec3( result );\n}\nfloat G_BlinnPhong_Implicit( ) {\n return 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n float dotNH = saturate( dot( geometry.normal, halfDir ) );\n float dotVH = saturate( dot( geometry.viewDir, halfDir ) );\n vec3 F = F_Schlick( specularColor, 1.0, dotVH );\n float G = G_BlinnPhong_Implicit( );\n float D = D_BlinnPhong( shininess, dotNH );\n return F * ( G * D );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float NoH ) {\n float invAlpha = 1.0 / roughness;\n float cos2h = NoH * NoH;\n float sin2h = max( 1.0 - cos2h, 0.0078125 );\n return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float NoV, float NoL ) {\n return saturate( 1.0 / ( 4.0 * ( NoL + NoV - NoL * NoV ) ) );\n}\nvec3 BRDF_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n vec3 N = geometry.normal;\n vec3 V = geometry.viewDir;\n vec3 H = normalize( V + L );\n float dotNH = saturate( dot( N, H ) );\n return specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n uniform sampler2D bumpMap;\n uniform float bumpScale;\n vec2 dHdxy_fwd() {\n vec2 dSTdx = dFdx( vUv );\n vec2 dSTdy = dFdy( vUv );\n float Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n return vec2( dBx, dBy );\n }\n vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n vec3 vN = surf_norm;\n vec3 R1 = cross( vSigmaY, vN );\n vec3 R2 = cross( vN, vSigmaX );\n float fDet = dot( vSigmaX, R1 ) * faceDirection;\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n return normalize( abs( fDet ) * surf_norm - vGrad );\n }\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n vec4 plane;\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n bool clipped = true;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n }\n #pragma unroll_loop_end\n if ( clipped ) discard;\n #endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n vClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n diffuseColor *= vColor;\n#elif defined( USE_COLOR )\n diffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR )\n varying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n varying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n vColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n vColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n vColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n vColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n return fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n float precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n float precisionSafeLength( vec3 v ) {\n float maxComponent = max3( abs( v ) );\n return length( v / maxComponent ) * maxComponent;\n }\n#endif\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\nstruct GeometricContext {\n vec3 position;\n vec3 normal;\n vec3 viewDir;\n#ifdef USE_CLEARCOAT\n vec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n mat3 tmp;\n tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n return tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n vec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n return dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n return vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n #define cubeUV_maxMipLevel 8.0\n #define cubeUV_minMipLevel 4.0\n #define cubeUV_maxTileSize 256.0\n #define cubeUV_minTileSize 16.0\n float getFace( vec3 direction ) {\n vec3 absDirection = abs( direction );\n float face = - 1.0;\n if ( absDirection.x > absDirection.z ) {\n if ( absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if ( absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n }\n vec2 getUV( vec3 direction, float face ) {\n vec2 uv;\n if ( face == 0.0 ) {\n uv = vec2( direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 1.0 ) {\n uv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n } else if ( face == 2.0 ) {\n uv = vec2( - direction.x, direction.y ) / abs( direction.z );\n } else if ( face == 3.0 ) {\n uv = vec2( - direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 4.0 ) {\n uv = vec2( - direction.x, direction.z ) / abs( direction.y );\n } else {\n uv = vec2( direction.x, direction.y ) / abs( direction.z );\n }\n return 0.5 * ( uv + 1.0 );\n }\n vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n float face = getFace( direction );\n float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n mipInt = max( mipInt, cubeUV_minMipLevel );\n float faceSize = exp2( mipInt );\n float texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n vec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n vec2 f = fract( uv );\n uv += 0.5 - f;\n if ( face > 2.0 ) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n if ( mipInt < cubeUV_maxMipLevel ) {\n uv.y += 2.0 * cubeUV_maxTileSize;\n }\n uv.y += filterInt * 2.0 * cubeUV_minTileSize;\n uv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n uv *= texelSize;\n vec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n uv.x += texelSize;\n vec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n uv.y += texelSize;\n vec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n uv.x -= texelSize;\n vec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n vec3 tm = mix( tl, tr, f.x );\n vec3 bm = mix( bl, br, f.x );\n return mix( tm, bm, f.y );\n }\n #define r0 1.0\n #define v0 0.339\n #define m0 - 2.0\n #define r1 0.8\n #define v1 0.276\n #define m1 - 1.0\n #define r4 0.4\n #define v4 0.046\n #define m4 2.0\n #define r5 0.305\n #define v5 0.016\n #define m5 3.0\n #define r6 0.21\n #define v6 0.0038\n #define m6 4.0\n float roughnessToMip( float roughness ) {\n float mip = 0.0;\n if ( roughness >= r1 ) {\n mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n } else if ( roughness >= r4 ) {\n mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n } else if ( roughness >= r5 ) {\n mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n } else if ( roughness >= r6 ) {\n mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n } else {\n mip = - 2.0 * log2( 1.16 * roughness ); }\n return mip;\n }\n vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n float mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n float mipF = fract( mip );\n float mipInt = floor( mip );\n vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n if ( mipF == 0.0 ) {\n return vec4( color0, 1.0 );\n } else {\n vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n return vec4( mix( color0, color1, mipF ), 1.0 );\n }\n }\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n mat3 m = mat3( instanceMatrix );\n transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n transformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n transformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n #ifdef FLIP_SIDED\n transformedTangent = - transformedTangent;\n #endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n uniform sampler2D displacementMap;\n uniform float displacementScale;\n uniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + dis
1placementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n vec4 emissiveColor = texture2D( emissiveMap, vUv );\n emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n totalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n uniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n return value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n float maxComponent = max( max( value.r, value.g ), value.b );\n float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.r, max( value.g, value.b ) );\n float M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n M = ceil( M * 255.0 ) / 255.0;\n return vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.r, max( value.g, value.b ) );\n float D = max( maxRange / maxRGB, 1.0 );\n D = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n vec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n vec4 vResult;\n vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n vResult.w = fract( Le );\n vResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n return vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n float Le = value.z * 255.0 + value.w;\n vec3 Xp_Y_XYZp;\n Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n return vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vec3 cameraToFrag;\n if ( isOrthographic ) {\n cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToFrag = normalize( vWorldPosition - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 reflectVec = reflect( cameraToFrag, worldNormal );\n #else\n vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n #endif\n #else\n vec3 reflectVec = vReflect;\n #endif\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n envColor = envMapTexelToLinear( envColor );\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n #else\n vec4 envColor = vec4( 0.0 );\n #endif\n #ifdef ENVMAP_BLENDING_MULTIPLY\n outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_MIX )\n outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_ADD )\n outgoingLight += envColor.xyz * specularStrength * reflectivity;\n #endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n uniform float envMapIntensity;\n uniform float flipEnvMap;\n uniform int maxMipLevel;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n \n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n uniform float reflectivity;\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n varying vec3 vWorldPosition;\n uniform float refractionRatio;\n #else\n varying vec3 vReflect;\n #endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n \n varying vec3 vWorldPosition;\n #else\n varying vec3 vReflect;\n uniform float refractionRatio;\n #endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n #ifdef ENVMAP_MODE_REFRACTION\n uniform float refractionRatio;\n #endif\n vec3 getIBLIrradiance( const in GeometricContext geometry ) {\n #if defined( ENVMAP_TYPE_CUBE_UV )\n vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n return PI * envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n #if defined( ENVMAP_TYPE_CUBE_UV )\n vec3 reflectVec;\n #ifdef ENVMAP_MODE_REFLECTION\n reflectVec = reflect( - viewDir, normal );\n reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n #else\n reflectVec = refract( - viewDir, normal, refractionRatio );\n #endif\n reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n return envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vWorldPosition = worldPosition.xyz;\n #else\n vec3 cameraToVertex;\n if ( isOrthographic ) {\n cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n }
1 else {\n cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vReflect = reflect( cameraToVertex, worldNormal );\n #else\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n #endif\n #endif\n#endif",fog_vertex:"#ifdef USE_FOG\n vFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n varying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n #ifdef FOG_EXP2\n float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n #else\n float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n #endif\n gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n uniform vec3 fogColor;\n varying float vFogDepth;\n #ifdef FOG_EXP2\n uniform float fogDensity;\n #else\n uniform float fogNear;\n uniform float fogFar;\n #endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n uniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n float dotNL = dot( normal, lightDirection );\n vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n #ifdef USE_GRADIENTMAP\n return texture2D( gradientMap, coord ).rgb;\n #else\n return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n #endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vUv2 );\n vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n lightMapIrradiance *= PI;\n #endif\n reflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n uniform sampler2D lightMap;\n uniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n vLightBack = vec3( 0.0 );\n vIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n vIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n getPointLightInfo( pointLights[ i ], geometry, directLight );\n dotNL = dot( geometry.normal, directLight.direction );\n directLightColor_Diffuse = directLight.color;\n vLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n #ifdef DOUBLE_SIDED\n vLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n #endif\n }\n #pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n getSpotLightInfo( spotLights[ i ], geometry, directLight );\n dotNL = dot( geometry.normal, directLight.direction );\n directLightColor_Diffuse = directLight.color;\n vLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n #ifdef DOUBLE_SIDED\n vLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n #endif\n }\n #pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n getDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\n dotNL = dot( geometry.normal, directLight.direction );\n directLightColor_Diffuse = directLight.color;\n vLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n #ifdef DOUBLE_SIDED\n vLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n #endif\n }\n #pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n #ifdef DOUBLE_SIDED\n vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n #endif\n }\n #pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n float x = normal.x, y = normal.y, z = normal.z;\n vec3 result = shCoefficients[ 0 ] * 0.886227;\n result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n return result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n return irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n vec3 irradiance = ambientLightColor;\n return irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n #if defined ( PHYSICALLY_CORRECT_LIGHTS )\n float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n if ( cutoffDistance > 0.0 ) {\n distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n }\n return distanceFalloff;\n #else\n if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n }\n return 1.0;\n #endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n return smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n struct DirectionalLight {\n vec3 direction;\n vec3 color;\n };\n uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n void getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n light.color = directionalLight.color;\n light.direction = directionalLight.direction;\n light.visible = true;\n }\n#endif\n#if NUM_POINT_LIGHTS > 0\n struct PointLight {\n vec3 position;\n vec3 color;\n float distance;\n float decay;\n };\n uniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n void getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n vec3 lVector = pointLight.position - geometry.position;\n light.direction = normalize( lVector );\n float lightDistance = length( lVector );\n light.color = pointLight.color;\n light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n }
1\n#endif\n#if NUM_SPOT_LIGHTS > 0\n struct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 color;\n float distance;\n float decay;\n float coneCos;\n float penumbraCos;\n };\n uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n void getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n vec3 lVector = spotLight.position - geometry.position;\n light.direction = normalize( lVector );\n float angleCos = dot( light.direction, spotLight.direction );\n float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n if ( spotAttenuation > 0.0 ) {\n float lightDistance = length( lVector );\n light.color = spotLight.color * spotAttenuation;\n light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n } else {\n light.color = vec3( 0.0 );\n light.visible = false;\n }\n }\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n struct RectAreaLight {\n vec3 color;\n vec3 position;\n vec3 halfWidth;\n vec3 halfHeight;\n };\n uniform sampler2D ltc_1; uniform sampler2D ltc_2;\n uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n struct HemisphereLight {\n vec3 direction;\n vec3 skyColor;\n vec3 groundColor;\n };\n uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n float dotNL = dot( geometry.normal, hemiLight.direction );\n float hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n return irradiance;\n }\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n vec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Toon\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material ) (0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n vec3 diffuseColor;\n vec3 specularColor;\n float specularShininess;\n float specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_BlinnPhong\n#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material ) (0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n #ifdef SPECULAR\n float specularIntensityFactor = specularIntensity;\n vec3 specularTintFactor = specularTint;\n #ifdef USE_SPECULARINTENSITYMAP\n specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n #endif\n #ifdef USE_SPECULARTINTMAP\n specularTintFactor *= specularTintMapTexelToLinear( texture2D( specularTintMap, vUv ) ).rgb;\n #endif\n material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n #else\n float specularIntensityFactor = 1.0;\n vec3 specularTintFactor = vec3( 1.0 );\n material.specularF90 = 1.0;\n #endif\n material.specularColor = mix( min( pow2( ( ior - 1.0 ) / ( ior + 1.0 ) ) * specularTintFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n material.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n material.clearcoat = clearcoat;
1\n material.clearcoatRoughness = clearcoatRoughness;\n material.clearcoatF0 = vec3( 0.04 );\n material.clearcoatF90 = 1.0;\n #ifdef USE_CLEARCOATMAP\n material.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n #endif\n #ifdef USE_CLEARCOAT_ROUGHNESSMAP\n material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n #endif\n material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n material.clearcoatRoughness += geometryRoughness;\n material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n material.sheenTint = sheenTint;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n vec3 diffuseColor;\n float roughness;\n vec3 specularColor;\n float specularF90;\n #ifdef USE_CLEARCOAT\n float clearcoat;\n float clearcoatRoughness;\n vec3 clearcoatF0;\n float clearcoatF90;\n #endif\n #ifdef USE_SHEEN\n vec3 sheenTint;\n #endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n vec4 r = roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n return fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n vec2 fab = DFGApprox( normal, viewDir, roughness );\n return specularColor * fab.x + specularF90 * fab.y;\n}\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n vec2 fab = DFGApprox( normal, viewDir, roughness );\n vec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\n float Ess = fab.x + fab.y;\n float Ems = 1.0 - Ess;\n vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n singleScatter += FssEss;\n multiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 normal = geometry.normal;\n vec3 viewDir = geometry.viewDir;\n vec3 position = geometry.position;\n vec3 lightPos = rectAreaLight.position;\n vec3 halfWidth = rectAreaLight.halfWidth;\n vec3 halfHeight = rectAreaLight.halfHeight;\n vec3 lightColor = rectAreaLight.color;\n float roughness = material.roughness;\n vec3 rectCoords[ 4 ];\n rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n vec2 uv = LTC_Uv( normal, viewDir, roughness );\n vec4 t1 = texture2D( ltc_1, uv );\n vec4 t2 = texture2D( ltc_2, uv );\n mat3 mInv = mat3(\n vec3( t1.x, 0, t1.y ),\n vec3( 0, 1, 0 ),\n vec3( t1.z, 0, t1.w )\n );\n vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n }\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifdef USE_CLEARCOAT\n float dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n vec3 ccIrradiance = dotNLcc * directLight.color;\n clearcoatSpecular += ccIrradiance * BRDF_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n #endif\n #ifdef USE_SHEEN\n reflectedLight.directSpecular += irradiance * BRDF_Sheen( material.roughness, directLight.direction, geometry, material.sheenTint );\n #else\n reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n #endif\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n #ifdef USE_CLEARCOAT\n clearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n #endif\n vec3 singleScattering = vec3( 0.0 );\n vec3 multiScattering = vec3( 0.0 );\n vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n computeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n reflectedLight.indirectSpecular += radiance * singleScattering;\n reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct RE_Direct_Physical\n#define RE_Direct_RectArea RE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular RE_IndirectSpecular_Physical\nfloat c
1omputeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n geometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n PointLight pointLight;\n #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n pointLight = pointLights[ i ];\n getPointLightInfo( pointLight, geometry, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n pointLightShadow = pointLightShadows[ i ];\n directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n #endif\n RE_Direct( directLight, geometry, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n SpotLight spotLight;\n #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n getSpotLightInfo( spotLight, geometry, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n spotLightShadow = spotLightShadows[ i ];\n directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometry, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n getDirectionalLightInfo( directionalLight, geometry, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometry, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n RectAreaLight rectAreaLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n rectAreaLight = rectAreaLights[ i ];\n RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n vec3 iblIrradiance = vec3( 0.0 );\n vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n irradiance += getLightProbeIrradiance( lightProbe, geometry );\n #if ( NUM_HEMI_LIGHTS > 0 )\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if defined( RE_IndirectSpecular )\n vec3 radiance = vec3( 0.0 );\n vec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vUv2 );\n vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n lightMapIrradiance *= PI;\n #endif\n irradiance += lightMapIrradiance;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n iblIrradiance += getIBLIrradiance( geometry );\n #endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n radiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n #ifdef USE_CLEARCOAT\n clearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n #endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n uniform float logDepthBufFC;\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n #ifdef USE_LOGDEPTHBUF_EXT\n varying float vFragDepth;\n varying float vIsPerspective;\n #else\n uniform float logDepthBufFC;\n #endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n #ifdef USE_LOGDEPTHBUF_EXT\n vFragDepth = 1.0 + gl_Position.w;\n vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n #else\n if ( isPerspectiveMatrix( projectionMatrix ) ) {\n gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n gl_Position.z *= gl_Position.w;\n }\n #endif\n#endif",map_fragment:"#ifdef USE_MAP\n vec4 texelColor = texture2D( map, vUv );\n texelColor = mapTexelToLinear( texelColor );\n diffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n uniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n vec4 mapTexel = texture2D( map, uv );\n diffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n uniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n uniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n vec4 texelMetalness = texture2D( metalnessMap, vUv );\n metalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n uniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n objectNormal *= morphTargetBaseInfluence;\n objectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n objectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n objectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n objectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n uniform float morphTargetBaseInfluence;\n #ifndef USE_MORPHNORMALS\n uniform float morphTargetInfluences[ 8 ];\n #else\n uniform float morphTargetInfluences[ 4 ];\n #endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n transformed *= morphTargetBaseInfluence;\n transformed += morphTarget0 * morphTargetInfluences[ 0 ];\n transformed += morphTarget1 * morphTargetInfluences[ 1 ];\n transformed += morphTarget2 * morphTargetInfluences[ 2 ];\n transformed += morphTarget3 * morphTargetInfluences[ 3 ];\n #ifndef USE_MORPHNORMALS\n transformed += morphTarget4 * morphTargetInfluences[ 4 ];\n transformed += morphTarget5 * morphTargetInfluences[ 5 ];\n transformed += morphTarget6 * morphTargetInfluences[ 6 ];\n transformed += morphTarget7 * morphTargetInfluences[ 7 ];\n #endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n vec3 normal = normalize( cross( fdx, fdy ) );\n#else\n vec3 normal = normalize( vNormal );\n #ifdef DOUBLE_SIDED\n normal = normal * faceDirection;\n #endif\n #ifdef USE_TANGENT\n vec3 tangent = normalize( vTangent );\n vec3 bitangent = normalize( vBitangent );\n #ifdef DOUBLE_SIDED\n tangent = tangent * faceDirection;\n bitangent = bitangent * faceDirection;\n #endif\n #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n mat3 vTBN = mat3( tangent, bitangent, normal );\n #endif\n #endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n #ifdef FLIP_SIDED\n normal = - normal;\n #endif\n #ifdef DOUBLE_SIDED\n normal = normal * faceDirection;\n #endif\n normal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n mapN.xy *= normalScale;\n #ifdef USE_TANGENT\n normal = normalize( vTBN * mapN );
1\n #else\n normal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n #endif\n#elif defined( USE_BUMPMAP )\n normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n #ifdef USE_TANGENT\n vTangent = normalize( transformedTangent );\n vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n #endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n uniform sampler2D normalMap;\n uniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n uniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n vec2 st0 = dFdx( vUv.st );\n vec2 st1 = dFdy( vUv.st );\n vec3 N = surf_norm;\n vec3 q1perp = cross( q1, N );\n vec3 q0perp = cross( N, q0 );\n vec3 T = q1perp * st0.x + q0perp * st1.x;\n vec3 B = q1perp * st0.y + q0perp * st1.y;\n float det = max( dot( T, T ), dot( B, B ) );\n float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n }\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n vec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n clearcoatMapN.xy *= clearcoatNormalScale;\n #ifdef USE_TANGENT\n clearcoatNormal = normalize( vTBN * clearcoatMapN );\n #else\n clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n #endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n uniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform sampler2D clearcoatNormalMap;\n uniform vec2 clearcoatNormalScale;\n#endif",output_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n return 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n vec4 r = vec4( fract( v * PackFactors ), v );\n r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n return dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n return ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n return linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n return ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n mvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n vec3 dithering( vec3 color ) {\n float grid_position = rand( gl_FragCoord.xy );\n vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n return color + dither_shift_RGB;\n }\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n vec4 texelRoughness = texture2D( roughnessMap, vUv );\n roughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n uniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
1\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n struct SpotLightShadow {\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n }\n vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n return unpackRGBATo2Half( texture2D( shadow, uv ) );\n }\n float VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n float occlusion = 1.0;\n vec2 distribution = texture2DDistribution( shadow, uv );\n float hard_shadow = step( compare , distribution.x );\n if (hard_shadow != 1.0 ) {\n float distance = compare - distribution.x ;\n float variance = max( 0.00000, distribution.y * distribution.y );\n float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n }\n return occlusion;\n }\n float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n shadowCoord.z += shadowBias;\n bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n bool inFrustum = all( inFrustumVec );\n bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n bool frustumTest = all( frustumTestVec );\n if ( frustumTest ) {\n #if defined( SHADOWMAP_TYPE_PCF )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx0 = - texelSize.x * shadowRadius;\n float dy0 = - texelSize.y * shadowRadius;\n float dx1 = + texelSize.x * shadowRadius;\n float dy1 = + texelSize.y * shadowRadius;\n float dx2 = dx0 / 2.0;\n float dy2 = dy0 / 2.0;\n float dx3 = dx1 / 2.0;\n float dy3 = dy1 / 2.0;\n shadow = (\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n ) * ( 1.0 / 17.0 );\n #elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx = texelSize.x;\n float dy = texelSize.y;\n vec2 uv = shadowCoord.xy;
1\n vec2 f = fract( uv * shadowMapSize + 0.5 );\n uv -= f * texelSize;\n shadow = (\n texture2DCompare( shadowMap, uv, shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n f.x ),\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n f.x ),\n f.y )\n ) * ( 1.0 / 9.0 );\n #elif defined( SHADOWMAP_TYPE_VSM )\n shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n #else\n shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n #endif\n }\n return shadow;\n }\n vec2 cubeToUV( vec3 v, float texelSizeY ) {\n vec3 absV = abs( v );\n float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n absV *= scaleToCube;\n v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n vec2 planar = v.xy;\n float almostATexel = 1.5 * texelSizeY;\n float almostOne = 1.0 - almostATexel;\n if ( absV.z >= almostOne ) {\n if ( v.z > 0.0 )\n planar.x = 4.0 - v.x;\n } else if ( absV.x >= almostOne ) {\n float signX = sign( v.x );\n planar.x = v.z * signX + 2.0 * signX;\n } else if ( absV.y >= almostOne ) {\n float signY = sign( v.y );\n planar.x = v.x + 2.0 * signY + 2.0;\n planar.y = v.z * signY - 2.0;\n }\n return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n }\n float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n vec3 lightToPosition = shadowCoord.xyz;\n float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias;\n vec3 bd3D = normalize( lightToPosition );\n #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n return (\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n ) * ( 1.0 / 9.0 );\n #else\n return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n #endif\n }\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
1\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n struct SpotLightShadow {\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n vec4 shadowWorldPosition;\n #endif\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n float shadow = 1.0;\n #ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n directionalLight = directionalLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n spotLight = spotLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n pointLight = pointLightShadows[ i ];\n shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #endif\n return shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n mat4 boneMatX = getBoneMatrix( skinIndex.x );\n mat4 boneMatY = getBoneMatrix( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n mat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n #ifdef BONE_TEXTURE\n uniform highp sampler2D boneTexture;\n uniform int boneTextureSize;\n mat4 getBoneMatrix( const in float i ) {\n float j = i * 4.0;\n float x = mod( j, float( boneTextureSize ) );\n float y = floor( j / float( boneTextureSize ) );\n float dx = 1.0 / float( boneTextureSize );\n float dy = 1.0 / float( boneTextureSize );\n y = dy * ( y + 0.5 );\n vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n mat4 bone = mat4( v1, v2, v3, v4 );\n return bone;\n }\n #else\n uniform mat4 boneMatrices[ MAX_BONES ];\n mat4 getBoneMatrix( const in float i ) {\n mat4 bone = boneMatrices[ int(i) ];\n return bone;\n }\n #endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n vec4 skinned = vec4( 0.0 );\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n transformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n mat4 skinMatrix = mat4( 0.0 );\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n #ifdef USE_TANGENT\n objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n #endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n vec4 texelSpecular = texture2D( specularMap, vUv );\n specularStrength = texelSpecular.r;\n#else\n specularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n uniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;
1\nvec3 LinearToneMapping( vec3 color ) {\n return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n vec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n return a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n const mat3 ACESInputMat = mat3(\n vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ),\n vec3( 0.04823, 0.01566, 0.83777 )\n );\n const mat3 ACESOutputMat = mat3(\n vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ),\n vec3( -0.07367, -0.00605, 1.07602 )\n );\n color *= toneMappingExposure / 0.6;\n color = ACESInputMat * color;\n color = RRTAndODTFit( color );\n color = ACESOutputMat * color;\n return saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n float transmissionAlpha = 1.0;\n float transmissionFactor = transmission;\n float thicknessFactor = thickness;\n #ifdef USE_TRANSMISSIONMAP\n transmissionFactor *= texture2D( transmissionMap, vUv ).r;\n #endif\n #ifdef USE_THICKNESSMAP\n thicknessFactor *= texture2D( thicknessMap, vUv ).g;\n #endif\n vec3 pos = vWorldPosition;\n vec3 v = normalize( cameraPosition - pos );\n vec3 n = inverseTransformDirection( normal, viewMatrix );\n vec4 transmission = getIBLVolumeRefraction(\n n, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n attenuationTint, attenuationDistance );\n totalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n transmissionAlpha = transmission.a;\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n uniform float transmission;\n uniform float thickness;\n uniform float attenuationDistance;\n uniform vec3 attenuationTint;\n #ifdef USE_TRANSMISSIONMAP\n uniform sampler2D transmissionMap;\n #endif\n #ifdef USE_THICKNESSMAP\n uniform sampler2D thicknessMap;\n #endif\n uniform vec2 transmissionSamplerSize;\n uniform sampler2D transmissionSamplerMap;\n uniform mat4 modelMatrix;\n uniform mat4 projectionMatrix;\n varying vec3 vWorldPosition;\n vec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) {\n vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n vec3 modelScale;\n modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n return normalize( refractionVector ) * thickness * modelScale;\n }\n float applyIorToRoughness( float roughness, float ior ) {\n return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n }\n vec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior ) {\n float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n #ifdef TEXTURE_LOD_EXT\n return texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n #else\n return texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n #endif\n }\n vec3 applyVolumeAttenuation( vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance ) {\n if ( attenuationDistance == 0.0 ) {\n return radiance;\n } else {\n vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance * radiance;\n }\n }\n vec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 diffuseColor, vec3 specularColor, float specularF90,\n vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness,\n vec3 attenuationColor, float attenuationDistance ) {\n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n vec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n return vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n }\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n varying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n #ifdef UVS_VERTEX_ONLY\n vec2 vUv;\n #else\n varying vec2 vUv;\n #endif\n uniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n varying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n attribute vec2 uv2;\n varying vec2 vUv2;\n uniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n vec4 worldPosition = vec4( transformed, 1.0 );\n #ifdef USE_INSTANCING\n worldPosition = instanceMatrix * worldPosition;\n #endif\n worldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n vec4 texColor = texture2D( t2D, vUv );\n gl_FragColor = mapTexelToLinear( texColor );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n gl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n vec3 vReflect = vWorldDirection;\n #include <envmap_fragment>\n gl_FragColor = envColor;\n gl_FragColor.a *= opacity;\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n gl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n uniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( 1.0 );\n #if DEPTH_PACKING == 3200\n diffuseColor.a = opacity;\n #endif\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <logdepthbuf_fragment>\n float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n #if DEPTH_PACKING == 3200\n gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n #elif DEPTH_PACKING == 3201\n gl_FragColor = packDepthToRGBA( fragCoordZ );\n #endif\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include <uv_vertex>\n #include <skinbase_vertex>\n #ifdef USE_DISPLACEMENTMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( 1.0 );\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n float dist = length( vWorldPosition - referencePosition );\n dist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n dist = saturate( dist );\n gl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <skinbase_vertex>\n #ifdef USE_DISPLACEMENTMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <worldpos_vertex>\n #include <clipping_planes_vertex>\n vWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vec3 direction = normalize( vWorldDirection );\n vec2 sampleUV = equirectUv( direction );\n vec4 texColor = texture2D( tEquirect, sampleUV );\n gl_FragColor = mapTexelToLinear( texColor );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n if ( mod( vLineDistance, totalSize ) > dashSize ) {\n discard;\n }\n vec3 outgoingLight = vec3( 0.0 );\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <logdepthbuf_fragment>\n #include <color_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <output_fragment>\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n vLineDistance = scale * lineDistance;\n #include <color_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel= texture2D( lightMap, vUv2 );\n reflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n #else\n reflectedLight.indirectDiffuse += vec3( 1.0 );\n #endif\n #include <aomap_fragment>\n reflectedLight.indirectDiffuse *= diffuseColor.rgb;\n vec3 outgoingLight = reflectedLight.indirectDiffuse;\n #include <envmap_fragment>\n #include <output_fragment>\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <uv2_vertex>\n #include <color_vertex>\n #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <fog_vertex>\n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n varying vec3 vLightBack;\n varying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( diffuse, opacity );\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n #include <emissivemap_fragment>\n #ifdef DOUBLE_SIDED\n reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n #else\n reflectedLight.indirectDiffuse += vIndirectFront;\n #endif\n #include <lightmap_fragment>\n reflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );\n #ifdef DOUBLE_SIDED\n reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n #else\n reflectedLight.directDiffuse = vLightFront;\n #endif\n reflecte
1dLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <envmap_fragment>\n #include <output_fragment>\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n varying vec3 vLightBack;\n varying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <uv2_vertex>\n #include <color_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <lights_lambert_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n vec3 viewDir = normalize( vViewPosition );\n vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n vec3 y = cross( viewDir, x );\n vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n #ifdef USE_MATCAP\n vec4 matcapColor = texture2D( matcap, uv );\n matcapColor = matcapTexelToLinear( matcapColor );\n #else\n vec4 matcapColor = vec4( 1.0 );\n #endif\n vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n #include <output_fragment>\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n vViewPosition = - mvPosition.xyz;\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n varying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n gl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n varying vec3 vViewPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n vViewPosition = - mvPosition.xyz;\n#endif\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( diffuse, opacity );\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_phong_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n #include <envmap_fragment>\n #include <output_fragment>\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <uv2_vertex>\n #include <color_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n #define IOR\n #define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n uniform float ior;\n#endif\n#ifdef SPECULAR\n uniform float specularIntensity;\n uniform vec3 specularTint;\n #ifdef USE_SPECULARINTENSITYMAP\n uniform sampler2D specularIntensityMap;\n #endif\n #ifdef USE_SPECULARTINTMAP\n uniform sampler2D specularTintMap;\n #endif\n#endif\n#ifdef USE_CLEARCOAT\n uniform float clearcoat;
1\n uniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n uniform vec3 sheenTint;\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( diffuse, opacity );\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <roughnessmap_fragment>\n #include <metalnessmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <clearcoat_normal_fragment_begin>\n #include <clearcoat_normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_physical_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n #include <transmission_fragment>\n vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n #ifdef USE_CLEARCOAT\n float dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n outgoingLight = outgoingLight * ( 1.0 - clearcoat * Fcc ) + clearcoatSpecular * clearcoat;
1\n #endif\n #include <output_fragment>\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n varying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <uv2_vertex>\n #include <color_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n#ifdef USE_TRANSMISSION\n vWorldPosition = worldPosition.xyz;\n#endif\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( diffuse, opacity );\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_toon_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <output_fragment>\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <uv2_vertex>\n #include <color_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3( 0.0 );\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <logdepthbuf_fragment>\n #include <map_particle_fragment>\n #include <color_fragment>\n #include <alphatest_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <output_fragment>\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <color_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <project_vertex>\n gl_PointSize = size;\n #ifdef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n #endif\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n}",shadow_vert:"#include <common>\n#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n #include <begin_vertex>\n #include <project_vertex>\n #include <worldpos_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3( 0.0 );\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <output_fragment>\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n vec2 scale;\n scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n #ifndef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) scale *= - mvPosition.z;\n #endif\n vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n mvPosition.xy += rotatedPosition;\n gl_Position = projectionMatrix * mvPosition;\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n}"},t1={common:{diffuse:{value:new e$(0xffffff)},opacity:{value:1},map:{value:null},uvTransform:{value:new b},uv2Transform:{value:new b},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},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 _(1,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 e$(0xffffff)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new e$(0xffffff)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new b}},sprite:{diffuse:{value:new e$(0xffffff)},opacity:{value:1},center:{value:new _(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new b}}},t3={basic:{uniforms:tB([t1.common,t1.specularmap,t1.envmap,t1.aomap,t1.lightmap,t1.fog]),vertexShader:t0.meshbasic_vert,fragmentShader:t0.meshbasic_frag},lambert:{uniforms:tB([t1.common,t1.specularmap,t1.envmap,t1.aomap,t1.lightmap,t1.emissivemap,t1.fog,t1.lights,{emissive:{value:new e$(0)}}]),vertexShader:t0.meshlambert_vert,fragmentShader:t0.meshlambert_frag},phong:{uniforms:tB([t1.common,t1.specularmap,t1.envmap,t1.aomap,t1.lightmap,t1.emissivemap,t1.bumpmap,t1.normalmap,t1.displacementmap,t1.fog,t1.lights,{emissive:{value:new e$(0)},specular:{value:new e$(1118481)},shininess:{value:30}}]),vertexShader:t0.meshphong_vert,fragmentShader:t0.meshphong_frag},standard:{uniforms:tB([t1.common,t1.envmap,t1.aomap,t1.lightmap,t1.emissivemap,t1.bumpmap,t1.normalmap,t1.displacementmap,t1.roughnessmap,t1.metalnessmap,t1.fog,t1.lights,{emissive:{value:new e$(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:t0.meshphysical_vert,fragmentShader:t0.meshphysical_frag},toon:{uniforms:tB([t1.common,t1.aomap,t1.lightmap,t1.emissivemap,t1.bumpmap,t1.normalmap,t1.displacementmap,t1.gradientmap,t1.fog,t1.lights,{emissive:{value:new e$(0)}}]),vertexShader:t0.meshtoon_vert,fragmentShader:t0.meshtoon_frag},matcap:{uniforms:tB([t1.common,t1.bumpmap,t1.normalmap,t1.displacementmap,t1.fog,{matcap:{value:null}}]),vertexShader:t0.meshmatcap_vert,fragmentShader:t0.meshmatcap_frag},points:{uniforms:tB([t1.points,t1.fog]),vertexShader:t0.points_vert,fragmentShader:t0.points_frag},dashed:{uniforms:tB([t1.common,t1.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:t0.linedashed_vert,fragmentShader:t0.linedashed_frag},depth:{uniforms:tB([t1.common,t1.displacementmap]),vertexShader:t0.depth_vert,fragmentShader:t0.depth_frag},normal:{uniforms:tB([t1.common,t1.bumpmap,t1.normalmap,t1.displacementmap,{opacity:{value:1}}]),vertexShader:t0.meshnormal_vert,fragmentShader:t0.meshnormal_frag},sprite:{uniforms:tB([t1.sprite,t1.fog]),vertexShader:t0.sprite_vert,fragmentShader:t0.sprite_frag},background:{uniforms:{uvTransform:{value:new b},t2D:{value:null}},vertexShader:t0.background_vert,fragmentShader:t0.background_frag},cube:{uniforms:tB([t1.envmap,{opacity:{value:1}}]),vertexShader:t0.cube_vert,fragmentShader:t0.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:t0.equirect_vert,fragmentShader:t0.equirect_frag},distanceRGBA:{uniforms:tB([t1.common,t1.displacementmap,{referencePosition:{value:new P},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:t0.distanceRGBA_vert,fragmentShader:t0.distanceRGBA_frag},shadow:{uniforms:tB([t1.lights,t1.fog,{color:{value:new e$(0)},opacity:{value:1}}]),vertexShader:t0.shadow_vert,fragmentShader:t0.shadow_frag}};function t2(e,t,i,n,r){let a=new e$(0),s,o,l=0,h=null,u=0,c=null;function d(e,t){i.buffers.color.setClear(e.r,e.g,e.b,t,r)}return{getClearColor:function(){return a},setClearColor:function(e,t=1){a.set(e),d(a,l=t)},getClearAlpha:function(){return l},setClearAlpha:function(e){d(a,l=e)},render:function(i,r){let p=!1,m=!0===r.isScene?r.background:null;m&&m.isTexture&&(m=t.get(m));let f=e.xr,g=f.getSession&&f.getSession();g&&"additive"===g.environmentBlendMode&&(m=null),null===m?d(a,l):m&&m.isColor&&(d(m,1),p=!0),(e.autoClear||p)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),m&&(m.isCubeTexture||306===m.mapping)?(void 0===o&&((o=new tI(new tN(1,1,1),new tO({name:"Backgroun
1dCubeMaterial",uniforms:tz(t3.cube.uniforms),vertexShader:t3.cube.vertexShader,fragmentShader:t3.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),o.geometry.deleteAttribute("uv"),o.onBeforeRender=function(e,t,i){this.matrixWorld.copyPosition(i.matrixWorld)},Object.defineProperty(o.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(o)),o.material.uniforms.envMap.value=m,o.material.uniforms.flipEnvMap.value=m.isCubeTexture&&!1===m.isRenderTargetTexture?-1:1,h===m&&u===m.version&&c===e.toneMapping||(o.material.needsUpdate=!0,h=m,u=m.version,c=e.toneMapping),i.unshift(o,o.geometry,o.material,0,0,null)):m&&m.isTexture&&(void 0===s&&((s=new tI(new t$(2,2),new tO({name:"BackgroundMaterial",uniforms:tz(t3.background.uniforms),vertexShader:t3.background.vertexShader,fragmentShader:t3.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(s.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(s)),s.material.uniforms.t2D.value=m,!0===m.matrixAutoUpdate&&m.updateMatrix(),s.material.uniforms.uvTransform.value.copy(m.matrix),h===m&&u===m.version&&c===e.toneMapping||(s.material.needsUpdate=!0,h=m,u=m.version,c=e.toneMapping),i.unshift(s,s.geometry,s.material,0,0,null))}}}function t4(e,t,i,n){let r=e.getParameter(34921),a=n.isWebGL2?null:t.get("OES_vertex_array_object"),s=n.isWebGL2||null!==a,o={},l=d(null),h=l;function u(t){return n.isWebGL2?e.bindVertexArray(t):a.bindVertexArrayOES(t)}function c(t){return n.isWebGL2?e.deleteVertexArray(t):a.deleteVertexArrayOES(t)}function d(e){let t=[],i=[],n=[];for(let e=0;e<r;e++)t[e]=0,i[e]=0,n[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:i,attributeDivisors:n,object:e,attributes:{},index:null}}function p(){let e=h.newAttributes;for(let t=0,i=e.length;t<i;t++)e[t]=0}function m(e){f(e,0)}function f(i,r){let a=h.newAttributes,s=h.enabledAttributes,o=h.attributeDivisors;a[i]=1,0===s[i]&&(e.enableVertexAttribArray(i),s[i]=1),o[i]!==r&&((n.isWebGL2?e:t.get("ANGLE_instanced_arrays"))[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](i,r),o[i]=r)}function g(){let t=h.newAttributes,i=h.enabledAttributes;for(let n=0,r=i.length;n<r;n++)i[n]!==t[n]&&(e.disableVertexAttribArray(n),i[n]=0)}function v(t,i,r,a,s,o){!0!==n.isWebGL2||5124!==r&&5125!==r?e.vertexAttribPointer(t,i,r,a,s,o):e.vertexAttribIPointer(t,i,r,s,o)}function y(){x(),h!==l&&u((h=l).object)}function x(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:function(r,l,c,y,x){let _=!1;if(s){let t=function(t,i,r){let s=!0===r.wireframe,l=o[t.id];void 0===l&&(l={},o[t.id]=l);let h=l[i.id];void 0===h&&(h={},l[i.id]=h);let u=h[s];return void 0===u&&(u=d(n.isWebGL2?e.createVertexArray():a.createVertexArrayOES()),h[s]=u),u}(y,c,l);h!==t&&u((h=t).object),(_=function(e,t){let i=h.attributes,n=e.attributes,r=0;for(let e in n){let t=i[e],a=n[e];if(void 0===t||t.attribute!==a||t.data!==a.data)return!0;r++}return h.attributesNum!==r||h.index!==t}(y,x))&&function(e,t){let i={},n=e.attributes,r=0;for(let e in n){let t=n[e],a={};a.attribute=t,t.data&&(a.data=t.data),i[e]=a,r++}h.attributes=i,h.attributesNum=r,h.index=t}(y,x)}else{let e=!0===l.wireframe;h.geometry===y.id&&h.program===c.id&&h.wireframe===e||(h.geometry=y.id,h.program=c.id,h.wireframe=e,_=!0)}!0===r.isInstancedMesh&&(_=!0),null!==x&&i.update(x,34963),_&&(function(r,a,s,o){if(!1===n.isWebGL2&&(r.isInstancedMesh||o.isInstancedBufferGeometry)&&null===t.get("ANGLE_instanced_arrays"))return;p();let l=o.attributes,h=s.getAttributes(),u=a.defaultAttributeValues;for(let t in h){let n=h[t];if(n.location>=0){let a=l[t];if(void 0===a&&("instanceMatrix"===t&&r.instanceMatrix&&(a=r.instanceMatrix),"instanceColor"===t&&r.instanceColor&&(a=r.instanceColor)),void 0!==a){let t=a.normalized,s=a.itemSize,l=i.get(a);if(void 0===l)continue;let h=l.buffer,u=l.type,c=l.bytesPerElement;if(a.isInterleavedBufferAttribute){let i=a.data,l=i.stride,d=a.offset;if(i&&i.isInstancedInterleavedBuffer){for(let e=0;e<n.locationSize;e++)f(n.location+e,i.meshPerAttribute);!0!==r.isInstancedMesh&&void 0===o._maxInstanceCount&&(o._maxInstanceCount=i.meshPerAttribute*i.count)}else for(let e=0;e<n.locationSize;e++)m(n.location+e);e.bindBuffer(34962,h);for(let e=0;e<n.locationSize;e++)v(n.location+e,s/n.locationSize,u,t,l*c,(d+s/n.locationSize*e)*c)}else{if(a.isInstancedBufferAttribute){for(let e=0;e<n.locationSize;e++)f(n.location+e,a.meshPerAttribute);!0!==r.isInstancedMesh&&void 0===o._maxInstanceCount&&(o._maxInstanceCount=a.meshPerAttribute*a.count)}
1else for(let e=0;e<n.locationSize;e++)m(n.location+e);e.bindBuffer(34962,h);for(let e=0;e<n.locationSize;e++)v(n.location+e,s/n.locationSize,u,t,s*c,s/n.locationSize*e*c)}}else if(void 0!==u){let i=u[t];if(void 0!==i)switch(i.length){case 2:e.vertexAttrib2fv(n.location,i);break;case 3:e.vertexAttrib3fv(n.location,i);break;case 4:e.vertexAttrib4fv(n.location,i);break;default:e.vertexAttrib1fv(n.location,i)}}}}g()}(r,l,c,y),null!==x&&e.bindBuffer(34963,i.get(x).buffer))},reset:y,resetDefaultState:x,dispose:function(){for(let e in y(),o){let t=o[e];for(let e in t){let i=t[e];for(let e in i)c(i[e].object),delete i[e];delete t[e]}delete o[e]}},releaseStatesOfGeometry:function(e){if(void 0===o[e.id])return;let t=o[e.id];for(let e in t){let i=t[e];for(let e in i)c(i[e].object),delete i[e];delete t[e]}delete o[e.id]},releaseStatesOfProgram:function(e){for(let t in o){let i=o[t];if(void 0===i[e.id])continue;let n=i[e.id];for(let e in n)c(n[e].object),delete n[e];delete i[e.id]}},initAttributes:p,enableAttribute:m,disableUnusedAttributes:g}}function t5(e,t,i,n){let r;let a=n.isWebGL2;this.setMode=function(e){r=e},this.render=function(t,n){e.drawArrays(r,t,n),i.update(n,r,1)},this.renderInstances=function(n,s,o){let l,h;if(0!==o){if(a)l=e,h="drawArraysInstanced";else if(l=t.get("ANGLE_instanced_arrays"),h="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[h](r,n,s,o),i.update(s,r,o)}}}function t6(e,t,i){let n;function r(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&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"}let a="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext,s=void 0!==i.precision?i.precision:"highp",o=r(s);o!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",o,"instead."),s=o);let l=a||t.has("WEBGL_draw_buffers"),h=!0===i.logarithmicDepthBuffer,u=e.getParameter(34930),c=e.getParameter(35660),d=e.getParameter(3379),p=e.getParameter(34076),m=e.getParameter(34921),f=e.getParameter(36347),g=e.getParameter(36348),v=e.getParameter(36349),y=c>0,x=a||t.has("OES_texture_float");return{isWebGL2:a,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==n)return n;if(!0===t.has("EXT_texture_filter_anisotropic")){let i=t.get("EXT_texture_filter_anisotropic");n=e.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n},getMaxPrecision:r,precision:s,logarithmicDepthBuffer:h,maxTextures:u,maxVertexTextures:c,maxTextureSize:d,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:f,maxVaryings:g,maxFragmentUniforms:v,vertexTextures:y,floatFragmentTextures:x,floatVertexTextures:y&&x,maxSamples:a?e.getParameter(36183):0}}function t8(e){let t=this,i=null,n=0,r=!1,a=!1,s=new tX,o=new b,l={value:null,needsUpdate:!1};function h(){l.value!==i&&(l.value=i,l.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function u(e,i,n,r){let a=null!==e?e.length:0,h=null;if(0!==a){if(h=l.value,!0!==r||null===h){let t=n+4*a,r=i.matrixWorldInverse;o.getNormalMatrix(r),(null===h||h.length<t)&&(h=new Float32Array(t));for(let t=0,i=n;t!==a;++t,i+=4)s.copy(e[t]).applyMatrix4(r,o),s.normal.toArray(h,i),h[i+3]=s.constant}l.value=h,l.needsUpdate=!0}return t.numPlanes=a,t.numIntersection=0,h}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t,a){let s=0!==e.length||t||0!==n||r;return r=t,i=u(e,a,0),n=e.length,s},this.beginShadows=function(){a=!0,u(null)},this.endShadows=function(){a=!1,h()},this.setState=function(t,s,o){let c=t.clippingPlanes,d=t.clipIntersection,p=t.clipShadows,m=e.get(t);if(r&&null!==c&&0!==c.length&&(!a||p)){let e=a?0:n,t=4*e,r=m.clippingState||null;l.value=r,r=u(c,s,t,o);for(let e=0;e!==t;++e)r[e]=i[e];m.clippingState=r,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=e}else a?u(null):h()}}function t7(e){let t=new WeakMap;function i(e,t){return 303===t?e.mapping=301:304===t&&(e.mapping=302),e}function n(e){let i=e.target;i.removeEventListener("dispose",n);let r=t.get(i);void 0!==r&&(t.delete(i),r.dispose())}return{get:function(r){if(r&&r.isTexture&&!1===r.isRenderTargetTexture){let a=r.mapping;if(303===a||304===a){if(t.has(r))return i(t.get(r).texture,r.mapping);{let a=r.image;if(a&&a.height>0){let s=e.getRenderTarget(),o=new tV(a.height/2);return o.fromEquirectangularTexture(e,r),t.set(r,o),e.setRenderTarget(s),r.addEventListener("dispose",n),i(o.texture,r.mapping)}return null}}}return r},dispose:function(){t=new WeakMap}}}t3.physical={uniforms:tB([t3.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new _(1,1)},clearcoatNormalMap:{value:null},sheenTint:{value:new e$(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new _},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationTint:{value:new e$(0)},specularIntensity:{value:0},specularIntensityMap:{value:null},specularTint:{value:new e$(1,1,1)},specularTintMap:{value:null}}]),vertexShader:t0.meshphysical_vert,fragmentShader:t0.meshphysical_frag};class t9 extends tU{constructor(e=-1,t=1,i=1,n=-1,r=.1,a=2e3){super(),this.type="Orthogra
1phicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=n,this.near=r,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,i,n,r,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2,r=i-e,a=i+e,s=n+t,o=n-t;if(null!==this.view&&this.view.enabled){let e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=e*this.view.offsetX,a=r+e*this.view.width,s-=t*this.view.offsetY,o=s-t*this.view.height}this.projectionMatrix.makeOrthographic(r,a,s,o,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}t9.prototype.isOrthographicCamera=!0;class ie extends tO{constructor(e){super(e),this.type="RawShaderMaterial"}}ie.prototype.isRawShaderMaterial=!0;let it=[.125,.215,.35,.446,.526,.582],ii=5+it.length,ir={3e3:0,3001:1,3002:2,3004:3,3005:4,3006:5,3007:6},ia=new t9,{_lodPlanes:is,_sizeLods:io,_sigmas:il}=function(){let e=[],t=[],i=[],n=8;for(let r=0;r<ii;r++){let a=Math.pow(2,n);t.push(a);let s=1/a;r>4?s=it[r-8+4-1]:0==r&&(s=0),i.push(s);let o=1/(a-1),l=-o/2,h=1+o/2,u=[l,l,h,l,h,h,l,l,h,h,l,h],c=new Float32Array(108),d=new Float32Array(72),p=new Float32Array(36);for(let e=0;e<6;e++){let t=e%3*2/3-1,i=e>2?0:-1,n=[t,i,0,t+2/3,i,0,t+2/3,i+1,0,t,i,0,t+2/3,i+1,0,t,i+1,0];c.set(n,18*e),d.set(u,12*e);let r=[e,e,e,e,e,e];p.set(r,6*e)}let m=new tm;m.setAttribute("position",new e2(c,3)),m.setAttribute("uv",new e2(d,2)),m.setAttribute("faceIndex",new e2(p,1)),e.push(m),n>4&&n--}return{_lodPlanes:e,_sizeLods:t,_sigmas:i}}(),ih=new e$,iu=null,ic=(1+Math.sqrt(5))/2,id=1/ic,ip=[new P(1,1,1),new P(-1,1,1),new P(1,1,-1),new P(-1,1,-1),new P(0,ic,id),new P(0,ic,-id),new P(id,0,ic),new P(-id,0,ic),new P(ic,id,0),new P(-ic,id,0)];class im{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=new ie({name:"SphericalGaussianBlur",defines:{n:20},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:new Float32Array(20)},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:new P(0,1,0)},inputEncoding:{value:ir[3e3]},outputEncoding:{value:ir[3e3]}},vertexShader:i_(),fragmentShader:` 2 3 precision mediump float; 4 precision mediump int; 5 6 varying vec3 vOutputDirection; 7 8 uniform sampler2D envMap; 9 uniform int samples; 10 uniform float weights[ n ]; 11 uniform bool latitudinal; 12 uniform float dTheta; 13 uniform float mipInt; 14 uniform vec3 poleAxis; 15 16 ${ib()} 17 18 #define ENVMAP_TYPE_CUBE_UV 19 #include <cube_uv_reflection_fragment> 20 21 vec3 getSample( float theta, vec3 axis ) { 22 23 float cosTheta = cos( theta ); 24 // Rodrigues' axis-angle rotation 25 vec3 sampleDirection = vOutputDirection * cosTheta 26 + cross( axis, vOutputDirection ) * sin( theta ) 27 + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); 28 29 return bilinearCubeUV( envMap, sampleDirection, mipInt ); 30 31 } 32 33 void main() { 34 35 vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); 36 37 if ( all( equal( axis, vec3( 0.0 ) ) ) ) { 38 39 axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); 40 41 } 42 43 axis = normalize( axis ); 44 45 gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 46 gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); 47 48 for ( int i = 1; i < n; i++ ) { 49 50 if ( i >= samples ) { 51 52 break; 53 54 } 55 56 float theta = dTheta * float( i ); 57 gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); 58 gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); 59 60 } 61 62 gl_FragColor = linearToOutputTexel( gl_FragColor ); 63 64 } 65 `,blending:0,depthTest:!1,depthWrite:!1}),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,n=100){iu=this._renderer.getRenderTarget();let r=this._allocateTargets();return this._sceneToCubeUV(e,i,n,r),t>0&&this._blur(r,0,0,t),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){null===this._cubemapShader&&(this._cubemapShader=ix(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){null===this._equirectShader&&(this._equirectShader=iy(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(let e=0;e<is.length;e++)is[e].dispose()}_cleanup(e){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(iu),e.scissorTest=!1,iv(e,0,0,e.width,e.height)}_fromTexture(e){iu=this._renderer.getRenderTarget();let t=this._allocateTargets(e);return this._textureToCubeUV(e,t),this._applyPMREM(t),this._cleanup(t),t}_allocateTargets(e){let t={magFilter:1003,minFilter:1003,generateMipmaps:!1,type:1009,format:1023,encoding:void 0!==e&&1009===e.type&&(3e3===e.encoding||3001===e.encoding||3007===e.encoding)?e.encoding:3002,depthBuffer:!1},i=ig(t);return i.depthBuffer=!e,this._pingPongRenderTarget=ig(t),i}_compileMaterial(e){let t=new tI(is[0],e);this._renderer.compile(t,ia)}_sceneToCubeUV(e,t,i,n){let r=new tH(90,1,t,i),a=[1,-1,1,1,1,1],s=[1,1,1,-1,-1,-1],o=this._renderer,l=o.autoClear,h=o.outputEncoding,u=o.toneMapping;o.getClearColor(ih),o.toneMapping=0,o.outputEncoding=3e3,o.autoClear=!1;
65let c=new e0({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1}),d=new tI(new tN,c),p=!1,m=e.background;m?m.isColor&&(c.color.copy(m),e.background=null,p=!0):(c.color.copy(ih),p=!0);for(let t=0;t<6;t++){let i=t%3;0==i?(r.up.set(0,a[t],0),r.lookAt(s[t],0,0)):1==i?(r.up.set(0,0,a[t]),r.lookAt(0,s[t],0)):(r.up.set(0,a[t],0),r.lookAt(0,0,s[t])),iv(n,256*i,t>2?256:0,256,256),o.setRenderTarget(n),p&&o.render(d,r),o.render(e,r)}d.geometry.dispose(),d.material.dispose(),o.toneMapping=u,o.outputEncoding=h,o.autoClear=l,e.background=m}_textureToCubeUV(e,t){let i=this._renderer;e.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=ix()):null==this._equirectShader&&(this._equirectShader=iy());let n=e.isCubeTexture?this._cubemapShader:this._equirectShader,r=new tI(is[0],n),a=n.uniforms;a.envMap.value=e,e.isCubeTexture||a.texelSize.value.set(1/e.image.width,1/e.image.height),a.inputEncoding.value=ir[e.encoding],a.outputEncoding.value=ir[t.texture.encoding],iv(t,0,0,768,512),i.setRenderTarget(t),i.render(r,ia)}_applyPMREM(e){let t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let t=1;t<ii;t++){let i=Math.sqrt(il[t]*il[t]-il[t-1]*il[t-1]),n=ip[(t-1)%ip.length];this._blur(e,t-1,t,i,n)}t.autoClear=i}_blur(e,t,i,n,r){let a=this._pingPongRenderTarget;this._halfBlur(e,a,t,i,n,"latitudinal",r),this._halfBlur(a,e,i,i,n,"longitudinal",r)}_halfBlur(e,t,i,n,r,a,s){let o=this._renderer,l=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");let h=new tI(is[n],l),u=l.uniforms,c=io[i]-1,d=isFinite(r)?Math.PI/(2*c):2*Math.PI/39,p=r/d,m=isFinite(r)?1+Math.floor(3*p):20;m>20&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${m} samples when the maximum is set to 20`);let f=[],g=0;for(let e=0;e<20;++e){let t=e/p,i=Math.exp(-t*t/2);f.push(i),0==e?g+=i:e<m&&(g+=2*i)}for(let e=0;e<f.length;e++)f[e]=f[e]/g;u.envMap.value=e.texture,u.samples.value=m,u.weights.value=f,u.latitudinal.value="latitudinal"===a,s&&(u.poleAxis.value=s),u.dTheta.value=d,u.mipInt.value=8-i,u.inputEncoding.value=ir[e.texture.encoding],u.outputEncoding.value=ir[e.texture.encoding];let v=io[n];iv(t,3*Math.max(0,256-2*v),(0===n?0:512)+2*v*(n>4?n-8+4:0),3*v,2*v),o.setRenderTarget(t),o.render(h,ia)}}function ig(e){let t=new A(768,768,e);return t.texture.mapping=306,t.texture.name="PMREM.cubeUv",t.scissorTest=!0,t}function iv(e,t,i,n,r){e.viewport.set(t,i,n,r),e.scissor.set(t,i,n,r)}function iy(){return new ie({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:new _(1,1)},inputEncoding:{value:ir[3e3]},outputEncoding:{value:ir[3e3]}},vertexShader:i_(),fragmentShader:` 66 67 precision mediump float; 68 precision mediump int; 69 70 varying vec3 vOutputDirection; 71 72 uniform sampler2D envMap; 73 uniform vec2 texelSize; 74 75 ${ib()} 76 77 #include <common> 78 79 void main() { 80 81 gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 82 83 vec3 outputDirection = normalize( vOutputDirection ); 84 vec2 uv = equirectUv( outputDirection ); 85 86 vec2 f = fract( uv / texelSize - 0.5 ); 87 uv -= f * texelSize; 88 vec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; 89 uv.x += texelSize.x; 90 vec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; 91 uv.y += texelSize.y; 92 vec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; 93 uv.x -= texelSize.x; 94 vec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb; 95 96 vec3 tm = mix( tl, tr, f.x ); 97 vec3 bm = mix( bl, br, f.x ); 98 gl_FragColor.rgb = mix( tm, bm, f.y ); 99 100 gl_FragColor = linearToOutputTexel( gl_FragColor ); 101 102 } 103 `,blending:0,depthTest:!1,depthWrite:!1})}function ix(){return new ie({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:ir[3e3]},outputEncoding:{value:ir[3e3]}},vertexShader:i_(),fragmentShader:` 104 105 precision mediump float; 106 precision mediump int; 107 108 varying vec3 vOutputDirection; 109 110 uniform samplerCube envMap; 111 112 ${ib()} 113 114 void main() { 115 116 gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 117 gl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb; 118 gl_FragColor = linearToOutputTexel( gl_FragColor ); 119 120 } 121 `,blending:0,depthTest:!1,depthWrite:!1})}function i_(){return"\n\n precision mediump float;\n precision mediump int;\n\n attribute vec3 position;\n attribute vec2 uv;\n attribute float faceIndex;\n\n varying vec3 vOutputDirection;\n\n // RH coordinate system; PMREM face-indexing convention\n vec3 getDirection( vec2 uv, float face ) {\n\n uv = 2.0 * uv - 1.0;\n\n vec3 direction = vec3( uv, 1.0 );\n\n if ( face == 0.0 ) {\n\n direction = direction.zyx; // ( 1, v, u ) pos x\n\n } else if ( face == 1.0 ) {\n\n direction = direction.xzy;\n direction.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n } else if ( face == 2.0 ) {\n\n direction.x *= -1.0; // ( -u, v, 1 ) pos z\n\n } else if ( face == 3.0 ) {\n\n direction = direction.zyx;\n direction.xz *= -1.0; // ( -1, v, -u ) neg x\n\n } else if ( face == 4.0 ) {\n\n direction = direction.xzy;\n direction.xy *= -1.0; // ( -u, -1, v ) neg y\n\n } else if ( face == 5.0 ) {\n\n direction.z *= -1.0; // ( u, v, -1 ) neg z\n\n }\n\n return direction;\n\n }\n\n void main() {\n\n vOutputDirection = getDirection( uv, faceIndex );\n gl_Position = vec4( position, 1.0 );\n\n }\n "}function ib(){return"\n\n uniform int inputEncoding;\n uniform int outputEncoding;\n\n #include <encodings_pars_fragment>\n\n vec4 inputTexelToLinear( vec4 value ) {\n\n if ( inputEncoding == 0 ) {\n\n return value;\n\n } else if ( inputEncoding == 1 ) {\n\n return sRGBToLinear( value );\n\n } else if ( inputEncoding == 2 ) {\n\n return RGBEToLinear( value );\n\n } else if ( inputEncoding == 3 ) {\n\n return RGBMToLinear( value, 7.0 );\n\n } else if ( inputEncoding == 4 ) {\n\n return RGBMToLinear( value, 16.0 );\n\n } else if ( inputEncoding == 5 ) {\n\n return RGBDToLinear( value, 256.0 );\n\n } else {\n\n return GammaToLinear( value, 2.2 );\n\n }\n\n }\n\n vec4 linearToOutputTexel( vec4 value ) {\n\n if ( outputEncoding == 0 ) {\n\n return value;\n\n } else if ( outputEncoding == 1 ) {\n\n return LinearTosRGB( value );\n\n } else if ( outputEncoding == 2 ) {\n\n return LinearToRGBE( value );\n\n } else if ( outputEncoding == 3 ) {\n\n return LinearToRGBM( value, 7.0 );\n\n } else if ( outputEncoding == 4 ) {\n\n return LinearToRGBM( value, 16.0 );\n\n } else if ( outputEncoding == 5 ) {\n\n return LinearToRGBD( value, 256.0 );\n\n } else {\n\n return LinearToGamma( value, 2.2 );\n\n }\n\n }\n\n vec4 envMapTexelToLinear( vec4 color ) {\n\n return inputTexelToLinear( color );\n\n }\n "}function iM(e){let t=new WeakMap,i=null;function n(e){let i=e.target;i.removeEventListener("dispose",n);let r=t.get(i);void 0!==r&&(t.delete(i),r.dispose())}return{get:function(r){if(r&&r.isTexture&&!1===r.isRenderTargetTexture){let a=r.mapping,s=303===a||304===a,o=301===a||302===a;if(s||o){if(t.has(r))return t.get(r).texture;{let a=r.image;if(s&&a&&a.height>0||o&&a&&function(e){let t=0;for(let i=0;i<6;i++)void 0!==e[i]&&t++;return 6===t}(a)){let a=e.getRenderTarget();null===i&&(i=new im(e));let o=s?i.fromEquirectangular(r):i.fromCubemap(r);return t.set(r,o),e.setRenderTarget(a),r.addEventListener("dispose",n),o.texture}return null}}}return r},dispose:function(){t=new WeakMap,null!==i&&(i.dispose(),i=null)}}}function iw(e){let t={};function i(i){let n;if(void 0!==t[i])return t[i];switch(i){case"WEBGL_depth_texture":n=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=e.getExtension(i)}return t[i]=n,n}return{has:function(e){return null!==i(e)},init:function(e){e.isWebGL2?i("EXT_color_buffer_float"):(i("WEBGL_depth_texture"),i("OES_texture_float"),i("OES_texture_half_float"),i("OES_texture_half_float_linear"),i("OES_standard_derivatives"),i("OES_element_index_uint"),i("OES_vertex_array_object"),i("ANGLE_instanced_arrays")),i("OES_texture_float_linear"),i("EXT_color_buffer_half_float")},get:function(e){let t=i(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function iS(e,t,i,n){let r={},a=new WeakMap;function s(e){let o=e.target;for(let e in null!==o.index&&t.remove(o.index),o.attributes)t.remove(o.attributes[e]);o.removeEventListener("dispose",s),delete r[o.id];let l=a.get(o);l&&(t.remove(l),a.delete(o)),n.releaseStatesOfGeometry(o),!0===o.isInstancedBufferGeometry&&delete o._maxInstanceCount,i.memory.geometries--}function o(e){let i=[],n=e.index,r=e.attributes.position,s=0;if(null!==n){let e=n.array;s=n.version;for(let t=0,n=e.length;t<n;t+=3){let n=e[t+0],r=e[t+1],a=e[t+2];i.push(n,r,r,a,a,n)}}else{let e=r.array;s=r.version;for(let t=0,n=e.length/3-1;t<n;t+=3){let e=t+0,n=t+1,r=t+2;i.push(e,n,n,r,r,e)}}let o=new(tr(i)>65535?te:e7)(i,1);o.version=s;let l=a.get(e);l&&t.remove(l),a.set(e,o)}return{get:function(e,t){return!0===r[t.id]||(t.addEventListener("dispose",s),r[t.id]=!0,i.memory.geometries++),t},update:function(e){let i=e.attributes;for(let e in i)t.update(i[e],34962);let n=e.morphAttributes;for(let e in n){let i=n[e];for(let e=0,n=i.length;e<n;e++)t.update(i[e],34962)}},getWireframeAttribute:function(e){let t=a.get(e);if(t){let i=e.index;null!==i&&t.version<i.version&&o(e)}else o(e);return a.get(e)}}}function iT(e,t,i,n){let r,a,s;
121let o=n.isWebGL2;this.setMode=function(e){r=e},this.setIndex=function(e){a=e.type,s=e.bytesPerElement},this.render=function(t,n){e.drawElements(r,n,a,t*s),i.update(n,r,1)},this.renderInstances=function(n,l,h){let u,c;if(0!==h){if(o)u=e,c="drawElementsInstanced";else if(u=t.get("ANGLE_instanced_arrays"),c="drawElementsInstancedANGLE",null===u)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[c](r,l,a,n*s,h),i.update(l,r,h)}}}function iE(e){let t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(e,i,n){switch(t.calls++,i){case 4:t.triangles+=e/3*n;break;case 1:t.lines+=e/2*n;break;case 3:t.lines+=n*(e-1);break;case 2:t.lines+=n*e;break;case 0:t.points+=n*e;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",i)}}}}function iA(e,t){return e[0]-t[0]}function iL(e,t){return Math.abs(t[1])-Math.abs(e[1])}function iR(e){let t={},i=new Float32Array(8),n=[];for(let e=0;e<8;e++)n[e]=[e,0];return{update:function(r,a,s,o){let l=r.morphTargetInfluences,h=void 0===l?0:l.length,u=t[a.id];if(void 0===u||u.length!==h){u=[];for(let e=0;e<h;e++)u[e]=[e,0];t[a.id]=u}for(let e=0;e<h;e++){let t=u[e];t[0]=e,t[1]=l[e]}u.sort(iL);for(let e=0;e<8;e++)e<h&&u[e][1]?(n[e][0]=u[e][0],n[e][1]=u[e][1]):(n[e][0]=Number.MAX_SAFE_INTEGER,n[e][1]=0);n.sort(iA);let c=a.morphAttributes.position,d=a.morphAttributes.normal,p=0;for(let e=0;e<8;e++){let t=n[e],r=t[0],s=t[1];r!==Number.MAX_SAFE_INTEGER&&s?(c&&a.getAttribute("morphTarget"+e)!==c[r]&&a.setAttribute("morphTarget"+e,c[r]),d&&a.getAttribute("morphNormal"+e)!==d[r]&&a.setAttribute("morphNormal"+e,d[r]),i[e]=s,p+=s):(c&&!0===a.hasAttribute("morphTarget"+e)&&a.deleteAttribute("morphTarget"+e),d&&!0===a.hasAttribute("morphNormal"+e)&&a.deleteAttribute("morphNormal"+e),i[e]=0)}let m=a.morphTargetsRelative?1:1-p;o.getUniforms().setValue(e,"morphTargetBaseInfluence",m),o.getUniforms().setValue(e,"morphTargetInfluences",i)}}}function iC(e,t,i,n){let r=new WeakMap;function a(e){let t=e.target;t.removeEventListener("dispose",a),i.remove(t.instanceMatrix),null!==t.instanceColor&&i.remove(t.instanceColor)}return{update:function(e){let s=n.render.frame,o=e.geometry,l=t.get(e,o);return r.get(l)!==s&&(t.update(l),r.set(l,s)),e.isInstancedMesh&&(!1===e.hasEventListener("dispose",a)&&e.addEventListener("dispose",a),i.update(e.instanceMatrix,34962),null!==e.instanceColor&&i.update(e.instanceColor,34962)),l},dispose:function(){r=new WeakMap}}}class iP extends S{constructor(e=null,t=1,i=1,n=1){super(null),this.image={data:e,width:t,height:i,depth:n},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}iP.prototype.isDataTexture2DArray=!0;class iI extends S{constructor(e=null,t=1,i=1,n=1){super(null),this.image={data:e,width:t,height:i,depth:n},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}iI.prototype.isDataTexture3D=!0;let iD=new S,iN=new iP,iz=new iI,iB=new tk,iF=[],iO=[],iU=new Float32Array(16),iH=new Float32Array(9),iG=new Float32Array(4);function ik(e,t,i){let n=e[0];if(n<=0||n>0)return e;let r=t*i,a=iF[r];if(void 0===a&&(a=new Float32Array(r),iF[r]=a),0!==t){n.toArray(a,0);for(let n=1,r=0;n!==t;++n)r+=i,e[n].toArray(a,r)}return a}function iV(e,t){if(e.length!==t.length)return!1;for(let i=0,n=e.length;i<n;i++)if(e[i]!==t[i])return!1;return!0}function iW(e,t){for(let i=0,n=t.length;i<n;i++)e[i]=t[i]}function ij(e,t){let i=iO[t];void 0===i&&(i=new Int32Array(t),iO[t]=i);for(let n=0;n!==t;++n)i[n]=e.allocateTextureUnit();return i}function iq(e,t){let i=this.cache;i[0]!==t&&(e.uniform1f(this.addr,t),i[0]=t)}function iX(e,t){let i=this.cache;if(void 0!==t.x)i[0]===t.x&&i[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y);else{if(iV(i,t))return;e.uniform2fv(this.addr,t),iW(i,t)}}function iY(e,t){let i=this.cache;if(void 0!==t.x)i[0]===t.x&&i[1]===t.y&&i[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z);else if(void 0!==t.r)i[0]===t.r&&i[1]===t.g&&i[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),i[0]=t.r,i[1]=t.g,i[2]=t.b);else{if(iV(i,t))return;e.uniform3fv(this.addr,t),iW(i,t)}}function iJ(e,t){let i=this.cache;if(void 0!==t.x)i[0]===t.x&&i[1]===t.y&&i[2]===t.z&&i[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w);else{if(iV(i,t))return;e.uniform4fv(this.addr,t),iW(i,t)}}function iZ(e,t){let i=this.cache,n=t.elements;if(void 0===n){if(iV(i,t))return;e.uniformMatrix2fv(this.addr,!1,t),iW(i,t)}else{if(iV(i,n))return;iG.set(n),e.uniformMatrix2fv(this.addr,!1,iG),iW(i,n)}}function iQ(e,t){let i=this.cache,n=t.elements;if(void 0===n){if(iV(i,t))return;e.uniformMatrix3fv(this.addr,!1,t),iW(i,t)}else{if(iV(i,n))return;iH.set(n),e.uniformMatrix3fv(this.addr,!1,iH),iW(i,n)}}function iK(e,t){let i=this.cache,n=t.elements;if(void 0===n){if(iV(i,t))return;e.uniformMatrix4fv(this.addr,!1,t),iW(i,t)}else{if(iV(i,n))return;iU.set(n),e.uniformMatrix4fv(this.addr,!1,iU),iW(i,n)}}function i$(e,t){let i=this.cache;i[0]!==t&&(e.uniform1i(this.addr,t),i[0]=t)}function i0(e,t){let i=this.cache;iV(i,t)||(e.uniform2iv(this.addr,t),iW(i,t))}function i1(e,t){let i=this.cache;iV(i,t)||(e.uniform3iv(this.addr,t),iW(i,t))}function i3(e,t){let i=this.cache;iV(i,t)||(e.uniform4iv(this.addr,t),iW(i,t))}function i2(e,t){let i=this.cache;i[0]!==t&&(e.uniform1ui(this.addr,t),i[0]=t)}function i4(e,t){let i=this.cache;iV(i,t)||(e.uniform2uiv(this.addr,t),iW(i,t))}function i5(e,t){let i=this.cache;iV(i,t)||(e.uniform3uiv(this.addr,t),iW(i,t))}function i6(e,t){let i=this.cache;iV(i,t)||(e.uniform4uiv(this.addr,t),iW(i,t))}function i8(e,t,i){let n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(e.uniform1i(this.addr,r),n[0]=r),i.safeSetTexture2D(t||iD,r)}function i7(e,t,i){let n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(e.uniform1i(this.addr,r),n[0]=r),i.setTexture3D(t||iz,r)}function i9(e,t,i){let n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(e.uniform1i(this.addr,r),n[0]=r),i.safeSetTextureCube(t||iB,r)}function ne(e,t,i){let n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(e.uniform1i(this.addr,r),n[0]=r),i.setTexture2DArray(t||iN,r)}function nt(e,t){e.uniform1fv(this.addr,t)}function ni(e,t){let i=ik(t,this.size,2);e.uniform2fv(this.addr,i)}function nn(e,t){let i=ik(t,this.size,3);e.uniform3fv(this.addr,i)}function nr(e,t){let i=ik(t,this.size,4);e.uniform4fv(this.addr,i)}function na(e,t){let i=ik(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,i)}function ns(e,t){let i=ik(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,i)}function no(e,t){let i=ik(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,i)}function nl(e,t){e.uniform1iv(this.addr,t)}function nh(e,t){e.uniform2iv(this.addr,t)}function nu(e,t){e.uniform3iv(this.addr,t)}function nc(e,t){e.uniform4iv(this.addr,t)}
121function nd(e,t){e.uniform1uiv(this.addr,t)}function np(e,t){e.uniform2uiv(this.addr,t)}function nm(e,t){e.uniform3uiv(this.addr,t)}function nf(e,t){e.uniform4uiv(this.addr,t)}function ng(e,t,i){let n=t.length,r=ij(i,n);e.uniform1iv(this.addr,r);for(let e=0;e!==n;++e)i.safeSetTexture2D(t[e]||iD,r[e])}function nv(e,t,i){let n=t.length,r=ij(i,n);e.uniform1iv(this.addr,r);for(let e=0;e!==n;++e)i.safeSetTextureCube(t[e]||iB,r[e])}function ny(e,t,i){this.id=e,this.addr=i,this.cache=[],this.setValue=function(e){switch(e){case 5126:return iq;case 35664:return iX;case 35665:return iY;case 35666:return iJ;case 35674:return iZ;case 35675:return iQ;case 35676:return iK;case 5124:case 35670:return i$;case 35667:case 35671:return i0;case 35668:case 35672:return i1;case 35669:case 35673:return i3;case 5125:return i2;case 36294:return i4;case 36295:return i5;case 36296:return i6;case 35678:case 36198:case 36298:case 36306:case 35682:return i8;case 35679:case 36299:case 36307:return i7;case 35680:case 36300:case 36308:case 36293:return i9;case 36289:case 36303:case 36311:case 36292:return ne}}(t.type)}function nx(e,t,i){this.id=e,this.addr=i,this.cache=[],this.size=t.size,this.setValue=function(e){switch(e){case 5126:return nt;case 35664:return ni;case 35665:return nn;case 35666:return nr;case 35674:return na;case 35675:return ns;case 35676:return no;case 5124:case 35670:return nl;case 35667:case 35671:return nh;case 35668:case 35672:return nu;case 35669:case 35673:return nc;case 5125:return nd;case 36294:return np;case 36295:return nm;case 36296:return nf;case 35678:case 36198:case 36298:case 36306:case 35682:return ng;case 35680:case 36300:case 36308:case 36293:return nv}}(t.type)}function n_(e){this.id=e,this.seq=[],this.map={}}nx.prototype.updateCache=function(e){let t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),iW(t,e)},n_.prototype.setValue=function(e,t,i){let n=this.seq;for(let r=0,a=n.length;r!==a;++r){let a=n[r];a.setValue(e,t[a.id],i)}};let nb=/(\w+)(\])?(\[|\.)?/g;function nM(e,t){e.seq.push(t),e.map[t.id]=t}function nw(e,t){this.seq=[],this.map={};let i=e.getProgramParameter(t,35718);for(let n=0;n<i;++n){let i=e.getActiveUniform(t,n);!function(e,t,i){let n=e.name,r=n.length;for(nb.lastIndex=0;;){let a=nb.exec(n),s=nb.lastIndex,o=a[1],l="]"===a[2],h=a[3];if(l&&(o|=0),void 0===h||"["===h&&s+2===r){nM(i,void 0===h?new ny(o,e,t):new nx(o,e,t));break}{let e=i.map[o];void 0===e&&nM(i,e=new n_(o)),i=e}}}(i,e.getUniformLocation(t,i.name),this)}}function nS(e,t,i){let n=e.createShader(t);return e.shaderSource(n,i),e.compileShader(n),n}nw.prototype.setValue=function(e,t,i,n){let r=this.map[t];void 0!==r&&r.setValue(e,i,n)},nw.prototype.setOptional=function(e,t,i){let n=t[i];void 0!==n&&this.setValue(e,i,n)},nw.upload=function(e,t,i,n){for(let r=0,a=t.length;r!==a;++r){let a=t[r],s=i[a.id];!1!==s.needsUpdate&&a.setValue(e,s.value,n)}},nw.seqWithValue=function(e,t){let i=[];for(let n=0,r=e.length;n!==r;++n){let r=e[n];r.id in t&&i.push(r)}return i};let nT=0;function nE(e){switch(e){case 3e3:return["Linear","( value )"];case 3001:return["sRGB","( value )"];case 3002:return["RGBE","( value )"];case 3004:return["RGBM","( value, 7.0 )"];case 3005:return["RGBM","( value, 16.0 )"];case 3006:return["RGBD","( value, 256.0 )"];case 3007:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case 3003:return["LogLuv","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",e),["Linear","( value )"]}}function nA(e,t,i){let n=e.getShaderParameter(t,35713),r=e.getShaderInfoLog(t).trim();return n&&""===r?"":i.toUpperCase()+"\n\n"+r+"\n\n"+function(e){let t=e.split("\n");for(let e=0;e<t.length;e++)t[e]=e+1+": "+t[e];return t.join("\n")}(e.getShaderSource(t))}function nL(e,t){let i=nE(t);return"vec4 "+e+"( vec4 value ) { return "+i[0]+"ToLinear"+i[1]+"; }"}function nR(e){return""!==e}function nC(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_L
121IGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function nP(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}let nI=/^[ \t]*#include +<([\w\d./]+)>/gm;function nD(e){return e.replace(nI,nN)}function nN(e,t){let i=t0[t];if(void 0===i)throw Error("Can not resolve #include <"+t+">");return nD(i)}let nz=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,nB=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function nF(e){return e.replace(nB,nU).replace(nz,nO)}function nO(e,t,i,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),nU(e,t,i,n)}function nU(e,t,i,n){let r="";for(let e=parseInt(t);e<parseInt(i);e++)r+=n.replace(/\[\s*i\s*\]/g,"[ "+e+" ]").replace(/UNROLLED_LOOP_INDEX/g,e);return r}function nH(e){let t="precision "+e.precision+" float;\nprecision "+e.precision+" int;";return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function nG(e,t,i,n){let r,a,o;let l=e.getContext(),h=i.defines,u=i.vertexShader,c=i.fragmentShader,d=(o="SHADOWMAP_TYPE_BASIC",1===i.shadowMapType?o="SHADOWMAP_TYPE_PCF":2===i.shadowMapType?o="SHADOWMAP_TYPE_PCF_SOFT":3===i.shadowMapType&&(o="SHADOWMAP_TYPE_VSM"),o),p=function(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case 301:case 302:t="ENVMAP_TYPE_CUBE";break;case 306:case 307:t="ENVMAP_TYPE_CUBE_UV"}return t}(i),m=function(e){let t="ENVMAP_MODE_REFLECTION";if(e.envMap)switch(e.envMapMode){case 302:case 307:t="ENVMAP_MODE_REFRACTION"}return t}(i),f=function(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case 0:t="ENVMAP_BLENDING_MULTIPLY";break;case 1:t="ENVMAP_BLENDING_MIX";break;case 2:t="ENVMAP_BLENDING_ADD"}return t}(i),g=e.gammaFactor>0?e.gammaFactor:1,v=i.isWebGL2?"":[i.extensionDerivatives||i.envMapCubeUV||i.bumpMap||i.tangentSpaceNormalMap||i.clearcoatNormalMap||i.flatShading||"physical"===i.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(i.extensionFragDepth||i.logarithmicDepthBuffer)&&i.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",i.extensionDrawBuffers&&i.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(i.extensionShaderTextureLOD||i.envMap||i.transmission)&&i.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(nR).join("\n"),y=function(e){let t=[];for(let i in e){let n=e[i];!1!==n&&t.push("#define "+i+" "+n)}return t.join("\n")}(h),x=l.createProgram(),_,b,M=i.glslVersion?"#version "+i.glslVersion+"\n":"";i.isRawShaderMaterial?((_=[y].filter(nR).join("\n")).length>0&&(_+="\n"),(b=[v,y].filter(nR).join("\n")).length>0&&(b+="\n")):(_=[nH(i),"#define SHADER_NAME "+i.shaderName,y,i.instancing?"#define USE_INSTANCING":"",i.instancingColor?"#define USE_INSTANCING_COLOR":"",i.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+g,"#define MAX_BONES "+i.maxBones,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+m:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.displacementMap&&i.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",i.specularTintMap?"#define USE_SPECULARTINTMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alph
121aMap?"#define USE_ALPHAMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.useVertexTexture?"#define BONE_TEXTURE":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&!1===i.flatShading?"#define USE_MORPHNORMALS":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+d:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.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","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif","\n"].filter(nR).join("\n"),b=[v,nH(i),"#define SHADER_NAME "+i.shaderName,y,"#define GAMMA_FACTOR "+g,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.matcap?"#define USE_MATCAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+p:"",i.envMap?"#define "+m:"",i.envMap?"#define "+f:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoat?"#define USE_CLEARCOAT":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",i.specularTintMap?"#define USE_SPECULARTINTMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaTest?"#define USE_ALPHATEST":"",i.sheenTint?"#define USE_SHEEN":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors||i.instancingColor?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+d:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(i.extensionShaderTextureLOD||i.envMap)&&i.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==i.toneMapping?"#define TONE_MAPPING":"",0!==i.toneMapping?t0.tonemapping_pars_fragment:"",0!==i.toneMapping?function(e,t){let i;switch(t){case 1:i="Linear";break;case 2:i="Reinhard";break;case 3:i="OptimizedCineon";break;case 4:i="ACESFilmic";break;case 5:i="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),i="Linear"}return"vec3 "+e+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",1022===i.format?"#define OPAQUE":"",t0.encodings_pars_fragment,i.map?nL("mapTexelToLinear",i.mapEncoding):"",i.matcap?nL("matcapTexelToLinear",i.matcapEncoding):"",i.envMap?nL("envMapTexelToLinear",i.envMapEncoding):"",i.emissiveMap?nL("emissiveMapTexelToLinear",i.emissiveMapEncoding):"",i.specularTintMap?nL("specularTintMapTexelToLinear",i.specularTintMapEncoding):"",i.lightMap?nL("lightMapTexelToLinear",i.lightMapEncoding):"",function(e,t){let i=nE(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+i[0]+i[1]+"; }"}("linearToOutputTexel",i.outputEncoding),i.depthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(nR).join("\n")),u=nP(u=nC(u=nD(u),i),i),c=nP(c=nC(c=nD(c),i),i),u=nF(u),c=nF(c),i.isWebGL2&&!0!==i.isRawShaderMaterial&&(M="#version 300 es\n",_="#define attribute in\n#define varying out\n#define texture2D texture\n"+_,b=["#define varying in",i.glslVersion===s?"":"out highp vec4 pc_fragColor;",i.glslVersion===s?"":"#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"+b);let w=M+b+c,S=nS(l,35633,M+_+u),T=nS(l,35632,w);if(l.attachShader(x,S),l.attachShader(x,T),void 0!==i.index0AttributeName?l.bindAttribLocation(x,0,i.index0AttributeName):!0===i.morphTargets&&l.bindAttribLocation(x,0,"position"),l.linkProgram(x),e.debug.checkSha
121derErrors){let e=l.getProgramInfoLog(x).trim(),t=l.getShaderInfoLog(S).trim(),i=l.getShaderInfoLog(T).trim(),n=!0,r=!0;if(!1===l.getProgramParameter(x,35714)){n=!1;let t=nA(l,S,"vertex"),i=nA(l,T,"fragment");console.error("THREE.WebGLProgram: Shader Error "+l.getError()+" - VALIDATE_STATUS "+l.getProgramParameter(x,35715)+"\n\nProgram Info Log: "+e+"\n"+t+"\n"+i)}else""!==e?console.warn("THREE.WebGLProgram: Program Info Log:",e):""!==t&&""!==i||(r=!1);r&&(this.diagnostics={runnable:n,programLog:e,vertexShader:{log:t,prefix:_},fragmentShader:{log:i,prefix:b}})}return l.deleteShader(S),l.deleteShader(T),this.getUniforms=function(){return void 0===r&&(r=new nw(l,x)),r},this.getAttributes=function(){return void 0===a&&(a=function(e,t){let i={},n=e.getProgramParameter(t,35721);for(let r=0;r<n;r++){let n=e.getActiveAttrib(t,r),a=n.name,s=1;35674===n.type&&(s=2),35675===n.type&&(s=3),35676===n.type&&(s=4),i[a]={type:n.type,location:e.getAttribLocation(t,a),locationSize:s}}return i}(l,x)),a},this.destroy=function(){n.releaseStatesOfProgram(this),l.deleteProgram(x),this.program=void 0},this.name=i.shaderName,this.id=nT++,this.cacheKey=t,this.usedTimes=1,this.program=x,this.vertexShader=S,this.fragmentShader=T,this}function nk(e,t,i,n,r,a,s){let o=[],l=r.isWebGL2,h=r.logarithmicDepthBuffer,u=r.floatVertexTextures,c=r.maxVertexUniforms,d=r.vertexTextures,p=r.precision,m={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"},f=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoat","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","specularIntensityMap","specularTintMap","specularTintMapEncoding","roughnessMap","metalnessMap","gradientMap","alphaMap","alphaTest","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","format","sheenTint","transmission","transmissionMap","thicknessMap"];function g(e){let t;return e&&e.isTexture?t=e.encoding:e&&e.isWebGLRenderTarget?(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),t=e.texture.encoding):t=3e3,t}return{getParameters:function(a,o,f,v,y){let x,_;let b=v.fog,M=a.isMeshStandardMaterial?v.environment:null,w=(a.isMeshStandardMaterial?i:t).get(a.envMap||M),S=m[a.type],T=y.isSkinnedMesh?function(e){let t=e.skeleton.bones;if(u)return 1024;{let e=Math.min(Math.floor((c-20)/4),t.length);return e<t.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+t.length+" bones. This GPU supports "+e+"."),0):e}}(y):0;if(null!==a.precision&&(p=r.getMaxPrecision(a.precision))!==a.precision&&console.warn("THREE.WebGLProgram.getParameters:",a.precision,"not supported, using",p,"instead."),S){let e=t3[S];x=e.vertexShader,_=e.fragmentShader}else x=a.vertexShader,_=a.fragmentShader;let E=e.getRenderTarget(),A=a.alphaTest>0,L=a.clearcoat>0;return{isWebGL2:l,shaderID:S,shaderName:a.type,vertexShader:x,fragmentShader:_,defines:a.defines,isRawShaderMaterial:!0===a.isRawShaderMaterial,glslVersion:a.glslVersion,precision:p,instancing:!0===y.isInstancedMesh,instancingColor:!0===y.isInstancedMesh&&null!==y.instanceColor,supportsVertexTextures:d,outputEncoding:null!==E?g(E.texture):e.outputEncoding,map:!!a.map,mapEncoding:g(a.map),matcap:!!a.matcap,matc
121apEncoding:g(a.matcap),envMap:!!w,envMapMode:w&&w.mapping,envMapEncoding:g(w),envMapCubeUV:!!w&&(306===w.mapping||307===w.mapping),lightMap:!!a.lightMap,lightMapEncoding:g(a.lightMap),aoMap:!!a.aoMap,emissiveMap:!!a.emissiveMap,emissiveMapEncoding:g(a.emissiveMap),bumpMap:!!a.bumpMap,normalMap:!!a.normalMap,objectSpaceNormalMap:1===a.normalMapType,tangentSpaceNormalMap:0===a.normalMapType,clearcoat:L,clearcoatMap:L&&!!a.clearcoatMap,clearcoatRoughnessMap:L&&!!a.clearcoatRoughnessMap,clearcoatNormalMap:L&&!!a.clearcoatNormalMap,displacementMap:!!a.displacementMap,roughnessMap:!!a.roughnessMap,metalnessMap:!!a.metalnessMap,specularMap:!!a.specularMap,specularIntensityMap:!!a.specularIntensityMap,specularTintMap:!!a.specularTintMap,specularTintMapEncoding:g(a.specularTintMap),alphaMap:!!a.alphaMap,alphaTest:A,gradientMap:!!a.gradientMap,sheenTint:!!a.sheenTint&&(a.sheenTint.r>0||a.sheenTint.g>0||a.sheenTint.b>0),transmission:a.transmission>0,transmissionMap:!!a.transmissionMap,thicknessMap:!!a.thicknessMap,combine:a.combine,vertexTangents:!!a.normalMap&&!!y.geometry&&!!y.geometry.attributes.tangent,vertexColors:a.vertexColors,vertexAlphas:!0===a.vertexColors&&!!y.geometry&&!!y.geometry.attributes.color&&4===y.geometry.attributes.color.itemSize,vertexUvs:!!(a.map||a.bumpMap||a.normalMap||a.specularMap||a.alphaMap||a.emissiveMap||a.roughnessMap||a.metalnessMap||a.clearcoatMap||a.clearcoatRoughnessMap||a.clearcoatNormalMap||a.displacementMap||a.transmissionMap||a.thicknessMap||a.specularIntensityMap||a.specularTintMap),uvsVertexOnly:!(a.map||a.bumpMap||a.normalMap||a.specularMap||a.alphaMap||a.emissiveMap||a.roughnessMap||a.metalnessMap||a.clearcoatNormalMap||a.transmission>0||a.transmissionMap||a.thicknessMap||a.specularIntensityMap||a.specularTintMap||!a.displacementMap),fog:!!b,useFog:a.fog,fogExp2:b&&b.isFogExp2,flatShading:!!a.flatShading,sizeAttenuation:a.sizeAttenuation,logarithmicDepthBuffer:h,skinning:!0===y.isSkinnedMesh&&T>0,maxBones:T,useVertexTexture:u,morphTargets:!!y.geometry&&!!y.geometry.morphAttributes.position,morphNormals:!!y.geometry&&!!y.geometry.morphAttributes.normal,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,format:a.format,dithering:a.dithering,shadowMapEnabled:e.shadowMap.enabled&&f.length>0,shadowMapType:e.shadowMap.type,toneMapping:a.toneMapped?e.toneMapping:0,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:a.premultipliedAlpha,doubleSided:2===a.side,flipSided:1===a.side,depthPacking:void 0!==a.depthPacking&&a.depthPacking,index0AttributeName:a.index0AttributeName,extensionDerivatives:a.extensions&&a.extensions.derivatives,extensionFragDepth:a.extensions&&a.extensions.fragDepth,extensionDrawBuffers:a.extensions&&a.extensions.drawBuffers,extensionShaderTextureLOD:a.extensions&&a.extensions.shaderTextureLOD,rendererExtensionFragDepth:l||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:l||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:l||n.has("EXT_shader_texture_lod"),customProgramCacheKey:a.customProgramCacheKey()}},getProgramCacheKey:function(t){let i=[];if(t.shaderID?i.push(t.shaderID):(i.push(t.fragmentShader),i.push(t.vertexShader)),void 0!==t.defines)for(let e in t.defines)i.push(e),i.push(t.defines[e]);if(!1===t.isRawShaderMaterial){for(let e=0;e<f.length;e++)i.push(t[f[e]]);i.push(e.outputEncoding),i.push(e.gammaFactor)}return i.push(t.customProgramCacheKey),i.join()},getUniforms:function(e){let t;let i=m[e.type];if(i){let e=t3[i];t=tF.clone(e.uniforms)}else t=e.uniforms;return t},acquireProgram:function(t,i){let n;for(let e=0,t=o.length;e<t;e++){let t=o[e];if(t.cacheKey===i){n=t,++n.usedTimes;break}}return void 0===n&&(n=new nG(e,i,t,a),o.push(n)),n}
vendor: 8,257 bytes, line 121
121,releaseProgram:function(e){if(0==--e.usedTimes){let t=o.indexOf(e);o[t]=o[o.length-1],o.pop(),e.destroy()}},programs:o}}function nV(){let e=new WeakMap;return{get:function(t){let i=e.get(t);return void 0===i&&(i={},e.set(t,i)),i},remove:function(t){e.delete(t)},update:function(t,i,n){e.get(t)[i]=n},dispose:function(){e=new WeakMap}}}function nW(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function nj(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function nq(e){let t=[],i=0,n=[],r=[],a=[],s={id:-1};function o(n,r,a,o,l,h){let u=t[i],c=e.get(a);return void 0===u?(u={id:n.id,object:n,geometry:r,material:a,program:c.program||s,groupOrder:o,renderOrder:n.renderOrder,z:l,group:h},t[i]=u):(u.id=n.id,u.object=n,u.geometry=r,u.material=a,u.program=c.program||s,u.groupOrder=o,u.renderOrder=n.renderOrder,u.z=l,u.group=h),i++,u}return{opaque:n,transmissive:r,transparent:a,init:function(){i=0,n.length=0,r.length=0,a.length=0},push:function(e,t,i,s,l,h){let u=o(e,t,i,s,l,h);i.transmission>0?r.push(u):!0===i.transparent?a.push(u):n.push(u)},unshift:function(e,t,i,s,l,h){let u=o(e,t,i,s,l,h);i.transmission>0?r.unshift(u):!0===i.transparent?a.unshift(u):n.unshift(u)},finish:function(){for(let e=i,n=t.length;e<n;e++){let i=t[e];if(null===i.id)break;i.id=null,i.object=null,i.geometry=null,i.material=null,i.program=null,i.group=null}},sort:function(e,t){n.length>1&&n.sort(e||nW),r.length>1&&r.sort(t||nj),a.length>1&&a.sort(t||nj)}}}function nX(e){let t=new WeakMap;return{get:function(i,n){let r;return!1===t.has(i)?(r=new nq(e),t.set(i,[r])):n>=t.get(i).length?(r=new nq(e),t.get(i).push(r)):r=t.get(i)[n],r},dispose:function(){t=new WeakMap}}}function nY(){let e={};return{get:function(t){let i;if(void 0!==e[t.id])return e[t.id];switch(t.type){case"DirectionalLight":i={direction:new P,color:new e$};break;case"SpotLight":i={position:new P,direction:new P,color:new e$,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new P,color:new e$,distance:0,decay:0};break;case"HemisphereLight":i={direction:new P,skyColor:new e$,groundColor:new e$};break;case"RectAreaLight":i={color:new e$,position:new P,halfWidth:new P,halfHeight:new P}}return e[t.id]=i,i}}}let nJ=0;function nZ(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function nQ(e,t){let i=new nY,n=function(){let e={};return{get:function(t){let i;if(void 0!==e[t.id])return e[t.id];switch(t.type){case"DirectionalLight":case"SpotLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _};break;case"PointLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=i,i}}}(),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:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let e=0;e<9;e++)r.probe.push(new P);let a=new P,s=new el,o=new el;return{setup:function(a,s){let o=0,l=0,h=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let u=0,c=0,d=0,p=0,m=0,f=0,g=0,v=0;a.sort(nZ);let y=!0!==s?Math.PI:1;for(let e=0,t=a.length;e<t;e++){let t=a[e],s=t.color,x=t.intensity,_=t.distance,b=t.shadow&&t.shadow.map?t.shadow.map.texture:null;if(t.isAmbientLight)o+=s.r*x*y,l+=s.g*x*y,h+=s.b*x*y;else if(t.isLightProbe)for(let e=0;e<9;e++)r.probe[e].addScaledVector(t.sh.coefficients[e],x);else if(t.isDirectionalLight){let e=i.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*y),t.castShadow){let e=t.shadow,i=n.get(t);i.shadowBias=e.bias,i.shadowNormalBias=e.normalBias,i.shadowRadius=e.radius,i.shadowMapSize=e.mapSize,r.directionalShadow[u]=i,r.directionalShadowMap[u]=b,r.directionalShadowMatrix[u]=t.shadow.matrix,f++}r.directional[u]=e,u++}else if(t.isSpotLight){let e=i.get(t);if(e.position.setFromMatrixPosition(t.matrixWorld),e.color.copy(s).multiplyScalar(x*y),e.distance=_,e.coneCos=Math.cos(t.angle),e.penumbraCos=Math.cos(t.angle*(1-t.penumbra)),e.decay=t.decay,t.castShadow){let e=t.shadow,i=n.get(t);i.shadowBias=e.bias,i.shadowNormalBias=e.normalBias,i.shadowRadius=e.radius,i.shadowMapSize=e.mapSize,r.spotShadow[d]=i,r.spotShadowMap[d]=b,r.spotShadowMatrix[d]=t.shadow.matrix,v++}r.spot[d]=e,d++}else if(t.isRectAreaLight){let e=i.get(t);e.color.copy(s).multiplyScalar(x),e.halfWidth.set(.5*t.width,0,0),e.halfHeight.set(0,.5*t.height,0),r.rectArea[p]=e,p++}else if(t.isPointLight){let e=i.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*y),e.distance=t.distance,e.decay=t.decay,t.castShadow){let e=t.shadow,i=n.get(t);i.shadowBias=e.bias,i.shadowNormalBias=e.normalBias,i.shadowRadius=e.radius,i.shadowMapSize=e.mapSize,i.shadowCameraNear=e.camera.near,i.shadowCameraFar=e.camera.far,r.pointShadow[c]=i,r.pointShadowMap[c]=b,r.pointShadowMatrix[c]=t.shadow.matrix,g++}r.point[c]=e,c++}else if(t.isHemisphereLight){let e=i.get(t);e.skyColor.copy(t.color).multiplyScalar(x*y),e.groundColor.copy(t.groundColor).multiplyScalar(x*y),r.hemi[m]=e,m++}}p>0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(r.rectAreaLTC1=t1.LTC_FLOAT_1,r.rectAreaLTC2=t1.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(r.rectAreaLTC1=t1.LTC_HALF_1,r.rectAreaLTC2=t1.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=o,r.ambient[1]=l,r.ambient[2]=h;let x=r.hash;x.directionalLength===u&&x.pointLength===c&&x.spotLength===d&&x.rectAreaLength===p&&x.hemiLength===m&&x.numDirectionalShadows===f&&x.numPointShadows===g&&x.numSpotShadows===v||(r.directional.length=u,r.spot.length=d,r.rectArea.length=p,r.point.length=c,r.hemi.length=m,r.directionalShadow.length=f,r.directionalShadowMap.length=f,r.pointShadow.length=g,r.pointShadowMap.length=g,r.spotShadow.length=v,r.spotShadowMap.length=v,r.directionalShadowMatrix.length=f,r.pointShadowMatrix.length=g,r.spotShadowMatrix.length=v,x.directionalLength=u,x.pointLength=c,x.spotLength=d,x.rectAreaLength=p,x.hemiLength=m,x.numDirectionalShadows=f,x.numPointShadows=g,x.numSpotShadows=v,r.version=nJ++)},setupView:function(e,t){let i=0,n=0,l=0,h=0,u=0,c=t.matrixWorldInverse;for(let t=0,d=e.length;t<d;t++){let d=e[t];if(d.isDirectionalLight){let e=r.directional[i];e.direction.setFromMatrixPosition(d.matrixWorld),a.setFromMatrixPosition(d.target.matrixWorld),e.direction.sub(a),e.direction.transformDirection(c),i++}else if(d.isSpotLight){let e=r.spot[l];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(c),e.direction.setFromMatrixPosition(d.matrixWorld),a.setFromMatrixPosition(d.target.matrixWorld),e.direction.sub(a),e.direction.transformDirection(c),l++}else if(d.isRectAreaLight){let e=r.rectArea[h];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(c),o.identity(),s.copy(d.matrixWorld),s.premultiply(c),o.extractRotation(s),e.halfWidth.set(.5*d.width,0,0),e.halfHeight.set(0,.5*d.height,0),e.halfWidth.applyMatrix4(o),e.halfHeight.applyMatrix4(o),h++}else if(d.isPointLight){let e=r.point[n];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(c),n++}else if(d.isHemisphereLight){let e=r.hemi[u];e.direction.setFromMatrixPosition(d.matrixWorld),e.direction.transformDirection(c),e.direction.normalize(),u++}}},state:r}}function nK(e,t){let i=new nQ(e,t),n=[],r=[];return{init:function(){n.length=0,r.length=0},state:{lightsArray:n,shadowsArray:r,lights:i},setupLights:function(e){i.setup(n,e)},setupLightsView:function(e){i.setupView(n,e)},pushLight:function(e){n.push(e)},pushShadow:function(e){r.push(e)}}}function n$(e,t){let i=new WeakMap;return{get:function(n,r=0){let a;return!1===i.has(n)?(a=new nK(e,t),i.set(n,[a])):r>=i.get(n).length?(a=new nK(e,t),i.get(n).push(a)):a=i.get(n)[r],a}
121,dispose:function(){i=new WeakMap}}}class n0 extends eq{constructor(e){super(),this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}n0.prototype.isMeshDepthMaterial=!0;class n1 extends eq{constructor(e){super(),this.type="MeshDistanceMaterial",this.referencePosition=new P,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function n3(e,t,i){let n=new tZ,r=new _,a=new _,s=new E,o=new n0({depthPacking:3201}),l=new n1,h={},u=i.maxTextureSize,c={0:1,1:0,2:2},d=new tO({uniforms:{shadow_pass:{value:null},resolution:{value:new _},radius:{value:4},samples:{value:8}},vertexShader:"void main() {\n gl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\nuniform float samples;\n#include <packing>\nvoid main() {\n float mean = 0.0;\n float squared_mean = 0.0;\n float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n float uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n for ( float i = 0.0; i < samples; i ++ ) {\n float uvOffset = uvStart + i * uvStride;\n #ifdef HORIZONTAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean / samples;\n squared_mean = squared_mean / samples;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),p=d.clone();p.defines.HORIZONTAL_PASS=1;let m=new tm;m.setAttribute("position",new e2(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let f=new tI(m,d),g=this;function v(t,i,n,r,a,s,u){let d=null,p=!0===r.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(d=void 0!==p?p:!0===r.isPointLight?l:o,e.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0){let e=d.uuid,t=n.uuid,i=h[e];void 0===i&&(i={},h[e]=i);let r=i[t];void 0===r&&(r=d.clone(),i[t]=r),d=r}return d.visible=n.visible,d.wireframe=n.wireframe,d.side=3===u?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:c[n.side],d.alphaMap=n.alphaMap,d.alphaTest=n.alphaTest,d.clipShadows=n.clipShadows,d.clippingPlanes=n.clippingPlanes,d.clipIntersection=n.clipIntersection,d.displacementMap=n.displacementMap,d.displacementScale=n.displacementScale,d.displacementBias=n.displacementBias,d.wireframeLinewidth=n.wireframeLinewidth,d.linewidth=n.linewidth,!0===r.isPointLight&&!0===d.isMeshDistanceMaterial&&(d.referencePosition.setFromMatrixPosition(r.matrixWorld),d.nearDistance=a,d.farDistance=s),d}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(i,o,l){if(!1===g.enabled||!1===g.autoUpdate&&!1===g.needsUpdate||0===i.length)return;let h=e.getRenderTarget(),c=e.getActiveCubeFace(),m=e.getActiveMipmapLevel(),y=e.state;y.setBlending(0),y.buffers.color.setClear(1,1,1,1),y.buffers.depth.setTest(!0),y.setScissorTest(!1);for(let h=0,c=i.length;h<c;h++){let c=i[h],m=c.shadow;if(void 0===m){console.warn("THREE.WebGLShadowMap:",c,"has no shadow.");continue}if(!1===m.autoUpdate&&!1===m.needsUpdate)continue;r.copy(m.mapSize);let g=m.getFrameExtents();if(r.multiply(g),a.copy(m.mapSize),(r.x>u||r.y>u)&&(r.x>u&&(a.x=Math.floor(u/g.x),r.x=a.x*g.x,m.mapSize.x=a.x),r.y>u&&(a.y=Math.floor(u/g.y),r.y=a.y*g.y,m.mapSize.y=a.y)),null===m.map&&!m.isPointLightShadow&&3===this.type){let e={minFilter:1006,magFilter:1006,format:1023};m.map=new A(r.x,r.y,e),m.map.texture.name=c.name+".shadowMap",m.mapPass=new A(r.x,r.y,e),m.camera.updateProjectionMatrix()}if(null===m.map){let e={minFilter:1003,magFilter:1003,format:1023};m.map=new A(r.x,r.y,e),m.map.texture.name=c.name+".shadowMap",m.camera.updateProjectionMatrix()}e.setRenderTarget(m.map),e.clear();let x=m.getViewportCount();for(let i=0;i<x;i++){let r=m.getViewport(i);s.set(a.x*r.x,a.y*r.y,a.x*r.z,a.y*r.w),y.viewport(s),m.updateMatrices(c,i),n=m.getFrustum(),function i(r,a,s,o,l){if(!1===r.visible)return;if(r.layers.test(a.layers)&&(r.isMesh||r.isLine||r.isPoints)&&(r.castShadow||r.receiveShadow&&3===l)&&(!r.frustumCulled||n.intersectsObject(r))){r.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,r.matrixWorld);let i=t.update(r),n=r.material;if(Array.isArray(n)){let t=i.groups;for(let a=0,h=t.length;a<h;a++){let h=t[a],u=n[h.materialIndex];if(u&&u.visible){let t=v(r,0,u,o,s.near,s.far,l);e.renderBufferDirect(s,null,i,t,r,h)}}}else if(n.visible){let t=v(r,0,n,o,s.near,s.far,l);e.renderBufferDirect(s,null,i,t,r,null)}}let h=r.children;for(let e=0,t=h.length;e<t;e++)i(h[e],a,s,o,l)}(o,l,m.camera,c,this.type)}m.isPointLightShadow||3!==this.type||function(i,n){let r=t.update(f);d.uniforms.shadow_pass.value=i.map.texture,d.uniforms.resolution.value=i.mapSize,d.uniforms.radius.value=i.radius,d.uniforms.samples.value=i.blurSamples,e.setRenderTarget(i.mapPass),e.clear(),e.renderBufferDirect(n,null,r,d,f,null),p.uniforms.shadow_pass.value=i.mapPass.texture,p.uniforms.resolution.value=i.mapSize,p.uniforms.radius.value=i.radius,p.uniforms.samples.value=i.blurSamples,e.setRenderTarget(i.map),e.clear(),e.renderBufferDirect(n,null,r,p,f,null)}(m,l),m.needsUpdate=!1}g.needsUpdate=!1,e.setRenderTarget(h,c,m)}}
121function n2(e,t,i){let n=i.isWebGL2,r=new function(){let t=!1,i=new E,n=null,r=new E(0,0,0,0);return{setMask:function(i){n===i||t||(e.colorMask(i,i,i,i),n=i)},setLocked:function(e){t=e},setClear:function(t,n,a,s,o){!0===o&&(t*=s,n*=s,a*=s),i.set(t,n,a,s),!1===r.equals(i)&&(e.clearColor(t,n,a,s),r.copy(i))},reset:function(){t=!1,n=null,r.set(-1,0,0,0)}}},a=new function(){let t=!1,i=null,n=null,r=null;return{setTest:function(e){e?F(2929):O(2929)},setMask:function(n){i===n||t||(e.depthMask(n),i=n)},setFunc:function(t){if(n!==t){if(t)switch(t){case 0:e.depthFunc(512);break;case 1:e.depthFunc(519);break;case 2:e.depthFunc(513);break;case 3:default:e.depthFunc(515);break;case 4:e.depthFunc(514);break;case 5:e.depthFunc(518);break;case 6:e.depthFunc(516);break;case 7:e.depthFunc(517)}else e.depthFunc(515);n=t}},setLocked:function(e){t=e},setClear:function(t){r!==t&&(e.clearDepth(t),r=t)},reset:function(){t=!1,i=null,n=null,r=null}}},s=new function(){let t=!1,i=null,n=null,r=null,a=null,s=null,o=null,l=null,h=null;return{setTest:function(e){t||(e?F(2960):O(2960))},setMask:function(n){i===n||t||(e.stencilMask(n),i=n)},setFunc:function(t,i,s){n===t&&r===i&&a===s||(e.stencilFunc(t,i,s),n=t,r=i,a=s)},setOp:function(t,i,n){s===t&&o===i&&l===n||(e.stencilOp(t,i,n),s=t,o=i,l=n)},setLocked:function(e){t=e},setClear:function(t){h!==t&&(e.clearStencil(t),h=t)},reset:function(){t=!1,i=null,n=null,r=null,a=null,s=null,o=null,l=null,h=null}}},o={},l=null,h={},u=null,c=!1,d=null,p=null,m=null,f=null,g=null,v=null,y=null,x=!1,_=null,b=null,M=null,w=null,S=null,T=e.getParameter(35661),A=!1,L=e.getParameter(7938);-1!==L.indexOf("WebGL")?A=parseFloat(/^WebGL (\d)/.exec(L)[1])>=1:-1!==L.indexOf("OpenGL ES")&&(A=parseFloat(/^OpenGL ES (\d)/.exec(L)[1])>=2);let R=null,C={},P=e.getParameter(3088),I=e.getParameter(2978),D=(new E).fromArray(P),N=(new E).fromArray(I);function z(t,i,n){let r=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(let t=0;t<n;t++)e.texImage2D(i+t,0,6408,1,1,0,6408,5121,r);return a}let B={};function F(t){!0!==o[t]&&(e.enable(t),o[t]=!0)}function O(t){!1!==o[t]&&(e.disable(t),o[t]=!1)}B[3553]=z(3553,3553,1),B[34067]=z(34067,34069,6),r.setClear(0,0,0,1),a.setClear(1),s.setClear(0),F(2929),a.setFunc(3),k(!1),V(1),F(2884),G(0);let U={100:32774,101:32778,102:32779};if(n)U[103]=32775,U[104]=32776;else{let e=t.get("EXT_blend_minmax");null!==e&&(U[103]=e.MIN_EXT,U[104]=e.MAX_EXT)}let H={200:0,201:1,202:768,204:770,210:776,208:774,206:772,203:769,205:771,209:775,207:773};function G(t,i,n,r,a,s,o,l){if(0!==t){if(!1===c&&(F(3042),c=!0),5===t)a=a||i,s=s||n,o=o||r,i===p&&a===g||(e.blendEquationSeparate(U[i],U[a]),p=i,g=a),n===m&&r===f&&s===v&&o===y||(e.blendFuncSeparate(H[n],H[r],H[s],H[o]),m=n,f=r,v=s,y=o),d=t,x=null;else if(t!==d||l!==x){if(100===p&&100===g||(e.blendEquation(32774),p=100,g=100),l)switch(t){case 1:e.blendFuncSeparate(1,771,1,771);break;case 2:e.blendFunc(1,1);break;case 3:e.blendFuncSeparate(0,0,769,771);break;case 4:e.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case 1:e.blendFuncSeparate(770,771,1,771);break;case 2:e.blendFunc(770,1);break;case 3:e.blendFunc(0,769);break;case 4:e.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}m=null,f=null,v=null,y=null,d=t,x=l}}else!0===c&&(O(3042),c=!1)}function k(t){_!==t&&(t?e.frontFace(2304):e.frontFace(2305),_=t)}function V(t){0!==t?(F(2884),t!==b&&(1===t?e.cullFace(1029):2===t?e.cullFace(1028):e.cullFace(1032))):O(2884),b=t}function W(t,i,n){t?(F(32823),w===i&&S===n||(e.polygonOffset(i,n),w=i,S=n)):O(32823)}function j(t){void 0===t&&(t=33984+T-1),R!==t&&(e.activeTexture(t),R=t)}return{buffers:{color:r,depth:a,stencil:s},enable:F,disable:O,bindFramebuffer:function(t,i){return null===i&&null!==l&&(i=l),h[t]!==i&&(e.bindFramebuffer(t,i),h[t]=i,n&&(36009===t&&(h[36160]=i),36160===t&&(h[36009]=i)),!0)},bindXRFramebuffer:function(t){t!==l&&(e.bindFramebuffer(36160,t),l=t)},useProgram:function(t){return u!==t&&(e.useProgram(t),u=t,!0)},setBlending:G,setMaterial:function(e,t){2===e.side?O(2884):F(2884);let i=1===e.side;t&&(i=!i),k(i),1===e.blending&&!1===e.transparent?G(0):G(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),a.setFunc(e.depthFunc),a.setTest(e.depthTest),a.setMask(e.depthWrite),r.setMask(e.colorWrite);let n=e.stencilWrite;s.setTest(n),n&&(s.setMask(e.stencilWriteMask),s.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),s.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),W(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits),!0===e.alphaToCoverage?F(32926):O(32926)},setFlipSided:k,setCullFace:V,setLineWidth:function(t){t!==M&&(A&&e.lineWidth(t),M=t)},setPolygonOffset:W,setScissorTest:function(e){e?F(3089):O(3089)},activeTexture:j,bindTexture:function(t,i){null===R&&j();let n=C[R];void 0===n&&(n={type:void 0,texture:void 0},C[R]=n),n.type===t&&n.texture===i||(e.bindTexture(t,i||B[t]),n.type=t,n.texture=i)},unbindTexture:function(){let t=C[R];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(t){!1===D.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),D.copy(t))},viewport:function(t){!1===N.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),N.copy(t))},reset:function(){e.disable(3042),e.disable(2884),e.disable(2929),e.disable(32823),e.disable(3089),e.disable(2960),e.disable(32926),e.blendEquation(32774),e.blendFunc(1,0),e.blendFuncSeparate(1,0,1,0),e.colorMask(!0,!0,
121!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(513),e.clearDepth(1),e.stencilMask(0xffffffff),e.stencilFunc(519,0,0xffffffff),e.stencilOp(7680,7680,7680),e.clearStencil(0),e.cullFace(1029),e.frontFace(2305),e.polygonOffset(0,0),e.activeTexture(33984),e.bindFramebuffer(36160,null),!0===n&&(e.bindFramebuffer(36009,null),e.bindFramebuffer(36008,null)),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),o={},R=null,C={},l=null,h={},u=null,c=!1,d=null,p=null,m=null,f=null,g=null,v=null,y=null,x=!1,_=null,b=null,M=null,w=null,S=null,D.set(0,0,e.canvas.width,e.canvas.height),N.set(0,0,e.canvas.width,e.canvas.height),r.reset(),a.reset(),s.reset()}}}function n4(e,t,i,n,r,a,s){let o=r.isWebGL2,l=r.maxTextures,h=r.maxCubemapSize,u=r.maxTextureSize,c=r.maxSamples,d=new WeakMap,p,m=!1;try{m="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function f(e,t){return m?new OffscreenCanvas(e,t):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function v(e,t,i,n){let r=1;if((e.width>n||e.height>n)&&(r=n/Math.max(e.width,e.height)),r<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){let n=t?y:Math.floor,a=n(r*e.width),s=n(r*e.height);void 0===p&&(p=f(a,s));let o=i?f(a,s):p;return o.width=a,o.height=s,o.getContext("2d").drawImage(e,0,0,a,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+a+"x"+s+")."),o}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function x(e){return g(e.width)&&g(e.height)}function _(e,t){return e.generateMipmaps&&t&&1003!==e.minFilter&&1006!==e.minFilter}function b(t,i,r,a,s=1){e.generateMipmap(t),n.get(i).__maxMipLevel=Math.log2(Math.max(r,a,s))}function M(i,n,r){if(!1===o)return n;if(null!==i){if(void 0!==e[i])return e[i];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+i+"'")}let a=n;return 6403===n&&(5126===r&&(a=33326),5131===r&&(a=33325),5121===r&&(a=33321)),6407===n&&(5126===r&&(a=34837),5131===r&&(a=34843),5121===r&&(a=32849)),6408===n&&(5126===r&&(a=34836),5131===r&&(a=34842),5121===r&&(a=32856)),33325!==a&&33326!==a&&34842!==a&&34836!==a||t.get("EXT_color_buffer_float"),a}function w(e){return 1003===e||1004===e||1005===e?9728:9729}function S(t){let i=t.target;i.removeEventListener("dispose",S),function(t){let i=n.get(t);void 0!==i.__webglInit&&(e.deleteTexture(i.__webglTexture),n.remove(t))}(i),i.isVideoTexture&&d.delete(i),s.memory.textures--}function T(t){let i=t.target;i.removeEventListener("dispose",T),function(t){let i=t.texture,r=n.get(t),a=n.get(i);if(t){if(void 0!==a.__webglTexture&&(e.deleteTexture(a.__webglTexture),s.memory.textures--),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++)e.deleteFramebuffer(r.__webglFramebuffer[t]),r.__webglDepthbuffer&&e.deleteRenderbuffer(r.__webglDepthbuffer[t]);else e.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&e.deleteRenderbuffer(r.__webglDepthbuffer),r.__webglMultisampledFramebuffer&&e.deleteFramebuffer(r.__webglMultisampledFramebuffer),r.__webglColorRenderbuffer&&e.deleteRenderbuffer(r.__webglColorRenderbuffer),r.__webglDepthRenderbuffer&&e.deleteRenderbuffer(r.__webglDepthRenderbuffer);if(t.isWebGLMultipleRenderTargets)for(let t=0,r=i.length;t<r;t++){let r=n.get(i[t]);r.__webglTexture&&(e.deleteTexture(r.__webglTexture),s.memory.textures--),n.remove(i[t])}n.remove(i),n.remove(t)}}(i)}let E=0;function A(e,t){let r=n.get(e);if(e.isVideoTexture&&function(e){let t=s.render.frame;d.get(e)!==t&&(d.set(e,t),e.update())}(e),e.version>0&&r.__version!==e.version){let i=e.image;if(void 0===i)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==i.complete)return void D(r,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}i.activeTexture(33984+t),i.bindTexture(3553,r.__webglTexture)}function L(t,r){let s=n.get(t);t.version>0&&s.__version!==t.version?function(t,n,r){let s;if(6!==n.image.length)return;I(t,n),i.activeTexture(33984+r),i.bindTexture(34067,t.__webglTexture),e.pixelStorei(37440,n.flipY),e.pixelStorei(37441,n.premultiplyAlpha),e.pixelStorei(3317,n.unpackAlignment),e.pixelStorei(37443,0);let l=n&&(n.isCompressedTexture||n.image[0].isCompressedTexture),u=n.image[0]&&n.image[0].isDataTexture,c=[];for(let e=0;e<6;e++)c[e]=l||u?u?n.image[e].image:n.image[e]:v(n.image[e],!1,!0,h);let d=c[0],p=x(d)||o,m=a.convert(n.format),f=a.convert(n.type),g=M(n.internalFormat,m,f);if(P(34067,n,p),l){for(let e=0;e<6;e++){s=c[e].mipmaps;for(let t=0;t<s.length;t++){let r=s[t];1023!==n.format&&1022!==n.format?null!==m?i.compressedTexImage2D(34069+e,t,g,r.width,r.height,0,r.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):i.texImage2D(34069+e,t,g,r.width,r.height,0,m,f,r.data)}}t.__maxMipLevel=s.length-1}else{s=n.mipmaps;for(let e=0;e<6;e++)if(u){i.texImage2D(34069+e,0,g,c[e].width,c[e].height,0,m,f,c[e].data);for(let t=0;t<s.length;t++){let n=s[t].image[e].image;i.texImage2D(34069+e,t+1,g,n.width,n.height,0,m,f,n.data)}}else{i.texImage2D(34069+e,0,g,m,f,c[e]);for(let t=0;t<s.length;t++){let n=s[t];i.texImage2D(34069+e,t+1,g,m,f,n.image[e])}}t.__maxMipLevel=s.length}_(n,p)&&b(34067,n,d.width,d.height),t.__version=n.version,n.onUp
121date&&n.onUpdate(n)}(s,t,r):(i.activeTexture(33984+r),i.bindTexture(34067,s.__webglTexture))}let R={1e3:10497,1001:33071,1002:33648},C={1003:9728,1004:9984,1005:9986,1006:9729,1007:9985,1008:9987};function P(i,a,s){if(s?(e.texParameteri(i,10242,R[a.wrapS]),e.texParameteri(i,10243,R[a.wrapT]),32879!==i&&35866!==i||e.texParameteri(i,32882,R[a.wrapR]),e.texParameteri(i,10240,C[a.magFilter]),e.texParameteri(i,10241,C[a.minFilter])):(e.texParameteri(i,10242,33071),e.texParameteri(i,10243,33071),32879!==i&&35866!==i||e.texParameteri(i,32882,33071),1001===a.wrapS&&1001===a.wrapT||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(i,10240,w(a.magFilter)),e.texParameteri(i,10241,w(a.minFilter)),1003!==a.minFilter&&1006!==a.minFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),!0===t.has("EXT_texture_filter_anisotropic")){let s=t.get("EXT_texture_filter_anisotropic");(1015!==a.type||!1!==t.has("OES_texture_float_linear"))&&(!1!==o||1016!==a.type||!1!==t.has("OES_texture_half_float_linear"))&&(a.anisotropy>1||n.get(a).__currentAnisotropy)&&(e.texParameterf(i,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,r.getMaxAnisotropy())),n.get(a).__currentAnisotropy=a.anisotropy)}}function I(t,i){void 0===t.__webglInit&&(t.__webglInit=!0,i.addEventListener("dispose",S),t.__webglTexture=e.createTexture(),s.memory.textures++)}function D(t,n,r){let s=3553;n.isDataTexture2DArray&&(s=35866),n.isDataTexture3D&&(s=32879),I(t,n),i.activeTexture(33984+r),i.bindTexture(s,t.__webglTexture),e.pixelStorei(37440,n.flipY),e.pixelStorei(37441,n.premultiplyAlpha),e.pixelStorei(3317,n.unpackAlignment),e.pixelStorei(37443,0);let l=!o&&(1001!==n.wrapS||1001!==n.wrapT||1003!==n.minFilter&&1006!==n.minFilter)&&!1===x(n.image),h=v(n.image,l,!1,u),c=x(h)||o,d=a.convert(n.format),p,m=a.convert(n.type),f=M(n.internalFormat,d,m);P(s,n,c);let g=n.mipmaps;if(n.isDepthTexture)f=6402,o?f=1015===n.type?36012:1014===n.type?33190:1020===n.type?35056:33189:1015===n.type&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),1026===n.format&&6402===f&&1012!==n.type&&1014!==n.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=1012,m=a.convert(n.type)),1027===n.format&&6402===f&&(f=34041,1020!==n.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=1020,m=a.convert(n.type))),i.texImage2D(3553,0,f,h.width,h.height,0,d,m,null);else if(n.isDataTexture){if(g.length>0&&c){for(let e=0,t=g.length;e<t;e++)p=g[e],i.texImage2D(3553,e,f,p.width,p.height,0,d,m,p.data);n.generateMipmaps=!1,t.__maxMipLevel=g.length-1}else i.texImage2D(3553,0,f,h.width,h.height,0,d,m,h.data),t.__maxMipLevel=0}else if(n.isCompressedTexture){for(let e=0,t=g.length;e<t;e++)p=g[e],1023!==n.format&&1022!==n.format?null!==d?i.compressedTexImage2D(3553,e,f,p.width,p.height,0,p.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):i.texImage2D(3553,e,f,p.width,p.height,0,d,m,p.data);t.__maxMipLevel=g.length-1}else if(n.isDataTexture2DArray)i.texImage3D(35866,0,f,h.width,h.height,h.depth,0,d,m,h.data),t.__maxMipLevel=0;else if(n.isDataTexture3D)i.texImage3D(32879,0,f,h.width,h.height,h.depth,0,d,m,h.data),t.__maxMipLevel=0;else if(g.length>0&&c){for(let e=0,t=g.length;e<t;e++)p=g[e],i.texImage2D(3553,e,f,d,m,p);n.generateMipmaps=!1,t.__maxMipLevel=g.length-1}else i.texImage2D(3553,0,f,d,m,h),t.__maxMipLevel=0;_(n,c)&&b(s,n,h.width,h.height),t.__version=n.version,n.onUpdate&&n.onUpdate(n)}function N(t,r,s,o,l){let h=a.convert(s.format),u=a.convert(s.type),c=M(s.internalFormat,h,u);32879===l||35866===l?i.texImage3D(l,0,c,r.width,r.height,r.depth,0,h,u,null):i.texImage2D(l,0,c,r.width,r.height,0,h,u,null),i.bindFramebuffer(36160,t),e.framebufferTexture2D(36160,o,l,n.get(s).__webglTexture,0),i.bindFramebuffer(36160,null)}function z(t,i,n){if(e.bindRenderbuffer(36161,t),i.depthBuffer&&!i.stencilBuffer){let r=33189;if(n){let t=i.depthTexture;t&&t.isDepthTexture&&(1015===t.type?r=36012:1014===t.type&&(r=33190));let n=B(i);e.renderbufferStorageMultisample(36161,n,r,i.width,i.height)}else e.renderbufferStorage(36161,r,i.width,i.height);e.framebufferRenderbuffer(36160,36096,36161,t)}else if(i.depthBuffer&&i.stencilBuffer){if(n){let t=B(i);e.renderbufferStorageMultisample(36161,t,35056,i.width,i.height)}else e.renderbufferStorage(36161,34041,i.width,i.height);e.framebufferRenderbuffer(36160,33306,36161,t)}
121else{let t=!0===i.isWebGLMultipleRenderTargets?i.texture[0]:i.texture,r=a.convert(t.format),s=a.convert(t.type),o=M(t.internalFormat,r,s);if(n){let t=B(i);e.renderbufferStorageMultisample(36161,t,o,i.width,i.height)}else e.renderbufferStorage(36161,o,i.width,i.height)}e.bindRenderbuffer(36161,null)}function B(e){return o&&e.isWebGLMultisampleRenderTarget?Math.min(c,e.samples):0}let F=!1,O=!1;this.allocateTextureUnit=function(){let e=E;return e>=l&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+l),E+=1,e},this.resetTextureUnits=function(){E=0},this.setTexture2D=A,this.setTexture2DArray=function(e,t){let r=n.get(e);e.version>0&&r.__version!==e.version?D(r,e,t):(i.activeTexture(33984+t),i.bindTexture(35866,r.__webglTexture))},this.setTexture3D=function(e,t){let r=n.get(e);e.version>0&&r.__version!==e.version?D(r,e,t):(i.activeTexture(33984+t),i.bindTexture(32879,r.__webglTexture))},this.setTextureCube=L,this.setupRenderTarget=function(t){let l=t.texture,h=n.get(t),u=n.get(l);t.addEventListener("dispose",T),!0!==t.isWebGLMultipleRenderTargets&&(u.__webglTexture=e.createTexture(),u.__version=l.version,s.memory.textures++);let c=!0===t.isWebGLCubeRenderTarget,d=!0===t.isWebGLMultipleRenderTargets,p=!0===t.isWebGLMultisampleRenderTarget,m=l.isDataTexture3D||l.isDataTexture2DArray,f=x(t)||o;if(o&&1022===l.format&&(1015===l.type||1016===l.type)&&(l.format=1023,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),c){h.__webglFramebuffer=[];for(let t=0;t<6;t++)h.__webglFramebuffer[t]=e.createFramebuffer()}else if(h.__webglFramebuffer=e.createFramebuffer(),d){if(r.drawBuffers){let i=t.texture;for(let t=0,r=i.length;t<r;t++){let r=n.get(i[t]);void 0===r.__webglTexture&&(r.__webglTexture=e.createTexture(),s.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.")}else if(p){if(o){h.__webglMultisampledFramebuffer=e.createFramebuffer(),h.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,h.__webglColorRenderbuffer);let n=a.convert(l.format),r=a.convert(l.type),s=M(l.internalFormat,n,r),o=B(t);e.renderbufferStorageMultisample(36161,o,s,t.width,t.height),i.bindFramebuffer(36160,h.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,h.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),t.depthBuffer&&(h.__webglDepthRenderbuffer=e.createRenderbuffer(),z(h.__webglDepthRenderbuffer,t,!0)),i.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")}if(c){i.bindTexture(34067,u.__webglTexture),P(34067,l,f);for(let e=0;e<6;e++)N(h.__webglFramebuffer[e],t,l,36064,34069+e);_(l,f)&&b(34067,l,t.width,t.height),i.unbindTexture()}else if(d){let e=t.texture;for(let r=0,a=e.length;r<a;r++){let a=e[r],s=n.get(a);i.bindTexture(3553,s.__webglTexture),P(3553,a,f),N(h.__webglFramebuffer,t,a,36064+r,3553),_(a,f)&&b(3553,a,t.width,t.height)}i.unbindTexture()}else{let e=3553;m&&(o?e=l.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),i.bindTexture(e,u.__webglTexture),P(e,l,f),N(h.__webglFramebuffer,t,l,36064,e),_(l,f)&&b(e,l,t.width,t.height,t.depth),i.unbindTexture()}t.depthBuffer&&function(t){let r=n.get(t),a=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture){if(a)throw Error("target.depthTexture not supported in Cube render targets");!function(t,r){if(r&&r.isWebGLCubeRenderTarget)throw Error("Depth Texture with cube render targets is not supported");if(i.bindFramebuffer(36160,t),!r.depthTexture||!r.depthTexture.isDepthTexture)throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(r.depthTexture).__webglTexture&&r.depthTexture.image.width===r.width&&r.depthTexture.image.height===r.height||(r.depthTexture.image.width=r.width,r.depthTexture.image.height=r.height,r.depthTexture.needsUpdate=!0),A(r.depthTexture,0);let a=n.get(r.depthTexture).__webglTexture;if(1026===r.depthTexture.format)e.framebufferTexture2D(36160,36096,3553,a,0);else{if(1027!==r.depthTexture.format)throw Error("Unknown depthTexture format");e.framebufferTexture2D(36160,33306,3553,a,0)}}(r.__webglFramebuffer,t)}else if(a){r.__webglDepthbuffer=[];for(let n=0;n<6;n++)i.bindFramebuffer(36160,r.__webglFramebuffer[n]),r.__webglDepthbuffer[n]=e.createRenderbuffer(),z(r.__webglDepthbuffer[n],t,!1)}else i.bindFramebuffer(36160,r.__webglFramebuffer),r.__webglDepthbuffer=e.createRenderbuffer(),z(r.__webglDepthbuffer,t,!1);i.bindFramebuffer(36160,null)}(t)},this.updateRenderTargetMipmap=function(e){let t=x(e)||o,r=!0===e.isWebGLMultipleRenderTargets?e.texture:[e.texture];for(let a=0,s=r.length;a<s;a++){let s=r[a];
121if(_(s,t)){let t=e.isWebGLCubeRenderTarget?34067:3553,r=n.get(s).__webglTexture;i.bindTexture(t,r),b(t,s,e.width,e.height),i.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget){if(o){let r=t.width,a=t.height,s=16384;t.depthBuffer&&(s|=256),t.stencilBuffer&&(s|=1024);let o=n.get(t);i.bindFramebuffer(36008,o.__webglMultisampledFramebuffer),i.bindFramebuffer(36009,o.__webglFramebuffer),e.blitFramebuffer(0,0,r,a,0,0,r,a,s,9728),i.bindFramebuffer(36008,null),i.bindFramebuffer(36009,o.__webglMultisampledFramebuffer)}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),A(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLCubeRenderTarget&&(!1===O&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),O=!0),e=e.texture),L(e,t)}}function n5(e,t,i){let n=i.isWebGL2;return{convert:function(e){let i;if(1009===e)return 5121;if(1017===e)return 32819;if(1018===e)return 32820;if(1019===e)return 33635;if(1010===e)return 5120;if(1011===e)return 5122;if(1012===e)return 5123;if(1013===e)return 5124;if(1014===e)return 5125;if(1015===e)return 5126;if(1016===e)return n?5131:null!==(i=t.get("OES_texture_half_float"))?i.HALF_FLOAT_OES:null;if(1021===e)return 6406;if(1022===e)return 6407;if(1023===e)return 6408;if(1024===e)return 6409;if(1025===e)return 6410;if(1026===e)return 6402;if(1027===e)return 34041;if(1028===e)return 6403;if(1029===e)return 36244;if(1030===e)return 33319;if(1031===e)return 33320;if(1032===e)return 36248;if(1033===e)return 36249;if(33776===e||33777===e||33778===e||33779===e){if(null===(i=t.get("WEBGL_compressed_texture_s3tc")))return null;if(33776===e)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===e)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===e)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===e)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===e||35841===e||35842===e||35843===e){if(null===(i=t.get("WEBGL_compressed_texture_pvrtc")))return null;if(35840===e)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===e)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===e)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===e)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===e)return null!==(i=t.get("WEBGL_compressed_texture_etc1"))?i.COMPRESSED_RGB_ETC1_WEBGL:null;if((37492===e||37496===e)&&null!==(i=t.get("WEBGL_compressed_texture_etc"))){if(37492===e)return i.COMPRESSED_RGB8_ETC2;if(37496===e)return i.COMPRESSED_RGBA8_ETC2_EAC}return 37808===e||37809===e||37810===e||37811===e||37812===e||37813===e||37814===e||37815===e||37816===e||37817===e||37818===e||37819===e||37820===e||37821===e||37840===e||37841===e||37842===e||37843===e||37844===e||37845===e||37846===e||37847===e||37848===e||37849===e||37850===e||37851===e||37852===e||37853===e?null!==(i=t.get("WEBGL_compressed_texture_astc"))?e:null:36492===e?null!==(i=t.get("EXT_texture_compression_bptc"))?e:null:1020===e?n?34042:null!==(i=t.get("WEBGL_depth_texture"))?i.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}n1.prototype.isMeshDistanceMaterial=!0;class n6 extends tH{constructor(e=[]){super(),this.cameras=e}}n6.prototype.isArrayCamera=!0;class n8 extends eD{constructor(){super(),this.type="Group"}}n8.prototype.isGroup=!0;let n7={type:"move"};class n9{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new n8,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new n8,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new P,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new P),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new n8,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new P,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new P),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,i){let n=null,r=null,a=null,s=this._targetRay,o=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(null!==s&&null!==(n=t.getPose(e.targetRaySpace,i))&&(s.matrix.fromArray(n.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),n.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(n.linearVelocity)):s.hasLinearVelocity=!1,n.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(n.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(n7)),l&&e.hand){for(let n of(a=!0,e.hand.values())
121){let e=t.getJointPose(n,i);if(void 0===l.joints[n.jointName]){let e=new n8;e.matrixAutoUpdate=!1,e.visible=!1,l.joints[n.jointName]=e,l.add(e)}let r=l.joints[n.jointName];null!==e&&(r.matrix.fromArray(e.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.jointRadius=e.radius),r.visible=null!==e}let n=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],s=n.position.distanceTo(r.position);l.inputState.pinching&&s>.025?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&s<=.015&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&e.gripSpace&&null!==(r=t.getPose(e.gripSpace,i))&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1)}return null!==s&&(s.visible=null!==n),null!==o&&(o.visible=null!==r),null!==l&&(l.visible=null!==a),this}}class re extends o{constructor(e,t){super();let i=this,n=e.state,r=null,a=1,s=null,o="local-floor",l=null,h=null,u=null,c=null,d=null,p=!1,m=null,f=null,g=null,v=null,y=null,x=null,_=[],b=new Map,M=new tH;M.layers.enable(1),M.viewport=new E;let w=new tH;w.layers.enable(2),w.viewport=new E;let S=[M,w],T=new n6;T.layers.enable(1),T.layers.enable(2);let A=null,L=null;function R(e){let t=b.get(e.inputSource);t&&t.dispatchEvent({type:e.type,data:e.inputSource})}function C(){b.forEach(function(e,t){e.disconnect(t)}),b.clear(),A=null,L=null,n.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),u&&t.deleteFramebuffer(u),m&&t.deleteFramebuffer(m),f&&t.deleteRenderbuffer(f),g&&t.deleteRenderbuffer(g),u=null,m=null,f=null,g=null,d=null,c=null,h=null,r=null,F.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}function I(e){let t=r.inputSources;for(let e=0;e<_.length;e++)b.set(t[e],_[e]);for(let t=0;t<e.removed.length;t++){let i=e.removed[t],n=b.get(i);n&&(n.dispatchEvent({type:"disconnected",data:i}),b.delete(i))}for(let t=0;t<e.added.length;t++){let i=e.added[t],n=b.get(i);n&&n.dispatchEvent({type:"connected",data:i})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=_[e];return void 0===t&&(t=new n9,_[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=_[e];return void 0===t&&(t=new n9,_[e]=t),t.getGripSpace()},this.getHand=function(e){let t=_[e];return void 0===t&&(t=new n9,_[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){a=e,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){o=e,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return s},this.getBaseLayer=function(){return null!==c?c:d},this.getBinding=function(){return h},this.getFrame=function(){return v},this.getSession=function(){return r},this.setSession=async function(e){if(null!==(r=e)){r.addEventListener("select",R),r.addEventListener("selectstart",R),r.addEventListener("selectend",R),r.addEventListener("squeeze",R),r.addEventListener("squeezestart",R),r.addEventListener("squeezeend",R),r.addEventListener("end",C),r.addEventListener("inputsourceschange",I);let e=t.getContextAttributes();if(!0!==e.xrCompatible&&await t.makeXRCompatible(),void 0===r.renderState.layers){let i={antialias:e.antialias,alpha:e.alpha,depth:e.depth,stencil:e.stencil,framebufferScaleFactor:a};d=new XRWebGLLayer(r,t,i),r.updateRenderState({baseLayer:d})}else if(t instanceof WebGLRenderingContext){let i={antialias:!0,alpha:e.alpha,depth:e.depth,stencil:e.stencil,framebufferScaleFactor:a};d=new XRWebGLLayer(r,t,i),r.updateRenderState({layers:[d]})}else{p=e.antialias;let i=null;e.depth&&(x=256,e.stencil&&(x|=1024),y=e.stencil?33306:36096,i=e.stencil?35056:33190);let s={colorFormat:e.alpha?32856:32849,depthFormat:i,scaleFactor:a};c=(h=new XRWebGLBinding(r,t)).createProjectionLayer(s),u=t.createFramebuffer(),r.updateRenderState({layers:[c]}),p&&(m=t.createFramebuffer(),f=t.createRenderbuffer(),t.bindRenderbuffer(36161,f),t.renderbufferStorageMultisample(36161,4,32856,c.textureWidth,c.textureHeight),n.bindFramebuffer(36160,m),t.framebufferRenderbuffer(36160,36064,36161,f),t.bindRenderbuffer(36161,null),null!==i&&(g=t.createRenderbuffer(),t.bindRenderbuffer(36161,g),t.renderbufferStorageMultisample(36161,4,i,c.textureWidth,c.textureHeight),t.framebufferRenderbuffer(36160,y,36161,g),t.bindRenderbuffer(36161,null)),n.bindFramebuffer(36160,null))}s=await r.requestReferenceSpace(o),F.setContext(r),F.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};let D=new P,N=new P;function z(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null===r)return;T.near=w.near=M.near=e.near,T.far=w.far=M.far=e.far,A===T.near&&L===T.far||(r.updateRenderState({depthNear:T.near,depthFar:T.far}),A=T.near,L=T.far);let t=e.parent,i=T.cameras;z(T,t);for(let e=0;e<i.length;e++)z(i[e],t);T.matrixWorld.decompose(T.position,T.quaternion,T.scale),e.position.copy(T.position),e.quaternion.copy(T.quaternion),e.scale.copy(T.scale),e.matrix.copy(T.matrix),e.matrixWorld.copy(T.matrixWorld);let n=e.children;for(let e=0,t=n.length;e<t;e++)n[e].updateMatrixWorld(!0);2===i.length?function(e,t,i){D.setFromMatrixPosition(t.matrixWorld),N.setFromMatrixPosition(i.matrixWorld);let n=D.distanceTo(N),r=t.projectionMatrix.elements,a=i.projectionMatrix.elements,s=r[14]/(r[10]-1),o=r[14]/(r[10]+1),l=(r[9]+1)/r[5],h=(r[9]-1)/r[5],u=(r[8]-1)/r[0],c=(a[8]+1)/a[0],d=n/(-u+c),p=-(d*u);t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(p),e.translateZ(d),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert();let m=s+d,f=o+d;e.projectionMatrix.makePerspective(s*u-p,s*c+(n-p),l*o/f*m,h*o/f*m,m,f)}(T,M,w):T.projectionMatrix.copy(M.projectionMatrix)},this.getCamera=function(){return T},this.getFoveation=function(){return null!==c?c.fixedFoveation:null!==d?d.fixedFoveation:void 0},this.setFoveation=function(e){null!==c&&(c.fixedFoveation=e),null!==d&&void 0!==d.fixedFoveation&&(d.fixedFoveation=e)};let B=null,F=new tQ;F.setAnimationLoop(function(e,i){if(l=i.getViewerPose(s),v=i,null!==l){let e=l.views;null!==d&&n.bindXRFramebuffer(d.framebuffer);let i=!1;e.length!==T.cameras.length&&(T.cameras.length=0,i=!0);for(let r=0;r<e.length;r++){let a=e[r],s=null;if(null!==d)s=d.getViewport(a);else{let e=h.getViewSubImage(c,a);n.bindXRFramebuffer(u),void 0!==e.depthStencilTexture&&t.framebufferTexture2D(36160,y,3553,e.depthStencilTexture,0),t.framebufferTexture2D(36160,36064,3553,e.colorTexture,0),s=e.viewport}let o=S[r];o.matrix.fromArray(a.transform.matrix),o.projectionMatrix.fromArray(a.projectionMatrix),o.viewport.set(s.x,s.y,s.width,s.height),0===r&&T.matrix.copy(o.matrix),!0===i&&T.cameras.push(o)}
121p&&(n.bindXRFramebuffer(m),null!==x&&t.clear(x))}let a=r.inputSources;for(let e=0;e<_.length;e++){let t=_[e],n=a[e];t.update(n,i,s)}if(B&&B(e,i),p){let e=c.textureWidth,i=c.textureHeight;n.bindFramebuffer(36008,m),n.bindFramebuffer(36009,u),t.invalidateFramebuffer(36008,[y]),t.invalidateFramebuffer(36009,[y]),t.blitFramebuffer(0,0,e,i,0,0,e,i,16384,9728),t.invalidateFramebuffer(36008,[36064]),n.bindFramebuffer(36008,null),n.bindFramebuffer(36009,null),n.bindFramebuffer(36160,m)}v=null}),this.setAnimationLoop=function(e){B=e},this.dispose=function(){}}}function rt(e){function t(t,i){let n,r;t.opacity.value=i.opacity,i.color&&t.diffuse.value.copy(i.color),i.emissive&&t.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(t.map.value=i.map),i.alphaMap&&(t.alphaMap.value=i.alphaMap),i.specularMap&&(t.specularMap.value=i.specularMap),i.alphaTest>0&&(t.alphaTest.value=i.alphaTest);let a=e.get(i).envMap;if(a){t.envMap.value=a,t.flipEnvMap.value=a.isCubeTexture&&!1===a.isRenderTargetTexture?-1:1,t.reflectivity.value=i.reflectivity,t.ior.value=i.ior,t.refractionRatio.value=i.refractionRatio;let n=e.get(a).__maxMipLevel;void 0!==n&&(t.maxMipLevel.value=n)}i.lightMap&&(t.lightMap.value=i.lightMap,t.lightMapIntensity.value=i.lightMapIntensity),i.aoMap&&(t.aoMap.value=i.aoMap,t.aoMapIntensity.value=i.aoMapIntensity),i.map?n=i.map:i.specularMap?n=i.specularMap:i.displacementMap?n=i.displacementMap:i.normalMap?n=i.normalMap:i.bumpMap?n=i.bumpMap:i.roughnessMap?n=i.roughnessMap:i.metalnessMap?n=i.metalnessMap:i.alphaMap?n=i.alphaMap:i.emissiveMap?n=i.emissiveMap:i.clearcoatMap?n=i.clearcoatMap:i.clearcoatNormalMap?n=i.clearcoatNormalMap:i.clearcoatRoughnessMap?n=i.clearcoatRoughnessMap:i.specularIntensityMap?n=i.specularIntensityMap:i.specularTintMap?n=i.specularTintMap:i.transmissionMap?n=i.transmissionMap:i.thicknessMap&&(n=i.thicknessMap),void 0!==n&&(n.isWebGLRenderTarget&&(n=n.texture),!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix)),i.aoMap?r=i.aoMap:i.lightMap&&(r=i.lightMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),t.uv2Transform.value.copy(r.matrix))}function i(t,i){t.roughness.value=i.roughness,t.metalness.value=i.metalness,i.roughnessMap&&(t.roughnessMap.value=i.roughnessMap),i.metalnessMap&&(t.metalnessMap.value=i.metalnessMap),i.emissiveMap&&(t.emissiveMap.value=i.emissiveMap),i.bumpMap&&(t.bumpMap.value=i.bumpMap,t.bumpScale.value=i.bumpScale,1===i.side&&(t.bumpScale.value*=-1)),i.normalMap&&(t.normalMap.value=i.normalMap,t.normalScale.value.copy(i.normalScale),1===i.side&&t.normalScale.value.negate()),i.displacementMap&&(t.displacementMap.value=i.displacementMap,t.displacementScale.value=i.displacementScale,t.displacementBias.value=i.displacementBias),e.get(i).envMap&&(t.envMapIntensity.value=i.envMapIntensity)}return{refreshFogUniforms: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)},refreshMaterialUniforms:function(e,n,r,a,s){let o,l;n.isMeshBasicMaterial?t(e,n):n.isMeshLambertMaterial?(t(e,n),n.emissiveMap&&(e.emissiveMap.value=n.emissiveMap)):n.isMeshToonMaterial?(t(e,n),n.gradientMap&&(e.gradientMap.value=n.gradientMap),n.emissiveMap&&(e.emissiveMap.value=n.emissiveMap),n.bumpMap&&(e.bumpMap.value=n.bumpMap,e.bumpScale.value=n.bumpScale,1===n.side&&(e.bumpScale.value*=-1)),n.normalMap&&(e.normalMap.value=n.normalMap,e.normalScale.value.copy(n.normalScale),1===n.side&&e.normalScale.value.negate()),n.displacementMap&&(e.displacementMap.value=n.displacementMap,e.displacementScale.value=n.displacementScale,e.displacementBias.value=n.displacementBias)):n.isMeshPhongMaterial?(t(e,n),e.specular.value.copy(n.specular),e.shininess.value=Math.max(n.shininess,1e-4),n.emissiveMap&&(e.emissiveMap.value=n.emissiveMap),n.bumpMap&&(e.bumpMap.value=n.bumpMap,e.bumpScale.value=n.bumpScale,1===n.side&&(e.bumpScale.value*=-1)),n.normalMap&&(e.normalMap.value=n.normalMap,e.normalScale.value.copy(n.normalScale),1===n.side&&e.normalScale.value.negate()),n.displacementMap&&(e.displacementMap.value=n.displacementMap,e.displacementScale.value=n.displacementScale,e.displacementBias.value=n.displacementBias)):n.isMeshStandardMaterial?(t(e,n),n.isMeshPhysicalMaterial?(i(e,n),e.ior.value=n.ior,n.sheenTint&&e.sheenTint.value.copy(n.sheenTint),n.clearcoat>0&&(e.clearcoat.value=n.clearcoat,e.clearcoatRoughness.value=n.clearcoatRoughness,n.clearcoatMap&&(e.clearcoatMap.value=n.clearcoatMap),n.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=n.clearcoatRoughnessMap),n.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(n.
121clearcoatNormalScale),e.clearcoatNormalMap.value=n.clearcoatNormalMap,1===n.side&&e.clearcoatNormalScale.value.negate())),n.transmission>0&&(e.transmission.value=n.transmission,e.transmissionSamplerMap.value=s.texture,e.transmissionSamplerSize.value.set(s.width,s.height),n.transmissionMap&&(e.transmissionMap.value=n.transmissionMap),e.thickness.value=n.thickness,n.thicknessMap&&(e.thicknessMap.value=n.thicknessMap),e.attenuationDistance.value=n.attenuationDistance,e.attenuationTint.value.copy(n.attenuationTint)),e.specularIntensity.value=n.specularIntensity,e.specularTint.value.copy(n.specularTint),n.specularIntensityMap&&(e.specularIntensityMap.value=n.specularIntensityMap),n.specularTintMap&&(e.specularTintMap.value=n.specularTintMap)):i(e,n)):n.isMeshMatcapMaterial?(t(e,n),n.matcap&&(e.matcap.value=n.matcap),n.bumpMap&&(e.bumpMap.value=n.bumpMap,e.bumpScale.value=n.bumpScale,1===n.side&&(e.bumpScale.value*=-1)),n.normalMap&&(e.normalMap.value=n.normalMap,e.normalScale.value.copy(n.normalScale),1===n.side&&e.normalScale.value.negate()),n.displacementMap&&(e.displacementMap.value=n.displacementMap,e.displacementScale.value=n.displacementScale,e.displacementBias.value=n.displacementBias)):n.isMeshDepthMaterial?(t(e,n),n.displacementMap&&(e.displacementMap.value=n.displacementMap,e.displacementScale.value=n.displacementScale,e.displacementBias.value=n.displacementBias)):n.isMeshDistanceMaterial?(t(e,n),n.displacementMap&&(e.displacementMap.value=n.displacementMap,e.displacementScale.value=n.displacementScale,e.displacementBias.value=n.displacementBias),e.referencePosition.value.copy(n.referencePosition),e.nearDistance.value=n.nearDistance,e.farDistance.value=n.farDistance):n.isMeshNormalMaterial?(t(e,n),n.bumpMap&&(e.bumpMap.value=n.bumpMap,e.bumpScale.value=n.bumpScale,1===n.side&&(e.bumpScale.value*=-1)),n.normalMap&&(e.normalMap.value=n.normalMap,e.normalScale.value.copy(n.normalScale),1===n.side&&e.normalScale.value.negate()),n.displacementMap&&(e.displacementMap.value=n.displacementMap,e.displacementScale.value=n.displacementScale,e.displacementBias.value=n.displacementBias)):n.isLineBasicMaterial?(e.diffuse.value.copy(n.color),e.opacity.value=n.opacity,n.isLineDashedMaterial&&(e.dashSize.value=n.dashSize,e.totalSize.value=n.dashSize+n.gapSize,e.scale.value=n.scale)):n.isPointsMaterial?(e.diffuse.value.copy(n.color),e.opacity.value=n.opacity,e.size.value=n.size*r,e.scale.value=.5*a,n.map&&(e.map.value=n.map),n.alphaMap&&(e.alphaMap.value=n.alphaMap),n.alphaTest>0&&(e.alphaTest.value=n.alphaTest),n.map?o=n.map:n.alphaMap&&(o=n.alphaMap),void 0!==o&&(!0===o.matrixAutoUpdate&&o.updateMatrix(),e.uvTransform.value.copy(o.matrix))):n.isSpriteMaterial?(e.diffuse.value.copy(n.color),e.opacity.value=n.opacity,e.rotation.value=n.rotation,n.map&&(e.map.value=n.map),n.alphaMap&&(e.alphaMap.value=n.alphaMap),n.alphaTest>0&&(e.alphaTest.value=n.alphaTest),n.map?l=n.map:n.alphaMap&&(l=n.alphaMap),void 0!==l&&(!0===l.matrixAutoUpdate&&l.updateMatrix(),e.uvTransform.value.copy(l.matrix))):n.isS
121hadowMaterial?(e.color.value.copy(n.color),e.opacity.value=n.opacity):n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)}}}function ri(e={}){let t=void 0!==e.canvas?e.canvas:function(){let e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return e.style.display="block",e}(),i=void 0!==e.context?e.context:null,n=void 0!==e.alpha&&e.alpha,r=void 0===e.depth||e.depth,a=void 0===e.stencil||e.stencil,s=void 0!==e.antialias&&e.antialias,o=void 0===e.premultipliedAlpha||e.premultipliedAlpha,l=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,h=void 0!==e.powerPreference?e.powerPreference:"default",u=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat,c=null,d=null,p=[],m=[];this.domElement=t,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=3e3,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1;let f=this,g=!1,v=0,y=0,x=null,_=-1,b=null,M=new E,w=new E,S=null,T=t.width,L=t.height,C=1,I=null,D=null,N=new E(0,0,T,L),z=new E(0,0,T,L),B=!1,F=[],O=new tZ,U=!1,H=!1,G=null,k=new el,V=new P,W={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function j(){return null===x?C:1}let q,X,Y,J,Z,Q,K,$,ee,et,ei,en,er,ea,es,eo,eh,eu,ec,ed,ep,em,ef,eg=i;function ev(e,i){for(let n=0;n<e.length;n++){let r=e[n],a=t.getContext(r,i);if(null!==a)return a}return null}try{if(t.addEventListener("webglcontextlost",e_,!1),t.addEventListener("webglcontextrestored",eb,!1),null===eg){let e=["webgl2","webgl","experimental-webgl"];if(!0===f.isWebGL1Renderer&&e.shift(),eg=ev(e,{alpha:n,depth:r,stencil:a,antialias:s,premultipliedAlpha:o,preserveDrawingBuffer:l,powerPreference:h,failIfMajorPerformanceCaveat:u}),null===eg)throw ev(e)?Error("Error creating WebGL context with your selected attributes."):Error("Error creating WebGL context.")}void 0===eg.getShaderPrecisionFormat&&(eg.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}function ey(){q=new iw(eg),X=new t6(eg,q,e),q.init(X),em=new n5(eg,q,X),Y=new n2(eg,q,X),F[0]=1029,J=new iE(eg),Z=new nV,Q=new n4(eg,q,Y,Z,X,em,J),K=new t7(f),$=new iM(f),ee=new tK(eg,X),ef=new t4(eg,q,ee,X),et=new iS(eg,ee,J,ef),ei=new iC(eg,et,ee,J),ec=new iR(eg),eo=new t8(Z),en=new nk(f,K,$,q,X,ef,eo),er=new rt(Z),ea=new nX(Z),es=new n$(q,X),eu=new t2(f,K,Y,ei,o),eh=new n3(f,ei,X),ed=new t5(eg,q,J,X),ep=new iT(eg,q,J,X),J.programs=en.programs,f.capabilities=X,f.extensions=q,f.properties=Z,f.renderLists=ea,f.shadowMap=eh,f.state=Y,f.info=J}ey();let ex=new re(f,eg);function e_(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),g=!0}function eb(){console.log("THREE.WebGLRenderer: Context Restored."),g=!1;let e=J.autoReset,t=eh.enabled,i=eh.autoUpdate,n=eh.needsUpdate,r=eh.type;ey(),J.autoReset=e,eh.enabled=t,eh.autoUpdate=i,eh.needsUpdate=n,eh.type=r}function eM(e){let t=e.target;t.removeEventListener("dispose",eM),function(e){let t=Z.get(e).programs;void 0!==t&&t.forEach(function(e){en.releaseProgram(e)})}(t),Z.remove(t)}this.xr=ex,this.getContext=function(){return eg},this.getContextAttributes=function(){return eg.getContextAttributes()},this.forceContextLoss=function(){let e=q.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){let e=q.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return C},this.setPixelRatio=function(e){void 0!==e&&(C=e,this.setSize(T,L,!1))},this.getSize=function(e){return e.set(T,L)},this.setSize=function(e,i,n){ex.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(T=e,L=i,t.width=Math.floor(e*C),t.height=Math.floor(i*C),!1!==n&&(t.style.width=e+"px",t.style.height=i+"px"),this.setViewport(0,0,e,i))},this.getDrawingBufferSize=function(e){return e.set(T*C,L*C).floor()},this.setDrawingBufferSize=function(e,i,n){T=e,L=i,C=n,t.width=Math.floor(e*n),t.height=Math.floor(i*n),this.setViewport(0,0,e,i)},this.getCurrentViewport=function(e){return e.copy(M)},this.getViewport=function(e){return e.copy(N)},this.setViewport=function(e,t,i,n){e.isVector4?N.set(e.x,e.y,e.z,e.w):N.set(e,t,i,n),Y.viewport(M.copy(N).multiplyScalar(C).floor())}
121,this.getScissor=function(e){return e.copy(z)},this.setScissor=function(e,t,i,n){e.isVector4?z.set(e.x,e.y,e.z,e.w):z.set(e,t,i,n),Y.scissor(w.copy(z).multiplyScalar(C).floor())},this.getScissorTest=function(){return B},this.setScissorTest=function(e){Y.setScissorTest(B=e)},this.setOpaqueSort=function(e){I=e},this.setTransparentSort=function(e){D=e},this.getClearColor=function(e){return e.copy(eu.getClearColor())},this.setClearColor=function(){eu.setClearColor.apply(eu,arguments)},this.getClearAlpha=function(){return eu.getClearAlpha()},this.setClearAlpha=function(){eu.setClearAlpha.apply(eu,arguments)},this.clear=function(e,t,i){let n=0;(void 0===e||e)&&(n|=16384),(void 0===t||t)&&(n|=256),(void 0===i||i)&&(n|=1024),eg.clear(n)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",e_,!1),t.removeEventListener("webglcontextrestored",eb,!1),ea.dispose(),es.dispose(),Z.dispose(),K.dispose(),$.dispose(),ei.dispose(),ef.dispose(),ex.dispose(),ex.removeEventListener("sessionstart",eS),ex.removeEventListener("sessionend",eT),G&&(G.dispose(),G=null),eE.stop()},this.renderBufferImmediate=function(e,t){ef.initAttributes();let i=Z.get(e);e.hasPositions&&!i.position&&(i.position=eg.createBuffer()),e.hasNormals&&!i.normal&&(i.normal=eg.createBuffer()),e.hasUvs&&!i.uv&&(i.uv=eg.createBuffer()),e.hasColors&&!i.color&&(i.color=eg.createBuffer());let n=t.getAttributes();e.hasPositions&&(eg.bindBuffer(34962,i.position),eg.bufferData(34962,e.positionArray,35048),ef.enableAttribute(n.position.location),eg.vertexAttribPointer(n.position.location,3,5126,!1,0,0)),e.hasNormals&&
121(eg.bindBuffer(34962,i.normal),eg.bufferData(34962,e.normalArray,35048),ef.enableAttribute(n.normal.location),eg.vertexAttribPointer(n.normal.location,3,5126,!1,0,0)),e.hasUvs&&(eg.bindBuffer(34962,i.uv),eg.bufferData(34962,e.uvArray,35048),ef.enableAttribute(n.uv.location),eg.vertexAttribPointer(n.uv.location,2,5126,!1,0,0)),e.hasColors&&(eg.bindBuffer(34962,i.color),eg.bufferData(34962,e.colorArray,35048),ef.enableAttribute(n.color.location),eg.vertexAttribPointer(n.color.location,3,5126,!1,0,0)),ef.disableUnusedAttributes(),eg.drawArrays(4,0,e.count),e.count=0},this.renderBufferDirect=function(e,t,i,n,r,a){null===t&&(t=W);let s=r.isMesh&&0>r.matrixWorld.determinant(),o=eP(e,t,n,r);Y.setMaterial(n,s);let l=i.index,h=i.attributes.position;if(null===l){if(void 0===h||0===h.count)return}else if(0===l.count)return;let u,c=1;!0===n.wireframe&&(l=et.getWireframeAttribute(i),c=2),void 0===i.morphAttributes.position&&void 0===i.morphAttributes.normal||ec.update(r,i,n,o),ef.setup(r,n,o,i,l);let d=ed;null!==l&&(u=ee.get(l),(d=ep).setIndex(u));let p=null!==l?l.count:h.count,m=i.drawRange.start*c,f=i.drawRange.count*c,g=null!==a?a.start*c:0,v=null!==a?a.count*c:1/0,y=Math.max(m,g),x=Math.max(0,Math.min(p,m+f,g+v)-1-y+1);if(0!==x){if(r.isMesh)!0===n.wireframe?(Y.setLineWidth(n.wireframeLinewidth*j()),d.setMode(1)):d.setMode(4);else if(r.isLine){let e=n.linewidth;void 0===e&&(e=1),Y.setLineWidth(e*j()),r.isLineSegments?d.setMode(1):r.isLineLoop?d.setMode(2):d.setMode(3)}else r.isPoints?d.setMode(0):r.isSprite&&d.setMode(4);if(r.isInstancedMesh)d.renderInstances(y,x,r.count);else if(i.isInstancedBufferGeometry){let e=Math.min(i.instanceCount,i._maxInstanceCount);d.renderInstances(y,x,e)}else d.render(y,x)}},this.compile=function(e,t){(d=es.get(e)).init(),m.push(d),e.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(d.pushLight(e),e.castShadow&&d.pushShadow(e))}),d.setupLights(f.physicallyCorrectLights),e.traverse(function(t){let i=t.material;if(i){if(Array.isArray(i))for(let n=0;n<i.length;n++)eR(i[n],e,t);else eR(i,e,t)}}),m.pop(),d=null};let ew=null;function eS(){eE.stop()}function eT(){eE.start()}let eE=new tQ;function eA(e,t,i,n){let r=e.opaque,a=e.transmissive,o=e.transparent;d.setupLightsView(i),a.length>0&&function(e,t,i){null===G&&(G=new(!0===s&&!0===X.isWebGL2?R:A)(1024,1024,{generateMipmaps:!0,type:null!==em.convert(1016)?1016:1009,minFilter:1008,magFilter:1003,wrapS:1001,wrapT:1001}));let n=f.getRenderTarget();f.setRenderTarget(G),f.clear();let r=f.toneMapping;f.toneMapping=0,eL(e,t,i),f.toneMapping=r,Q.updateMultisampleRenderTarget(G),Q.updateRenderTargetMipmap(G),f.setRenderTarget(n)}(r,t,i),n&&Y.viewport(M.copy(n)),r.length>0&&eL(r,t,i),a.length>0&&eL(a,t,i),o.length>0&&eL(o,t,i)}function eL(e,t,i){let n=!0===t.isScene?t.overrideMaterial:null;for(let r=0,a=e.length;r<a;r++){let a=e[r],s=a.object,o=a.geometry,l=null===n?a.material:n,h=a.group;s.layers.test(i.layers)&&function(e,t,i,n,r,a){if(e.onBeforeRender(f,t,i,n,r,a),e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.isImmediateRenderObject){let n=eP(i,t,r,e);Y.setMaterial(r),ef.reset(),function(e,t){e.render(function(e){f.renderBufferImmediate(e,t)})}(e,n)}else!0===r.transparent&&2===r.side?(r.side=1,r.needsUpdate=!0,f.renderBufferDirect(i,t,n,r,e,a),r.side=0,r.needsUpdate=!0,f.renderBufferDirect(i,t,n,r,e,a),r.side=2):f.renderBufferDirect(i,t,n,r,e,a);e.onAfterRender(f,t,i,n,r,a)}(s,t,i,o,l,h)}}function eR(e,t,i){!0!==t.isScene&&(t=W);let n=Z.get(e),r=d.state.lights,a=d.state.shadowsArray,s=r.state.version,o=en.getParameters(e,r.state,a,t,i),l=en.getProgramCacheKey(o),h=n.programs;n.environment=e.isMeshStandardMaterial?t.environment:null,n.fog=t.fog,n.envMap=(e.isMeshStandardMaterial?$:K).get(e.envMap||n.environment),void 0===h&&(e.addEventListener("dispose",eM),h=new Map,n.programs=h);let u=h.get(l);if(void 0!==u){if(n.currentProgram===u&&n.lightsStateVersion===s)return eC(e,o),u}else o.uniforms=en.getUniforms(e),e.onBuild(o,f),e.onBeforeCompile(o,f),u=en.acquireProgram(o,l),h.set(l,u),n.uniforms=o.uniforms;let c=n.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(c.clippingPlanes=eo.uniform),eC(e,o),n.needsLights=e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights,n.lightsStateVersion=s,n.needsLights&&(c.ambientLightColor.value=r.state.ambient,c.lightProbe.value=r.state.probe,c.directionalLights.value=r.state.directional,c.directionalLightShadows.value=r.state.directionalShadow,c.spotLights.value=r.state.spot,c.spotLightShadows.value=r.state.spotShadow,c.rectAreaLights.value=r.state.rectArea,c.ltc_1.value=r.state.rectAreaLTC1,c.ltc_2.value=r.state.rectAreaLTC2,c.pointLights.value=r.state.point,c.pointLightShadows.value=r.state.pointShadow,c.hemisphereLights.value=r.state.hemi,c.directionalShadowMap.value=r.state.directionalShadowMap,c.directionalShadowMatrix.value=r.state.directionalShadowMatrix,c.spotShadowMap.value=r.state.spotShadowMap,c.spotShadowMatrix.value=r.state.spotShadowMatrix,c.pointShadowMap.value=r.state.pointShadowMap,c.pointShadowMatrix.value=r.state.pointShadowMatrix);let p=u.getUniforms(),m=nw.seqWithValue(p.seq,c);return n.currentProgram=u,n.uniformsList=m,u}function eC(e,t){let i=Z.get(e);i.outputEncoding=t.outputEncoding,i.instancing=t.instancing,i.skinning=t.skinning,i.morphTargets=t.morphTargets,i.morphNormals=t.morphNormals,i.numClippingPlanes=t.numClippingPlanes,i.numIntersection=t.numClipIntersection,i.vertexAlphas=t.vertexAlphas,i.vertexTangents=t.vertexTangents}function eP(e,t,i,n){var r;!0!==t.isScene&&(t=W),Q.resetTextureUnits();let a=t.fog,s=i.isMeshStandardMaterial?t.environment:null,o=null===x?f.outputEncoding:x.texture.encoding,l=(i.isMeshStandardMaterial?$:K).get(i.envMap||s),h=!0===i.vertexColors&&!!n.geometry&&!!n.geometry.attributes.color&&4===n.geometry.attributes.color.itemSize,u=!!n.geometry&&!!n.geometry.attributes.tangent,c=!!n.geometry&&!!n.geometry.morphAttributes.position,p=!!n.geometry&&!!n.geometry.morphAttributes.normal,m=Z.get(i),g=d.state.lights;if(!0===U&&(!0===H||e!==b)){let t=e===b&&i.id===_;eo.setState(i,e,t)}let v=!1;i.version===m.__version?m.needsLights&&m.lightsStateVersion!==g.state.ver
121sion||m.outputEncoding!==o||n.isInstancedMesh&&!1===m.instancing?v=!0:n.isInstancedMesh||!0!==m.instancing?n.isSkinnedMesh&&!1===m.skinning?v=!0:n.isSkinnedMesh||!0!==m.skinning?m.envMap!==l||i.fog&&m.fog!==a?v=!0:void 0===m.numClippingPlanes||m.numClippingPlanes===eo.numPlanes&&m.numIntersection===eo.numIntersection?(m.vertexAlphas!==h||m.vertexTangents!==u||m.morphTargets!==c||m.morphNormals!==p)&&(v=!0):v=!0:v=!0:v=!0:(v=!0,m.__version=i.version);let y=m.currentProgram;!0===v&&(y=eR(i,t,n));let M=!1,w=!1,S=!1,T=y.getUniforms(),E=m.uniforms;if(Y.useProgram(y.program)&&(M=!0,w=!0,S=!0),i.id!==_&&(_=i.id,w=!0),M||b!==e){if(T.setValue(eg,"projectionMatrix",e.projectionMatrix),X.logarithmicDepthBuffer&&T.setValue(eg,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),b!==e&&(b=e,w=!0,S=!0),i.isShaderMaterial||i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshStandardMaterial||i.envMap){let t=T.map.cameraPosition;void 0!==t&&t.setValue(eg,V.setFromMatrixPosition(e.matrixWorld))}(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&T.setValue(eg,"isOrthographic",!0===e.isOrthographicCamera),(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial||i.isShadowMaterial||n.isSkinnedMesh)&&T.setValue(eg,"viewMatrix",e.matrixWorldInverse)}if(n.isSkinnedMesh){T.setOptional(eg,n,"bindMatrix"),T.setOptional(eg,n,"bindMatrixInverse");let e=n.skeleton;e&&(X.floatVertexTextures?(null===e.boneTexture&&e.computeBoneTexture(),T.setValue(eg,"boneTexture",e.boneTexture,Q),T.setValue(eg,"boneTextureSize",e.boneTextureSize)):T.setOptional(eg,e,"boneMatrices"))}return(w||m.receiveShadow!==n.receiveShadow)&&(m.receiveShadow=n.receiveShadow,T.setValue(eg,"receiveShadow",n.receiveShadow)),w&&(T.setValue(eg,"toneMappingExposure",f.toneMappingExposure),m.needsLights&&(r=S,E.ambientLightColor.needsUpdate=r,E.lightProbe.needsUpdate=r,E.directionalLights.needsUpdate=r,E.directionalLightShadows.needsUpdate=r,E.pointLights.needsUpdate=r,E.pointLightShadows.needsUpdate=r,E.spotLights.needsUpdate=r,E.spotLightShadows.needsUpdate=r,E.rectAreaLights.needsUpdate=r,E.hemisphereLights.needsUpdate=r),a&&i.fog&&er.refreshFogUniforms(E,a),er.refreshMaterialUniforms(E,i,C,L,G),nw.upload(eg,m.uniformsList,E,Q)),i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(nw.upload(eg,m.uniformsList,E,Q),i.uniformsNeedUpdate=!1),i.isSpriteMaterial&&T.setValue(eg,"center",n.center),T.setValue(eg,"modelViewMatrix",n.modelViewMatrix),T.setValue(eg,"normalMatrix",n.normalMatrix),T.setValue(eg,"modelMatrix",n.matrixWorld),y}eE.setAnimationLoop(function(e){ew&&ew(e)}),"undefined"!=typeof window&&eE.setContext(window),this.setAnimationLoop=function(e){ew=e,ex.setAnimationLoop(e),null===e?eE.stop():eE.start()},ex.addEventListener("sessionstart",eS),ex.addEventListener("sessionend",eT),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===g)return;!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),!0===ex.enabled&&!0===ex.isPresenting&&(!0===ex.cameraAutoUpdate&&ex.updateCamera(t),t=ex.getCamera()),!0===e.isScene&&e.onBeforeRender(f,e,t,x),(d=es.get(e,m.length)).init(),m.push(d),k.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),O.setFromProjectionMatrix(k),H=this.localClippingEnabled,U=eo.init(this.clippingPlanes,H,t),(c=ea.get(e,p.length)).init(),p.push(c),function e(t,i,n,r){if(!1===t.visible)return;if(t.layers.test(i.layers)){if(t.isGroup)n=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(i);else if(t.isLight)d.pushLight(t),t.castShadow&&d.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||O.intersectsSprite(t)){r&&V.setFromMatrixPosition(t.matrixWorld).applyMatrix4(k);let e=ei.update(t),i=t.material;i.visible&&c.push(t,e,i,n,V.z,null)}}else if(t.isImmediateRenderObject)r&&V.setFromMatrixPosition(t.matrixWorld).applyMatrix4(k),c.push(t,null,t.material,n,V.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.frame!==J.render.frame&&(t.skeleton.update(),t.skeleton.frame=J.render.frame),!t.frustumCulled||O.intersectsObject(t))){r&&V.setFromMatrixPosition(t.matrixWorld).applyMatrix4(k);let e=ei.update(t),i=t.material;if(Array.isArray(i)){let r=e.groups;for(let a=0,s=r.length;a<s;a++){let s=r[a],o=i[s.materialIndex];o&&o.visible&&c.push(t,e,o,n,V.z,s)}}else i.visible&&c.push(t,e,i,n,V.z,null)}}let a=t.children;for(let t=0,s=a.length;t<s;t++)e(a[t],i,n,r)}(e,t,0,f.sortObjects),c.finish(),!0===f.sortObjects&&c.sort(I,D),!0===U&&eo.beginShadows();let i=d.state.shadowsArray;if(eh.render(i,e,t),!0===U&&eo.endShadows(),!0===this.info.autoReset&&this.info.reset(),eu.render(c,e),d.setupLights(f.physicallyCorrectLights),t.isArrayCamera){let i=t.cameras;for(let t=0,n=i.length;t<n;t++){let n=i[t];eA(c,e,n,n.viewport)}}else eA(c,e,t);null!==x&&(Q.updateMultisampleRenderTarget(x),Q.updateRenderTargetMipmap(x)),!0===e.isScene&&e.onAfterRender(f,e,t),Y.buffers.depth.setTest(!0),Y.buffers.depth.setMask(!0),Y.buffers.color.setMask(!0),Y.setPolygonOffset(!1),ef.resetDefaultState(),_=-1,b=null,m.pop(),d=m.length>0?m[m.length-1]:null,p.pop(),c=p.length>0?p[p.length-1]:null},this.getActiveCubeFace=function(){return v},this.getActiveMipmapLevel=function(){return y},this.getRenderTarget=function(){return x},this.setRenderTarget=function(e,t=0,i=0){x=e,v=t,y=i,e&&void 0===Z.get(e).__webglFramebuffer&&Q.setupRenderTarget(e);let n=null,r=!1,a=!1;if(e){let i=e.texture;(i.isDataTexture3D||i.isDataTexture2DArray)&&(a=!0);let s=Z.get(e).__webglFramebuffer;
vendor: 7,444 bytes, line 121
121e.isWebGLCubeRenderTarget?(n=s[t],r=!0):n=e.isWebGLMultisampleRenderTarget?Z.get(e).__webglMultisampledFramebuffer:s,M.copy(e.viewport),w.copy(e.scissor),S=e.scissorTest}else M.copy(N).multiplyScalar(C).floor(),w.copy(z).multiplyScalar(C).floor(),S=B;if(Y.bindFramebuffer(36160,n)&&X.drawBuffers){let t=!1;if(e){if(e.isWebGLMultipleRenderTargets){let i=e.texture;if(F.length!==i.length||36064!==F[0]){for(let e=0,t=i.length;e<t;e++)F[e]=36064+e;F.length=i.length,t=!0}}else 1===F.length&&36064===F[0]||(F[0]=36064,F.length=1,t=!0)}else 1===F.length&&1029===F[0]||(F[0]=1029,F.length=1,t=!0);t&&(X.isWebGL2?eg.drawBuffers(F):q.get("WEBGL_draw_buffers").drawBuffersWEBGL(F))}if(Y.viewport(M),Y.scissor(w),Y.setScissorTest(S),r){let n=Z.get(e.texture);eg.framebufferTexture2D(36160,36064,34069+t,n.__webglTexture,i)}else if(a){let n=Z.get(e.texture);eg.framebufferTextureLayer(36160,36064,n.__webglTexture,i||0,t||0)}_=-1},this.readRenderTargetPixels=function(e,t,i,n,r,a,s){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let o=Z.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==s&&(o=o[s]),o){Y.bindFramebuffer(36160,o);try{let s=e.texture,o=s.format,l=s.type;if(1023!==o&&em.convert(o)!==eg.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");let h=1016===l&&(q.has("EXT_color_buffer_half_float")||X.isWebGL2&&q.has("EXT_color_buffer_float"));if(!(1009===l||em.convert(l)===eg.getParameter(35738)||1015===l&&(X.isWebGL2||q.has("OES_texture_float")||q.has("WEBGL_color_buffer_float"))||h))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===eg.checkFramebufferStatus(36160)?t>=0&&t<=e.width-n&&i>=0&&i<=e.height-r&&eg.readPixels(t,i,n,r,em.convert(o),em.convert(l),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{let e=null!==x?Z.get(x).__webglFramebuffer:null;Y.bindFramebuffer(36160,e)}}},this.copyFramebufferToTexture=function(e,t,i=0){let n=Math.pow(2,-i),r=Math.floor(t.image.width*n),a=Math.floor(t.image.height*n),s=em.convert(t.format);X.isWebGL2&&(6407===s&&(s=32849),6408===s&&(s=32856)),Q.setTexture2D(t,0),eg.copyTexImage2D(3553,i,s,e.x,e.y,r,a,0),Y.unbindTexture()},this.copyTextureToTexture=function(e,t,i,n=0){let r=t.image.width,a=t.image.height,s=em.convert(i.format),o=em.convert(i.type);Q.setTexture2D(i,0),eg.pixelStorei(37440,i.flipY),eg.pixelStorei(37441,i.premultiplyAlpha),eg.pixelStorei(3317,i.unpackAlignment),t.isDataTexture?eg.texSubImage2D(3553,n,e.x,e.y,r,a,s,o,t.image.data):t.isCompressedTexture?eg.compressedTexSubImage2D(3553,n,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,s,t.mipmaps[0].data):eg.texSubImage2D(3553,n,e.x,e.y,s,o,t.image),0===n&&i.generateMipmaps&&eg.generateMipmap(3553),Y.unbindTexture()},this.copyTextureToTexture3D=function(e,t,i,n,r=0){let a;if(f.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");let s=e.max.x-e.min.x+1,o=e.max.y-e.min.y+1,l=e.max.z-e.min.z+1,h=em.convert(n.format),u=em.convert(n.type);if(n.isDataTexture3D)Q.setTexture3D(n,0),a=32879;else{if(!n.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");Q.setTexture2DArray(n,0),a=35866}eg.pixelStorei(37440,n.flipY),eg.pixelStorei(37441,n.premultiplyAlpha),eg.pixelStorei(3317,n.unpackAlignment);let c=eg.getParameter(3314),d=eg.getParameter(32878),p=eg.getParameter(3316),m=eg.getParameter(3315),g=eg.getParameter(32877),v=i.isCompressedTexture?i.mipmaps[0]:i.image;eg.pixelStorei(3314,v.width),eg.pixelStorei(32878,v.height),eg.pixelStorei(3316,e.min.x),eg.pixelStorei(3315,e.min.y),eg.pixelStorei(32877,e.min.z),i.isDataTexture||i.isDataTexture3D?eg.texSubImage3D(a,r,t.x,t.y,t.z,s,o,l,h,u,v.data):i.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),eg.compressedTexSubImage3D(a,r,t.x,t.y,t.z,s,o,l,h,v.data)):eg.texSubImage3D(a,r,t.x,t.y,t.z,s,o,l,h,u,v),eg.pixelStorei(3314,c),eg.pixelStorei(32878,d),eg.pixelStorei(3316,p),eg.pixelStorei(3315,m),eg.pixelStorei(32877,g),0===r&&n.generateMipmaps&&eg.generateMipmap(a),Y.unbindTexture()},this.initTexture=function(e){Q.setTexture2D(e,0),Y.unbindTexture()},this.resetState=function(){v=0,y=0,x=null,Y.reset(),ef.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class rn extends ri{}rn.prototype.isWebGL1Renderer=!0;class rr{constructor(e,t=25e-5){this.name="",this.color=new e$(e),this.density=t}clone(){return new rr(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}rr.prototype.isFogExp2=!0;class ra{constructor(e,t=1,i=1e3){this.name="",this.color=new e$(e),this.near=t,this.far=i}clone(){return new ra(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}ra.prototype.isFog=!0;class rs extends eD{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}rs.prototype.isScene=!0;class ro{constructor(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=d()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let n=0,r=this.stride;n<r;n++)this.array[e+n]=t.array[i+n];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=d()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=d()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}ro.prototype.isInterleavedBuffer=!0;
121let rl=new P;class rh{constructor(e,t,i,n=!1){this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=!0===n}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,i=this.data.count;t<i;t++)rl.x=this.getX(t),rl.y=this.getY(t),rl.z=this.getZ(t),rl.applyMatrix4(e),this.setXYZ(t,rl.x,rl.y,rl.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)rl.x=this.getX(t),rl.y=this.getY(t),rl.z=this.getZ(t),rl.applyNormalMatrix(e),this.setXYZ(t,rl.x,rl.y,rl.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)rl.x=this.getX(t),rl.y=this.getY(t),rl.z=this.getZ(t),rl.transformDirection(e),this.setXYZ(t,rl.x,rl.y,rl.z);return this}setX(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){return this.data.array[e*this.data.stride+this.offset]}getY(e){return this.data.array[e*this.data.stride+this.offset+1]}getZ(e){return this.data.array[e*this.data.stride+this.offset+2]}getW(e){return this.data.array[e*this.data.stride+this.offset+3]}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=n,this}setXYZW(e,t,i,n,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=n,this.data.array[e+3]=r,this}clone(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");let e=[];for(let t=0;t<this.count;t++){let i=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[i+t])}return new e2(new this.array.constructor(e),this.itemSize,this.normalized)}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new rh(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");let e=[];for(let t=0;t<this.count;t++){let i=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[i+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}rh.prototype.isInterleavedBufferAttribute=!0;class ru extends eq{constructor(e){super(),this.type="SpriteMaterial",this.color=new e$(0xffffff),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this}}ru.prototype.isSpriteMaterial=!0;let rc=new P,rd=new P,rp=new P,rm=new _,rf=new _,rg=new el,rv=new P,ry=new P,rx=new P,r_=new _,rb=new _,rM=new _;class rw extends eD{constructor(e){if(super(),this.type="Sprite",void 0===i){i=new tm;let e=new ro(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);i.setIndex([0,1,2,0,2,3]),i.setAttribute("position",new rh(e,3,0,!1)),i.setAttribute("uv",new rh(e,2,3,!1))}this.geometry=i,this.material=void 0!==e?e:new ru,this.center=new _(.5,.5)}raycast(e,t){let i,n;null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),rd.setFromMatrixScale(this.matrixWorld),rg.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),rp.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&rd.multiplyScalar(-rp.z);let r=this.material.rotation;0!==r&&(n=Math.cos(r),i=Math.sin(r));let a=this.center;rS(rv.set(-.5,-.5,0),rp,a,rd,i,n),rS(ry.set(.5,-.5,0),rp,a,rd,i,n),rS(rx.set(.5,.5,0),rp,a,rd,i,n),r_.set(0,0),rb.set(1,0),rM.set(1,1);let s=e.ray.intersectTriangle(rv,ry,rx,!1,rc);if(null===s&&(rS(ry.set(-.5,.5,0),rp,a,rd,i,n),rb.set(0,1),null===(s=e.ray.intersectTriangle(rv,rx,ry,!1,rc)
121)))return;let o=e.ray.origin.distanceTo(rc);o<e.near||o>e.far||t.push({distance:o,point:rc.clone(),uv:eW.getUV(rc,rv,ry,rx,r_,rb,rM,new _),face:null,object:this})}copy(e){return super.copy(e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}function rS(e,t,i,n,r,a){rm.subVectors(e,i).addScalar(.5).multiply(n),void 0!==r?(rf.x=a*rm.x-r*rm.y,rf.y=r*rm.x+a*rm.y):rf.copy(rm),e.copy(t),e.x+=rf.x,e.y+=rf.y,e.applyMatrix4(rg)}rw.prototype.isSprite=!0;let rT=new P,rE=new P;class rA extends eD{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let e=0,i=t.length;e<i;e++){let i=t[e];this.addLevel(i.object.clone(),i.distance)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0){let i;t=Math.abs(t);let n=this.levels;for(i=0;i<n.length&&!(t<n[i].distance);i++);return n.splice(i,0,{distance:t,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){let t=this.levels;if(t.length>0){let i,n;for(i=1,n=t.length;i<n&&!(e<t[i].distance);i++);return t[i-1].object}return null}raycast(e,t){if(this.levels.length>0){rT.setFromMatrixPosition(this.matrixWorld);let i=e.ray.origin.distanceTo(rT);this.getObjectForDistance(i).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){let i,n;rT.setFromMatrixPosition(e.matrixWorld),rE.setFromMatrixPosition(this.matrixWorld);let r=rT.distanceTo(rE)/e.zoom;for(t[0].object.visible=!0,i=1,n=t.length;i<n&&r>=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;i<n;i++)t[i].object.visible=!1}}toJSON(e){let t=super.toJSON(e);!1===this.autoUpdate&&(t.object.autoUpdate=!1),t.object.levels=[];let i=this.levels;for(let e=0,n=i.length;e<n;e++){let n=i[e];t.object.levels.push({object:n.object.uuid,distance:n.distance})}return t}}let rL=new P,rR=new E,rC=new E,rP=new P,rI=new el;class rD extends tI{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new el,this.bindMatrixInverse=new el}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){let e=new E,t=this.geometry.attributes.skinWeight;for(let i=0,n=t.count;i<n;i++){e.x=t.getX(i),e.y=t.getY(i),e.z=t.getZ(i),e.w=t.getW(i);let n=1/e.manhattanLength();n!==1/0?e.multiplyScalar(n):e.set(1,0,0,0),t.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),"attached"===this.bindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){let i=this.skeleton,n=this.geometry;rR.fromBufferAttribute(n.attributes.skinIndex,e),rC.fromBufferAttribute(n.attributes.skinWeight,e),rL.fromBufferAttribute(n.attributes.position,e).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let e=0;e<4;e++){let n=rC.getComponent(e);if(0!==n){let r=rR.getComponent(e);rI.multiplyMatrices(i.bones[r].matrixWorld,i.boneInverses[r]),t.addScaledVector(rP.copy(rL).applyMatrix4(rI),n)}}return t.applyMatrix4(this.bindMatrixInverse)}}rD.prototype.isSkinnedMesh=!0;class rN extends eD{constructor(){super(),this.type="Bone"}}rN.prototype.isBone=!0;class rz extends S{constructor(e=null,t=1,i=1,n,r,a,s,o,l=1003,h=1003,u,c){super(null,a,s,o,l,h,n,r,u,c),this.image={data:e,width:t,height:i},this.magFilter=l,this.minFilter=h,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}rz.prototype.isDataTexture=!0;let rB=new el,rF=new el;class rO{constructor(e=[],t=[]){this.uuid=d(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){let e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new el)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){let t=new el;this.bones[e]&&t.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(t)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){let t=this.bones[e];t&&t.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){let t=this.bones[e];t&&(t.parent&&t.parent.isBone?(t.matrix.copy(t.parent.matrixWorld).invert(),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))}}update(){let e=this.bones,t=this.boneInverses,i=this.boneMatrices,n=this.boneTexture;for(let n=0,r=e.length;n<r;n++){let r=e[n]?e[n].matrixWorld:rF;rB.multiplyMatrices(r,t[n]),rB.toArray(i,16*n)}null!==n&&(n.needsUpdate=!0)}clone(){return new rO(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(4*this.bones.length),t=new Float32Array((e=Math.max(e=v(e),4))*e*4);t.set(this.boneMatrices);let i=new rz(t,e,e,1023,1015);return this.boneMatrices=t,this.boneTexture=i,this.boneTextureSize=e,this}getBoneByName(e){for(let t=0,i=this.bones.length;t<i;t++){let i=this.bones[t];if(i.name===e)return i}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let i=0,n=e.bones.length;i<n;i++){let n=e.bones[i],r=t[n];void 0===r&&(console.warn("THREE.Skeleton: No bone found with UUID:",n),r=new rN),this.bones.push(r),this.boneInverses.push((new el).fromArray(e.boneInverses[i])
121)}return this.init(),this}toJSON(){let e={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;let t=this.bones,i=this.boneInverses;for(let n=0,r=t.length;n<r;n++){let r=t[n];e.bones.push(r.uuid);let a=i[n];e.boneInverses.push(a.toArray())}return e}}class rU extends e2{constructor(e,t,i,n=1){"number"==typeof i&&(n=i,i=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,i),this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){let e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}rU.prototype.isInstancedBufferAttribute=!0;let rH=new el,rG=new el,rk=[],rV=new tI;class rW extends tI{constructor(e,t,i){super(e,t),this.instanceMatrix=new rU(new Float32Array(16*i),16),this.instanceColor=null,this.count=i,this.frustumCulled=!1}copy(e){return super.copy(e),this.instanceMatrix.copy(e.instanceMatrix),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,3*e)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,16*e)}raycast(e,t){let i=this.matrixWorld,n=this.count;if(rV.geometry=this.geometry,rV.material=this.material,void 0!==rV.material)for(let r=0;r<n;r++){this.getMatrixAt(r,rH),rG.multiplyMatrices(i,rH),rV.matrixWorld=rG,rV.raycast(e,rk);for(let e=0,i=rk.length;e<i;e++){let i=rk[e];i.instanceId=r,i.object=this,t.push(i)}rk.length=0}}setColorAt(e,t){null===this.instanceColor&&(this.instanceColor=new rU(new Float32Array(3*this.instanceMatrix.count),3)),t.toArray(this.instanceColor.array,3*e)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,16*e)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}rW.prototype.isInstancedMesh=!0;class rj extends eq{constructor(e){super(),this.type="LineBasicMaterial",this.color=new e$(0xffffff),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this}}rj.prototype.isLineBasicMaterial=!0;let rq=new P,rX=new P,rY=new el,rJ=new eo,rZ=new $;class rQ extends eD{constructor(e=new tm,t=new rj){super(),this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){let e=this.geometry;if(e.isBufferGeometry){if(null===e.index){let t=e.attributes.position,i=[0];for(let e=1,n=t.count;e<n;e++)rq.fromBufferAttribute(t,e-1),rX.fromBufferAttribute(t,e),i[e]=i[e-1],i[e]+=rq.distanceTo(rX);e.setAttribute("lineDistance",new ti(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.")}else e.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(e,t){let i=this.geometry,n=this.matrixWorld,r=e.params.Line.threshold,a=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),rZ.copy(i.boundingSphere),rZ.applyMatrix4(n),rZ.radius+=r,!1===e.ray.intersectsSphere(rZ))return;rY.copy(n).invert(),rJ.copy(e.ray).applyMatrix4(rY);let s=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=s*s,l=new P,h=new P,u=new P,c=new P,d=this.isLineSegments?2:1;if(i.isBufferGeometry){let n=i.index,r=i.attributes.position;if(null!==n)for(let i=Math.max(0,a.start),s=Math.min(n.count,a.start+a.count)-1;i<s;i+=d){let a=n.getX(i),s=n.getX(i+1);if(l.fromBufferAttribute(r,a),h.fromBufferAttribute(r,s),rJ.distanceSqToSegment(l,h,c,u)>o)continue;c.applyMatrix4(this.matrixWorld);let d=e.ray.origin.distanceTo(c);d<e.near||d>e.far||t.push({distance:d,point:u.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}else for(let i=Math.max(0,a.start),n=Math.min(r.count,a.start+a.count)-1;i<n;i+=d){if(l.fromBufferAttribute(r,i),h.fromBufferAttribute(r,i+1),rJ.distanceSqToSegment(l,h,c,u)>o)continue;c.applyMatrix4(this.matrixWorld);let n=e.ray.origin.distanceTo(c);n<e.near||n>e.far||t.push({distance:n,point:u.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}else i.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,i=Object.keys(t);if(i.length>0){let e=t[i[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,i=e.length;t<i;t++){let i=e[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=t}}}}else{let t=e.morphTargets;void 0!==t&&t.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}rQ.prototype.isLine=!0;let rK=new P,r$=new P;class r0 extends rQ{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.isBufferGeometry){if(null===e.index){let t=e.attributes.position,i=[];for(let e=0,n=t.count;e<n;e+=2)rK.fromBufferAttribute(t,e),r$.fromBufferAttribute(t,e+1),i[e]=0===e?0:i[e-1],i[e+1]=i[e]+rK.distanceTo(r$);e.setAttribute("lineDistance",new ti(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.")}else e.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() n
121o longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}r0.prototype.isLineSegments=!0;class r1 extends rQ{constructor(e,t){super(e,t),this.type="LineLoop"}}r1.prototype.isLineLoop=!0;class r3 extends eq{constructor(e){super(),this.type="PointsMaterial",this.color=new e$(0xffffff),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this}}r3.prototype.isPointsMaterial=!0;let r2=new el,r4=new eo,r5=new $,r6=new P;class r8 extends eD{constructor(e=new tm,t=new r3){super(),this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){let i=this.geometry,n=this.matrixWorld,r=e.params.Points.threshold,a=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),r5.copy(i.boundingSphere),r5.applyMatrix4(n),r5.radius+=r,!1===e.ray.intersectsSphere(r5))return;r2.copy(n).invert(),r4.copy(e.ray).applyMatrix4(r2);let s=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=s*s;if(i.isBufferGeometry){let r=i.index,s=i.attributes.position;if(null!==r)for(let i=Math.max(0,a.start),l=Math.min(r.count,a.start+a.count);i<l;i++){let a=r.getX(i);r6.fromBufferAttribute(s,a),r7(r6,a,o,n,e,t,this)}else for(let i=Math.max(0,a.start),r=Math.min(s.count,a.start+a.count);i<r;i++)r6.fromBufferAttribute(s,i),r7(r6,i,o,n,e,t,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,i=Object.keys(t);if(i.length>0){let e=t[i[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,i=e.length;t<i;t++){let i=e[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=t}}}}else{let t=e.morphTargets;void 0!==t&&t.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function r7(e,t,i,n,r,a,s){let o=r4.distanceSqToPoint(e);if(o<i){let i=new P;r4.closestPointToPoint(e,i),i.applyMatrix4(n);let l=r.ray.origin.distanceTo(i);if(l<r.near||l>r.far)return;a.push({distance:l,distanceToRay:Math.sqrt(o),point:i,index:t,face:null,object:s})}}r8.prototype.isPoints=!0;class r9 extends S{constructor(e,t,i,n,r,a,s,o,l){super(e,t,i,n,r,a,s,o,l),this.format=void 0!==s?s:1022,this.minFilter=void 0!==a?a:1006,this.magFilter=void 0!==r?r:1006,this.generateMipmaps=!1;let h=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(function t(){h.needsUpdate=!0,e.requestVideoFrameCallback(t)})}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;!1=="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}r9.prototype.isVideoTexture=!0;class ae extends S{constructor(e,t,i,n,r,a,s,o,l,h,u,c){super(null,a,s,o,l,h,n,r,u,c),this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}ae.prototype.isCompressedTexture=!0;class at extends S{constructor(e,t,i,n,r,a,s,o,l){super(e,t,i,n,r,a,s,o,l),this.needsUpdate=!0}}at.prototype.isCanvasTexture=!0;class ai extends S{constructor(e,t,i,n,r,a,s,o,l,h){if(1026!==(h=void 0!==h?h:1026)&&1027!==h)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&1026===h&&(i=1012),void 0===i&&1027===h&&(i=1020),super(null,n,r,a,s,o,h,i,l),this.image={width:e,height:t},this.magFilter=void 0!==s?s:1003,this.minFilter=void 0!==o?o:1003,this.flipY=!1,this.generateMipmaps=!1}}ai.prototype.isDepthTexture=!0;class an extends tm{constructor(e=1,t=8,i=0,n=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:n},t=Math.max(3,t);let r=[],a=[],s=[],o=[],l=new P,h=new _;a.push(0,0,0),s.push(0,0,1),o.push(.5,.5);for(let r=0,u=3;r<=t;r++,u+=3){let c=i+r/t*n;l.x=e*Math.cos(c),l.y=e*Math.sin(c),a.push(l.x,l.y,l.z),s.push(0,0,1),h.x=(a[u]/e+1)/2,h.y=(a[u+1]/e+1)/2,o.push(h.x,h.y)}for(let e=1;e<=t;e++)r.push(e,e+1,0);this.setIndex(r),this.setAttribute("position",new ti(a,3)),this.setAttribute("normal",new ti(s,3)),this.setAttribute("uv",new ti(o,2))}static fromJSON(e){return new an(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class ar extends tm{constructor(e=1,t=1,i=1,n=8,r=1,a=!1,s=0,o=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiu
vendor: 1,478 bytes, line 121
121sTop:e,radiusBottom:t,height:i,radialSegments:n,heightSegments:r,openEnded:a,thetaStart:s,thetaLength:o};let l=this;n=Math.floor(n),r=Math.floor(r);let h=[],u=[],c=[],d=[],p=0,m=[],f=i/2,g=0;function v(i){let r=p,a=new _,m=new P,v=0,y=!0===i?e:t,x=!0===i?1:-1;for(let e=1;e<=n;e++)u.push(0,f*x,0),c.push(0,x,0),d.push(.5,.5),p++;let b=p;for(let e=0;e<=n;e++){let t=e/n*o+s,i=Math.cos(t),r=Math.sin(t);m.x=y*r,m.y=f*x,m.z=y*i,u.push(m.x,m.y,m.z),c.push(0,x,0),a.x=.5*i+.5,a.y=.5*r*x+.5,d.push(a.x,a.y),p++}for(let e=0;e<n;e++){let t=r+e,n=b+e;!0===i?h.push(n,n+1,t):h.push(n+1,n,t),v+=3}l.addGroup(g,v,!0===i?1:2),g+=v}(function(){let a=new P,v=new P,y=0,x=(t-e)/i;for(let l=0;l<=r;l++){let h=[],g=l/r,y=g*(t-e)+e;for(let e=0;e<=n;e++){let t=e/n,r=t*o+s,l=Math.sin(r),m=Math.cos(r);v.x=y*l,v.y=-g*i+f,v.z=y*m,u.push(v.x,v.y,v.z),a.set(l,x,m).normalize(),c.push(a.x,a.y,a.z),d.push(t,1-g),h.push(p++)}m.push(h)}for(let e=0;e<n;e++)for(let t=0;t<r;t++){let i=m[t][e],n=m[t+1][e],r=m[t+1][e+1],a=m[t][e+1];h.push(i,n,a),h.push(n,r,a),y+=6}l.addGroup(g,y,0),g+=y})(),!1===a&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(h),this.setAttribute("position",new ti(u,3)),this.setAttribute("normal",new ti(c,3)),this.setAttribute("uv",new ti(d,2))}static fromJSON(e){return new ar(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class aa extends ar{constructor(e=1,t=1,i=8,n=1,r=!1,a=0,s=2*Math.PI){super(0,e,t,i,n,r,a,s),this.type="C
121oneGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:a,thetaLength:s}}static fromJSON(e){return new aa(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class as extends tm{constructor(e,t,i=1,n=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:n};let r=[],a=[];function s(e){r.push(e.x,e.y,e.z)}function o(t,i){let n=3*t;i.x=e[n+0],i.y=e[n+1],i.z=e[n+2]}function l(e,t,i,n){n<0&&1===e.x&&(a[t]=e.x-1),0===i.x&&0===i.z&&(a[t]=n/2/Math.PI+.5)}function h(e){return Math.atan2(e.z,-e.x)}(function(e){let i=new P,n=new P,r=new P;for(let a=0;a<t.length;a+=3)o(t[a+0],i),o(t[a+1],n),o(t[a+2],r),function(e,t,i,n){let r=n+1,a=[];for(let n=0;n<=r;n++){a[n]=[];let s=e.clone().lerp(i,n/r),o=t.clone().lerp(i,n/r),l=r-n;for(let e=0;e<=l;e++)a[n][e]=0===e&&n===r?s:s.clone().lerp(o,e/l)}for(let e=0;e<r;e++)for(let t=0;t<2*(r-e)-1;t++){let i=Math.floor(t/2);t%2==0?(s(a[e][i+1]),s(a[e+1][i]),s(a[e][i])):(s(a[e][i+1]),s(a[e+1][i+1]),s(a[e+1][i]))}}(i,n,r,e)})(n),function(e){let t=new P;for(let i=0;i<r.length;i+=3)t.x=r[i+0],t.y=r[i+1],t.z=r[i+2],t.normalize().multiplyScalar(e),r[i+0]=t.x,r[i+1]=t.y,r[i+2]=t.z}(i),function(){let e=new P;for(let t=0;t<r.length;t+=3){e.x=r[t+0],e.y=r[t+1],e.z=r[t+2];let i=h(e)/2/Math.PI+.5,n=Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))/Math.PI+.5;a.push(i,1-n)}(function(){let e=new P,t=new P,i=new P,n=new P,s=new _,o=new _,u=new _;for(let c=0,d=0;c<r.length;c+=9,d+=6){e.set(r[c+0],r[c+1],r[c+2]),t.set(r[c+3],r[c+4],r[c+5]),i.set(r[c+6],r[c+7],r[c+8]),s.set(a[d+0],a[d+1]),o.set(a[d+2],a[d+3]),u.set(a[d+4],a[d+5]),n.copy(e).add(t).add(i).divideScalar(3);let p=h(n);l(s,d+0,e,p),l(o,d+2,t,p),l(u,d+4,i,p)}})(),function(){for(let e=0;e<a.length;e+=6){let t=a[e+0],i=a[e+2],n=a[e+4],r=Math.max(t,i,n),s=Math.min(t,i,n);r>.9&&s<.1&&(t<.2&&(a[e+0]+=1),i<.2&&(a[e+2]+=1),n<.2&&(a[e+4]+=1))}}()}(),this.setAttribute("position",new ti(r,3)),this.setAttribute("normal",new ti(r.slice(),3)),this.setAttribute("uv",new ti(a,2)),0===n?this.computeVertexNormals():this.normalizeNormals()}static fromJSON(e){return new as(e.vertices,e.indices,e.radius,e.details)}}class ao extends as{constructor(e=1,t=0){let i=(1+Math.sqrt(5))/2,n=1/i;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-i,0,-n,i,0,n,-i,0,n,i,-n,-i,0,-n,i,0,n,-i,0,n,i,0,-i,0,-n,i,0,-n,-i,0,n,i,0,n],[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,
12119,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new ao(e.radius,e.detail)}}let al=new P,ah=new P,au=new P,ac=new eW;class ad extends tm{constructor(e,t){if(super(),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=void 0!==t?t:1,!0===e.isGeometry)return void console.error("THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");let i=Math.cos(u*t),n=e.getIndex(),r=e.getAttribute("position"),a=n?n.count:r.count,s=[0,0,0],o=["a","b","c"],l=[,,,],h={},c=[];for(let e=0;e<a;e+=3){n?(s[0]=n.getX(e),s[1]=n.getX(e+1),s[2]=n.getX(e+2)):(s[0]=e,s[1]=e+1,s[2]=e+2);let{a:t,b:a,c:u}=ac;if(t.fromBufferAttribute(r,s[0]),a.fromBufferAttribute(r,s[1]),u.fromBufferAttribute(r,s[2]),ac.getNormal(au),l[0]=`${Math.round(1e4*t.x)},${Math.round(1e4*t.y)},${Math.round(1e4*t.z)}`,l[1]=`${Math.round(1e4*a.x)},${Math.round(1e4*a.y)},${Math.round(1e4*a.z)}`,l[2]=`${Math.round(1e4*u.x)},${Math.round(1e4*u.y)},${Math.round(1e4*u.z)}`,l[0]!==l[1]&&l[1]!==l[2]&&l[2]!==l[0])for(let e=0;e<3;e++){let t=(e+1)%3,n=l[e],r=l[t],a=ac[o[e]],u=ac[o[t]],d=`${n}_${r}`,p=`${r}_${n}`;p in h&&h[p]?(au.dot(h[p].normal)<=i&&(c.push(a.x,a.y,a.z),c.push(u.x,u.y,u.z)),h[p]=null):d in h||(h[d]={index0:s[e],index1:s[t],normal:au.clone()})}}for(let e in h)if(h[e]){let{index0:t,index1:i}=h[e];al.fromBufferAttribute(r,t),ah.fromBufferAttribute(r,i),c.push(al.x,al.y,al.z),c.push(ah.x,ah.y,ah.z)}this.setAttribute("position",new ti(c,3))}}class ap{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){let i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){let t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){let t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){let e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let t=[],i,n=this.getPoint(0),r=0;t.push(0);for(let a=1;a<=e;a++)t.push(r+=(i=this.getPoint(a/e)).distanceTo(n)),n=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){let i;let n=this.getLengths(),r=0,a=n.length;i=t||e*n[a-1];let s,o=0,l=a-1;for(;o<=l;)if((s=n[r=Math.floor(o+(l-o)/2)]-i)<0)o=r+1;else{if(!(s>0)){l=r;break}l=r-1}if(n[r=l]===i)return r/(a-1);let h=n[r];return(r+(i-h)/(n[r+1]-h))/(a-1)}getTangent(e,t){let i=e-1e-4,n=e+1e-4;i<0&&(i=0),n>1&&(n=1);let r=this.getPoint(i),a=this.getPoint(n),s=t||(r.isVector2?new _:new P);return s.copy(a).sub(r).normalize(),s}getTangentAt(e,t){let i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){let i=new P,n=[],r=[],a=[],s=new P,o=new el;for(let t=0;t<=e;t++){let i=t/e;n[t]=this.getTangentAt(i,new P),n[t].normalize()}r[0]=new P,a[0]=new P;let l=Number.MAX_VALUE,h=Math.abs(n[0].x),u=Math.abs(n[0].y),c=Math.abs(n[0].z);h<=l&&(l=h,i.set(1,0,0)),u<=l&&(l=u,i.set(0,1,0)),c<=l&&i.set(0,0,1),s.crossVectors(n[0],i).normalize(),r[0].crossVectors(n[0],s),a[0].crossVectors(n[0],r[0]);for(let t=1;t<=e;t++){if(r[t]=r[t-1].clone(),a[t]=a[t-1].clone(),s.crossVectors(n[t-1],n[t]),s.length()>Number.EPSILON){s.normalize();let e=Math.acos(p(n[t-1].dot(n[t]),-1,1));r[t].applyMatrix4(o.makeRotationAxis(s,e))}a[t].crossVectors(n[t],r[t])}if(!0===t){let t=Math.acos(p(r[0].dot(r[e]),-1,1));t/=e,n[0].dot(s.crossVectors(r[0],r[e]))>0&&(t=-t);for(let i=1;i<=e;i++)r[i].applyMatrix4(o.makeRotationAxis(n[i],t*i)),a[i].crossVectors(n[i],r[i])}return{tangents:n,normals:r,binormals:a}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class am extends ap{constructor(e=0,t=0,i=1,n=1,r=0,a=2*Math.PI,s=!1,o=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=n,this.aStartAngle=r,this.aEndAngle=a,this.aClockwise=s,this.aRotation=o}getPoint(e,t){let i=t||new _,n=2*Math.PI,r=this.aEndAngle-this.aStartAngle,a=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=n;for(;r>n;)r-=n;r<Number.EPSILON&&(r=a?0:n),!0!==this.aClockwise||a||(r===n?r=-n:r-=n);let s=this.aStartAngle+e*r,o=this.aX+this.xRadius*Math.cos(s),l=this.aY+this.yRadius*Math.sin(s);if(0!==this.aRotation){let e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),i=o-this.aX,n=l-this.aY;o=i*e-n*t+this.aX,l=i*t+n*e+this.aY}return i.set(o,l)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){let e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}am.prototype.isEllipseCurve=!0;class af extends am{constructor(e,t,i,n,r,a){super(e,t,i,i,n,r,a),this.type="ArcCurve"}}function ag(){let e=0,t=0,i=0,n=0;function r(r,a,s,o){e=r,t=s,i=-3*r+3*a-2*s-o,n=2*r-2*a+s+o}return{initCatmullRom:function(e,t,i,n,a){r(t,i,a*(i-e),a*(n-t))},initNonuniformCatmullRom:function(e,t,i,n,a,s,o){let l=(t-e)/a-(i-e)/(a+s)+(i-t)/s,h=(i-t)/s-(n-t)/(s+o)+(n-i)/o;r(t,i,l*=s,h*=s)},calc:function(r){let a=r*r;return e+t*r+i*a+a*r*n}}}af.prototype.isArcCurve=!0;let av=new P,ay=new ag,ax=new ag,a_=new ag;class ab extends ap{constructor(e=[],t=!1,i="centripetal",n=.5){super(),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=i,this.tension=n}getPoint(e,t=new P){let i=this.points,n=i.length,r=(n-(this.closed?0:1))*e,a,s,o=Math.floor(r),l=r-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/n)+1)*n:0===l&&o===n-1&&(o=n-2,l=1),this.closed||o>0?a=i[(o-1)%n]:(av.subVectors(i[0],i[1]).add(i[0]),a=av);let h=i[o%n],u=i[(o+1)%n];if(this.closed||o+2<n?s=i[(o+2)%n]:(av.subVectors(i[n-1],i[n-2]).add(i[n-1]),s=av),"centripetal"===this.curveType||"chordal"===this.curveType){let e="chordal"===this.curveType?.5:.25,t=Math.pow(a.distanceToSquared(h),e),i=Math.pow(h.distanceToSquared(u),e),n=Math.pow(u.distanceToSquared(s),e);i<1e-4&&(i=1),t<1e-4&&(t=i),n<1e-4&&(n=i),ay.initNonuniformCatmullRom(a.x,h.x,u.x,s.x,t,i,n),ax.initNonuniformCatmullRom(a.y,h.y,u.y,s.y,t,i,n),a_.initNonuniformCatmullRom(a.z,h.z,u.z,s.z,t,i,n)}else"catmullrom"===this.curveType&&(ay.initCatmullRom(a.x,h.x,u.x,s.x,this.tension),ax.initCatmullRom(a.y,h.y,u.y,s.y,this.tension),a_.initCatmullRom(a.z,h.z,u.z,s.z,this.tension));return t.set(ay.calc(l),ax.calc(l),a_.calc(l)),t}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){let i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){let i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){let i=e.points[t];this.points.push((new P).fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function aM(e,t,i,n,r){let a=.5*(n-t),s=.5*(r-i),o=e*e;return e*o*(2*i-2*n+a+s)+(-3*i+3*n-2*a-s)*o+a*e+i}function aw(e,t,i,n){return function(e,t){let i=1-e;return i*i*t}(e,t)+2*(1-e)*e*i+e*e*n}function aS(e,t,i,n,r){return function(e,t){let i=1-e;return i*i*i*t}(e,t)+function(e,t){let i=1-e;return 3*i*i*e*t}(e,i)+3*(1-e)*e*e*n+e*e*e*r}ab.prototype.isCatmullRomCurve3=!0;class aT extends ap{constructor(e=new _,t=new _,i=new _,n=new _){super(),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=i,this.v3=n}getPoint(e,t=new _){let i=this.v0,n=this.v1,r=this.v2,a=this.v3;return t.set(aS(e,i.x,n.x,r.x,a.x),aS(e,i.y,n.y,r.y,a.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}aT.prototype.isCubicBezierCurve=!0;class aE extends ap{constructor(e=new P,t=new P,i=new P,n=new P){super(),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=i,this.v3=n}getPoint(e,t=new P){let i=this.v0,n=this.v1,r=this.v2,a=this.v3;return t.set(aS(e,i.x,n.x,r.x,a.x),aS(e,i.y,n.y,r.y,a.y),aS(e,i.z,n.z,r.z,a.z)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}aE.prototype.isCubicBezierCurve3=!0;class aA extends ap{constructor(e=new _,t=new _){super(),this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new _){return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){let i=t||new _;return i.copy(this.v2).sub(this.v1).normalize(),i}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}aA.prototype.isLineCurve=!0;class aL extends ap{constructor(e=new P,t=new P){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new P){return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class aR extends ap{constructor(e=new _,t=new _,i=new _){super(),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=i}
121getPoint(e,t=new _){let i=this.v0,n=this.v1,r=this.v2;return t.set(aw(e,i.x,n.x,r.x),aw(e,i.y,n.y,r.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}aR.prototype.isQuadraticBezierCurve=!0;class aC extends ap{constructor(e=new P,t=new P,i=new P){super(),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new P){let i=this.v0,n=this.v1,r=this.v2;return t.set(aw(e,i.x,n.x,r.x),aw(e,i.y,n.y,r.y),aw(e,i.z,n.z,r.z)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}aC.prototype.isQuadraticBezierCurve3=!0;class aP extends ap{constructor(e=[]){super(),this.type="SplineCurve",this.points=e}getPoint(e,t=new _){let i=this.points,n=(i.length-1)*e,r=Math.floor(n),a=n-r,s=i[0===r?r:r-1],o=i[r],l=i[r>i.length-2?i.length-1:r+1],h=i[r>i.length-3?i.length-1:r+2];return t.set(aM(a,s.x,o.x,l.x,h.x),aM(a,s.y,o.y,l.y,h.y)),t}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){let i=e.points[t];this.points.push(i.clone())}return this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){let i=this.points[t];e.points.push(i.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){let i=e.points[t];this.points.push((new _).fromArray(i))}return this}}aP.prototype.isSplineCurve=!0;var aI=Object.freeze({__proto__:null,ArcCurve:af,CatmullRomCurve3:ab,CubicBezierCurve:aT,CubicBezierCurve3:aE,EllipseCurve:am,LineCurve:aA,LineCurve3:aL,QuadraticBezierCurve:aR,QuadraticBezierCurve3:aC,SplineCurve:aP});let aD=function(e,t,i=2){let n,r,a,s,o,l,h;let u=t&&t.length,c=u?t[0]*i:e.length,d=aN(e,0,c,i,!0),p=[];if(!d||d.next===d.prev)return p;if(u&&(d=function(e,t,i,n){let r,a,s,o,l;let h=[];for(r=0,a=t.length;r<a;r++)s=t[r]*n,o=r<a-1?t[r+1]*n:e.length,(l=aN(e,s,o,n,!1))===l.next&&(l.steiner=!0),h.push(function(e){let t=e,i=e;do(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next;while(t!==e);return i}(l));for(h.sort(aB),r=0;r<h.length;r++)(function(e,t){if(t=function(e,t){let i=t,n=e.x,r=e.y,a,s=-1/0;do{if(r<=i.y&&r>=i.next.y&&i.next.y!==i.y){let e=i.x+(r-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(e<=n&&e>s){if(s=e,e===n){if(r===i.y)return i;if(r===i.next.y)return i.next}a=i.x<i.next.x?i:i.next}}i=i.next}while(i!==t);if(!a)return null;if(n===s)return a;let o=a,l=a.x,h=a.y,u,c=1/0;i=a;do{var d,p;n>=i.x&&i.x>=l&&n!==i.x&&aO(r<h?n:s,r,l,h,r<h?s:n,r,i.x,i.y)&&(u=Math.abs(r-i.y)/(n-i.x),aW(i,e)&&(u<c||u===c&&(i.x>a.x||i.x===a.x&&(d=a,p=i,0>aU(d.prev,d,p.prev)&&0>aU(p.next,d,d.next))))&&(a=i,c=u)),i=i.next}while(i!==o);return a}(e,t)){let i=aj(t,e);az(t,t.next),az(i,i.next)}})(h[r],i),i=az(i,i.next);return i}(e,t,d,i)),e.length>80*i){n=a=e[0],r=s=e[1];for(let t=i;t<c;t+=i)o=e[t],l=e[t+1],o<n&&(n=o),l<r&&(r=l),o>a&&(a=o),l>s&&(s=l);h=0!==(h=Math.max(a-n,s-r))?1/h:0}return function e(t,i,n,r,a,s,o){if(!t)return;!o&&s&&function(e,t,i,n){let r=e;do null===r.z&&(r.z=aF(r.x,r.y,t,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){let t,i,n,r,a,s,o,l,h=1;do{for(i=e,e=null,a=null,s=0;i;){for(s++,n=i,o=0,t=0;t<h&&(o++,n=n.nextZ);t++);for(l=h;o>0||l>0&&n;)0!==o&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,o--):(r=n,n=n.nextZ,l--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;i=n}a.nextZ=null,h*=2}while(s>1)}(r)}(t,r,a,s);let l,h,u=t;for(;t.prev!==t.next;)if(l=t.prev,h=t.next,s?function(e,t,i,n){let r=e.prev,a=e.next;if(aU(r,e,a)>=0)return!1;let s=r.x<e.x?r.x<a.x?r.x:a.x:e.x<a.x?e.x:a.x,o=r.y<e.y?r.y<a.y?r.y:a.y:e.y<a.y?e.y:a.y,l=r.x>e.x?r.x>a.x?r.x:a.x:e.x>a.x?e.x:a.x,h=r.y>e.y?r.y>a.y?r.y:a.y:e.y>a.y?e.y:a.y,u=aF(s,o,t,i,n),c=aF(l,h,t,i,n),d=e.prevZ,p=e.nextZ;for(;d&&d.z>=u&&p&&p.z<=c;){if(d!==e.prev&&d!==e.next&&aO(r.x,r.y,e.x,e.y,a.x,a.y,d.x,d.y)&&aU(d.prev,d,d.next)>
121=0||(d=d.prevZ,p!==e.prev&&p!==e.next&&aO(r.x,r.y,e.x,e.y,a.x,a.y,p.x,p.y)&&aU(p.prev,p,p.next)>=0))return!1;p=p.nextZ}for(;d&&d.z>=u;){if(d!==e.prev&&d!==e.next&&aO(r.x,r.y,e.x,e.y,a.x,a.y,d.x,d.y)&&aU(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;p&&p.z<=c;){if(p!==e.prev&&p!==e.next&&aO(r.x,r.y,e.x,e.y,a.x,a.y,p.x,p.y)&&aU(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}(t,r,a,s):function(e){let t=e.prev,i=e.next;if(aU(t,e,i)>=0)return!1;let n=e.next.next;for(;n!==e.prev;){if(aO(t.x,t.y,e.x,e.y,i.x,i.y,n.x,n.y)&&aU(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}(t))i.push(l.i/n),i.push(t.i/n),i.push(h.i/n),aX(t),t=h.next,u=h.next;else if((t=h)===u){o?1===o?e(t=function(e,t,i){let n=e;do{let r=n.prev,a=n.next.next;!aH(r,a)&&aG(r,n,n.next,a)&&aW(r,a)&&aW(a,r)&&(t.push(r.i/i),t.push(n.i/i),t.push(a.i/i),aX(n),aX(n.next),n=e=a),n=n.next}while(n!==e);return az(n)}(az(t),i,n),i,n,r,a,s,2):2===o&&function(t,i,n,r,a,s){let o=t;do{let t=o.next.next;for(;t!==o.prev;){var l,h;if(o.i!==t.i&&(l=o,h=t,l.next.i!==h.i&&l.prev.i!==h.i&&!function(e,t){let i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&aG(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}(l,h)&&(aW(l,h)&&aW(h,l)&&function(e,t){let i=e,n=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;do i.y>a!=i.next.y>a&&i.next.y!==i.y&&r<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next;while(i!==e);return n}(l,h)&&(aU(l.prev,l,h.prev)||aU(l,h.prev,h))||aH(l,h)&&aU(l.prev,l,l.next)>0&&aU(h.prev,h,h.next)>0))){let l=aj(o,t);return o=az(o,o.next),l=az(l,l.next),e(o,i,n,r,a,s),void e(l,i,n,r,a,s)}t=t.next}o=o.next}while(o!==t)}(t,i,n,r,a,s):e(az(t),i,n,r,a,s,1);break}}(d,p,i,n,r,h),p};function aN(e,t,i,n,r){let a,s;if(r===function(e,t,i,n){let r=0;for(let a=t,s=i-n;a<i;a+=n)r+=(e[s]-e[a])*(e[a+1]+e[s+1]),s=a;return r}(e,t,i,n)>0)for(a=t;a<i;a+=n)s=aq(a,e[a],e[a+1],s);else for(a=i-n;a>=t;a-=n)s=aq(a,e[a],e[a+1],s);return s&&aH(s,s.next)&&(aX(s),s=s.next),s}function az(e,t){if(!e)return e;t||(t=e);let i,n=e;do if(i=!1,n.steiner||!aH(n,n.next)&&0!==aU(n.prev,n,n.next))n=n.next;else{if(aX(n),(n=t=n.prev)===n.next)break;i=!0}while(i||n!==t);return t}function aB(e,t){return e.x-t.x}function aF(e,t,i,n,r){return(e=0x55555555&((e=0x33333333&((e=0xf0f0f0f&((e=0xff00ff&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=0x55555555&((t=0x33333333&((t=0xf0f0f0f&((t=0xff00ff&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function aO(e,t,i,n,r,a,s,o){return(r-s)*(t-o)-(e-s)*(a-o)>=0&&(e-s)*(n-o)-(i-s)*(t-o)>=0&&(i-s)*(a-o)-(r-s)*(n-o)>=0}function aU(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function aH(e,t){return e.x===t.x&&e.y===t.y}function aG(e,t,i,n){let r=aV(aU(e,t,i)),a=aV(aU(e,t,n)),s=aV(aU(i,n,e)),o=aV(aU(i,n,t));return r!==a&&s!==o||!(0!==r||!ak(e,i,t))||!(0!==a||!ak(e,n,t))||
121!(0!==s||!ak(i,e,n))||!(0!==o||!ak(i,t,n))}function ak(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function aV(e){return e>0?1:e<0?-1:0}function aW(e,t){return 0>aU(e.prev,e,e.next)?aU(e,t,e.next)>=0&&aU(e,e.prev,t)>=0:0>aU(e,t,e.prev)||0>aU(e,e.next,t)}function aj(e,t){let i=new aY(e.i,e.x,e.y),n=new aY(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,i.next=r,r.prev=i,n.next=i,i.prev=n,a.next=n,n.prev=a,n}function aq(e,t,i,n){let r=new aY(e,t,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function aX(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 aY(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}class aJ{static area(e){let t=e.length,i=0;for(let n=t-1,r=0;r<t;n=r++)i+=e[n].x*e[r].y-e[r].x*e[n].y;return .5*i}static isClockWise(e){return 0>aJ.area(e)}static triangulateShape(e,t){let i=[],n=[],r=[];aZ(e),aQ(i,e);let a=e.length;t.forEach(aZ);for(let e=0;e<t.length;e++)n.push(a),a+=t[e].length,aQ(i,t[e]);let s=aD(i,n);for(let e=0;e<s.length;e+=3)r.push(s.slice(e,e+3));return r}}function aZ(e){let t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function aQ(e,t){for(let i=0;i<t.length;i++)e.push(t[i].x),e.push(t[i].y)}class aK extends tm{constructor(e,t){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];let i=this,n=[],r=[];for(let a=0,s=e.length;a<s;a++)(function(e){let a=[],s=void 0!==t.curveSegments?t.curveSegments:12,o=void 0!==t.steps?t.steps:1,l=void 0!==t.depth?t.depth:100,h=void 0===t.bevelEnabled||t.bevelEnabled,u=void 0!==t.bevelThickness?t.bevelThickness:6,c=void 0!==t.bevelSize?t.bevelSize:u-2,d=void 0!==t.bevelOffset?t.bevelOffset:0,p=void 0!==t.bevelSegments?t.bevelSegments:3,m=t.extrudePath,f=void 0!==t.UVGenerator?t.UVGenerator:a$;void 0!==t.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),l=t.amount);let g,v,y,x,b,M=!1;m&&(g=m.getSpacedPoints(o),M=!0,h=!1,v=m.computeFrenetFrames(o,!1),y=new P,x=new P,b=new P),h||(p=0,u=0,c=0,d=0);let w=e.extractPoints(s),S=w.shape,T=w.holes;if(!aJ.isClockWise(S)){S=S.reverse();for(let e=0,t=T.length;e<t;e++){let t=T[e];aJ.isClockWise(t)&&(T[e]=t.reverse())}}let E=aJ.triangulateShape(S,T),A=S;for(let e=0,t=T.length;e<t;e++){let t=T[e];S=S.concat(t)}function L(e,t,i){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(i).add(e)}let R=S.length,C=E.length;function I(e,t,i){let n,r,a;let s=e.x-t.x,o=e.y-t.y,l=i.x-e.x,h=i.y-e.y,u=s*s+o*o;if(Math.abs(s*h-o*l)>Number.EPSILON){let c=Math.sqrt(u),d=Math.sqrt(l*l+h*h),p=t.x-o/c,m=t.y+s/c,f=((i.x-h/d-p)*h-(i.y+l/d-m)*l)/(s*h-o*l),g=(n=p+s*f-e.x)*n+(r=m+o*f-e.y)*r;if(g<=2)return new _(n,r);a=Math.sqrt(g/2)}else{let e=!1;s>Number.EPSILON?l>Number.EPSILON&&(e=!0):s<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(o)===Math.sign(h)&&(e=!0),e?(n=-o,r=s,a=Math.sqrt(u)):(n=s,r=o,a=Math.sqrt(u/2))}return new _(n/a,r/a)}let D=[];for(let e=0,t=A.length,i=t-1,n=e+1;e<t;e++,i++,n++)i===t&&(i=0),n===t&&(n=0),D[e]=I(A[e],A[i],A[n]);let N=[],z,B=D.concat();for(let e=0,t=T.length;e<t;e++){let t=T[e];z=[];for(let e=0,i=t.length,n=i-1,r=e+1;e<i;e++,n++,r++)n===i&&(n=0),r===i&&(r=0),z[e]=I(t[e],t[n],t[r]);N.push(z),B=B.concat(z)}for(let e=0;e<p;e++){let t=e/p,i=u*Math.cos(t*Math.PI/2),n=c*Math.sin(t*Math.PI/2)+d;for(let e=0,t=A.length;e<t;e++){let t=L(A[e],D[e],n);U(t.x,t.y,-i)}for(let e=0,t=T.length;e<t;e++){let t=T[e];z=N[e];for(let e=0,r=t.length;e<r;e++){let r=L(t[e],z[e],n);U(r.x,r.y,-i)}}}let F=c+d;for(let e=0;e<R;e++){let t=h?L(S[e],B[e],F):S[e];M?(x.copy(v.normals[0]).multiplyScalar(t.x),y.copy(v.binormals[0]).multiplyScalar(t.y),b.copy(g[0]).add(x).add(y),U(b.x,b.y,b.z)):U(t.x,t.y,0)}for(let e=1;e<=o;e++)for(let t=0;t<R;t++){let i=h?L(S[t],B[t],F):S[t];M?(x.copy(v.normals[e]).multiplyScalar(i.x),y.copy(v.binormals[e]).multiplyScalar(i.y),b.copy(g[e]).add(x).add(y),U(b.x,b.y,b.z)):U(i.x,i.y,l/o*e)}for(let e=p-1;e>=0;e--){let t=e/p,i=u*Math.cos(t*Math.PI/2),n=c*Math.sin(t*Math.PI/2)+d;for(let e=0,t=A.length;e<t;e++){let t=L(A[e],D[e],n);U(t.x,t.y,l+i)}for(let e=0,t=T.length;e<t;e++){let t=T[e];z=N[e];for(let e=0,r=t.length;e<r;e++){let r=L(t[e],z[e],n);M?U(r.x,r.y+g[o-1].y,g[o-1].x+i):U(r.x,r.y,l+i)}}}function O(e,t){let r=e.length;for(;--r>=0;){let a=r,s=r-1;s<0&&(s=e.length-1);for(let e=0,r=o+2*p;e<r;e++){let r=R*e,o=R*(e+1);(function(e,t,r,a){G(e),G(t),G(a),G(t),G(r),G(a);let s=n.length/3,o=f.generateSideWallUV(i,n,s-6,s-3,s-2,s-1);k(o[0]),k(o[1]),k(o[3]),k(o[1]),k(o[2]),k(o[3])})(t+a+r,t+s+r,t+s+o,t+a+o)}}}function U(e,t,i){a.push(e),a.push(t),a.push(i)}function H(e,t,r){G(e),G(t),G(r);let a=n.length/3,s=f.generateTopUV(i,n,a-3,a-2,a-1);k(s[0]),k(s[1]),k(s[2])}function G(e){n.push(a[3*e+0]),n.push(a[3*e+1]),n.push(a[3*e+2])}function k(e){r.push(e.x),r.push(e.y)}(function(){let e=n.length/3;if(h){let e=0*R;for(let t=0;t<C;t++){let i=E[t];H(i[2]+e,i[1]+e,i[0]+e)}e=R*(o+2*p);for(let t=0;t<C;t++){let i=E[t];H(i[0]+e,i[1]+e,i[2]+e)}}else{for(let e=0;e<C;e++){let t=E[e];H(t[2],t[1],t[0])}for(let e=0;e<C;e++){let t=E[e];H(t[0]+R*o,t[1]+R*o,t[2]+R*o)}}i.addGroup(e,n.length/3-e,0)})(),function(){let e=n.length/3,t=0;O(A,0),t+=A.length;for(let e=0,i=T.length;e<i;e++){let i=T[e];O(i,t),t+=i.length}i.addGroup(e,n.length/3-e,1)}()})(e[a]);this.setAttribute("position",new ti(n,3)),this.setAttribute("uv",new ti(r,2)),this.computeVertexNormals()}toJSON(){let e=super.toJSON();return function(e,t,i){if(i.shapes=[],Array.isArray(e))for(let t=0,n=e.length;t<n;t++){let n=e[t];i.shapes.push(n.uuid)}else i.shapes.push(e.uuid);return void 0!==t.extrudePath&&(i.options.extrudePath=t.extrudePath.toJSON()),i}(this.parameters.shapes,this.parameters.options,e)}static fromJSON(e,t){let i=[];for(let n=0,r=e.shapes.length;n<r;n++){let r=t[e.shapes[n]];i.push(r)}let n=e.options.extrudePath;return void 0!==n&&(e.options.extrudePath=(new aI[n.type]).fromJSON(n)),new aK(i,e.options)}}let a$={generateTopUV:function(e,t,i,n,r){let a=t[3*i],s=t[3*i+1],o=t[3*n],l=t[3*n+1],h=t[3*r],u=t[3*r+1];return[new _(a,s),new _(o,l),new _(h,u)]},generateSideWallUV:function(e,t,i,n,r,a){let s=t[3*i],o=t[3*i+1],l=t[3*i+2],h=t[3*n],u=t[3*n+1],c=t[3*n+2],d=t[3*r],p=t[3*r+1],m=t[3*r+2],f=t[3*a],g=t[3*a+1],v=t[3*a+2];return Math.abs(o-u)<Math.abs(s-h)?[new _(s,1-l),new _(h,1-c),new _(d,1-m),new _(f,1-v)]:[new _(o,1-l),new _(u,1-c),new _(p,1-m),new _(g,1-v)]}};class a0 extends as{constructor(e=1,t=0){let i=(1+Math.sqrt(5))/2;super([-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronGeometry",this.parameters={radiu
121s:e,detail:t}}static fromJSON(e){return new a0(e.radius,e.detail)}}class a1 extends tm{constructor(e,t=12,i=0,n=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:n},t=Math.floor(t),n=p(n,0,2*Math.PI);let r=[],a=[],s=[],o=1/t,l=new P,h=new _;for(let r=0;r<=t;r++){let u=i+r*o*n,c=Math.sin(u),d=Math.cos(u);for(let i=0;i<=e.length-1;i++)l.x=e[i].x*c,l.y=e[i].y,l.z=e[i].x*d,a.push(l.x,l.y,l.z),h.x=r/t,h.y=i/(e.length-1),s.push(h.x,h.y)}for(let i=0;i<t;i++)for(let t=0;t<e.length-1;t++){let n=t+i*e.length,a=n+e.length,s=n+e.length+1,o=n+1;r.push(n,a,o),r.push(a,s,o)}if(this.setIndex(r),this.setAttribute("position",new ti(a,3)),this.setAttribute("uv",new ti(s,2)),this.computeVertexNormals(),n===2*Math.PI){let i=this.attributes.normal.array,n=new P,r=new P,a=new P,s=t*e.length*3;for(let t=0,o=0;t<e.length;t++,o+=3)n.x=i[o+0],n.y=i[o+1],n.z=i[o+2],r.x=i[s+o+0],r.y=i[s+o+1],r.z=i[s+o+2],a.addVectors(n,r).normalize(),i[o+0]=i[s+o+0]=a.x,i[o+1]=i[s+o+1]=a.y,i[o+2]=i[s+o+2]=a.z}}static fromJSON(e){return new a1(e.points,e.segments,e.phiStart,e.phiLength)}}class a3 extends as{constructor(e=1,t=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new a3(e.radius,e.detail)}}class a2 extends tm{constructor(e,t,i){super(),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:i};let n=[],r=[],a=[],s=[],o=new P,l=new P,h=new P,u=new P,c=new P;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");let d=t+1;for(let n=0;n<=i;n++){let d=n/i;for(let i=0;i<=t;i++){let n=i/t;e(n,d,l),r.push(l.x,l.y,l.z),n-1e-5>=0?(e(n-1e-5,d,h),u.subVectors(l,h)):(e(n+1e-5,d,h),u.subVectors(h,l)),d-1e-5>=0?(e(n,d-1e-5,h),c.subVectors(l,h)):(e(n,d+1e-5,h),c.subVectors(h,l)),o.crossVectors(u,c).normalize(),a.push(o.x,o.y,o.z),s.push(n,d)}}for(let e=0;e<i;e++)for(let i=0;i<t;i++){let t=e*d+i,r=e*d+i+1,a=(e+1)*d+i+1,s=(e+1)*d+i;n.push(t,r,s),n.push(r,a,s)}this.setIndex(n),this.setAttribute("position",new ti(r,3)),this.setAttribute("normal",new ti(a,3)),this.setAttribute("uv",new ti(s,2))}}class a4 extends tm{constructor(e=.5,t=1,i=8,n=1,r=0,a=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:n,thetaStart:r,thetaLength:a},i=Math.max(3,i);let s=[],o=[],l=[],h=[],u=e,c=(t-e)/(n=Math.max(1,n)),d=new P,p=new _;for(let e=0;e<=n;e++){for(let e=0;e<=i;e++){let n=r+e/i*a;d.x=u*Math.cos(n),d.y=u*Math.sin(n),o.push(d.x,d.y,d.z),l.push(0,0,1),p.x=(d.x/t+1)/2,p.y=(d.y/t+1)/2,h.push(p.x,p.y)}u+=c}for(let e=0;e<n;e++){let t=e*(i+1);for(let e=0;e<i;e++){let n=e+t,r=n+i+1,a=n+i+2,o=n+1;s.push(n,r,o),s.push(r,a,o)}}this.setIndex(s),this.setAttribute("position",new ti(o,3)),this.setAttribute("normal",new ti(l,3)),this.setAttribute("uv",new ti(h,2))}static fromJSON(e){return new a4(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class a5 extends tm{constructor(e,t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};let i=[],n=[],r=[],a=[],s=0,o=0;if(!1===Array.isArray(e))l(e);else for(let t=0;t<e.length;t++)l(e[t]),this.addGroup(s,o,t),s+=o,o=0;function l(e){let s=n.length/3,l=e.extractPoints(t),h=l.shape,u=l.holes;!1===aJ.isClockWise(h)&&(h=h.reverse());for(let e=0,t=u.length;e<t;e++){let t=u[e];!0===aJ.isClockWise(t)&&(u[e]=t.reverse())}let c=aJ.triangulateShape(h,u);for(let e=0,t=u.length;e<t;e++){let t=u[e];h=h.concat(t)}for(let e=0,t=h.length;e<t;e++){let t=h[e];n.push(t.x,t.y,0),r.push(0,0,1),a.push(t.x,t.y)}for(let e=0,t=c.length;e<t;e++){let t=c[e],n=t[0]+s,r=t[1]+s,a=t[2]+s;i.push(n,r,a),o+=3}}this.setIndex(i),this.setAttribute("position",new ti(n,3)),this.setAttribute("normal",new ti(r,3)),this.setAttribute("uv",new ti(a,2))}toJSON(){let e=super.toJSON();return function(e,t){if(t.shapes=[],Array.isArray(e))for(let i=0,n=e.length;i<n;i++){let n=e[i];t.shapes.push(n.uuid)}else t.shapes.push(e.uuid);return t}(this.parameters.shapes,e)}static fromJSON(e,t){let i=[];for(let n=0,r=e.shapes.length;n<r;n++){let r=t[e.shapes[n]];i.push(r)}return new a5(i,e.curveSegments)}}class a6 extends tm{constructor(e=1,t=32,i=16,n=0,r=2*Math.PI,a=0,s=Math.PI){super(),this.type="SphereGeometry",this.parameters={radiu
121s:e,widthSegments:t,heightSegments:i,phiStart:n,phiLength:r,thetaStart:a,thetaLength:s},t=Math.max(3,Math.floor(t)),i=Math.max(2,Math.floor(i));let o=Math.min(a+s,Math.PI),l=0,h=[],u=new P,c=new P,d=[],p=[],m=[],f=[];for(let d=0;d<=i;d++){let g=[],v=d/i,y=0;0==d&&0==a?y=.5/t:d==i&&o==Math.PI&&(y=-.5/t);for(let i=0;i<=t;i++){let o=i/t;u.x=-e*Math.cos(n+o*r)*Math.sin(a+v*s),u.y=e*Math.cos(a+v*s),u.z=e*Math.sin(n+o*r)*Math.sin(a+v*s),p.push(u.x,u.y,u.z),c.copy(u).normalize(),m.push(c.x,c.y,c.z),f.push(o+y,1-v),g.push(l++)}h.push(g)}for(let e=0;e<i;e++)for(let n=0;n<t;n++){let t=h[e][n+1],r=h[e][n],s=h[e+1][n],l=h[e+1][n+1];(0!==e||a>0)&&d.push(t,r,l),(e!==i-1||o<Math.PI)&&d.push(r,s,l)}this.setIndex(d),this.setAttribute("position",new ti(p,3)),this.setAttribute("normal",new ti(m,3)),this.setAttribute("uv",new ti(f,2))}static fromJSON(e){return new a6(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class a8 extends as{constructor(e=1,t=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new a8(e.radius,e.detail)}}class a7 extends aK{constructor(e,t={}){let i=t.font;if(!i||!i.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new tm;let n=i.generateShapes(e,t.size);t.depth=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),super(n,t),this.type="TextGeometry"}}class a9 extends tm{constructor(e=1,t=.4,i=8,n=6,r=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:n,arc:r},i=Math.floor(i),n=Math.floor(n);let a=[],s=[],o=[],l=[],h=new P,u=new P,c=new P;for(let a=0;a<=i;a++)for(let d=0;d<=n;d++){let p=d/n*r,m=a/i*Math.PI*2;u.x=(e+t*Math.cos(m))*Math.cos(p),u.y=(e+t*Math.cos(m))*Math.sin(p),u.z=t*Math.sin(m),s.push(u.x,u.y,u.z),h.x=e*Math.cos(p),h.y=e*Math.sin(p),c.subVectors(u,h).normalize(),o.push(c.x,c.y,c.z),l.push(d/n),l.push(a/i)}for(let e=1;e<=i;e++)for(let t=1;t<=n;t++){let i=(n+1)*e+t-1,r=(n+1)*(e-1)+t-1,s=(n+1)*(e-1)+t,o=(n+1)*e+t;a.push(i,r,o),a.push(r,s,o)}this.setIndex(a),this.setAttribute("position",new ti(s,3)),this.setAttribute("normal",new ti(o,3)),this.setAttribute("uv",new ti(l,2))}static fromJSON(e){return new a9(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class se extends tm{constructor(e=1,t=.4,i=64,n=8,r=2,a=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:n,p:r,q:a},i=Math.floor(i),n=Math.floor(n);let s=[],o=[],l=[],h=[],u=new P,c=new P,d=new P,p=new P,m=new P,f=new P,g=new P;for(let s=0;s<=i;++s){let y=s/i*r*Math.PI*2;v(y,r,a,e,d),v(y+.01,r,a,e,p),f.subVectors(p,d),g.addVectors(p,d),m.crossVectors(f,g),g.crossVectors(m,f),m.normalize(),g.normalize();for(let e=0;e<=n;++e){let r=e/n*Math.PI*2,a=-t*Math.cos(r),p=t*Math.sin(r);u.x=d.x+(a*g.x+p*m.x),u.y=d.y+(a*g.y+p*m.y),u.z=d.z+(a*g.z+p*m.z),o.push(u.x,u.y,u.z),c.subVectors(u,d).normalize(),l.push(c.x,c.y,c.z),h.push(s/i),h.push(e/n)}}for(let e=1;e<=i;e++)for(let t=1;t<=n;t++){let i=(n+1)*(e-1)+(t-1),r=(n+1)*e+(t-1),a=(n+1)*e+t,o=(n+1)*(e-1)+t;s.push(i,r,o),s.push(r,a,o)}function v(e,t,i,n,r){let a=Math.cos(e),s=Math.sin(e),o=i/t*e,l=Math.cos(o);r.x=n*(2+l)*.5*a,r.y=n*(2+l)*s*.5,r.z=n*Math.sin(o)*.5}this.setIndex(s),this.setAttribute("position",new ti(o,3)),this.setAttribute("normal",new ti(l,3)),this.setAttribute("uv",new ti(h,2))}static fromJSON(e){return new se(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class st extends tm{constructor(e,t=64,i=1,n=8,r=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:i,radialSegments:n,closed:r};let a=e.computeFrenetFrames(t,r);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;let s=new P,o=new P,l=new _,h=new P,u=[],c=[],d=[],p=[];function m(r){h=e.getPointAt(r/t,h);let l=a.normals[r],d=a.binormals[r];for(let e=0;e<=n;e++){let t=e/n*Math.PI*2,r=Math.sin(t),a=-Math.cos(t);o.x=a*l.x+r*d.x,o.y=a*l.y+r*d.y,o.z=a*l.z+r*d.z,o.normalize(),c.push(o.x,o.y,o.z),s.x=h.x+i*o.x,s.y=h.y+i*o.y,s.z=h.z+i*o.z,u.push(s.x,s.y,s.z)}}(function(){for(let e=0;e<t;e++)m(e);m(!1===r?t:0),function(){for(let e=0;e<=t;e++)for(let i=0;i<=n;i++)l.x=e/t,l.y=i/n,d.push(l.x,l.y)}(),function(){for(let e=1;e<=t;e++)for(let t=1;t<=n;t++){let i=(n+1)*(e-1)+(t-1),r=(n+1)*e+(t-1),a=(n+1)*e+t,s=(n+1)*(e-1)+t;p.push(i,r,s),p.push(r,a,s)}}()})(),this.setIndex(p),this.setAttribute("position",new ti(u,3)),this.setAttribute("normal",new ti(c,3)),this.setAttribute("uv",new ti(d,2))}toJSON(){let e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new st((new aI[e.path.type]).fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class si extends tm{constructor(e){if(super(),this.type="WireframeGeometry",!0===e.isGeometry)return void console.error("THREE.WireframeGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");let t=[],i=new Set,n=new P,r=new P;if(null!==e.index){let a=e.attributes.position,s=e.index,o=e.groups;0===o.length&&(o=[{start:0,count:s.count,materialIndex:0}]);for(let e=0,l=o.length;e<l;++e){let l=o[e],h=l.start;for(let e=h,o=h+l.count;e<o;e+=3)for(let o=0;o<3;o++){let l=s.getX(e+o),h=s.getX(e+(o+1)%3);n.fromBufferAttribute(a,l),r.fromBufferAttribute(a,h),!0===sn(n,r,i)&&(t.push(n.x,n.y,n.z),t.pu
vendor: 11,369 bytes, line 121
121sh(r.x,r.y,r.z))}}}else{let a=e.attributes.position;for(let e=0,s=a.count/3;e<s;e++)for(let s=0;s<3;s++){let o=3*e+s,l=3*e+(s+1)%3;n.fromBufferAttribute(a,o),r.fromBufferAttribute(a,l),!0===sn(n,r,i)&&(t.push(n.x,n.y,n.z),t.push(r.x,r.y,r.z))}}this.setAttribute("position",new ti(t,3))}}function sn(e,t,i){let n=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`,r=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`;return!0!==i.has(n)&&!0!==i.has(r)&&(i.add(n,r),!0)}var sr=Object.freeze({__proto__:null,BoxGeometry:tN,BoxBufferGeometry:tN,CircleGeometry:an,CircleBufferGeometry:an,ConeGeometry:aa,ConeBufferGeometry:aa,CylinderGeometry:ar,CylinderBufferGeometry:ar,DodecahedronGeometry:ao,DodecahedronBufferGeometry:ao,EdgesGeometry:ad,ExtrudeGeometry:aK,ExtrudeBufferGeometry:aK,IcosahedronGeometry:a0,IcosahedronBufferGeometry:a0,LatheGeometry:a1,LatheBufferGeometry:a1,OctahedronGeometry:a3,OctahedronBufferGeometry:a3,ParametricGeometry:a2,ParametricBufferGeometry:a2,PlaneGeometry:t$,PlaneBufferGeometry:t$,PolyhedronGeometry:as,PolyhedronBufferGeometry:as,RingGeometry:a4,RingBufferGeometry:a4,ShapeGeometry:a5,ShapeBufferGeometry:a5,SphereGeometry:a6,SphereBufferGeometry:a6,TetrahedronGeometry:a8,TetrahedronBufferGeometry:a8,TextGeometry:a7,TextBufferGeometry:a7,TorusGeometry:a9,TorusBufferGeometry:a9,TorusKnotGeometry:se,TorusKnotBufferGeometry:se,TubeGeometry:st,TubeBufferGeometry:st,WireframeGeometry:si});class sa extends eq{constructor(e){super(),this.type="ShadowMaterial",this.color=new e$(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}}sa.prototype.isShadowMaterial=!0;class ss extends eq{constructor(e){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new e$(0xffffff),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new e$(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new _(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.flatShading=!1,this.setValues(e)}copy(e){return super.copy(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.flatShading=e.flatShading,this}}ss.prototype.isMeshStandardMaterial=!0;class so extends ss{constructor(e){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new _(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return p(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.sheenTint=new e$(0),this.transmission=0,this.transmissionMap=null,this.thickness=.01,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationTint=new e$(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularTint=new e$(1,1,1),this.specularTintMap=null,this._clearcoat=0,this._transmission=0,this.setValues(e)}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.sheenTint.copy(e.sheenTint),this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationTint.copy(e.attenuationTint),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularTint.copy(e.specularTint),this.specularTintMap=e.specularTintMap,this}}so.prototype.isMeshPhysicalMaterial=!0;class sl extends eq{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new e$(0xffffff),this.specular=new e$(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new e$(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new _(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(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.flatShading=e.flatShading,this}}sl.prototype.isMeshPhongMaterial=!0;class sh extends eq{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new e$(0xffffff),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new e$(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new _(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),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.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}sh.prototype.isMeshToonMaterial=!0;class su extends eq{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new _(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(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.flatShading=e.flatShading,this}}su.prototype.isMeshNormalMaterial=!0;class sc extends eq{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new e$(0xffffff),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new e$(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(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}}sc.prototype.isMeshLambertMaterial=!0;class sd extends eq{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new e$(0xffffff),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new _(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(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.flatShading=e.flatShading,this}}
121sd.prototype.isMeshMatcapMaterial=!0;class sp extends rj{constructor(e){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}sp.prototype.isLineDashedMaterial=!0;var sm=Object.freeze({__proto__:null,ShadowMaterial:sa,SpriteMaterial:ru,RawShaderMaterial:ie,ShaderMaterial:tO,PointsMaterial:r3,MeshPhysicalMaterial:so,MeshStandardMaterial:ss,MeshPhongMaterial:sl,MeshToonMaterial:sh,MeshNormalMaterial:su,MeshLambertMaterial:sc,MeshDepthMaterial:n0,MeshDistanceMaterial:n1,MeshBasicMaterial:e0,MeshMatcapMaterial:sd,LineDashedMaterial:sp,LineBasicMaterial:rj,Material:eq});let sf={arraySlice:function(e,t,i){return sf.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==i?i:e.length)):e.slice(t,i)},convertArray:function(e,t,i){return e&&(i||e.constructor!==t)?"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e):e},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){let t=e.length,i=Array(t);for(let e=0;e!==t;++e)i[e]=e;return i.sort(function(t,i){return e[t]-e[i]}),i},sortedArray:function(e,t,i){let n=e.length,r=new e.constructor(n);for(let a=0,s=0;s!==n;++a){let n=i[a]*t;for(let i=0;i!==t;++i)r[s++]=e[n+i]}return r},flattenJSON:function(e,t,i,n){let r=1,a=e[0];for(;void 0!==a&&void 0===a[n];)a=e[r++];if(void 0===a)return;let s=a[n];if(void 0!==s){if(Array.isArray(s))do void 0!==(s=a[n])&&(t.push(a.time),i.push.apply(i,s)),a=e[r++];while(void 0!==a);else if(void 0!==s.toArray)do void 0!==(s=a[n])&&(t.push(a.time),s.toArray(i,i.length)),a=e[r++];while(void 0!==a);else do void 0!==(s=a[n])&&(t.push(a.time),i.push(s)),a=e[r++];while(void 0!==a)}},subclip:function(e,t,i,n,r=30){let a=e.clone();a.name=t;let s=[];for(let e=0;e<a.tracks.length;++e){let t=a.tracks[e],o=t.getValueSize(),l=[],h=[];for(let e=0;e<t.times.length;++e){let a=t.times[e]*r;if(!(a<i||a>=n)){l.push(t.times[e]);for(let i=0;i<o;++i)h.push(t.values[e*o+i])}}0!==l.length&&(t.times=sf.convertArray(l,t.times.constructor),t.values=sf.convertArray(h,t.values.constructor),s.push(t))}a.tracks=s;let o=1/0;for(let e=0;e<a.tracks.length;++e)o>a.tracks[e].times[0]&&(o=a.tracks[e].times[0]);for(let e=0;e<a.tracks.length;++e)a.tracks[e].shift(-1*o);return a.resetDuration(),a},makeClipAdditive:function(e,t=0,i=e,n=30){n<=0&&(n=30);let r=i.tracks.length,a=t/n;for(let t=0;t<r;++t){let n;let r=i.tracks[t],s=r.ValueTypeName;if("bool"===s||"string"===s)continue;let o=e.tracks.find(function(e){return e.name===r.name&&e.ValueTypeName===s});if(void 0===o)continue;let l=0,h=r.getValueSize();r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(l=h/3);let u=0,c=o.getValueSize();o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(u=c/3);let d=r.times.length-1;if(a<=r.times[0]){let e=l,t=h-l;n=sf.arraySlice(r.values,e,t)}else if(a>=r.times[d]){let e=d*h+l,t=e+h-l;n=sf.arraySlice(r.values,e,t)}else{let e=r.createInterpolant(),t=l,i=h-l;e.evaluate(a),n=sf.arraySlice(e.resultBuffer,t,i)}"quaternion"===s&&(new C).fromArray(n).normalize().conjugate().toArray(n);let p=o.times.length;for(let e=0;e<p;++e){let t=e*c+u;if("quaternion"===s)C.multiplyQuaternionsFlat(o.values,t,n,0,o.values,t);else{let e=c-2*u;for(let i=0;i<e;++i)o.values[t+i]-=n[i]}}}return e.blendMode=2501,e}};class sg{constructor(e,t,i,n){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,i=this._cachedIndex,n=t[i],r=t[i-1];e:{t:{let a;i:{n:if(!(e<n)){for(let a=i+2;;){if(void 0===n){if(e<r)break n;return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,e,r)}if(i===a)break;if(r=n,e<(n=t[++i]))break t}a=t.length;break i}if(e>=r)break e;{let s=t[1];e<s&&(i=2,r=s);for(let a=i-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,e,n);if(i===a)break;if(n=r,e>=(r=t[--i-1]))break t}a=i,i=0}}for(;i<a;){let n=i+a>>>1;e<t[n]?a=n:i=n+1}if(n=t[i],void 0===(r=t[i-1]))return this._cachedIndex=0,this.beforeStart_(0,e,n);
121if(void 0===n)return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,r,e)}this._cachedIndex=i,this.intervalChanged_(i,r,n)}return this.interpolate_(i,r,e,n)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let t=this.resultBuffer,i=this.sampleValues,n=this.valueSize,r=e*n;for(let e=0;e!==n;++e)t[e]=i[r+e];return t}interpolate_(){throw Error("call to abstract method")}intervalChanged_(){}}sg.prototype.beforeStart_=sg.prototype.copySampleValue_,sg.prototype.afterEnd_=sg.prototype.copySampleValue_;class sv extends sg{constructor(e,t,i,n){super(e,t,i,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:2400,endingEnd:2400}}intervalChanged_(e,t,i){let n=this.parameterPositions,r=e-2,a=e+1,s=n[r],o=n[a];if(void 0===s)switch(this.getSettings_().endingStart){case 2401:r=e,s=2*t-i;break;case 2402:r=n.length-2,s=t+n[r]-n[r+1];break;default:r=e,s=i}if(void 0===o)switch(this.getSettings_().endingEnd){case 2401:a=e,o=2*i-t;break;case 2402:a=1,o=i+n[1]-n[0];break;default:a=e-1,o=t}let l=.5*(i-t),h=this.valueSize;this._weightPrev=l/(t-s),this._weightNext=l/(o-i),this._offsetPrev=r*h,this._offsetNext=a*h}interpolate_(e,t,i,n){let r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=e*s,l=o-s,h=this._offsetPrev,u=this._offsetNext,c=this._weightPrev,d=this._weightNext,p=(i-t)/(n-t),m=p*p,f=m*p,g=-c*f+2*c*m-c*p,v=(1+c)*f+(-1.5-2*c)*m+(-.5+c)*p+1,y=(-1-d)*f+(1.5+d)*m+.5*p,x=d*f-d*m;for(let e=0;e!==s;++e)r[e]=g*a[h+e]+v*a[l+e]+y*a[o+e]+x*a[u+e];return r}}class sy extends sg{constructor(e,t,i,n){super(e,t,i,n)}interpolate_(e,t,i,n){let r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=e*s,l=o-s,h=(i-t)/(n-t),u=1-h;for(let e=0;e!==s;++e)r[e]=a[l+e]*u+a[o+e]*h;return r}}class sx extends sg{constructor(e,t,i,n){super(e,t,i,n)}interpolate_(e){return this.copySampleValue_(e-1)}}class s_{constructor(e,t,i,n){if(void 0===e)throw Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=sf.convertArray(t,this.TimeBufferType),this.values=sf.convertArray(i,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}static toJSON(e){let t;let i=e.constructor;if(i.toJSON!==this.toJSON)t=i.toJSON(e);else{t={name:e.name,times:sf.convertArray(e.times,Array),values:sf.convertArray(e.values,Array)};let i=e.getInterpolation();i!==e.DefaultInterpolation&&(t.interpolation=i)}return t.type=e.ValueTypeName,t}InterpolantFactoryMethodDiscrete(e){return new sx(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new sy(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new sv(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case 2300:t=this.InterpolantFactoryMethodDiscrete;break;case 2301:t=this.InterpolantFactoryMethodLinear;break;case 2302:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){let t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw Error(t);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}}getValueSize(){return this.values.length/this.times.length}shift(e){if(0!==e){let t=this.times;for(let i=0,n=t.length;i!==n;++i)t[i]+=e}return this}scale(e){if(1!==e){let t=this.times;for(let i=0,n=t.length;i!==n;++i)t[i]*=e}return this}trim(e,t){let i=this.times,n=i.length,r=0,a=n-1;for(;r!==n&&i[r]<e;)++r;for(;-1!==a&&i[a]>t;)--a;if(++a,0!==r||a!==n){r>=a&&(r=(a=Math.max(a,1))-1);let e=this.getValueSize();this.times=sf.arraySlice(i,r,a),this.values=sf.arraySlice(this.values,r*e,a*e)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let i=this.times,n=this.values,r=i.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let t=0;t!==r;t++){let n=i[t];if("number"==typeof n&&isNaN(n)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,t,n),e=!1;break}if(null!==a&&a>n){console.error("THREE.KeyframeTrack: Out of order keys.",this,t,n,a),e=!1;break}a=n}if(void 0!==n&&sf.isTypedArray(n))for(let t=0,i=n.length;t!==i;++t){let i=n[t];if(isNaN(i)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,t,i),e=!1;break}}return e}optimize(){let e=sf.arraySlice(this.times),t=sf.arraySlice(this.values),i=this.getValueSize(),n=2302===this.getInterpolation(),r=e.length-1,a=1;for(let s=1;s<r;++s){let r=!1,o=e[s];if(o!==e[s+1]&&(1!==s||o!==e[0])){if(n)r=!0;else{let e=s*i,n=e-i,a=e+i;for(let s=0;s!==i;++s){let i=t[e+s];if(i!==t[n+s]||i!==t[a+s]){r=!0;break}}}}if(r){if(s!==a){e[a]=e[s];let n=s*i,r=a*i;for(let e=0;e!==i;++e)t[r+e]=t[n+e]}++a}}if(r>0){e[a]=e[r];for(let e=r*i,n=a*i,s=0;s!==i;++s)t[n+s]=t[e+s];++a}return a!==e.length?(this.times=sf.arraySlice(e,0,a),this.values=sf.arraySlice(t,0,a*i)):(this.times=e,this.values=t),this}clone(){let e=sf.arraySlice(this.times,0),t=sf.arraySlice(this.values,0),i=new this.constructor(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}s_.prototype.TimeBufferType=Float32Array,s_.prototype.ValueBufferType=Float32Array,s_.prototype.DefaultInterpolation=2301;class sb extends s_{}sb.prototype.ValueTypeName="bool",sb.prototype.ValueBufferType=Array,sb.prototype.DefaultInterpolation=2300,sb.prototype.InterpolantFactoryMethodLinear=void 0,sb.prototype.InterpolantFactoryMethodSmooth=void 0;class sM extends s_{}sM.prototype.ValueTypeName="color";class sw extends s_{}sw.prototype.ValueTypeName="number";class sS extends sg{constructor(e,t,i,n){super(e,t,i,n)}interpolate_(e,t,i,n){let r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=(i-t)/(n-t),l=e*s;for(let e=l+s;
121l!==e;l+=4)C.slerpFlat(r,0,a,l-s,a,l,o);return r}}class sT extends s_{InterpolantFactoryMethodLinear(e){return new sS(this.times,this.values,this.getValueSize(),e)}}sT.prototype.ValueTypeName="quaternion",sT.prototype.DefaultInterpolation=2301,sT.prototype.InterpolantFactoryMethodSmooth=void 0;class sE extends s_{}sE.prototype.ValueTypeName="string",sE.prototype.ValueBufferType=Array,sE.prototype.DefaultInterpolation=2300,sE.prototype.InterpolantFactoryMethodLinear=void 0,sE.prototype.InterpolantFactoryMethodSmooth=void 0;class sA extends s_{}sA.prototype.ValueTypeName="vector";class sL{constructor(e,t=-1,i,n=2500){this.name=e,this.tracks=i,this.duration=t,this.blendMode=n,this.uuid=d(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],i=e.tracks,n=1/(e.fps||1);for(let e=0,r=i.length;e!==r;++e)t.push((function(e){if(void 0===e.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");let t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return sw;case"vector":case"vector2":case"vector3":case"vector4":return sA;case"color":return sM;case"quaternion":return sT;case"bool":case"boolean":return sb;case"string":return sE}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){let t=[],i=[];sf.flattenJSON(e.keys,t,i,"value"),e.times=t,e.values=i}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)})(i[e]).scale(n));let r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){let t=[],i=e.tracks,n={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,n=i.length;e!==n;++e)t.push(s_.toJSON(i[e]));return n}static CreateFromMorphTargetSequence(e,t,i,n){let r=t.length,a=[];for(let e=0;e<r;e++){let s=[],o=[];s.push((e+r-1)%r,e,(e+1)%r),o.push(0,1,0);let l=sf.getKeyframeOrder(s);s=sf.sortedArray(s,1,l),o=sf.sortedArray(o,1,l),n||0!==s[0]||(s.push(r),o.push(o[0])),a.push(new sw(".morphTargetInfluences["+t[e].name+"]",s,o).scale(1/i))}return new this(e,-1,a)}static findByName(e,t){let i=e;Array.isArray(e)||(i=e.geometry&&e.geometry.animations||e.animations);for(let e=0;e<i.length;e++)if(i[e].name===t)return i[e];return null}static CreateClipsFromMorphTargetSequences(e,t,i){let n={},r=/^([\w-]*?)([\d]+)$/;for(let t=0,i=e.length;t<i;t++){let i=e[t],a=i.name.match(r);if(a&&a.length>1){let e=a[1],t=n[e];t||(n[e]=t=[]),t.push(i)}}let a=[];for(let e in n)a.push(this.CreateFromMorphTargetSequence(e,n[e],t,i));return a}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let i=function(e,t,i,n,r){if(0!==i.length){let a=[],s=[];sf.flattenJSON(i,a,s,n),0!==a.length&&r.push(new e(t,a,s))}},n=[],r=e.name||"default",a=e.fps||30,s=e.blendMode,o=e.length||-1,l=e.hierarchy||[];for(let e=0;e<l.length;e++){let r=l[e].keys;if(r&&0!==r.length){if(r[0].morphTargets){let e;let t={};for(e=0;e<r.length;e++)if(r[e].morphTargets)for(let i=0;i<r[e].morphTargets.length;i++)t[r[e].morphTargets[i]]=-1;for(let i in t){let t=[],a=[];for(let n=0;n!==r[e].morphTargets.length;++n){let n=r[e];t.push(n.time),a.push(n.morphTarget===i?1:0)}n.push(new sw(".morphTargetInfluence["+i+"]",t,a))}o=t.length*(a||1)}else{let a=".bones["+t[e].name+"]";i(sA,a+".position",r,"pos",n),i(sT,a+".quaternion",r,"rot",n),i(sA,a+".scale",r,"scl",n)}}}return 0===n.length?null:new this(r,o,n,s)}resetDuration(){let e=0;for(let t=0,i=this.tracks.length;t!==i;++t){let i=this.tracks[t];e=Math.max(e,i.times[i.times.length-1])}return this.duration=e,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){let e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}let sR={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};class sC{constructor(e,t,i){let n=this,r,a=!1,s=0,o=0,l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(e){o++,!1===a&&void 0!==n.onStart&&n.onStart(e,s,o),a=!0},this.itemEnd=function(e){s++,void 0!==n.onProgress&&n.onProgress(e,s,o),s===o&&(a=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(e){void 0!==n.onError&&n.onError(e)},this.resolveURL=function(e){return r?r(e):e},this.setURLModifier=function(e){return r=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){let t=l.indexOf(e);return -1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(let t=0,i=l.length;t<i;t+=2){let i=l[t],n=l[t+1];if(i.global&&(i.lastIndex=0),i.test(e))return n}return null}}}let sP=new sC;class sI{constructor(e){this.manager=void 0!==e?e:sP,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){let i=this;return new Promise(function(n,r){i.load(e,n,t,r)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}let sD={};class sN extends sI{constructor(e){super(e)}load(e,t,i,n){let r;void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);let a=this,s=sR.get(e);if(void 0!==s)return a.manager.itemStart(e),setTimeout(function(){t&&t(s),a.manager.itemEnd(e)},0),s;if(void 0!==sD[e])return void sD[e].push({onLoad:t,onProgress:i,onError:n});let o=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(o){let i=o[1],r=!!o[2],s=o[3];s=decodeURIComponent(s),r&&(s=atob(s));try{let n;let r=(this.responseType||"").toLowerCase();switch(r){case"arraybuffer":case"blob":let o=new Uint8Array(s.length);for(let e=0;e<s.length;e++)o[e]=s.charCodeAt(e);n="blob"===r?new Blob([o.buffer],{type:i}):o.buffer;break;case"document":n=(new DOMParser).parseFromString(s,i);break;case"json":n=JSON.parse(s);break;default:n=s}setTimeout(function(){t&&t(n),a.manager.itemEnd(e)},0)}catch(t){setTimeout(function(){n&&n(t),a.manager.itemError(e),a.manager.itemEnd(e)},0)}}else{for(let s in sD[e]=[],sD[e].push({onLoad:t,onProgress:i,onError:n}),(r=new XMLHttpRequest).open("GET",e,!0),r.addEventListener("load",function(t){let i=this.response,n=sD[e];if(delete sD[e],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),sR.add(e,i);for(let e=0,t=n.length;e<t;e++){let t=n[e];t.onLoad&&t.onLoad(i)}a.manager.itemEnd(e)}else{for(let e=0,i=n.length;e<i;e++){let i=n[e];i.onError&&i.onError(t)}a.manager.itemError(e),a.manager.itemEnd(e)}},!1),r.addEventListener("progress",function(t){let i=sD[e];for(let e=0,n=i.length;e<n;e++){let n=i[e];n.onProgress&&n.onProgress(t)}},!1),r.addEventListener("error",function(t){let i=sD[e];delete sD[e];for(let e=0,n=i.length;e<n;e++){let n=i[e];n.onError&&n.onError(t)}a.manager.itemError(e),a.manager.itemEnd(e)},!1),r.addEventListener("abort",function(t){let i=sD[e];delete sD[e];for(let e=0,n=i.length;e<n;e++){let n=i[e];n.onError&&n.onError(t)}a.manager.itemError(e),a.manager.itemEnd(e)},!1),void 0!==this.responseType&&(r.responseType=this.responseType),void 0!==this.withCredentials&&(r.withCredentials=this.withCredentials),r.overrideMimeType&&r.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)r.setRequestHeader(s,this.requestHeader[s]);r.send(null)}return a.manager.itemStart(e),r}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class sz extends sI{constructor(e){super(e)}load(e,t,i,n){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);let r=this,a=sR.get(e);if(void 0!==a)return r.manager.itemStart(e),setTimeout(function(){t&&t(a),r.manager.itemEnd(e)},0),a;let s=document.createElementNS("http://www.w3.org/1999/xhtml","img");function o(){s.removeEventListener("load",o,!1),s.removeEventListener("error",l,!1),sR.add(e,this),t&&t(this),r.manager.itemEnd(e)}function l(t){s.removeEventListener("load",o,!1),s.removeEventListener("error",l,!1),n&&n(t),r.manager.itemError(e),r.manager.itemEnd(e)}return s.addEventListener("load",o,!1),s.addEventListener("error",l,!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),r.manager.itemStart(e),s.src=e,s}}class sB extends sI{constructor(e){super(e)}load(e,t,i,n){let r=new tk,a=new sz(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);let s=0;for(let i=0;i<e.length;++i)!function(i){a.load(e[i],function(e){r.images[i]=e,6==++s&&(r.needsUpdate=!0,t&&t(r))},void 0,n)}(i);return r}}class sF extends sI{constructor(e){super(e)}load(e,t,i,n){let r=this,a=new rz,s=new sN(this.manager);return s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setPath(this.path),s.setWithCredentials(r.withCredentials),s.load(e,function(e){let i=r.parse(e);i&&(void 0!==i.image?a.image=i.image:void 0!==i.data&&(a.image.width=i.width,a.image.height=i.height,a.image.data=i.data),a.wrapS=void 0!==i.wrapS?i.wrapS:1001,a.wrapT=void 0!==i.wrapT?i.wrapT:1001,a.magFilter=void 0!==i.magFilter?i.magFilter:1006,a.minFilter=void 0!==i.minFilter?i.minFilter:1006,a.anisotropy=void 0!==i.anisotropy?i.anisotropy:1,void 0!==i.encoding&&(a.encoding=i.encoding),void 0!==i.flipY&&(a.flipY=i.flipY),void 0!==i.format&&(a.format=i.format),void 0!==i.type&&(a.type=i.type),void 0!==i.mipmaps&&(a.mipmaps=i.mipmaps,a.minFilter=1008),1===i.mipmapCount&&(a.minFilter=1006),void 0!==i.generateMipmaps&&(a.generateMipmaps=i.generateMipmaps),a.needsUpdate=!0,t&&t(a,i))},i,n),a}}class sO extends sI{constructor(e){super(e)}load(e,t,i,n){let r=new S,a=new sz(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(i){r.image=i;let n=e.search(/\.jpe?g($|\?)/i)>0||0===e.search(/^data\:image\/jpeg/);r.format=n?1022:1023,r.needsUpdate=!0,void 0!==t&&t(r)},i,n),r}}class sU extends ap{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new aA(t,e))}getPoint(e){let t=e*this.getLength(),i=this.getCurveLengths(),n=0;for(;n<i.length;){if(i[n]>=t){let e=i[n]-t,r=this.curves[n],a=r.getLength(),s=0===a?0:1-e/a;return r.getPointAt(s)}n++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let i=0,n=this.curves.length;i<n;i++)e.push(t+=this.curves[i].getLength());return this.cacheLengths=e,e}getSpacedPoints(e=40){let t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){let t;let i=[];for(let n=0,r=this.curves;n<r.length;
121n++){let a=r[n],s=a&&a.isEllipseCurve?2*e:a&&(a.isLineCurve||a.isLineCurve3)?1:a&&a.isSplineCurve?e*a.points.length:e,o=a.getPoints(s);for(let e=0;e<o.length;e++){let n=o[e];t&&t.equals(n)||(i.push(n),t=n)}}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){let i=e.curves[t];this.curves.push(i.clone())}return this.autoClose=e.autoClose,this}toJSON(){let e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,i=this.curves.length;t<i;t++){let i=this.curves[t];e.curves.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){let i=e.curves[t];this.curves.push((new aI[i.type]).fromJSON(i))}return this}}class sH extends sU{constructor(e){super(),this.type="Path",this.currentPoint=new _,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,i=e.length;t<i;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){let i=new aA(this.currentPoint.clone(),new _(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,i,n){let r=new aR(this.currentPoint.clone(),new _(e,t),new _(i,n));return this.curves.push(r),this.currentPoint.set(i,n),this}bezierCurveTo(e,t,i,n,r,a){let s=new aT(this.currentPoint.clone(),new _(e,t),new _(i,n),new _(r,a));return this.curves.push(s),this.currentPoint.set(r,a),this}splineThru(e){let t=new aP([this.currentPoint.clone()].concat(e));return this.curves.push(t),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,i,n,r,a){let s=this.currentPoint.x,o=this.currentPoint.y;return this.absarc(e+s,t+o,i,n,r,a),this}absarc(e,t,i,n,r,a){return this.absellipse(e,t,i,i,n,r,a),this}ellipse(e,t,i,n,r,a,s,o){let l=this.currentPoint.x,h=this.currentPoint.y;return this.absellipse(e+l,t+h,i,n,r,a,s,o),this}absellipse(e,t,i,n,r,a,s,o){let l=new am(e,t,i,n,r,a,s,o);if(this.curves.length>0){let e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);let h=l.getPoint(1);return this.currentPoint.copy(h),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class sG extends sH{constructor(e){super(e),this.uuid=d(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let i=0,n=this.holes.length;i<n;i++)t[i]=this.holes[i].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){let i=e.holes[t];this.holes.push(i.clone())}return this}toJSON(){let e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,i=this.holes.length;t<i;t++){let i=this.holes[t];e.holes.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){let i=e.holes[t];this.holes.push((new sH).fromJSON(i))}return this}}class sk extends eD{constructor(e,t=1){super(),this.type="Light",this.color=new e$(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}sk.prototype.isLight=!0;class sV extends sk{constructor(e,t,i){super(e,i),this.type="HemisphereLight",this.position.copy(eD.DefaultUp),this.updateMatrix(),this.groundColor=new e$(t)}copy(e){return sk.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}sV.prototype.isHemisphereLight=!0;let sW=new el,sj=new P,sq=new P;class sX{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new _(512,512),this.map=null,this.mapPass=null,this.matrix=new el,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new tZ,this._frameExtents=new _(1,1),this._viewportCount=1,this._viewports=[new E(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,i=this.matrix;sj.setFromMatrixPosition(e.matrixWorld),t.position.copy(sj),sq.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(sq),t.updateMatrixWorld(),sW.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(sW),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(t.projectionMatrix),i.multiply(t.matrixWorldInverse)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){let e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radiu
vendor: 7,522 bytes, line 121
121s=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class sY extends sX{constructor(){super(new tH(50,1,.5,500)),this.focus=1}updateMatrices(e){let t=this.camera,i=2*c*e.angle*this.focus,n=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;i===t.fov&&n===t.aspect&&r===t.far||(t.fov=i,t.aspect=n,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}sY.prototype.isSpotLightShadow=!0;class sJ extends sk{constructor(e,t,i=0,n=Math.PI/3,r=0,a=1){super(e,t),this.type="SpotLight",this.position.copy(eD.DefaultUp),this.updateMatrix(),this.target=new eD,this.distance=i,this.angle=n,this.penumbra=r,this.decay=a,this.shadow=new sY}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}sJ.prototype.isSpotLight=!0;let sZ=new el,sQ=new P,sK=new P;class s$ extends sX{constructor(){super(new tH(90,1,.5,500)),this._frameExtents=new _(4,2),this._viewportCount=6,this._viewports=[new E(2,1,1,1),new E(0,1,1,1),new E(3,1,1,1),new E(1,1,1,1),new E(3,0,1,1),new E(1,0,1,1)],this._cubeDirections=[new P(1,0,0),new P(-1,0,0),new P(0,0,1),new P(0,0,-1),new P(0,1,0),new P(0,-1,0)],this._cubeUps=[new P(0,1,0),new P(0,1,0),new P(0,1,0),new P(0,1,0),new P(0,0,1),new P(0,0,-1)]}updateMatrices(e,t=0){let i=this.camera,n=this.matrix,r=e.distance||i.far;r!==i.far&&(i.far=r,i.updateProjectionMatrix()),sQ.setFromMatrixPosition(e.matrixWorld),i.position.copy(sQ),sK.copy(i.position),sK.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(sK),i.updateMatrixWorld(),n.makeTranslation(-sQ.x,-sQ.y,-sQ.z),sZ.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(sZ)}}s$.prototype.isPointLightShadow=!0;class s0 extends sk{constructor(e,t,i=0,n=1){super(e,t),this.type="PointLight",this.distance=i,this.decay=n,this.shadow=new s$}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}s0.prototype.isPointLight=!0;class s1 extends sX{constructor(){super(new t9(-5,5,5,-5,.5,500))}}s1.prototype.isDirectionalLightShadow=!0;class s3 extends sk{constructor(e,t){super(e,t),this.type="DirectionalLight",this.position.copy(eD.DefaultUp),this.updateMatrix(),this.target=new eD,this.shadow=new s1}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}s3.prototype.isDirectionalLight=!0;class s2 extends sk{constructor(e,t){super(e,t),this.type="AmbientLight"}}s2.prototype.isAmbientLight=!0;class s4 extends sk{constructor(e,t,i=10,n=10){super(e,t),this.type="RectAreaLight",this.width=i,this.height=n}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){let t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}s4.prototype.isRectAreaLight=!0;class s5{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new P)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){let i=e.x,n=e.y,r=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScaledVector(a[1],.488603*n),t.addScaledVector(a[2],.488603*r),t.addScaledVector(a[3],.488603*i),t.addScaledVector(a[4],i*n*1.092548),t.addScaledVector(a[5],n*r*1.092548),t.addScaledVector(a[6],.315392*(3*r*r-1)),t.addScaledVector(a[7],i*r*1.092548),t.addScaledVector(a[8],.546274*(i*i-n*n)),t}getIrradianceAt(e,t){let i=e.x,n=e.y,r=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScaledVector(a[1],1.023328*n),t.addScaledVector(a[2],1.023328*r),t.addScaledVector(a[3],1.023328*i),t.addScaledVector(a[4],.858086*i*n),t.addScaledVector(a[5],.858086*n*r),t.addScaledVector(a[6],.743125*r*r-.247708),t.addScaledVector(a[7],.858086*i*r),t.addScaledVector(a[8],.429043*(i*i-n*n)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(e.coefficients[i],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let i=0;i<9;i++)this.coefficients[i].lerp(e.coefficients[i],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(e,t=0){let i=this.coefficients;for(let n=0;n<9;n++)i[n].fromArray(e,t+3*n);return this}toArray(e=[],t=0){let i=this.coefficients;for(let n=0;n<9;n++)i[n].toArray(e,t+3*n);return e}static getBasisAt(e,t){let i=e.x,n=e.y,r=e.z;t[0]=.282095,t[1]=.488603*n,t[2]=.488603*r,t[3]=.488603*i,t[4]=1.092548*i*n,t[5]=1.092548*n*r,t[6]=.315392*(3*r*r-1),t[7]=1.092548*i*r,t[8]=.546274*(i*i-n*n)}}s5.prototype.isSphericalHarmonics3=!0;class s6 extends sk{constructor(e=new s5,t=1){super(void 0,t),this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){let t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}s6.prototype.isLightProbe=!0;class s8 extends sI{constructor(e){super(e),this.textures={}}load(e,t,i,n){let r=this,a=new sN(r.manager);a.setPath(r.path),a.setRequestHeader(r.requestHeader),a.setWithCredentials(r.withCredentials),a.load(e,function(i){try{t(r.parse(JSON.parse(i)))}catch(t){n?n(t):console.error(t),r.manager.itemError(e)}},i,n)}parse(e){let t=this.textures;function i(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}let n=new sm[e.type];if(void 0!==e.uuid&&(n.uuid=e.uuid),void 0!==e.name&&(n.name=e.name),void 0!==e.color&&void 0!==n.color&&n.color.setHex(e.color),void 0!==e.roughness&&(n.roughness=e.roughness),void 0!==e.metalness&&(n.metalness=e.metalness),void 0!==e.sheenTint&&(n.sheenTint=(new e$).setHex(e.sheenTint)),void 0!==e.emissive&&void 0!==n.emissive&&n.emissive.setHex(e.emissive),void 0!==e.specular&&void 0!==n.specular&&n.specular.setHex(e.specular),void 0!==e.specularIntensity&&(n.specularIntensity=e.specularIntensity),void 0!==e.specularTint&&void 0!==n.specularTint&&n.specularTint.setHex(e.specularTint),void 0!==e.shininess&&(n.shininess=e.shininess),void 0!==e.clearcoat&&(n.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(n.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.transmission&&(n.transmission=e.transmission),void 0!==e.thickness&&(n.thickness=e.thickness),void 0!==e.attenuationDistance&&(n.attenuationDistance=e.attenuationDistance),void 0!==e.attenuationTint&&void 0!==n.attenuationTint&&n.attenuationTint.setHex(e.attenuationTint),void 0!==e.fog&&(n.fog=e.fog),void 0!==e.flatShading&&(n.flatShading=e.flatShading),void 0!==e.blending&&(n.blending=e.blending),void 0!==e.combine&&(n.combine=e.combine),void 0!==e.side&&(n.side=e.side),void 0!==e.shadowSide&&(n.shadowSide=e.shadowSide),void 0!==e.opacity&&(n.op
121acity=e.opacity),void 0!==e.format&&(n.format=e.format),void 0!==e.transparent&&(n.transparent=e.transparent),void 0!==e.alphaTest&&(n.alphaTest=e.alphaTest),void 0!==e.depthTest&&(n.depthTest=e.depthTest),void 0!==e.depthWrite&&(n.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(n.colorWrite=e.colorWrite),void 0!==e.stencilWrite&&(n.stencilWrite=e.stencilWrite),void 0!==e.stencilWriteMask&&(n.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(n.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(n.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(n.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(n.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(n.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(n.stencilZPass=e.stencilZPass),void 0!==e.wireframe&&(n.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(n.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(n.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(n.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(n.rotation=e.rotation),1!==e.linewidth&&(n.linewidth=e.linewidth),void 0!==e.dashSize&&(n.dashSize=e.dashSize),void 0!==e.gapSize&&(n.gapSize=e.gapSize),void 0!==e.scale&&(n.scale=e.scale),void 0!==e.polygonOffset&&(n.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(n.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(n.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.dithering&&(n.dithering=e.dithering),void 0!==e.alphaToCoverage&&(n.alphaToCoverage=e.alphaToCoverage),void 0!==e.premultipliedAlpha&&(n.premultipliedAlpha=e.premultipliedAlpha),void 0!==e.visible&&(n.visible=e.visible),void 0!==e.toneMapped&&(n.toneMapped=e.toneMapped),void 0!==e.userData&&(n.userData=e.userData),void 0!==e.vertexColors&&("number"==typeof e.vertexColors?n.vertexColors=e.vertexColors>0:n.vertexColors=e.vertexColors),void 0!==e.uniforms)for(let t in e.uniforms){let r=e.uniforms[t];switch(n.uniforms[t]={},r.type){case"t":n.uniforms[t].value=i(r.value);break;case"c":n.uniforms[t].value=(new e$).setHex(r.value);break;case"v2":n.uniforms[t].value=(new _).fromArray(r.value);break;case"v3":n.uniforms[t].value=(new P).fromArray(r.value);break;case"v4":n.uniforms[t].value=(new E).fromArray(r.value);break;case"m3":n.uniforms[t].value=(new b).fromArray(r.value);break;
121case"m4":n.uniforms[t].value=(new el).fromArray(r.value);break;default:n.uniforms[t].value=r.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(let t in e.extensions)n.extensions[t]=e.extensions[t];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=i(e.map)),void 0!==e.matcap&&(n.matcap=i(e.matcap)),void 0!==e.alphaMap&&(n.alphaMap=i(e.alphaMap)),void 0!==e.bumpMap&&(n.bumpMap=i(e.bumpMap)),void 0!==e.bumpScale&&(n.bumpScale=e.bumpScale),void 0!==e.normalMap&&(n.normalMap=i(e.normalMap)),void 0!==e.normalMapType&&(n.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),n.normalScale=(new _).fromArray(t)}return void 0!==e.displacementMap&&(n.displacementMap=i(e.displacementMap)),void 0!==e.displacementScale&&(n.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(n.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(n.roughnessMap=i(e.roughnessMap)),void 0!==e.metalnessMap&&(n.metalnessMap=i(e.metalnessMap)),void 0!==e.emissiveMap&&(n.emissiveMap=i(e.emissiveMap)),void 0!==e.emissiveIntensity&&(n.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(n.specularMap=i(e.specularMap)),void 0!==e.specularIntensityMap&&(n.specularIntensityMap=i(e.specularIntensityMap)),void 0!==e.specularTintMap&&(n.specularTintMap=i(e.specularTintMap)),void 0!==e.envMap&&(n.envMap=i(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=i(e.lightMap)),void 0!==e.lightMapIntensity&&(n.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(n.aoMap=i(e.aoMap)),void 0!==e.aoMapIntensity&&(n.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(n.gradientMap=i(e.gradientMap)),void 0!==e.clearcoatMap&&(n.clearcoatMap=i(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(n.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(n.clearcoatNormalMap=i(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(n.clearcoatNormalScale=(new _).fromArray(e.clearcoatNormalScale)),void 0!==e.transmissionMap&&(n.transmissionMap=i(e.transmissionMap)),void 0!==e.thicknessMap&&(n.thicknessMap=i(e.thicknessMap)),n}setTextures(e){return this.textures=e,this}}class s7{static decodeText(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let i=0,n=e.length;i<n;i++)t+=String.fromCharCode(e[i]);try{return decodeURIComponent(escape(t))}catch(e){return t}}static extractUrlBase(e){let t=e.lastIndexOf("/");return -1===t?"./":e.substr(0,t+1)}}class s9 extends tm{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}clone(){return(new this.constructor).copy(this)}toJSON(){let e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}s9.prototype.isInstancedBufferGeometry=!0;class oe extends sI{constructor(e){super(e)}load(e,t,i,n){let r=this,a=new sN(r.manager);a.setPath(r.path),a.setRequestHeader(r.requestHeader),a.setWithCredentials(r.withCredentials),a.load(e,function(i){try{t(r.parse(JSON.parse(i)))}catch(t){n?n(t):console.error(t),r.manager.itemError(e)}},i,n)}parse(e){let t={},i={};function n(e,n){if(void 0!==t[n])return t[n];let r=e.interleavedBuffers[n],a=function(e,t){if(void 0!==i[t])return i[t];let n=new Uint32Array(e.arrayBuffers[t]).buffer;return i[t]=n,n}(e,r.buffer),s=new ro(ts(r.type,a),r.stride);return s.uuid=r.uuid,t[n]=s,s}let r=e.isInstancedBufferGeometry?new s9:new tm,a=e.data.index;if(void 0!==a){let e=ts(a.type,a.array);r.setIndex(new e2(e,1))}let s=e.data.attributes;for(let t in s){let i;let a=s[t];if(a.isInterleavedBufferAttribute)i=new rh(n(e.data,a.data),a.itemSize,a.offset,a.normalized);else{let e=ts(a.type,a.array);i=new(a.isInstancedBufferAttribute?rU:e2)(e,a.itemSize,a.normalized)}void 0!==a.name&&(i.name=a.name),void 0!==a.usage&&i.setUsage(a.usage),void 0!==a.updateRange&&(i.updateRange.offset=a.updateRange.offset,i.updateRange.count=a.updateRange.count),r.setAttribute(t,i)}let o=e.data.morphAttributes;if(o)for(let t in o){let i=o[t],a=[];for(let t=0,r=i.length;t<r;t++){let r;let s=i[t];r=s.isInterleavedBufferAttribute?new rh(n(e.data,s.data),s.itemSize,s.offset,s.normalized):new e2(ts(s.type,s.array),s.itemSize,s.normalized),void 0!==s.name&&(r.name=s.name),a.push(r)}r.morphAttributes[t]=a}e.data.morphTargetsRelative&&(r.morphTargetsRelative=!0);let l=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==l)for(let e=0,t=l.length;e!==t;++e){let t=l[e];r.addGroup(t.start,t.count,t.materialIndex)}let h=e.data.boundingSphere;if(void 0!==h){let e=new P;void 0!==h.center&&e.fromArray(h.center),r.boundingSphere=new $(e,h.radius)}return e.name&&(r.name=e.name),e.userData&&(r.userData=e.userData),r}}let ot={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,CubeUVReflectionMapping:306,CubeUVRefractionMapping:307},oi={RepeatWrapping:1e3,ClampToEdgeWrapping:1001,MirroredRepeatWrapping:1002},on={NearestFilter:1003,NearestMipmapNearestFilter:1004,NearestMipmapLinearFilter:1005,LinearFilter:1006,LinearMipmapNearestFilter:1007,LinearMipmapLinearFilter:1008};class or extends sI{constructor(e){super(e),"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,n){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);let r=this,a=sR.get(e);if(void 0!==a)return r.manager.itemStart(e),setTimeout(function(){t&&t(a),r.manager.itemEnd(e)},0),a;let s={};s.credentials="anonymous"===this.crossOrigin?"same-origin":"include",s.headers=this.requestHeader,fetch(e,s).then(function(e){return e.blob()}).then(function(e){return createImageBitmap(e,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(i){sR.add(e,i),t&&t(i),r.manager.itemEnd(e)}).catch(function(t){n&&n(t),r.manager.itemError(e),r.manager.itemEnd(e)}),r.manager.itemStart(e)}}or.prototype.isImageBitmapLoader=!0;class oa{constructor(){this.type="ShapePath",this.color=new e$,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new sH,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,n){return this.currentPath.quadraticCurveTo(e,t,i,n),this}bezierCurveTo(e,t,i,n,r,a){return this.currentPath.bezierCurveTo(e,t,i,n,r,a),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){let i,n,r;function a(e){let t=[];for(let i=0,n=e.length;i<n;i++){let n=e[i],r=new sG;r.curves=n.curves,t.push(r)}return t}let s=aJ.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===t)return a(o);let l=[];
121if(1===o.length)return n=o[0],(r=new sG).curves=n.curves,l.push(r),l;let h=!s(o[0].getPoints());h=e?!h:h;let u=[],c=[],d,p,m=[],f=0;c[0]=void 0,m[f]=[];for(let t=0,r=o.length;t<r;t++)i=s(d=(n=o[t]).getPoints()),(i=e?!i:i)?(!h&&c[f]&&f++,c[f]={s:new sG,p:d},c[f].s.curves=n.curves,h&&f++,m[f]=[]):m[f].push({h:n,p:d[0]});if(!c[0])return a(o);if(c.length>1){let e=!1,t=[];for(let e=0,t=c.length;e<t;e++)u[e]=[];for(let i=0,n=c.length;i<n;i++){let n=m[i];for(let r=0;r<n.length;r++){let a=n[r],s=!0;for(let n=0;n<c.length;n++)(function(e,t){let i=t.length,n=!1;for(let r=i-1,a=0;a<i;r=a++){let i=t[r],s=t[a],o=s.x-i.x,l=s.y-i.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(i=t[a],o=-o,s=t[r],l=-l),e.y<i.y||e.y>s.y)continue;if(e.y===i.y){if(e.x===i.x)return!0}else{let t=l*(e.x-i.x)-o*(e.y-i.y);if(0===t)return!0;if(t<0)continue;n=!n}}else{if(e.y!==i.y)continue;if(s.x<=e.x&&e.x<=i.x||i.x<=e.x&&e.x<=s.x)return!0}}return n})(a.p,c[n].p)&&(i!==n&&t.push({froms:i,tos:n,hole:r}),s?(s=!1,u[n].push(a)):e=!0);s&&u[i].push(a)}}t.length>0&&(e||(m=u))}for(let e=0,t=c.length;e<t;e++){r=c[e].s,l.push(r),p=m[e];for(let e=0,t=p.length;e<t;e++)r.holes.push(p[e].h)}return l}}class os{constructor(e){this.type="Font",this.data=e}generateShapes(e,t=100){let i=[],n=function(e,t,i){let n=Array.from(e),r=t/i.resolution,a=(i.boundingBox.yMax-i.boundingBox.yMin+i.underlineThickness)*r,s=[],o=0,l=0;for(let e=0;e<n.length;e++){let t=n[e];if("\n"===t)o=0,l-=a;else{let e=function(e,t,i,n,r){let a,s,o,l,h,u,c,d;let p=r.glyphs[e]||r.glyphs["?"];if(!p)return void console.error('THREE.Font: character "'+e+'" does not exists in font family '+r.familyName+".");let m=new oa;if(p.o){let e=p._cachedOutline||(p._cachedOutline=p.o.split(" "));for(let r=0,p=e.length;r<p;)switch(e[r++]){case"m":a=e[r++]*t+i,s=e[r++]*t+n,m.moveTo(a,s);break;case"l":a=e[r++]*t+i,s=e[r++]*t+n,m.lineTo(a,s);break;case"q":o=e[r++]*t+i,l=e[r++]*t+n,h=e[r++]*t+i,u=e[r++]*t+n,m.quadraticCurveTo(h,u,o,l);break;case"b":o=e[r++]*t+i,l=e[r++]*t+n,h=e[r++]*t+i,u=e[r++]*t+n,c=e[r++]*t+i,d=e[r++]*t+n,m.bezierCurveTo(h,u,c,d,o,l)}}return{offsetX:p.ha*t,path:m}}(t,r,o,l,i);o+=e.offsetX,s.push(e.path)}}return s}(e,t,this.data);for(let e=0,t=n.length;e<t;e++)Array.prototype.push.apply(i,n[e].toShapes());return i}}os.prototype.isFont=!0;let oo={getContext:function(){return void 0===n&&(n=new(window.AudioContext||window.webkitAudioContext)),n},setContext:function(e){n=e}};class ol extends sI{constructor(e){super(e)}load(e,t,i,n){let r=this,a=new sN(this.manager);a.setResponseType("arraybuffer"),a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(i){try{let e=i.slice(0);oo.getContext().decodeAudioData(e,function(e){t(e)})}catch(t){n?n(t):console.error(t),r.manager.itemError(e)}},i,n)}}class oh extends s6{constructor(e,t,i=1){super(void 0,i);let n=(new e$).set(e),r=(new e$).set(t),a=new P(n.r,n.g,n.b),s=new P(r.r,r.g,r.b),o=Math.sqrt(Math.PI),l=o*Math.sqrt(.75);this.sh.coefficients[0].copy(a).add(s).multiplyScalar(o),this.sh.coefficients[1].copy(a).sub(s).multiplyScalar(l)}}oh.prototype.isHemisphereLightProbe=!0;class ou extends s6{constructor(e,t=1){super(void 0,t);let i=(new e$).set(e);this.sh.coefficients[0].set(i.r,i.g,i.b).multiplyScalar(2*Math.sqrt(Math.PI))}}ou.prototype.isAmbientLightProbe=!0;let oc=new el,od=new el;class op{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=om(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){let t=om();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function om(){return("undefined"==typeof performance?Date:performance).now()}let of=new P,og=new C,ov=new P,oy=new P;class ox extends eD{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl
vendor: 6,011 bytes, line 121
121=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+e;let t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(e){return e||(e=[]),!0===this._connected?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}let o_=new P,ob=new C,oM=new P,ow=new P;class oS{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0,t=this.getFrequencyData();for(let i=0;i<t.length;i++)e+=t[i];return e/t.length}}class oT{constructor(e,t,i){let n,r,a;switch(this.binding=e,this.valueSize=i,t){case"quaternion":n=this._slerp,r=this._slerpAdditive,a=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*i),this._workIndex=5;break;case"string":case"bool":n=this._select,r=this._select,a=this._setAdditiveIdentityOther,this.buffer=Array(5*i);break;default:n=this._lerp,r=this._lerpAdditive,a=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*i)}this._mixBufferRegion=n,this._mixBufferRegionAdditive=r,this._setIdentity=a,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){let i=this.buffer,n=this.valueSize,r=e*n+n,a=this.cumulativeWeight;if(0===a){for(let e=0;e!==n;++e)i[r+e]=i[e];a=t}else{a+=t;let e=t/a;this._mixBufferRegion(i,r,0,e,n)}this.cumulativeWeight=a}accumulateAdditive(e){let t=this.buffer,i=this.valueSize,n=i*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,n,0,e,i),this.cumulativeWeightAdditive+=e}apply(e){let t=this.valueSize,i=this.buffer,n=e*t+t,r=this.cumulativeWeight,a=this.cumulativeWeightAdditive,s=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,r<1){let e=t*this._origIndex;this._mixBufferRegion(i,n,e,1-r,t)}a>0&&this._mixBufferRegionAdditive(i,n,this._addIndex*t,1,t);for(let e=t,r=t+t;e!==r;++e)if(i[e]!==i[e+t]){s.setValue(i,n);break}}saveOriginalState(){let e=this.binding,t=this.buffer,i=this.valueSize,n=i*this._origIndex;e.getValue(t,n);for(let e=i;e!==n;++e)t[e]=t[n+e%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;
121for(let i=e;i<t;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){let e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[t+i]=this.buffer[e+i]}_select(e,t,i,n,r){if(n>=.5)for(let n=0;n!==r;++n)e[t+n]=e[i+n]}_slerp(e,t,i,n){C.slerpFlat(e,t,e,t,e,i,n)}_slerpAdditive(e,t,i,n,r){let a=this._workIndex*r;C.multiplyQuaternionsFlat(e,a,e,t,e,i),C.slerpFlat(e,t,e,t,e,a,n)}_lerp(e,t,i,n,r){let a=1-n;for(let s=0;s!==r;++s){let r=t+s;e[r]=e[r]*a+e[i+s]*n}}_lerpAdditive(e,t,i,n,r){for(let a=0;a!==r;++a){let r=t+a;e[r]=e[r]+e[i+a]*n}}}let oE=RegExp("[\\[\\]\\.:\\/]","g"),oA="[^\\[\\]\\.:\\/]",oL="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",oR=/((?:WC+[\/:])*)/.source.replace("WC",oA),oC=RegExp("^"+oR+/(WCOD+)?/.source.replace("WCOD",oL)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",oA)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",oA)+"$"),oP=["material","materials","bones"];class oI{constructor(e,t,i){this.path=t,this.parsedPath=i||oI.parseTrackName(t),this.node=oI.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new oI.Composite(e,t,i):new oI(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(oE,"")}static parseTrackName(e){let t=oC.exec(e);if(!t)throw Error("PropertyBinding: Cannot parse trackName: "+e);let i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},n=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){let e=i.nodeName.substring(n+1);-1!==oP.indexOf(e)&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=e)}if(null===i.propertyName||0===i.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(!t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){let i=e.skeleton.getBoneByName(t);if(void 0!==i)return i}if(e.children){let i=function(e){for(let n=0;n<e.length;n++){let r=e[n];if(r.name===t||r.uuid===t)return r;let a=i(r.children);if(a)return a}return null},n=i(e.children);if(n)return n}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){let i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)e[t++]=i[n]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){let i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=e[t++]}_setValue_array_setNeedsUpdate(e,t){let i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){let i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node,t=this.parsedPath,i=t.objectName,n=t.propertyName,r=t.propertyIndex;if(e||(e=oI.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(i){let n=t.objectIndex;switch(i){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as no
121de does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(let t=0;t<e.length;t++)if(e[t].name===n){n=t;break}break;default:if(void 0===e[i])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[i]}if(void 0!==n){if(void 0===e[n])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[n]}}let a=e[n];if(void 0===a)return void console.error("THREE.PropertyBinding: Trying to update property for track: "+t.nodeName+"."+n+" but it wasn't found.",e);let s=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?s=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(s=this.Versioning.MatrixWorldNeedsUpdate);let o=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===n){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[r]&&(r=e.morphTargetDictionary[r])}o=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=r}else void 0!==a.fromArray&&void 0!==a.toArray?(o=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(o=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=n;this.getValue=this.GetterByBindingType[o],this.setValue=this.SetterByBindingTypeAndVersioning[o][s]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}oI.Composite=class{constructor(e,t,i){let n=i||oI.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,n)}getValue(e,t){this.bind();let i=this._targetGroup.nCachedObjects_,n=this._bindings[i];void 0!==n&&n.getValue(e,t)}setValue(e,t){let i=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=i.length;n!==r;++n)i[n].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}},oI.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},oI.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},oI.prototype.GetterByBindingType=[oI.prototype._getValue_direct,oI.prototype._getValue_array,oI.prototype._getValue_arrayElement,oI.prototype._getValue_toArray],oI.prototype.SetterByBindingTypeAndVersioning=[[oI.prototype._setValue_direct,oI.prototype._setValue_direct_setNeedsUpdate,oI.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[oI.prototype._setValue_array,oI.prototype._setValue_array_setNeedsUpdate,oI.prototype._setValue_array_setMatrixWorldNeedsUpdate],[oI.prototype._setValue_arrayElement,oI.prototype._setValue_arrayElement_setNeedsUpdate,oI.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[oI.prototype._setValue_fromArray,oI.prototype._setValue_fromArray_setNeedsUpdate,oI.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class oD{constructor(){this.uuid=d(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;let e={};this._indicesByUUID=e;for(let t=0,i=arguments.length;t!==i;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};let t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){let e=this._objects,t=this._indicesByUUID,i=this._paths,n=this._parsedPaths,r=this._bindings,a=r.length,s,o=e.length,l=this.nCachedObjects_;for(let h=0,u=arguments.length;h!==u;++h){let u=arguments[h],c=u.uuid,d=t[c];if(void 0===d){d=o++,t[c]=d,e.push(u);for(let e=0;e!==a;++e)r[e].push(new oI(u,i[e],n[e]))}else if(d<l){s=e[d];let o=--l,h=e[o];t[h.uuid]=d,e[d]=h,t[c]=o,e[o]=u;for(let e=0;e!==a;++e){let t=r[e],a=t[o],s=t[d];t[d]=a,void 0===s&&(s=new oI(u,i[e],n[e])),t[o]=s}}else e[d]!==s&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastru
121cture when reloading scenes.")}this.nCachedObjects_=l}remove(){let e=this._objects,t=this._indicesByUUID,i=this._bindings,n=i.length,r=this.nCachedObjects_;for(let a=0,s=arguments.length;a!==s;++a){let s=arguments[a],o=s.uuid,l=t[o];if(void 0!==l&&l>=r){let a=r++,h=e[a];t[h.uuid]=l,e[l]=h,t[o]=a,e[a]=s;for(let e=0;e!==n;++e){let t=i[e],n=t[a],r=t[l];t[l]=n,t[a]=r}}}this.nCachedObjects_=r}uncache(){let e=this._objects,t=this._indicesByUUID,i=this._bindings,n=i.length,r=this.nCachedObjects_,a=e.length;for(let s=0,o=arguments.length;s!==o;++s){let o=arguments[s].uuid,l=t[o];if(void 0!==l){if(delete t[o],l<r){let s=--r,o=e[s],h=--a,u=e[h];t[o.uuid]=l,e[l]=o,t[u.uuid]=s,e[s]=u,e.pop();for(let e=0;e!==n;++e){let t=i[e],n=t[s],r=t[h];t[l]=n,t[s]=r,t.pop()}}else{let r=--a,s=e[r];r>0&&(t[s.uuid]=l),e[l]=s,e.pop();for(let e=0;e!==n;++e){let t=i[e];t[l]=t[r],t.pop()}}}}this.nCachedObjects_=r}subscribe_(e,t){let i=this._bindingsIndicesByPath,n=i[e],r=this._bindings;if(void 0!==n)return r[n];let a=this._paths,s=this._parsedPaths,o=this._objects,l=o.length,h=this.nCachedObjects_,u=Array(l);n=r.length,i[e]=n,a.push(e),s.push(t),r.push(u);for(let i=h,n=o.length;i!==n;++i){let n=o[i];u[i]=new oI(n,e,t)}return u}unsubscribe_(e){let t=this._bindingsIndicesByPath,i=t[e];if(void 0!==i){let n=this._paths,r=this._parsedPaths,a=this._bindings,s=a.length-1,o=a[s];t[e[s]]=i,a[i]=o,a.pop(),r[i]=r[s],r.pop(),n[i]=n[s],n.pop()}}}oD.prototype.isAnimationObjectGroup=!0;class oN{constructor(e,t,i=null,n=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=n;let r=t.tracks,a=r.length,s=Array(a),o={endingStart:2400,endingEnd:2400};for(let e=0;e!==a;++e){let t=r[e].createInterpolant(null);s[e]=t,t.settings=o}this._interpolantSettings=o,this._interpolants=s,this._propertyBindings=Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,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}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){let i=this._clip.duration,n=e._clip.duration;e.warp(1,n/i,t),this.warp(i/n,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){let e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){let n=this._mixer,r=n.time,a=this.timeScale,s=this._timeScaleInterpolant;null===s&&(s=n._lendControlInterpolant(),this._timeScaleInterpolant=s);let o=s.parameterPositions,l=s.sampleValues;return o[0]=r,o[1]=r+i,l[0]=e/a,l[1]=t/a,this}stopWarping(){let e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,n){if(!this.enabled)return void this._updateWeight(e);let r=this._startTime;if(null!==r){let n=(e-r)*i;if(n<0||0===i)return;this._startTime=null,t=i*n}t*=this._updateTimeScale(e);let a=this._updateTime(t),s=this._updateWeight(e);if(s>0){let e=this._interpolants,t=this._propertyBindings;if(2501===this.blendMode)for(let i=0,n=e.length;i!==n;++i)e[i].evaluate(a),t[i].accumulateAdditive(s);else for(let i=0,r=e.length;i!==r;++i)e[i].evaluate(a),t[i].accumulate(n,s)}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let i=this._weightInterpolant;if(null!==i){let n=i.evaluate(e)[0];t*=n,e>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let i=this._timeScaleInterpolant;null!==i&&(t*=i.evaluate(e)[0],e>i.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,i=this.loop,n=this.time+e,r=this._loopCount,a=2202===i;if(0===e)return -1===r?n:a&&1==(1&r)?t-n:n;if(2200===i){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(n>=t)n=t;else{if(!(n<0)){this.time=n;break e}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===r&&(e>=0?(r=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),n>=t||n<0){let i=Math.floor(n/t);n-=t*i,r+=Math.abs(i);let s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=e>0?t:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){let t=e<0;this._setEndings(t,!t,a)}else this._setEndings(!1,!1,a);this._loopCount=r,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:i})}}else this.time=n;if(a&&1==(1&r))return t-n}return n}_setEndings(e,t,i){let n=this._interpolantSettings;i?(n.endingStart=2401,n.endingEnd=2401):(n.endingStart=e?this.zeroSlopeAtStart?2401:2400:2402,n.endingEnd=t?this.zeroSlopeAtEnd?2401:2400:2402)}_scheduleFading(e,t,i){let n=this._mixer,r=n.time,a=this._weightInterpolant;null===a&&(a=n._lendControlInterpolant(),this._weightInterpolant=a);let s=a.parameterPositions,o=a.sampleValues;return s[0]=r,o[0]=t,s[1]=r+e,o[1]=i,this}}class oz extends o{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let i=e._localRoot||this._root,n=e._clip.tracks,r=n.length,a=e._propertyBindings,s=e._interpolants,o=i.uuid,l=this._bindingsByRootAndName,h=l[o];void 0===h&&(h={},l[o]=h);for(let e=0;e!==r;++e){let r=n[e],l=r.name,u=h[l];if(void 0!==u)a[e]=u;else{if(void 0!==(u=a[e])){null===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,o,l));continue}let n=t&&t._propertyBindings[e].binding.parsedPath;u=new oT(oI.create(i,l,n),r.ValueTypeName,r.getValueSize()),++u.referenceCount,this._addInactiveBinding(u,o,l),a[e]=u}s[e].resultBuffer=u.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){let t=(e._localRoot||this._root).uuid,i=e._clip.uuid,n=this._actionsByClip[i];this._bindAction(e,n&&n.knownActions[0]),this._addInactiveAction(e,i,t)}let t=e._propertyBindings;for(let e=0,i=t.length;e!==i;++e){let i=t[e];0==i.useCount++&&(this._lendBinding(i),i.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let e=0,i=t.length;e!==i;++e){let i=t[e];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let 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(e){let t=e._cacheIndex;return null!==t&&t<this._nActiveActions}_addInactiveAction(e,t,i){let n=this._actions,r=this._actionsByClip,a=r[t];if(void 0===a)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,r[t]=a;else{let t=a.knownActions;e._byClipCacheIndex=t.length,t.push(e)}e._cacheIndex=n.length,n.push(e),a.actionByRoot[i]=e}_removeInactiveAction(e){let t=this._actions,i=t[t.length-1],n=e._cacheIndex;i._cacheIndex=n,t[n]=i,t.pop(),e._cacheIndex=null;let r=e._clip.uuid,a=this._actionsByClip,s=a[r],o=s.knownActions,l=o[o.length-1],h=e._byClipCacheIndex;l._byClipCacheIndex=h,o[h]=l,o.pop(),e._byClipCacheIndex=null,delete s.actionByRoot[(e._localRoot||this._root).uuid],0===o.length&&delete a[r],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){let t=e._propertyBindings;for(let e=0,i=t.length;e!==i;++e){let i=t[e];0==--i.referenceCount&&this._removeInactiveBinding(i)}}_lendAction(e){let t=this._actions,i=e._cacheIndex,n=this._nActiveActions++,r=t[n];e._cacheIndex=n,t[n]=e,r._cacheIndex=i,t[i]=r}_takeBackAction(e){let t=this._actions,i=e._cacheIndex,n=--this._nActiveActions,r=t[n];e._cacheIndex=n,t[n]=e,r._cacheIndex=i,t[i]=r}_addInactiveBinding(e,t,i){let n=this._bindingsByRootAndName,r=this._bindings,a=n[t];void 0===a&&(a={},n[t]=a),a[i]=e,e._cacheIndex=r.length,r.push(e)}_removeInactiveBinding(e){let t=this._bindings,i=e.binding,n=i.rootNode.uuid,r=i.path,a=this._bindingsByRootAndName,s=a[n],o=t[t.length-1],l=e._cacheIndex;o._cacheIndex=l,t[l]=o,t.pop(),delete s[r],0===Object.keys(s).length&&delete a[n]}_lendBinding(e){let t=this._bindings,i=e._cacheIndex,n=this._nActiveBindings++,r=t[n];e._cacheIndex=n,t[n]=e,r._cacheIndex=i,t[i]=r}_takeBackBinding(e){let t=this._bindings,i=e._cacheIndex,n=--this._nActiveBindings,r=t[n];e._cacheIndex=n,t[n]=e,r._cacheIndex=i,t[i]=r}_lendControlInterpolant(){let e=this._controlInterpolants,t=this._nActiveControlInterpolants++,i=e[t];return void 0===i&&((i=new sy(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=t,e[t]=i),i}_takeBackControlInterpolant(e){let t=this._controlInterpolants,i=e.__cacheIndex,n=--this._nActiveControlInterpolants,r=t[n];e.__cacheIndex=n,t[n]=e,r.__cacheIndex=i,t[i]=r}clipAction(e,t,i){let n=t||this._root,r=n.uuid,a="string"==typeof e?sL.findByName(n,e):e,s=null!==a?a.uuid:e,o=this._actionsByClip[s],l=null;if(void 0===i&&(i=null!==a?a.blendMode:2500),void 0!==o){let e=o.actionByRoot[r];if(void 0!==e&&e.blendMode===i)return e;l=o.knownActions[0],null===a&&(a=l._clip)}if(null===a)return null;let h=new oN(this,a,t,i);return this._bindAction(h,l),this._addInactiveAction(h,s,r),h}existingAction(e,t){let i=t||this._root,n=i.uuid,r="string"==typeof e?sL.findByName(i,e):e,a=r?r.uuid:e,s=this._actionsByClip[a];return void 0!==s&&s.actionByRoot[n]||null}stopAllAction(){let e=this._actions;for(let t=this._nActiveActions-1;t>=0;--t)e[t].stop();return this}update(e){e*=this.timeScale;let t=this._actions,i=this._nActiveActions,n=this.time+=e,r=Math.sign(e),a=this._accuIndex^=1;for(let s=0;s!==i;++s)t[s]._update(n,e,r,a);let s=this._bindings,o=this._nActiveBindings;for(let e=0;e!==o;++e)s[e].apply(a);return this}setTime(e){this.time=0;for(let e=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){let t=this._actions,i=e.uuid,n=this._actionsByClip,r=n[i];if(void 0!==r){let e=r.knownActions;for(let i=0,n=e.length;i!==n;++i){let n=e[i];this._deactivateAction(n);let r=n._cacheIndex,a=t[t.length-1];n._cacheIndex=null,n._byClipCacheIndex=null,a._cacheIndex=r,t[r]=a,t.pop(),this._removeInactiveBindingsForAction(n)}delete n[i]}}uncacheRoot(e){let t=e.uuid,i=this._actionsByClip;for(let e in i){let n=i[e].actionByRoot[t];void 0!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}let n=this._bindingsByRootAndName[t];if(void 0!==n)for(let e in n){let t=n[e];t.restoreOriginalState(),this._removeInactiveBinding(t)}}uncacheAction(e,t){let i=this.existingAction(e,t);null!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}}oz.prototype._controlInterpolantsResultBuffer=new Float32Array(1);class oB{constructor(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}clone(){return new oB(void 0===this.value.clone?this.value:this.value.clone())}}class oF extends ro{constructor(e,t,i=1){super(e,t),this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){let t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){let t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}oF.prototype.isInstancedInterleavedBuffer=!0;class oO{constructor(e,t,i,n,r){this.buffer=e,this.type=t,this.itemSize=i,this.elementSize=n,this.count=r,this.version=0}set needsUpdate(e){!0===e&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}function oU(e,t){return e.distance-t.distance}function oH(e,t,i,n){if(e.layers.test(t.layers)&&e.raycast(t,i),!0===n){let n=e.children;for(let e=0,r=n.length;e<r;e++)oH(n[e],t,i,!0)}}oO.prototype.isGLBufferAttribute=!0;let oG=new _;class ok{constructor(e=new _(1/0,1/0),t=new _(-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let i=oG.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}containsBox(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(e,t){return 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(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return oG.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}ok.prototype.isBox2=!0;let oV=new P,oW=new P;class oj{constructor(e=new P,t=new P){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){oV.subVectors(e,this.start),oW.subVectors(this.end,this.start);let i=oW.dot(oW),n=oW.dot(oV)/i;return t&&(n=p(n,0,1)),n}closestPointToPoint(e,t,i){let n=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(n).add(this.start)}
121applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}}class oq extends eD{constructor(e){super(),this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}}oq.prototype.isImmediateRenderObject=!0;let oX=new P,oY=new P,oJ=new el,oZ=new el;class oQ extends r0{constructor(e){let t=function e(t){let i=[];t&&t.isBone&&i.push(t);for(let n=0;n<t.children.length;n++)i.push.apply(i,e(t.children[n]));return i}(e),i=new tm,n=[],r=[],a=new e$(0,0,1),s=new e$(0,1,0);for(let e=0;e<t.length;e++){let i=t[e];i.parent&&i.parent.isBone&&(n.push(0,0,0),n.push(0,0,0),r.push(a.r,a.g,a.b),r.push(s.r,s.g,s.b))}i.setAttribute("position",new ti(n,3)),i.setAttribute("color",new ti(r,3)),super(i,new rj({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){let t=this.bones,i=this.geometry,n=i.getAttribute("position");oZ.copy(this.root.matrixWorld).invert();for(let e=0,i=0;e<t.length;e++){let r=t[e];r.parent&&r.parent.isBone&&(oJ.multiplyMatrices(oZ,r.matrixWorld),oY.setFromMatrixPosition(oJ),n.setXYZ(i,oY.x,oY.y,oY.z),oJ.multiplyMatrices(oZ,r.parent.matrixWorld),oY.setFromMatrixPosition(oJ),n.setXYZ(i+1,oY.x,oY.y,oY.z),i+=2)}i.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}}let oK=new P,o$=new e$,o0=new e$;class o1 extends r0{constructor(e=10,t=10,i=4473924,n=8947848){i=new e$(i),n=new e$(n);let r=t/2,a=e/t,s=e/2,o=[],l=[];for(let e=0,h=0,u=-s;e<=t;e++,u+=a){o.push(-s,0,u,s,0,u),o.push(u,0,-s,u,0,s);let t=e===r?i:n;t.toArray(l,h),h+=3,t.toArray(l,h),h+=3,t.toArray(l,h),h+=3,t.toArray(l,h),h+=3}let h=new tm;h.setAttribute("position",new ti(o,3)),h.setAttribute("color",new ti(l,3)),super(h,new rj({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}let o3=new P,o2=new P,o4=new P,o5=new P,o6=new tU;function o8(e,t,i,n,r,a,s){o5.set(r,a,s).unproject(n);let o=t[e];if(void 0!==o){let e=i.getAttribute("position");for(let t=0,i=o.length;t<i;t++)e.setXYZ(o[t],o5.x,o5.y,o5.z)}}let o7=new N;class o9 extends r0{constructor(e,t=0xffff00){let i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new Float32Array(24),r=new tm;r.setIndex(new e2(i,1)),r.setAttribute("position",new e2(n,3)),super(r,new rj({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&o7.setFromObject(this.object),o7.isEmpty())return;let t=o7.min,i=o7.max,n=this.geometry.attributes.position,r=n.array;r[0]=i.x,r[1]=i.y,r[2]=i.z,r[3]=t.x,r[4]=i.y,r[5]=i.z,r[6]=t.x,r[7]=t.y,r[8]=i.z,r[9]=i.x,r[10]=t.y,r[11]=i.z,r[12]=i.x,r[13]=i.y,r[14]=t.z,r[15]=t.x,r[16]=i.y,r[17]=t.z,r[18]=t.x,r[19]=t.y,r[20]=t.z,r[21]=i.x,r[22]=t.y,r[23]=t.z,n.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e){return r0.prototype.copy.call(this,e),this.object=e.object,this}}let le=new P;class lt extends r0{constructor(e=1){let t=new tm;t.setAttribute("position",new ti([0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],3)),t.setAttribute("color",new ti([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(t,new rj({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(e,t,i){let n=new e$,r=this.geometry.attributes.color.array;return n.set(e),n.toArray(r,0),n.toArray(r,3),n.set(t),n.toArray(r,6),n.toArray(r,9),n.set(i),n.toArray(r,12),n.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}let li=new Float32Array(1),ln=new Int32Array(li.buffer);ap.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(ap.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},sH.prototype.fromPoints=function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)},o1.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},oQ.prototype.update=function(){console.error("THREE.SkeletonHelper: update(
121) no longer needs to be called.")},sI.prototype.extractUrlBase=function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),s7.extractUrlBase(e)},sI.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},ok.prototype.center=function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},ok.prototype.empty=function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},ok.prototype.isIntersectionBox=function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},ok.prototype.size=function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)},N.prototype.center=function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},N.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},N.prototype.isIntersectionBox=function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},N.prototype.isIntersectionSphere=function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},N.prototype.size=function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)},$.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()},tZ.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},oj.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},b.prototype.flattenToArrayOffset=function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},b.prototype.multiplyVector3=function(e){return console.warn("THREE.Matrix3: .multiplyVector3(
121) has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},b.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},b.prototype.applyToBufferAttribute=function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},b.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},b.prototype.getInverse=function(e){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()},el.prototype.extractPosition=function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},el.prototype.flattenToArrayOffset=function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},el.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new P).setFromMatrixColumn(this,3)},el.prototype.setRotationFromQuaternion=function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},el.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},el.prototype.multiplyVector3=function(e){return console.warn("THREE.Matrix4: .multiplyVector3(
121) has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},el.prototype.multiplyVector4=function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},el.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},el.prototype.rotateAxis=function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},el.prototype.crossVector=function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},el.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")},el.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},el.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},el.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},el.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},el.prototype.applyToBufferAttribute=function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},el.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},el.prototype.makeFrustum=function(e,t,i,n,r,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,n,i,r,a)},el.prototype.getInverse=function(e){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()},tX.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},C.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3(
121) has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},C.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()},eo.prototype.isIntersectionBox=function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},eo.prototype.isIntersectionPlane=function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},eo.prototype.isIntersectionSphere=function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},eW.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},eW.prototype.barycoordFromPoint=function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},eW.prototype.midpoint=function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},eW.prototypenormal=function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},eW.prototype.plane=function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)},eW.barycoordFromPoint=function(e,t,i,n,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),eW.getBarycoord(e,t,i,n,r)},eW.normal=function(e,t,i,n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),eW.getNormal(e,t,i,n)},sG.prototype.extractAllPoints=function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},sG.prototype.extrude=function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new aK(this,e)},sG.prototype.makeGeometry=function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new a5(this,e)},_.prototype.fromAttribute=function(e,t,i){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,i)},_.prototype.distanceToManhattan=function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},_.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},P.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},P.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},P.prototype.getPositionFromMatrix=function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},P.prototype.getScaleFromMatrix=function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},P.prototype.getColumnFromMatrix=function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},P.prototype.applyProjection=function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},P.prototype.fromAttribute=function(e,t,i){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,i)},P.prototype.distanceToManhattan=function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},P.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},E.prototype.fromAttribute=function(e,t,i){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,i)},E.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},eD.prototype.getChildByName=function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},eD.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},eD.prototype.translate=function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},eD.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")}
vendor: 5,579 bytes, line 121
121,eD.prototype.applyMatrix=function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)},Object.defineProperties(eD.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),tI.prototype.setDrawMode=function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")},Object.defineProperties(tI.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),rD.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},tH.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(sk.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(e2.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),35048===this.usage},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(35048)}}}),e2.prototype.setDynamic=function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?35048:35044),this},e2.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},e2.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},tm.prototype.addIndex=function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},tm.prototype.addAttribute=function(e,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new e2(arguments[1],arguments[2])))},tm.prototype.addDrawCall=function(e,t,i){void 0!==i&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},tm.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},tm.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},tm.prototype.removeAttribute=function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)}
121,tm.prototype.applyMatrix=function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)},Object.defineProperties(tm.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),ro.prototype.setDynamic=function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?35048:35044),this},ro.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},aK.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},aK.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},aK.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")},rs.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")},oB.prototype.onUpdate=function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this},Object.defineProperties(eq.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")}
vendor: 4,112 bytes, line 121
121,set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new e$}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===e}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}},vertexTangents:{get:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")},set:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")}}}),Object.defineProperties(tO.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),ri.prototype.clearTarget=function(e,t,i,n){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,i,n)},ri.prototype.animate=function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},ri.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},ri.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},ri.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},ri.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},ri.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},ri.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},ri.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},ri.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},ri.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},ri.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},ri.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},ri.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_
121instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},ri.prototype.enableScissorTest=function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},ri.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},ri.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},ri.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},ri.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},ri.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},ri.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},ri.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},ri.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},ri.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},ri.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()},Object.defineProperties(ri.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===e?3001:3e3}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(n3.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(A.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy
121is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),ox.prototype.load=function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");let t=this;return(new ol).load(e,function(e){t.setBuffer(e)}),this},oS.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},tG.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update(
121)."),this.update(e,t)},tG.prototype.clear=function(e,t,i,n){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(e,t,i,n)},M.crossOrigin=void 0,M.loadTexture=function(e,t,i,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");let r=new sO;r.setCrossOrigin(this.crossOrigin);let a=r.load(e,i,void 0,n);return t&&(a.mapping=t),a},M.loadTextureCube=function(e,t,i,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");let r=new sB;r.setCrossOrigin(this.crossOrigin);let a=r.load(e,i,void 0,n);return t&&(a.mapping=t),a},M.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},M.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"132"}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="132"),e.ACESFilmicToneMapping=4,e.AddEquation=100,e.AddOperation=2,e.AdditiveAnimationBlendMode=2501,e.AdditiveBlending=2,e.AlphaFormat=1021,e.AlwaysDepth=1,e.AlwaysStencilFunc=519,e.AmbientLight=s2,e.AmbientLightProbe=ou,e.AnimationClip=sL,e.AnimationLoader=class extends sI{constructor(e){super(e)}load(e,t,i,n){let r=this,a=new sN(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(i){try{t(r.parse(JSON.parse(i)))}catch(t){n?n(t):console.error(t),r.manager.itemError(e)}},i,n)}parse(e){let t=[];for(let i=0;i<e.length;i++){let n=sL.parse(e[i]);t.push(n)}return t}},e.AnimationMixer=oz,e.AnimationObjectGroup=oD,e.AnimationUtils=sf,e.ArcCurve=af,e.ArrayCamera=n6,e.ArrowHelper=class extends eD{constructor(e=new P(0,0,1),t=new P(0,0,0),i=1,n=0xffff00,s=.2*i,o=.2*s){super(),this.type="ArrowHelper",void 0===r&&((r=new tm).setAttribute("position",new ti([0,0,0,0,1,0],3)),(a=new ar(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(t),this.line=new rQ(r,new rj({color:n,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new tI(a,new e0({color:n,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(i,s,o)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{le.set(e.z,0,-e.x).normalize();let t=Math.acos(e.y);this.quaternion.setFromAxisAngle(le,t)}}setLength(e,t=.2*e,i=.2*t){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}},e.Audio=ox,e.AudioAnalyser=oS,e.AudioContext=oo,e.AudioListener=class extends eD{constructor(){super(),this.type="AudioListener",this.context=oo.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new op}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);let t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(of,og,ov),oy.set(0,0,-1).applyQuaternion(og),t.positionX){let e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(of.x,e),t.positionY.linearRampToValueAtTime(of.y,e),t.positionZ.linearRampToValueAtTime(of.z,e),t.forwardX.linearRampToValueAtTime(oy.x,e),t.forwardY.linearRampToValueAtTime(oy.y,e),t.forwardZ.linearRampToValueAtTime(oy.z,e),t.upX.linearRampToValueAtTime(i.x,e),t.upY.linearRampToValueAtTime(i.y,e),t.upZ.linearRampToValueAtTime(i.z,e)}else t.setPosition(of.x,of.y,of.z),t.setOrientation(oy.x,oy.y,oy.z,i.x,i.y,i.z)}},e.AudioLoader=ol,e.AxesHelper=lt,e.AxisHelper=function(e){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new lt(e)},e.BackSide=1,e.BasicDepthPacking=3200,e.BasicShadowMap=0,e.BinaryTextureLoader=function(e){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new sF(e)},e.Bone=rN,e.BooleanKeyframeTrack=sb,e.BoundingBoxHelper=function(e,t){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new o9(e,t)}
vendor: 1,255 bytes, line 121
121,e.Box2=ok,e.Box3=N,e.Box3Helper=class extends r0{constructor(e,t=0xffff00){let i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new tm;n.setIndex(new e2(i,1)),n.setAttribute("position",new ti([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(n,new rj({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){let t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}},e.BoxBufferGeometry=tN,e.BoxGeometry=tN,e.BoxHelper=o9,e.BufferAttribute=e2,e.BufferGeometry=tm,e.BufferGeometryLoader=oe,e.ByteType=1010,e.Cache=sR,e.Camera=tU,e.CameraHelper=class extends r0{constructor(e){let t=new tm,i=new rj({color:0xffffff,vertexColors:!0,toneMapped:!1}),n=[],r=[],a={},s=new e$(0xffaa00),o=new e$(0xff0000),l=new e$(43775),h=new e$(0xffffff),u=new e$(3355443);function c(e,t,i){d(e,i),d(t,i)}function d(e,t){n.push(0,0,0),r.push(t.r,t.g,t.b),void 0===a[e]&&(a[e]=[]),a[e].push(n.length/3-1)}c("n1","n2",s),c("n2","n4",s),c("n4","n3",s),c("n3","n1",s),c("f1","f2",s),c("f2","f4",s),c("f4","f3",s),c("f3","f1",s),c("n1","f1",s),c("n2","f2",s),c("n3","f3",s),c("n4","f4",s),c("p","
121n1",o),c("p","n2",o),c("p","n3",o),c("p","n4",o),c("u1","u2",l),c("u2","u3",l),c("u3","u1",l),c("c","t",h),c("p","c",u),c("cn1","cn2",u),c("cn3","cn4",u),c("cf1","cf2",u),c("cf3","cf4",u),t.setAttribute("position",new ti(n,3)),t.setAttribute("color",new ti(r,3)),super(t,i),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()}update(){let e=this.geometry,t=this.pointMap;o6.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),o8("c",t,e,o6,0,0,-1),o8("t",t,e,o6,0,0,1),o8("n1",t,e,o6,-1,-1,-1),o8("n2",t,e,o6,1,-1,-1),o8("n3",t,e,o6,-1,1,-1),o8("n4",t,e,o6,1,1,-1),o8("f1",t,e,o6,-1,-1,1),o8("f2",t,e,o6,1,-1,1),o8("f3",t,e,o6,-1,1,1),o8("f4",t,e,o6,1,1,1),o8("u1",t,e,o6,.7,1.1,-1),o8("u2",t,e,o6,-.7,1.1,-1),o8("u3",t,e,o6,0,2,-1),o8("cf1",t,e,o6,-1,0,1),o8("cf2",t,e,o6,1,0,1),o8("cf3",t,e,o6,0,-1,1),o8("cf4",t,e,o6,0,1,1),o8("cn1",t,e,o6,-1,0,-1),o8("cn2",t,e,o6,1,0,-1),o8("cn3",t,e,o6,0,-1,-1),o8("cn4",t,e,o6,0,1,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}},e.CanvasRenderer=function(){console.error("THREE.CanvasRenderer has been removed")},e.CanvasTexture=at,e.CatmullRomCurve3=ab,e.CineonToneMapping=3,e.CircleBufferGeometry=an,e.CircleGeometry=an,e.ClampToEdgeWrapping=1001,e.Clock=op,e.Color=e$,e.ColorKeyframeTrack=sM,e.CompressedTexture=ae,e.CompressedTextureLoader=class extends sI{constructor(e){super(e)}load(e,t,i,n){let r=this,a=[],s=new ae,o=new sN(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(r.withCredentials);let l=0;if(Array.isArray(e))for(let h=0,u=e.length;h<u;++h)(function(h){o.load(e[h],function(e){let i=r.parse(e,!0);a[h]={width:i.width,height:i.height,format:i.format,mipmaps:i.mipmaps},6===(l+=1)&&(1===i.mipmapCount&&(s.minFilter=1006),s.image=a,s.format=i.format,s.needsUpdate=!0,t&&t(s))},i,n)})(h);else o.load(e,function(e){let i=r.parse(e,!0);if(i.isCubemap){let e=i.mipmaps.length/i.mipmapCount;for(let t=0;t<e;t++){a[t]={mipmaps:[]};for(let e=0;e<i.mipmapCount;e++)a[t].mipmaps.push(i.mipmaps[t*i.mipmapCount+e]),a[t].format=i.format,a[t].width=i.width,a[t].height=i.height}s.image=a}else s.image.width=i.width,s.image.height=i.height,s.mipmaps=i.mipmaps;1===i.mipmapCount&&(s.minFilter=1006),s.format=i.format,s.needsUpdate=!0,t&&t(s)},i,n);return s}},e.ConeBufferGeometry=aa,e.ConeGeometry=aa,e.CubeCamera=tG,e.CubeReflectionMapping=301,e.CubeRefractionMapping=302,e.CubeTexture=tk,e.CubeTextureLoader=sB,e.CubeUVReflectionMapping=306,e.CubeUVRefractionMapping=307,e.CubicBezierCurve=aT,e.CubicBezierCurve3=aE,e.CubicInterpolant=sv,e.CullFaceBack=1,e.CullFaceFront=2,e.CullFaceFrontBack=3,e.CullFaceNone=0,e.Curve=ap,e.CurvePath=sU,e.CustomBlending=5,e.CustomToneMapping=5,e.CylinderBufferGeometry=ar,e.CylinderGeometry=ar,e.Cylindrical=class{constructor(e=1,t=0,i=0){return this.radius=e,this.theta=t,this.y=i,this}set(e,t,i){return this.radius=e,this.theta=t,this.y=i,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+i*i),this.theta=Math.atan2(e,i),this.y=t,this}clone(){return(new this.constructor).copy(this)}},e.DataTexture=rz,e.DataTexture2DArray=iP,e.DataTexture3D=iI,e.DataTextureLoader=sF,e.DataUtils=class{static toHalfFloat(e){li[0]=e;let t=ln[0],i=t>>16&32768,n=t>>12&2047,r=t>>23&255;return r<103?i:r>142?(i|=31744,i|=(255==r?0:1)&&8388607&t):r<113?(n|=2048,i|=(n>>114-r)+(n>>113-r&1)):(i|=r-112<<10|n>>1,i+=1&n)}},e.DecrementStencilOp=7683,e.DecrementWrapStencilOp=34056,e.DefaultLoadingManager=sP,e.DepthFormat=1026,e.DepthStencilFormat=1027,e.DepthTexture=ai,e.DirectionalLight=s3,e.DirectionalLightHelper=class extends eD{constructor(e,t,i){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,void 0===t&&(t=1);let n=new tm;n.setAttribute("position",new ti([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));let r=new rj({fog:!1,toneMapped:!1});this.lightPlane=new rQ(n,r),this.add(this.lightPlane),(n=new tm).setAttribute("position",new ti([0,0,0,0,0,1],3)),this.targetLine=new rQ(n,r),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){o3.setFromMatrixPosition(this.light.matrixWorld),o2.setFromMatrixPosition(this.light.target.matrixWorld),o4.subVectors(o2,o3),this.lightPlane.lookAt(o2),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(o2),this.targetLine.scale.z
121=o4.length()}},e.DiscreteInterpolant=sx,e.DodecahedronBufferGeometry=ao,e.DodecahedronGeometry=ao,e.DoubleSide=2,e.DstAlphaFactor=206,e.DstColorFactor=208,e.DynamicBufferAttribute=function(e,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new e2(e,t).setUsage(35048)},e.DynamicCopyUsage=35050,e.DynamicDrawUsage=35048,e.DynamicReadUsage=35049,e.EdgesGeometry=ad,e.EdgesHelper=function(e,t){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new r0(new ad(e.geometry),new rj({color:void 0!==t?t:0xffffff}))},e.EllipseCurve=am,e.EqualDepth=4,e.EqualStencilFunc=514,e.EquirectangularReflectionMapping=303,e.EquirectangularRefractionMapping=304,e.Euler=ey,e.EventDispatcher=o,e.ExtrudeBufferGeometry=aK,e.ExtrudeGeometry=aK,e.FaceColors=1,e.FileLoader=sN,e.FlatShading=1,e.Float16BufferAttribute=tt,e.Float32Attribute=function(e,t){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new ti(e,t)},e.Float32BufferAttribute=ti,e.Float64Attribute=function(e,t){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new tn(e,t)},e.Float64BufferAttribute=tn,e.FloatType=1015,e.Fog=ra,e.FogExp2=rr,e.Font=os,e.FontLoader=class extends sI{constructor(e){super(e)}load(e,t,i,n){let r=this,a=new sN(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(r.withCredentials),a.load(e,function(e){let i;try{i=JSON.parse(e)}catch(t){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),i=JSON.parse(e.substring(65,e.length-2))}let n=r.parse(i);t&&t(n)},i,n)}parse(e){return new os(e)}},e.FrontSide=0,e.Frustum=tZ,e.GLBufferAttribute=oO,e.GLSL1="100",e.GLSL3=s,e.GammaEncoding=3007,e.GreaterDepth=6,e.GreaterEqualDepth=5,e.GreaterEqualStencilFunc=518,e.GreaterStencilFunc=516,e.GridHelper=o1,e.Group=n8,e.HalfFloatType=1016,e.HemisphereLight=sV,e.HemisphereLightHelper=class extends eD{constructor(e,t,i){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i;let n=new a3(t);n.rotateY(.5*Math.PI),this.material=new e0({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);let r=new Float32Array(3*n.getAttribute("position").count);n.setAttribute("color",new e2(r,3)),this.add(new tI(n,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){let e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{let t=e.geometry.getAttribute("color");o$.copy(this.light.color),o0.copy(this.light.groundColor);for(let e=0,i=t.count;e<i;e++){let n=e<i/2?o$:o0;t.setXYZ(e,n.r,n.g,n.b)}t.needsUpdate=!0}e.lookAt(oK.setFromMatrixPosition(this.light.matrixWorld).negate())}},e.HemisphereLightProbe=oh,e.IcosahedronBufferGeometry=a0,e.IcosahedronGeometry=a0,e.ImageBitmapLoader=or,e.ImageLoader=sz,e.ImageUtils=M,e.ImmediateRenderObject=oq,e.IncrementStencilOp=7682,e.IncrementWrapStencilOp=34055,e.InstancedBufferAttribute=rU,e.InstancedBufferGeometry=s9,e.InstancedInterleavedBuffer=oF,e.InstancedMesh=rW,e.Int16Attribute=function(e,t){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new e8(e,t)},e.Int16BufferAttribute=e8,e.Int32Attribute=function(e,t){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new e9(e,t)},e.Int32BufferAttribute=e9,e.Int8Attribute=function(e,t){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new e4(e,t)},e.Int8BufferAttribute=e4,e.IntType=1013,e.InterleavedBuffer=ro,e.InterleavedBufferAttribute=rh,e.Interpolant=sg,e.InterpolateDiscrete=2300,e.InterpolateLinear=2301,e.InterpolateSmooth=2302,e.InvertStencilOp=5386,e.JSONLoader=function(){console.error("THREE.JSONLoader has been removed.")},e.KeepStencilOp=7680,e.KeyframeTrack=s_,e.LOD=rA,e.LatheBufferGeometry=a1,e.LatheGeometry=a1,e.Layers=ex,e.LensFlare=function(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")},e.LessDepth=2,e.LessEqualDepth=3,e.LessEqualStencilFunc=515,e.LessStencilFunc=513,e.Light=sk,e.LightProbe=s6,e.Line=rQ,e.Line3=oj,e.LineBasicMaterial=rj,e.LineCurve=aA,e.LineCurve3=aL,e.LineDashedMaterial=sp,e.LineLoop=r1,e.LinePieces=1,e.LineSegments=r0,e.LineStrip=0,e.LinearEncoding=3e3,e.LinearFilter=1006,e.LinearInterpolant=sy,e.LinearMipMapLinearFilter=1008,e.LinearMipMapNearestFilter=1007,e.LinearMipmapLinearFilter=1008,e.LinearMipmapNearestFilter=1007,e.LinearToneMapping=1,e.Loader=sI,e.LoaderUtils=s7,e.LoadingManager=sC,e.LogLuvEncoding=3003,e.LoopOnce=2200,e.LoopPingPong=2202,e.LoopRepeat=2201,e.LuminanceAlphaFormat=1025,e.LuminanceFormat=1024,e.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},e.Material=eq,e.MaterialLoader=s8,e.Math=x,e.MathUtils=x,e.Matrix3=b,e.Matrix4=el,e.MaxEquation=104,e.Mesh=tI,e.MeshBasicMaterial=e0,e.MeshDepthMaterial=n0,e.MeshDistanceMaterial=n1,e.MeshFaceMaterial=function(e){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),e},e.MeshLambertMaterial=sc,e.MeshMatcapMaterial=sd,e.MeshNormalMaterial=su,e.MeshPhongMaterial=sl,e.MeshPhysicalMaterial=so,e.MeshStandardMaterial=ss,e.MeshToonMaterial=sh,e.MinEquation=103,e.MirroredRepeatWrapping=1002,e.MixOperation=1,e.MultiMaterial=function(e=[]){return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),e.isMultiMaterial=!0,e.materials=e,e.clone=function(){return e.slice()},e},e.MultiplyBlending=4,e.MultiplyOperation=0,e.NearestFilter=1003,e.NearestMipMapLinearFilter=1005,e.NearestMipMapNearestFilter=1004,e.NearestMipmapLinearFilter=1005,e.NearestMipmapNearestFilter=1004,e.NeverDepth=0,e.NeverStencilFunc=512,e.NoBlending=0,e.NoColors=0,e.NoToneMapping=0,e.NormalAnimationBlendMode=2500,e.NormalBlending=1,e.NotEqualDepth=
1217,e.NotEqualStencilFunc=517,e.NumberKeyframeTrack=sw,e.Object3D=eD,e.ObjectLoader=class extends sI{constructor(e){super(e)}load(e,t,i,n){let r=this,a=""===this.path?s7.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||a;let s=new sN(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(i){let a=null;try{a=JSON.parse(i)}catch(t){return void 0!==n&&n(t),void console.error("THREE:ObjectLoader: Can't parse "+e+".",t.message)}let s=a.metadata;void 0!==s&&void 0!==s.type&&"geometry"!==s.type.toLowerCase()?r.parse(a,t):console.error("THREE.ObjectLoader: Can't load "+e)},i,n)}async loadAsync(e,t){let i=""===this.path?s7.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||i;let n=new sN(this.manager);n.setPath(this.path),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials);let r=JSON.parse(await n.loadAsync(e,t)),a=r.metadata;if(void 0===a||void 0===a.type||"geometry"===a.type.toLowerCase())throw Error("THREE.ObjectLoader: Can't load "+e);return await this.parseAsync(r)}parse(e,t){let i=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,n),a=this.parseImages(e.images,function(){void 0!==t&&t(l)}),s=this.parseTextures(e.textures,a),o=this.parseMaterials(e.materials,s),l=this.parseObject(e.object,r,o,s,i),h=this.parseSkeletons(e.skeletons,l);if(this.bindSkeletons(l,h),void 0!==t){let e=!1;for(let t in a)if(a[t]instanceof HTMLImageElement){e=!0;break}!1===e&&t(l)}return l}async parseAsync(e){let t=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),n=this.parseGeometries(e.geometries,i),r=await this.parseImagesAsync(e.images),a=this.parseTextures(e.textures,r),s=this.parseMaterials(e.materials,a),o=this.parseObject(e.object,n,s,a,t),l=this.parseSkeletons(e.skeletons,o);return this.bindSkeletons(o,l),o}parseShapes(e){let t={};if(void 0!==e)for(let i=0,n=e.length;i<n;i++){let n=(new sG).fromJSON(e[i]);t[n.uuid]=n}return t}parseSkeletons(e,t){let i={},n={};if(t.traverse(function(e){e.isBone&&(n[e.uuid]=e)}),void 0!==e)for(let t=0,r=e.length;t<r;t++){let r=(new rO).fromJSON(e[t],n);i[r.uuid]=r}return i}parseGeometries(e,t){let i={};if(void 0!==e){let n=new oe;for(let r=0,a=e.length;r<a;r++){let a;let s=e[r];switch(s.type){case"BufferGeometry":case"InstancedBufferGeometry":a=n.parse(s);break;case"Geometry":console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported.");break;default:s.type in sr?a=sr[s.type].fromJSON(s,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${s.type}"`)}a.uuid=s.uuid,void 0!==s.name&&(a.name=s.name),!0===a.isBufferGeometry&&void 0!==s.userData&&(a.userData=s.userData),i[s.uuid]=a}}return i}parseMaterials(e,t){let i={},n={};if(void 0!==e){let r=new s8;r.setTextures(t);for(let t=0,a=e.length;t<a;t++){let a=e[t];if("MultiMaterial"===a.type){let e=[];for(let t=0;t<a.materials.length;t++){let n=a.materials[t];void 0===i[n.uuid]&&(i[n.uuid]=r.parse(n)),e.push(i[n.uuid])}n[a.uuid]=e}else void 0===i[a.uuid]&&(i[a.uuid]=r.parse(a)),n[a.uuid]=i[a.uuid]}}return n}parseAnimations(e){let t={};if(void 0!==e)for(let i=0;i<e.length;i++){let n=e[i],r=sL.parse(n);t[r.uuid]=r}return t}parseImages(e,t){let i;let n=this,r={};function a(e){if("string"==typeof e){var t;return t=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(e)?e:n.resourcePath+e,n.manager.itemStart(t),i.load(t,function(){n.manager.itemEnd(t)},void 0,function(){n.manager.itemError(t),n.manager.itemEnd(t)})}return e.data?{data:ts(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){(i=new sz(new sC(t))).setCrossOrigin(this.crossOrigin);for(let t=0,i=e.length;t<i;t++){let i=e[t],n=i.url;if(Array.isArray(n)){r[i.uuid]=[];for(let e=0,t=n.length;e<t;e++){let t=a(n[e]);null!==t&&(t instanceof HTMLImageElement?r[i.uuid].push(t):r[i.uuid].push(new rz(t.data,t.width,t.height)))}}else{let e=a(i.url);null!==e&&(r[i.uuid]=e)}}}return r}async parseImagesAsync(e){let t;let i=this,n={};async function r(e){if("string"==typeof e){let n=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(e)?e:i.resourcePath+e;return await t.loadAsync(n)}return e.data?{data:ts(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){(t=new sz(this.manager)).setCrossOrigin(this.crossOrigin);for(let t=0,i=e.length;t<i;t++){let i=e[t],a=i.url;if(Array.isArray(a)){n[i.uuid]=[];for(let e=0,t=a.length;e<t;e++){let t=a[e],s=await r(t);null!==s&&(s instanceof HTMLImageElement?n[i.uuid].push(s):n[i.uuid].push(new rz(s.data,s.width,s.height)))}}else{let e=await r(i.url);null!==e&&(n[i.uuid]=e)}}}return n}parseTextures(e,t){function i(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}let n={};if(void 0!==e)for(let r=0,a=e.length;r<a;r++){let a;let s=e[r];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===t[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image);let o=t[s.image];Array.isArray(o)?(a=new tk(o),6===o.length&&(a.needsUpdate=!0)):(a=o&&o.data?new rz(o.data,o.width,o.height):new S(o),o&&(a.needsUpdate=!0)),a.uuid=s.uuid,void 0!==s.name&&(a.name=s.name),void 0!==s.mapping&&(a.mapping=i(s.mapping,ot)),void 0!==s.offset&&a.offset.fromArray(s.offset),void 0!==s.repeat&&a.repeat.fromArray(s.repeat),void 0!==s.center&&a.center.fromArray(s.center),void 0!==s.rotation&&(a.rotation=s.rotation),void 0!==s.wrap&&(a.wrapS=i(s.wrap[0],oi),a.wrapT=i(s.wrap[1],oi)),void 0!==s.format&&(a.format=s.format),void 0!==s.type&&(a.type=s.type),void 0!==s.encoding&&(a.encoding=s.encoding),void 0!==s.minFilter&&(a.minFilter=i(s.minFilter,on)),void 0!==s.magFilter&&(a.magFilter=i(s.magFilter,on)),void 0!==s.anisotropy&&(a.anisotropy=s.anisotropy),void 0!==s.flipY&&(a.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(a.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(a.unpackAlignment=s.unpackAlignment),n[s.uuid]=a}return n}parseObject(e,t,i,n,r){let a,s,o;function l(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function h(e){if(void 0!==e){if(Array.isArray(e)){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];void 0===i[r]&&console.warn("THREE.ObjectLoader: Undefined material",r),t.pu
121sh(i[r])}return t}return void 0===i[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),i[e]}}function u(e){return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined texture",e),n[e]}switch(e.type){case"Scene":a=new rs,void 0!==e.background&&(Number.isInteger(e.background)?a.background=new e$(e.background):a.background=u(e.background)),void 0!==e.environment&&(a.environment=u(e.environment)),void 0!==e.fog&&("Fog"===e.fog.type?a.fog=new ra(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(a.fog=new rr(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":a=new tH(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(a.focus=e.focus),void 0!==e.zoom&&(a.zoom=e.zoom),void 0!==e.filmGauge&&(a.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(a.filmOffset=e.filmOffset),void 0!==e.view&&(a.view=Object.assign({},e.view));break;case"OrthographicCamera":a=new t9(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(a.zoom=e.zoom),void 0!==e.view&&(a.view=Object.assign({},e.view));break;case"AmbientLight":a=new s2(e.color,e.intensity);break;case"DirectionalLight":a=new s3(e.color,e.intensity);break;case"PointLight":a=new s0(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":a=new s4(e.color,e.intensity,e.width,e.height);break;case"SpotLight":a=new sJ(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":a=new sV(e.color,e.groundColor,e.intensity);break;case"LightProbe":a=(new s6).fromJSON(e);break;case"SkinnedMesh":a=new rD(s=l(e.geometry),o=h(e.material)),void 0!==e.bindMode&&(a.bindMode=e.bindMode),void 0!==e.bindMatrix&&a.bindMatrix.fromArray(e.bindMatrix),void 0!==e.skeleton&&(a.skeleton=e.skeleton);break;case"Mesh":a=new tI(s=l(e.geometry),o=h(e.material));break;case"InstancedMesh":s=l(e.geometry),o=h(e.material);let c=e.count,d=e.instanceMatrix,p=e.instanceColor;(a=new rW(s,o,c)).instanceMatrix=new rU(new Float32Array(d.array),16),void 0!==p&&(a.instanceColor=new rU(new Float32Array(p.array),p.itemSize));break;case"LOD":a=new rA;break;case"Line":a=new rQ(l(e.geometry),h(e.material));break;case"LineLoop":a=new r1(l(e.geometry),h(e.material));break;case"LineSegments":a=new r0(l(e.geometry),h(e.material));break;case"PointCloud":case"Points":a=new r8(l(e.geometry),h(e.material));break;case"Sprite":a=new rw(h(e.material));break;case"Group":a=new n8;break;case"Bone":a=new rN;break;default:a=new eD}if(a.uuid=e.uuid,void 0!==e.name&&(a.name=e.name),void 0!==e.matrix?(a.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(a.matrixAutoUpdate=e.matrixAutoUpdate),a.matrixAutoUpdate&&a.matrix.decompose(a.position,a.quaternion,a.scale)):(void 0!==e.position&&a.position.fromArray(e.position),void 0!==e.rotation&&a.rotation.fromArray(e.rotation),void 0!==e.quaternion&&a.quaternion.fromArray(e.quaternion),void 0!==e.scale&&a.scale.fromArray(e.scale)),void 0!==e.castShadow&&(a.castShadow=e.castShadow),void 0!==e.receiveShadow&&(a.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(a.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(a.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(a.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&a.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(a.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(a.visible=e.visible),void 0!==e.frustumCulled&&(a.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(a.renderOrder=e.renderOrder),void 0!==e.userData&&(a.userData=e.userData),void 0!==e.layers&&(a.layers.mask=e.layers),void 0!==e.children){let s=e.children;for(let e=0;e<s.length;e++)a.add(this.parseObject(s[e],t,i,n,r))}if(void 0!==e.animations){let t=e.animations;for(let e=0;e<t.length;e++){let i=t[e];a.animations.push(r[i])}}if("LOD"===e.type){void 0!==e.autoUpdate&&(a.autoUpdate=e.autoUpdate);let t=e.levels;for(let e=0;e<t.length;e++){let i=t[e],n=a.getObjectByProperty("uuid",i.object);void 0!==n&&a.addLevel(n,i.distance)}}return a}bindSkeletons(e,t){0!==Object.keys(t).length&&e.traverse(function(e){if(!0===e.isSkinnedMesh&&void 0!==e.skeleton){let i=t[e.skeleton];void 0===i?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",e.skeleton):e.bind(i,e.bindMatrix)}})}setTexturePath(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}},e.ObjectSpaceNormalMap=1,e.OctahedronBufferGeometry=a3,e.OctahedronGeometry=a3,e.OneFactor=201,e.OneMinusDstAlphaFactor=207,e.OneMinusDstColorFactor=209,e.OneMinusSrcAlphaFactor=205,e.OneMinusSrcColorFactor=203,e.Orthogra
121phicCamera=t9,e.PCFShadowMap=1,e.PCFSoftShadowMap=2,e.PMREMGenerator=im,e.ParametricBufferGeometry=a2,e.ParametricGeometry=a2,e.Particle=function(e){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new rw(e)},e.ParticleBasicMaterial=function(e){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new r3(e)},e.ParticleSystem=function(e,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new r8(e,t)},e.ParticleSystemMaterial=function(e){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new r3(e)},e.Path=sH,e.PerspectiveCamera=tH,e.Plane=tX,e.PlaneBufferGeometry=t$,e.PlaneGeometry=t$,e.PlaneHelper=class extends rQ{constructor(e,t=1,i=0xffff00){let n=new tm;n.setAttribute("position",new ti([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,0,1,0,0,0],3)),n.computeBoundingSphere(),super(n,new rj({color:i,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;let r=new tm;r.setAttribute("position",new ti([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),r.computeBoundingSphere(),this.add(new tI(r,new e0({color:i,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){let t=-this.plane.constant;1e-8>Math.abs(t)&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?1:0,this.lookAt(this.plane.normal),super.updateMatrixWorld(e)}},e.PointCloud=function(e,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new r8(e,t)},e.PointCloudMaterial=function(e){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new r3(e)},e.PointLight=s0,e.PointLightHelper=class extends tI{constructor(e,t,i){super(new a6(t,4,2),new e0({wireframe:!0,fog:!1,toneMapped:!1})),this.light=e,this.light.updateMatrixWorld(),this.color=i,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}},e.Points=r8,e.PointsMaterial=r3,e.PolarGridHelper=class extends r0{constructor(e=10,t=16,i=8,n=64,r=4473924,a=8947848){r=new e$(r),a=new e$(a);let s=[],o=[];for(let i=0;i<=t;i++){let n=i/t*(2*Math.PI),l=Math.sin(n)*e,h=Math.cos(n)*e;s.push(0,0,0),s.push(l,0,h);let u=1&i?r:a;o.push(u.r,u.g,u.b),o.push(u.r,u.g,u.b)}for(let t=0;t<=i;t++){let l=1&t?r:a,h=e-e/i*t;for(let e=0;e<n;e++){let t=e/n*(2*Math.PI),i=Math.sin(t)*h,r=Math.cos(t)*h;s.push(i,0,r),o.push(l.r,l.g,l.b),i=Math.sin(t=(e+1)/n*(2*Math.PI))*h,r=Math.cos(t)*h,s.push(i,0,r),o.push(l.r,l.g,l.b)}}let l=new tm;l.setAttribute("position",new ti(s,3)),l.setAttribute("color",new ti(o,3)),super(l,new rj({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}},e.PolyhedronBufferGeometry=as,e.PolyhedronGeometry=as,e.PositionalAudio=class extends ox{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,i){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=i,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(o_,ob,oM),ow.set(0,0,1).applyQuaternion(ob);let t=this.panner;if(t.positionX){let e=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(o_.x,e),t.positionY.linearRampToValueAtTime(o_.y,e),t.positionZ.linearRampToValueAtTime(o_.z,e),t.orientationX.linearRampToValueAtTime(ow.x,e),t.orientationY.linearRampToValueAtTime(ow.y,e),t.orientationZ.linearRampToValueAtTime(ow.z,e)}else t.setPosition(o_.x,o_.y,o_.z),t.setOrientation(ow.x,ow.y,ow.z)}},e.PropertyBinding=oI,e.PropertyMixer=oT,e.QuadraticBezierCurve=aR,e.QuadraticBezierCurve3=aC,e.Quaternion=C,e.QuaternionKeyframeTrack=sT,e.QuaternionLinearInterpolant=sS,e.REVISION="132",e.RGBADepthPacking=3201,e.RGBAFormat=1023,e.RGBAIntegerFormat=1033,e.RGBA_ASTC_10x10_Format=37819,e.RGBA_ASTC_10x5_Format=37816,e.RGBA_ASTC_10x6_Format=37817,e.RGBA_ASTC_10x8_Format=37818,e.RGBA_ASTC_12x10_Format=37820,e.RGBA_ASTC_12x12_Format=37821,e.RGBA_ASTC_4x4_Format=37808,e.RGBA_ASTC_5x4_Format=37809,e.RGBA_ASTC_5x5_Format=37810,e.RGBA_ASTC_6x5_Format=37811,e.RGBA_ASTC_6x6_Format=37812,e.RGBA_ASTC_8x5_Format=37813,e.RGBA_ASTC_8x6_Format=37814,e.RGBA_ASTC_8x8_Format=37815,e.RGBA_BPTC_Format=36492,e.RGBA_ETC2_EAC_Format=37496,e.RGBA_PVRTC_2BPPV1_Format=35843,e.RGBA_PVRTC_4BPPV1_Format=35842,e.RGBA_S3TC_DXT1_Format=33777,e.RGBA_S3TC_DXT3_Format=33778,e.RGBA_S3TC_DXT5_Format=33779,e.RGBDEncoding=3006,e.RGBEEncoding=3002,e.RGBEFormat=1023,e.RGBFormat=1022,e.RGBIntegerFormat=1032,e.RGBM16Encoding=3005,e.RGBM7Encoding=3004,e.RGB_ETC1_Format=36196,e.RGB_ETC2_Format=37492,e.RGB_PVRTC_2BPPV1_Format=35841,e.RGB_PVRTC_4BPPV1_Format=35840,e.RGB_S3TC_DXT1_Format=33776,e.RGFormat=1030,e.RGIntegerFormat=1031,e.RawShaderMaterial=ie,e.Ray=eo,e.Raycaster=class{constructor(e,t,i=0,n=1/0){this.ray=new eo(e,t),this.near=i,this.far=n,this.camera=null,this.layers=new ex,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster:
121Unsupported camera type: "+t.type)}intersectObject(e,t=!1,i=[]){return oH(e,this,i,t),i.sort(oU),i}intersectObjects(e,t=!1,i=[]){for(let n=0,r=e.length;n<r;n++)oH(e[n],this,i,t);return i.sort(oU),i}},e.RectAreaLight=s4,e.RedFormat=1028,e.RedIntegerFormat=1029,e.ReinhardToneMapping=2,e.RepeatWrapping=1e3,e.ReplaceStencilOp=7681,e.ReverseSubtractEquation=102,e.RingBufferGeometry=a4,e.RingGeometry=a4,e.SRGB8_ALPHA8_ASTC_10x10_Format=37851,e.SRGB8_ALPHA8_ASTC_10x5_Format=37848,e.SRGB8_ALPHA8_ASTC_10x6_Format=37849,e.SRGB8_ALPHA8_ASTC_10x8_Format=37850,e.SRGB8_ALPHA8_ASTC_12x10_Format=37852,e.SRGB8_ALPHA8_ASTC_12x12_Format=37853,e.SRGB8_ALPHA8_ASTC_4x4_Format=37840,e.SRGB8_ALPHA8_ASTC_5x4_Format=37841,e.SRGB8_ALPHA8_ASTC_5x5_Format=37842,e.SRGB8_ALPHA8_ASTC_6x5_Format=37843,e.SRGB8_ALPHA8_ASTC_6x6_Format=37844,e.SRGB8_ALPHA8_ASTC_8x5_Format=37845,e.SRGB8_ALPHA8_ASTC_8x6_Format=37846,e.SRGB8_ALPHA8_ASTC_8x8_Format=37847,e.Scene=rs,e.SceneUtils={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}},e.ShaderChunk=t0,e.ShaderLib=t3,e.ShaderMaterial=tO,e.ShadowMaterial=sa,e.Shape=sG,e.ShapeBufferGeometry=a5,e.ShapeGeometry=a5,e.ShapePath=oa,e.ShapeUtils=aJ,e.ShortType=1011,e.Skeleton=rO,e.SkeletonHelper=oQ,e.SkinnedMesh=rD,e.SmoothShading=2,e.Sphere=$,e.SphereBufferGeometry=a6,e.SphereGeometry=a6,e.Spherical=class{constructor(e=1,t=0,i=0){return this.radius=e,this.phi=t,this.theta=i,this}set(e,t,i){return this.radius=e,this.phi=t,this.theta=i,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+t*t+i*i),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,i),this.phi=Math.acos(p(t/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}},e.SphericalHarmonics3=s5,e.SplineCurve=aP,e.SpotLight=sJ,e.SpotLightHelper=class extends eD{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;let i=new tm,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];for(let e=0,t=1;e<32;e++,t++){let i=e/32*Math.PI*2,r=t/32*Math.PI*2;n.push(Math.cos(i),Math.sin(i),1,Math.cos(r),Math.sin(r),1)}i.setAttribute("position",new ti(n,3));let r=new rj({fog:!1,toneMapped:!1});this.cone=new r0(i,r),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateMatrixWorld();let e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),oX.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(oX),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}},e.Sprite=rw,e.SpriteMaterial=ru,e.SrcAlphaFactor=204,e.SrcAlphaSaturateFactor=210,e.SrcColorFactor=202,e.StaticCopyUsage=35046,e.StaticDrawUsage=35044,e.StaticReadUsage=35045,e.StereoCamera=class{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new tH,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new tH,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){let t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){let i,n;t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep;let r=e.projectionMatrix.clone(),a=t.eyeSep/2,s=a*t.near/t.focus,o=t.near*Math.tan(u*t.fov*.5)/t.zoom;od.elements[12]=-a,oc.elements[12]=a,i=-o*t.aspect+s,n=o*t.aspect+s,r.elements[0]=2*t.near/(n-i),r.elements[8]=(n+i)/(n-i),this.cameraL.projectionMatrix.copy(r),i=-o*t.aspect-s,n=o*t.aspect-s,r.elements[0]=2*t.near/(n-i),r.elements[8]=(n+i)/(n-i),this.cameraR.projectionMatrix.copy(r)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(od),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(oc)}},e.StreamCopyUsage=35042,e.StreamDrawUsage=35040,e.StreamReadUsage=35041,e.StringKeyframeTrack=sE,e.SubtractEquation=101,e.SubtractiveBlending=3,e.TOUCH={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},e.TangentSpaceNormalMap=0,e.TetrahedronBufferGeometry=a8,e.TetrahedronGeometry=a8,e.TextBufferGeometry=a7,e.TextGeometry=a7,e.Texture=S,e.TextureLoader=sO,e.TorusBufferGeometry=a9,e.TorusGeometry=a9,e.TorusKnotBufferGeometry=se,e.TorusKnotGeometry=se,e.Triangle=eW,e.TriangleFanDrawMode=2,e.TriangleStripDrawMode=1,e.TrianglesDrawMode=0,e.TubeBufferGeometry=st,e.TubeGeometry=st,e.UVMapping=300,e.Uint16Attribute=function(e,t){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new e7(e,t)},e.Uint16BufferAttribute=e7,e.Uint32Attribute=function(e,t){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new te(e,t)},e.Uint32BufferAttribute=te,e.Uint8Attribute=function(e,t){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new e5(e,t)},e.Uint8BufferAttribute=e5,e.Uint8ClampedAttribute=function(e,t){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new e6(e,t)},e.Uint8ClampedBufferAttribute=e6,e.Uniform=oB,e.UniformsLib=t1,e.UniformsUtils=tF,e.UnsignedByteType=1009,e.UnsignedInt248Type=1020,e.UnsignedIntType=1014,e.UnsignedShort4444Type=1017,e.UnsignedShort5551Type=1018,e.UnsignedShort565Type=1019,e.UnsignedShortType=1012,e.VSMShadowMap=3,e.Vector2=_,e.Vector3=P,e.Vector4=E,e.VectorKeyframeTrack=sA,e.Vertex=function(e,t,i){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new P(e,t,i)},e.VertexColors=2,e.VideoTexture=r9,e.WebGL1Renderer=rn,e.WebGLCubeRen
121derTarget=tV,e.WebGLMultipleRenderTargets=L,e.WebGLMultisampleRenderTarget=R,e.WebGLRenderTarget=A,e.WebGLRenderTargetCube=function(e,t,i){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new tV(e,i)},e.WebGLRenderer=ri,e.WebGLUtils=n5,e.WireframeGeometry=si,e.WireframeHelper=function(e,t){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new r0(new si(e.geometry),new rj({color:void 0!==t?t:0xffffff}))},e.WrapAroundEnding=2402,e.XHRLoader=function(e){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new sN(e)},e.ZeroCurvatureEnding=2400,e.ZeroFactor=200,e.ZeroSlopeEnding=2401,e.ZeroStencilOp=0,e.sRGBEncoding=3001,Object.defineProperty(e,"__esModule",{value:!0})})(t)}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.