// COPYRIGHT © 2021 Esri
//
// All rights reserved under the copyright laws of the United States
// and applicable international laws, treaties, and conventions.
//
// This material is licensed for use under the Esri Master License
// Agreement (MLA), and is bound by the terms of that agreement.
// You may redistribute and use this code without modification,
// provided you adhere to the terms of the MLA and include this
// copyright notice.
//
// See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english
//
// For additional information, contact:
// Environmental Systems Research Institute, Inc.
// Attn: Contracts and Legal Services Department
// 380 New York Street
// Redlands, California, USA 92373
// USA
//
// email: contracts@esri.com
//
// See http://js.arcgis.com/3.37/esri/copyright.txt for details.

this.BAIV3||function(t){"use strict";function e(){}Object.assign(e.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)},removeEventListener:function(t,e){if(void 0!==this._listeners){var n=this._listeners[t];if(void 0!==n){var r=n.indexOf(e);-1!==r&&n.splice(r,1)}}},dispatchEvent:function(t){if(void 0!==this._listeners){var e=this._listeners[t.type];if(void 0!==e){t.target=this;for(var n=e.slice(0),r=0,i=n.length;r<i;r++)n[r].call(this,t)}}}});var n,r,i,o,a,s=103,c=104,l=1e3,h=1001,u=1002,d=1003,p=1004,f=1005,m=1006,g=1008,v=1009,y=1012,x=1014,w=1015,_=1016,M=1020,b=1022,S=1023,L=1026,A=1027,T={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){for(var t=[],e=0;e<256;e++)t[e]=(e<16?"0":"")+e.toString(16);return function(){var e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(t[255&e]+t[e>>8&255]+t[e>>16&255]+t[e>>24&255]+"-"+t[255&n]+t[n>>8&255]+"-"+t[n>>16&15|64]+t[n>>24&255]+"-"+t[63&r|128]+t[r>>8&255]+"-"+t[r>>16&255]+t[r>>24&255]+t[255&i]+t[i>>8&255]+t[i>>16&255]+t[i>>24&255]).toUpperCase()}}(),clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)},lerp:function(t,e,n){return(1-n)*t+n*e},smoothstep:function(t,e,n){return t<=e?0:n<=t?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:n<=t?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*T.DEG2RAD},radToDeg:function(t){return t*T.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}};function P(t,e){this.x=t||0,this.y=e||0}function C(t,e,n,r){this._x=t||0,this._y=e||0,this._z=n||0,this._w=void 0!==r?r:1}function E(t,e,n){this.x=t||0,this.y=e||0,this.z=n||0}function I(){this.elements=[1,0,0,0,1,0,0,0,1],0<arguments.length&&console.error("BAIV3.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.defineProperties(P.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(P.prototype,{isVector2:!0,set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("BAIV3.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("BAIV3.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},applyMatrix3:function(t){var e=this.x,n=this.y,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6],this.y=r[1]*e+r[4]*n+r[7],this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("BAIV3.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){var n=Math.cos(e),r=Math.sin(e),i=this.x-t.x,o=this.y-t.y;return this.x=i*n-o*r+t.x,this.y=i*r+o*n+t.y,this}}),Object.assign(C,{slerp:function(t,e,n,r){return n.copy(t).slerp(e,r)},slerpFlat:function(t,e,n,r,i,o,a){throw"error: calling lost code 1"}}),Object.defineProperties(C.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback()}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback()}}}),Object.assign(C.prototype,{isQuaternion:!0,set:function(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._w=r,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this.onChangeCallback(),this},setFromEuler:function(t,e){if(!t||!t.isEuler)throw new Error("BAIV3.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=t._x,r=t._y,i=t._z,o=t.order,a=Math.cos,s=Math.sin,c=a(n/2),l=a(r/2),h=a(i/2),u=s(n/2),d=s(r/2),p=s(i/2);return"XYZ"===o?(this._x=u*l*h+c*d*p,this._y=c*d*h-u*l*p,this._z=c*l*p+u*d*h,this._w=c*l*h-u*d*p):"YXZ"===o?(this._x=u*l*h+c*d*p,this._y=c*d*h-u*l*p,this._z=c*l*p-u*d*h,this._w=c*l*h+u*d*p):"ZXY"===o?(this._x=u*l*h-c*d*p,this._y=c*d*h+u*l*p,this._z=c*l*p+u*d*h,this._w=c*l*h-u*d*p):"ZYX"===o?(this._x=u*l*h-c*d*p,this._y=c*d*h+u*l*p,this._z=c*l*p-u*d*h,this._w=c*l*h+u*d*p):"YZX"===o?(this._x=u*l*h+c*d*p,this._y=c*d*h+u*l*p,this._z=c*l*p-u*d*h,this._w=c*l*h-u*d*p):"XZY"===o&&(this._x=u*l*h-c*d*p,this._y=c*d*h-u*l*p,this._z=c*l*p+u*d*h,this._w=c*l*h+u*d*p),!1!==e&&this.onChangeCallback(),this},setFromAxisAngle:function(t,e){var n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this.onChangeCallback(),this},setFromRotationMatrix:function(t){var e,n=t.elements,r=n[0],i=n[4],o=n[8],a=n[1],s=n[5],c=n[9],l=n[2],h=n[6],u=n[10],d=r+s+u;return 0<d?(e=.5/Math.sqrt(d+1),this._w=.25/e,this._x=(h-c)*e,this._y=(o-l)*e,this._z=(a-i)*e):s<r&&u<r?(e=2*Math.sqrt(1+r-s-u),this._w=(h-c)/e,this._x=.25*e,this._y=(i+a)/e,this._z=(o+l)/e):u<s?(e=2*Math.sqrt(1+s-r-u),this._w=(o-l)/e,this._x=(i+a)/e,this._y=.25*e,this._z=(c+h)/e):(e=2*Math.sqrt(1+u-r-s),this._w=(a-i)/e,this._x=(o+l)/e,this._y=(c+h)/e,this._z=.25*e),this.onChangeCallback(),this},setFromUnitVectors:function(t,e){var n=t.dot(e)+1;return n<1e-6?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0):(this._x=0,this._y=-t.z,this._z=t.y)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x),this._w=n,this.normalize()},angleTo:function(t){return 2*Math.acos(Math.abs(T.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,e){var n=this.angleTo(t);if(0===n)return this;var r=Math.min(1,e/n);return this.slerp(t,r),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this.onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("BAIV3.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var n=t._x,r=t._y,i=t._z,o=t._w,a=e._x,s=e._y,c=e._z,l=e._w;return this._x=n*l+o*a+r*c-i*s,this._y=r*l+o*s+i*a-n*c,this._z=i*l+o*c+n*s-r*a,this._w=o*l-n*a-r*s-i*c,this.onChangeCallback(),this},slerp:function(t,e){throw"error: calling lost code 2"},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),Object.assign(E.prototype,{isVector3:!0,set:function(t,e,n){return this.x=t,this.y=e,this.z=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("BAIV3.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("BAIV3.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("BAIV3.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:(a=new C,function(t){return t&&t.isEuler||console.error("BAIV3.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(a.setFromEuler(t))}),applyAxisAngle:(o=new C,function(t,e){return this.applyQuaternion(o.setFromAxisAngle(t,e))}),applyMatrix3:function(t){var e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6]*r,this.y=i[1]*e+i[4]*n+i[7]*r,this.z=i[2]*e+i[5]*n+i[8]*r,this},applyMatrix4:function(t){var e=this.x,n=this.y,r=this.z,i=t.elements,o=1/(i[3]*e+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*e+i[4]*n+i[8]*r+i[12])*o,this.y=(i[1]*e+i[5]*n+i[9]*r+i[13])*o,this.z=(i[2]*e+i[6]*n+i[10]*r+i[14])*o,this},applyQuaternion:function(t){var e=this.x,n=this.y,r=this.z,i=t.x,o=t.y,a=t.z,s=t.w,c=s*e+o*r-a*n,l=s*n+a*e-i*r,h=s*r+i*n-o*e,u=-i*e-o*n-a*r;return this.x=c*s+u*-i+l*-a-h*-o,this.y=l*s+u*-o+h*-i-c*-a,this.z=h*s+u*-a+c*-o-l*-i,this},project:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},unproject:function(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)},transformDirection:function(t){var e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[4]*n+i[8]*r,this.y=i[1]*e+i[5]*n+i[9]*r,this.z=i[2]*e+i[6]*n+i[10]*r,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},cross:function(t,e){return void 0!==e?(console.warn("BAIV3.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)},crossVectors:function(t,e){var n=t.x,r=t.y,i=t.z,o=e.x,a=e.y,s=e.z;return this.x=r*s-i*a,this.y=i*o-n*s,this.z=n*a-r*o,this},projectOnVector:function(t){var e=t.dot(this)/t.lengthSq();return this.copy(t).multiplyScalar(e)},projectOnPlane:(i=new E,function(t){return i.copy(this).projectOnVector(t),this.sub(i)}),reflect:(r=new E,function(t){return this.sub(r.copy(t).multiplyScalar(2*this.dot(t)))}),angleTo:function(t){var e=this.dot(t)/Math.sqrt(this.lengthSq()*t.lengthSq());return Math.acos(T.clamp(e,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return e*e+n*n+r*r},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)},setFromSphericalCoords:function(t,e,n){var r=Math.sin(e)*t;return this.x=r*Math.sin(n),this.y=Math.cos(e)*t,this.z=r*Math.cos(n),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this},setFromMatrixPosition:function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=r,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.elements,4*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("BAIV3.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}}),Object.assign(I.prototype,{isMatrix3:!0,set:function(t,e,n,r,i,o,a,s,c){var l=this.elements;return l[0]=t,l[1]=r,l[2]=a,l[3]=e,l[4]=i,l[5]=s,l[6]=n,l[7]=o,l[8]=c,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this},setFromMatrix4:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},applyToBufferAttribute:(n=new E,function(t){for(var e=0,r=t.count;e<r;e++)n.x=t.getX(e),n.y=t.getY(e),n.z=t.getZ(e),n.applyMatrix3(this),t.setXYZ(e,n.x,n.y,n.z);return t}),multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,r=e.elements,i=this.elements,o=n[0],a=n[3],s=n[6],c=n[1],l=n[4],h=n[7],u=n[2],d=n[5],p=n[8],f=r[0],m=r[3],g=r[6],v=r[1],y=r[4],x=r[7],w=r[2],_=r[5],M=r[8];return i[0]=o*f+a*v+s*w,i[3]=o*m+a*y+s*_,i[6]=o*g+a*x+s*M,i[1]=c*f+l*v+h*w,i[4]=c*m+l*y+h*_,i[7]=c*g+l*x+h*M,i[2]=u*f+d*v+p*w,i[5]=u*m+d*y+p*_,i[8]=u*g+d*x+p*M,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],c=t[7],l=t[8];return e*o*l-e*a*c-n*i*l+n*a*s+r*i*c-r*o*s},getInverse:function(t,e){t&&t.isMatrix4&&console.error("BAIV3.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=t.elements,r=this.elements,i=n[0],o=n[1],a=n[2],s=n[3],c=n[4],l=n[5],h=n[6],u=n[7],d=n[8],p=d*c-l*u,f=l*h-d*s,m=u*s-c*h,g=i*p+o*f+a*m;if(0==g){var v="BAIV3.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(v);return console.warn(v),this.identity()}var y=1/g;return r[0]=p*y,r[1]=(a*u-d*o)*y,r[2]=(l*o-a*c)*y,r[3]=f*y,r[4]=(d*i-a*h)*y,r[5]=(a*s-l*i)*y,r[6]=m*y,r[7]=(o*h-u*i)*y,r[8]=(c*i-o*s)*y,this},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},setUvTransform:function(t,e,n,r,i,o,a){var s=Math.cos(i),c=Math.sin(i);this.set(n*s,n*c,-n*(s*o+c*a)+o+t,-r*c,r*s,-r*(-c*o+s*a)+a+e,0,0,1)},scale:function(t,e){var n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this},rotate:function(t){var e=Math.cos(t),n=Math.sin(t),r=this.elements,i=r[0],o=r[3],a=r[6],s=r[1],c=r[4],l=r[7];return r[0]=e*i+n*s,r[3]=e*o+n*c,r[6]=e*a+n*l,r[1]=-n*i+e*s,r[4]=-n*o+e*c,r[7]=-n*a+e*l,this},translate:function(t,e){var n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this},equals:function(t){for(var e=this.elements,n=t.elements,r=0;r<9;r++)if(e[r]!==n[r])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<9;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}});var D,B,O,V,R,N,z,U,F,G,j,k,W,H,X,q,Y,Z,J,Q,K,$,tt,et,nt,rt,it,ot,at,st,ct,lt,ht,ut,dt,pt,ft,mt,gt,vt={getDataURL:function(t){throw"error: calling lost code 3"}},yt=0;function xt(t,e,n,r,i,o,a,s,c,l){Object.defineProperty(this,"id",{value:yt++}),this.uuid=T.generateUUID(),this.name="",this.image=void 0!==t?t:xt.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:xt.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:h,this.wrapT=void 0!==r?r:h,this.magFilter=void 0!==i?i:m,this.minFilter=void 0!==o?o:g,this.anisotropy=void 0!==c?c:1,this.format=void 0!==a?a:S,this.type=void 0!==s?s:v,this.offset=new P(0,0),this.repeat=new P(1,1),this.center=new P(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new I,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==l?l:3e3,this.version=0,this.onUpdate=null}function wt(t,e,n,r){this.x=t||0,this.y=e||0,this.z=n||0,this.w=void 0!==r?r:1}function _t(t,e,n){this.width=t,this.height=e,this.scissor=new wt(0,0,t,e),this.scissorTest=!1,this.viewport=new wt(0,0,t,e),n=n||{},this.texture=new xt(void 0,void 0,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:m,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function Mt(t,e,n){_t.call(this,t,e,n),this.samples=4}function bt(t,e,n){_t.call(this,t,e,n)}function St(t,e,n,r,i,o,a,s,c,l,h,u){xt.call(this,null,o,a,s,c,l,r,i,h,u),this.image={data:t,width:e,height:n},this.magFilter=void 0!==c?c:d,this.minFilter=void 0!==l?l:d,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function Lt(t,e){this.min=void 0!==t?t:new E(1/0,1/0,1/0),this.max=void 0!==e?e:new E(-1/0,-1/0,-1/0)}function At(t,e){this.center=void 0!==t?t:new E,this.radius=void 0!==e?e:0}function Tt(t,e){this.normal=void 0!==t?t:new E(1,0,0),this.constant=void 0!==e?e:0}function Pt(t,e,n,r,i,o){this.planes=[void 0!==t?t:new Tt,void 0!==e?e:new Tt,void 0!==n?n:new Tt,void 0!==r?r:new Tt,void 0!==i?i:new Tt,void 0!==o?o:new Tt]}function Ct(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0<arguments.length&&console.error("BAIV3.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function Et(t){var e,n;for(e=0,n=t.length-3;e<=n;e+=3){ot.fromArray(t,e);var r=st.x*Math.abs(ot.x)+st.y*Math.abs(ot.y)+st.z*Math.abs(ot.z),i=$.dot(ot),o=tt.dot(ot),a=et.dot(ot);if(Math.max(-Math.max(i,o,a),Math.min(i,o,a))>r)return!1}return!0}function It(t){var e=t.geometry;if(void 0!==e)if(e.isGeometry){var n=e.vertices;for(ut=0,dt=n.length;ut<dt;ut++)pt.copy(n[ut]),pt.applyMatrix4(t.matrixWorld),ht.expandByPoint(pt)}else if(e.isBufferGeometry){var r=e.attributes.position;if(void 0!==r)for(ut=0,dt=r.count;ut<dt;ut++)pt.fromBufferAttribute(r,ut).applyMatrix4(t.matrixWorld),ht.expandByPoint(pt)}}xt.DEFAULT_IMAGE=void 0,xt.DEFAULT_MAPPING=300,xt.prototype=Object.assign(Object.create(e.prototype),{constructor:xt,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){throw"error: calling lost code 4"},toJSON:function(t){throw"error: calling lost code 5"},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){throw"error: calling lost code 6"}}),Object.defineProperty(xt.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(wt.prototype,{isVector4:!0,set:function(t,e,n,r){return this.x=t,this.y=e,this.z=n,this.w=r,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("BAIV3.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("BAIV3.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var e=this.x,n=this.y,r=this.z,i=this.w,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*r+o[12]*i,this.y=o[1]*e+o[5]*n+o[9]*r+o[13]*i,this.z=o[2]*e+o[6]*n+o[10]*r+o[14]*i,this.w=o[3]*e+o[7]*n+o[11]*r+o[15]*i,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,n,r,i,o=t.elements,a=o[0],s=o[4],c=o[8],l=o[1],h=o[5],u=o[9],d=o[2],p=o[6],f=o[10];if(Math.abs(s-l)<.01&&Math.abs(c-d)<.01&&Math.abs(u-p)<.01){if(Math.abs(s+l)<.1&&Math.abs(c+d)<.1&&Math.abs(u+p)<.1&&Math.abs(a+h+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;var m=(a+1)/2,g=(h+1)/2,v=(f+1)/2,y=(s+l)/4,x=(c+d)/4,w=(u+p)/4;return g<m&&v<m?i=m<.01?(n=0,r=.707106781):(r=y/(n=Math.sqrt(m)),x/n):v<g?i=g<.01?(r=0,n=.707106781):(n=y/(r=Math.sqrt(g)),w/r):v<.01?(r=n=.707106781,i=0):(n=x/(i=Math.sqrt(v)),r=w/i),this.set(n,r,i,e),this}var _=Math.sqrt((p-u)*(p-u)+(c-d)*(c-d)+(l-s)*(l-s));return Math.abs(_)<.001&&(_=1),this.x=(p-u)/_,this.y=(c-d)/_,this.z=(l-s)/_,this.w=Math.acos((a+h+f-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(t,e){return void 0===mt&&(mt=new wt,gt=new wt),mt.set(t,t,t,t),gt.set(e,e,e,e),this.clamp(mt,gt)},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("BAIV3.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}}),_t.prototype=Object.assign(Object.create(e.prototype),{constructor:_t,isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Mt.prototype=Object.assign(Object.create(_t.prototype),{constructor:Mt,isWebGLMultisampleRenderTarget:!0,copy:function(t){return _t.prototype.copy.call(this,t),this.samples=t.samples,this}}),((bt.prototype=Object.create(_t.prototype)).constructor=bt).prototype.isWebGLRenderTargetCube=!0,((St.prototype=Object.create(xt.prototype)).constructor=St).prototype.isDataTexture=!0,Object.assign(Lt.prototype,{isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,c=t.length;s<c;s+=3){var l=t[s],h=t[s+1],u=t[s+2];l<e&&(e=l),h<n&&(n=h),u<r&&(r=u),i<l&&(i=l),o<h&&(o=h),a<u&&(a=u)}return this.min.set(e,n,r),this.max.set(i,o,a),this},setFromBufferAttribute:function(t){for(var e=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,c=t.count;s<c;s++){var l=t.getX(s),h=t.getY(s),u=t.getZ(s);l<e&&(e=l),h<n&&(n=h),u<r&&(r=u),i<l&&(i=l),o<h&&(o=h),a<u&&(a=u)}return this.min.set(e,n,r),this.max.set(i,o,a),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:(ft=new E,function(t,e){var n=ft.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}),setFromObject:function(t){return this.makeEmpty(),this.expandByObject(t)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){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:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(t){return void 0===t&&(console.warn("BAIV3.Box3: .getCenter() target is now required"),t=new E),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("BAIV3.Box3: .getSize() target is now required"),t=new E),this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},expandByObject:(pt=new E,function(t){return ht=this,t.updateMatrixWorld(!0),t.traverse(It),this}),containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return void 0===e&&(console.warn("BAIV3.Box3: .getParameter() target is now required"),e=new E),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},intersectsSphere:(lt=new E,function(t){return this.clampPoint(t.center,lt),lt.distanceToSquared(t.center)<=t.radius*t.radius}),intersectsPlane:function(t){throw"error: calling lost code 7"},intersectsTriangle:($=new E,tt=new E,et=new E,nt=new E,rt=new E,it=new E,ot=new E,at=new E,st=new E,ct=new E,function(t){if(this.isEmpty())return!1;this.getCenter(at),st.subVectors(this.max,at),$.subVectors(t.a,at),tt.subVectors(t.b,at),et.subVectors(t.c,at),nt.subVectors(tt,$),rt.subVectors(et,tt),it.subVectors($,et);var e=[0,-nt.z,nt.y,0,-rt.z,rt.y,0,-it.z,it.y,nt.z,0,-nt.x,rt.z,0,-rt.x,it.z,0,-it.x,-nt.y,nt.x,0,-rt.y,rt.x,0,-it.y,it.x,0];return!!Et(e)&&!!Et(e=[1,0,0,0,1,0,0,0,1])&&(ct.crossVectors(nt,rt),Et(e=[ct.x,ct.y,ct.z]))}),clampPoint:function(t,e){return void 0===e&&(console.warn("BAIV3.Box3: .clampPoint() target is now required"),e=new E),e.copy(t).clamp(this.min,this.max)},distanceToPoint:(K=new E,function(t){return K.copy(t).clamp(this.min,this.max).sub(t).length()}),getBoundingSphere:(Q=new E,function(t){return void 0===t&&console.error("BAIV3.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(Q).length(),t}),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:(J=[new E,new E,new E,new E,new E,new E,new E,new E],function(t){return this.isEmpty()||(J[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),J[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),J[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),J[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),J[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),J[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),J[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),J[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(J)),this}),translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}),Object.assign(At.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:(Z=new Lt,function(t,e){var n=this.center;void 0!==e?n.copy(e):Z.setFromPoints(t).getCenter(n);for(var r=0,i=0,o=t.length;i<o;i++)r=Math.max(r,n.distanceToSquared(t[i]));return this.radius=Math.sqrt(r),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return this.radius<=0},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,e){var n=this.center.distanceToSquared(t);return void 0===e&&(console.warn("BAIV3.Sphere: .clampPoint() target is now required"),e=new E),e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},getBoundingBox:function(t){return void 0===t&&(console.warn("BAIV3.Sphere: .getBoundingBox() target is now required"),t=new Lt),t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}}),Object.assign(Tt.prototype,{set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,n,r){return this.normal.set(t,e,n),this.constant=r,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:(q=new E,Y=new E,function(t,e,n){var r=q.subVectors(n,e).cross(Y.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(r,t),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return void 0===e&&(console.warn("BAIV3.Plane: .projectPoint() target is now required"),e=new E),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:(X=new E,function(t,e){void 0===e&&(console.warn("BAIV3.Plane: .intersectLine() target is now required"),e=new E);var n=t.delta(X),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(t.start)?e.copy(t.start):void 0;var i=-(t.start.dot(this.normal)+this.constant)/r;return i<0||1<i?void 0:e.copy(n).multiplyScalar(i).add(t.start)}),intersectsLine:function(t){var e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&0<n||n<0&&0<e},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(console.warn("BAIV3.Plane: .coplanarPoint() target is now required"),t=new E),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:(W=new E,H=new I,function(t,e){var n=e||H.getNormalMatrix(t),r=this.coplanarPoint(W).applyMatrix4(t),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}),translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}}),Object.assign(Pt.prototype,{set:function(t,e,n,r,i,o){var a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(r),a[4].copy(i),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,n=0;n<6;n++)e[n].copy(t.planes[n]);return this},setFromMatrix:function(t){var e=this.planes,n=t.elements,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],c=n[5],l=n[6],h=n[7],u=n[8],d=n[9],p=n[10],f=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return e[0].setComponents(a-r,h-s,f-u,y-m).normalize(),e[1].setComponents(a+r,h+s,f+u,y+m).normalize(),e[2].setComponents(a+i,h+c,f+d,y+g).normalize(),e[3].setComponents(a-i,h-c,f-d,y-g).normalize(),e[4].setComponents(a-o,h-l,f-p,y-v).normalize(),e[5].setComponents(a+o,h+l,f+p,y+v).normalize(),this},intersectsObject:(k=new At,function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),k.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(k)}),intersectsSprite:(j=new At,function(t){return j.center.set(0,0,0),j.radius=.7071067811865476,j.applyMatrix4(t.matrixWorld),this.intersectsSphere(j)}),intersectsSphere:function(t){for(var e=this.planes,n=t.center,r=-t.radius,i=0;i<6;i++)if(e[i].distanceToPoint(n)<r)return!1;return!0},intersectsBox:(G=new E,function(t){for(var e=this.planes,n=0;n<6;n++){var r=e[n];if(G.x=0<r.normal.x?t.max.x:t.min.x,G.y=0<r.normal.y?t.max.y:t.min.y,G.z=0<r.normal.z?t.max.z:t.min.z,r.distanceToPoint(G)<0)return!1}return!0}),containsPoint:function(t){for(var e=this.planes,n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}}),Object.assign(Ct.prototype,{isMatrix4:!0,set:function(t,e,n,r,i,o,a,s,c,l,h,u,d,p,f,m){var g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=r,g[1]=i,g[5]=o,g[9]=a,g[13]=s,g[2]=c,g[6]=l,g[10]=h,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new Ct).fromArray(this.elements)},copy:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this},copyPosition:function(t){var e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this},extractBasis:function(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this},extractRotation:(F=new E,function(t){var e=this.elements,n=t.elements,r=1/F.setFromMatrixColumn(t,0).length(),i=1/F.setFromMatrixColumn(t,1).length(),o=1/F.setFromMatrixColumn(t,2).length();return e[0]=n[0]*r,e[1]=n[1]*r,e[2]=n[2]*r,e[3]=0,e[4]=n[4]*i,e[5]=n[5]*i,e[6]=n[6]*i,e[7]=0,e[8]=n[8]*o,e[9]=n[9]*o,e[10]=n[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}),makeRotationFromEuler:function(t){throw"error: calling lost code 8"},makeRotationFromQuaternion:(z=new E(0,0,0),U=new E(1,1,1),function(t){return this.compose(z,t,U)}),lookAt:(V=new E,R=new E,N=new E,function(t,e,n){var r=this.elements;return N.subVectors(t,e),0===N.lengthSq()&&(N.z=1),N.normalize(),V.crossVectors(n,N),0===V.lengthSq()&&(1===Math.abs(n.z)?N.x+=1e-4:N.z+=1e-4,N.normalize(),V.crossVectors(n,N)),V.normalize(),R.crossVectors(N,V),r[0]=V.x,r[4]=R.x,r[8]=N.x,r[1]=V.y,r[5]=R.y,r[9]=N.y,r[2]=V.z,r[6]=R.z,r[10]=N.z,this}),multiply:function(t,e){return void 0!==e?(console.warn("BAIV3.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,r=e.elements,i=this.elements,o=n[0],a=n[4],s=n[8],c=n[12],l=n[1],h=n[5],u=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],v=n[3],y=n[7],x=n[11],w=n[15],_=r[0],M=r[4],b=r[8],S=r[12],L=r[1],A=r[5],T=r[9],P=r[13],C=r[2],E=r[6],I=r[10],D=r[14],B=r[3],O=r[7],V=r[11],R=r[15];return i[0]=o*_+a*L+s*C+c*B,i[4]=o*M+a*A+s*E+c*O,i[8]=o*b+a*T+s*I+c*V,i[12]=o*S+a*P+s*D+c*R,i[1]=l*_+h*L+u*C+d*B,i[5]=l*M+h*A+u*E+d*O,i[9]=l*b+h*T+u*I+d*V,i[13]=l*S+h*P+u*D+d*R,i[2]=p*_+f*L+m*C+g*B,i[6]=p*M+f*A+m*E+g*O,i[10]=p*b+f*T+m*I+g*V,i[14]=p*S+f*P+m*D+g*R,i[3]=v*_+y*L+x*C+w*B,i[7]=v*M+y*A+x*E+w*O,i[11]=v*b+y*T+x*I+w*V,i[15]=v*S+y*P+x*D+w*R,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},applyToBufferAttribute:(O=new E,function(t){for(var e=0,n=t.count;e<n;e++)O.x=t.getX(e),O.y=t.getY(e),O.z=t.getZ(e),O.applyMatrix4(this),t.setXYZ(e,O.x,O.y,O.z);return t}),determinant:function(){var t=this.elements,e=t[0],n=t[4],r=t[8],i=t[12],o=t[1],a=t[5],s=t[9],c=t[13],l=t[2],h=t[6],u=t[10],d=t[14];return t[3]*(i*s*h-r*c*h-i*a*u+n*c*u+r*a*d-n*s*d)+t[7]*(e*s*d-e*c*u+i*o*u-r*o*d+r*c*l-i*s*l)+t[11]*(e*c*h-e*a*d-i*o*h+n*o*d+i*a*l-n*c*l)+t[15]*(-r*a*l-e*s*h+e*a*u+r*o*h-n*o*u+n*s*l)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},setPosition:function(t,e,n){var r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=n),this},getInverse:function(t,e){var n=this.elements,r=t.elements,i=r[0],o=r[1],a=r[2],s=r[3],c=r[4],l=r[5],h=r[6],u=r[7],d=r[8],p=r[9],f=r[10],m=r[11],g=r[12],v=r[13],y=r[14],x=r[15],w=p*y*u-v*f*u+v*h*m-l*y*m-p*h*x+l*f*x,_=g*f*u-d*y*u-g*h*m+c*y*m+d*h*x-c*f*x,M=d*v*u-g*p*u+g*l*m-c*v*m-d*l*x+c*p*x,b=g*p*h-d*v*h-g*l*f+c*v*f+d*l*y-c*p*y,S=i*w+o*_+a*M+s*b;if(0==S){var L="BAIV3.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(L);return console.warn(L),this.identity()}var A=1/S;return n[0]=w*A,n[1]=(v*f*s-p*y*s-v*a*m+o*y*m+p*a*x-o*f*x)*A,n[2]=(l*y*s-v*h*s+v*a*u-o*y*u-l*a*x+o*h*x)*A,n[3]=(p*h*s-l*f*s-p*a*u+o*f*u+l*a*m-o*h*m)*A,n[4]=_*A,n[5]=(d*y*s-g*f*s+g*a*m-i*y*m-d*a*x+i*f*x)*A,n[6]=(g*h*s-c*y*s-g*a*u+i*y*u+c*a*x-i*h*x)*A,n[7]=(c*f*s-d*h*s+d*a*u-i*f*u-c*a*m+i*h*m)*A,n[8]=M*A,n[9]=(g*p*s-d*v*s-g*o*m+i*v*m+d*o*x-i*p*x)*A,n[10]=(c*v*s-g*l*s+g*o*u-i*v*u-c*o*x+i*l*x)*A,n[11]=(d*l*s-c*p*s-d*o*u+i*p*u+c*o*m-i*l*m)*A,n[12]=b*A,n[13]=(d*v*a-g*p*a+g*o*f-i*v*f-d*o*y+i*p*y)*A,n[14]=(g*l*a-c*v*a-g*o*h+i*v*h+c*o*y-i*l*y)*A,n[15]=(c*p*a-d*l*a+d*o*h-i*p*h-c*o*f+i*l*f)*A,this},scale:function(t){var e=this.elements,n=t.x,r=t.y,i=t.z;return e[0]*=n,e[4]*=r,e[8]*=i,e[1]*=n,e[5]*=r,e[9]*=i,e[2]*=n,e[6]*=r,e[10]*=i,e[3]*=n,e[7]*=r,e[11]*=i,this},getMaxScaleOnAxis:function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,r))},makeTranslation:function(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this},makeRotationX:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this},makeRotationY:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this},makeRotationZ:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){var n=Math.cos(e),r=Math.sin(e),i=1-n,o=t.x,a=t.y,s=t.z,c=i*o,l=i*a;return this.set(c*o+n,c*a-r*s,c*s+r*a,0,c*a+r*s,l*a+n,l*s-r*o,0,c*s-r*a,l*s+r*o,i*s*s+n,0,0,0,0,1),this},makeScale:function(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(t,e,n){return this.set(1,e,n,0,t,1,n,0,t,e,1,0,0,0,0,1),this},compose:function(t,e,n){var r=this.elements,i=e._x,o=e._y,a=e._z,s=e._w,c=i+i,l=o+o,h=a+a,u=i*c,d=i*l,p=i*h,f=o*l,m=o*h,g=a*h,v=s*c,y=s*l,x=s*h,w=n.x,_=n.y,M=n.z;return r[0]=(1-(f+g))*w,r[1]=(d+x)*w,r[2]=(p-y)*w,r[3]=0,r[4]=(d-x)*_,r[5]=(1-(u+g))*_,r[6]=(m+v)*_,r[7]=0,r[8]=(p+y)*M,r[9]=(m-v)*M,r[10]=(1-(u+f))*M,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this},decompose:(D=new E,B=new Ct,function(t,e,n){var r=this.elements,i=D.set(r[0],r[1],r[2]).length(),o=D.set(r[4],r[5],r[6]).length(),a=D.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),t.x=r[12],t.y=r[13],t.z=r[14],B.copy(this);var s=1/i,c=1/o,l=1/a;return B.elements[0]*=s,B.elements[1]*=s,B.elements[2]*=s,B.elements[4]*=c,B.elements[5]*=c,B.elements[6]*=c,B.elements[8]*=l,B.elements[9]*=l,B.elements[10]*=l,e.setFromRotationMatrix(B),n.x=i,n.y=o,n.z=a,this}),makePerspective:function(t,e,n,r,i,o){void 0===o&&console.warn("BAIV3.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var a=this.elements,s=2*i/(e-t),c=2*i/(n-r),l=(e+t)/(e-t),h=(n+r)/(n-r),u=-(o+i)/(o-i),d=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=l,a[12]=0,a[1]=0,a[5]=c,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=u,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makeOrthographic:function(t,e,n,r,i,o){var a=this.elements,s=1/(e-t),c=1/(n-r),l=1/(o-i),h=(e+t)*s,u=(n+r)*c,d=(o+i)*l;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-u,a[2]=0,a[6]=0,a[10]=-2*l,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},equals:function(t){for(var e=this.elements,n=t.elements,r=0;r<16;r++)if(e[r]!==n[r])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<16;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}});var Dt={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE  = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS  = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn 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\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(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 average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1  (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale =  bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV( sampler2D envMap, vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = normalMatrix * objectTangent;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn 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\treturn 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\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = min( floor( D ) / 255.0, 1.0 );\n\treturn 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\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn 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\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_pars_fragment:"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent ));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = 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\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif",lights_pars_begin:"uniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight  ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",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;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_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\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3(    0, 1,    0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#endif\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\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\tfloat clearCoatInv = 1.0 - clearCoatDHR;\n\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec3 singleScattering = vec3( 0.0 );\n\t\tvec3 multiScattering = vec3( 0.0 );\n\t\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\t\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\t\treflectedLight.indirectSpecular += clearCoatInv * radiance * singleScattering;\n\t\treflectedLight.indirectDiffuse += multiScattering * cosineWeightedIrradiance;\n\t\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n\t#else\n\t\treflectedLight.indirectSpecular += clearCoatInv * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#endif\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material )   GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material )   GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn 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 = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearCoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), maxMipLevel );\n\t#ifndef STANDARD\n\t\tclearCoatRadiance += getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, irradiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\tgl_Position.z *= gl_Position.w;\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#ifdef USE_MAP\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif",map_particle_pars_fragment:"#ifdef USE_MAP\n\tuniform mat3 uvTransform;\n\tuniform sampler2D map;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t#endif\n#endif",normal_fragment_maps:"#ifdef USE_NORMALMAP\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t#ifdef FLIP_SIDED\n\t\t\tnormal = - normal;\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\tnormal = normalize( normalMatrix * normal );\n\t#else\n\t\t#ifdef USE_TANGENT\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t\tmapN.xy = normalScale * mapN.xy;\n\t\t\tnormal = normalize( vTBN * mapN );\n\t\t#else\n\t\t\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n\t\t#endif\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tuniform mat3 normalMatrix;\n\t#else\n\t\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\t\tvec2 st0 = dFdx( vUv.st );\n\t\t\tvec2 st1 = dFdy( vUv.st );\n\t\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\t\tvec3 N = normalize( surf_norm );\n\t\t\tmat3 tsn = mat3( S, T, N );\n\t\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t\tmapN.xy *= normalScale;\n\t\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\treturn normalize( tsn * mapN );\n\t\t}\n\t#endif\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 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\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#if defined( DITHERING )\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#if defined( DITHERING )\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix  = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}",uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform 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 <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#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>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\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 <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_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\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#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\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_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 <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\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 <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_pars_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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_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\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#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\tvarying vec3 vLightBack;\n\tvarying 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 <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying 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\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_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\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\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 <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\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 <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\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphysical_frag:"#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\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 <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_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\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 <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\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\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>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvViewPosition = - mvPosition.xyz;\n#endif\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 <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_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\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#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\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <fog_fragment>\n}",shadow_vert:"#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#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 <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#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\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}"};function Bt(t){var e={};for(var n in t)for(var r in e[n]={},t[n]){var i=t[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture)?e[n][r]=i.clone():Array.isArray(i)?e[n][r]=i.slice():e[n][r]=i}return e}function Ot(t){for(var e={},n=0;n<t.length;n++){var r=Bt(t[n]);for(var i in r)e[i]=r[i]}return e}var Vt,Rt,Nt,zt={clone:Bt,merge:Ot};function Ut(t,e,n){return void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}function Ft(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}function Gt(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function jt(t,e,n){return n<0&&(n+=1),1<n&&--n,n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}Object.assign(Ut.prototype,{isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,n){return this.r=t,this.g=e,this.b=n,this},setHSL:function(t,e,n){if(t=T.euclideanModulo(t,1),e=T.clamp(e,0,1),n=T.clamp(n,0,1),0===e)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+e):n+e-n*e,i=2*n-r;this.r=jt(i,r,t+1/3),this.g=jt(i,r,t),this.b=jt(i,r,t-1/3)}return this},setStyle:function(t){throw"error: calling lost code 9"},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var n=0<e?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this},convertGammaToLinear:function(t){return this.copyGammaToLinear(this,t),this},convertLinearToGamma:function(t){return this.copyLinearToGamma(this,t),this},copySRGBToLinear:function(t){return this.r=Gt(t.r),this.g=Gt(t.g),this.b=Gt(t.b),this},copyLinearToSRGB:function(t){return this.r=Ft(t.r),this.g=Ft(t.g),this.b=Ft(t.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){throw"error: calling lost code 9"},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:(Nt={},function(t,e,n){return this.getHSL(Nt),Nt.h+=t,Nt.s+=e,Nt.l+=n,this.setHSL(Nt.h,Nt.s,Nt.l),this}),add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},sub:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},lerpHSL:(Vt={h:0,s:0,l:0},Rt={h:0,s:0,l:0},function(t,e){this.getHSL(Vt),t.getHSL(Rt);var n=T.lerp(Vt.h,Rt.h,e),r=T.lerp(Vt.s,Rt.s,e),i=T.lerp(Vt.l,Rt.l,e);return this.setHSL(n,r,i),this}),equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t},toJSON:function(){return this.getHex()}});var kt,Wt,Ht={common:{diffuse:{value:new Ut(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new I},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new P(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 Ut(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new Ut(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new I}},sprite:{diffuse:{value:new Ut(15658734)},opacity:{value:1},center:{value:new P(.5,.5)},rotation:{value:0},map:{value:null},uvTransform:{value:new I}}},Xt={basic:{uniforms:Ot([Ht.common,Ht.specularmap,Ht.envmap,Ht.aomap,Ht.lightmap,Ht.fog]),vertexShader:Dt.meshbasic_vert,fragmentShader:Dt.meshbasic_frag},lambert:{uniforms:Ot([Ht.common,Ht.specularmap,Ht.envmap,Ht.aomap,Ht.lightmap,Ht.emissivemap,Ht.fog,Ht.lights,{emissive:{value:new Ut(0)}}]),vertexShader:Dt.meshlambert_vert,fragmentShader:Dt.meshlambert_frag},phong:{uniforms:Ot([Ht.common,Ht.specularmap,Ht.envmap,Ht.aomap,Ht.lightmap,Ht.emissivemap,Ht.bumpmap,Ht.normalmap,Ht.displacementmap,Ht.gradientmap,Ht.fog,Ht.lights,{emissive:{value:new Ut(0)},specular:{value:new Ut(1118481)},shininess:{value:30}}]),vertexShader:Dt.meshphong_vert,fragmentShader:Dt.meshphong_frag},standard:{uniforms:Ot([Ht.common,Ht.envmap,Ht.aomap,Ht.lightmap,Ht.emissivemap,Ht.bumpmap,Ht.normalmap,Ht.displacementmap,Ht.roughnessmap,Ht.metalnessmap,Ht.fog,Ht.lights,{emissive:{value:new Ut(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:Dt.meshphysical_vert,fragmentShader:Dt.meshphysical_frag},matcap:{uniforms:Ot([Ht.common,Ht.bumpmap,Ht.normalmap,Ht.displacementmap,Ht.fog,{matcap:{value:null}}]),vertexShader:Dt.meshmatcap_vert,fragmentShader:Dt.meshmatcap_frag},points:{uniforms:Ot([Ht.points,Ht.fog]),vertexShader:Dt.points_vert,fragmentShader:Dt.points_frag},dashed:{uniforms:Ot([Ht.common,Ht.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Dt.linedashed_vert,fragmentShader:Dt.linedashed_frag},depth:{uniforms:Ot([Ht.common,Ht.displacementmap]),vertexShader:Dt.depth_vert,fragmentShader:Dt.depth_frag},normal:{uniforms:Ot([Ht.common,Ht.bumpmap,Ht.normalmap,Ht.displacementmap,{opacity:{value:1}}]),vertexShader:Dt.normal_vert,fragmentShader:Dt.normal_frag},sprite:{uniforms:Ot([Ht.sprite,Ht.fog]),vertexShader:Dt.sprite_vert,fragmentShader:Dt.sprite_frag},background:{uniforms:{uvTransform:{value:new I},t2D:{value:null}},vertexShader:Dt.background_vert,fragmentShader:Dt.background_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Dt.cube_vert,fragmentShader:Dt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Dt.equirect_vert,fragmentShader:Dt.equirect_frag},distanceRGBA:{uniforms:Ot([Ht.common,Ht.displacementmap,{referencePosition:{value:new E},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Dt.distanceRGBA_vert,fragmentShader:Dt.distanceRGBA_frag},shadow:{uniforms:Ot([Ht.lights,Ht.fog,{color:{value:new Ut(0)},opacity:{value:1}}]),vertexShader:Dt.shadow_vert,fragmentShader:Dt.shadow_frag}};function qt(){var t=null,e=!1,n=null;function r(i,o){!1!==e&&(n(i,o),t.requestAnimationFrame(r))}return{start:function(){!0!==e&&null!==n&&(t.requestAnimationFrame(r),e=!0)},stop:function(){e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function Yt(t){var e=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),e.get(t)},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);var r=e.get(n);r&&(t.deleteBuffer(r.buffer),e.delete(n))},update:function(n,r){n.isInterleavedBufferAttribute&&(n=n.data);var i,o,a,s,c,l=e.get(n);void 0===l?e.set(n,function(e,n){var r=e.array,i=e.dynamic?35048:35044,o=t.createBuffer();t.bindBuffer(n,o),t.bufferData(n,r,i),e.onUploadCallback();var a=5126;return r instanceof Float32Array?a=5126:r instanceof Float64Array?console.warn("BAIV3.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?a=5123:r instanceof Int16Array?a=5122:r instanceof Uint32Array?a=5125:r instanceof Int32Array?a=5124:r instanceof Int8Array?a=5120:r instanceof Uint8Array&&(a=5121),{buffer:o,type:a,bytesPerElement:r.BYTES_PER_ELEMENT,version:e.version}}(n,r)):l.version<n.version&&(i=l.buffer,a=r,s=(o=n).array,c=o.updateRange,t.bindBuffer(a,i),!1===o.dynamic?t.bufferData(a,s,35044):-1===c.count?t.bufferSubData(a,0,s):0===c.count?console.error("BAIV3.WebGLObjects.updateBuffer: dynamic BAIV3.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(t.bufferSubData(a,c.offset*s.BYTES_PER_ELEMENT,s.subarray(c.offset,c.offset+c.count)),c.count=-1),l.version=n.version)}}}function Zt(t,e,n,r){this._x=t||0,this._y=e||0,this._z=n||0,this._order=r||Zt.DefaultOrder}function Jt(){this.mask=1}Xt.physical={uniforms:Ot([Xt.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:Dt.meshphysical_vert,fragmentShader:Dt.meshphysical_frag},Zt.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],Zt.DefaultOrder="XYZ",Object.defineProperties(Zt.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback()}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback()}}}),Object.assign(Zt.prototype,{isEuler:!0,set:function(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._order=r||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this.onChangeCallback(),this},setFromRotationMatrix:function(t,e,n){var r=T.clamp,i=t.elements,o=i[0],a=i[4],s=i[8],c=i[1],l=i[5],h=i[9],u=i[2],d=i[6],p=i[10];return"XYZ"===(e=e||this._order)?(this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(d,l),this._z=0)):"YXZ"===e?(this._x=Math.asin(-r(h,-1,1)),Math.abs(h)<.99999?(this._y=Math.atan2(s,p),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-u,o),this._z=0)):"ZXY"===e?(this._x=Math.asin(r(d,-1,1)),Math.abs(d)<.99999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(c,o))):"ZYX"===e?(this._y=Math.asin(-r(u,-1,1)),Math.abs(u)<.99999?(this._x=Math.atan2(d,p),this._z=Math.atan2(c,o)):(this._x=0,this._z=Math.atan2(-a,l))):"YZX"===e?(this._z=Math.asin(r(c,-1,1)),Math.abs(c)<.99999?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-u,o)):(this._x=0,this._y=Math.atan2(s,p))):"XZY"===e?(this._z=Math.asin(-r(a,-1,1)),Math.abs(a)<.99999?(this._x=Math.atan2(d,l),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-h,p),this._y=0)):console.warn("BAIV3.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,!1!==n&&this.onChangeCallback(),this},setFromQuaternion:(Wt=new Ct,function(t,e,n){return Wt.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Wt,e,n)}),setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:(kt=new C,function(t){return kt.setFromEuler(this),this.setFromQuaternion(kt,t)}),equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new E(this._x,this._y,this._z)},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),Object.assign(Jt.prototype,{set:function(t){this.mask=1<<t|0},enable:function(t){this.mask|=1<<t|0},toggle:function(t){this.mask^=1<<t|0},disable:function(t){this.mask&=~(1<<t|0)},test:function(t){return 0!=(this.mask&t.mask)}});var Qt,Kt,$t,te,ee=0;function ne(){Object.defineProperty(this,"id",{value:ee++}),this.uuid=T.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=ne.DefaultUp.clone();var t=new E,e=new Zt,n=new C,r=new E(1,1,1);e.onChange((function(){n.setFromEuler(e,!1)})),n.onChange((function(){e.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Ct},normalMatrix:{value:new I}}),this.matrix=new Ct,this.matrixWorld=new Ct,this.matrixAutoUpdate=ne.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Jt,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}ne.DefaultUp=new E(0,1,0),ne.DefaultMatrixAutoUpdate=!0,ne.prototype=Object.assign(Object.create(e.prototype),{constructor:ne,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(t){return this.quaternion.premultiply(t),this},lookAt:(Qt=new C,Kt=new Ct,$t=new E,te=new E,function(t,e,n){t.isVector3?$t.copy(t):$t.set(t,e,n);var r=this.parent;this.updateWorldMatrix(!0,!1),te.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Kt.lookAt(te,$t,this.up):Kt.lookAt($t,te,this.up),this.quaternion.setFromRotationMatrix(Kt),r&&(Kt.extractRotation(r.matrixWorld),Qt.setFromRotationMatrix(Kt),this.quaternion.premultiply(Qt.inverse()))}),add:function(t){if(1<arguments.length){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?console.error("BAIV3.Object3D.add: object can't be added as a child of itself.",t):t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,t.dispatchEvent({type:"added"}),this.children.push(t)):console.error("BAIV3.Object3D.add: object not an instance of BAIV3.Object3D.",t),this},remove:function(t){if(1<arguments.length){for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}var n=this.children.indexOf(t);return-1!==n&&(t.parent=null,t.dispatchEvent({type:"removed"}),this.children.splice(n,1)),this},traverse:function(t){t(this);for(var e=this.children,n=0,r=e.length;n<r;n++)e[n].traverse(t)},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t=!(this.matrixWorldNeedsUpdate=!1));for(var e=this.children,n=0,r=e.length;n<r;n++)e[n].updateMatrixWorld(t)},updateWorldMatrix:function(t,e){var n=this.parent;if(!0===t&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e)for(var r=this.children,i=0,o=r.length;i<o;i++)r[i].updateWorldMatrix(!1,!0)},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var n=0;n<t.children.length;n++){var r=t.children[n];this.add(r.clone())}return this}});var re,ie,oe,ae,se=0;function ce(){Object.defineProperty(this,"id",{value:se+=2}),this.uuid=T.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}function le(t,e,n){if(Array.isArray(t))throw new TypeError("BAIV3.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===n,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function he(t,e,n){le.call(this,new Int8Array(t),e,n)}function ue(t,e,n){le.call(this,new Uint8Array(t),e,n)}function de(t,e,n){le.call(this,new Uint8ClampedArray(t),e,n)}function pe(t,e,n){le.call(this,new Int16Array(t),e,n)}function fe(t,e,n){le.call(this,new Uint16Array(t),e,n)}function me(t,e,n){le.call(this,new Int32Array(t),e,n)}function ge(t,e,n){le.call(this,new Uint32Array(t),e,n)}function ve(t,e,n){le.call(this,new Float32Array(t),e,n)}function ye(t,e,n){le.call(this,new Float64Array(t),e,n)}ce.prototype=Object.assign(Object.create(e.prototype),{constructor:ce,isGeometry:!0,applyMatrix:function(t){for(var e=(new I).getNormalMatrix(t),n=0,r=this.vertices.length;n<r;n++)this.vertices[n].applyMatrix4(t);for(n=0,r=this.faces.length;n<r;n++){var i=this.faces[n];i.normal.applyMatrix3(e).normalize();for(var o=0,a=i.vertexNormals.length;o<a;o++)i.vertexNormals[o].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},translate:(ae=new Ct,function(t,e,n){return ae.makeTranslation(t,e,n),this.applyMatrix(ae),this}),scale:(oe=new Ct,function(t,e,n){return oe.makeScale(t,e,n),this.applyMatrix(oe),this}),lookAt:(ie=new ne,function(t){ie.lookAt(t),ie.updateMatrix(),this.applyMatrix(ie.matrix)}),fromBufferGeometry:function(t){throw"error: calling lost code 10"},center:(re=new E,function(){return this.computeBoundingBox(),this.boundingBox.getCenter(re).negate(),this.translate(re.x,re.y,re.z),this}),normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=this.boundingSphere.radius,n=0===e?1:1/e,r=new Ct;return r.set(n,0,0,-n*t.x,0,n,0,-n*t.y,0,0,n,-n*t.z,0,0,0,1),this.applyMatrix(r),this},computeFaceNormals:function(){for(var t=new E,e=new E,n=0,r=this.faces.length;n<r;n++){var i=this.faces[n],o=this.vertices[i.a],a=this.vertices[i.b],s=this.vertices[i.c];t.subVectors(s,a),e.subVectors(o,a),t.cross(e),t.normalize(),i.normal.copy(t)}},computeVertexNormals:function(t){var e,n,r,i,o,a;for(void 0===t&&(t=!0),a=new Array(this.vertices.length),e=0,n=this.vertices.length;e<n;e++)a[e]=new E;if(t){var s,c,l,h=new E,u=new E;for(r=0,i=this.faces.length;r<i;r++)o=this.faces[r],s=this.vertices[o.a],c=this.vertices[o.b],l=this.vertices[o.c],h.subVectors(l,c),u.subVectors(s,c),h.cross(u),a[o.a].add(h),a[o.b].add(h),a[o.c].add(h)}else for(this.computeFaceNormals(),r=0,i=this.faces.length;r<i;r++)a[(o=this.faces[r]).a].add(o.normal),a[o.b].add(o.normal),a[o.c].add(o.normal);for(e=0,n=this.vertices.length;e<n;e++)a[e].normalize();for(r=0,i=this.faces.length;r<i;r++){var d=(o=this.faces[r]).vertexNormals;3===d.length?(d[0].copy(a[o.a]),d[1].copy(a[o.b]),d[2].copy(a[o.c])):(d[0]=a[o.a].clone(),d[1]=a[o.b].clone(),d[2]=a[o.c].clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,e,n;for(this.computeFaceNormals(),t=0,e=this.faces.length;t<e;t++){var r=(n=this.faces[t]).vertexNormals;3===r.length?(r[0].copy(n.normal),r[1].copy(n.normal),r[2].copy(n.normal)):(r[0]=n.normal.clone(),r[1]=n.normal.clone(),r[2]=n.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,n,r,i;for(n=0,r=this.faces.length;n<r;n++)for((i=this.faces[n]).__originalFaceNormal?i.__originalFaceNormal.copy(i.normal):i.__originalFaceNormal=i.normal.clone(),i.__originalVertexNormals||(i.__originalVertexNormals=[]),t=0,e=i.vertexNormals.length;t<e;t++)i.__originalVertexNormals[t]?i.__originalVertexNormals[t].copy(i.vertexNormals[t]):i.__originalVertexNormals[t]=i.vertexNormals[t].clone();var o=new ce;for(o.faces=this.faces,t=0,e=this.morphTargets.length;t<e;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];var a=this.morphNormals[t].faceNormals,s=this.morphNormals[t].vertexNormals;for(n=0,r=this.faces.length;n<r;n++)c=new E,l={a:new E,b:new E,c:new E},a.push(c),s.push(l)}var c,l,h=this.morphNormals[t];for(o.vertices=this.morphTargets[t].vertices,o.computeFaceNormals(),o.computeVertexNormals(),n=0,r=this.faces.length;n<r;n++)i=this.faces[n],c=h.faceNormals[n],l=h.vertexNormals[n],c.copy(i.normal),l.a.copy(i.vertexNormals[0]),l.b.copy(i.vertexNormals[1]),l.c.copy(i.vertexNormals[2])}for(n=0,r=this.faces.length;n<r;n++)(i=this.faces[n]).normal=i.__originalFaceNormal,i.vertexNormals=i.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Lt),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new At),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,n){throw"error: calling lost code 11"},mergeMesh:function(t){throw"error: calling lost code 12"},mergeVertices:function(){throw"error: calling lost code 13"},setFromPoints:function(t){throw"error: calling lost code 14"},sortFacesByMaterialIndex:function(){throw"error: calling lost code 15"},clone:function(){return(new ce).copy(this)},copy:function(t){throw"error: calling lost code 16"},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(le.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(le.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setArray:function(t){if(Array.isArray(t))throw new TypeError("BAIV3.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==t?t.length/this.itemSize:0,this.array=t,this},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.dynamic=t.dynamic,this},copyAt:function(t,e,n){t*=this.itemSize,n*=e.itemSize;for(var r=0,i=this.itemSize;r<i;r++)this.array[t+r]=e.array[n+r];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var o=t[r];void 0===o&&(console.warn("BAIV3.BufferAttribute.copyColorsArray(): color is undefined",r),o=new Ut),e[n++]=o.r,e[n++]=o.g,e[n++]=o.b}return this},copyVector2sArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var o=t[r];void 0===o&&(console.warn("BAIV3.BufferAttribute.copyVector2sArray(): vector is undefined",r),o=new P),e[n++]=o.x,e[n++]=o.y}return this},copyVector3sArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var o=t[r];void 0===o&&(console.warn("BAIV3.BufferAttribute.copyVector3sArray(): vector is undefined",r),o=new E),e[n++]=o.x,e[n++]=o.y,e[n++]=o.z}return this},copyVector4sArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var o=t[r];void 0===o&&(console.warn("BAIV3.BufferAttribute.copyVector4sArray(): vector is undefined",r),o=new wt),e[n++]=o.x,e[n++]=o.y,e[n++]=o.z,e[n++]=o.w}return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this},setXYZ:function(t,e,n,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this},setXYZW:function(t,e,n,r,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this.array[t+3]=i,this},onUpload:function(t){return this.onUploadCallback=t,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),(he.prototype=Object.create(le.prototype)).constructor=he,(ue.prototype=Object.create(le.prototype)).constructor=ue,(de.prototype=Object.create(le.prototype)).constructor=de,(pe.prototype=Object.create(le.prototype)).constructor=pe,(fe.prototype=Object.create(le.prototype)).constructor=fe,(me.prototype=Object.create(le.prototype)).constructor=me,(ge.prototype=Object.create(le.prototype)).constructor=ge,(ve.prototype=Object.create(le.prototype)).constructor=ve,(ye.prototype=Object.create(le.prototype)).constructor=ye;var xe,we,_e,Me,be,Se,Le,Ae,Te,Pe,Ce,Ee,Ie=1;function De(){Object.defineProperty(this,"id",{value:Ie+=2}),this.uuid=T.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}function Be(t,e,n,r){ce.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:r},this.fromBufferGeometry(new Oe(t,e,n,r)),this.mergeVertices()}function Oe(t,e,n,r){De.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:r};var i,o,a=(t=t||1)/2,s=(e=e||1)/2,c=Math.floor(n)||1,l=Math.floor(r)||1,h=c+1,u=l+1,d=t/c,p=e/l,f=[],m=[],g=[],v=[];for(o=0;o<u;o++){var y=o*p-s;for(i=0;i<h;i++){var x=i*d-a;m.push(x,-y,0),g.push(0,0,1),v.push(i/c),v.push(1-o/l)}}for(o=0;o<l;o++)for(i=0;i<c;i++){var w=i+h*o,_=i+h*(o+1),M=i+1+h*(o+1),b=i+1+h*o;f.push(w,_,b),f.push(_,M,b)}this.setIndex(f),this.addAttribute("position",new ve(m,3)),this.addAttribute("normal",new ve(g,3)),this.addAttribute("uv",new ve(v,2))}De.prototype=Object.assign(Object.create(e.prototype),{constructor:De,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(65535<function(t){if(0===t.length)return-1/0;for(var e=t[0],n=1,r=t.length;n<r;++n)t[n]>e&&(e=t[n]);return e}(t)?ge:fe)(t,1):this.index=t},addAttribute:function(t,e){return e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?("index"===t?(console.warn("BAIV3.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e)):this.attributes[t]=e,this):(console.warn("BAIV3.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.addAttribute(t,new le(e,arguments[2])))},getAttribute:function(t){return this.attributes[t]},removeAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,n){this.groups.push({start:t,count:e,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix:function(t){var e=this.attributes.position;void 0!==e&&(t.applyToBufferAttribute(e),e.needsUpdate=!0);var n=this.attributes.normal;void 0!==n&&((new I).getNormalMatrix(t).applyToBufferAttribute(n),n.needsUpdate=!0);var r=this.attributes.tangent;return void 0!==r&&((new I).getNormalMatrix(t).applyToBufferAttribute(r),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:(Ee=new Ct,function(t){return Ee.makeRotationX(t),this.applyMatrix(Ee),this}),rotateY:(Ce=new Ct,function(t){return Ce.makeRotationY(t),this.applyMatrix(Ce),this}),rotateZ:(Pe=new Ct,function(t){return Pe.makeRotationZ(t),this.applyMatrix(Pe),this}),translate:(Te=new Ct,function(t,e,n){return Te.makeTranslation(t,e,n),this.applyMatrix(Te),this}),scale:(Ae=new Ct,function(t,e,n){return Ae.makeScale(t,e,n),this.applyMatrix(Ae),this}),lookAt:(Le=new ne,function(t){Le.lookAt(t),Le.updateMatrix(),this.applyMatrix(Le.matrix)}),center:(Se=new E,function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Se).negate(),this.translate(Se.x,Se.y,Se.z),this}),setFromObject:function(t){throw"error: calling lost code 559"},setFromPoints:function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];e.push(i.x,i.y,i.z||0)}return this.addAttribute("position",new ve(e,3)),this},updateFromObject:function(t){throw"error: calling lost code 17"},fromGeometry:function(t){throw"error: calling lost code 18"},fromDirectGeometry:function(t){throw"error: calling lost code 19"},computeBoundingBox:(be=new Lt,function(){null===this.boundingBox&&(this.boundingBox=new Lt);var t=this.attributes.position,e=this.morphAttributes.position;if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(var n=0,r=e.length;n<r;n++){var i=e[n];be.setFromBufferAttribute(i),this.boundingBox.expandByPoint(be.min),this.boundingBox.expandByPoint(be.max)}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('BAIV3.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}),computeBoundingSphere:(we=new Lt,_e=new Lt,Me=new E,function(){null===this.boundingSphere&&(this.boundingSphere=new At);var t=this.attributes.position,e=this.morphAttributes.position;if(t){var n=this.boundingSphere.center;if(we.setFromBufferAttribute(t),e)for(var r=0,i=e.length;r<i;r++){var o=e[r];_e.setFromBufferAttribute(o),we.expandByPoint(_e.min),we.expandByPoint(_e.max)}we.getCenter(n);var a=0;for(r=0,i=t.count;r<i;r++)Me.fromBufferAttribute(t,r),a=Math.max(a,n.distanceToSquared(Me));if(e)for(r=0,i=e.length;r<i;r++)for(var s=0,c=(o=e[r]).count;s<c;s++)Me.fromBufferAttribute(o,s),a=Math.max(a,n.distanceToSquared(Me));this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error('BAIV3.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}),computeFaceNormals:function(){},computeVertexNormals:function(){throw"error: calling lost code 20"},merge:function(t,e){if(t&&t.isBufferGeometry){void 0===e&&(e=0,console.warn("BAIV3.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var n=this.attributes;for(var r in n)if(void 0!==t.attributes[r])for(var i=n[r].array,o=t.attributes[r],a=o.array,s=o.itemSize*e,c=Math.min(a.length,i.length-s),l=0,h=s;l<c;l++,h++)i[h]=a[l];return this}console.error("BAIV3.BufferGeometry.merge(): geometry not an instance of BAIV3.BufferGeometry.",t)},normalizeNormals:(xe=new E,function(){for(var t=this.attributes.normal,e=0,n=t.count;e<n;e++)xe.x=t.getX(e),xe.y=t.getY(e),xe.z=t.getZ(e),xe.normalize(),t.setXYZ(e,xe.x,xe.y,xe.z)}),toNonIndexed:function(){function t(t,e){for(var n=t.array,r=t.itemSize,i=new n.constructor(e.length*r),o=0,a=0,s=0,c=e.length;s<c;s++){o=e[s]*r;for(var l=0;l<r;l++)i[a++]=n[o++]}return new le(i,r)}if(null===this.index)return console.warn("BAIV3.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var e=new De,n=this.index.array,r=this.attributes;for(var i in r){var o=t(r[i],n);e.addAttribute(i,o)}var a=this.morphAttributes;for(i in a){for(var s=[],c=a[i],l=0,h=c.length;l<h;l++)o=t(c[l],n),s.push(o);e.morphAttributes[i]=s}for(var u=this.groups,d=(l=0,u.length);l<d;l++){var p=u[l];e.addGroup(p.start,p.count,p.materialIndex)}return e},clone:function(){return(new De).copy(this)},copy:function(t){throw"error: calling lost code 21"},dispose:function(){this.dispatchEvent({type:"dispose"})}}),(Be.prototype=Object.create(ce.prototype)).constructor=Be,(Oe.prototype=Object.create(De.prototype)).constructor=Oe;var Ve=0;function Re(){Object.defineProperty(this,"id",{value:Ve++}),this.uuid=T.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=1,this.side=0,this.flatShading=!1,this.vertexTangents=!1,this.vertexColors=0,this.opacity=1,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.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.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.userData={},this.needsUpdate=!0}Re.prototype=Object.assign(Object.create(e.prototype),{constructor:Re,isMaterial:!0,onBeforeCompile:function(){},setValues:function(t){if(void 0!==t)for(var e in t){var n=t[e];if(void 0!==n)if("shading"!==e){var r=this[e];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[e]=n:console.warn("BAIV3."+this.type+": '"+e+"' is not a property of this material.")}else console.warn("BAIV3."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;else console.warn("BAIV3.Material: '"+e+"' parameter is undefined.")}},toJSON:function(t){throw"error: calling lost code 22"},clone:function(){return(new this.constructor).copy(this)},copy:function(t){throw"error: calling lost code 23"},dispose:function(){this.dispatchEvent({type:"dispose"})}});var Ne,ze,Ue,Fe,Ge,je,ke,We,He,Xe,qe,Ye,Ze,Je,Qe,Ke,$e,tn,en,nn,rn,on,an,sn,cn,ln,hn;function un(t){Re.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_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.skinning=!1,this.morphTargets=!1,this.morphNormals=!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,void 0!==t&&(void 0!==t.attributes&&console.error("BAIV3.ShaderMaterial: attributes should now be defined in BAIV3.BufferGeometry instead."),this.setValues(t))}function dn(t,e){this.origin=void 0!==t?t:new E,this.direction=void 0!==e?e:new E}function pn(t,e,n){this.a=void 0!==t?t:new E,this.b=void 0!==e?e:new E,this.c=void 0!==n?n:new E}function fn(t){Re.call(this),this.type="MeshBasicMaterial",this.color=new Ut(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.lights=!1,this.setValues(t)}function mn(t,e){ne.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new De,this.material=void 0!==e?e:new fn({color:16777215*Math.random()}),this.drawMode=0,this.updateMorphTargets()}function gn(t,e,n,r){var i,o,a=new Ut(0),s=0,c=null,l=0;function h(t,n){e.buffers.color.setClear(t.r,t.g,t.b,n,r)}return{getClearColor:function(){return a},setClearColor:function(t,e){a.set(t),h(a,s=void 0!==e?e:1)},getClearAlpha:function(){return s},setClearAlpha:function(t){h(a,s=t)},render:function(e,r,u,d){var p=r.background,f=t.vr,m=f.getSession&&f.getSession();if(m&&"additive"===m.environmentBlendMode&&(p=null),null===p?(h(a,s),c=null,l=0):p&&p.isColor&&(h(p,1),d=!0,c=null,l=0),(t.autoClear||d)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),p&&(p.isCubeTexture||p.isWebGLRenderTargetCube)){void 0===o&&((o=new mn(new BoxBufferGeometry(1,1,1),new un({type:"BackgroundCubeMaterial",uniforms:Bt(Xt.cube.uniforms),vertexShader:Xt.cube.vertexShader,fragmentShader:Xt.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.removeAttribute("normal"),o.geometry.removeAttribute("uv"),o.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.tCube.value}}),n.update(o));var g=p.isWebGLRenderTargetCube?p.texture:p;o.material.uniforms.tCube.value=g,o.material.uniforms.tFlip.value=p.isWebGLRenderTargetCube?1:-1,c===p&&l===g.version||(o.material.needsUpdate=!0,c=p,l=g.version),e.unshift(o,o.geometry,o.material,0,0,null)}else p&&p.isTexture&&(void 0===i&&((i=new mn(new Oe(2,2),new un({type:"BackgroundMaterial",uniforms:Bt(Xt.background.uniforms),vertexShader:Xt.background.vertexShader,fragmentShader:Xt.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.removeAttribute("normal"),Object.defineProperty(i.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(i)),!0===(i.material.uniforms.t2D.value=p).matrixAutoUpdate&&p.updateMatrix(),i.material.uniforms.uvTransform.value.copy(p.matrix),c===p&&l===p.version||(i.material.needsUpdate=!0,l=(c=p).version),e.unshift(i,i.geometry,i.material,0,0,null))}}}function vn(t,e,n,r){var i;this.setMode=function(t){i=t},this.render=function(e,r){t.drawArrays(i,e,r),n.update(r,i)},this.renderInstances=function(o,a,s){var c;if(r.isWebGL2)c=t;else if(null===(c=e.get("ANGLE_instanced_arrays")))return void console.error("BAIV3.WebGLBufferRenderer: using BAIV3.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[r.isWebGL2?"drawArraysInstanced":"drawArraysInstancedANGLE"](i,a,s,o.maxInstancedCount),n.update(s,i,o.maxInstancedCount)}}function yn(t,e,n){var r;function i(e){if("highp"===e){if(0<t.getShaderPrecisionFormat(35633,36338).precision&&0<t.getShaderPrecisionFormat(35632,36338).precision)return"highp";e="mediump"}return"mediump"===e&&0<t.getShaderPrecisionFormat(35633,36337).precision&&0<t.getShaderPrecisionFormat(35632,36337).precision?"mediump":"lowp"}var o="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext,a=void 0!==n.precision?n.precision:"highp",s=i(a);s!==a&&(console.warn("BAIV3.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);var c=!0===n.logarithmicDepthBuffer,l=t.getParameter(34930),h=t.getParameter(35660),u=t.getParameter(3379),d=t.getParameter(34076),p=t.getParameter(34921),f=t.getParameter(36347),m=t.getParameter(36348),g=t.getParameter(36349),v=0<h,y=o||!!e.get("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){if(void 0!==r)return r;var n=e.get("EXT_texture_filter_anisotropic");return r=null!==n?t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:a,logarithmicDepthBuffer:c,maxTextures:l,maxVertexTextures:h,maxTextureSize:u,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:o?t.getParameter(36183):0}}function xn(){var t=this,e=null,n=0,r=!1,i=!1,o=new Tt,a=new I,s={value:null,needsUpdate:!1};function c(){s.value!==e&&(s.value=e,s.needsUpdate=0<n),t.numPlanes=n,t.numIntersection=0}function l(e,n,r,i){var c=null!==e?e.length:0,l=null;if(0!==c){if(l=s.value,!0!==i||null===l){var h=r+4*c,u=n.matrixWorldInverse;a.getNormalMatrix(u),(null===l||l.length<h)&&(l=new Float32Array(h));for(var d=0,p=r;d!==c;++d,p+=4)o.copy(e[d]).applyMatrix4(u,a),o.normal.toArray(l,p),l[p+3]=o.constant}s.value=l,s.needsUpdate=!0}return t.numPlanes=c,l}this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(t,i,o){var a=0!==t.length||i||0!==n||r;return r=i,e=l(t,o,0),n=t.length,a},this.beginShadows=function(){i=!0,l(null)},this.endShadows=function(){i=!1,c()},this.setState=function(t,o,a,h,u,d){if(!r||null===t||0===t.length||i&&!a)i?l(null):c();else{var p=i?0:n,f=4*p,m=u.clippingState||null;s.value=m,m=l(t,h,f,d);for(var g=0;g!==f;++g)m[g]=e[g];u.clippingState=m,this.numIntersection=o?this.numPlanes:0,this.numPlanes+=p}}}function wn(t){var e={};return{get:function(n){if(void 0!==e[n])return e[n];var r;switch(n){case"WEBGL_depth_texture":r=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=t.getExtension(n)}return null===r&&console.warn("BAIV3.WebGLRenderer: "+n+" extension not supported."),e[n]=r}}}function _n(t,e,n){var r={},i={};function o(t){var a=t.target,s=r[a.id];for(var c in null!==s.index&&e.remove(s.index),s.attributes)e.remove(s.attributes[c]);a.removeEventListener("dispose",o),delete r[a.id];var l=i[s.id];l&&(e.remove(l),delete i[s.id]),n.memory.geometries--}return{get:function(t,e){var i=r[e.id];return i||(e.addEventListener("dispose",o),e.isBufferGeometry?i=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new De).setFromObject(t)),i=e._bufferGeometry),r[e.id]=i,n.memory.geometries++,i)},update:function(t){var n=t.index,r=t.attributes;for(var i in null!==n&&e.update(n,34963),r)e.update(r[i],34962);var o=t.morphAttributes;for(var i in o)for(var a=o[i],s=0,c=a.length;s<c;s++)e.update(a[s],34962)},getWireframeAttribute:function(t){throw"error: calling lost code 27"}}}function Mn(t,e,n,r){var i,o,a;this.setMode=function(t){i=t},this.setIndex=function(t){o=t.type,a=t.bytesPerElement},this.render=function(e,r){t.drawElements(i,r,o,e*a),n.update(r,i)},this.renderInstances=function(s,c,l){var h;if(r.isWebGL2)h=t;else if(null===(h=e.get("ANGLE_instanced_arrays")))return void console.error("BAIV3.WebGLIndexedBufferRenderer: using BAIV3.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[r.isWebGL2?"drawElementsInstanced":"drawElementsInstancedANGLE"](i,l,o,c*a,s.maxInstancedCount),n.update(l,i,s.maxInstancedCount)}}function bn(t){var e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.frame++,e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(t,n,r){switch(r=r||1,e.calls++,n){case 4:e.triangles+=r*(t/3);break;case 5:case 6:e.triangles+=r*(t-2);break;case 1:e.lines+=r*(t/2);break;case 3:e.lines+=r*(t-1);break;case 2:e.lines+=r*t;break;case 0:e.points+=r*t;break;default:console.error("BAIV3.WebGLInfo: Unknown draw mode:",n)}}}}function Sn(t){return new Float32Array(8),{update:function(t,e,n,r){throw"error: calling lost code 28"}}}function Ln(t,e){var n={};return{update:function(r){var i=e.render.frame,o=r.geometry,a=t.get(r,o);return n[a.id]!==i&&(o.isGeometry&&a.updateFromObject(r),t.update(a),n[a.id]=i),a},dispose:function(){n={}}}}function An(t,e,n,r,i,o,a,s,c,l){xt.call(this,t=void 0!==t?t:[],e=void 0!==e?e:301,n,r,i,o,a=void 0!==a?a:b,s,c,l),this.flipY=!1}function Tn(t,e,n,r){xt.call(this,null),this.image={data:t,width:e,height:n,depth:r},this.magFilter=d,this.minFilter=d,this.wrapR=h,this.generateMipmaps=!1,this.flipY=!1}function Pn(t,e,n,r){xt.call(this,null),this.image={data:t,width:e,height:n,depth:r},this.magFilter=d,this.minFilter=d,this.wrapR=h,this.generateMipmaps=!1,this.flipY=!1}((un.prototype=Object.create(Re.prototype)).constructor=un).prototype.isShaderMaterial=!0,un.prototype.copy=function(t){return Re.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Bt(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=t.extensions,this},un.prototype.toJSON=function(t){var e=Re.prototype.toJSON.call(this,t);for(var n in e.uniforms={},this.uniforms){var r=this.uniforms[n].value;r&&r.isTexture?e.uniforms[n]={type:"t",value:r.toJSON(t).uuid}:r&&r.isColor?e.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?e.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?e.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?e.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?e.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?e.uniforms[n]={type:"m4",value:r.toArray()}:e.uniforms[n]={value:r}}0<Object.keys(this.defines).length&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;var i={};for(var o in this.extensions)!0===this.extensions[o]&&(i[o]=!0);return 0<Object.keys(i).length&&(e.extensions=i),e},Object.assign(dn.prototype,{set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){return void 0===e&&(console.warn("BAIV3.Ray: .at() target is now required"),e=new E),e.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:(hn=new E,function(t){return this.origin.copy(this.at(t,hn)),this}),closestPointToPoint:function(t,e){void 0===e&&(console.warn("BAIV3.Ray: .closestPointToPoint() target is now required"),e=new E),e.subVectors(t,this.origin);var n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:(ln=new E,function(t){var e=ln.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(ln.copy(this.direction).multiplyScalar(e).add(this.origin),ln.distanceToSquared(t))}),distanceSqToSegment:(an=new E,sn=new E,cn=new E,function(t,e,n,r){an.copy(t).add(e).multiplyScalar(.5),sn.copy(e).sub(t).normalize(),cn.copy(this.origin).sub(an);var i,o,a,s,c=.5*t.distanceTo(e),l=-this.direction.dot(sn),h=cn.dot(this.direction),u=-cn.dot(sn),d=cn.lengthSq(),p=Math.abs(1-l*l);if(0<p)if(o=l*h-u,s=c*p,0<=(i=l*u-h))if(-s<=o)if(o<=s){var f=1/p;a=(i*=f)*(i+l*(o*=f)+2*h)+o*(l*i+o+2*u)+d}else o=c,a=-(i=Math.max(0,-(l*o+h)))*i+o*(o+2*u)+d;else o=-c,a=-(i=Math.max(0,-(l*o+h)))*i+o*(o+2*u)+d;else a=o<=-s?-(i=Math.max(0,-(-l*c+h)))*i+(o=0<i?-c:Math.min(Math.max(-c,-u),c))*(o+2*u)+d:o<=s?(i=0,(o=Math.min(Math.max(-c,-u),c))*(o+2*u)+d):-(i=Math.max(0,-(l*c+h)))*i+(o=0<i?c:Math.min(Math.max(-c,-u),c))*(o+2*u)+d;else o=0<l?-c:c,a=-(i=Math.max(0,-(l*o+h)))*i+o*(o+2*u)+d;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(sn).multiplyScalar(o).add(an),a}),intersectSphere:(on=new E,function(t,e){on.subVectors(t.center,this.origin);var n=on.dot(this.direction),r=on.dot(on)-n*n,i=t.radius*t.radius;if(i<r)return null;var o=Math.sqrt(i-r),a=n-o,s=n+o;return a<0&&s<0?null:a<0?this.at(s,e):this.at(a,e)}),intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(t.normal)+t.constant)/e;return 0<=n?n:null},intersectPlane:function(t,e){var n=this.distanceToPlane(t);return null===n?null:this.at(n,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0},intersectBox:function(t,e){var n,r,i,o,a,s,c=1/this.direction.x,l=1/this.direction.y,h=1/this.direction.z,u=this.origin;return r=0<=c?(n=(t.min.x-u.x)*c,(t.max.x-u.x)*c):(n=(t.max.x-u.x)*c,(t.min.x-u.x)*c),(o=0<=l?(i=(t.min.y-u.y)*l,(t.max.y-u.y)*l):(i=(t.max.y-u.y)*l,(t.min.y-u.y)*l))<n||r<i?null:((n<i||n!=n)&&(n=i),(o<r||r!=r)&&(r=o),(s=0<=h?(a=(t.min.z-u.z)*h,(t.max.z-u.z)*h):(a=(t.max.z-u.z)*h,(t.min.z-u.z)*h))<n||r<a?null:((n<a||n!=n)&&(n=a),(s<r||r!=r)&&(r=s),r<0?null:this.at(0<=n?n:r,e)))},intersectsBox:(rn=new E,function(t){return null!==this.intersectBox(t,rn)}),intersectTriangle:($e=new E,tn=new E,en=new E,nn=new E,function(t,e,n,r,i){tn.subVectors(e,t),en.subVectors(n,t),nn.crossVectors(tn,en);var o,a=this.direction.dot(nn);if(0<a){if(r)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}$e.subVectors(this.origin,t);var s=o*this.direction.dot(en.crossVectors($e,en));if(s<0)return null;var c=o*this.direction.dot(tn.cross($e));if(c<0)return null;if(a<s+c)return null;var l=-o*$e.dot(nn);return l<0?null:this.at(l/a,i)}),applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}}),Object.assign(pn,{getNormal:(Ke=new E,function(t,e,n,r){void 0===r&&(console.warn("BAIV3.Triangle: .getNormal() target is now required"),r=new E),r.subVectors(n,e),Ke.subVectors(t,e),r.cross(Ke);var i=r.lengthSq();return 0<i?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}),getBarycoord:(Ze=new E,Je=new E,Qe=new E,function(t,e,n,r,i){Ze.subVectors(r,e),Je.subVectors(n,e),Qe.subVectors(t,e);var o=Ze.dot(Ze),a=Ze.dot(Je),s=Ze.dot(Qe),c=Je.dot(Je),l=Je.dot(Qe),h=o*c-a*a;if(void 0===i&&(console.warn("BAIV3.Triangle: .getBarycoord() target is now required"),i=new E),0==h)return i.set(-2,-1,-1);var u=1/h,d=(c*s-a*l)*u,p=(o*l-a*s)*u;return i.set(1-d-p,p,d)}),containsPoint:(Ye=new E,function(t,e,n,r){return pn.getBarycoord(t,e,n,r,Ye),0<=Ye.x&&0<=Ye.y&&Ye.x+Ye.y<=1}),getUV:(qe=new E,function(t,e,n,r,i,o,a,s){return this.getBarycoord(t,e,n,r,qe),s.set(0,0),s.addScaledVector(i,qe.x),s.addScaledVector(o,qe.y),s.addScaledVector(a,qe.z),s}),isFrontFacing:(He=new E,Xe=new E,function(t,e,n,r){return He.subVectors(n,e),Xe.subVectors(t,e),He.cross(Xe).dot(r)<0})}),Object.assign(pn.prototype,{set:function(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this},setFromPointsAndIndices:function(t,e,n,r){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[r]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},getArea:(ke=new E,We=new E,function(){return ke.subVectors(this.c,this.b),We.subVectors(this.a,this.b),.5*ke.cross(We).length()}),getMidpoint:function(t){return void 0===t&&(console.warn("BAIV3.Triangle: .getMidpoint() target is now required"),t=new E),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return pn.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(console.warn("BAIV3.Triangle: .getPlane() target is now required"),t=new E),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,e){return pn.getBarycoord(t,this.a,this.b,this.c,e)},getUV:function(t,e,n,r,i){return pn.getUV(t,this.a,this.b,this.c,e,n,r,i)},containsPoint:function(t){return pn.containsPoint(t,this.a,this.b,this.c)},isFrontFacing:function(t){return pn.isFrontFacing(this.a,this.b,this.c,t)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:(Ne=new E,ze=new E,Ue=new E,Fe=new E,Ge=new E,je=new E,function(t,e){void 0===e&&(console.warn("BAIV3.Triangle: .closestPointToPoint() target is now required"),e=new E);var n,r,i=this.a,o=this.b,a=this.c;Ne.subVectors(o,i),ze.subVectors(a,i),Fe.subVectors(t,i);var s=Ne.dot(Fe),c=ze.dot(Fe);if(s<=0&&c<=0)return e.copy(i);Ge.subVectors(t,o);var l=Ne.dot(Ge),h=ze.dot(Ge);if(0<=l&&h<=l)return e.copy(o);var u=s*h-l*c;if(u<=0&&0<=s&&l<=0)return n=s/(s-l),e.copy(i).addScaledVector(Ne,n);je.subVectors(t,a);var d=Ne.dot(je),p=ze.dot(je);if(0<=p&&d<=p)return e.copy(a);var f=d*c-s*p;if(f<=0&&0<=c&&p<=0)return r=c/(c-p),e.copy(i).addScaledVector(ze,r);var m=l*p-d*h;if(m<=0&&0<=h-l&&0<=d-p)return Ue.subVectors(a,o),r=(h-l)/(h-l+(d-p)),e.copy(o).addScaledVector(Ue,r);var g=1/(m+f+u);return n=f*g,r=u*g,e.copy(i).addScaledVector(Ne,n).addScaledVector(ze,r)}),equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}),((fn.prototype=Object.create(Re.prototype)).constructor=fn).prototype.isMeshBasicMaterial=!0,fn.prototype.copy=function(t){return Re.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this},mn.prototype=Object.assign(Object.create(ne.prototype),{constructor:mn,isMesh:!0,setDrawMode:function(t){this.drawMode=t},copy:function(t){return ne.prototype.copy.call(this,t),this.drawMode=t.drawMode,void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this},updateMorphTargets:function(){var t,e,n,r=this.geometry;if(r.isBufferGeometry){var i=r.morphAttributes,o=Object.keys(i);if(0<o.length){var a=i[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=a.length;t<e;t++)n=a[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}else{var s=r.morphTargets;void 0!==s&&0<s.length&&console.error("BAIV3.Mesh.updateMorphTargets() no longer supports BAIV3.Geometry. Use BAIV3.BufferGeometry instead.")}},raycast:(new Ct,new dn,new At,new E,new E,new E,new E,new E,new E,new E,new E,new E,new P,new P,new P,new E,new E,function(){throw"error: calling lost code 26"}),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),((An.prototype=Object.create(xt.prototype)).constructor=An).prototype.isCubeTexture=!0,Object.defineProperty(An.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}}),((Tn.prototype=Object.create(xt.prototype)).constructor=Tn).prototype.isDataTexture2DArray=!0,((Pn.prototype=Object.create(xt.prototype)).constructor=Pn).prototype.isDataTexture3D=!0;var Cn=new xt,En=new Tn,In=new Pn,Dn=new An,Bn=[],On=new Float32Array(16),Vn=new Float32Array(9),Rn=new Float32Array(4);function Nn(){throw"error: calling lost code 29"}function zn(t,e){if(t.length===e.length){for(var n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return;return 1}}function Un(t,e){for(var n=0,r=e.length;n<r;n++)t[n]=e[n]}function Fn(t,e){var n=Bn[e];void 0===n&&(n=new Int32Array(e),Bn[e]=n);for(var r=0;r!==e;++r)n[r]=t.allocateTextureUnit();return n}function Gn(t,e){var n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function jn(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(zn(n,e))return;t.uniform2fv(this.addr,e),Un(n,e)}}function kn(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(void 0!==e.r)n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(zn(n,e))return;t.uniform3fv(this.addr,e),Un(n,e)}}function Wn(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(zn(n,e))return;t.uniform4fv(this.addr,e),Un(n,e)}}function Hn(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(zn(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),Un(n,e)}else{if(zn(n,r))return;Rn.set(r),t.uniformMatrix2fv(this.addr,!1,Rn),Un(n,r)}}function Xn(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(zn(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),Un(n,e)}else{if(zn(n,r))return;Vn.set(r),t.uniformMatrix3fv(this.addr,!1,Vn),Un(n,r)}}function qn(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(zn(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),Un(n,e)}else{if(zn(n,r))return;On.set(r),t.uniformMatrix4fv(this.addr,!1,On),Un(n,r)}}function Yn(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.safeSetTexture2D(e||Cn,i)}function Zn(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(e||En,i)}function Jn(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(e||In,i)}function Qn(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.safeSetTextureCube(e||Dn,i)}function Kn(t,e){var n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function $n(t,e){var n=this.cache;zn(n,e)||(t.uniform2iv(this.addr,e),Un(n,e))}function tr(t,e){var n=this.cache;zn(n,e)||(t.uniform3iv(this.addr,e),Un(n,e))}function er(t,e){var n=this.cache;zn(n,e)||(t.uniform4iv(this.addr,e),Un(n,e))}function nr(t,e){t.uniform1fv(this.addr,e)}function rr(t,e){t.uniform1iv(this.addr,e)}function ir(t,e){t.uniform2iv(this.addr,e)}function or(t,e){t.uniform3iv(this.addr,e)}function ar(t,e){t.uniform4iv(this.addr,e)}function sr(t,e){var n=Nn(this.size);t.uniform2fv(this.addr,n)}function cr(t,e){var n=Nn(this.size);t.uniform3fv(this.addr,n)}function lr(t,e){var n=Nn(this.size);t.uniform4fv(this.addr,n)}function hr(t,e){var n=Nn(this.size);t.uniformMatrix2fv(this.addr,!1,n)}function ur(t,e){var n=Nn(this.size);t.uniformMatrix3fv(this.addr,!1,n)}function dr(t,e){var n=Nn(this.size);t.uniformMatrix4fv(this.addr,!1,n)}function pr(t,e,n){var r=e.length,i=Fn(n,r);t.uniform1iv(this.addr,i);for(var o=0;o!==r;++o)n.safeSetTexture2D(e[o]||Cn,i[o])}function fr(t,e,n){var r=e.length,i=Fn(n,r);t.uniform1iv(this.addr,i);for(var o=0;o!==r;++o)n.safeSetTextureCube(e[o]||Dn,i[o])}function mr(t,e,n){this.id=t,this.addr=n,this.cache=[],this.setValue=function(t){switch(t){case 5126:return Gn;case 35664:return jn;case 35665:return kn;case 35666:return Wn;case 35674:return Hn;case 35675:return Xn;case 35676:return qn;case 35678:case 36198:return Yn;case 35679:return Jn;case 35680:return Qn;case 36289:return Zn;case 5124:case 35670:return Kn;case 35667:case 35671:return $n;case 35668:case 35672:return tr;case 35669:case 35673:return er}}(e.type)}function gr(t,e,n){this.id=t,this.addr=n,this.cache=[],this.size=e.size,this.setValue=function(t){switch(t){case 5126:return nr;case 35664:return sr;case 35665:return cr;case 35666:return lr;case 35674:return hr;case 35675:return ur;case 35676:return dr;case 35678:return pr;case 35680:return fr;case 5124:case 35670:return rr;case 35667:case 35671:return ir;case 35668:case 35672:return or;case 35669:case 35673:return ar}}(e.type)}function vr(t){this.id=t,this.seq=[],this.map={}}gr.prototype.updateCache=function(t){var e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),Un(e,t)},vr.prototype.setValue=function(t,e,n){for(var r=this.seq,i=0,o=r.length;i!==o;++i){var a=r[i];a.setValue(t,e[a.id],n)}};var yr=/([\w\d_]+)(\])?(\[|\.)?/g;function xr(t,e){t.seq.push(e),t.map[e.id]=e}function wr(t,e,n){var r=t.name,i=r.length;for(yr.lastIndex=0;;){var o=yr.exec(r),a=yr.lastIndex,s=o[1],c="]"===o[2],l=o[3];if(c&&(s|=0),void 0===l||"["===l&&a+2===i){xr(n,new(void 0===l?mr:gr)(s,t,e));break}var h=n.map[s];void 0===h&&xr(n,h=new vr(s)),n=h}}function _r(t,e){this.seq=[],this.map={};for(var n=t.getProgramParameter(e,35718),r=0;r<n;++r){var i=t.getActiveUniform(e,r);wr(i,t.getUniformLocation(e,i.name),this)}}function Mr(t,e,n,r){var i=t.createShader(e);return t.shaderSource(i,n),t.compileShader(i),!0===r&&(!1===t.getShaderParameter(i,35713)&&console.error("BAIV3.WebGLShader: Shader couldn't compile."),""!==t.getShaderInfoLog(i)&&console.warn("BAIV3.WebGLShader: gl.getShaderInfoLog()",35633===e?"vertex":"fragment",t.getShaderInfoLog(i),function(t){for(var e=t.split("\n"),n=0;n<e.length;n++)e[n]=n+1+": "+e[n];return e.join("\n")}(n))),i}_r.prototype.setValue=function(t,e,n,r){var i=this.map[e];void 0!==i&&i.setValue(t,n,r)},_r.prototype.setOptional=function(t,e,n){var r=e[n];void 0!==r&&this.setValue(t,n,r)},_r.upload=function(t,e,n,r){for(var i=0,o=e.length;i!==o;++i){var a=e[i],s=n[a.id];!1!==s.needsUpdate&&a.setValue(t,s.value,r)}},_r.seqWithValue=function(t,e){for(var n=[],r=0,i=t.length;r!==i;++r){var o=t[r];o.id in e&&n.push(o)}return n};var br=0;function Sr(t){switch(t){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 ) )"];default:throw new Error("unsupported encoding: "+t)}}function Lr(t,e){var n=Sr(e);return"vec4 "+t+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function Ar(t){return""!==t}function Tr(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights)}function Pr(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}function Cr(t){return t.replace(/^[ \t]*#include +<([\w\d./]+)>/gm,(function(t,e){var n=Dt[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return Cr(n)}))}function Er(t){return t.replace(/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,(function(t,e,n,r){for(var i="",o=parseInt(e);o<parseInt(n);o++)i+=r.replace(/\[ i \]/g,"[ "+o+" ]");return i}))}function Ir(t,e,n,r,i,o,a,s){var c=t.context,l=r.defines,h=i.vertexShader,u=i.fragmentShader,d="SHADOWMAP_TYPE_BASIC";1===o.shadowMapType?d="SHADOWMAP_TYPE_PCF":2===o.shadowMapType&&(d="SHADOWMAP_TYPE_PCF_SOFT");var p="ENVMAP_TYPE_CUBE",f="ENVMAP_MODE_REFLECTION",m="ENVMAP_BLENDING_MULTIPLY";if(o.envMap){switch(r.envMap.mapping){case 301:case 302:p="ENVMAP_TYPE_CUBE";break;case 306:case 307:p="ENVMAP_TYPE_CUBE_UV";break;case 303:case 304:p="ENVMAP_TYPE_EQUIREC";break;case 305:p="ENVMAP_TYPE_SPHERE"}switch(r.envMap.mapping){case 302:case 304:f="ENVMAP_MODE_REFRACTION"}switch(r.combine){case 0:m="ENVMAP_BLENDING_MULTIPLY";break;case 1:m="ENVMAP_BLENDING_MIX";break;case 2:m="ENVMAP_BLENDING_ADD"}}var g,v,y,x,w,_,M,b=0<t.gammaFactor?t.gammaFactor:1,S=a.isWebGL2?"":(v=o,y=e,[(g=(g=r.extensions)||{}).derivatives||v.envMapCubeUV||v.bumpMap||v.normalMap&&!v.objectSpaceNormalMap||v.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(g.fragDepth||v.logarithmicDepthBuffer)&&y.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",g.drawBuffers&&y.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(g.shaderTextureLOD||v.envMap)&&y.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Ar).join("\n")),L=function(t){var e=[];for(var n in t){var r=t[n];!1!==r&&e.push("#define "+n+" "+r)}return e.join("\n")}(l),A=c.createProgram();if(r.isRawShaderMaterial?(0<(x=[L].filter(Ar).join("\n")).length&&(x+="\n"),0<(w=[S,L].filter(Ar).join("\n")).length&&(w+="\n")):(x=["precision "+o.precision+" float;","precision "+o.precision+" int;","#define SHADER_NAME "+i.name,L,o.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+b,"#define MAX_BONES "+o.maxBones,o.useFog&&o.fog?"#define USE_FOG":"",o.useFog&&o.fogExp?"#define FOG_EXP2":"",o.map?"#define USE_MAP":"",o.envMap?"#define USE_ENVMAP":"",o.envMap?"#define "+f:"",o.lightMap?"#define USE_LIGHTMAP":"",o.aoMap?"#define USE_AOMAP":"",o.emissiveMap?"#define USE_EMISSIVEMAP":"",o.bumpMap?"#define USE_BUMPMAP":"",o.normalMap?"#define USE_NORMALMAP":"",o.normalMap&&o.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",o.displacementMap&&o.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",o.specularMap?"#define USE_SPECULARMAP":"",o.roughnessMap?"#define USE_ROUGHNESSMAP":"",o.metalnessMap?"#define USE_METALNESSMAP":"",o.alphaMap?"#define USE_ALPHAMAP":"",o.vertexTangents?"#define USE_TANGENT":"",o.vertexColors?"#define USE_COLOR":"",o.flatShading?"#define FLAT_SHADED":"",o.skinning?"#define USE_SKINNING":"",o.useVertexTexture?"#define BONE_TEXTURE":"",o.morphTargets?"#define USE_MORPHTARGETS":"",o.morphNormals&&!1===o.flatShading?"#define USE_MORPHNORMALS":"",o.doubleSided?"#define DOUBLE_SIDED":"",o.flipSided?"#define FLIP_SIDED":"",o.shadowMapEnabled?"#define USE_SHADOWMAP":"",o.shadowMapEnabled?"#define "+d:"",o.sizeAttenuation?"#define USE_SIZEATTENUATION":"",o.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",o.logarithmicDepthBuffer&&(a.isWebGL2||e.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Ar).join("\n"),w=[S,"precision "+o.precision+" float;","precision "+o.precision+" int;","#define SHADER_NAME "+i.name,L,o.alphaTest?"#define ALPHATEST "+o.alphaTest+(o.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+b,o.useFog&&o.fog?"#define USE_FOG":"",o.useFog&&o.fogExp?"#define FOG_EXP2":"",o.map?"#define USE_MAP":"",o.matcap?"#define USE_MATCAP":"",o.envMap?"#define USE_ENVMAP":"",o.envMap?"#define "+p:"",o.envMap?"#define "+f:"",o.envMap?"#define "+m:"",o.lightMap?"#define USE_LIGHTMAP":"",o.aoMap?"#define USE_AOMAP":"",o.emissiveMap?"#define USE_EMISSIVEMAP":"",o.bumpMap?"#define USE_BUMPMAP":"",o.normalMap?"#define USE_NORMALMAP":"",o.normalMap&&o.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",o.specularMap?"#define USE_SPECULARMAP":"",o.roughnessMap?"#define USE_ROUGHNESSMAP":"",o.metalnessMap?"#define USE_METALNESSMAP":"",o.alphaMap?"#define USE_ALPHAMAP":"",o.vertexTangents?"#define USE_TANGENT":"",o.vertexColors?"#define USE_COLOR":"",o.gradientMap?"#define USE_GRADIENTMAP":"",o.flatShading?"#define FLAT_SHADED":"",o.doubleSided?"#define DOUBLE_SIDED":"",o.flipSided?"#define FLIP_SIDED":"",o.shadowMapEnabled?"#define USE_SHADOWMAP":"",o.shadowMapEnabled?"#define "+d:"",o.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",o.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",o.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",o.logarithmicDepthBuffer&&(a.isWebGL2||e.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"",o.envMap&&(a.isWebGL2||e.get("EXT_shader_texture_lod"))?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",0!==o.toneMapping?"#define TONE_MAPPING":"",0!==o.toneMapping?Dt.tonemapping_pars_fragment:"",0!==o.toneMapping?function(t,e){var n;switch(e){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="Uncharted2";break;case 4:n="OptimizedCineon";break;case 5:n="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+e)}return"vec3 toneMapping( vec3 color ) { return "+n+"ToneMapping( color ); }"}(0,o.toneMapping):"",o.dithering?"#define DITHERING":"",o.outputEncoding||o.mapEncoding||o.matcapEncoding||o.envMapEncoding||o.emissiveMapEncoding?Dt.encodings_pars_fragment:"",o.mapEncoding?Lr("mapTexelToLinear",o.mapEncoding):"",o.matcapEncoding?Lr("matcapTexelToLinear",o.matcapEncoding):"",o.envMapEncoding?Lr("envMapTexelToLinear",o.envMapEncoding):"",o.emissiveMapEncoding?Lr("emissiveMapTexelToLinear",o.emissiveMapEncoding):"",o.outputEncoding?("linearToOutputTexel",_=o.outputEncoding,M=Sr(_),"vec4 linearToOutputTexel( vec4 value ) { return LinearTo"+M[0]+M[1]+"; }"):"",o.depthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(Ar).join("\n")),h=Pr(h=Tr(h=Cr(h),o),o),u=Pr(u=Tr(u=Cr(u),o),o),h=Er(h),u=Er(u),a.isWebGL2&&!r.isRawShaderMaterial){var T=!1,P=/^\s*#version\s+300\s+es\s*\n/;r.isShaderMaterial&&null!==h.match(P)&&null!==u.match(P)&&(T=!0,h=h.replace(P,""),u=u.replace(P,"")),x=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+x,w=["#version 300 es\n","#define varying in",T?"":"out highp vec4 pc_fragColor;",T?"":"#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"+w}var C,E,I=w+u,D=Mr(c,35633,x+h,t.debug.checkShaderErrors),B=Mr(c,35632,I,t.debug.checkShaderErrors);if(c.attachShader(A,D),c.attachShader(A,B),void 0!==r.index0AttributeName?c.bindAttribLocation(A,0,r.index0AttributeName):!0===o.morphTargets&&c.bindAttribLocation(A,0,"position"),c.linkProgram(A),t.debug.checkShaderErrors){var O=c.getProgramInfoLog(A).trim(),V=c.getShaderInfoLog(D).trim(),R=c.getShaderInfoLog(B).trim(),N=!0,z=!0;!1===c.getProgramParameter(A,35714)?(N=!1,console.error("BAIV3.WebGLProgram: shader error: ",c.getError(),"35715",c.getProgramParameter(A,35715),"gl.getProgramInfoLog",O,V,R)):""!==O?console.warn("BAIV3.WebGLProgram: gl.getProgramInfoLog()",O):""!==V&&""!==R||(z=!1),z&&(this.diagnostics={runnable:N,material:r,programLog:O,vertexShader:{log:V,prefix:x},fragmentShader:{log:R,prefix:w}})}return c.deleteShader(D),c.deleteShader(B),this.getUniforms=function(){return void 0===C&&(C=new _r(c,A,s)),C},this.getAttributes=function(){return void 0===E&&(E=function(t,e){for(var n={},r=t.getProgramParameter(e,35721),i=0;i<r;i++){var o=t.getActiveAttrib(e,i).name;n[o]=t.getAttribLocation(e,o)}return n}(c,A)),E},this.destroy=function(){c.deleteProgram(A),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("BAIV3.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("BAIV3.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.name=i.name,this.id=br++,this.code=n,this.usedTimes=1,this.program=A,this.vertexShader=D,this.fragmentShader=B,this}function Dr(t,e,n,r){var i=[],o={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},a=["precision","supportsVertexTextures","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering"];function s(t,e){var n;return t?t.isTexture?n=t.encoding:t.isWebGLRenderTarget&&(console.warn("BAIV3.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),n=t.texture.encoding):n=3e3,3e3===n&&e&&(n=3007),n}this.getParameters=function(e,r,i,a,c,l,h){var u=o[e.type],d=h.isSkinnedMesh?function(){throw"error: calling lost code 30"}():0,p=n.precision;null!==e.precision&&(p=n.getMaxPrecision(e.precision))!==e.precision&&console.warn("BAIV3.WebGLProgram.getParameters:",e.precision,"not supported, using",p,"instead.");var f=t.getRenderTarget();return{shaderID:u,precision:p,supportsVertexTextures:n.vertexTextures,outputEncoding:s(f?f.texture:null,t.gammaOutput),map:!!e.map,mapEncoding:s(e.map,t.gammaInput),matcap:!!e.matcap,matcapEncoding:s(e.matcap,t.gammaInput),envMap:!!e.envMap,envMapMode:e.envMap&&e.envMap.mapping,envMapEncoding:s(e.envMap,t.gammaInput),envMapCubeUV:!!e.envMap&&(306===e.envMap.mapping||307===e.envMap.mapping),lightMap:!!e.lightMap,aoMap:!!e.aoMap,emissiveMap:!!e.emissiveMap,emissiveMapEncoding:s(e.emissiveMap,t.gammaInput),bumpMap:!!e.bumpMap,normalMap:!!e.normalMap,objectSpaceNormalMap:1===e.normalMapType,displacementMap:!!e.displacementMap,roughnessMap:!!e.roughnessMap,metalnessMap:!!e.metalnessMap,specularMap:!!e.specularMap,alphaMap:!!e.alphaMap,gradientMap:!!e.gradientMap,combine:e.combine,vertexTangents:e.normalMap&&e.vertexTangents,vertexColors:e.vertexColors,fog:!!a,useFog:e.fog,fogExp:a&&a.isFogExp2,flatShading:e.flatShading,sizeAttenuation:e.sizeAttenuation,logarithmicDepthBuffer:n.logarithmicDepthBuffer,skinning:e.skinning&&0<d,maxBones:d,useVertexTexture:n.floatVertexTextures,morphTargets:e.morphTargets,morphNormals:e.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:r.directional.length,numPointLights:r.point.length,numSpotLights:r.spot.length,numRectAreaLights:r.rectArea.length,numHemiLights:r.hemi.length,numClippingPlanes:c,numClipIntersection:l,dithering:e.dithering,shadowMapEnabled:t.shadowMap.enabled&&h.receiveShadow&&0<i.length,shadowMapType:t.shadowMap.type,toneMapping:t.toneMapping,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:e.premultipliedAlpha,alphaTest:e.alphaTest,doubleSided:2===e.side,flipSided:1===e.side,depthPacking:void 0!==e.depthPacking&&e.depthPacking}},this.getProgramCode=function(e,n){var r=[];if(n.shaderID?r.push(n.shaderID):(r.push(e.fragmentShader),r.push(e.vertexShader)),void 0!==e.defines)for(var i in e.defines)r.push(i),r.push(e.defines[i]);for(var o=0;o<a.length;o++)r.push(n[a[o]]);return r.push(e.onBeforeCompile.toString()),r.push(t.gammaOutput),r.push(t.gammaFactor),r.join()},this.acquireProgram=function(o,a,s,c){for(var l,h=0,u=i.length;h<u;h++){var d=i[h];if(d.code===c){++(l=d).usedTimes;break}}return void 0===l&&(l=new Ir(t,e,c,o,a,s,n,r),i.push(l)),l},this.releaseProgram=function(t){if(0==--t.usedTimes){var e=i.indexOf(t);i[e]=i[i.length-1],i.pop(),t.destroy()}},this.programs=i}function Br(){var t=new WeakMap;return{get:function(e){var n=t.get(e);return void 0===n&&(n={},t.set(e,n)),n},remove:function(e){t.delete(e)},update:function(e,n,r){t.get(e)[n]=r},dispose:function(){t=new WeakMap}}}function Or(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program!==e.program?t.program.id-e.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function Vr(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Rr(){var t=[],e=0,n=[],r=[],i={id:-1};function o(n,r,o,a,s,c){var l=t[e];return void 0===l?(l={id:n.id,object:n,geometry:r,material:o,program:o.program||i,groupOrder:a,renderOrder:n.renderOrder,z:s,group:c},t[e]=l):(l.id=n.id,l.object=n,l.geometry=r,l.material=o,l.program=o.program||i,l.groupOrder=a,l.renderOrder=n.renderOrder,l.z=s,l.group=c),e++,l}return{opaque:n,transparent:r,init:function(){e=0,n.length=0,r.length=0},push:function(t,e,i,a,s,c){var l=o(t,e,i,a,s,c);(!0===i.transparent?r:n).push(l)},unshift:function(t,e,i,a,s,c){var l=o(t,e,i,a,s,c);(!0===i.transparent?r:n).unshift(l)},sort:function(){1<n.length&&n.sort(Or),1<r.length&&r.sort(Vr)}}}function Nr(){var t={};function e(n){var r=n.target;r.removeEventListener("dispose",e),delete t[r.id]}return{get:function(n,r){var i,o=t[n.id];return void 0===o?(i=new Rr,t[n.id]={},t[n.id][r.id]=i,n.addEventListener("dispose",e)):void 0===(i=o[r.id])&&(i=new Rr,o[r.id]=i),i},dispose:function(){t={}}}}function zr(){return{get:function(t){throw"error: calling lost code 31"}}}var Ur,Fr,Gr,jr,kr,Wr,Hr,Xr,qr=0;function Yr(){for(var t=new zr,e={id:qr++,hash:{stateID:-1,directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,shadowsLength:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},n=0;n<9;n++)e.probe.push(new E);var r=new E,i=new Ct,o=new Ct;return{setup:function(n,a,s){for(var c=0,l=0,h=0,u=0;u<9;u++)e.probe[u].set(0,0,0);for(var d=0,p=0,f=0,m=0,g=0,v=s.matrixWorldInverse,y=(u=0,n.length);u<y;u++){var x=n[u],w=x.color,_=x.intensity,M=x.distance,b=x.shadow&&x.shadow.map?x.shadow.map.texture:null;if(x.isAmbientLight)c+=w.r*_,l+=w.g*_,h+=w.b*_;else if(x.isLightProbe)for(var S=0;S<9;S++)e.probe[S].addScaledVector(x.sh.coefficients[S],_);else if(x.isDirectionalLight){if((A=t.get(x)).color.copy(x.color).multiplyScalar(x.intensity),A.direction.setFromMatrixPosition(x.matrixWorld),r.setFromMatrixPosition(x.target.matrixWorld),A.direction.sub(r),A.direction.transformDirection(v),A.shadow=x.castShadow,x.castShadow){var L=x.shadow;A.shadowBias=L.bias,A.shadowRadius=L.radius,A.shadowMapSize=L.mapSize}e.directionalShadowMap[d]=b,e.directionalShadowMatrix[d]=x.shadow.matrix,e.directional[d]=A,d++}else if(x.isSpotLight)(A=t.get(x)).position.setFromMatrixPosition(x.matrixWorld),A.position.applyMatrix4(v),A.color.copy(w).multiplyScalar(_),A.distance=M,A.direction.setFromMatrixPosition(x.matrixWorld),r.setFromMatrixPosition(x.target.matrixWorld),A.direction.sub(r),A.direction.transformDirection(v),A.coneCos=Math.cos(x.angle),A.penumbraCos=Math.cos(x.angle*(1-x.penumbra)),A.decay=x.decay,A.shadow=x.castShadow,x.castShadow&&(L=x.shadow,A.shadowBias=L.bias,A.shadowRadius=L.radius,A.shadowMapSize=L.mapSize),e.spotShadowMap[f]=b,e.spotShadowMatrix[f]=x.shadow.matrix,e.spot[f]=A,f++;else if(x.isRectAreaLight)(A=t.get(x)).color.copy(w).multiplyScalar(_),A.position.setFromMatrixPosition(x.matrixWorld),A.position.applyMatrix4(v),o.identity(),i.copy(x.matrixWorld),i.premultiply(v),o.extractRotation(i),A.halfWidth.set(.5*x.width,0,0),A.halfHeight.set(0,.5*x.height,0),A.halfWidth.applyMatrix4(o),A.halfHeight.applyMatrix4(o),e.rectArea[m]=A,m++;else if(x.isPointLight)(A=t.get(x)).position.setFromMatrixPosition(x.matrixWorld),A.position.applyMatrix4(v),A.color.copy(x.color).multiplyScalar(x.intensity),A.distance=x.distance,A.decay=x.decay,A.shadow=x.castShadow,x.castShadow&&(L=x.shadow,A.shadowBias=L.bias,A.shadowRadius=L.radius,A.shadowMapSize=L.mapSize,A.shadowCameraNear=L.camera.near,A.shadowCameraFar=L.camera.far),e.pointShadowMap[p]=b,e.pointShadowMatrix[p]=x.shadow.matrix,e.point[p]=A,p++;else if(x.isHemisphereLight){var A;(A=t.get(x)).direction.setFromMatrixPosition(x.matrixWorld),A.direction.transformDirection(v),A.direction.normalize(),A.skyColor.copy(x.color).multiplyScalar(_),A.groundColor.copy(x.groundColor).multiplyScalar(_),e.hemi[g]=A,g++}}e.ambient[0]=c,e.ambient[1]=l,e.ambient[2]=h,e.directional.length=d,e.spot.length=f,e.rectArea.length=m,e.point.length=p,e.hemi.length=g,e.hash.stateID=e.id,e.hash.directionalLength=d,e.hash.pointLength=p,e.hash.spotLength=f,e.hash.rectAreaLength=m,e.hash.hemiLength=g,e.hash.shadowsLength=a.length},state:e}}function Zr(){var t=new Yr,e=[],n=[];return{init:function(){e.length=0,n.length=0},state:{lightsArray:e,shadowsArray:n,lights:t},setupLights:function(r){t.setup(e,n,r)},pushLight:function(t){e.push(t)},pushShadow:function(t){n.push(t)}}}function Jr(){var t={};function e(n){var r=n.target;r.removeEventListener("dispose",e),delete t[r.id]}return{get:function(n,r){var i;return void 0===t[n.id]?(i=new Zr,t[n.id]={},t[n.id][r.id]=i,n.addEventListener("dispose",e)):void 0===t[n.id][r.id]?(i=new Zr,t[n.id][r.id]=i):i=t[n.id][r.id],i},dispose:function(){t={}}}}function Qr(t){Re.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,this.skinning=!1,this.morphTargets=!1,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.lights=!1,this.setValues(t)}function Kr(t){Re.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new E,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.lights=!1,this.setValues(t)}function $r(t,e,n){for(var r=new Pt,i=new Ct,o=new P,a=new P(n,n),s=new E,c=new E,l=new Array(4),h=new Array(4),u=[new E(1,0,0),new E(-1,0,0),new E(0,0,1),new E(0,0,-1),new E(0,1,0),new E(0,-1,0)],p=[new E(0,1,0),new E(0,1,0),new E(0,1,0),new E(0,1,0),new E(0,0,1),new E(0,0,-1)],f=[new wt,new wt,new wt,new wt,new wt,new wt],m=0;4!==m;++m){var g=0!=(1&m),v=0!=(2&m),y=new Qr({depthPacking:3201,morphTargets:g,skinning:v});l[m]=y;var x=new Kr({morphTargets:g,skinning:v});h[m]=x}var w=this;function _(){throw"error: calling lost code 33"}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(e,n,l){if(!1!==w.enabled&&(!1!==w.autoUpdate||!1!==w.needsUpdate)&&0!==e.length){var h,m=t.getRenderTarget(),g=t.getActiveCubeFace(),v=t.getActiveMipMapLevel(),y=t.state;y.setBlending(0),y.buffers.color.setClear(1,1,1,1),y.buffers.depth.setTest(!0),y.setScissorTest(!1);for(var x=0,M=e.length;x<M;x++){var b=e[x],L=b.shadow,A=b&&b.isPointLight;if(void 0!==L){var T=L.camera;if(o.copy(L.mapSize),o.min(a),A){var P=o.x,C=o.y;f[0].set(2*P,C,P,C),f[1].set(0,C,P,C),f[2].set(3*P,C,P,C),f[3].set(P,C,P,C),f[4].set(3*P,0,P,C),f[5].set(P,0,P,C),o.x*=4,o.y*=2}if(null===L.map){var E={minFilter:d,magFilter:d,format:S};L.map=new _t(o.x,o.y,E),L.map.texture.name=b.name+".shadowMap",T.updateProjectionMatrix()}L.isSpotLightShadow&&L.update(b);var I=L.map,D=L.matrix;c.setFromMatrixPosition(b.matrixWorld),T.position.copy(c),A?(h=6,D.makeTranslation(-c.x,-c.y,-c.z)):(h=1,s.setFromMatrixPosition(b.target.matrixWorld),T.lookAt(s),T.updateMatrixWorld(),D.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),D.multiply(T.projectionMatrix),D.multiply(T.matrixWorldInverse)),t.setRenderTarget(I),t.clear();for(var B=0;B<h;B++){if(A){s.copy(T.position),s.add(u[B]),T.up.copy(p[B]),T.lookAt(s),T.updateMatrixWorld();var O=f[B];y.viewport(O)}i.multiplyMatrices(T.projectionMatrix,T.matrixWorldInverse),r.setFromMatrix(i),_()}}else console.warn("BAIV3.WebGLShadowMap:",b,"has no shadow.")}w.needsUpdate=!1,t.setRenderTarget(m,g,v)}}}function ti(t,e,n,r){var i=new function(){var e=!1,n=new wt,r=null,i=new wt(0,0,0,0);return{setMask:function(n){r===n||e||(t.colorMask(n,n,n,n),r=n)},setLocked:function(t){e=t},setClear:function(e,r,o,a,s){!0===s&&(e*=a,r*=a,o*=a),n.set(e,r,o,a),!1===i.equals(n)&&(t.clearColor(e,r,o,a),i.copy(n))},reset:function(){e=!1,r=null,i.set(-1,0,0,0)}}},o=new function(){var e=!1,n=null,r=null,i=null;return{setTest:function(t){(t?z:U)(2929)},setMask:function(r){n===r||e||(t.depthMask(r),n=r)},setFunc:function(e){if(r!==e){if(e)switch(e){case 0:t.depthFunc(512);break;case 1:t.depthFunc(519);break;case 2:t.depthFunc(513);break;case 3:t.depthFunc(515);break;case 4:t.depthFunc(514);break;case 5:t.depthFunc(518);break;case 6:t.depthFunc(516);break;case 7:t.depthFunc(517);break;default:t.depthFunc(515)}else t.depthFunc(515);r=e}},setLocked:function(t){e=t},setClear:function(e){i!==e&&(t.clearDepth(e),i=e)},reset:function(){e=!1,i=r=n=null}}},a=new function(){var e=null;return{setTest:function(t){throw"error: calling lost code 34"},setMask:function(t){throw"error: calling lost code 35"},setFunc:function(t,e,n){throw"error: calling lost code 36"},setOp:function(t,e,n){throw"error: calling lost code 37"},setLocked:function(t){},setClear:function(n){e!==n&&(t.clearStencil(n),e=n)},reset:function(){throw"error: calling lost code 38"}}},s=t.getParameter(34921),c=new Uint8Array(s),l=new Uint8Array(s),h=new Uint8Array(s),u={},d=null,p=null,f=null,m=null,g=null,v=null,y=null,x=null,w=null,_=!1,M=null,b=null,S=null,L=null,A=null,T=t.getParameter(35661),P=!1,C=0,E=t.getParameter(7938);-1!==E.indexOf("WebGL")?(C=parseFloat(/^WebGL\ ([0-9])/.exec(E)[1]),P=1<=C):-1!==E.indexOf("OpenGL ES")&&(C=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(E)[1]),P=2<=C);var I=null,D={},B=new wt,O=new wt;function V(e,n,r){var i=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(var a=0;a<r;a++)t.texImage2D(n+a,0,6408,1,1,0,6408,5121,i);return o}var R={};function N(n,i){c[n]=1,0===l[n]&&(t.enableVertexAttribArray(n),l[n]=1),h[n]!==i&&((r.isWebGL2?t:e.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,i),h[n]=i)}function z(e){!0!==u[e]&&(t.enable(e),u[e]=!0)}function U(e){!1!==u[e]&&(t.disable(e),u[e]=!1)}function F(e,r,i,o,a,s,c,l){if(0!==e){if(p||(z(3042),p=!0),5===e)a=a||r,s=s||i,c=c||o,r===m&&a===y||(t.blendEquationSeparate(n.convert(r),n.convert(a)),m=r,y=a),i===g&&o===v&&s===x&&c===w||(t.blendFuncSeparate(n.convert(i),n.convert(o),n.convert(s),n.convert(c)),g=i,v=o,x=s,w=c),f=e,_=null;else if(e!==f||l!==_){if(100===m&&100===y||(t.blendEquation(32774),y=m=100),l)switch(e){case 1:t.blendFuncSeparate(1,771,1,771);break;case 2:t.blendFunc(1,1);break;case 3:t.blendFuncSeparate(0,0,769,771);break;case 4:t.blendFuncSeparate(0,768,0,770);break;default:console.error("BAIV3.WebGLState: Invalid blending: ",e)}else switch(e){case 1:t.blendFuncSeparate(770,771,1,771);break;case 2:t.blendFunc(770,1);break;case 3:t.blendFunc(0,769);break;case 4:t.blendFunc(0,768);break;default:console.error("BAIV3.WebGLState: Invalid blending: ",e)}w=x=v=g=null,f=e,_=l}}else p&&(U(3042),p=!1)}function G(e){M!==e&&(e?t.frontFace(2304):t.frontFace(2305),M=e)}function j(e){0!==e?(z(2884),e!==b&&(1===e?t.cullFace(1029):2===e?t.cullFace(1028):t.cullFace(1032))):U(2884),b=e}function k(e,n,r){e?(z(32823),L===n&&A===r||(t.polygonOffset(n,r),L=n,A=r)):U(32823)}function W(e){void 0===e&&(e=33984+T-1),I!==e&&(t.activeTexture(e),I=e)}return R[3553]=V(3553,3553,1),R[34067]=V(34067,34069,6),i.setClear(0,0,0,1),o.setClear(1),a.setClear(0),z(2929),o.setFunc(3),G(!1),j(1),z(2884),F(0),{buffers:{color:i,depth:o,stencil:a},initAttributes:function(){for(var t=0,e=c.length;t<e;t++)c[t]=0},enableAttribute:function(t){N(t,0)},enableAttributeAndDivisor:N,disableUnusedAttributes:function(){for(var e=0,n=l.length;e!==n;++e)l[e]!==c[e]&&(t.disableVertexAttribArray(e),l[e]=0)},enable:z,disable:U,getCompressedTextureFormats:function(){throw"error: calling lost code 39"},useProgram:function(e){return d!==e&&(t.useProgram(e),d=e,!0)},setBlending:F,setMaterial:function(t,e){(2===t.side?U:z)(2884);var n=1===t.side;e&&(n=!n),G(n),1===t.blending&&!1===t.transparent?F(0):F(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),o.setFunc(t.depthFunc),o.setTest(t.depthTest),o.setMask(t.depthWrite),i.setMask(t.colorWrite),k(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:G,setCullFace:j,setLineWidth:function(e){e!==S&&(P&&t.lineWidth(e),S=e)},setPolygonOffset:k,setScissorTest:function(t){(t?z:U)(3089)},activeTexture:W,bindTexture:function(e,n){null===I&&W();var r=D[I];void 0===r&&(r={type:void 0,texture:void 0},D[I]=r),r.type===e&&r.texture===n||(t.bindTexture(e,n||R[e]),r.type=e,r.texture=n)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("BAIV3.WebGLState:",t)}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("BAIV3.WebGLState:",t)}},texImage3D:function(){try{t.texImage3D.apply(t,arguments)}catch(t){console.error("BAIV3.WebGLState:",t)}},scissor:function(e){!1===B.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),B.copy(e))},viewport:function(e){!1===O.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),O.copy(e))},reset:function(){for(var e=0;e<l.length;e++)1===l[e]&&(t.disableVertexAttribArray(e),l[e]=0);u={},D={},b=M=f=d=I=null,i.reset(),o.reset(),a.reset()}}}function ei(t,e,n,r,i,o,a){var s,c={},l="undefined"!=typeof OffscreenCanvas;function u(t,e){return l?new OffscreenCanvas(t,e):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function g(t){return T.isPowerOfTwo(t.width)&&T.isPowerOfTwo(t.height)}function v(t){return t===d||t===p||t===f?9728:9729}function P(e){var n=e.target;n.removeEventListener("dispose",P),function(e){var n=r.get(e);void 0!==n.__webglInit&&(t.deleteTexture(n.__webglTexture),r.remove(e))}(n),n.isVideoTexture&&delete c[n.id],a.memory.textures--}var C=0;function E(c,l){var p=r.get(c);if(c.isVideoTexture&&function(){throw"error: calling lost code 52"}(),0<c.version&&p.__version!==c.version){var f=c.image;if(void 0===f)console.warn("BAIV3.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==f.complete)return void function(c,l,p){var f=3553;l.isDataTexture2DArray&&(f=35866),l.isDataTexture3D&&(f=32879),function(e,n){void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",P),e.__webglTexture=t.createTexture(),a.memory.textures++)}(c,l),n.activeTexture(33984+p),n.bindTexture(f,c.__webglTexture),t.pixelStorei(37440,l.flipY),t.pixelStorei(37441,l.premultiplyAlpha),t.pixelStorei(3317,l.unpackAlignment);var C=function(t){return!i.isWebGL2&&(t.wrapS!==h||t.wrapT!==h||t.minFilter!==d&&t.minFilter!==m)}(l)&&!1===g(l.image),E=function(t,e,n,r){var i=1;if((t.width>r||t.height>r)&&(i=r/Math.max(t.width,t.height)),i<1||!0===e){if(!("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap))return"data"in t&&console.warn("BAIV3.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t;var o=e?T.floorPowerOfTwo:Math.floor,a=o(i*t.width),c=o(i*t.height);void 0===s&&(s=u(a,c));var l=s;l.width=a,l.height=c;var h=l.getContext("2d");if(h&&h.drawImage)return h.drawImage(t,0,0,a,c),console.warn("BAIV3.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+a+"x"+c+")."),l}return t}(l.image,C,0,i.maxTextureSize),I=g(E)||i.isWebGL2,D=o.convert(l.format),B=o.convert(l.type),O=function(t,n){if(!i.isWebGL2)return t;var r=t;return 6403===t&&(5126===n&&(r=33326),5131===n&&(r=33325),5121===n&&(r=33321)),6407===t&&(5126===n&&(r=34837),5131===n&&(r=34843),5121===n&&(r=32849)),6408===t&&(5126===n&&(r=34836),5131===n&&(r=34842),5121===n&&(r=32856)),33325===r||33326===r||34842===r||34836===r?e.get("EXT_color_buffer_float"):34843!==r&&34837!==r||console.warn("BAIV3.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."),r}(D,B);!function(n,a,s){var c;if(s?(t.texParameteri(n,10242,o.convert(a.wrapS)),t.texParameteri(n,10243,o.convert(a.wrapT)),32879!==n&&35866!==n||t.texParameteri(n,32882,o.convert(a.wrapR)),t.texParameteri(n,10240,o.convert(a.magFilter)),t.texParameteri(n,10241,o.convert(a.minFilter))):(t.texParameteri(n,10242,33071),t.texParameteri(n,10243,33071),32879!==n&&35866!==n||t.texParameteri(n,32882,33071),a.wrapS===h&&a.wrapT===h||console.warn("BAIV3.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to BAIV3.ClampToEdgeWrapping."),t.texParameteri(n,10240,v(a.magFilter)),t.texParameteri(n,10241,v(a.minFilter)),a.minFilter!==d&&a.minFilter!==m&&console.warn("BAIV3.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to BAIV3.NearestFilter or BAIV3.LinearFilter.")),c=e.get("EXT_texture_filter_anisotropic")){if(a.type===w&&null===e.get("OES_texture_float_linear"))return;if(a.type===_&&null===(i.isWebGL2||e.get("OES_texture_half_float_linear")))return;(1<a.anisotropy||r.get(a).__currentAnisotropy)&&(t.texParameterf(n,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy)}}(f,l,I);var V,R=l.mipmaps;if(l.isDepthTexture){if(O=6402,l.type===w){if(!i.isWebGL2)throw new Error("Float Depth Texture only supported in WebGL2.0");O=36012}else i.isWebGL2&&(O=33189);l.format===L&&6402===O&&l.type!==y&&l.type!==x&&(console.warn("BAIV3.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),l.type=y,B=o.convert(l.type)),l.format===A&&(O=34041,l.type!==M&&(console.warn("BAIV3.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),l.type=M,B=o.convert(l.type))),n.texImage2D(3553,0,O,E.width,E.height,0,D,B,null)}else if(l.isDataTexture)if(0<R.length&&I){for(var N=0,z=R.length;N<z;N++)V=R[N],n.texImage2D(3553,N,O,V.width,V.height,0,D,B,V.data);l.generateMipmaps=!1,c.__maxMipLevel=R.length-1}else n.texImage2D(3553,0,O,E.width,E.height,0,D,B,E.data),c.__maxMipLevel=0;else if(l.isCompressedTexture){for(N=0,z=R.length;N<z;N++)V=R[N],l.format!==S&&l.format!==b?-1<n.getCompressedTextureFormats().indexOf(D)?n.compressedTexImage2D(3553,N,O,V.width,V.height,0,V.data):console.warn("BAIV3.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(3553,N,O,V.width,V.height,0,D,B,V.data);c.__maxMipLevel=R.length-1}else if(l.isDataTexture2DArray)n.texImage3D(35866,0,O,E.width,E.height,E.depth,0,D,B,E.data),c.__maxMipLevel=0;else if(l.isDataTexture3D)n.texImage3D(32879,0,O,E.width,E.height,E.depth,0,D,B,E.data),c.__maxMipLevel=0;else if(0<R.length&&I){for(N=0,z=R.length;N<z;N++)V=R[N],n.texImage2D(3553,N,O,D,B,V);l.generateMipmaps=!1,c.__maxMipLevel=R.length-1}else n.texImage2D(3553,0,O,D,B,E),c.__maxMipLevel=0;!function(t,e){return t.generateMipmaps&&e&&t.minFilter!==d&&t.minFilter!==m}(l,I)||function(e,n,i,o){t.generateMipmap(3553),r.get(n).__maxMipLevel=Math.log(Math.max(i,o))*Math.LOG2E}(0,l,E.width,E.height),c.__version=l.version,l.onUpdate&&l.onUpdate(l)}(p,c,l);console.warn("BAIV3.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+l),n.bindTexture(3553,p.__webglTexture)}var I=!1;this.allocateTextureUnit=function(){var t=C;return t>=i.maxTextures&&console.warn("BAIV3.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+i.maxTextures),C+=1,t},this.resetTextureUnits=function(){C=0},this.setTexture2D=E,this.setTexture2DArray=function(t,e){throw"error: calling lost code 40"},this.setTexture3D=function(t,e){throw"error: calling lost code 41"},this.setTextureCube=function(t,e){throw"error: calling lost code 42"},this.setTextureCubeDynamic=function(t,e){throw"error: calling lost code 43"},this.setupRenderTarget=function(t){throw"error: calling lost code 48"},this.updateRenderTargetMipmap=function(t){throw"error: calling lost code 49"},this.updateMultisampleRenderTarget=function(t){throw"error: calling lost code 50"},this.safeSetTexture2D=function(t,e){t&&t.isWebGLRenderTarget&&(!1===I&&(console.warn("BAIV3.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),I=!0),t=t.texture),E(t,e)},this.safeSetTextureCube=function(t,e){throw"error: calling lost code 53"}}function ni(t,e,n){return{convert:function(t){var r;if(t===l)return 10497;if(t===h)return 33071;if(t===u)return 33648;if(t===d)return 9728;if(t===p)return 9984;if(t===f)return 9986;if(t===m)return 9729;if(1007===t)return 9985;if(t===g)return 9987;if(t===v)return 5121;if(1017===t)return 32819;if(1018===t)return 32820;if(1019===t)return 33635;if(1010===t)return 5120;if(1011===t)return 5122;if(t===y)return 5123;if(1013===t)return 5124;if(t===x)return 5125;if(t===w)return 5126;if(t===_){if(n.isWebGL2)return 5131;if(null!==(r=e.get("OES_texture_half_float")))return r.HALF_FLOAT_OES}if(1021===t)return 6406;if(t===b)return 6407;if(t===S)return 6408;if(1024===t)return 6409;if(1025===t)return 6410;if(t===L)return 6402;if(t===A)return 34041;if(1028===t)return 6403;if(100===t)return 32774;if(101===t)return 32778;if(102===t)return 32779;if(200===t)return 0;if(201===t)return 1;if(202===t)return 768;if(203===t)return 769;if(204===t)return 770;if(205===t)return 771;if(206===t)return 772;if(207===t)return 773;if(208===t)return 774;if(209===t)return 775;if(210===t)return 776;if((33776===t||33777===t||33778===t||33779===t)&&null!==(r=e.get("WEBGL_compressed_texture_s3tc"))){if(33776===t)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===t)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===t)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===t)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((35840===t||35841===t||35842===t||35843===t)&&null!==(r=e.get("WEBGL_compressed_texture_pvrtc"))){if(35840===t)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===t)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===t)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===t)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===t&&null!==(r=e.get("WEBGL_compressed_texture_etc1")))return r.COMPRESSED_RGB_ETC1_WEBGL;if((37808===t||37809===t||37810===t||37811===t||37812===t||37813===t||37814===t||37815===t||37816===t||37817===t||37818===t||37819===t||37820===t||37821===t)&&null!==(r=e.get("WEBGL_compressed_texture_astc")))return t;if(t===s||t===c){if(n.isWebGL2){if(t===s)return 32775;if(t===c)return 32776}if(null!==(r=e.get("EXT_blend_minmax"))){if(t===s)return r.MIN_EXT;if(t===c)return r.MAX_EXT}}if(t===M){if(n.isWebGL2)return 34042;if(null!==(r=e.get("WEBGL_depth_texture")))return r.UNSIGNED_INT_24_8_WEBGL}return 0}}}function ri(){ne.call(this),this.type="Group"}function ii(){ne.call(this),this.type="Camera",this.matrixWorldInverse=new Ct,this.projectionMatrix=new Ct,this.projectionMatrixInverse=new Ct}function oi(t,e,n,r){ii.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==r?r:2e3,this.focus=10,this.aspect=void 0!==e?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function ai(t){oi.call(this),this.cameras=t||[]}function si(t){var e,n,r=this,i=null,o=[],a=new Ct,s=(new Ct,1);"undefined"!=typeof window&&"VRFrameData"in window&&(new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",f,!1)),new Ct,new C,new E;var c=new oi;c.viewport=new wt,c.layers.enable(1);var l=new oi;l.viewport=new wt,l.layers.enable(2);var h=new ai([c,l]);function u(){return null!==i&&!0===i.isPresenting}h.layers.enable(1),h.layers.enable(2);var d,p=new P;function f(){if(u()){var o=i.getEyeParameters("left");e=2*o.renderWidth*s,n=o.renderHeight*s,d=t.getPixelRatio(),t.getSize(p),t.setDrawingBufferSize(e,n,1),c.viewport.set(0,0,e/2,n),l.viewport.set(e/2,0,e/2,n),m.start()}else r.enabled&&t.setDrawingBufferSize(p.width,p.height,d),m.stop()}this.enabled=!1,this.getController=function(t){var e=o[t];return void 0===e&&((e=new ri).matrixAutoUpdate=!1,e.visible=!1,o[t]=e),e},this.getDevice=function(){return i},this.setDevice=function(t){void 0!==t&&(i=t),m.setContext(t)},this.setFramebufferScaleFactor=function(t){s=t},this.setReferenceSpaceType=function(t){},this.setPoseTarget=function(t){},this.getCamera=function(t){throw"error: calling lost code 56"},this.getStandingMatrix=function(){return a},this.isPresenting=u;var m=new qt;this.setAnimationLoop=function(t){m.setAnimationLoop(t),u()&&m.start()},this.submitFrame=function(){u()&&i.submitFrame()},this.dispose=function(){"undefined"!=typeof window&&window.removeEventListener("vrdisplaypresentchange",f)},this.setFrameOfReferenceType=function(){console.warn("BAIV3.WebVRManager: setFrameOfReferenceType() has been deprecated.")}}function ci(t){var e=this,n=null,r=null,i="local-floor",o=null,a=[],s=[];function c(){return null!==n&&null!==r}var l=new oi;l.layers.enable(1),l.viewport=new wt;var h=new oi;h.layers.enable(2),h.viewport=new wt;var u=new ai([l,h]);function d(t){for(var e=0;e<a.length;e++)s[e]===t.inputSource&&a[e].dispatchEvent({type:t.type})}function p(){t.setFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),v.stop(),e.dispatchEvent({type:"sessionend"})}function f(t){r=t,v.setContext(n),v.start(),e.dispatchEvent({type:"sessionstart"})}function m(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)}u.layers.enable(1),u.layers.enable(2),this.enabled=!1,this.getController=function(t){var e=a[t];return void 0===e&&((e=new ri).matrixAutoUpdate=!1,e.visible=!1,a[t]=e),e},this.setFramebufferScaleFactor=function(t){},this.setReferenceSpaceType=function(t){i=t},this.getSession=function(){return n},this.setSession=function(t){null!==(n=t)&&(n.addEventListener("select",d),n.addEventListener("selectstart",d),n.addEventListener("selectend",d),n.addEventListener("end",p),n.updateRenderState({baseLayer:new XRWebGLLayer(n,gl)}),n.requestReferenceSpace(i).then(f),s=n.inputSources,n.addEventListener("inputsourceschange",(function(){s=n.inputSources,console.log(s);for(var t=0;t<a.length;t++)a[t].userData.inputSource=s[t]})))},this.getCamera=function(t){if(c()){var e=t.parent,n=u.cameras;m(u,e);for(var r=0;r<n.length;r++)m(n[r],e);t.matrixWorld.copy(u.matrixWorld);for(var i=t.children,o=(r=0,i.length);r<o;r++)i[r].updateMatrixWorld(!0);return function(){throw"error: calling lost code 54"}(),u}return t},this.isPresenting=c;var g=null,v=new qt;v.setAnimationLoop((function(e,i){if(null!==(o=i.getViewerPose(r))){var c=o.views,l=n.renderState.baseLayer;t.setFramebuffer(l.framebuffer);for(var h=0;h<c.length;h++){var d=c[h],p=l.getViewport(d),f=d.transform.inverse.matrix,m=u.cameras[h];m.matrix.fromArray(f).getInverse(m.matrix),m.projectionMatrix.fromArray(d.projectionMatrix),m.viewport.set(p.x,p.y,p.width,p.height),0===h&&u.matrix.copy(m.matrix)}}for(h=0;h<a.length;h++){var v=a[h],y=s[h];if(y){var x=i.getPose(y.targetRaySpace,r);if(null!==x){v.matrix.fromArray(x.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.visible=!0;continue}}v.visible=!1}g&&g(e)})),this.setAnimationLoop=function(t){g=t},this.dispose=function(){},this.getStandingMatrix=function(){return console.warn("BAIV3.WebXRManager: getStandingMatrix() is no longer needed."),new Ct},this.getDevice=function(){console.warn("BAIV3.WebXRManager: getDevice() has been deprecated.")},this.setDevice=function(){console.warn("BAIV3.WebXRManager: setDevice() has been deprecated.")},this.setFrameOfReferenceType=function(){console.warn("BAIV3.WebXRManager: setFrameOfReferenceType() has been deprecated.")},this.submitFrame=function(){}}function li(t){console.log("BAIV3.WebGLRenderer","105");var e=void 0!==(t=t||{}).canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=void 0!==t.context?t.context:null,r=void 0!==t.alpha&&t.alpha,i=void 0===t.depth||t.depth,o=void 0===t.stencil||t.stencil,a=void 0!==t.antialias&&t.antialias,s=void 0===t.premultipliedAlpha||t.premultipliedAlpha,c=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,l=void 0!==t.powerPreference?t.powerPreference:"default",h=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat,u=null,d=null;this.domElement=e,this.context=null,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.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=1,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var p,f,m,g,v,y,x,_,M,b,L,A,C,I,D,B,O,V,R=this,N=!1,z=null,U=null,F=-1,G={geometry:null,program:null,wireframe:!1},j=null,k=null,W=new wt,H=new wt,X=e.width,q=e.height,Y=1,Z=new wt(0,0,X,q),J=new wt(0,0,X,q),Q=!1,K=new Pt,$=new xn,tt=!1,et=!1,nt=new Ct,rt=new E;function it(){return Y}try{var ot={alpha:r,depth:i,stencil:o,antialias:a,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:l,failIfMajorPerformanceCaveat:h,xrCompatible:!0};if(e.addEventListener("webglcontextlost",lt,!1),e.addEventListener("webglcontextrestored",ht,!1),null===(p=n||e.getContext("webgl",ot)||e.getContext("experimental-webgl",ot)))throw null!==e.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===p.getShaderPrecisionFormat&&(p.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw console.error("BAIV3.WebGLRenderer: "+t.message),t}function at(){f=new wn(p),(m=new yn(p,f,t)).isWebGL2||(f.get("WEBGL_depth_texture"),f.get("OES_texture_float"),f.get("OES_texture_half_float"),f.get("OES_texture_half_float_linear"),f.get("OES_standard_derivatives"),f.get("OES_element_index_uint"),f.get("ANGLE_instanced_arrays")),f.get("OES_texture_float_linear"),V=new ni(p,f,m),(g=new ti(p,f,V,m)).scissor(H.copy(J).multiplyScalar(Y)),g.viewport(W.copy(Z).multiplyScalar(Y)),v=new bn(p),y=new Br,x=new ei(p,f,g,y,m,V,v),_=new Yt(p),M=new _n(p,_,v),b=new Ln(M,v),D=new Sn(p),L=new Dr(R,f,m,x),A=new Nr,C=new Jr,I=new gn(R,g,b,s),B=new vn(p,f,v,m),O=new Mn(p,f,v,m),v.programs=L.programs,R.context=p,R.capabilities=m,R.extensions=f,R.properties=y,R.renderLists=A,R.state=g,R.info=v}at();var st=new("undefined"!=typeof navigator&&"xr"in navigator&&"supportsSession"in navigator.xr?ci:si)(R);this.vr=st;var ct=new $r(R,b,m.maxTextureSize);function lt(t){t.preventDefault(),console.log("BAIV3.WebGLRenderer: Context Lost."),N=!0}function ht(){console.log("BAIV3.WebGLRenderer: Context Restored."),N=!1,at()}function ut(t){var e,n=t.target;n.removeEventListener("dispose",ut),dt(e=n),y.remove(e)}function dt(t){var e=y.get(t).program;(t.program=void 0)!==e&&L.releaseProgram(e)}this.shadowMap=ct,this.getContext=function(){return p},this.getContextAttributes=function(){return p.getContextAttributes()},this.forceContextLoss=function(){var t=f.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){var t=f.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return Y},this.setPixelRatio=function(t){void 0!==t&&(Y=t,this.setSize(X,q,!1))},this.getSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),t=new P),t.set(X,q)},this.setSize=function(t,n,r){st.isPresenting()?console.warn("BAIV3.WebGLRenderer: Can't change size while VR device is presenting."):(X=t,q=n,e.width=t*Y,e.height=n*Y,!1!==r&&(e.style.width=t+"px",e.style.height=n+"px"),this.setViewport(0,0,t,n))},this.getDrawingBufferSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),t=new P),t.set(X*Y,q*Y)},this.setDrawingBufferSize=function(t,n,r){X=t,q=n,Y=r,e.width=t*r,e.height=n*r,this.setViewport(0,0,t,n)},this.getCurrentViewport=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),t=new wt),t.copy(W)},this.getViewport=function(t){return t.copy(Z)},this.setViewport=function(t,e,n,r){t.isVector4?Z.set(t.x,t.y,t.z,t.w):Z.set(t,e,n,r),g.viewport(W.copy(Z).multiplyScalar(Y))},this.getScissor=function(t){return t.copy(J)},this.setScissor=function(t,e,n,r){t.isVector4?J.set(t.x,t.y,t.z,t.w):J.set(t,e,n,r),g.scissor(H.copy(J).multiplyScalar(Y))},this.getScissorTest=function(){return Q},this.setScissorTest=function(t){g.setScissorTest(Q=t)},this.getClearColor=function(){return I.getClearColor()},this.setClearColor=function(){I.setClearColor.apply(I,arguments)},this.getClearAlpha=function(){return I.getClearAlpha()},this.setClearAlpha=function(){I.setClearAlpha.apply(I,arguments)},this.clear=function(t,e,n){var r=0;void 0!==t&&!t||(r|=16384),void 0!==e&&!e||(r|=256),void 0!==n&&!n||(r|=1024),p.clear(r)},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(){e.removeEventListener("webglcontextlost",lt,!1),e.removeEventListener("webglcontextrestored",ht,!1),A.dispose(),C.dispose(),y.dispose(),b.dispose(),st.dispose(),ft.stop()},this.renderBufferImmediate=function(t,e){g.initAttributes();var n=y.get(t);t.hasPositions&&!n.position&&(n.position=p.createBuffer()),t.hasNormals&&!n.normal&&(n.normal=p.createBuffer()),t.hasUvs&&!n.uv&&(n.uv=p.createBuffer()),t.hasColors&&!n.color&&(n.color=p.createBuffer());var r=e.getAttributes();t.hasPositions&&(p.bindBuffer(34962,n.position),p.bufferData(34962,t.positionArray,35048),g.enableAttribute(r.position),p.vertexAttribPointer(r.position,3,5126,!1,0,0)),t.hasNormals&&(p.bindBuffer(34962,n.normal),p.bufferData(34962,t.normalArray,35048),g.enableAttribute(r.normal),p.vertexAttribPointer(r.normal,3,5126,!1,0,0)),t.hasUvs&&(p.bindBuffer(34962,n.uv),p.bufferData(34962,t.uvArray,35048),g.enableAttribute(r.uv),p.vertexAttribPointer(r.uv,2,5126,!1,0,0)),t.hasColors&&(p.bindBuffer(34962,n.color),p.bufferData(34962,t.colorArray,35048),g.enableAttribute(r.color),p.vertexAttribPointer(r.color,3,5126,!1,0,0)),g.disableUnusedAttributes(),p.drawArrays(4,0,t.count),t.count=0},this.renderBufferDirect=function(t,e,n,r,i,o){var a=i.isMesh&&i.matrixWorld.determinant()<0;g.setMaterial(r,a);var s=yt(t,e,r,i),c=!1;G.geometry===n.id&&G.program===s.id&&G.wireframe===(!0===r.wireframe)||(G.geometry=n.id,G.program=s.id,G.wireframe=!0===r.wireframe,c=!0),i.morphTargetInfluences&&(D.update(i,n,r,s),c=!0);var l,h=n.index,u=n.attributes.position,d=1;!0===r.wireframe&&(h=M.getWireframeAttribute(n),d=2);var v=B;null!==h&&(l=_.get(h),(v=O).setIndex(l)),c&&(function(t,e,n){if(n&&n.isInstancedBufferGeometry&&!m.isWebGL2&&null===f.get("ANGLE_instanced_arrays"))return console.error("BAIV3.WebGLRenderer.setupVertexAttributes: using BAIV3.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");g.initAttributes();var r=n.attributes,i=e.getAttributes(),o=t.defaultAttributeValues;for(var a in i){var s=i[a];if(0<=s){var c=r[a];if(void 0!==c){var l=c.normalized,h=c.itemSize,u=_.get(c);if(void 0===u)continue;var d=u.buffer,v=u.type,y=u.bytesPerElement;if(c.isInterleavedBufferAttribute){var x=c.data,w=x.stride,M=c.offset;x&&x.isInstancedInterleavedBuffer?(g.enableAttributeAndDivisor(s,x.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=x.meshPerAttribute*x.count)):g.enableAttribute(s),p.bindBuffer(34962,d),p.vertexAttribPointer(s,h,v,l,w*y,M*y)}else c.isInstancedBufferAttribute?(g.enableAttributeAndDivisor(s,c.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=c.meshPerAttribute*c.count)):g.enableAttribute(s),p.bindBuffer(34962,d),p.vertexAttribPointer(s,h,v,l,0,0)}else if(void 0!==o){var b=o[a];if(void 0!==b)switch(b.length){case 2:p.vertexAttrib2fv(s,b);break;case 3:p.vertexAttrib3fv(s,b);break;case 4:p.vertexAttrib4fv(s,b);break;default:p.vertexAttrib1fv(s,b)}}}}g.disableUnusedAttributes()}(r,s,n),null!==h&&p.bindBuffer(34963,l.buffer));var y=1/0;null!==h?y=h.count:void 0!==u&&(y=u.count);var x=n.drawRange.start*d,w=n.drawRange.count*d,b=null!==o?o.start*d:0,S=null!==o?o.count*d:1/0,L=Math.max(x,b),A=Math.min(y,x+w,b+S)-1,T=Math.max(0,A-L+1);if(0!==T){if(i.isMesh)if(!0===r.wireframe)g.setLineWidth(r.wireframeLinewidth*it()),v.setMode(1);else switch(i.drawMode){case 0:v.setMode(4);break;case 1:v.setMode(5);break;case 2:v.setMode(6)}else if(i.isLine){var P=r.linewidth;void 0===P&&(P=1),g.setLineWidth(P*it()),i.isLineSegments?v.setMode(1):i.isLineLoop?v.setMode(2):v.setMode(3)}else i.isPoints?v.setMode(0):i.isSprite&&v.setMode(4);n&&n.isInstancedBufferGeometry?0<n.maxInstancedCount&&v.renderInstances(n,L,T):v.render(L,T)}},this.compile=function(t,e){(d=C.get(t,e)).init(),t.traverse((function(t){t.isLight&&(d.pushLight(t),t.castShadow&&d.pushShadow(t))})),d.setupLights(e),t.traverse((function(e){if(e.material)if(Array.isArray(e.material))for(var n=0;n<e.material.length;n++)vt(e.material[n],t.fog,e);else vt(e.material,t.fog,e)}))};var pt=null,ft=new qt;function mt(t,e,n,r){for(var i=0,o=t.length;i<o;i++){var a=t[i],s=a.object,c=a.geometry,l=void 0===r?a.material:r,h=a.group;if(n.isArrayCamera)for(var u=(k=n).cameras,p=0,f=u.length;p<f;p++){var m=u[p];s.layers.test(m.layers)&&(g.viewport(W.copy(m.viewport)),d.setupLights(m),gt(s,e,m,c,l,h))}else k=null,gt(s,e,n,c,l,h)}}function gt(t,e,n,r,i,o){if(t.onBeforeRender(R,e,n,r,i,o),d=C.get(e,k||n),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){g.setMaterial(i);var a=yt(n,e.fog,i,t);G.geometry=null,G.program=null,G.wireframe=!1,s=a,t.render((function(t){R.renderBufferImmediate(t,s)}))}else R.renderBufferDirect(n,e.fog,r,i,t,o);var s;t.onAfterRender(R,e,n,r,i,o),d=C.get(e,k||n)}function vt(t,e,n){var r=y.get(t),i=d.state.lights,o=d.state.shadowsArray,a=r.lightsHash,s=i.state.hash,c=L.getParameters(t,i.state,o,e,$.numPlanes,$.numIntersection,n),l=L.getProgramCode(t,c),h=r.program,u=!0;if(void 0===h)t.addEventListener("dispose",ut);else if(h.code!==l)dt(t);else if(a.stateID!==s.stateID||a.directionalLength!==s.directionalLength||a.pointLength!==s.pointLength||a.spotLength!==s.spotLength||a.rectAreaLength!==s.rectAreaLength||a.hemiLength!==s.hemiLength||a.shadowsLength!==s.shadowsLength)a.stateID=s.stateID,a.directionalLength=s.directionalLength,a.pointLength=s.pointLength,a.spotLength=s.spotLength,a.rectAreaLength=s.rectAreaLength,a.hemiLength=s.hemiLength,a.shadowsLength=s.shadowsLength,u=!1;else{if(void 0!==c.shaderID)return;u=!1}if(u){if(c.shaderID){var p=Xt[c.shaderID];r.shader={name:t.type,uniforms:Bt(p.uniforms),vertexShader:p.vertexShader,fragmentShader:p.fragmentShader}}else r.shader={name:t.type,uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader};t.onBeforeCompile(r.shader,R),l=L.getProgramCode(t,c),h=L.acquireProgram(t,r.shader,c,l),r.program=h,t.program=h}var f=h.getAttributes();if(t.morphTargets)for(var m=t.numSupportedMorphTargets=0;m<R.maxMorphTargets;m++)0<=f["morphTarget"+m]&&t.numSupportedMorphTargets++;if(t.morphNormals)for(m=t.numSupportedMorphNormals=0;m<R.maxMorphNormals;m++)0<=f["morphNormal"+m]&&t.numSupportedMorphNormals++;var g=r.shader.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(r.numClippingPlanes=$.numPlanes,r.numIntersection=$.numIntersection,g.clippingPlanes=$.uniform),r.fog=e,void 0===a&&(r.lightsHash=a={}),a.stateID=s.stateID,a.directionalLength=s.directionalLength,a.pointLength=s.pointLength,a.spotLength=s.spotLength,a.rectAreaLength=s.rectAreaLength,a.hemiLength=s.hemiLength,a.shadowsLength=s.shadowsLength,t.lights&&(g.ambientLightColor.value=i.state.ambient,g.lightProbe.value=i.state.probe,g.directionalLights.value=i.state.directional,g.spotLights.value=i.state.spot,g.rectAreaLights.value=i.state.rectArea,g.pointLights.value=i.state.point,g.hemisphereLights.value=i.state.hemi,g.directionalShadowMap.value=i.state.directionalShadowMap,g.directionalShadowMatrix.value=i.state.directionalShadowMatrix,g.spotShadowMap.value=i.state.spotShadowMap,g.spotShadowMatrix.value=i.state.spotShadowMatrix,g.pointShadowMap.value=i.state.pointShadowMap,g.pointShadowMatrix.value=i.state.pointShadowMatrix);var v=r.program.getUniforms(),x=_r.seqWithValue(v.seq,g);r.uniformsList=x}function yt(t,e,n,r){x.resetTextureUnits();var i=y.get(n),o=d.state.lights,a=i.lightsHash,s=o.state.hash;if(tt&&(et||t!==j)){var c=t===j&&n.id===F;$.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,t,i,c)}!1===n.needsUpdate&&(void 0===i.program||n.fog&&i.fog!==e?n.needsUpdate=!0:(!n.lights||a.stateID===s.stateID&&a.directionalLength===s.directionalLength&&a.pointLength===s.pointLength&&a.spotLength===s.spotLength&&a.rectAreaLength===s.rectAreaLength&&a.hemiLength===s.hemiLength&&a.shadowsLength===s.shadowsLength)&&(void 0===i.numClippingPlanes||i.numClippingPlanes===$.numPlanes&&i.numIntersection===$.numIntersection)||(n.needsUpdate=!0)),n.needsUpdate&&(vt(n,e,r),n.needsUpdate=!1);var l=!1,h=!1,u=i.program,f=u.getUniforms(),v=i.shader.uniforms;if(g.useProgram(u.program)&&(h=l=!0),n.id!==F&&(F=n.id,h=!0),l||j!==t){if(f.setValue(p,"projectionMatrix",t.projectionMatrix),m.logarithmicDepthBuffer&&f.setValue(p,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),j!==t&&(j=t,h=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.envMap){var _=f.map.cameraPosition;void 0!==_&&_.setValue(p,rt.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&f.setValue(p,"viewMatrix",t.matrixWorldInverse)}if(n.skinning){f.setOptional(p,r,"bindMatrix"),f.setOptional(p,r,"bindMatrixInverse");var M=r.skeleton;if(M){var b=M.bones;if(m.floatVertexTextures){if(void 0===M.boneTexture){var L=Math.sqrt(4*b.length);L=T.ceilPowerOfTwo(L),L=Math.max(L,4);var A=new Float32Array(L*L*4);A.set(M.boneMatrices);var P=new St(A,L,L,S,w);P.needsUpdate=!0,M.boneMatrices=A,M.boneTexture=P,M.boneTextureSize=L}f.setValue(p,"boneTexture",M.boneTexture,x),f.setValue(p,"boneTextureSize",M.boneTextureSize)}else f.setOptional(p,M,"boneMatrices")}}return h&&(f.setValue(p,"toneMappingExposure",R.toneMappingExposure),f.setValue(p,"toneMappingWhitePoint",R.toneMappingWhitePoint),n.lights&&function(){throw"error: calling lost code 72"}(),e&&n.fog&&function(){throw"error: calling lost code 62"}(),n.isMeshBasicMaterial?xt(v,n):n.isMeshLambertMaterial?(xt(v,n),function(){throw"error: calling lost code 63"}()):n.isMeshPhongMaterial?(xt(v,n),(n.isMeshToonMaterial?function(){throw"error: calling lost code 65"}:function(){throw"error: calling lost code 64"})()):n.isMeshStandardMaterial?(xt(v,n),(n.isMeshPhysicalMaterial?function(){throw"error: calling lost code 67"}:function(){throw"error: calling lost code 66"})()):n.isMeshMatcapMaterial?(xt(v,n),function(){throw"error: calling lost code 68"}()):n.isMeshDepthMaterial?(xt(v,n),function(){throw"error: calling lost code 69"}()):n.isMeshDistanceMaterial?(xt(v,n),function(){throw"error: calling lost code 70"}()):n.isMeshNormalMaterial?(xt(v,n),function(){throw"error: calling lost code 71"}()):n.isLineBasicMaterial?(function(){throw"error: calling lost code 58"}(),n.isLineDashedMaterial&&function(){throw"error: calling lost code 59"}()):n.isPointsMaterial?function(){throw"error: calling lost code 60"}():n.isSpriteMaterial?function(){throw"error: calling lost code 61"}():n.isShadowMaterial&&(v.color.value.copy(n.color),v.opacity.value=n.opacity),void 0!==v.ltc_1&&(v.ltc_1.value=Ht.LTC_1),void 0!==v.ltc_2&&(v.ltc_2.value=Ht.LTC_2),_r.upload(p,i.uniformsList,v,x)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(_r.upload(p,i.uniformsList,v,x),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&f.setValue(p,"center",r.center),f.setValue(p,"modelViewMatrix",r.modelViewMatrix),f.setValue(p,"normalMatrix",r.normalMatrix),f.setValue(p,"modelMatrix",r.matrixWorld),u}function xt(t,e){var n;t.opacity.value=e.opacity,e.color&&t.diffuse.value.copy(e.color),e.emissive&&t.emissive.value.copy(e.emissive).multiplyScalar(e.emissiveIntensity),e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.specularMap&&(t.specularMap.value=e.specularMap),e.envMap&&(t.envMap.value=e.envMap,t.flipEnvMap.value=e.envMap.isCubeTexture?-1:1,t.reflectivity.value=e.reflectivity,t.refractionRatio.value=e.refractionRatio,t.maxMipLevel.value=y.get(e.envMap).__maxMipLevel),e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.aoMap&&(t.aoMap.value=e.aoMap,t.aoMapIntensity.value=e.aoMapIntensity),e.map?n=e.map:e.specularMap?n=e.specularMap:e.displacementMap?n=e.displacementMap:e.normalMap?n=e.normalMap:e.bumpMap?n=e.bumpMap:e.roughnessMap?n=e.roughnessMap:e.metalnessMap?n=e.metalnessMap:e.alphaMap?n=e.alphaMap:e.emissiveMap&&(n=e.emissiveMap),void 0!==n&&(n.isWebGLRenderTarget&&(n=n.texture),!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}ft.setAnimationLoop((function(t){st.isPresenting()||pt&&pt(t)})),"undefined"!=typeof window&&ft.setContext(window),this.setAnimationLoop=function(t){pt=t,st.setAnimationLoop(t),ft.start()},this.render=function(t,e){var n,r;if(void 0!==arguments[2]&&(console.warn("BAIV3.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),n=arguments[2]),void 0!==arguments[3]&&(console.warn("BAIV3.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),r=arguments[3]),e&&e.isCamera){if(!N){G.geometry=null,G.program=null,G.wireframe=!1,F=-1,!(j=null)===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),st.enabled&&(e=st.getCamera(e)),(d=C.get(t,e)).init(),t.onBeforeRender(R,t,e,n||U),nt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),K.setFromMatrix(nt),et=this.localClippingEnabled,tt=$.init(this.clippingPlanes,et,e),(u=A.get(t,e)).init(),function t(e,n,r,i){if(!1!==e.visible){if(e.layers.test(n.layers))if(e.isGroup)r=e.renderOrder;else if(e.isLight)d.pushLight(e),e.castShadow&&d.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||K.intersectsSprite(e)){i&&rt.setFromMatrixPosition(e.matrixWorld).applyMatrix4(nt);var o=b.update(e);(a=e.material).visible&&u.push(e,o,a,r,rt.z,null)}}else if(e.isImmediateRenderObject)i&&rt.setFromMatrixPosition(e.matrixWorld).applyMatrix4(nt),u.push(e,null,e.material,r,rt.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.update(),!e.frustumCulled||K.intersectsObject(e))){i&&rt.setFromMatrixPosition(e.matrixWorld).applyMatrix4(nt);o=b.update(e);var a=e.material;if(Array.isArray(a))for(var s=o.groups,c=0,l=s.length;c<l;c++){var h=s[c],p=a[h.materialIndex];p&&p.visible&&u.push(e,o,p,r,rt.z,h)}else a.visible&&u.push(e,o,a,r,rt.z,null)}var f=e.children;for(c=0,l=f.length;c<l;c++)t(f[c],n,r,i)}}(t,e,0,R.sortObjects),!0===R.sortObjects&&u.sort(),tt&&$.beginShadows();var i=d.state.shadowsArray;ct.render(i,t,e),d.setupLights(e),tt&&$.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==n&&this.setRenderTarget(n),I.render(u,t,e,r);var o=u.opaque,a=u.transparent;if(t.overrideMaterial){var s=t.overrideMaterial;o.length&&mt(o,t,e,s),a.length&&mt(a,t,e,s)}else o.length&&mt(o,t,e),a.length&&mt(a,t,e);t.onAfterRender(R,t,e),g.buffers.depth.setTest(!0),g.buffers.depth.setMask(!0),g.buffers.color.setMask(!0),g.setPolygonOffset(!1),st.enabled&&st.submitFrame(),d=u=null}}else console.error("BAIV3.WebGLRenderer.render: camera is not an instance of BAIV3.Camera.")},this.setFramebuffer=function(t){z!==t&&p.bindFramebuffer(36160,t),z=t},this.getActiveCubeFace=function(){return 0},this.getActiveMipMapLevel=function(){return 0},this.getRenderTarget=function(){return U},this.setRenderTarget=function(t,e,n){throw"error: calling lost code 73"},this.readRenderTargetPixels=function(t,e,n,r,i,o,a){throw"error: calling lost code 74"},this.copyFramebufferToTexture=function(t,e,n){throw"error: calling lost code 75"},this.copyTextureToTexture=function(t,e,n,r){throw"error: calling lost code 76"}}function hi(t,e){throw"error: calling lost code 77"}function ui(t,e,n){throw"error: calling lost code 79"}function di(){ne.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function pi(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function fi(t,e,n,r){this.data=t,this.itemSize=e,this.offset=n,this.normalized=!0===r}function mi(t){Re.call(this),this.type="SpriteMaterial",this.color=new Ut(16777215),this.map=null,this.rotation=0,this.sizeAttenuation=!0,this.lights=!1,this.transparent=!0,this.setValues(t)}function gi(t){if(ne.call(this),this.type="Sprite",void 0===Ur){Ur=new De;var e=new pi(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);Ur.setIndex([0,1,2,0,2,3]),Ur.addAttribute("position",new fi(e,3,0,!1)),Ur.addAttribute("uv",new fi(e,2,3,!1))}this.geometry=Ur,this.material=void 0!==t?t:new mi,this.center=new P(.5,.5)}function vi(){throw"error: calling lost code 82"}function yi(t,e){throw"error: calling lost code 87"}function xi(t,e){throw"error: calling lost code 91"}function wi(){ne.call(this),this.type="Bone"}function _i(t){Re.call(this),this.type="LineBasicMaterial",this.color=new Ut(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(t)}function Mi(t,e,n){1===n&&console.error("BAIV3.Line: parameter BAIV3.LinePieces no longer supported. Use BAIV3.LineSegments instead."),ne.call(this),this.type="Line",this.geometry=void 0!==t?t:new De,this.material=void 0!==e?e:new _i({color:16777215*Math.random()})}function bi(t,e){Mi.call(this,t,e),this.type="LineSegments"}function Si(t,e){Mi.call(this,t,e),this.type="LineLoop"}function Li(t){Re.call(this),this.type="PointsMaterial",this.color=new Ut(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.lights=!1,this.setValues(t)}function Ai(t,e){ne.call(this),this.type="Points",this.geometry=void 0!==t?t:new De,this.material=void 0!==e?e:new Li({color:16777215*Math.random()})}function Ti(t,e,n,r,i,o,a,s,c){throw"error: calling lost code 99"}function Pi(t,e,n,r,i,o,a,s,c,l,h,u){xt.call(this,null,o,a,s,c,l,r,i,h,u),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function Ci(t,e,n,r,i,o,a,s,c){xt.call(this,t,e,n,r,i,o,a,s,c),this.needsUpdate=!0}function Ei(t,e,n,r,i,o,a,s,c,l){if((l=void 0!==l?l:L)!==L&&l!==A)throw new Error("DepthTexture format must be either BAIV3.DepthFormat or BAIV3.DepthStencilFormat");void 0===n&&l===L&&(n=y),void 0===n&&l===A&&(n=M),xt.call(this,null,r,i,o,a,s,l,n,c),this.image={width:t,height:e},this.magFilter=void 0!==a?a:d,this.minFilter=void 0!==s?s:d,this.flipY=!1,this.generateMipmaps=!1}function Ii(t){throw"error: calling lost code 100"}function Di(t,e,n){throw"error: calling lost code 101"}function Bi(t,e,n){throw"error: calling lost code 102"}function Oi(t,e,n,r){throw"error: calling lost code 103"}function Vi(t,e,n,r){throw"error: calling lost code 104"}function Ri(t,e){ce.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Ni(t,e)),this.mergeVertices()}function Ni(t,e){Vi.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:t,detail:e}}function zi(t,e){ce.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Ui(t,e)),this.mergeVertices()}function Ui(t,e){throw"error: calling lost code 105"}function Fi(t,e){throw"error: calling lost code 106"}function Gi(t,e){throw"error: calling lost code 106"}function ji(t,e){throw"error: calling lost code 107"}function ki(t,e){throw"error: calling lost code 108"}function Wi(t,e,n,r,i,o){throw"error: calling lost code 109"}function Hi(t,e,n,r,i){throw"error: calling lost code 110"}function Xi(t,e,n,r,i,o,a){throw"error: calling lost code 111"}function qi(t,e,n,r,i,o){throw"error: calling lost code 112"}function Yi(t,e,n,r,i){throw"error: calling lost code 113"}function Zi(t,e,n,r,i){throw"error: calling lost code 114"}((Qr.prototype=Object.create(Re.prototype)).constructor=Qr).prototype.isMeshDepthMaterial=!0,Qr.prototype.copy=function(t){return Re.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},((Kr.prototype=Object.create(Re.prototype)).constructor=Kr).prototype.isMeshDistanceMaterial=!0,Kr.prototype.copy=function(t){return Re.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this},ri.prototype=Object.assign(Object.create(ne.prototype),{constructor:ri,isGroup:!0}),ii.prototype=Object.assign(Object.create(ne.prototype),{constructor:ii,isCamera:!0,copy:function(t,e){return ne.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("BAIV3.Camera: .getWorldDirection() target is now required"),t=new E),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){ne.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),oi.prototype=Object.assign(Object.create(ii.prototype),{constructor:oi,isPerspectiveCamera:!0,copy:function(t,e){return ii.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){var e=.5*this.getFilmHeight()/t;this.fov=2*T.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*T.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*T.RAD2DEG*Math.atan(Math.tan(.5*T.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,n,r,i,o){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*T.DEG2RAD*this.fov)/this.zoom,n=2*e,r=this.aspect*n,i=-.5*r,o=this.view;if(null!==this.view&&this.view.enabled){var a=o.fullWidth,s=o.fullHeight;i+=o.offsetX*r/a,e-=o.offsetY*n/s,r*=o.width/a,n*=o.height/s}var c=this.filmOffset;0!==c&&(i+=t*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,e,e-n,t,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=ne.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}),ai.prototype=Object.assign(Object.create(oi.prototype),{constructor:ai,isArrayCamera:!0}),new E,new E,Object.assign(hi.prototype,{isFogExp2:!0,clone:function(){return new hi(this.color,this.density)},toJSON:function(){throw"error: calling lost code 78"}}),Object.assign(ui.prototype,{isFog:!0,clone:function(){return new ui(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),di.prototype=Object.assign(Object.create(ne.prototype),{constructor:di,isScene:!0,copy:function(t,e){return ne.prototype.copy.call(this,t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},toJSON:function(t){var e=ne.prototype.toJSON.call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(pi.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(pi.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setArray:function(t){if(Array.isArray(t))throw new TypeError("BAIV3.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==t?t.length/this.stride:0,this.array=t,this},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.dynamic=t.dynamic,this},copyAt:function(t,e,n){t*=this.stride,n*=e.stride;for(var r=0,i=this.stride;r<i;r++)this.array[t+r]=e.array[n+r];return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(t){return this.onUploadCallback=t,this}}),Object.defineProperties(fi.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(fi.prototype,{isInterleavedBufferAttribute:!0,setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,e,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this},setXYZ:function(t,e,n,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this},setXYZW:function(t,e,n,r,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this.data.array[t+3]=i,this}}),((mi.prototype=Object.create(Re.prototype)).constructor=mi).prototype.isSpriteMaterial=!0,mi.prototype.copy=function(t){return Re.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this},gi.prototype=Object.assign(Object.create(ne.prototype),{constructor:gi,isSprite:!0,raycast:(new E,new E,new E,new P,new P,new Ct,new E,new E,new E,new P,new P,new P,function(){throw"error: calling lost code 81"}),clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return ne.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}}),vi.prototype=Object.assign(Object.create(ne.prototype),{constructor:vi,isLOD:!0,copy:function(t){throw"error: calling lost code 83"},addLevel:function(t,e){throw"error: calling lost code 84"},getObjectForDistance:function(t){throw"error: calling lost code 85"},raycast:(Xr=new E,function(t,e){Xr.setFromMatrixPosition(this.matrixWorld);var n=t.ray.origin.distanceTo(Xr);this.getObjectForDistance(n).raycast(t,e)}),update:(Wr=new E,Hr=new E,function(t){var e=this.levels;if(1<e.length){Wr.setFromMatrixPosition(t.matrixWorld),Hr.setFromMatrixPosition(this.matrixWorld);var n=Wr.distanceTo(Hr);e[0].object.visible=!0;for(var r=1,i=e.length;r<i&&n>=e[r].distance;r++)e[r-1].object.visible=!1,e[r].object.visible=!0;for(;r<i;r++)e[r].object.visible=!1}}),toJSON:function(t){throw"error: calling lost code 86"}}),yi.prototype=Object.assign(Object.create(mn.prototype),{constructor:yi,isSkinnedMesh:!0,bind:function(t,e){throw"error: calling lost code 88"},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){throw"error: calling lost code 89"},updateMatrixWorld:function(t){throw"error: calling lost code 90"},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Object.assign(xi.prototype,{calculateInverses:function(){throw"error: calling lost code 92"},pose:function(){throw"error: calling lost code 93"},update:(jr=new Ct,kr=new Ct,function(){for(var t=this.bones,e=this.boneInverses,n=this.boneMatrices,r=this.boneTexture,i=0,o=t.length;i<o;i++){var a=t[i]?t[i].matrixWorld:kr;jr.multiplyMatrices(a,e[i]),jr.toArray(n,16*i)}void 0!==r&&(r.needsUpdate=!0)}),clone:function(){return new xi(this.bones,this.boneInverses)},getBoneByName:function(t){throw"error: calling lost code 94"}}),wi.prototype=Object.assign(Object.create(ne.prototype),{constructor:wi,isBone:!0}),((_i.prototype=Object.create(Re.prototype)).constructor=_i).prototype.isLineBasicMaterial=!0,_i.prototype.copy=function(t){throw"error: calling lost code 95"},Mi.prototype=Object.assign(Object.create(ne.prototype),{constructor:Mi,isLine:!0,computeLineDistances:(new E,new E,function(){throw"error: calling lost code 96"}),raycast:(new Ct,new dn,new At,function(){throw"error: calling lost code 97"}),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),bi.prototype=Object.assign(Object.create(Mi.prototype),{constructor:bi,isLineSegments:!0,computeLineDistances:(Fr=new E,Gr=new E,function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[],r=0,i=e.count;r<i;r+=2)Fr.fromBufferAttribute(e,r),Gr.fromBufferAttribute(e,r+1),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+Fr.distanceTo(Gr);t.addAttribute("lineDistance",new ve(n,1))}else console.warn("BAIV3.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){var o=t.vertices;for(n=t.lineDistances,r=0,i=o.length;r<i;r+=2)Fr.copy(o[r]),Gr.copy(o[r+1]),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+Fr.distanceTo(Gr)}return this})}),Si.prototype=Object.assign(Object.create(Mi.prototype),{constructor:Si,isLineLoop:!0}),((Li.prototype=Object.create(Re.prototype)).constructor=Li).prototype.isPointsMaterial=!0,Li.prototype.copy=function(t){return Re.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this},Ai.prototype=Object.assign(Object.create(ne.prototype),{constructor:Ai,isPoints:!0,raycast:(new Ct,new dn,new At,function(){throw"error: calling lost code 98"}),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Ti.prototype=Object.assign(Object.create(xt.prototype),{constructor:Ti,isVideoTexture:!0,update:function(){var t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),((Pi.prototype=Object.create(xt.prototype)).constructor=Pi).prototype.isCompressedTexture=!0,((Ci.prototype=Object.create(xt.prototype)).constructor=Ci).prototype.isCanvasTexture=!0,((Ei.prototype=Object.create(xt.prototype)).constructor=Ei).prototype.isDepthTexture=!0,(Ii.prototype=Object.create(De.prototype)).constructor=Ii,(Di.prototype=Object.create(ce.prototype)).constructor=Di,(Bi.prototype=Object.create(De.prototype)).constructor=Bi,(Oi.prototype=Object.create(ce.prototype)).constructor=Oi,(Vi.prototype=Object.create(De.prototype)).constructor=Vi,(Ri.prototype=Object.create(ce.prototype)).constructor=Ri,(Ni.prototype=Object.create(Vi.prototype)).constructor=Ni,(zi.prototype=Object.create(ce.prototype)).constructor=zi,(Ui.prototype=Object.create(Vi.prototype)).constructor=Ui,(Fi.prototype=Object.create(ce.prototype)).constructor=Fi,(Gi.prototype=Object.create(Vi.prototype)).constructor=Gi,(ji.prototype=Object.create(ce.prototype)).constructor=ji,(ki.prototype=Object.create(Vi.prototype)).constructor=ki,(Wi.prototype=Object.create(ce.prototype)).constructor=Wi,((Hi.prototype=Object.create(De.prototype)).constructor=Hi).prototype.toJSON=function(){var t=De.prototype.toJSON.call(this);return t.path=this.parameters.path.toJSON(),t},(Xi.prototype=Object.create(ce.prototype)).constructor=Xi,(qi.prototype=Object.create(De.prototype)).constructor=qi,(Yi.prototype=Object.create(ce.prototype)).constructor=Yi,(Zi.prototype=Object.create(De.prototype)).constructor=Zi;var Ji={area:function(t){throw"error: calling lost code 140"},isClockWise:function(t){return Ji.area(t)<0},triangulateShape:function(t,e){throw"error: calling lost code 141"}};function Qi(t,e){ce.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},this.fromBufferGeometry(new Ki(t,e)),this.mergeVertices()}function Ki(t,e){throw"error: calling lost code 145"}function $i(t,e){throw"error: calling lost code 150"}function to(t,e){throw"error: calling lost code 151"}function eo(t,e,n,r,i,o,a){ce.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:r,phiLength:i,thetaStart:o,thetaLength:a},this.fromBufferGeometry(new no(t,e,n,r,i,o,a)),this.mergeVertices()}function no(t,e,n,r,i,o,a){De.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:r,phiLength:i,thetaStart:o,thetaLength:a},t=t||1,e=Math.max(3,Math.floor(e)||8),n=Math.max(2,Math.floor(n)||6),r=void 0!==r?r:0,i=void 0!==i?i:2*Math.PI,o=void 0!==o?o:0,a=void 0!==a?a:Math.PI;var s,c,l=Math.min(o+a,Math.PI),h=0,u=[],d=new E,p=new E,f=[],m=[],g=[],v=[];for(c=0;c<=n;c++){var y=[],x=c/n,w=0;for(0==c&&0==o?w=.5/e:c==n&&l==Math.PI&&(w=-.5/e),s=0;s<=e;s++){var _=s/e;d.x=-t*Math.cos(r+_*i)*Math.sin(o+x*a),d.y=t*Math.cos(o+x*a),d.z=t*Math.sin(r+_*i)*Math.sin(o+x*a),m.push(d.x,d.y,d.z),p.copy(d).normalize(),g.push(p.x,p.y,p.z),v.push(_+w,1-x),y.push(h++)}u.push(y)}for(c=0;c<n;c++)for(s=0;s<e;s++){var M=u[c][s+1],b=u[c][s],S=u[c+1][s],L=u[c+1][s+1];(0!==c||0<o)&&f.push(M,b,L),(c!==n-1||l<Math.PI)&&f.push(b,S,L)}this.setIndex(f),this.addAttribute("position",new ve(m,3)),this.addAttribute("normal",new ve(g,3)),this.addAttribute("uv",new ve(v,2))}function ro(t,e,n,r,i,o){throw"error: calling lost code 152"}function io(t,e,n,r,i,o){throw"error: calling lost code 153"}function oo(t,e,n,r){throw"error: calling lost code 154"}function ao(t,e,n,r){throw"error: calling lost code 155"}function so(t,e){throw"error: calling lost code 156"}function co(t,e){throw"error: calling lost code 157"}function lo(t,e){throw"error: calling lost code 159"}function ho(t,e,n,r,i,o,a,s){throw"error: calling lost code 160"}function uo(t,e,n,r,i,o,a,s){throw"error: calling lost code 161"}function po(t,e,n,r,i,o,a){throw"error: calling lost code 162"}function fo(t,e,n,r,i,o,a){throw"error: calling lost code 163"}function mo(t,e,n,r){ce.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:r},this.fromBufferGeometry(new go(t,e,n,r)),this.mergeVertices()}function go(t,e,n,r){De.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:r},t=t||1,e=void 0!==e?Math.max(3,e):8,n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI;var i,o,a=[],s=[],c=[],l=[],h=new E,u=new P;for(s.push(0,0,0),c.push(0,0,1),l.push(.5,.5),o=0,i=3;o<=e;o++,i+=3){var d=n+o/e*r;h.x=t*Math.cos(d),h.y=t*Math.sin(d),s.push(h.x,h.y,h.z),c.push(0,0,1),u.x=(s[i]/t+1)/2,u.y=(s[i+1]/t+1)/2,l.push(u.x,u.y)}for(i=1;i<=e;i++)a.push(i,i+1,0);this.setIndex(a),this.addAttribute("position",new ve(s,3)),this.addAttribute("normal",new ve(c,3)),this.addAttribute("uv",new ve(l,2))}function vo(t){Re.call(this),this.type="ShadowMaterial",this.color=new Ut(0),this.transparent=!0,this.setValues(t)}function yo(t){un.call(this,t),this.type="RawShaderMaterial"}function xo(t){Re.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Ut(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ut(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new P(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function wo(t){xo.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(t)}function _o(t){Re.call(this),this.type="MeshPhongMaterial",this.color=new Ut(16777215),this.specular=new Ut(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ut(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new P(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.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Mo(t){_o.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(t)}function bo(t){Re.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new P(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function So(t){Re.call(this),this.type="MeshLambertMaterial",this.color=new Ut(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ut(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.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Lo(t){Re.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ut(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new P(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.lights=!1,this.setValues(t)}function Ao(t){_i.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}((Qi.prototype=Object.create(ce.prototype)).constructor=Qi).prototype.toJSON=function(){throw"error: calling lost code 144"},((Ki.prototype=Object.create(De.prototype)).constructor=Ki).prototype.toJSON=function(){throw"error: calling lost code 146"},($i.prototype=Object.create(ce.prototype)).constructor=$i,(to.prototype=Object.create(Ki.prototype)).constructor=to,(eo.prototype=Object.create(ce.prototype)).constructor=eo,(no.prototype=Object.create(De.prototype)).constructor=no,(ro.prototype=Object.create(ce.prototype)).constructor=ro,(io.prototype=Object.create(De.prototype)).constructor=io,(oo.prototype=Object.create(ce.prototype)).constructor=oo,(ao.prototype=Object.create(De.prototype)).constructor=ao,((so.prototype=Object.create(ce.prototype)).constructor=so).prototype.toJSON=function(){var t=ce.prototype.toJSON.call(this);return function(t,e){if(e.shapes=[],Array.isArray(t))for(var n=0,r=t.length;n<r;n++){var i=t[n];e.shapes.push(i.uuid)}else e.shapes.push(t.uuid);return e}(this.parameters.shapes,t)},((co.prototype=Object.create(De.prototype)).constructor=co).prototype.toJSON=function(){throw"error: calling lost code 158"},(lo.prototype=Object.create(De.prototype)).constructor=lo,(ho.prototype=Object.create(ce.prototype)).constructor=ho,(uo.prototype=Object.create(De.prototype)).constructor=uo,(po.prototype=Object.create(ho.prototype)).constructor=po,(fo.prototype=Object.create(uo.prototype)).constructor=fo,(mo.prototype=Object.create(ce.prototype)).constructor=mo,(go.prototype=Object.create(De.prototype)).constructor=go,Object.freeze({WireframeGeometry:Ii,ParametricGeometry:Di,ParametricBufferGeometry:Bi,TetrahedronGeometry:Ri,TetrahedronBufferGeometry:Ni,OctahedronGeometry:zi,OctahedronBufferGeometry:Ui,IcosahedronGeometry:Fi,IcosahedronBufferGeometry:Gi,DodecahedronGeometry:ji,DodecahedronBufferGeometry:ki,PolyhedronGeometry:Oi,PolyhedronBufferGeometry:Vi,TubeGeometry:Wi,TubeBufferGeometry:Hi,TorusKnotGeometry:Xi,TorusKnotBufferGeometry:qi,TorusGeometry:Yi,TorusBufferGeometry:Zi,TextGeometry:$i,TextBufferGeometry:to,SphereGeometry:eo,SphereBufferGeometry:no,RingGeometry:ro,RingBufferGeometry:io,PlaneGeometry:Be,PlaneBufferGeometry:Oe,LatheGeometry:oo,LatheBufferGeometry:ao,ShapeGeometry:so,ShapeBufferGeometry:co,ExtrudeGeometry:Qi,ExtrudeBufferGeometry:Ki,EdgesGeometry:lo,ConeGeometry:po,ConeBufferGeometry:fo,CylinderGeometry:ho,CylinderBufferGeometry:uo,CircleGeometry:mo,CircleBufferGeometry:go}),((vo.prototype=Object.create(Re.prototype)).constructor=vo).prototype.isShadowMaterial=!0,vo.prototype.copy=function(t){return Re.prototype.copy.call(this,t),this.color.copy(t.color),this},((yo.prototype=Object.create(un.prototype)).constructor=yo).prototype.isRawShaderMaterial=!0,((xo.prototype=Object.create(Re.prototype)).constructor=xo).prototype.isMeshStandardMaterial=!0,xo.prototype.copy=function(t){return Re.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((wo.prototype=Object.create(xo.prototype)).constructor=wo).prototype.isMeshPhysicalMaterial=!0,wo.prototype.copy=function(t){return xo.prototype.copy.call(this,t),this.defines={PHYSICAL:""},this.reflectivity=t.reflectivity,this.clearCoat=t.clearCoat,this.clearCoatRoughness=t.clearCoatRoughness,this},((_o.prototype=Object.create(Re.prototype)).constructor=_o).prototype.isMeshPhongMaterial=!0,_o.prototype.copy=function(t){return Re.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((Mo.prototype=Object.create(_o.prototype)).constructor=Mo).prototype.isMeshToonMaterial=!0,Mo.prototype.copy=function(t){return _o.prototype.copy.call(this,t),this.gradientMap=t.gradientMap,this},((bo.prototype=Object.create(Re.prototype)).constructor=bo).prototype.isMeshNormalMaterial=!0,bo.prototype.copy=function(t){return Re.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((So.prototype=Object.create(Re.prototype)).constructor=So).prototype.isMeshLambertMaterial=!0,So.prototype.copy=function(t){return Re.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((Lo.prototype=Object.create(Re.prototype)).constructor=Lo).prototype.isMeshMatcapMaterial=!0,Lo.prototype.copy=function(t){return Re.prototype.copy.call(this,t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((Ao.prototype=Object.create(_i.prototype)).constructor=Ao).prototype.isLineDashedMaterial=!0,Ao.prototype.copy=function(t){return _i.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var To=Object.freeze({ShadowMaterial:vo,SpriteMaterial:mi,RawShaderMaterial:yo,ShaderMaterial:un,PointsMaterial:Li,MeshPhysicalMaterial:wo,MeshStandardMaterial:xo,MeshPhongMaterial:_o,MeshToonMaterial:Mo,MeshNormalMaterial:bo,MeshLambertMaterial:So,MeshDepthMaterial:Qr,MeshDistanceMaterial:Kr,MeshBasicMaterial:fn,MeshMatcapMaterial:Lo,LineDashedMaterial:Ao,LineBasicMaterial:_i,Material:Re}),Po={arraySlice:function(t,e,n){return Po.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)},convertArray:function(t,e,n){return!t||!n&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){for(var e=t.length,n=new Array(e),r=0;r!==e;++r)n[r]=r;return n.sort((function(e,n){return t[e]-t[n]})),n},sortedArray:function(t,e,n){for(var r=t.length,i=new t.constructor(r),o=0,a=0;a!==r;++o)for(var s=n[o]*e,c=0;c!==e;++c)i[a++]=t[s+c];return i},flattenJSON:function(t,e,n,r){for(var i=1,o=t[0];void 0!==o&&void 0===o[r];)o=t[i++];if(void 0!==o){var a=o[r];if(void 0!==a)if(Array.isArray(a))for(;void 0!==(a=o[r])&&(e.push(o.time),n.push.apply(n,a)),void 0!==(o=t[i++]););else if(void 0!==a.toArray)for(;void 0!==(a=o[r])&&(e.push(o.time),a.toArray(n,n.length)),void 0!==(o=t[i++]););else for(;void 0!==(a=o[r])&&(e.push(o.time),n.push(a)),void 0!==(o=t[i++]););}}};function Co(t,e,n,r){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new e.constructor(n),this.sampleValues=e,this.valueSize=n}function Eo(t,e,n,r){throw"error: calling lost code 164"}function Io(t,e,n,r){Co.call(this,t,e,n,r)}function Do(t,e,n,r){Co.call(this,t,e,n,r)}function Bo(t,e,n,r){throw"error: calling lost code 168"}function Oo(t,e,n){Bo.call(this,t,e,n)}function Vo(t,e,n,r){Bo.call(this,t,e,n,r)}function Ro(t,e,n,r){Bo.call(this,t,e,n,r)}function No(t,e,n,r){Co.call(this,t,e,n,r)}function zo(t,e,n,r){Bo.call(this,t,e,n,r)}function Uo(t,e,n,r){Bo.call(this,t,e,n,r)}function Fo(t,e,n,r){Bo.call(this,t,e,n,r)}function Go(t,e,n){throw"error: calling lost code 178"}Object.assign(Co.prototype,{evaluate:function(t){var e=this.parameterPositions,n=this._cachedIndex,r=e[n],i=e[n-1];t:{e:{var o;n:{r:if(!(t<r)){for(var a=n+2;;){if(void 0===r){if(t<i)break r;return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,t,i)}if(n===a)break;if(i=r,t<(r=e[++n]))break e}o=e.length;break n}if(i<=t)break t;var s=e[1];for(t<s&&(n=2,i=s),a=n-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(n===a)break;if(r=i,(i=e[--n-1])<=t)break e}o=n,n=0}for(;n<o;){var c=n+o>>>1;t<e[c]?o=c:n=1+c}if(r=e[n],void 0===(i=e[n-1]))return this._cachedIndex=0,this.beforeStart_(0,t,r);if(void 0===r)return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,i,t)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,t,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){for(var e=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=t*r,o=0;o!==r;++o)e[o]=n[i+o];return e},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(Co.prototype,{beforeStart_:Co.prototype.copySampleValue_,afterEnd_:Co.prototype.copySampleValue_}),Eo.prototype=Object.assign(Object.create(Co.prototype),{constructor:Eo,DefaultSettings_:{endingStart:2400,endingEnd:2400},intervalChanged_:function(t,e,n){throw"error: calling lost code 165"},interpolate_:function(t,e,n,r){throw"error: calling lost code 166"}}),Io.prototype=Object.assign(Object.create(Co.prototype),{constructor:Io,interpolate_:function(t,e,n,r){throw"error: calling lost code 167"}}),Do.prototype=Object.assign(Object.create(Co.prototype),{constructor:Do,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(Bo,{toJSON:function(t){throw"error: calling lost code 169"}}),Object.assign(Bo.prototype,{constructor:Bo,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(t){return new Do(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new Io(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new Eo(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){throw"error: calling lost code 170"},getInterpolation:function(){throw"error: calling lost code 171"},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){throw"error: calling lost code 172"},scale:function(t){throw"error: calling lost code 173"},trim:function(t,e){throw"error: calling lost code 174"},validate:function(){throw"error: calling lost code 175"},optimize:function(){throw"error: calling lost code 176"},clone:function(){throw"error: calling lost code 177"}}),Oo.prototype=Object.assign(Object.create(Bo.prototype),{constructor:Oo,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Vo.prototype=Object.assign(Object.create(Bo.prototype),{constructor:Vo,ValueTypeName:"color"}),Ro.prototype=Object.assign(Object.create(Bo.prototype),{constructor:Ro,ValueTypeName:"number"}),No.prototype=Object.assign(Object.create(Co.prototype),{constructor:No,interpolate_:function(t,e,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,c=(n-e)/(r-e),l=s+a;s!==l;s+=4)C.slerpFlat(i,0,o,s-a,o,s,c);return i}}),zo.prototype=Object.assign(Object.create(Bo.prototype),{constructor:zo,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(t){return new No(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),Uo.prototype=Object.assign(Object.create(Bo.prototype),{constructor:Uo,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Fo.prototype=Object.assign(Object.create(Bo.prototype),{constructor:Fo,ValueTypeName:"vector"}),Object.assign(Go,{parse:function(t){throw"error: calling lost code 181"},toJSON:function(t){throw"error: calling lost code 182"},CreateFromMorphTargetSequence:function(t,e,n,r){throw"error: calling lost code 183"},findByName:function(t,e){throw"error: calling lost code 184"},CreateClipsFromMorphTargetSequences:function(t,e,n){throw"error: calling lost code 185"},parseAnimation:function(t,e){throw"error: calling lost code 186"}}),Object.assign(Go.prototype,{resetDuration:function(){throw"error: calling lost code 187"},trim:function(){throw"error: calling lost code 188"},validate:function(){throw"error: calling lost code 189"},optimize:function(){throw"error: calling lost code 190"},clone:function(){throw"error: calling lost code 191"}});var jo={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};function ko(t,e,n){var r=this,i=!1,o=0,a=0,s=void 0;this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){a++,!1===i&&void 0!==r.onStart&&r.onStart(t,o,a),i=!0},this.itemEnd=function(t){o++,void 0!==r.onProgress&&r.onProgress(t,o,a),o===a&&(i=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(t){void 0!==r.onError&&r.onError(t)},this.resolveURL=function(t){return s?s(t):t},this.setURLModifier=function(t){return s=t,this}}var Wo=new ko,Ho={};function Xo(t){this.manager=void 0!==t?t:Wo}function qo(t){this.manager=void 0!==t?t:Wo}function Yo(t){this.manager=void 0!==t?t:Wo,this._parser=null}function Zo(t){this.manager=void 0!==t?t:Wo,this._parser=null}function Jo(t){this.manager=void 0!==t?t:Wo}function Qo(t){this.manager=void 0!==t?t:Wo}function Ko(t){this.manager=void 0!==t?t:Wo}function $o(){this.type="Curve",this.arcLengthDivisions=200}function ta(t,e,n,r,i,o,a,s){$o.call(this),this.type="EllipseCurve",this.aX=t||0,this.aY=e||0,this.xRadius=n||1,this.yRadius=r||1,this.aStartAngle=i||0,this.aEndAngle=o||2*Math.PI,this.aClockwise=a||!1,this.aRotation=s||0}function ea(t,e,n,r,i,o){ta.call(this,t,e,n,n,r,i,o),this.type="ArcCurve"}function na(){var t=0,e=0,n=0,r=0;function i(i,o,a,s){n=-3*(t=i)+3*o-2*(e=a)-s,r=2*i-2*o+a+s}return{initCatmullRom:function(t,e,n,r,o){i(e,n,o*(n-t),o*(r-e))},initNonuniformCatmullRom:function(t,e,n,r,o,a,s){var c=(e-t)/o-(n-t)/(o+a)+(n-e)/a,l=(n-e)/a-(r-e)/(a+s)+(r-n)/s;i(e,n,c*=a,l*=a)},calc:function(i){var o=i*i;return t+e*i+n*o+r*(o*i)}}}function ra(t,e,n,r){$o.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=e||!1,this.curveType=n||"centripetal",this.tension=r||.5}function ia(t,e,n,r){throw"error: calling lost code 198"}function oa(t,e,n,r){throw"error: calling lost code 203"}function aa(t,e){throw"error: calling lost code 208"}function sa(t,e){throw"error: calling lost code 213"}function ca(t,e,n){throw"error: calling lost code 218"}function la(t,e,n){throw"error: calling lost code 223"}function ha(t){throw"error: calling lost code 228"}function ua(){throw"error: calling lost code 233"}function da(t){throw ua.call(this),"error: calling lost code 243"}function pa(t){da.call(this,t),this.uuid=T.generateUUID(),this.type="Shape",this.holes=[]}function fa(t,e){throw"error: calling lost code 255"}function ma(t,e,n){throw"error: calling lost code 258"}function ga(t){throw"error: calling lost code 260"}function va(){ga.call(this,new oi(50,1,.5,500))}function ya(t,e,n,r,i,o){throw"error: calling lost code 264"}function xa(t,e,n,r){throw"error: calling lost code 266"}function wa(t,e,n,r,i,o){ii.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==t?t:-1,this.right=void 0!==e?e:1,this.top=void 0!==n?n:1,this.bottom=void 0!==r?r:-1,this.near=void 0!==i?i:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()}function _a(){ga.call(this,new wa(-5,5,5,-5,.5,500))}function Ma(t,e){throw"error: calling lost code 268"}function ba(t,e){fa.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function Sa(t,e,n,r){throw"error: calling lost code 270"}function La(t){this.manager=void 0!==t?t:Wo,this.textures={}}Object.assign(Xo.prototype,{load:function(t,e,n,r){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var i=this,o=jo.get(t);if(void 0!==o)return i.manager.itemStart(t),setTimeout((function(){e&&e(o),i.manager.itemEnd(t)}),0),o;if(void 0===Ho[t]){var a=t.match(/^data:(.*?)(;base64)?,(.*)$/);if(a){var s=a[1],c=!!a[2],l=a[3];l=decodeURIComponent(l),c&&(l=atob(l));try{var h,u=(this.responseType||"").toLowerCase();switch(u){case"arraybuffer":case"blob":for(var d=new Uint8Array(l.length),p=0;p<l.length;p++)d[p]=l.charCodeAt(p);h="blob"===u?new Blob([d.buffer],{type:s}):d.buffer;break;case"document":var f=new DOMParser;h=f.parseFromString(l,s);break;case"json":h=JSON.parse(l);break;default:h=l}setTimeout((function(){e&&e(h),i.manager.itemEnd(t)}),0)}catch(e){setTimeout((function(){r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)}),0)}}else{Ho[t]=[],Ho[t].push({onLoad:e,onProgress:n,onError:r});var m=new XMLHttpRequest;for(var g in m.open("GET",t,!0),m.addEventListener("load",(function(e){var n=this.response;jo.add(t,n);var r=Ho[t];if(delete Ho[t],200===this.status||0===this.status){0===this.status&&console.warn("BAIV3.FileLoader: HTTP Status 0 received.");for(var o=0,a=r.length;o<a;o++)(s=r[o]).onLoad&&s.onLoad(n);i.manager.itemEnd(t)}else{for(o=0,a=r.length;o<a;o++){var s;(s=r[o]).onError&&s.onError(e)}i.manager.itemError(t),i.manager.itemEnd(t)}}),!1),m.addEventListener("progress",(function(e){for(var n=Ho[t],r=0,i=n.length;r<i;r++){var o=n[r];o.onProgress&&o.onProgress(e)}}),!1),m.addEventListener("error",(function(e){var n=Ho[t];delete Ho[t];for(var r=0,o=n.length;r<o;r++){var a=n[r];a.onError&&a.onError(e)}i.manager.itemError(t),i.manager.itemEnd(t)}),!1),m.addEventListener("abort",(function(e){var n=Ho[t];delete Ho[t];for(var r=0,o=n.length;r<o;r++){var a=n[r];a.onError&&a.onError(e)}i.manager.itemError(t),i.manager.itemEnd(t)}),!1),void 0!==this.responseType&&(m.responseType=this.responseType),void 0!==this.withCredentials&&(m.withCredentials=this.withCredentials),m.overrideMimeType&&m.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)m.setRequestHeader(g,this.requestHeader[g]);m.send(null)}return i.manager.itemStart(t),m}Ho[t].push({onLoad:e,onProgress:n,onError:r})},setPath:function(t){return this.path=t,this},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setMimeType:function(t){return this.mimeType=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}}),Object.assign(qo.prototype,{load:function(t,e,n,r){var i=this,o=new Xo(i.manager);o.setPath(i.path),o.load(t,(function(t){e(i.parse(JSON.parse(t)))}),n,r)},parse:function(t){for(var e=[],n=0;n<t.length;n++){var r=Go.parse(t[n]);e.push(r)}return e},setPath:function(t){return this.path=t,this}}),Object.assign(Yo.prototype,{load:function(t,e,n,r){var i=this,o=[],a=new Pi;a.image=o;var s=new Xo(this.manager);function c(c){s.load(t[c],(function(t){var n=i._parser(t,!0);o[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(l+=1)&&(1===n.mipmapCount&&(a.minFilter=m),a.format=n.format,a.needsUpdate=!0,e&&e(a))}),n,r)}if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(t))for(var l=0,h=0,u=t.length;h<u;++h)c(h);else s.load(t,(function(t){var n=i._parser(t,!0);if(n.isCubemap)for(var r=n.mipmaps.length/n.mipmapCount,s=0;s<r;s++){o[s]={mipmaps:[]};for(var c=0;c<n.mipmapCount;c++)o[s].mipmaps.push(n.mipmaps[s*n.mipmapCount+c]),o[s].format=n.format,o[s].width=n.width,o[s].height=n.height}else a.image.width=n.width,a.image.height=n.height,a.mipmaps=n.mipmaps;1===n.mipmapCount&&(a.minFilter=m),a.format=n.format,a.needsUpdate=!0,e&&e(a)}),n,r);return a},setPath:function(t){return this.path=t,this}}),Object.assign(Zo.prototype,{load:function(t,e,n,r){var i=this,o=new St,a=new Xo(this.manager);return a.setResponseType("arraybuffer"),a.setPath(this.path),a.load(t,(function(t){var n=i._parser(t);n&&(void 0!==n.image?o.image=n.image:void 0!==n.data&&(o.image.width=n.width,o.image.height=n.height,o.image.data=n.data),o.wrapS=void 0!==n.wrapS?n.wrapS:h,o.wrapT=void 0!==n.wrapT?n.wrapT:h,o.magFilter=void 0!==n.magFilter?n.magFilter:m,o.minFilter=void 0!==n.minFilter?n.minFilter:g,o.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.format&&(o.format=n.format),void 0!==n.type&&(o.type=n.type),void 0!==n.mipmaps&&(o.mipmaps=n.mipmaps),1===n.mipmapCount&&(o.minFilter=m),o.needsUpdate=!0,e&&e(o,n))}),n,r),o},setPath:function(t){return this.path=t,this}}),Object.assign(Jo.prototype,{crossOrigin:"anonymous",load:function(t,e,n,r){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var i=this,o=jo.get(t);if(void 0!==o)return i.manager.itemStart(t),setTimeout((function(){e&&e(o),i.manager.itemEnd(t)}),0),o;var a=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){a.removeEventListener("load",s,!1),a.removeEventListener("error",c,!1),jo.add(t,this),e&&e(this),i.manager.itemEnd(t)}function c(e){a.removeEventListener("load",s,!1),a.removeEventListener("error",c,!1),r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)}return a.addEventListener("load",s,!1),a.addEventListener("error",c,!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),i.manager.itemStart(t),a.src=t,a},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(Qo.prototype,{crossOrigin:"anonymous",load:function(t,e,n,r){var i=new An,o=new Jo(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);var a=0;function s(n){o.load(t[n],(function(t){i.images[n]=t,6==++a&&(i.needsUpdate=!0,e&&e(i))}),void 0,r)}for(var c=0;c<t.length;++c)s(c);return i},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(Ko.prototype,{crossOrigin:"anonymous",load:function(t,e,n,r){var i=new xt,o=new Jo(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,(function(n){i.image=n;var r=0<t.search(/\.jpe?g($|\?)/i)||0===t.search(/^data\:image\/jpeg/);i.format=r?b:S,i.needsUpdate=!0,void 0!==e&&e(i)}),n,r),i},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign($o.prototype,{getPoint:function(){return console.warn("BAIV3.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){var n=this.getUtoTmapping(t);return this.getPoint(n,e)},getPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,n,r=[],i=this.getPoint(0),o=0;for(r.push(0),n=1;n<=t;n++)o+=(e=this.getPoint(n/t)).distanceTo(i),r.push(o),i=e;return this.cacheArcLengths=r},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var n,r=this.getLengths(),i=0,o=r.length;n=e||t*r[o-1];for(var a,s=0,c=o-1;s<=c;)if((a=r[i=Math.floor(s+(c-s)/2)]-n)<0)s=i+1;else{if(!(0<a)){c=i;break}c=i-1}if(r[i=c]===n)return i/(o-1);var l=r[i];return(i+(n-l)/(r[i+1]-l))/(o-1)},getTangent:function(t){var e=t-1e-4,n=t+1e-4;e<0&&(e=0),1<n&&(n=1);var r=this.getPoint(e);return this.getPoint(n).clone().sub(r).normalize()},getTangentAt:function(t){var e=this.getUtoTmapping(t);return this.getTangent(e)},computeFrenetFrames:function(t,e){var n,r,i,o=new E,a=[],s=[],c=[],l=new E,h=new Ct;for(n=0;n<=t;n++)r=n/t,a[n]=this.getTangentAt(r),a[n].normalize();s[0]=new E,c[0]=new E;var u=Number.MAX_VALUE,d=Math.abs(a[0].x),p=Math.abs(a[0].y),f=Math.abs(a[0].z);for(d<=u&&(u=d,o.set(1,0,0)),p<=u&&(u=p,o.set(0,1,0)),f<=u&&o.set(0,0,1),l.crossVectors(a[0],o).normalize(),s[0].crossVectors(a[0],l),c[0].crossVectors(a[0],s[0]),n=1;n<=t;n++)s[n]=s[n-1].clone(),c[n]=c[n-1].clone(),l.crossVectors(a[n-1],a[n]),l.length()>Number.EPSILON&&(l.normalize(),i=Math.acos(T.clamp(a[n-1].dot(a[n]),-1,1)),s[n].applyMatrix4(h.makeRotationAxis(l,i))),c[n].crossVectors(a[n],s[n]);if(!0===e)for(i=Math.acos(T.clamp(s[0].dot(s[t]),-1,1)),i/=t,0<a[0].dot(l.crossVectors(s[0],s[t]))&&(i=-i),n=1;n<=t;n++)s[n].applyMatrix4(h.makeRotationAxis(a[n],i*n)),c[n].crossVectors(a[n],s[n]);return{tangents:a,normals:s,binormals:c}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){var t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),((ta.prototype=Object.create($o.prototype)).constructor=ta).prototype.isEllipseCurve=!0,ta.prototype.getPoint=function(t,e){for(var n=e||new P,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,o=Math.abs(i)<Number.EPSILON;i<0;)i+=r;for(;r<i;)i-=r;i<Number.EPSILON&&(i=o?0:r),!0!==this.aClockwise||o||(i===r?i=-r:i-=r);var a=this.aStartAngle+t*i,s=this.aX+this.xRadius*Math.cos(a),c=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){var l=Math.cos(this.aRotation),h=Math.sin(this.aRotation),u=s-this.aX,d=c-this.aY;s=u*l-d*h+this.aX,c=u*h+d*l+this.aY}return n.set(s,c)},ta.prototype.copy=function(t){return $o.prototype.copy.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},ta.prototype.toJSON=function(){var t=$o.prototype.toJSON.call(this);return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t},ta.prototype.fromJSON=function(t){return $o.prototype.fromJSON.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},((ea.prototype=Object.create(ta.prototype)).constructor=ea).prototype.isArcCurve=!0,new E,new na,new na,new na,((ra.prototype=Object.create($o.prototype)).constructor=ra).prototype.isCatmullRomCurve3=!0,ra.prototype.getPoint=function(t,e){throw"error: calling lost code 192"},ra.prototype.copy=function(t){throw"error: calling lost code 193"},ra.prototype.toJSON=function(){throw"error: calling lost code 194"},ra.prototype.fromJSON=function(t){throw"error: calling lost code 195"},((ia.prototype=Object.create($o.prototype)).constructor=ia).prototype.isCubicBezierCurve=!0,ia.prototype.getPoint=function(t,e){throw"error: calling lost code 199"},ia.prototype.copy=function(t){throw"error: calling lost code 200"},ia.prototype.toJSON=function(){throw"error: calling lost code 201"},ia.prototype.fromJSON=function(t){throw"error: calling lost code 202"},((oa.prototype=Object.create($o.prototype)).constructor=oa).prototype.isCubicBezierCurve3=!0,oa.prototype.getPoint=function(t,e){throw"error: calling lost code 204"},oa.prototype.copy=function(t){throw"error: calling lost code 205"},oa.prototype.toJSON=function(){throw"error: calling lost code 206"},oa.prototype.fromJSON=function(t){throw"error: calling lost code 207"},((aa.prototype=Object.create($o.prototype)).constructor=aa).prototype.isLineCurve=!0,aa.prototype.getPoint=function(t,e){throw"error: calling lost code 209"},aa.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},aa.prototype.getTangent=function(){},aa.prototype.copy=function(t){throw"error: calling lost code 210"},aa.prototype.toJSON=function(){throw"error: calling lost code 211"},aa.prototype.fromJSON=function(t){throw"error: calling lost code 212"},((sa.prototype=Object.create($o.prototype)).constructor=sa).prototype.isLineCurve3=!0,sa.prototype.getPoint=function(t,e){throw"error: calling lost code 214"},sa.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},sa.prototype.copy=function(t){throw"error: calling lost code 215"},sa.prototype.toJSON=function(){throw"error: calling lost code 216"},sa.prototype.fromJSON=function(t){throw"error: calling lost code 217"},((ca.prototype=Object.create($o.prototype)).constructor=ca).prototype.isQuadraticBezierCurve=!0,ca.prototype.getPoint=function(t,e){throw"error: calling lost code 219"},ca.prototype.copy=function(t){throw"error: calling lost code 220"},ca.prototype.toJSON=function(){throw"error: calling lost code 221"},ca.prototype.fromJSON=function(t){throw"error: calling lost code 222"},((la.prototype=Object.create($o.prototype)).constructor=la).prototype.isQuadraticBezierCurve3=!0,la.prototype.getPoint=function(t,e){throw"error: calling lost code 224"},la.prototype.copy=function(t){throw"error: calling lost code 225"},la.prototype.toJSON=function(){throw"error: calling lost code 226"},la.prototype.fromJSON=function(t){throw"error: calling lost code 227"},((ha.prototype=Object.create($o.prototype)).constructor=ha).prototype.isSplineCurve=!0,ha.prototype.getPoint=function(t,e){throw"error: calling lost code 229"},ha.prototype.copy=function(t){throw"error: calling lost code 230"},ha.prototype.toJSON=function(){throw"error: calling lost code 231"},ha.prototype.fromJSON=function(t){throw"error: calling lost code 232"},Object.freeze({ArcCurve:ea,CatmullRomCurve3:ra,CubicBezierCurve:ia,CubicBezierCurve3:oa,EllipseCurve:ta,LineCurve:aa,LineCurve3:sa,QuadraticBezierCurve:ca,QuadraticBezierCurve3:la,SplineCurve:ha}),ua.prototype=Object.assign(Object.create($o.prototype),{constructor:ua,add:function(t){this.curves.push(t)},closePath:function(){throw"error: calling lost code 234"},getPoint:function(t){throw"error: calling lost code 235"},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){throw"error: calling lost code 236"},getCurveLengths:function(){throw"error: calling lost code 237"},getSpacedPoints:function(t){throw"error: calling lost code 238"},getPoints:function(t){throw"error: calling lost code 239"},copy:function(t){throw"error: calling lost code 240"},toJSON:function(){throw"error: calling lost code 241"},fromJSON:function(t){throw"error: calling lost code 242"}}),da.prototype=Object.assign(Object.create(ua.prototype),{constructor:da,setFromPoints:function(t){throw"error: calling lost code 244"},moveTo:function(t,e){this.currentPoint.set(t,e)},lineTo:function(t,e){throw"error: calling lost code 245"},quadraticCurveTo:function(t,e,n,r){throw"error: calling lost code 246"},bezierCurveTo:function(t,e,n,r,i,o){throw"error: calling lost code 247"},splineThru:function(t){throw"error: calling lost code 248"},arc:function(t,e,n,r,i,o){throw"error: calling lost code 249"},absarc:function(t,e,n,r,i,o){this.absellipse(t,e,n,n,r,i,o)},ellipse:function(t,e,n,r,i,o,a,s){throw"error: calling lost code 250"},absellipse:function(t,e,n,r,i,o,a,s){throw"error: calling lost code 251"},copy:function(t){throw"error: calling lost code 252"},toJSON:function(){throw"error: calling lost code 253"},fromJSON:function(t){throw"error: calling lost code 254"}}),pa.prototype=Object.assign(Object.create(da.prototype),{constructor:pa,getPointsHoles:function(t){for(var e=[],n=0,r=this.holes.length;n<r;n++)e[n]=this.holes[n].getPoints(t);return e},extractPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},copy:function(t){da.prototype.copy.call(this,t),this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var r=t.holes[e];this.holes.push(r.clone())}return this},toJSON:function(){var t=da.prototype.toJSON.call(this);t.uuid=this.uuid,t.holes=[];for(var e=0,n=this.holes.length;e<n;e++){var r=this.holes[e];t.holes.push(r.toJSON())}return t},fromJSON:function(t){da.prototype.fromJSON.call(this,t),this.uuid=t.uuid,this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var r=t.holes[e];this.holes.push((new da).fromJSON(r))}return this}}),fa.prototype=Object.assign(Object.create(ne.prototype),{constructor:fa,isLight:!0,copy:function(t){throw"error: calling lost code 256"},toJSON:function(t){throw"error: calling lost code 257"}}),ma.prototype=Object.assign(Object.create(fa.prototype),{constructor:ma,isHemisphereLight:!0,copy:function(t){throw"error: calling lost code 259"}}),Object.assign(ga.prototype,{copy:function(t){throw"error: calling lost code 261"},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){throw"error: calling lost code 262"}}),va.prototype=Object.assign(Object.create(ga.prototype),{constructor:va,isSpotLightShadow:!0,update:function(t){throw"error: calling lost code 263"}}),ya.prototype=Object.assign(Object.create(fa.prototype),{constructor:ya,isSpotLight:!0,copy:function(t){throw"error: calling lost code 265"}}),xa.prototype=Object.assign(Object.create(fa.prototype),{constructor:xa,isPointLight:!0,copy:function(t){throw"error: calling lost code 267"}}),wa.prototype=Object.assign(Object.create(ii.prototype),{constructor:wa,isOrthographicCamera:!0,copy:function(t,e){return ii.prototype.copy.call(this,t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,e,n,r,i,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-t,o=n+t,a=r+e,s=r-e;if(null!==this.view&&this.view.enabled){var c=this.zoom/(this.view.width/this.view.fullWidth),l=this.zoom/(this.view.height/this.view.fullHeight),h=(this.right-this.left)/this.view.width,u=(this.top-this.bottom)/this.view.height;o=(i+=h*(this.view.offsetX/c))+h*(this.view.width/c),s=(a-=u*(this.view.offsetY/l))-u*(this.view.height/l)}this.projectionMatrix.makeOrthographic(i,o,a,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=ne.prototype.toJSON.call(this,t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}),_a.prototype=Object.assign(Object.create(ga.prototype),{constructor:_a}),Ma.prototype=Object.assign(Object.create(fa.prototype),{constructor:Ma,isDirectionalLight:!0,copy:function(t){throw"error: calling lost code 269"}}),ba.prototype=Object.assign(Object.create(fa.prototype),{constructor:ba,isAmbientLight:!0}),Sa.prototype=Object.assign(Object.create(fa.prototype),{constructor:Sa,isRectAreaLight:!0,copy:function(t){throw"error: calling lost code 271"},toJSON:function(t){throw"error: calling lost code 272"}}),Object.assign(La.prototype,{load:function(t,e,n,r){var i=this,o=new Xo(i.manager);o.setPath(i.path),o.load(t,(function(t){e(i.parse(JSON.parse(t)))}),n,r)},parse:function(t){var e=this.textures;function n(t){return void 0===e[t]&&console.warn("BAIV3.MaterialLoader: Undefined texture",t),e[t]}var r=new To[t.type];if(void 0!==t.uuid&&(r.uuid=t.uuid),void 0!==t.name&&(r.name=t.name),void 0!==t.color&&r.color.setHex(t.color),void 0!==t.roughness&&(r.roughness=t.roughness),void 0!==t.metalness&&(r.metalness=t.metalness),void 0!==t.emissive&&r.emissive.setHex(t.emissive),void 0!==t.specular&&r.specular.setHex(t.specular),void 0!==t.shininess&&(r.shininess=t.shininess),void 0!==t.clearCoat&&(r.clearCoat=t.clearCoat),void 0!==t.clearCoatRoughness&&(r.clearCoatRoughness=t.clearCoatRoughness),void 0!==t.vertexColors&&(r.vertexColors=t.vertexColors),void 0!==t.fog&&(r.fog=t.fog),void 0!==t.flatShading&&(r.flatShading=t.flatShading),void 0!==t.blending&&(r.blending=t.blending),void 0!==t.combine&&(r.combine=t.combine),void 0!==t.side&&(r.side=t.side),void 0!==t.opacity&&(r.opacity=t.opacity),void 0!==t.transparent&&(r.transparent=t.transparent),void 0!==t.alphaTest&&(r.alphaTest=t.alphaTest),void 0!==t.depthTest&&(r.depthTest=t.depthTest),void 0!==t.depthWrite&&(r.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(r.colorWrite=t.colorWrite),void 0!==t.wireframe&&(r.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(r.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(r.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(r.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(r.rotation=t.rotation),1!==t.linewidth&&(r.linewidth=t.linewidth),void 0!==t.dashSize&&(r.dashSize=t.dashSize),void 0!==t.gapSize&&(r.gapSize=t.gapSize),void 0!==t.scale&&(r.scale=t.scale),void 0!==t.polygonOffset&&(r.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(r.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(r.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.skinning&&(r.skinning=t.skinning),void 0!==t.morphTargets&&(r.morphTargets=t.morphTargets),void 0!==t.dithering&&(r.dithering=t.dithering),void 0!==t.visible&&(r.visible=t.visible),void 0!==t.userData&&(r.userData=t.userData),void 0!==t.uniforms)for(var i in t.uniforms){var o=t.uniforms[i];switch(r.uniforms[i]={},o.type){case"t":r.uniforms[i].value=n(o.value);break;case"c":r.uniforms[i].value=(new Ut).setHex(o.value);break;case"v2":r.uniforms[i].value=(new P).fromArray(o.value);break;case"v3":r.uniforms[i].value=(new E).fromArray(o.value);break;case"v4":r.uniforms[i].value=(new wt).fromArray(o.value);break;case"m3":r.uniforms[i].value=(new I).fromArray(o.value);case"m4":r.uniforms[i].value=(new Ct).fromArray(o.value);break;default:r.uniforms[i].value=o.value}}if(void 0!==t.defines&&(r.defines=t.defines),void 0!==t.vertexShader&&(r.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(r.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(var a in t.extensions)r.extensions[a]=t.extensions[a];if(void 0!==t.shading&&(r.flatShading=1===t.shading),void 0!==t.size&&(r.size=t.size),void 0!==t.sizeAttenuation&&(r.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(r.map=n(t.map)),void 0!==t.matcap&&(r.matcap=n(t.matcap)),void 0!==t.alphaMap&&(r.alphaMap=n(t.alphaMap),r.transparent=!0),void 0!==t.bumpMap&&(r.bumpMap=n(t.bumpMap)),void 0!==t.bumpScale&&(r.bumpScale=t.bumpScale),void 0!==t.normalMap&&(r.normalMap=n(t.normalMap)),void 0!==t.normalMapType&&(r.normalMapType=t.normalMapType),void 0!==t.normalScale){var s=t.normalScale;!1===Array.isArray(s)&&(s=[s,s]),r.normalScale=(new P).fromArray(s)}return void 0!==t.displacementMap&&(r.displacementMap=n(t.displacementMap)),void 0!==t.displacementScale&&(r.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(r.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(r.roughnessMap=n(t.roughnessMap)),void 0!==t.metalnessMap&&(r.metalnessMap=n(t.metalnessMap)),void 0!==t.emissiveMap&&(r.emissiveMap=n(t.emissiveMap)),void 0!==t.emissiveIntensity&&(r.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(r.specularMap=n(t.specularMap)),void 0!==t.envMap&&(r.envMap=n(t.envMap)),void 0!==t.envMapIntensity&&(r.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(r.reflectivity=t.reflectivity),void 0!==t.lightMap&&(r.lightMap=n(t.lightMap)),void 0!==t.lightMapIntensity&&(r.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(r.aoMap=n(t.aoMap)),void 0!==t.aoMapIntensity&&(r.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(r.gradientMap=n(t.gradientMap)),r},setPath:function(t){return this.path=t,this},setTextures:function(t){return this.textures=t,this}});var Aa,Ta,Pa,Ca,Ea={decodeText:function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var e="",n=0,r=t.length;n<r;n++)e+=String.fromCharCode(t[n]);try{return decodeURIComponent(escape(e))}catch(t){return e}},extractUrlBase:function(t){var e=t.lastIndexOf("/");return-1===e?"./":t.substr(0,e+1)}};function Ia(){throw"error: calling lost code 273"}function Da(t,e,n,r){"number"==typeof n&&(r=n,n=!1,console.error("BAIV3.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),le.call(this,t,e,n),this.meshPerAttribute=r||1}function Ba(t){this.manager=void 0!==t?t:Wo}function Oa(t){throw"error: calling lost code 281"}function Va(){throw"error: calling lost code 285"}function Ra(t){throw"error: calling lost code 288"}function Na(t){this.manager=void 0!==t?t:Wo}function za(){}Ia.prototype=Object.assign(Object.create(De.prototype),{constructor:Ia,isInstancedBufferGeometry:!0,copy:function(t){throw"error: calling lost code 274"},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){throw"error: calling lost code 275"}}),Da.prototype=Object.assign(Object.create(le.prototype),{constructor:Da,isInstancedBufferAttribute:!0,copy:function(t){throw"error: calling lost code 276"},toJSON:function(){throw"error: calling lost code 277"}}),Object.assign(Ba.prototype,{load:function(t,e,n,r){throw"error: calling lost code 278"},parse:function(t){throw"error: calling lost code 279"},setPath:function(t){throw"error: calling lost code 280"}}),Int8Array,Uint8Array,"undefined"!=typeof Uint8ClampedArray||Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Oa.prototype={constructor:Oa,setOptions:function(){throw"error: calling lost code 282"},load:function(t,e,n,r){throw"error: calling lost code 283"},setCrossOrigin:function(){return this},setPath:function(t){throw"error: calling lost code 284"}},Object.assign(Va.prototype,{moveTo:function(t,e){throw"error: calling lost code 286"},lineTo:function(t,e){this.currentPath.lineTo(t,e)},quadraticCurveTo:function(t,e,n,r){this.currentPath.quadraticCurveTo(t,e,n,r)},bezierCurveTo:function(t,e,n,r,i,o){this.currentPath.bezierCurveTo(t,e,n,r,i,o)},splineThru:function(t){this.currentPath.splineThru(t)},toShapes:function(t,e){throw"error: calling lost code 287"}}),Object.assign(Ra.prototype,{isFont:!0,generateShapes:function(t,e){throw"error: calling lost code 289"}}),Object.assign(Na.prototype,{load:function(t,e,n,r){throw"error: calling lost code 292"},parse:function(t){return new Ra(t)},setPath:function(t){throw"error: calling lost code 293"}}),za.Handlers={handlers:[],add:function(t,e){this.handlers.push(t,e)},get:function(t){throw"error: calling lost code 294"}},Object.assign(za.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(t,e,n){for(var r=[],i=0;i<t.length;++i)r[i]=this.createMaterial(t[i],e,n);return r},createMaterial:(Aa={NoBlending:0,NormalBlending:1,AdditiveBlending:2,SubtractiveBlending:3,MultiplyBlending:4,CustomBlending:5},Ta=new Ut,Pa=new Ko,Ca=new La,function(t,e,n){var r={};function i(t,i,o,a,s){var c,h=e+t,d=za.Handlers.get(h);c=null!==d?d.load(h):(Pa.setCrossOrigin(n),Pa.load(h)),void 0!==i&&(c.repeat.fromArray(i),1!==i[0]&&(c.wrapS=l),1!==i[1]&&(c.wrapT=l)),void 0!==o&&c.offset.fromArray(o),void 0!==a&&("repeat"===a[0]&&(c.wrapS=l),"mirror"===a[0]&&(c.wrapS=u),"repeat"===a[1]&&(c.wrapT=l),"mirror"===a[1]&&(c.wrapT=u)),void 0!==s&&(c.anisotropy=s);var p=T.generateUUID();return r[p]=c,p}var o={uuid:T.generateUUID(),type:"MeshLambertMaterial"};for(var a in t){var s=t[a];switch(a){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":o.name=s;break;case"blending":o.blending=Aa[s];break;case"colorAmbient":case"mapAmbient":console.warn("BAIV3.Loader.createMaterial:",a,"is no longer supported.");break;case"colorDiffuse":o.color=Ta.fromArray(s).getHex();break;case"colorSpecular":o.specular=Ta.fromArray(s).getHex();break;case"colorEmissive":o.emissive=Ta.fromArray(s).getHex();break;case"specularCoef":o.shininess=s;break;case"shading":"basic"===s.toLowerCase()&&(o.type="MeshBasicMaterial"),"phong"===s.toLowerCase()&&(o.type="MeshPhongMaterial"),"standard"===s.toLowerCase()&&(o.type="MeshStandardMaterial");break;case"mapDiffuse":o.map=i(s,t.mapDiffuseRepeat,t.mapDiffuseOffset,t.mapDiffuseWrap,t.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":o.emissiveMap=i(s,t.mapEmissiveRepeat,t.mapEmissiveOffset,t.mapEmissiveWrap,t.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":o.lightMap=i(s,t.mapLightRepeat,t.mapLightOffset,t.mapLightWrap,t.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":o.aoMap=i(s,t.mapAORepeat,t.mapAOOffset,t.mapAOWrap,t.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":o.bumpMap=i(s,t.mapBumpRepeat,t.mapBumpOffset,t.mapBumpWrap,t.mapBumpAnisotropy);break;case"mapBumpScale":o.bumpScale=s;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":o.normalMap=i(s,t.mapNormalRepeat,t.mapNormalOffset,t.mapNormalWrap,t.mapNormalAnisotropy);break;case"mapNormalFactor":o.normalScale=s;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":o.specularMap=i(s,t.mapSpecularRepeat,t.mapSpecularOffset,t.mapSpecularWrap,t.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":o.metalnessMap=i(s,t.mapMetalnessRepeat,t.mapMetalnessOffset,t.mapMetalnessWrap,t.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":o.roughnessMap=i(s,t.mapRoughnessRepeat,t.mapRoughnessOffset,t.mapRoughnessWrap,t.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":o.alphaMap=i(s,t.mapAlphaRepeat,t.mapAlphaOffset,t.mapAlphaWrap,t.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":o.side=1;break;case"doubleSided":o.side=2;break;case"transparency":console.warn("BAIV3.Loader.createMaterial: transparency has been renamed to opacity"),o.opacity=s;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":o[a]=s;break;case"vertexColors":!0===s&&(o.vertexColors=2),"face"===s&&(o.vertexColors=1);break;default:console.error("BAIV3.Loader.createMaterial: Unsupported",a,s)}}return"MeshBasicMaterial"===o.type&&delete o.emissive,"MeshPhongMaterial"!==o.type&&delete o.specular,o.opacity<1&&(o.transparent=!0),Ca.setTextures(r),Ca.parse(o)})});var Ua,Fa,Ga,ja,ka,Wa,Ha,Xa,qa;function Ya(t){this.manager=void 0!==t?t:Wo}function Za(){throw"error: calling lost code 298"}function Ja(t,e){throw"error: calling lost code 310"}function Qa(t,e,n){throw"error: calling lost code 313"}function Ka(t,e){throw"error: calling lost code 316"}function $a(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new oi,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new oi,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}function ts(t,e,n,r){throw"error: calling lost code 320"}function es(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}function ns(){throw"error: calling lost code 321"}function rs(t){throw"error: calling lost code 334"}function is(t){throw"error: calling lost code 349"}function os(t,e){throw"error: calling lost code 351"}function as(t,e,n){throw"error: calling lost code 354"}Object.assign(Ya.prototype,{load:function(t,e,n,r){throw"error: calling lost code 296"},setPath:function(t){throw"error: calling lost code 297"}}),Object.assign(Za.prototype,{isSphericalHarmonics3:!0,set:function(t){throw"error: calling lost code 299"},zero:function(){throw"error: calling lost code 300"},getAt:function(t,e){throw"error: calling lost code 301"},getIrradianceAt:function(t,e){throw"error: calling lost code 302"},add:function(t){throw"error: calling lost code 303"},scale:function(t){throw"error: calling lost code 304"},lerp:function(t,e){throw"error: calling lost code 305"},equals:function(t){throw"error: calling lost code 306"},copy:function(t){return this.set(t.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(t){throw"error: calling lost code 307"},toArray:function(){throw"error: calling lost code 308"}}),Object.assign(Za,{getBasisAt:function(t,e){throw"error: calling lost code 309"}}),Ja.prototype=Object.assign(Object.create(fa.prototype),{constructor:Ja,isLightProbe:!0,copy:function(t){throw"error: calling lost code 311"},toJSON:function(t){throw"error: calling lost code 312"}}),Qa.prototype=Object.assign(Object.create(Ja.prototype),{constructor:Qa,isHemisphereLightProbe:!0,copy:function(t){throw"error: calling lost code 314"},toJSON:function(t){throw"error: calling lost code 315"}}),Ka.prototype=Object.assign(Object.create(Ja.prototype),{constructor:Ka,isAmbientLightProbe:!0,copy:function(t){throw"error: calling lost code 317"},toJSON:function(t){throw"error: calling lost code 318"}}),Object.assign($a.prototype,{update:(new Ct,new Ct,function(){throw"error: calling lost code 319"})}),(ts.prototype=Object.create(ne.prototype)).constructor=ts,Object.assign(es.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var e=("undefined"==typeof performance?Date:performance).now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}),ns.prototype=Object.assign(Object.create(ne.prototype),{constructor:ns,getInput:function(){return this.gain},removeFilter:function(){throw"error: calling lost code 322"},getFilter:function(){return this.filter},setFilter:function(t){throw"error: calling lost code 323"},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this},updateMatrixWorld:(ka=new E,Wa=new C,Ha=new E,Xa=new E,qa=new es,function(t){ne.prototype.updateMatrixWorld.call(this,t);var e=this.context.listener,n=this.up;if(this.timeDelta=qa.getDelta(),this.matrixWorld.decompose(ka,Wa,Ha),Xa.set(0,0,-1).applyQuaternion(Wa),e.positionX){var r=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(ka.x,r),e.positionY.linearRampToValueAtTime(ka.y,r),e.positionZ.linearRampToValueAtTime(ka.z,r),e.forwardX.linearRampToValueAtTime(Xa.x,r),e.forwardY.linearRampToValueAtTime(Xa.y,r),e.forwardZ.linearRampToValueAtTime(Xa.z,r),e.upX.linearRampToValueAtTime(n.x,r),e.upY.linearRampToValueAtTime(n.y,r),e.upZ.linearRampToValueAtTime(n.z,r)}else e.setPosition(ka.x,ka.y,ka.z),e.setOrientation(Xa.x,Xa.y,Xa.z,n.x,n.y,n.z)})}),rs.prototype=Object.assign(Object.create(ne.prototype),{constructor:rs,getOutput:function(){return this.gain},setNodeSource:function(t){throw"error: calling lost code 335"},setMediaElementSource:function(t){throw"error: calling lost code 336"},setBuffer:function(t){throw"error: calling lost code 337"},play:function(){throw"error: calling lost code 338"},pause:function(){throw"error: calling lost code 339"},stop:function(){throw"error: calling lost code 340"},connect:function(){throw"error: calling lost code 341"},disconnect:function(){throw"error: calling lost code 342"},getFilters:function(){return this.filters},setFilters:function(t){throw"error: calling lost code 343"},setDetune:function(t){throw"error: calling lost code 344"},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(t){return this.setFilters(t?[t]:[])},setPlaybackRate:function(t){throw"error: calling lost code 345"},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){throw"error: calling lost code 346"},setLoop:function(t){throw"error: calling lost code 347"},getVolume:function(){return this.gain.gain.value},setVolume:function(t){throw"error: calling lost code 348"}}),is.prototype=Object.assign(Object.create(rs.prototype),{constructor:is,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(t){return this.panner.refDistance=t,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(t){return this.panner.rolloffFactor=t,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(t){return this.panner.distanceModel=t,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(t){return this.panner.maxDistance=t,this},setDirectionalCone:function(t,e,n){throw"error: calling lost code 350"},updateMatrixWorld:(Ua=new E,Fa=new C,Ga=new E,ja=new E,function(t){if(ne.prototype.updateMatrixWorld.call(this,t),!0!==this.hasPlaybackControl||!1!==this.isPlaying){this.matrixWorld.decompose(Ua,Fa,Ga),ja.set(0,0,1).applyQuaternion(Fa);var e=this.panner;if(e.positionX){var n=this.context.currentTime+this.listener.timeDelta;e.positionX.linearRampToValueAtTime(Ua.x,n),e.positionY.linearRampToValueAtTime(Ua.y,n),e.positionZ.linearRampToValueAtTime(Ua.z,n),e.orientationX.linearRampToValueAtTime(ja.x,n),e.orientationY.linearRampToValueAtTime(ja.y,n),e.orientationZ.linearRampToValueAtTime(ja.z,n)}else e.setPosition(Ua.x,Ua.y,Ua.z),e.setOrientation(ja.x,ja.y,ja.z)}})}),Object.assign(os.prototype,{getFrequencyData:function(){throw"error: calling lost code 352"},getAverageFrequency:function(){throw"error: calling lost code 353"}}),Object.assign(as.prototype,{accumulate:function(t,e){throw"error: calling lost code 355"},apply:function(t){throw"error: calling lost code 356"},saveOriginalState:function(){throw"error: calling lost code 357"},restoreOriginalState:function(){throw"error: calling lost code 358"},_select:function(t,e,n,r,i){throw"error: calling lost code 359"},_slerp:function(t,e,n,r){C.slerpFlat(t,e,t,e,t,n,r)},_lerp:function(t,e,n,r,i){throw"error: calling lost code 360"}});var ss,cs,ls,hs,us,ds,ps,fs,ms,gs,vs,ys,xs,ws,_s,Ms,bs,Ss,Ls="\\[\\]\\.:\\/";function As(t,e,n){throw"error: calling lost code 361"}function Ts(t,e,n){throw"error: calling lost code 366"}function Ps(){throw"error: calling lost code 369"}function Cs(t){"string"==typeof t&&(console.warn("BAIV3.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function Es(t,e,n){pi.call(this,t,e),this.meshPerAttribute=n||1}function Is(t,e,n,r){this.ray=new dn(t,e),this.near=n||0,this.far=r||1/0,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("BAIV3.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function Ds(t,e){return t.distance-e.distance}function Bs(t,e,n,r){if(!1!==t.visible&&(t.raycast(e,n),!0===r))for(var i=t.children,o=0,a=i.length;o<a;o++)Bs(i[o],e,n,!0)}function Os(t,e,n){throw"error: calling lost code 370"}function Vs(t,e,n){throw"error: calling lost code 375"}function Rs(t,e){}function Ns(t){throw"error: calling lost code 386"}function zs(t,e,n,r){throw"error: calling lost code 387"}function Us(t){throw"error: calling lost code 389"}function Fs(t,e,n){throw"error: calling lost code 391"}function Gs(t,e){throw"error: calling lost code 394"}function js(t,e,n){throw"error: calling lost code 397"}function ks(t,e){throw"error: calling lost code 399"}function Ws(t,e,n,r){throw"error: calling lost code 401"}function Hs(t,e,n,r,i,o){throw"error: calling lost code 403"}function Xs(t,e,n,r){throw"error: calling lost code 404"}function qs(t,e,n,r){throw"error: calling lost code 407"}function Ys(t,e,n){throw"error: calling lost code 409"}function Zs(t){throw"error: calling lost code 412"}function Js(t,e){throw"error: calling lost code 414"}function Qs(t,e,n,r,i,o){throw"error: calling lost code 416"}function Ks(t){throw"error: calling lost code 421"}function $s(t){throw"error: calling lost code 446"}function tc(t){throw"error: calling lost code 447"}function ec(t){throw"error: calling lost code 448"}Object.assign(As.prototype,{getValue:function(t,e){throw"error: calling lost code 362"},setValue:function(t,e){throw"error: calling lost code 363"},bind:function(){throw"error: calling lost code 364"},unbind:function(){throw"error: calling lost code 365"}}),Object.assign(Ts,{Composite:As,create:function(t,e,n){throw"error: calling lost code 367"},sanitizeNodeName:(bs=new RegExp("["+Ls+"]","g"),function(t){return t.replace(/\s/g,"_").replace(bs,"")}),parseTrackName:(ms="[^"+Ls+"]",gs="[^"+Ls.replace("\\.","")+"]",vs=/((?:WC+[\/:])*)/.source.replace("WC",ms),ys=/(WCOD+)?/.source.replace("WCOD",gs),xs=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",ms),ws=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",ms),_s=new RegExp("^"+vs+ys+xs+ws+"$"),Ms=["material","materials","bones"],function(t){var e=_s.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){var i=n.nodeName.substring(r+1);-1!==Ms.indexOf(i)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=i)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}),findNode:function(t,e){throw"error: calling lost code 368"}}),Object.assign(Ts.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[],SetterByBindingTypeAndVersioning:[[],[],[],[]],getValue:function(){},setValue:function(){},bind:function(){},unbind:function(){}}),Object.assign(Ts.prototype,{_getValue_unbound:Ts.prototype.getValue,_setValue_unbound:Ts.prototype.setValue}),Object.assign(Ps.prototype,{isAnimationObjectGroup:!0,add:function(){},remove:function(){},uncache:function(){},subscribe_:function(t,e){},unsubscribe_:function(t){}}),Cs.prototype.clone=function(){return new Cs(void 0===this.value.clone?this.value:this.value.clone())},Es.prototype=Object.assign(Object.create(pi.prototype),{constructor:Es,isInstancedInterleavedBuffer:!0,copy:function(t){return pi.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),Object.assign(Is.prototype,{linePrecision:1,set:function(t,e){this.ray.set(t,e)},setFromCamera:function(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize()):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld)):console.error("BAIV3.Raycaster: Unsupported camera type.")},intersectObject:function(t,e,n){var r=n||[];return Bs(t,this,r,e),r.sort(Ds),r},intersectObjects:function(t,e,n){var r=n||[];if(!1===Array.isArray(t))return console.warn("BAIV3.Raycaster.intersectObjects: objects is not an Array."),r;for(var i=0,o=t.length;i<o;i++)Bs(t[i],this,r,e);return r.sort(Ds),r}}),Object.assign(Os.prototype,{set:function(t,e,n){throw"error: calling lost code 371"},clone:function(){return(new this.constructor).copy(this)},copy:function(t){throw"error: calling lost code 372"},makeSafe:function(){throw"error: calling lost code 373"},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,n){throw"error: calling lost code 374"}}),Object.assign(Vs.prototype,{set:function(t,e,n){throw"error: calling lost code 376"},clone:function(){return(new this.constructor).copy(this)},copy:function(t){throw"error: calling lost code 377"},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,n){throw"error: calling lost code 378"}}),Object.assign(Rs.prototype,{set:function(t,e){throw"error: calling lost code 379"},clone:function(){return(new this.constructor).copy(this)},copy:function(t){throw"error: calling lost code 380"},getCenter:function(t){throw"error: calling lost code 381"},delta:function(t){throw"error: calling lost code 382"},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){throw"error: calling lost code 383"},closestPointToPointParameter:(ps=new E,fs=new E,function(t,e){ps.subVectors(t,this.start),fs.subVectors(this.end,this.start);var n=fs.dot(fs),r=fs.dot(ps)/n;return e&&(r=T.clamp(r,0,1)),r}),closestPointToPoint:function(t,e,n){throw"error: calling lost code 384"},applyMatrix4:function(t){throw"error: calling lost code 385"},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}),((Ns.prototype=Object.create(ne.prototype)).constructor=Ns).prototype.isImmediateRenderObject=!0,((zs.prototype=Object.create(bi.prototype)).constructor=zs).prototype.update=(hs=new E,us=new E,ds=new I,function(){var t=["a","b","c"];this.object.updateMatrixWorld(!0),ds.getNormalMatrix(this.object.matrixWorld);var e=this.object.matrixWorld,n=this.geometry.attributes.position,r=this.object.geometry;if(r&&r.isGeometry)for(var i=r.vertices,o=r.faces,a=0,s=0,c=o.length;s<c;s++)for(var l=o[s],h=0,u=l.vertexNormals.length;h<u;h++){var d=i[l[t[h]]],p=l.vertexNormals[h];hs.copy(d).applyMatrix4(e),us.copy(p).applyMatrix3(ds).normalize().multiplyScalar(this.size).add(hs),n.setXYZ(a,hs.x,hs.y,hs.z),a+=1,n.setXYZ(a,us.x,us.y,us.z),a+=1}else if(r&&r.isBufferGeometry){var f=r.attributes.position,m=r.attributes.normal;for(h=a=0,u=f.count;h<u;h++)hs.set(f.getX(h),f.getY(h),f.getZ(h)).applyMatrix4(e),us.set(m.getX(h),m.getY(h),m.getZ(h)),us.applyMatrix3(ds).normalize().multiplyScalar(this.size).add(hs),n.setXYZ(a,hs.x,hs.y,hs.z),a+=1,n.setXYZ(a,us.x,us.y,us.z),a+=1}n.needsUpdate=!0}),((Us.prototype=Object.create(bi.prototype)).constructor=Us).prototype.updateMatrixWorld=(new E,new Ct,new Ct,function(){throw"error: calling lost code 390"}),((Fs.prototype=Object.create(mn.prototype)).constructor=Fs).prototype.dispose=function(){throw"error: calling lost code 392"},Fs.prototype.update=function(){throw"error: calling lost code 393"},((Gs.prototype=Object.create(Mi.prototype)).constructor=Gs).prototype.update=function(){throw"error: calling lost code 395"},Gs.prototype.dispose=function(){throw"error: calling lost code 396"},((js.prototype=Object.create(ne.prototype)).constructor=js).prototype.dispose=function(){throw"error: calling lost code 398"},js.prototype.update=(ss=new E,cs=new Ut,ls=new Ut,function(){var t=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var e=t.geometry.getAttribute("color");cs.copy(this.light.color),ls.copy(this.light.groundColor);for(var n=0,r=e.count;n<r;n++){var i=n<r/2?cs:ls;e.setXYZ(n,i.r,i.g,i.b)}e.needsUpdate=!0}t.lookAt(ss.setFromMatrixPosition(this.light.matrixWorld).negate())}),((ks.prototype=Object.create(mn.prototype)).constructor=ks).prototype.dispose=function(){throw"error: calling lost code 400"},ks.prototype.onBeforeRender=function(){this.position.copy(this.lightProbe.position),this.scale.set(1,1,1).multiplyScalar(this.size),this.material.uniforms.intensity.value=this.lightProbe.intensity},Ws.prototype=Object.assign(Object.create(bi.prototype),{constructor:Ws,copy:function(t){throw"error: calling lost code 402"},clone:function(){return(new this.constructor).copy(this)}}),(Hs.prototype=Object.create(bi.prototype)).constructor=Hs,((Xs.prototype=Object.create(Mi.prototype)).constructor=Xs).prototype.update=function(){throw"error: calling lost code 405"},Xs.prototype.dispose=function(){throw"error: calling lost code 406"},((qs.prototype=Object.create(bi.prototype)).constructor=qs).prototype.update=(new E,new E,new I,function(){throw"error: calling lost code 408"}),((Ys.prototype=Object.create(ne.prototype)).constructor=Ys).prototype.dispose=function(){throw"error: calling lost code 410"},Ys.prototype.update=(new E,new E,new E,function(){throw"error: calling lost code 411"}),((Zs.prototype=Object.create(bi.prototype)).constructor=Zs).prototype.update=(new E,new ii,function(){throw"error: calling lost code 413"}),((Js.prototype=Object.create(bi.prototype)).constructor=Js).prototype.updateMatrixWorld=function(t){throw"error: calling lost code 415"},((Qs.prototype=Object.create(ne.prototype)).constructor=Qs).prototype.setDirection=(new E,function(){throw"error: calling lost code 417"}),Qs.prototype.setLength=function(t,e,n){throw"error: calling lost code 418"},Qs.prototype.setColor=function(t){throw"error: calling lost code 419"},Qs.prototype.copy=function(t){throw"error: calling lost code 420"},Qs.prototype.clone=function(){return(new this.constructor).copy(this)},(Ks.prototype=Object.create(bi.prototype)).constructor=Ks,$o.create=function(t,e){throw"error: calling lost code 442"},Object.assign(ua.prototype,{createPointsGeometry:function(t){throw"error: calling lost code 443"},createSpacedPointsGeometry:function(t){throw"error: calling lost code 444"},createGeometry:function(t){throw"error: calling lost code 445"}}),Object.assign(da.prototype,{fromPoints:function(t){console.warn("BAIV3.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)}}),$s.prototype=Object.create(ra.prototype),tc.prototype=Object.create(ra.prototype),ec.prototype=Object.create(ra.prototype),Object.assign(ec.prototype,{initFromArray:function(){console.error("BAIV3.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("BAIV3.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("BAIV3.Spline: .reparametrizeByArcLength() has been removed.")}}),Ws.prototype.setColors=function(){console.error("BAIV3.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Us.prototype.update=function(){console.error("BAIV3.SkeletonHelper: update() no longer needs to be called.")},Object.assign(za.prototype,{extractUrlBase:function(t){return console.warn("BAIV3.Loader: .extractUrlBase() has been deprecated. Use BAIV3.LoaderUtils.extractUrlBase() instead."),Ea.extractUrlBase(t)}}),Object.assign(Lt.prototype,{center:function(t){throw"error: calling lost code 452"},empty:function(){throw"error: calling lost code 453"},isIntersectionBox:function(t){throw"error: calling lost code 454"},isIntersectionSphere:function(t){throw"error: calling lost code 455"},size:function(t){throw"error: calling lost code 456"}}),Rs.prototype.center=function(t){throw"error: calling lost code 457"},Object.assign(T,{random16:function(){return console.warn("BAIV3.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(t){return console.warn("BAIV3.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),T.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return console.warn("BAIV3.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),T.ceilPowerOfTwo(t)}}),Object.assign(I.prototype,{flattenToArrayOffset:function(t,e){return console.warn("BAIV3.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("BAIV3.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(){console.error("BAIV3.Matrix3: .multiplyVector3Array() has been removed.")},applyToBuffer:function(t){return console.warn("BAIV3.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(){console.error("BAIV3.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(Ct.prototype,{extractPosition:function(t){return console.warn("BAIV3.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("BAIV3.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){return void 0===Ss&&(Ss=new E),console.warn("BAIV3.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),Ss.setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(t){return console.warn("BAIV3.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyToArray:function(){console.warn("BAIV3.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(t){return console.warn("BAIV3.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector4:function(t){return console.warn("BAIV3.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(){console.error("BAIV3.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(t){console.warn("BAIV3.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("BAIV3.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},translate:function(){console.error("BAIV3.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("BAIV3.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("BAIV3.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("BAIV3.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("BAIV3.Matrix4: .rotateByAxis() has been removed.")},applyToBuffer:function(t){return console.warn("BAIV3.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(){console.error("BAIV3.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,n,r,i,o){return console.warn("BAIV3.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,r,n,i,o)}}),Tt.prototype.isIntersectionLine=function(t){return console.warn("BAIV3.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},C.prototype.multiplyVector3=function(t){return console.warn("BAIV3.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},Object.assign(dn.prototype,{isIntersectionBox:function(t){throw"error: calling lost code 458"},isIntersectionPlane:function(t){throw"error: calling lost code 459"},isIntersectionSphere:function(t){throw"error: calling lost code 460"}}),Object.assign(pn.prototype,{area:function(){throw"error: calling lost code 461"},barycoordFromPoint:function(t,e){throw"error: calling lost code 462"},midpoint:function(t){throw"error: calling lost code 463"},normal:function(t){throw"error: calling lost code 464"},plane:function(t){throw"error: calling lost code 465"}}),Object.assign(pn,{barycoordFromPoint:function(t,e,n,r,i){throw"error: calling lost code 466"},normal:function(t,e,n,r){throw"error: calling lost code 467"}}),Object.assign(pa.prototype,{extractAllPoints:function(t){throw"error: calling lost code 468"},extrude:function(t){throw"error: calling lost code 469"},makeGeometry:function(t){throw"error: calling lost code 470"}}),Object.assign(P.prototype,{fromAttribute:function(t,e,n){throw"error: calling lost code 471"},distanceToManhattan:function(t){throw"error: calling lost code 472"},lengthManhattan:function(){throw"error: calling lost code 473"}}),Object.assign(E.prototype,{setEulerFromRotationMatrix:function(){console.error("BAIV3.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("BAIV3.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){throw"error: calling lost code 474"},getScaleFromMatrix:function(t){throw"error: calling lost code 475"},getColumnFromMatrix:function(t,e){throw"error: calling lost code 476"},applyProjection:function(t){throw"error: calling lost code 477"},fromAttribute:function(t,e,n){throw"error: calling lost code 478"},distanceToManhattan:function(t){throw"error: calling lost code 479"},lengthManhattan:function(){throw"error: calling lost code 480"}}),Object.assign(wt.prototype,{fromAttribute:function(t,e,n){throw"error: calling lost code 481"},lengthManhattan:function(){throw"error: calling lost code 482"}}),Object.assign(ce.prototype,{computeTangents:function(){console.error("BAIV3.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("BAIV3.Geometry: .computeLineDistances() has been removed. Use BAIV3.Line.computeLineDistances() instead.")}}),Object.assign(ne.prototype,{getChildByName:function(t){throw"error: calling lost code 483"},renderDepth:function(){console.warn("BAIV3.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){throw"error: calling lost code 484"},getWorldRotation:function(){console.error("BAIV3.Object3D: .getWorldRotation() has been removed. Use BAIV3.Object3D.getWorldQuaternion( target ) instead.")}}),Object.defineProperties(ne.prototype,{eulerOrder:{get:function(){throw"error: calling lost code 485"},set:function(t){throw"error: calling lost code 486"}},useQuaternion:{get:function(){console.warn("BAIV3.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("BAIV3.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.defineProperties(vi.prototype,{objects:{get:function(){throw"error: calling lost code 487"}}}),Object.defineProperty(xi.prototype,"useVertexTexture",{get:function(){console.warn("BAIV3.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("BAIV3.Skeleton: useVertexTexture has been removed.")}}),yi.prototype.initBones=function(){console.error("BAIV3.SkinnedMesh: initBones() has been removed.")},Object.defineProperty($o.prototype,"__arcLengthDivisions",{get:function(){throw"error: calling lost code 488"},set:function(t){throw"error: calling lost code 489"}}),oi.prototype.setLens=function(t,e){throw"error: calling lost code 490"},Object.defineProperties(fa.prototype,{onlyShadow:{set:function(){console.warn("BAIV3.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){throw"error: calling lost code 491"}},shadowCameraLeft:{set:function(t){throw"error: calling lost code 492"}},shadowCameraRight:{set:function(t){throw"error: calling lost code 493"}},shadowCameraTop:{set:function(t){throw"error: calling lost code 494"}},shadowCameraBottom:{set:function(t){throw"error: calling lost code 495"}},shadowCameraNear:{set:function(t){throw"error: calling lost code 496"}},shadowCameraFar:{set:function(t){throw"error: calling lost code 497"}},shadowCameraVisible:{set:function(){console.warn("BAIV3.Light: .shadowCameraVisible has been removed. Use new BAIV3.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){throw"error: calling lost code 498"}},shadowDarkness:{set:function(){console.warn("BAIV3.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){throw"error: calling lost code 499"}},shadowMapHeight:{set:function(t){throw"error: calling lost code 500"}}}),Object.defineProperties(le.prototype,{length:{get:function(){throw"error: calling lost code 501"}},copyIndicesArray:function(){console.error("BAIV3.BufferAttribute: .copyIndicesArray() has been removed.")}}),Object.assign(De.prototype,{addIndex:function(t){throw"error: calling lost code 502"},addDrawCall:function(t,e,n){throw void 0!==n&&console.warn("BAIV3.BufferGeometry: .addDrawCall() no longer supports indexOffset."),"error: calling lost code 503"},clearDrawCalls:function(){throw"error: calling lost code 504"},computeTangents:function(){console.warn("BAIV3.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("BAIV3.BufferGeometry: .computeOffsets() has been removed.")}}),Object.defineProperties(De.prototype,{drawcalls:{get:function(){throw"error: calling lost code 505"}},offsets:{get:function(){throw"error: calling lost code 506"}}}),Object.assign(Ki.prototype,{getArrays:function(){console.error("BAIV3.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("BAIV3.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("BAIV3.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.defineProperties(Cs.prototype,{dynamic:{set:function(){console.warn("BAIV3.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("BAIV3.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(Re.prototype,{wrapAround:{get:function(){console.warn("BAIV3.Material: .wrapAround has been removed.")},set:function(){console.warn("BAIV3.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("BAIV3.Material: .overdraw has been removed.")},set:function(){console.warn("BAIV3.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("BAIV3.Material: .wrapRGB has been removed."),new Ut}},shading:{get:function(){console.error("BAIV3."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){throw"error: calling lost code 507"}}}),Object.defineProperties(_o.prototype,{metal:{get:function(){throw"error: calling lost code 508"},set:function(){console.warn("BAIV3.MeshPhongMaterial: .metal has been removed. Use BAIV3.MeshStandardMaterial instead")}}}),Object.defineProperties(un.prototype,{derivatives:{get:function(){throw"error: calling lost code 509"},set:function(t){throw"error: calling lost code 510"}}}),Object.assign(li.prototype,{clearTarget:function(t,e,n,r){throw"error: calling lost code 511"},animate:function(t){throw"error: calling lost code 512"},getCurrentRenderTarget:function(){throw"error: calling lost code 513"},getMaxAnisotropy:function(){throw"error: calling lost code 514"},getPrecision:function(){throw"error: calling lost code 515"},resetGLState:function(){throw"error: calling lost code 516"},supportsFloatTextures:function(){throw"error: calling lost code 517"},supportsHalfFloatTextures:function(){throw"error: calling lost code 518"},supportsStandardDerivatives:function(){throw"error: calling lost code 519"},supportsCompressedTextureS3TC:function(){throw"error: calling lost code 520"},supportsCompressedTexturePVRTC:function(){throw"error: calling lost code 521"},supportsBlendMinMax:function(){throw"error: calling lost code 522"},supportsVertexTextures:function(){throw"error: calling lost code 523"},supportsInstancedArrays:function(){throw"error: calling lost code 524"},enableScissorTest:function(t){throw"error: calling lost code 525"},initMaterial:function(){console.warn("BAIV3.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("BAIV3.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("BAIV3.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("BAIV3.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("BAIV3.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("BAIV3.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("BAIV3.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("BAIV3.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("BAIV3.WebGLRenderer: .setTextureCube() has been removed.")}}),Object.defineProperties(li.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){throw"error: calling lost code 526"}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){throw"error: calling lost code 527"}},shadowMapCullFace:{get:function(){throw"error: calling lost code 528"},set:function(){console.warn("BAIV3.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties($r.prototype,{cullFace:{get:function(){throw"error: calling lost code 529"},set:function(){console.warn("BAIV3.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){throw"error: calling lost code 530"},set:function(){console.warn("BAIV3.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){throw"error: calling lost code 531"},set:function(){console.warn("BAIV3.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(bt.prototype,{activeCubeFace:{set:function(){console.warn("BAIV3.WebGLRenderTargetCube: .activeCubeFace has been removed. It is now the second parameter of WebGLRenderer.setRenderTarget().")}},activeMipMapLevel:{set:function(){console.warn("BAIV3.WebGLRenderTargetCube: .activeMipMapLevel has been removed. It is now the third parameter of WebGLRenderer.setRenderTarget().")}}}),Object.defineProperties(_t.prototype,{wrapS:{get:function(){throw"error: calling lost code 532"},set:function(t){throw"error: calling lost code 533"}},wrapT:{get:function(){throw"error: calling lost code 534"},set:function(t){throw"error: calling lost code 535"}},magFilter:{get:function(){throw"error: calling lost code 536"},set:function(t){throw"error: calling lost code 537"}},minFilter:{get:function(){throw"error: calling lost code 538"},set:function(t){throw"error: calling lost code 539"}},anisotropy:{get:function(){throw"error: calling lost code 540"},set:function(t){throw"error: calling lost code 541"}},offset:{get:function(){throw"error: calling lost code 542"},set:function(t){throw"error: calling lost code 543"}},repeat:{get:function(){throw"error: calling lost code 544"},set:function(t){throw"error: calling lost code 545"}},format:{get:function(){throw"error: calling lost code 546"},set:function(t){throw"error: calling lost code 547"}},type:{get:function(){throw"error: calling lost code 548"},set:function(t){throw"error: calling lost code 549"}},generateMipmaps:{get:function(){throw"error: calling lost code 550"},set:function(t){throw"error: calling lost code 551"}}}),Object.defineProperties(si.prototype,{standing:{set:function(){console.warn("BAIV3.WebVRManager: .standing has been removed.")}},userHeight:{set:function(){console.warn("BAIV3.WebVRManager: .userHeight has been removed.")}}}),rs.prototype.load=function(t){throw"error: calling lost code 552"},os.prototype.getData=function(){throw"error: calling lost code 553"},ts.prototype.updateCubeMap=function(t,e){throw"error: calling lost code 554"},vt.crossOrigin=void 0,vt.loadTexture=function(t,e,n,r){throw"error: calling lost code 557"},vt.loadTextureCube=function(t,e,n,r){throw"error: calling lost code 558"},vt.loadCompressedTexture=function(){console.error("BAIV3.ImageUtils.loadCompressedTexture has been removed. Use BAIV3.DDSLoader instead.")},vt.loadCompressedTextureCube=function(){console.error("BAIV3.ImageUtils.loadCompressedTextureCube has been removed. Use BAIV3.DDSLoader instead.")};var nc={createMultiMaterialObject:function(){console.error("BAIV3.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},detach:function(){console.error("BAIV3.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},attach:function(){console.error("BAIV3.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")}};t.ACESFilmicToneMapping=5,t.AddEquation=100,t.AddOperation=2,t.AdditiveBlending=2,t.AlphaFormat=1021,t.AlwaysDepth=1,t.AmbientLight=ba,t.AmbientLightProbe=Ka,t.AnimationClip=Go,t.AnimationLoader=qo,t.AnimationObjectGroup=Ps,t.AnimationUtils=Po,t.ArcCurve=ea,t.ArrayCamera=ai,t.ArrowHelper=Qs,t.Audio=rs,t.AudioAnalyser=os,t.AudioContext={getContext:function(){throw"error: calling lost code 295"},setContext:function(t){}},t.AudioListener=ns,t.AudioLoader=Ya,t.AxesHelper=Ks,t.AxisHelper=function(t){throw"error: calling lost code 449"},t.BackSide=1,t.BasicDepthPacking=3200,t.BasicShadowMap=0,t.BinaryTextureLoader=function(t){return console.warn("BAIV3.BinaryTextureLoader has been renamed to BAIV3.DataTextureLoader."),new Zo(t)},t.Bone=wi,t.BooleanKeyframeTrack=Oo,t.Box3=Lt,t.Box3Helper=Js,t.BufferAttribute=le,t.BufferGeometry=De,t.BufferGeometryLoader=Ba,t.ByteType=1010,t.Cache=jo,t.Camera=ii,t.CameraHelper=Zs,t.CanvasRenderer=function(){console.error("BAIV3.CanvasRenderer has been removed")},t.CanvasTexture=Ci,t.CatmullRomCurve3=ra,t.CineonToneMapping=4,t.CircleBufferGeometry=go,t.CircleGeometry=mo,t.ClampToEdgeWrapping=h,t.Clock=es,t.ClosedSplineCurve3=$s,t.Color=Ut,t.ColorKeyframeTrack=Vo,t.CompressedTexture=Pi,t.CompressedTextureLoader=Yo,t.ConeBufferGeometry=fo,t.ConeGeometry=po,t.CubeCamera=ts,t.CubeReflectionMapping=301,t.CubeRefractionMapping=302,t.CubeTexture=An,t.CubeTextureLoader=Qo,t.CubeUVReflectionMapping=306,t.CubeUVRefractionMapping=307,t.CubicBezierCurve=ia,t.CubicBezierCurve3=oa,t.CubicInterpolant=Eo,t.CullFaceBack=1,t.CullFaceFront=2,t.CullFaceFrontBack=3,t.CullFaceNone=0,t.Curve=$o,t.CurvePath=ua,t.CustomBlending=5,t.CylinderBufferGeometry=uo,t.CylinderGeometry=ho,t.Cylindrical=Vs,t.DataTexture=St,t.DataTexture2DArray=Tn,t.DataTexture3D=Pn,t.DataTextureLoader=Zo,t.DefaultLoadingManager=Wo,t.DepthFormat=L,t.DepthStencilFormat=A,t.DepthTexture=Ei,t.DirectionalLight=Ma,t.DirectionalLightHelper=Ys,t.DirectionalLightShadow=_a,t.DiscreteInterpolant=Do,t.DodecahedronBufferGeometry=ki,t.DodecahedronGeometry=ji,t.DoubleSide=2,t.DstAlphaFactor=206,t.DstColorFactor=208,t.DynamicBufferAttribute=function(t,e){throw"error: calling lost code 432"},t.EdgesGeometry=lo,t.EdgesHelper=function(t,e){throw"error: calling lost code 450"},t.EllipseCurve=ta,t.EqualDepth=4,t.EquirectangularReflectionMapping=303,t.EquirectangularRefractionMapping=304,t.Euler=Zt,t.EventDispatcher=e,t.ExtrudeBufferGeometry=Ki,t.ExtrudeGeometry=Qi,t.Face4=function(t,e,n,r,i,o,a){throw"error: calling lost code 422"},t.FaceColors=1,t.FaceNormalsHelper=qs,t.FileLoader=Xo,t.FlatShading=1,t.Float32Attribute=function(t,e){throw"error: calling lost code 440"},t.Float32BufferAttribute=ve,t.Float64Attribute=function(t,e){throw"error: calling lost code 441"},t.Float64BufferAttribute=ye,t.FloatType=w,t.Fog=ui,t.FogExp2=hi,t.Font=Ra,t.FontLoader=Na,t.FrontFaceDirectionCCW=1,t.FrontFaceDirectionCW=0,t.FrontSide=0,t.Frustum=Pt,t.GammaEncoding=3007,t.Geometry=ce,t.GeometryUtils={merge:function(t,e,n){throw"error: calling lost code 555"},center:function(t){throw"error: calling lost code 556"}},t.GreaterDepth=6,t.GreaterEqualDepth=5,t.GridHelper=Ws,t.Group=ri,t.HalfFloatType=_,t.HemisphereLight=ma,t.HemisphereLightHelper=js,t.HemisphereLightProbe=Qa,t.IcosahedronBufferGeometry=Gi,t.IcosahedronGeometry=Fi,t.ImageBitmapLoader=Oa,t.ImageLoader=Jo,t.ImageUtils=vt,t.ImmediateRenderObject=Ns,t.InstancedBufferAttribute=Da,t.InstancedBufferGeometry=Ia,t.InstancedInterleavedBuffer=Es,t.Int16Attribute=function(t,e){throw"error: calling lost code 436"},t.Int16BufferAttribute=pe,t.Int32Attribute=function(t,e){throw"error: calling lost code 438"},t.Int32BufferAttribute=me,t.Int8Attribute=function(t,e){throw"error: calling lost code 433"},t.Int8BufferAttribute=he,t.IntType=1013,t.InterleavedBuffer=pi,t.InterleavedBufferAttribute=fi,t.Interpolant=Co,t.InterpolateDiscrete=2300,t.InterpolateLinear=2301,t.InterpolateSmooth=2302,t.JSONLoader=function(){console.error("BAIV3.JSONLoader has been removed.")},t.KeyframeTrack=Bo,t.LOD=vi,t.LatheBufferGeometry=ao,t.LatheGeometry=oo,t.Layers=Jt,t.LensFlare=function(){console.error("BAIV3.LensFlare has been moved to /examples/js/objects/Lensflare.js")},t.LessDepth=2,t.LessEqualDepth=3,t.Light=fa,t.LightProbe=Ja,t.LightProbeHelper=ks,t.LightShadow=ga,t.Line=Mi,t.Line3=Rs,t.LineBasicMaterial=_i,t.LineCurve=aa,t.LineCurve3=sa,t.LineDashedMaterial=Ao,t.LineLoop=Si,t.LinePieces=1,t.LineSegments=bi,t.LineStrip=0,t.LinearEncoding=3e3,t.LinearFilter=m,t.LinearInterpolant=Io,t.LinearMipMapLinearFilter=g,t.LinearMipMapNearestFilter=1007,t.LinearToneMapping=1,t.Loader=za,t.LoaderUtils=Ea,t.LoadingManager=ko,t.LogLuvEncoding=3003,t.LoopOnce=2200,t.LoopPingPong=2202,t.LoopRepeat=2201,t.LuminanceAlphaFormat=1025,t.LuminanceFormat=1024,t.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2},t.Material=Re,t.MaterialLoader=La,t.Math=T,t.Matrix3=I,t.Matrix4=Ct,t.MaxEquation=c,t.Mesh=mn,t.MeshBasicMaterial=fn,t.MeshDepthMaterial=Qr,t.MeshDistanceMaterial=Kr,t.MeshFaceMaterial=function(t){throw"error: calling lost code 423"},t.MeshLambertMaterial=So,t.MeshMatcapMaterial=Lo,t.MeshNormalMaterial=bo,t.MeshPhongMaterial=_o,t.MeshPhysicalMaterial=wo,t.MeshStandardMaterial=xo,t.MeshToonMaterial=Mo,t.MinEquation=s,t.MirroredRepeatWrapping=u,t.MixOperation=1,t.MultiMaterial=function(t){throw"error: calling lost code 424"},t.MultiplyBlending=4,t.MultiplyOperation=0,t.NearestFilter=d,t.NearestMipMapLinearFilter=f,t.NearestMipMapNearestFilter=p,t.NeverDepth=0,t.NoBlending=0,t.NoColors=0,t.NoToneMapping=0,t.NormalBlending=1,t.NotEqualDepth=7,t.NumberKeyframeTrack=Ro,t.Object3D=ne,t.ObjectSpaceNormalMap=1,t.OctahedronBufferGeometry=Ui,t.OctahedronGeometry=zi,t.OneFactor=201,t.OneMinusDstAlphaFactor=207,t.OneMinusDstColorFactor=209,t.OneMinusSrcAlphaFactor=205,t.OneMinusSrcColorFactor=203,t.OrthographicCamera=wa,t.PCFShadowMap=1,t.PCFSoftShadowMap=2,t.ParametricBufferGeometry=Bi,t.ParametricGeometry=Di,t.Particle=function(t){throw"error: calling lost code 426"},t.ParticleBasicMaterial=function(t){throw"error: calling lost code 429"},t.ParticleSystem=function(t,e){throw"error: calling lost code 427"},t.ParticleSystemMaterial=function(t){throw"error: calling lost code 430"},t.Path=da,t.PerspectiveCamera=oi,t.Plane=Tt,t.PlaneBufferGeometry=Oe,t.PlaneGeometry=Be,t.PointCloud=function(t,e){throw"error: calling lost code 425"},t.PointCloudMaterial=function(t){throw"error: calling lost code 428"},t.PointLight=xa,t.PointLightHelper=Fs,t.Points=Ai,t.PointsMaterial=Li,t.PolarGridHelper=Hs,t.PolyhedronBufferGeometry=Vi,t.PolyhedronGeometry=Oi,t.PositionalAudio=is,t.PositionalAudioHelper=Xs,t.PropertyBinding=Ts,t.PropertyMixer=as,t.QuadraticBezierCurve=ca,t.QuadraticBezierCurve3=la,t.Quaternion=C,t.QuaternionKeyframeTrack=zo,t.QuaternionLinearInterpolant=No,t.REVISION="105",t.RGBADepthPacking=3201,t.RGBAFormat=S,t.RGBA_ASTC_10x10_Format=37819,t.RGBA_ASTC_10x5_Format=37816,t.RGBA_ASTC_10x6_Format=37817,t.RGBA_ASTC_10x8_Format=37818,t.RGBA_ASTC_12x10_Format=37820,t.RGBA_ASTC_12x12_Format=37821,t.RGBA_ASTC_4x4_Format=37808,t.RGBA_ASTC_5x4_Format=37809,t.RGBA_ASTC_5x5_Format=37810,t.RGBA_ASTC_6x5_Format=37811,t.RGBA_ASTC_6x6_Format=37812,t.RGBA_ASTC_8x5_Format=37813,t.RGBA_ASTC_8x6_Format=37814,t.RGBA_ASTC_8x8_Format=37815,t.RGBA_PVRTC_2BPPV1_Format=35843,t.RGBA_PVRTC_4BPPV1_Format=35842,t.RGBA_S3TC_DXT1_Format=33777,t.RGBA_S3TC_DXT3_Format=33778,t.RGBA_S3TC_DXT5_Format=33779,t.RGBDEncoding=3006,t.RGBEEncoding=3002,t.RGBEFormat=1023,t.RGBFormat=b,t.RGBM16Encoding=3005,t.RGBM7Encoding=3004,t.RGB_ETC1_Format=36196,t.RGB_PVRTC_2BPPV1_Format=35841,t.RGB_PVRTC_4BPPV1_Format=35840,t.RGB_S3TC_DXT1_Format=33776,t.RawShaderMaterial=yo,t.Ray=dn,t.Raycaster=Is,t.RectAreaLight=Sa,t.RectAreaLightHelper=Gs,t.RedFormat=1028,t.ReinhardToneMapping=2,t.RepeatWrapping=l,t.ReverseSubtractEquation=102,t.RingBufferGeometry=io,t.RingGeometry=ro,t.Scene=di,t.SceneUtils=nc,t.ShaderChunk=Dt,t.ShaderLib=Xt,t.ShaderMaterial=un,t.ShadowMaterial=vo,t.Shape=pa,t.ShapeBufferGeometry=co,t.ShapeGeometry=so,t.ShapePath=Va,t.ShapeUtils=Ji,t.ShortType=1011,t.Skeleton=xi,t.SkeletonHelper=Us,t.SkinnedMesh=yi,t.SmoothShading=2,t.Sphere=At,t.SphereBufferGeometry=no,t.SphereGeometry=eo,t.Spherical=Os,t.SphericalHarmonics3=Za,t.SphericalReflectionMapping=305,t.Spline=ec,t.SplineCurve=ha,t.SplineCurve3=tc,t.SpotLight=ya,t.SpotLightShadow=va,t.Sprite=gi,t.SpriteMaterial=mi,t.SrcAlphaFactor=204,t.SrcAlphaSaturateFactor=210,t.SrcColorFactor=202,t.StereoCamera=$a,t.StringKeyframeTrack=Uo,t.SubtractEquation=101,t.SubtractiveBlending=3,t.TangentSpaceNormalMap=0,t.TetrahedronBufferGeometry=Ni,t.TetrahedronGeometry=Ri,t.TextBufferGeometry=to,t.TextGeometry=$i,t.Texture=xt,t.TextureLoader=Ko,t.TorusBufferGeometry=Zi,t.TorusGeometry=Yi,t.TorusKnotBufferGeometry=qi,t.TorusKnotGeometry=Xi,t.Triangle=pn,t.TriangleFanDrawMode=2,t.TriangleStripDrawMode=1,t.TrianglesDrawMode=0,t.TubeBufferGeometry=Hi,t.TubeGeometry=Wi,t.UVMapping=300,t.Uint16Attribute=function(t,e){throw"error: calling lost code 437"},t.Uint16BufferAttribute=fe,t.Uint32Attribute=function(t,e){throw"error: calling lost code 439"},t.Uint32BufferAttribute=ge,t.Uint8Attribute=function(t,e){throw"error: calling lost code 434"},t.Uint8BufferAttribute=ue,t.Uint8ClampedAttribute=function(t,e){throw"error: calling lost code 435"},t.Uint8ClampedBufferAttribute=de,t.Uncharted2ToneMapping=3,t.Uniform=Cs,t.UniformsLib=Ht,t.UniformsUtils=zt,t.UnsignedByteType=v,t.UnsignedInt248Type=M,t.UnsignedIntType=x,t.UnsignedShort4444Type=1017,t.UnsignedShort5551Type=1018,t.UnsignedShort565Type=1019,t.UnsignedShortType=y,t.Vector2=P,t.Vector3=E,t.Vector4=wt,t.VectorKeyframeTrack=Fo,t.Vertex=function(t,e,n){throw"error: calling lost code 431"},t.VertexColors=2,t.VertexNormalsHelper=zs,t.VideoTexture=Ti,t.WebGLMultisampleRenderTarget=Mt,t.WebGLRenderTarget=_t,t.WebGLRenderTargetCube=bt,t.WebGLRenderer=li,t.WebGLUtils=ni,t.WireframeGeometry=Ii,t.WireframeHelper=function(t,e){throw"error: calling lost code 451"},t.WrapAroundEnding=2402,t.XHRLoader=function(t){return console.warn("BAIV3.XHRLoader has been renamed to BAIV3.FileLoader."),new Xo(t)},t.ZeroCurvatureEnding=2400,t.ZeroFactor=200,t.ZeroSlopeEnding=2401,t.sRGBEncoding=3001,Object.defineProperty(t,"__esModule",{value:!0})}(this.BAIV3={});